1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct AddressId(pub String);
14impl From<&str> for AddressId {
15 fn from(value: &str) -> Self {
16 Self(value.to_string())
17 }
18}
19impl From<String> for AddressId {
20 fn from(value: String) -> Self {
21 Self(value)
22 }
23}
24impl IntoID<AddressId> for Address {
25 fn into_id(
26 self,
27 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
28 {
29 Box::pin(async move { self.id().await })
30 }
31}
32impl IntoID<AddressId> for AddressId {
33 fn into_id(
34 self,
35 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
36 {
37 Box::pin(async move { Ok::<AddressId, DaggerError>(self) })
38 }
39}
40impl AddressId {
41 fn quote(&self) -> String {
42 format!("\"{}\"", self.0.clone())
43 }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct BindingId(pub String);
47impl From<&str> for BindingId {
48 fn from(value: &str) -> Self {
49 Self(value.to_string())
50 }
51}
52impl From<String> for BindingId {
53 fn from(value: String) -> Self {
54 Self(value)
55 }
56}
57impl IntoID<BindingId> for Binding {
58 fn into_id(
59 self,
60 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
61 {
62 Box::pin(async move { self.id().await })
63 }
64}
65impl IntoID<BindingId> for BindingId {
66 fn into_id(
67 self,
68 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
69 {
70 Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
71 }
72}
73impl BindingId {
74 fn quote(&self) -> String {
75 format!("\"{}\"", self.0.clone())
76 }
77}
78#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
79pub struct CacheVolumeId(pub String);
80impl From<&str> for CacheVolumeId {
81 fn from(value: &str) -> Self {
82 Self(value.to_string())
83 }
84}
85impl From<String> for CacheVolumeId {
86 fn from(value: String) -> Self {
87 Self(value)
88 }
89}
90impl IntoID<CacheVolumeId> for CacheVolume {
91 fn into_id(
92 self,
93 ) -> std::pin::Pin<
94 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
95 > {
96 Box::pin(async move { self.id().await })
97 }
98}
99impl IntoID<CacheVolumeId> for CacheVolumeId {
100 fn into_id(
101 self,
102 ) -> std::pin::Pin<
103 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
104 > {
105 Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
106 }
107}
108impl CacheVolumeId {
109 fn quote(&self) -> String {
110 format!("\"{}\"", self.0.clone())
111 }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ChangesetId(pub String);
115impl From<&str> for ChangesetId {
116 fn from(value: &str) -> Self {
117 Self(value.to_string())
118 }
119}
120impl From<String> for ChangesetId {
121 fn from(value: String) -> Self {
122 Self(value)
123 }
124}
125impl IntoID<ChangesetId> for Changeset {
126 fn into_id(
127 self,
128 ) -> std::pin::Pin<
129 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
130 > {
131 Box::pin(async move { self.id().await })
132 }
133}
134impl IntoID<ChangesetId> for ChangesetId {
135 fn into_id(
136 self,
137 ) -> std::pin::Pin<
138 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
139 > {
140 Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
141 }
142}
143impl ChangesetId {
144 fn quote(&self) -> String {
145 format!("\"{}\"", self.0.clone())
146 }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CloudId(pub String);
150impl From<&str> for CloudId {
151 fn from(value: &str) -> Self {
152 Self(value.to_string())
153 }
154}
155impl From<String> for CloudId {
156 fn from(value: String) -> Self {
157 Self(value)
158 }
159}
160impl IntoID<CloudId> for Cloud {
161 fn into_id(
162 self,
163 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
164 {
165 Box::pin(async move { self.id().await })
166 }
167}
168impl IntoID<CloudId> for CloudId {
169 fn into_id(
170 self,
171 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
172 {
173 Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
174 }
175}
176impl CloudId {
177 fn quote(&self) -> String {
178 format!("\"{}\"", self.0.clone())
179 }
180}
181#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
182pub struct ContainerId(pub String);
183impl From<&str> for ContainerId {
184 fn from(value: &str) -> Self {
185 Self(value.to_string())
186 }
187}
188impl From<String> for ContainerId {
189 fn from(value: String) -> Self {
190 Self(value)
191 }
192}
193impl IntoID<ContainerId> for Container {
194 fn into_id(
195 self,
196 ) -> std::pin::Pin<
197 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
198 > {
199 Box::pin(async move { self.id().await })
200 }
201}
202impl IntoID<ContainerId> for ContainerId {
203 fn into_id(
204 self,
205 ) -> std::pin::Pin<
206 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
207 > {
208 Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
209 }
210}
211impl ContainerId {
212 fn quote(&self) -> String {
213 format!("\"{}\"", self.0.clone())
214 }
215}
216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
217pub struct CurrentModuleId(pub String);
218impl From<&str> for CurrentModuleId {
219 fn from(value: &str) -> Self {
220 Self(value.to_string())
221 }
222}
223impl From<String> for CurrentModuleId {
224 fn from(value: String) -> Self {
225 Self(value)
226 }
227}
228impl IntoID<CurrentModuleId> for CurrentModule {
229 fn into_id(
230 self,
231 ) -> std::pin::Pin<
232 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
233 > {
234 Box::pin(async move { self.id().await })
235 }
236}
237impl IntoID<CurrentModuleId> for CurrentModuleId {
238 fn into_id(
239 self,
240 ) -> std::pin::Pin<
241 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
242 > {
243 Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
244 }
245}
246impl CurrentModuleId {
247 fn quote(&self) -> String {
248 format!("\"{}\"", self.0.clone())
249 }
250}
251#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
252pub struct DirectoryId(pub String);
253impl From<&str> for DirectoryId {
254 fn from(value: &str) -> Self {
255 Self(value.to_string())
256 }
257}
258impl From<String> for DirectoryId {
259 fn from(value: String) -> Self {
260 Self(value)
261 }
262}
263impl IntoID<DirectoryId> for Directory {
264 fn into_id(
265 self,
266 ) -> std::pin::Pin<
267 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
268 > {
269 Box::pin(async move { self.id().await })
270 }
271}
272impl IntoID<DirectoryId> for DirectoryId {
273 fn into_id(
274 self,
275 ) -> std::pin::Pin<
276 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
277 > {
278 Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
279 }
280}
281impl DirectoryId {
282 fn quote(&self) -> String {
283 format!("\"{}\"", self.0.clone())
284 }
285}
286#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
287pub struct EngineCacheEntryId(pub String);
288impl From<&str> for EngineCacheEntryId {
289 fn from(value: &str) -> Self {
290 Self(value.to_string())
291 }
292}
293impl From<String> for EngineCacheEntryId {
294 fn from(value: String) -> Self {
295 Self(value)
296 }
297}
298impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
299 fn into_id(
300 self,
301 ) -> std::pin::Pin<
302 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
303 > {
304 Box::pin(async move { self.id().await })
305 }
306}
307impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
308 fn into_id(
309 self,
310 ) -> std::pin::Pin<
311 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
312 > {
313 Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
314 }
315}
316impl EngineCacheEntryId {
317 fn quote(&self) -> String {
318 format!("\"{}\"", self.0.clone())
319 }
320}
321#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
322pub struct EngineCacheEntrySetId(pub String);
323impl From<&str> for EngineCacheEntrySetId {
324 fn from(value: &str) -> Self {
325 Self(value.to_string())
326 }
327}
328impl From<String> for EngineCacheEntrySetId {
329 fn from(value: String) -> Self {
330 Self(value)
331 }
332}
333impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
334 fn into_id(
335 self,
336 ) -> std::pin::Pin<
337 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
338 > {
339 Box::pin(async move { self.id().await })
340 }
341}
342impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
343 fn into_id(
344 self,
345 ) -> std::pin::Pin<
346 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
347 > {
348 Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
349 }
350}
351impl EngineCacheEntrySetId {
352 fn quote(&self) -> String {
353 format!("\"{}\"", self.0.clone())
354 }
355}
356#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
357pub struct EngineCacheId(pub String);
358impl From<&str> for EngineCacheId {
359 fn from(value: &str) -> Self {
360 Self(value.to_string())
361 }
362}
363impl From<String> for EngineCacheId {
364 fn from(value: String) -> Self {
365 Self(value)
366 }
367}
368impl IntoID<EngineCacheId> for EngineCache {
369 fn into_id(
370 self,
371 ) -> std::pin::Pin<
372 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
373 > {
374 Box::pin(async move { self.id().await })
375 }
376}
377impl IntoID<EngineCacheId> for EngineCacheId {
378 fn into_id(
379 self,
380 ) -> std::pin::Pin<
381 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
382 > {
383 Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
384 }
385}
386impl EngineCacheId {
387 fn quote(&self) -> String {
388 format!("\"{}\"", self.0.clone())
389 }
390}
391#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
392pub struct EngineId(pub String);
393impl From<&str> for EngineId {
394 fn from(value: &str) -> Self {
395 Self(value.to_string())
396 }
397}
398impl From<String> for EngineId {
399 fn from(value: String) -> Self {
400 Self(value)
401 }
402}
403impl IntoID<EngineId> for Engine {
404 fn into_id(
405 self,
406 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
407 {
408 Box::pin(async move { self.id().await })
409 }
410}
411impl IntoID<EngineId> for EngineId {
412 fn into_id(
413 self,
414 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
415 {
416 Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
417 }
418}
419impl EngineId {
420 fn quote(&self) -> String {
421 format!("\"{}\"", self.0.clone())
422 }
423}
424#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
425pub struct EnumTypeDefId(pub String);
426impl From<&str> for EnumTypeDefId {
427 fn from(value: &str) -> Self {
428 Self(value.to_string())
429 }
430}
431impl From<String> for EnumTypeDefId {
432 fn from(value: String) -> Self {
433 Self(value)
434 }
435}
436impl IntoID<EnumTypeDefId> for EnumTypeDef {
437 fn into_id(
438 self,
439 ) -> std::pin::Pin<
440 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
441 > {
442 Box::pin(async move { self.id().await })
443 }
444}
445impl IntoID<EnumTypeDefId> for EnumTypeDefId {
446 fn into_id(
447 self,
448 ) -> std::pin::Pin<
449 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
450 > {
451 Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
452 }
453}
454impl EnumTypeDefId {
455 fn quote(&self) -> String {
456 format!("\"{}\"", self.0.clone())
457 }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EnumValueTypeDefId(pub String);
461impl From<&str> for EnumValueTypeDefId {
462 fn from(value: &str) -> Self {
463 Self(value.to_string())
464 }
465}
466impl From<String> for EnumValueTypeDefId {
467 fn from(value: String) -> Self {
468 Self(value)
469 }
470}
471impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
472 fn into_id(
473 self,
474 ) -> std::pin::Pin<
475 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
476 > {
477 Box::pin(async move { self.id().await })
478 }
479}
480impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
481 fn into_id(
482 self,
483 ) -> std::pin::Pin<
484 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
485 > {
486 Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
487 }
488}
489impl EnumValueTypeDefId {
490 fn quote(&self) -> String {
491 format!("\"{}\"", self.0.clone())
492 }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct EnvFileId(pub String);
496impl From<&str> for EnvFileId {
497 fn from(value: &str) -> Self {
498 Self(value.to_string())
499 }
500}
501impl From<String> for EnvFileId {
502 fn from(value: String) -> Self {
503 Self(value)
504 }
505}
506impl IntoID<EnvFileId> for EnvFile {
507 fn into_id(
508 self,
509 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
510 {
511 Box::pin(async move { self.id().await })
512 }
513}
514impl IntoID<EnvFileId> for EnvFileId {
515 fn into_id(
516 self,
517 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
518 {
519 Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
520 }
521}
522impl EnvFileId {
523 fn quote(&self) -> String {
524 format!("\"{}\"", self.0.clone())
525 }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EnvId(pub String);
529impl From<&str> for EnvId {
530 fn from(value: &str) -> Self {
531 Self(value.to_string())
532 }
533}
534impl From<String> for EnvId {
535 fn from(value: String) -> Self {
536 Self(value)
537 }
538}
539impl IntoID<EnvId> for Env {
540 fn into_id(
541 self,
542 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
543 {
544 Box::pin(async move { self.id().await })
545 }
546}
547impl IntoID<EnvId> for EnvId {
548 fn into_id(
549 self,
550 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
551 {
552 Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
553 }
554}
555impl EnvId {
556 fn quote(&self) -> String {
557 format!("\"{}\"", self.0.clone())
558 }
559}
560#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
561pub struct EnvVariableId(pub String);
562impl From<&str> for EnvVariableId {
563 fn from(value: &str) -> Self {
564 Self(value.to_string())
565 }
566}
567impl From<String> for EnvVariableId {
568 fn from(value: String) -> Self {
569 Self(value)
570 }
571}
572impl IntoID<EnvVariableId> for EnvVariable {
573 fn into_id(
574 self,
575 ) -> std::pin::Pin<
576 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
577 > {
578 Box::pin(async move { self.id().await })
579 }
580}
581impl IntoID<EnvVariableId> for EnvVariableId {
582 fn into_id(
583 self,
584 ) -> std::pin::Pin<
585 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
586 > {
587 Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
588 }
589}
590impl EnvVariableId {
591 fn quote(&self) -> String {
592 format!("\"{}\"", self.0.clone())
593 }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct ErrorId(pub String);
597impl From<&str> for ErrorId {
598 fn from(value: &str) -> Self {
599 Self(value.to_string())
600 }
601}
602impl From<String> for ErrorId {
603 fn from(value: String) -> Self {
604 Self(value)
605 }
606}
607impl IntoID<ErrorId> for Error {
608 fn into_id(
609 self,
610 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
611 {
612 Box::pin(async move { self.id().await })
613 }
614}
615impl IntoID<ErrorId> for ErrorId {
616 fn into_id(
617 self,
618 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
619 {
620 Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
621 }
622}
623impl ErrorId {
624 fn quote(&self) -> String {
625 format!("\"{}\"", self.0.clone())
626 }
627}
628#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
629pub struct ErrorValueId(pub String);
630impl From<&str> for ErrorValueId {
631 fn from(value: &str) -> Self {
632 Self(value.to_string())
633 }
634}
635impl From<String> for ErrorValueId {
636 fn from(value: String) -> Self {
637 Self(value)
638 }
639}
640impl IntoID<ErrorValueId> for ErrorValue {
641 fn into_id(
642 self,
643 ) -> std::pin::Pin<
644 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
645 > {
646 Box::pin(async move { self.id().await })
647 }
648}
649impl IntoID<ErrorValueId> for ErrorValueId {
650 fn into_id(
651 self,
652 ) -> std::pin::Pin<
653 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
654 > {
655 Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
656 }
657}
658impl ErrorValueId {
659 fn quote(&self) -> String {
660 format!("\"{}\"", self.0.clone())
661 }
662}
663#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
664pub struct FieldTypeDefId(pub String);
665impl From<&str> for FieldTypeDefId {
666 fn from(value: &str) -> Self {
667 Self(value.to_string())
668 }
669}
670impl From<String> for FieldTypeDefId {
671 fn from(value: String) -> Self {
672 Self(value)
673 }
674}
675impl IntoID<FieldTypeDefId> for FieldTypeDef {
676 fn into_id(
677 self,
678 ) -> std::pin::Pin<
679 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
680 > {
681 Box::pin(async move { self.id().await })
682 }
683}
684impl IntoID<FieldTypeDefId> for FieldTypeDefId {
685 fn into_id(
686 self,
687 ) -> std::pin::Pin<
688 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
689 > {
690 Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
691 }
692}
693impl FieldTypeDefId {
694 fn quote(&self) -> String {
695 format!("\"{}\"", self.0.clone())
696 }
697}
698#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
699pub struct FileId(pub String);
700impl From<&str> for FileId {
701 fn from(value: &str) -> Self {
702 Self(value.to_string())
703 }
704}
705impl From<String> for FileId {
706 fn from(value: String) -> Self {
707 Self(value)
708 }
709}
710impl IntoID<FileId> for File {
711 fn into_id(
712 self,
713 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
714 {
715 Box::pin(async move { self.id().await })
716 }
717}
718impl IntoID<FileId> for FileId {
719 fn into_id(
720 self,
721 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
722 {
723 Box::pin(async move { Ok::<FileId, DaggerError>(self) })
724 }
725}
726impl FileId {
727 fn quote(&self) -> String {
728 format!("\"{}\"", self.0.clone())
729 }
730}
731#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
732pub struct FunctionArgId(pub String);
733impl From<&str> for FunctionArgId {
734 fn from(value: &str) -> Self {
735 Self(value.to_string())
736 }
737}
738impl From<String> for FunctionArgId {
739 fn from(value: String) -> Self {
740 Self(value)
741 }
742}
743impl IntoID<FunctionArgId> for FunctionArg {
744 fn into_id(
745 self,
746 ) -> std::pin::Pin<
747 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
748 > {
749 Box::pin(async move { self.id().await })
750 }
751}
752impl IntoID<FunctionArgId> for FunctionArgId {
753 fn into_id(
754 self,
755 ) -> std::pin::Pin<
756 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
757 > {
758 Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
759 }
760}
761impl FunctionArgId {
762 fn quote(&self) -> String {
763 format!("\"{}\"", self.0.clone())
764 }
765}
766#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
767pub struct FunctionCallArgValueId(pub String);
768impl From<&str> for FunctionCallArgValueId {
769 fn from(value: &str) -> Self {
770 Self(value.to_string())
771 }
772}
773impl From<String> for FunctionCallArgValueId {
774 fn from(value: String) -> Self {
775 Self(value)
776 }
777}
778impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
779 fn into_id(
780 self,
781 ) -> std::pin::Pin<
782 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
783 > {
784 Box::pin(async move { self.id().await })
785 }
786}
787impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
788 fn into_id(
789 self,
790 ) -> std::pin::Pin<
791 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
792 > {
793 Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
794 }
795}
796impl FunctionCallArgValueId {
797 fn quote(&self) -> String {
798 format!("\"{}\"", self.0.clone())
799 }
800}
801#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
802pub struct FunctionCallId(pub String);
803impl From<&str> for FunctionCallId {
804 fn from(value: &str) -> Self {
805 Self(value.to_string())
806 }
807}
808impl From<String> for FunctionCallId {
809 fn from(value: String) -> Self {
810 Self(value)
811 }
812}
813impl IntoID<FunctionCallId> for FunctionCall {
814 fn into_id(
815 self,
816 ) -> std::pin::Pin<
817 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
818 > {
819 Box::pin(async move { self.id().await })
820 }
821}
822impl IntoID<FunctionCallId> for FunctionCallId {
823 fn into_id(
824 self,
825 ) -> std::pin::Pin<
826 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
827 > {
828 Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
829 }
830}
831impl FunctionCallId {
832 fn quote(&self) -> String {
833 format!("\"{}\"", self.0.clone())
834 }
835}
836#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
837pub struct FunctionId(pub String);
838impl From<&str> for FunctionId {
839 fn from(value: &str) -> Self {
840 Self(value.to_string())
841 }
842}
843impl From<String> for FunctionId {
844 fn from(value: String) -> Self {
845 Self(value)
846 }
847}
848impl IntoID<FunctionId> for Function {
849 fn into_id(
850 self,
851 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
852 {
853 Box::pin(async move { self.id().await })
854 }
855}
856impl IntoID<FunctionId> for FunctionId {
857 fn into_id(
858 self,
859 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
860 {
861 Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
862 }
863}
864impl FunctionId {
865 fn quote(&self) -> String {
866 format!("\"{}\"", self.0.clone())
867 }
868}
869#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
870pub struct GeneratedCodeId(pub String);
871impl From<&str> for GeneratedCodeId {
872 fn from(value: &str) -> Self {
873 Self(value.to_string())
874 }
875}
876impl From<String> for GeneratedCodeId {
877 fn from(value: String) -> Self {
878 Self(value)
879 }
880}
881impl IntoID<GeneratedCodeId> for GeneratedCode {
882 fn into_id(
883 self,
884 ) -> std::pin::Pin<
885 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
886 > {
887 Box::pin(async move { self.id().await })
888 }
889}
890impl IntoID<GeneratedCodeId> for GeneratedCodeId {
891 fn into_id(
892 self,
893 ) -> std::pin::Pin<
894 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
895 > {
896 Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
897 }
898}
899impl GeneratedCodeId {
900 fn quote(&self) -> String {
901 format!("\"{}\"", self.0.clone())
902 }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct GitRefId(pub String);
906impl From<&str> for GitRefId {
907 fn from(value: &str) -> Self {
908 Self(value.to_string())
909 }
910}
911impl From<String> for GitRefId {
912 fn from(value: String) -> Self {
913 Self(value)
914 }
915}
916impl IntoID<GitRefId> for GitRef {
917 fn into_id(
918 self,
919 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
920 {
921 Box::pin(async move { self.id().await })
922 }
923}
924impl IntoID<GitRefId> for GitRefId {
925 fn into_id(
926 self,
927 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
928 {
929 Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
930 }
931}
932impl GitRefId {
933 fn quote(&self) -> String {
934 format!("\"{}\"", self.0.clone())
935 }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct GitRepositoryId(pub String);
939impl From<&str> for GitRepositoryId {
940 fn from(value: &str) -> Self {
941 Self(value.to_string())
942 }
943}
944impl From<String> for GitRepositoryId {
945 fn from(value: String) -> Self {
946 Self(value)
947 }
948}
949impl IntoID<GitRepositoryId> for GitRepository {
950 fn into_id(
951 self,
952 ) -> std::pin::Pin<
953 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
954 > {
955 Box::pin(async move { self.id().await })
956 }
957}
958impl IntoID<GitRepositoryId> for GitRepositoryId {
959 fn into_id(
960 self,
961 ) -> std::pin::Pin<
962 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
963 > {
964 Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
965 }
966}
967impl GitRepositoryId {
968 fn quote(&self) -> String {
969 format!("\"{}\"", self.0.clone())
970 }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct HostId(pub String);
974impl From<&str> for HostId {
975 fn from(value: &str) -> Self {
976 Self(value.to_string())
977 }
978}
979impl From<String> for HostId {
980 fn from(value: String) -> Self {
981 Self(value)
982 }
983}
984impl IntoID<HostId> for Host {
985 fn into_id(
986 self,
987 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
988 {
989 Box::pin(async move { self.id().await })
990 }
991}
992impl IntoID<HostId> for HostId {
993 fn into_id(
994 self,
995 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
996 {
997 Box::pin(async move { Ok::<HostId, DaggerError>(self) })
998 }
999}
1000impl HostId {
1001 fn quote(&self) -> String {
1002 format!("\"{}\"", self.0.clone())
1003 }
1004}
1005#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1006pub struct InputTypeDefId(pub String);
1007impl From<&str> for InputTypeDefId {
1008 fn from(value: &str) -> Self {
1009 Self(value.to_string())
1010 }
1011}
1012impl From<String> for InputTypeDefId {
1013 fn from(value: String) -> Self {
1014 Self(value)
1015 }
1016}
1017impl IntoID<InputTypeDefId> for InputTypeDef {
1018 fn into_id(
1019 self,
1020 ) -> std::pin::Pin<
1021 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1022 > {
1023 Box::pin(async move { self.id().await })
1024 }
1025}
1026impl IntoID<InputTypeDefId> for InputTypeDefId {
1027 fn into_id(
1028 self,
1029 ) -> std::pin::Pin<
1030 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1031 > {
1032 Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1033 }
1034}
1035impl InputTypeDefId {
1036 fn quote(&self) -> String {
1037 format!("\"{}\"", self.0.clone())
1038 }
1039}
1040#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1041pub struct InterfaceTypeDefId(pub String);
1042impl From<&str> for InterfaceTypeDefId {
1043 fn from(value: &str) -> Self {
1044 Self(value.to_string())
1045 }
1046}
1047impl From<String> for InterfaceTypeDefId {
1048 fn from(value: String) -> Self {
1049 Self(value)
1050 }
1051}
1052impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1053 fn into_id(
1054 self,
1055 ) -> std::pin::Pin<
1056 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1057 > {
1058 Box::pin(async move { self.id().await })
1059 }
1060}
1061impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1062 fn into_id(
1063 self,
1064 ) -> std::pin::Pin<
1065 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1066 > {
1067 Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1068 }
1069}
1070impl InterfaceTypeDefId {
1071 fn quote(&self) -> String {
1072 format!("\"{}\"", self.0.clone())
1073 }
1074}
1075#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1076pub struct Json(pub String);
1077impl From<&str> for Json {
1078 fn from(value: &str) -> Self {
1079 Self(value.to_string())
1080 }
1081}
1082impl From<String> for Json {
1083 fn from(value: String) -> Self {
1084 Self(value)
1085 }
1086}
1087impl Json {
1088 fn quote(&self) -> String {
1089 format!("\"{}\"", self.0.clone())
1090 }
1091}
1092#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1093pub struct JsonValueId(pub String);
1094impl From<&str> for JsonValueId {
1095 fn from(value: &str) -> Self {
1096 Self(value.to_string())
1097 }
1098}
1099impl From<String> for JsonValueId {
1100 fn from(value: String) -> Self {
1101 Self(value)
1102 }
1103}
1104impl IntoID<JsonValueId> for JsonValue {
1105 fn into_id(
1106 self,
1107 ) -> std::pin::Pin<
1108 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1109 > {
1110 Box::pin(async move { self.id().await })
1111 }
1112}
1113impl IntoID<JsonValueId> for JsonValueId {
1114 fn into_id(
1115 self,
1116 ) -> std::pin::Pin<
1117 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1118 > {
1119 Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1120 }
1121}
1122impl JsonValueId {
1123 fn quote(&self) -> String {
1124 format!("\"{}\"", self.0.clone())
1125 }
1126}
1127#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1128pub struct Llmid(pub String);
1129impl From<&str> for Llmid {
1130 fn from(value: &str) -> Self {
1131 Self(value.to_string())
1132 }
1133}
1134impl From<String> for Llmid {
1135 fn from(value: String) -> Self {
1136 Self(value)
1137 }
1138}
1139impl IntoID<Llmid> for Llm {
1140 fn into_id(
1141 self,
1142 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1143 {
1144 Box::pin(async move { self.id().await })
1145 }
1146}
1147impl IntoID<Llmid> for Llmid {
1148 fn into_id(
1149 self,
1150 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1151 {
1152 Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1153 }
1154}
1155impl Llmid {
1156 fn quote(&self) -> String {
1157 format!("\"{}\"", self.0.clone())
1158 }
1159}
1160#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1161pub struct LlmTokenUsageId(pub String);
1162impl From<&str> for LlmTokenUsageId {
1163 fn from(value: &str) -> Self {
1164 Self(value.to_string())
1165 }
1166}
1167impl From<String> for LlmTokenUsageId {
1168 fn from(value: String) -> Self {
1169 Self(value)
1170 }
1171}
1172impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1173 fn into_id(
1174 self,
1175 ) -> std::pin::Pin<
1176 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1177 > {
1178 Box::pin(async move { self.id().await })
1179 }
1180}
1181impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1182 fn into_id(
1183 self,
1184 ) -> std::pin::Pin<
1185 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1186 > {
1187 Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1188 }
1189}
1190impl LlmTokenUsageId {
1191 fn quote(&self) -> String {
1192 format!("\"{}\"", self.0.clone())
1193 }
1194}
1195#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1196pub struct LabelId(pub String);
1197impl From<&str> for LabelId {
1198 fn from(value: &str) -> Self {
1199 Self(value.to_string())
1200 }
1201}
1202impl From<String> for LabelId {
1203 fn from(value: String) -> Self {
1204 Self(value)
1205 }
1206}
1207impl IntoID<LabelId> for Label {
1208 fn into_id(
1209 self,
1210 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1211 {
1212 Box::pin(async move { self.id().await })
1213 }
1214}
1215impl IntoID<LabelId> for LabelId {
1216 fn into_id(
1217 self,
1218 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1219 {
1220 Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1221 }
1222}
1223impl LabelId {
1224 fn quote(&self) -> String {
1225 format!("\"{}\"", self.0.clone())
1226 }
1227}
1228#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1229pub struct ListTypeDefId(pub String);
1230impl From<&str> for ListTypeDefId {
1231 fn from(value: &str) -> Self {
1232 Self(value.to_string())
1233 }
1234}
1235impl From<String> for ListTypeDefId {
1236 fn from(value: String) -> Self {
1237 Self(value)
1238 }
1239}
1240impl IntoID<ListTypeDefId> for ListTypeDef {
1241 fn into_id(
1242 self,
1243 ) -> std::pin::Pin<
1244 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1245 > {
1246 Box::pin(async move { self.id().await })
1247 }
1248}
1249impl IntoID<ListTypeDefId> for ListTypeDefId {
1250 fn into_id(
1251 self,
1252 ) -> std::pin::Pin<
1253 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1254 > {
1255 Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1256 }
1257}
1258impl ListTypeDefId {
1259 fn quote(&self) -> String {
1260 format!("\"{}\"", self.0.clone())
1261 }
1262}
1263#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1264pub struct ModuleConfigClientId(pub String);
1265impl From<&str> for ModuleConfigClientId {
1266 fn from(value: &str) -> Self {
1267 Self(value.to_string())
1268 }
1269}
1270impl From<String> for ModuleConfigClientId {
1271 fn from(value: String) -> Self {
1272 Self(value)
1273 }
1274}
1275impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1276 fn into_id(
1277 self,
1278 ) -> std::pin::Pin<
1279 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1280 > {
1281 Box::pin(async move { self.id().await })
1282 }
1283}
1284impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1285 fn into_id(
1286 self,
1287 ) -> std::pin::Pin<
1288 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1289 > {
1290 Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1291 }
1292}
1293impl ModuleConfigClientId {
1294 fn quote(&self) -> String {
1295 format!("\"{}\"", self.0.clone())
1296 }
1297}
1298#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1299pub struct ModuleId(pub String);
1300impl From<&str> for ModuleId {
1301 fn from(value: &str) -> Self {
1302 Self(value.to_string())
1303 }
1304}
1305impl From<String> for ModuleId {
1306 fn from(value: String) -> Self {
1307 Self(value)
1308 }
1309}
1310impl IntoID<ModuleId> for Module {
1311 fn into_id(
1312 self,
1313 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1314 {
1315 Box::pin(async move { self.id().await })
1316 }
1317}
1318impl IntoID<ModuleId> for ModuleId {
1319 fn into_id(
1320 self,
1321 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1322 {
1323 Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1324 }
1325}
1326impl ModuleId {
1327 fn quote(&self) -> String {
1328 format!("\"{}\"", self.0.clone())
1329 }
1330}
1331#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1332pub struct ModuleSourceId(pub String);
1333impl From<&str> for ModuleSourceId {
1334 fn from(value: &str) -> Self {
1335 Self(value.to_string())
1336 }
1337}
1338impl From<String> for ModuleSourceId {
1339 fn from(value: String) -> Self {
1340 Self(value)
1341 }
1342}
1343impl IntoID<ModuleSourceId> for ModuleSource {
1344 fn into_id(
1345 self,
1346 ) -> std::pin::Pin<
1347 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1348 > {
1349 Box::pin(async move { self.id().await })
1350 }
1351}
1352impl IntoID<ModuleSourceId> for ModuleSourceId {
1353 fn into_id(
1354 self,
1355 ) -> std::pin::Pin<
1356 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1357 > {
1358 Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1359 }
1360}
1361impl ModuleSourceId {
1362 fn quote(&self) -> String {
1363 format!("\"{}\"", self.0.clone())
1364 }
1365}
1366#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1367pub struct ObjectTypeDefId(pub String);
1368impl From<&str> for ObjectTypeDefId {
1369 fn from(value: &str) -> Self {
1370 Self(value.to_string())
1371 }
1372}
1373impl From<String> for ObjectTypeDefId {
1374 fn from(value: String) -> Self {
1375 Self(value)
1376 }
1377}
1378impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1379 fn into_id(
1380 self,
1381 ) -> std::pin::Pin<
1382 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1383 > {
1384 Box::pin(async move { self.id().await })
1385 }
1386}
1387impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1388 fn into_id(
1389 self,
1390 ) -> std::pin::Pin<
1391 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1392 > {
1393 Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1394 }
1395}
1396impl ObjectTypeDefId {
1397 fn quote(&self) -> String {
1398 format!("\"{}\"", self.0.clone())
1399 }
1400}
1401#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1402pub struct Platform(pub String);
1403impl From<&str> for Platform {
1404 fn from(value: &str) -> Self {
1405 Self(value.to_string())
1406 }
1407}
1408impl From<String> for Platform {
1409 fn from(value: String) -> Self {
1410 Self(value)
1411 }
1412}
1413impl Platform {
1414 fn quote(&self) -> String {
1415 format!("\"{}\"", self.0.clone())
1416 }
1417}
1418#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1419pub struct PortId(pub String);
1420impl From<&str> for PortId {
1421 fn from(value: &str) -> Self {
1422 Self(value.to_string())
1423 }
1424}
1425impl From<String> for PortId {
1426 fn from(value: String) -> Self {
1427 Self(value)
1428 }
1429}
1430impl IntoID<PortId> for Port {
1431 fn into_id(
1432 self,
1433 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1434 {
1435 Box::pin(async move { self.id().await })
1436 }
1437}
1438impl IntoID<PortId> for PortId {
1439 fn into_id(
1440 self,
1441 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1442 {
1443 Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1444 }
1445}
1446impl PortId {
1447 fn quote(&self) -> String {
1448 format!("\"{}\"", self.0.clone())
1449 }
1450}
1451#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1452pub struct SdkConfigId(pub String);
1453impl From<&str> for SdkConfigId {
1454 fn from(value: &str) -> Self {
1455 Self(value.to_string())
1456 }
1457}
1458impl From<String> for SdkConfigId {
1459 fn from(value: String) -> Self {
1460 Self(value)
1461 }
1462}
1463impl IntoID<SdkConfigId> for SdkConfig {
1464 fn into_id(
1465 self,
1466 ) -> std::pin::Pin<
1467 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1468 > {
1469 Box::pin(async move { self.id().await })
1470 }
1471}
1472impl IntoID<SdkConfigId> for SdkConfigId {
1473 fn into_id(
1474 self,
1475 ) -> std::pin::Pin<
1476 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1477 > {
1478 Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1479 }
1480}
1481impl SdkConfigId {
1482 fn quote(&self) -> String {
1483 format!("\"{}\"", self.0.clone())
1484 }
1485}
1486#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1487pub struct ScalarTypeDefId(pub String);
1488impl From<&str> for ScalarTypeDefId {
1489 fn from(value: &str) -> Self {
1490 Self(value.to_string())
1491 }
1492}
1493impl From<String> for ScalarTypeDefId {
1494 fn from(value: String) -> Self {
1495 Self(value)
1496 }
1497}
1498impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1499 fn into_id(
1500 self,
1501 ) -> std::pin::Pin<
1502 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1503 > {
1504 Box::pin(async move { self.id().await })
1505 }
1506}
1507impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1508 fn into_id(
1509 self,
1510 ) -> std::pin::Pin<
1511 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1512 > {
1513 Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1514 }
1515}
1516impl ScalarTypeDefId {
1517 fn quote(&self) -> String {
1518 format!("\"{}\"", self.0.clone())
1519 }
1520}
1521#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1522pub struct SearchResultId(pub String);
1523impl From<&str> for SearchResultId {
1524 fn from(value: &str) -> Self {
1525 Self(value.to_string())
1526 }
1527}
1528impl From<String> for SearchResultId {
1529 fn from(value: String) -> Self {
1530 Self(value)
1531 }
1532}
1533impl IntoID<SearchResultId> for SearchResult {
1534 fn into_id(
1535 self,
1536 ) -> std::pin::Pin<
1537 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1538 > {
1539 Box::pin(async move { self.id().await })
1540 }
1541}
1542impl IntoID<SearchResultId> for SearchResultId {
1543 fn into_id(
1544 self,
1545 ) -> std::pin::Pin<
1546 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1547 > {
1548 Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1549 }
1550}
1551impl SearchResultId {
1552 fn quote(&self) -> String {
1553 format!("\"{}\"", self.0.clone())
1554 }
1555}
1556#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1557pub struct SearchSubmatchId(pub String);
1558impl From<&str> for SearchSubmatchId {
1559 fn from(value: &str) -> Self {
1560 Self(value.to_string())
1561 }
1562}
1563impl From<String> for SearchSubmatchId {
1564 fn from(value: String) -> Self {
1565 Self(value)
1566 }
1567}
1568impl IntoID<SearchSubmatchId> for SearchSubmatch {
1569 fn into_id(
1570 self,
1571 ) -> std::pin::Pin<
1572 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1573 > {
1574 Box::pin(async move { self.id().await })
1575 }
1576}
1577impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1578 fn into_id(
1579 self,
1580 ) -> std::pin::Pin<
1581 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1582 > {
1583 Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1584 }
1585}
1586impl SearchSubmatchId {
1587 fn quote(&self) -> String {
1588 format!("\"{}\"", self.0.clone())
1589 }
1590}
1591#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1592pub struct SecretId(pub String);
1593impl From<&str> for SecretId {
1594 fn from(value: &str) -> Self {
1595 Self(value.to_string())
1596 }
1597}
1598impl From<String> for SecretId {
1599 fn from(value: String) -> Self {
1600 Self(value)
1601 }
1602}
1603impl IntoID<SecretId> for Secret {
1604 fn into_id(
1605 self,
1606 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1607 {
1608 Box::pin(async move { self.id().await })
1609 }
1610}
1611impl IntoID<SecretId> for SecretId {
1612 fn into_id(
1613 self,
1614 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1615 {
1616 Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1617 }
1618}
1619impl SecretId {
1620 fn quote(&self) -> String {
1621 format!("\"{}\"", self.0.clone())
1622 }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct ServiceId(pub String);
1626impl From<&str> for ServiceId {
1627 fn from(value: &str) -> Self {
1628 Self(value.to_string())
1629 }
1630}
1631impl From<String> for ServiceId {
1632 fn from(value: String) -> Self {
1633 Self(value)
1634 }
1635}
1636impl IntoID<ServiceId> for Service {
1637 fn into_id(
1638 self,
1639 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1640 {
1641 Box::pin(async move { self.id().await })
1642 }
1643}
1644impl IntoID<ServiceId> for ServiceId {
1645 fn into_id(
1646 self,
1647 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1648 {
1649 Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1650 }
1651}
1652impl ServiceId {
1653 fn quote(&self) -> String {
1654 format!("\"{}\"", self.0.clone())
1655 }
1656}
1657#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1658pub struct SocketId(pub String);
1659impl From<&str> for SocketId {
1660 fn from(value: &str) -> Self {
1661 Self(value.to_string())
1662 }
1663}
1664impl From<String> for SocketId {
1665 fn from(value: String) -> Self {
1666 Self(value)
1667 }
1668}
1669impl IntoID<SocketId> for Socket {
1670 fn into_id(
1671 self,
1672 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1673 {
1674 Box::pin(async move { self.id().await })
1675 }
1676}
1677impl IntoID<SocketId> for SocketId {
1678 fn into_id(
1679 self,
1680 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1681 {
1682 Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1683 }
1684}
1685impl SocketId {
1686 fn quote(&self) -> String {
1687 format!("\"{}\"", self.0.clone())
1688 }
1689}
1690#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1691pub struct SourceMapId(pub String);
1692impl From<&str> for SourceMapId {
1693 fn from(value: &str) -> Self {
1694 Self(value.to_string())
1695 }
1696}
1697impl From<String> for SourceMapId {
1698 fn from(value: String) -> Self {
1699 Self(value)
1700 }
1701}
1702impl IntoID<SourceMapId> for SourceMap {
1703 fn into_id(
1704 self,
1705 ) -> std::pin::Pin<
1706 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1707 > {
1708 Box::pin(async move { self.id().await })
1709 }
1710}
1711impl IntoID<SourceMapId> for SourceMapId {
1712 fn into_id(
1713 self,
1714 ) -> std::pin::Pin<
1715 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1716 > {
1717 Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1718 }
1719}
1720impl SourceMapId {
1721 fn quote(&self) -> String {
1722 format!("\"{}\"", self.0.clone())
1723 }
1724}
1725#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1726pub struct TerminalId(pub String);
1727impl From<&str> for TerminalId {
1728 fn from(value: &str) -> Self {
1729 Self(value.to_string())
1730 }
1731}
1732impl From<String> for TerminalId {
1733 fn from(value: String) -> Self {
1734 Self(value)
1735 }
1736}
1737impl IntoID<TerminalId> for Terminal {
1738 fn into_id(
1739 self,
1740 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1741 {
1742 Box::pin(async move { self.id().await })
1743 }
1744}
1745impl IntoID<TerminalId> for TerminalId {
1746 fn into_id(
1747 self,
1748 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1749 {
1750 Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1751 }
1752}
1753impl TerminalId {
1754 fn quote(&self) -> String {
1755 format!("\"{}\"", self.0.clone())
1756 }
1757}
1758#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1759pub struct TypeDefId(pub String);
1760impl From<&str> for TypeDefId {
1761 fn from(value: &str) -> Self {
1762 Self(value.to_string())
1763 }
1764}
1765impl From<String> for TypeDefId {
1766 fn from(value: String) -> Self {
1767 Self(value)
1768 }
1769}
1770impl IntoID<TypeDefId> for TypeDef {
1771 fn into_id(
1772 self,
1773 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1774 {
1775 Box::pin(async move { self.id().await })
1776 }
1777}
1778impl IntoID<TypeDefId> for TypeDefId {
1779 fn into_id(
1780 self,
1781 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1782 {
1783 Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1784 }
1785}
1786impl TypeDefId {
1787 fn quote(&self) -> String {
1788 format!("\"{}\"", self.0.clone())
1789 }
1790}
1791#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1792pub struct Void(pub String);
1793impl From<&str> for Void {
1794 fn from(value: &str) -> Self {
1795 Self(value.to_string())
1796 }
1797}
1798impl From<String> for Void {
1799 fn from(value: String) -> Self {
1800 Self(value)
1801 }
1802}
1803impl Void {
1804 fn quote(&self) -> String {
1805 format!("\"{}\"", self.0.clone())
1806 }
1807}
1808#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1809pub struct BuildArg {
1810 pub name: String,
1811 pub value: String,
1812}
1813#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1814pub struct PipelineLabel {
1815 pub name: String,
1816 pub value: String,
1817}
1818#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1819pub struct PortForward {
1820 pub backend: isize,
1821 pub frontend: isize,
1822 pub protocol: NetworkProtocol,
1823}
1824#[derive(Clone)]
1825pub struct Address {
1826 pub proc: Option<Arc<DaggerSessionProc>>,
1827 pub selection: Selection,
1828 pub graphql_client: DynGraphQLClient,
1829}
1830#[derive(Builder, Debug, PartialEq)]
1831pub struct AddressDirectoryOpts<'a> {
1832 #[builder(setter(into, strip_option), default)]
1833 pub exclude: Option<Vec<&'a str>>,
1834 #[builder(setter(into, strip_option), default)]
1835 pub include: Option<Vec<&'a str>>,
1836 #[builder(setter(into, strip_option), default)]
1837 pub no_cache: Option<bool>,
1838}
1839#[derive(Builder, Debug, PartialEq)]
1840pub struct AddressFileOpts<'a> {
1841 #[builder(setter(into, strip_option), default)]
1842 pub exclude: Option<Vec<&'a str>>,
1843 #[builder(setter(into, strip_option), default)]
1844 pub include: Option<Vec<&'a str>>,
1845 #[builder(setter(into, strip_option), default)]
1846 pub no_cache: Option<bool>,
1847}
1848impl Address {
1849 pub fn container(&self) -> Container {
1851 let query = self.selection.select("container");
1852 Container {
1853 proc: self.proc.clone(),
1854 selection: query,
1855 graphql_client: self.graphql_client.clone(),
1856 }
1857 }
1858 pub fn directory(&self) -> Directory {
1864 let query = self.selection.select("directory");
1865 Directory {
1866 proc: self.proc.clone(),
1867 selection: query,
1868 graphql_client: self.graphql_client.clone(),
1869 }
1870 }
1871 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
1877 let mut query = self.selection.select("directory");
1878 if let Some(exclude) = opts.exclude {
1879 query = query.arg("exclude", exclude);
1880 }
1881 if let Some(include) = opts.include {
1882 query = query.arg("include", include);
1883 }
1884 if let Some(no_cache) = opts.no_cache {
1885 query = query.arg("noCache", no_cache);
1886 }
1887 Directory {
1888 proc: self.proc.clone(),
1889 selection: query,
1890 graphql_client: self.graphql_client.clone(),
1891 }
1892 }
1893 pub fn file(&self) -> File {
1899 let query = self.selection.select("file");
1900 File {
1901 proc: self.proc.clone(),
1902 selection: query,
1903 graphql_client: self.graphql_client.clone(),
1904 }
1905 }
1906 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
1912 let mut query = self.selection.select("file");
1913 if let Some(exclude) = opts.exclude {
1914 query = query.arg("exclude", exclude);
1915 }
1916 if let Some(include) = opts.include {
1917 query = query.arg("include", include);
1918 }
1919 if let Some(no_cache) = opts.no_cache {
1920 query = query.arg("noCache", no_cache);
1921 }
1922 File {
1923 proc: self.proc.clone(),
1924 selection: query,
1925 graphql_client: self.graphql_client.clone(),
1926 }
1927 }
1928 pub fn git_ref(&self) -> GitRef {
1930 let query = self.selection.select("gitRef");
1931 GitRef {
1932 proc: self.proc.clone(),
1933 selection: query,
1934 graphql_client: self.graphql_client.clone(),
1935 }
1936 }
1937 pub fn git_repository(&self) -> GitRepository {
1939 let query = self.selection.select("gitRepository");
1940 GitRepository {
1941 proc: self.proc.clone(),
1942 selection: query,
1943 graphql_client: self.graphql_client.clone(),
1944 }
1945 }
1946 pub async fn id(&self) -> Result<AddressId, DaggerError> {
1948 let query = self.selection.select("id");
1949 query.execute(self.graphql_client.clone()).await
1950 }
1951 pub fn secret(&self) -> Secret {
1953 let query = self.selection.select("secret");
1954 Secret {
1955 proc: self.proc.clone(),
1956 selection: query,
1957 graphql_client: self.graphql_client.clone(),
1958 }
1959 }
1960 pub fn service(&self) -> Service {
1962 let query = self.selection.select("service");
1963 Service {
1964 proc: self.proc.clone(),
1965 selection: query,
1966 graphql_client: self.graphql_client.clone(),
1967 }
1968 }
1969 pub fn socket(&self) -> Socket {
1971 let query = self.selection.select("socket");
1972 Socket {
1973 proc: self.proc.clone(),
1974 selection: query,
1975 graphql_client: self.graphql_client.clone(),
1976 }
1977 }
1978 pub async fn value(&self) -> Result<String, DaggerError> {
1980 let query = self.selection.select("value");
1981 query.execute(self.graphql_client.clone()).await
1982 }
1983}
1984#[derive(Clone)]
1985pub struct Binding {
1986 pub proc: Option<Arc<DaggerSessionProc>>,
1987 pub selection: Selection,
1988 pub graphql_client: DynGraphQLClient,
1989}
1990impl Binding {
1991 pub fn as_address(&self) -> Address {
1993 let query = self.selection.select("asAddress");
1994 Address {
1995 proc: self.proc.clone(),
1996 selection: query,
1997 graphql_client: self.graphql_client.clone(),
1998 }
1999 }
2000 pub fn as_cache_volume(&self) -> CacheVolume {
2002 let query = self.selection.select("asCacheVolume");
2003 CacheVolume {
2004 proc: self.proc.clone(),
2005 selection: query,
2006 graphql_client: self.graphql_client.clone(),
2007 }
2008 }
2009 pub fn as_changeset(&self) -> Changeset {
2011 let query = self.selection.select("asChangeset");
2012 Changeset {
2013 proc: self.proc.clone(),
2014 selection: query,
2015 graphql_client: self.graphql_client.clone(),
2016 }
2017 }
2018 pub fn as_cloud(&self) -> Cloud {
2020 let query = self.selection.select("asCloud");
2021 Cloud {
2022 proc: self.proc.clone(),
2023 selection: query,
2024 graphql_client: self.graphql_client.clone(),
2025 }
2026 }
2027 pub fn as_container(&self) -> Container {
2029 let query = self.selection.select("asContainer");
2030 Container {
2031 proc: self.proc.clone(),
2032 selection: query,
2033 graphql_client: self.graphql_client.clone(),
2034 }
2035 }
2036 pub fn as_directory(&self) -> Directory {
2038 let query = self.selection.select("asDirectory");
2039 Directory {
2040 proc: self.proc.clone(),
2041 selection: query,
2042 graphql_client: self.graphql_client.clone(),
2043 }
2044 }
2045 pub fn as_env(&self) -> Env {
2047 let query = self.selection.select("asEnv");
2048 Env {
2049 proc: self.proc.clone(),
2050 selection: query,
2051 graphql_client: self.graphql_client.clone(),
2052 }
2053 }
2054 pub fn as_env_file(&self) -> EnvFile {
2056 let query = self.selection.select("asEnvFile");
2057 EnvFile {
2058 proc: self.proc.clone(),
2059 selection: query,
2060 graphql_client: self.graphql_client.clone(),
2061 }
2062 }
2063 pub fn as_file(&self) -> File {
2065 let query = self.selection.select("asFile");
2066 File {
2067 proc: self.proc.clone(),
2068 selection: query,
2069 graphql_client: self.graphql_client.clone(),
2070 }
2071 }
2072 pub fn as_git_ref(&self) -> GitRef {
2074 let query = self.selection.select("asGitRef");
2075 GitRef {
2076 proc: self.proc.clone(),
2077 selection: query,
2078 graphql_client: self.graphql_client.clone(),
2079 }
2080 }
2081 pub fn as_git_repository(&self) -> GitRepository {
2083 let query = self.selection.select("asGitRepository");
2084 GitRepository {
2085 proc: self.proc.clone(),
2086 selection: query,
2087 graphql_client: self.graphql_client.clone(),
2088 }
2089 }
2090 pub fn as_json_value(&self) -> JsonValue {
2092 let query = self.selection.select("asJSONValue");
2093 JsonValue {
2094 proc: self.proc.clone(),
2095 selection: query,
2096 graphql_client: self.graphql_client.clone(),
2097 }
2098 }
2099 pub fn as_module(&self) -> Module {
2101 let query = self.selection.select("asModule");
2102 Module {
2103 proc: self.proc.clone(),
2104 selection: query,
2105 graphql_client: self.graphql_client.clone(),
2106 }
2107 }
2108 pub fn as_module_config_client(&self) -> ModuleConfigClient {
2110 let query = self.selection.select("asModuleConfigClient");
2111 ModuleConfigClient {
2112 proc: self.proc.clone(),
2113 selection: query,
2114 graphql_client: self.graphql_client.clone(),
2115 }
2116 }
2117 pub fn as_module_source(&self) -> ModuleSource {
2119 let query = self.selection.select("asModuleSource");
2120 ModuleSource {
2121 proc: self.proc.clone(),
2122 selection: query,
2123 graphql_client: self.graphql_client.clone(),
2124 }
2125 }
2126 pub fn as_search_result(&self) -> SearchResult {
2128 let query = self.selection.select("asSearchResult");
2129 SearchResult {
2130 proc: self.proc.clone(),
2131 selection: query,
2132 graphql_client: self.graphql_client.clone(),
2133 }
2134 }
2135 pub fn as_search_submatch(&self) -> SearchSubmatch {
2137 let query = self.selection.select("asSearchSubmatch");
2138 SearchSubmatch {
2139 proc: self.proc.clone(),
2140 selection: query,
2141 graphql_client: self.graphql_client.clone(),
2142 }
2143 }
2144 pub fn as_secret(&self) -> Secret {
2146 let query = self.selection.select("asSecret");
2147 Secret {
2148 proc: self.proc.clone(),
2149 selection: query,
2150 graphql_client: self.graphql_client.clone(),
2151 }
2152 }
2153 pub fn as_service(&self) -> Service {
2155 let query = self.selection.select("asService");
2156 Service {
2157 proc: self.proc.clone(),
2158 selection: query,
2159 graphql_client: self.graphql_client.clone(),
2160 }
2161 }
2162 pub fn as_socket(&self) -> Socket {
2164 let query = self.selection.select("asSocket");
2165 Socket {
2166 proc: self.proc.clone(),
2167 selection: query,
2168 graphql_client: self.graphql_client.clone(),
2169 }
2170 }
2171 pub async fn as_string(&self) -> Result<String, DaggerError> {
2173 let query = self.selection.select("asString");
2174 query.execute(self.graphql_client.clone()).await
2175 }
2176 pub async fn digest(&self) -> Result<String, DaggerError> {
2178 let query = self.selection.select("digest");
2179 query.execute(self.graphql_client.clone()).await
2180 }
2181 pub async fn id(&self) -> Result<BindingId, DaggerError> {
2183 let query = self.selection.select("id");
2184 query.execute(self.graphql_client.clone()).await
2185 }
2186 pub async fn is_null(&self) -> Result<bool, DaggerError> {
2188 let query = self.selection.select("isNull");
2189 query.execute(self.graphql_client.clone()).await
2190 }
2191 pub async fn name(&self) -> Result<String, DaggerError> {
2193 let query = self.selection.select("name");
2194 query.execute(self.graphql_client.clone()).await
2195 }
2196 pub async fn type_name(&self) -> Result<String, DaggerError> {
2198 let query = self.selection.select("typeName");
2199 query.execute(self.graphql_client.clone()).await
2200 }
2201}
2202#[derive(Clone)]
2203pub struct CacheVolume {
2204 pub proc: Option<Arc<DaggerSessionProc>>,
2205 pub selection: Selection,
2206 pub graphql_client: DynGraphQLClient,
2207}
2208impl CacheVolume {
2209 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2211 let query = self.selection.select("id");
2212 query.execute(self.graphql_client.clone()).await
2213 }
2214}
2215#[derive(Clone)]
2216pub struct Changeset {
2217 pub proc: Option<Arc<DaggerSessionProc>>,
2218 pub selection: Selection,
2219 pub graphql_client: DynGraphQLClient,
2220}
2221impl Changeset {
2222 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2224 let query = self.selection.select("addedPaths");
2225 query.execute(self.graphql_client.clone()).await
2226 }
2227 pub fn after(&self) -> Directory {
2229 let query = self.selection.select("after");
2230 Directory {
2231 proc: self.proc.clone(),
2232 selection: query,
2233 graphql_client: self.graphql_client.clone(),
2234 }
2235 }
2236 pub fn as_patch(&self) -> File {
2238 let query = self.selection.select("asPatch");
2239 File {
2240 proc: self.proc.clone(),
2241 selection: query,
2242 graphql_client: self.graphql_client.clone(),
2243 }
2244 }
2245 pub fn before(&self) -> Directory {
2247 let query = self.selection.select("before");
2248 Directory {
2249 proc: self.proc.clone(),
2250 selection: query,
2251 graphql_client: self.graphql_client.clone(),
2252 }
2253 }
2254 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2260 let mut query = self.selection.select("export");
2261 query = query.arg("path", path.into());
2262 query.execute(self.graphql_client.clone()).await
2263 }
2264 pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2266 let query = self.selection.select("id");
2267 query.execute(self.graphql_client.clone()).await
2268 }
2269 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2271 let query = self.selection.select("isEmpty");
2272 query.execute(self.graphql_client.clone()).await
2273 }
2274 pub fn layer(&self) -> Directory {
2276 let query = self.selection.select("layer");
2277 Directory {
2278 proc: self.proc.clone(),
2279 selection: query,
2280 graphql_client: self.graphql_client.clone(),
2281 }
2282 }
2283 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2285 let query = self.selection.select("modifiedPaths");
2286 query.execute(self.graphql_client.clone()).await
2287 }
2288 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2290 let query = self.selection.select("removedPaths");
2291 query.execute(self.graphql_client.clone()).await
2292 }
2293 pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2295 let query = self.selection.select("sync");
2296 query.execute(self.graphql_client.clone()).await
2297 }
2298}
2299#[derive(Clone)]
2300pub struct Cloud {
2301 pub proc: Option<Arc<DaggerSessionProc>>,
2302 pub selection: Selection,
2303 pub graphql_client: DynGraphQLClient,
2304}
2305impl Cloud {
2306 pub async fn id(&self) -> Result<CloudId, DaggerError> {
2308 let query = self.selection.select("id");
2309 query.execute(self.graphql_client.clone()).await
2310 }
2311 pub async fn trace_url(&self) -> Result<String, DaggerError> {
2313 let query = self.selection.select("traceURL");
2314 query.execute(self.graphql_client.clone()).await
2315 }
2316}
2317#[derive(Clone)]
2318pub struct Container {
2319 pub proc: Option<Arc<DaggerSessionProc>>,
2320 pub selection: Selection,
2321 pub graphql_client: DynGraphQLClient,
2322}
2323#[derive(Builder, Debug, PartialEq)]
2324pub struct ContainerAsServiceOpts<'a> {
2325 #[builder(setter(into, strip_option), default)]
2328 pub args: Option<Vec<&'a str>>,
2329 #[builder(setter(into, strip_option), default)]
2331 pub expand: Option<bool>,
2332 #[builder(setter(into, strip_option), default)]
2334 pub experimental_privileged_nesting: Option<bool>,
2335 #[builder(setter(into, strip_option), default)]
2337 pub insecure_root_capabilities: Option<bool>,
2338 #[builder(setter(into, strip_option), default)]
2341 pub no_init: Option<bool>,
2342 #[builder(setter(into, strip_option), default)]
2344 pub use_entrypoint: Option<bool>,
2345}
2346#[derive(Builder, Debug, PartialEq)]
2347pub struct ContainerAsTarballOpts {
2348 #[builder(setter(into, strip_option), default)]
2351 pub forced_compression: Option<ImageLayerCompression>,
2352 #[builder(setter(into, strip_option), default)]
2355 pub media_types: Option<ImageMediaTypes>,
2356 #[builder(setter(into, strip_option), default)]
2359 pub platform_variants: Option<Vec<ContainerId>>,
2360}
2361#[derive(Builder, Debug, PartialEq)]
2362pub struct ContainerDirectoryOpts {
2363 #[builder(setter(into, strip_option), default)]
2365 pub expand: Option<bool>,
2366}
2367#[derive(Builder, Debug, PartialEq)]
2368pub struct ContainerExistsOpts {
2369 #[builder(setter(into, strip_option), default)]
2371 pub do_not_follow_symlinks: Option<bool>,
2372 #[builder(setter(into, strip_option), default)]
2374 pub expected_type: Option<ExistsType>,
2375}
2376#[derive(Builder, Debug, PartialEq)]
2377pub struct ContainerExportOpts {
2378 #[builder(setter(into, strip_option), default)]
2380 pub expand: Option<bool>,
2381 #[builder(setter(into, strip_option), default)]
2384 pub forced_compression: Option<ImageLayerCompression>,
2385 #[builder(setter(into, strip_option), default)]
2388 pub media_types: Option<ImageMediaTypes>,
2389 #[builder(setter(into, strip_option), default)]
2392 pub platform_variants: Option<Vec<ContainerId>>,
2393}
2394#[derive(Builder, Debug, PartialEq)]
2395pub struct ContainerExportImageOpts {
2396 #[builder(setter(into, strip_option), default)]
2399 pub forced_compression: Option<ImageLayerCompression>,
2400 #[builder(setter(into, strip_option), default)]
2403 pub media_types: Option<ImageMediaTypes>,
2404 #[builder(setter(into, strip_option), default)]
2407 pub platform_variants: Option<Vec<ContainerId>>,
2408}
2409#[derive(Builder, Debug, PartialEq)]
2410pub struct ContainerFileOpts {
2411 #[builder(setter(into, strip_option), default)]
2413 pub expand: Option<bool>,
2414}
2415#[derive(Builder, Debug, PartialEq)]
2416pub struct ContainerImportOpts<'a> {
2417 #[builder(setter(into, strip_option), default)]
2419 pub tag: Option<&'a str>,
2420}
2421#[derive(Builder, Debug, PartialEq)]
2422pub struct ContainerPublishOpts {
2423 #[builder(setter(into, strip_option), default)]
2426 pub forced_compression: Option<ImageLayerCompression>,
2427 #[builder(setter(into, strip_option), default)]
2430 pub media_types: Option<ImageMediaTypes>,
2431 #[builder(setter(into, strip_option), default)]
2434 pub platform_variants: Option<Vec<ContainerId>>,
2435}
2436#[derive(Builder, Debug, PartialEq)]
2437pub struct ContainerTerminalOpts<'a> {
2438 #[builder(setter(into, strip_option), default)]
2440 pub cmd: Option<Vec<&'a str>>,
2441 #[builder(setter(into, strip_option), default)]
2443 pub experimental_privileged_nesting: Option<bool>,
2444 #[builder(setter(into, strip_option), default)]
2446 pub insecure_root_capabilities: Option<bool>,
2447}
2448#[derive(Builder, Debug, PartialEq)]
2449pub struct ContainerUpOpts<'a> {
2450 #[builder(setter(into, strip_option), default)]
2453 pub args: Option<Vec<&'a str>>,
2454 #[builder(setter(into, strip_option), default)]
2456 pub expand: Option<bool>,
2457 #[builder(setter(into, strip_option), default)]
2459 pub experimental_privileged_nesting: Option<bool>,
2460 #[builder(setter(into, strip_option), default)]
2462 pub insecure_root_capabilities: Option<bool>,
2463 #[builder(setter(into, strip_option), default)]
2466 pub no_init: Option<bool>,
2467 #[builder(setter(into, strip_option), default)]
2470 pub ports: Option<Vec<PortForward>>,
2471 #[builder(setter(into, strip_option), default)]
2473 pub random: Option<bool>,
2474 #[builder(setter(into, strip_option), default)]
2476 pub use_entrypoint: Option<bool>,
2477}
2478#[derive(Builder, Debug, PartialEq)]
2479pub struct ContainerWithDefaultTerminalCmdOpts {
2480 #[builder(setter(into, strip_option), default)]
2482 pub experimental_privileged_nesting: Option<bool>,
2483 #[builder(setter(into, strip_option), default)]
2485 pub insecure_root_capabilities: Option<bool>,
2486}
2487#[derive(Builder, Debug, PartialEq)]
2488pub struct ContainerWithDirectoryOpts<'a> {
2489 #[builder(setter(into, strip_option), default)]
2491 pub exclude: Option<Vec<&'a str>>,
2492 #[builder(setter(into, strip_option), default)]
2494 pub expand: Option<bool>,
2495 #[builder(setter(into, strip_option), default)]
2497 pub include: Option<Vec<&'a str>>,
2498 #[builder(setter(into, strip_option), default)]
2502 pub owner: Option<&'a str>,
2503}
2504#[derive(Builder, Debug, PartialEq)]
2505pub struct ContainerWithEntrypointOpts {
2506 #[builder(setter(into, strip_option), default)]
2508 pub keep_default_args: Option<bool>,
2509}
2510#[derive(Builder, Debug, PartialEq)]
2511pub struct ContainerWithEnvVariableOpts {
2512 #[builder(setter(into, strip_option), default)]
2514 pub expand: Option<bool>,
2515}
2516#[derive(Builder, Debug, PartialEq)]
2517pub struct ContainerWithExecOpts<'a> {
2518 #[builder(setter(into, strip_option), default)]
2520 pub expand: Option<bool>,
2521 #[builder(setter(into, strip_option), default)]
2523 pub expect: Option<ReturnType>,
2524 #[builder(setter(into, strip_option), default)]
2526 pub experimental_privileged_nesting: Option<bool>,
2527 #[builder(setter(into, strip_option), default)]
2530 pub insecure_root_capabilities: Option<bool>,
2531 #[builder(setter(into, strip_option), default)]
2534 pub no_init: Option<bool>,
2535 #[builder(setter(into, strip_option), default)]
2537 pub redirect_stderr: Option<&'a str>,
2538 #[builder(setter(into, strip_option), default)]
2540 pub redirect_stdin: Option<&'a str>,
2541 #[builder(setter(into, strip_option), default)]
2543 pub redirect_stdout: Option<&'a str>,
2544 #[builder(setter(into, strip_option), default)]
2546 pub stdin: Option<&'a str>,
2547 #[builder(setter(into, strip_option), default)]
2549 pub use_entrypoint: Option<bool>,
2550}
2551#[derive(Builder, Debug, PartialEq)]
2552pub struct ContainerWithExposedPortOpts<'a> {
2553 #[builder(setter(into, strip_option), default)]
2555 pub description: Option<&'a str>,
2556 #[builder(setter(into, strip_option), default)]
2558 pub experimental_skip_healthcheck: Option<bool>,
2559 #[builder(setter(into, strip_option), default)]
2561 pub protocol: Option<NetworkProtocol>,
2562}
2563#[derive(Builder, Debug, PartialEq)]
2564pub struct ContainerWithFileOpts<'a> {
2565 #[builder(setter(into, strip_option), default)]
2567 pub expand: Option<bool>,
2568 #[builder(setter(into, strip_option), default)]
2572 pub owner: Option<&'a str>,
2573 #[builder(setter(into, strip_option), default)]
2575 pub permissions: Option<isize>,
2576}
2577#[derive(Builder, Debug, PartialEq)]
2578pub struct ContainerWithFilesOpts<'a> {
2579 #[builder(setter(into, strip_option), default)]
2581 pub expand: Option<bool>,
2582 #[builder(setter(into, strip_option), default)]
2586 pub owner: Option<&'a str>,
2587 #[builder(setter(into, strip_option), default)]
2589 pub permissions: Option<isize>,
2590}
2591#[derive(Builder, Debug, PartialEq)]
2592pub struct ContainerWithMountedCacheOpts<'a> {
2593 #[builder(setter(into, strip_option), default)]
2595 pub expand: Option<bool>,
2596 #[builder(setter(into, strip_option), default)]
2601 pub owner: Option<&'a str>,
2602 #[builder(setter(into, strip_option), default)]
2604 pub sharing: Option<CacheSharingMode>,
2605 #[builder(setter(into, strip_option), default)]
2607 pub source: Option<DirectoryId>,
2608}
2609#[derive(Builder, Debug, PartialEq)]
2610pub struct ContainerWithMountedDirectoryOpts<'a> {
2611 #[builder(setter(into, strip_option), default)]
2613 pub expand: Option<bool>,
2614 #[builder(setter(into, strip_option), default)]
2618 pub owner: Option<&'a str>,
2619}
2620#[derive(Builder, Debug, PartialEq)]
2621pub struct ContainerWithMountedFileOpts<'a> {
2622 #[builder(setter(into, strip_option), default)]
2624 pub expand: Option<bool>,
2625 #[builder(setter(into, strip_option), default)]
2629 pub owner: Option<&'a str>,
2630}
2631#[derive(Builder, Debug, PartialEq)]
2632pub struct ContainerWithMountedSecretOpts<'a> {
2633 #[builder(setter(into, strip_option), default)]
2635 pub expand: Option<bool>,
2636 #[builder(setter(into, strip_option), default)]
2639 pub mode: Option<isize>,
2640 #[builder(setter(into, strip_option), default)]
2644 pub owner: Option<&'a str>,
2645}
2646#[derive(Builder, Debug, PartialEq)]
2647pub struct ContainerWithMountedTempOpts {
2648 #[builder(setter(into, strip_option), default)]
2650 pub expand: Option<bool>,
2651 #[builder(setter(into, strip_option), default)]
2653 pub size: Option<isize>,
2654}
2655#[derive(Builder, Debug, PartialEq)]
2656pub struct ContainerWithNewFileOpts<'a> {
2657 #[builder(setter(into, strip_option), default)]
2659 pub expand: Option<bool>,
2660 #[builder(setter(into, strip_option), default)]
2664 pub owner: Option<&'a str>,
2665 #[builder(setter(into, strip_option), default)]
2667 pub permissions: Option<isize>,
2668}
2669#[derive(Builder, Debug, PartialEq)]
2670pub struct ContainerWithSymlinkOpts {
2671 #[builder(setter(into, strip_option), default)]
2673 pub expand: Option<bool>,
2674}
2675#[derive(Builder, Debug, PartialEq)]
2676pub struct ContainerWithUnixSocketOpts<'a> {
2677 #[builder(setter(into, strip_option), default)]
2679 pub expand: Option<bool>,
2680 #[builder(setter(into, strip_option), default)]
2684 pub owner: Option<&'a str>,
2685}
2686#[derive(Builder, Debug, PartialEq)]
2687pub struct ContainerWithWorkdirOpts {
2688 #[builder(setter(into, strip_option), default)]
2690 pub expand: Option<bool>,
2691}
2692#[derive(Builder, Debug, PartialEq)]
2693pub struct ContainerWithoutDirectoryOpts {
2694 #[builder(setter(into, strip_option), default)]
2696 pub expand: Option<bool>,
2697}
2698#[derive(Builder, Debug, PartialEq)]
2699pub struct ContainerWithoutEntrypointOpts {
2700 #[builder(setter(into, strip_option), default)]
2702 pub keep_default_args: Option<bool>,
2703}
2704#[derive(Builder, Debug, PartialEq)]
2705pub struct ContainerWithoutExposedPortOpts {
2706 #[builder(setter(into, strip_option), default)]
2708 pub protocol: Option<NetworkProtocol>,
2709}
2710#[derive(Builder, Debug, PartialEq)]
2711pub struct ContainerWithoutFileOpts {
2712 #[builder(setter(into, strip_option), default)]
2714 pub expand: Option<bool>,
2715}
2716#[derive(Builder, Debug, PartialEq)]
2717pub struct ContainerWithoutFilesOpts {
2718 #[builder(setter(into, strip_option), default)]
2720 pub expand: Option<bool>,
2721}
2722#[derive(Builder, Debug, PartialEq)]
2723pub struct ContainerWithoutMountOpts {
2724 #[builder(setter(into, strip_option), default)]
2726 pub expand: Option<bool>,
2727}
2728#[derive(Builder, Debug, PartialEq)]
2729pub struct ContainerWithoutUnixSocketOpts {
2730 #[builder(setter(into, strip_option), default)]
2732 pub expand: Option<bool>,
2733}
2734impl Container {
2735 pub fn as_service(&self) -> Service {
2742 let query = self.selection.select("asService");
2743 Service {
2744 proc: self.proc.clone(),
2745 selection: query,
2746 graphql_client: self.graphql_client.clone(),
2747 }
2748 }
2749 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2756 let mut query = self.selection.select("asService");
2757 if let Some(args) = opts.args {
2758 query = query.arg("args", args);
2759 }
2760 if let Some(use_entrypoint) = opts.use_entrypoint {
2761 query = query.arg("useEntrypoint", use_entrypoint);
2762 }
2763 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2764 query = query.arg(
2765 "experimentalPrivilegedNesting",
2766 experimental_privileged_nesting,
2767 );
2768 }
2769 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2770 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2771 }
2772 if let Some(expand) = opts.expand {
2773 query = query.arg("expand", expand);
2774 }
2775 if let Some(no_init) = opts.no_init {
2776 query = query.arg("noInit", no_init);
2777 }
2778 Service {
2779 proc: self.proc.clone(),
2780 selection: query,
2781 graphql_client: self.graphql_client.clone(),
2782 }
2783 }
2784 pub fn as_tarball(&self) -> File {
2790 let query = self.selection.select("asTarball");
2791 File {
2792 proc: self.proc.clone(),
2793 selection: query,
2794 graphql_client: self.graphql_client.clone(),
2795 }
2796 }
2797 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2803 let mut query = self.selection.select("asTarball");
2804 if let Some(platform_variants) = opts.platform_variants {
2805 query = query.arg("platformVariants", platform_variants);
2806 }
2807 if let Some(forced_compression) = opts.forced_compression {
2808 query = query.arg("forcedCompression", forced_compression);
2809 }
2810 if let Some(media_types) = opts.media_types {
2811 query = query.arg("mediaTypes", media_types);
2812 }
2813 File {
2814 proc: self.proc.clone(),
2815 selection: query,
2816 graphql_client: self.graphql_client.clone(),
2817 }
2818 }
2819 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2822 let query = self.selection.select("combinedOutput");
2823 query.execute(self.graphql_client.clone()).await
2824 }
2825 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2827 let query = self.selection.select("defaultArgs");
2828 query.execute(self.graphql_client.clone()).await
2829 }
2830 pub fn directory(&self, path: impl Into<String>) -> Directory {
2838 let mut query = self.selection.select("directory");
2839 query = query.arg("path", path.into());
2840 Directory {
2841 proc: self.proc.clone(),
2842 selection: query,
2843 graphql_client: self.graphql_client.clone(),
2844 }
2845 }
2846 pub fn directory_opts(
2854 &self,
2855 path: impl Into<String>,
2856 opts: ContainerDirectoryOpts,
2857 ) -> Directory {
2858 let mut query = self.selection.select("directory");
2859 query = query.arg("path", path.into());
2860 if let Some(expand) = opts.expand {
2861 query = query.arg("expand", expand);
2862 }
2863 Directory {
2864 proc: self.proc.clone(),
2865 selection: query,
2866 graphql_client: self.graphql_client.clone(),
2867 }
2868 }
2869 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2871 let query = self.selection.select("entrypoint");
2872 query.execute(self.graphql_client.clone()).await
2873 }
2874 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2880 let mut query = self.selection.select("envVariable");
2881 query = query.arg("name", name.into());
2882 query.execute(self.graphql_client.clone()).await
2883 }
2884 pub fn env_variables(&self) -> Vec<EnvVariable> {
2886 let query = self.selection.select("envVariables");
2887 vec![EnvVariable {
2888 proc: self.proc.clone(),
2889 selection: query,
2890 graphql_client: self.graphql_client.clone(),
2891 }]
2892 }
2893 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2900 let mut query = self.selection.select("exists");
2901 query = query.arg("path", path.into());
2902 query.execute(self.graphql_client.clone()).await
2903 }
2904 pub async fn exists_opts(
2911 &self,
2912 path: impl Into<String>,
2913 opts: ContainerExistsOpts,
2914 ) -> Result<bool, DaggerError> {
2915 let mut query = self.selection.select("exists");
2916 query = query.arg("path", path.into());
2917 if let Some(expected_type) = opts.expected_type {
2918 query = query.arg("expectedType", expected_type);
2919 }
2920 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2921 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2922 }
2923 query.execute(self.graphql_client.clone()).await
2924 }
2925 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2928 let query = self.selection.select("exitCode");
2929 query.execute(self.graphql_client.clone()).await
2930 }
2931 pub fn experimental_with_all_gp_us(&self) -> Container {
2935 let query = self.selection.select("experimentalWithAllGPUs");
2936 Container {
2937 proc: self.proc.clone(),
2938 selection: query,
2939 graphql_client: self.graphql_client.clone(),
2940 }
2941 }
2942 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2950 let mut query = self.selection.select("experimentalWithGPU");
2951 query = query.arg(
2952 "devices",
2953 devices
2954 .into_iter()
2955 .map(|i| i.into())
2956 .collect::<Vec<String>>(),
2957 );
2958 Container {
2959 proc: self.proc.clone(),
2960 selection: query,
2961 graphql_client: self.graphql_client.clone(),
2962 }
2963 }
2964 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2974 let mut query = self.selection.select("export");
2975 query = query.arg("path", path.into());
2976 query.execute(self.graphql_client.clone()).await
2977 }
2978 pub async fn export_opts(
2988 &self,
2989 path: impl Into<String>,
2990 opts: ContainerExportOpts,
2991 ) -> Result<String, DaggerError> {
2992 let mut query = self.selection.select("export");
2993 query = query.arg("path", path.into());
2994 if let Some(platform_variants) = opts.platform_variants {
2995 query = query.arg("platformVariants", platform_variants);
2996 }
2997 if let Some(forced_compression) = opts.forced_compression {
2998 query = query.arg("forcedCompression", forced_compression);
2999 }
3000 if let Some(media_types) = opts.media_types {
3001 query = query.arg("mediaTypes", media_types);
3002 }
3003 if let Some(expand) = opts.expand {
3004 query = query.arg("expand", expand);
3005 }
3006 query.execute(self.graphql_client.clone()).await
3007 }
3008 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3015 let mut query = self.selection.select("exportImage");
3016 query = query.arg("name", name.into());
3017 query.execute(self.graphql_client.clone()).await
3018 }
3019 pub async fn export_image_opts(
3026 &self,
3027 name: impl Into<String>,
3028 opts: ContainerExportImageOpts,
3029 ) -> Result<Void, DaggerError> {
3030 let mut query = self.selection.select("exportImage");
3031 query = query.arg("name", name.into());
3032 if let Some(platform_variants) = opts.platform_variants {
3033 query = query.arg("platformVariants", platform_variants);
3034 }
3035 if let Some(forced_compression) = opts.forced_compression {
3036 query = query.arg("forcedCompression", forced_compression);
3037 }
3038 if let Some(media_types) = opts.media_types {
3039 query = query.arg("mediaTypes", media_types);
3040 }
3041 query.execute(self.graphql_client.clone()).await
3042 }
3043 pub fn exposed_ports(&self) -> Vec<Port> {
3046 let query = self.selection.select("exposedPorts");
3047 vec![Port {
3048 proc: self.proc.clone(),
3049 selection: query,
3050 graphql_client: self.graphql_client.clone(),
3051 }]
3052 }
3053 pub fn file(&self, path: impl Into<String>) -> File {
3061 let mut query = self.selection.select("file");
3062 query = query.arg("path", path.into());
3063 File {
3064 proc: self.proc.clone(),
3065 selection: query,
3066 graphql_client: self.graphql_client.clone(),
3067 }
3068 }
3069 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3077 let mut query = self.selection.select("file");
3078 query = query.arg("path", path.into());
3079 if let Some(expand) = opts.expand {
3080 query = query.arg("expand", expand);
3081 }
3082 File {
3083 proc: self.proc.clone(),
3084 selection: query,
3085 graphql_client: self.graphql_client.clone(),
3086 }
3087 }
3088 pub fn from(&self, address: impl Into<String>) -> Container {
3094 let mut query = self.selection.select("from");
3095 query = query.arg("address", address.into());
3096 Container {
3097 proc: self.proc.clone(),
3098 selection: query,
3099 graphql_client: self.graphql_client.clone(),
3100 }
3101 }
3102 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3104 let query = self.selection.select("id");
3105 query.execute(self.graphql_client.clone()).await
3106 }
3107 pub async fn image_ref(&self) -> Result<String, DaggerError> {
3109 let query = self.selection.select("imageRef");
3110 query.execute(self.graphql_client.clone()).await
3111 }
3112 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3119 let mut query = self.selection.select("import");
3120 query = query.arg_lazy(
3121 "source",
3122 Box::new(move || {
3123 let source = source.clone();
3124 Box::pin(async move { source.into_id().await.unwrap().quote() })
3125 }),
3126 );
3127 Container {
3128 proc: self.proc.clone(),
3129 selection: query,
3130 graphql_client: self.graphql_client.clone(),
3131 }
3132 }
3133 pub fn import_opts<'a>(
3140 &self,
3141 source: impl IntoID<FileId>,
3142 opts: ContainerImportOpts<'a>,
3143 ) -> Container {
3144 let mut query = self.selection.select("import");
3145 query = query.arg_lazy(
3146 "source",
3147 Box::new(move || {
3148 let source = source.clone();
3149 Box::pin(async move { source.into_id().await.unwrap().quote() })
3150 }),
3151 );
3152 if let Some(tag) = opts.tag {
3153 query = query.arg("tag", tag);
3154 }
3155 Container {
3156 proc: self.proc.clone(),
3157 selection: query,
3158 graphql_client: self.graphql_client.clone(),
3159 }
3160 }
3161 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3167 let mut query = self.selection.select("label");
3168 query = query.arg("name", name.into());
3169 query.execute(self.graphql_client.clone()).await
3170 }
3171 pub fn labels(&self) -> Vec<Label> {
3173 let query = self.selection.select("labels");
3174 vec![Label {
3175 proc: self.proc.clone(),
3176 selection: query,
3177 graphql_client: self.graphql_client.clone(),
3178 }]
3179 }
3180 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3182 let query = self.selection.select("mounts");
3183 query.execute(self.graphql_client.clone()).await
3184 }
3185 pub async fn platform(&self) -> Result<Platform, DaggerError> {
3187 let query = self.selection.select("platform");
3188 query.execute(self.graphql_client.clone()).await
3189 }
3190 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3200 let mut query = self.selection.select("publish");
3201 query = query.arg("address", address.into());
3202 query.execute(self.graphql_client.clone()).await
3203 }
3204 pub async fn publish_opts(
3214 &self,
3215 address: impl Into<String>,
3216 opts: ContainerPublishOpts,
3217 ) -> Result<String, DaggerError> {
3218 let mut query = self.selection.select("publish");
3219 query = query.arg("address", address.into());
3220 if let Some(platform_variants) = opts.platform_variants {
3221 query = query.arg("platformVariants", platform_variants);
3222 }
3223 if let Some(forced_compression) = opts.forced_compression {
3224 query = query.arg("forcedCompression", forced_compression);
3225 }
3226 if let Some(media_types) = opts.media_types {
3227 query = query.arg("mediaTypes", media_types);
3228 }
3229 query.execute(self.graphql_client.clone()).await
3230 }
3231 pub fn rootfs(&self) -> Directory {
3233 let query = self.selection.select("rootfs");
3234 Directory {
3235 proc: self.proc.clone(),
3236 selection: query,
3237 graphql_client: self.graphql_client.clone(),
3238 }
3239 }
3240 pub async fn stderr(&self) -> Result<String, DaggerError> {
3243 let query = self.selection.select("stderr");
3244 query.execute(self.graphql_client.clone()).await
3245 }
3246 pub async fn stdout(&self) -> Result<String, DaggerError> {
3249 let query = self.selection.select("stdout");
3250 query.execute(self.graphql_client.clone()).await
3251 }
3252 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3255 let query = self.selection.select("sync");
3256 query.execute(self.graphql_client.clone()).await
3257 }
3258 pub fn terminal(&self) -> Container {
3264 let query = self.selection.select("terminal");
3265 Container {
3266 proc: self.proc.clone(),
3267 selection: query,
3268 graphql_client: self.graphql_client.clone(),
3269 }
3270 }
3271 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3277 let mut query = self.selection.select("terminal");
3278 if let Some(cmd) = opts.cmd {
3279 query = query.arg("cmd", cmd);
3280 }
3281 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3282 query = query.arg(
3283 "experimentalPrivilegedNesting",
3284 experimental_privileged_nesting,
3285 );
3286 }
3287 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3288 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3289 }
3290 Container {
3291 proc: self.proc.clone(),
3292 selection: query,
3293 graphql_client: self.graphql_client.clone(),
3294 }
3295 }
3296 pub async fn up(&self) -> Result<Void, DaggerError> {
3303 let query = self.selection.select("up");
3304 query.execute(self.graphql_client.clone()).await
3305 }
3306 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3313 let mut query = self.selection.select("up");
3314 if let Some(random) = opts.random {
3315 query = query.arg("random", random);
3316 }
3317 if let Some(ports) = opts.ports {
3318 query = query.arg("ports", ports);
3319 }
3320 if let Some(args) = opts.args {
3321 query = query.arg("args", args);
3322 }
3323 if let Some(use_entrypoint) = opts.use_entrypoint {
3324 query = query.arg("useEntrypoint", use_entrypoint);
3325 }
3326 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3327 query = query.arg(
3328 "experimentalPrivilegedNesting",
3329 experimental_privileged_nesting,
3330 );
3331 }
3332 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3333 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3334 }
3335 if let Some(expand) = opts.expand {
3336 query = query.arg("expand", expand);
3337 }
3338 if let Some(no_init) = opts.no_init {
3339 query = query.arg("noInit", no_init);
3340 }
3341 query.execute(self.graphql_client.clone()).await
3342 }
3343 pub async fn user(&self) -> Result<String, DaggerError> {
3345 let query = self.selection.select("user");
3346 query.execute(self.graphql_client.clone()).await
3347 }
3348 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3355 let mut query = self.selection.select("withAnnotation");
3356 query = query.arg("name", name.into());
3357 query = query.arg("value", value.into());
3358 Container {
3359 proc: self.proc.clone(),
3360 selection: query,
3361 graphql_client: self.graphql_client.clone(),
3362 }
3363 }
3364 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3370 let mut query = self.selection.select("withDefaultArgs");
3371 query = query.arg(
3372 "args",
3373 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3374 );
3375 Container {
3376 proc: self.proc.clone(),
3377 selection: query,
3378 graphql_client: self.graphql_client.clone(),
3379 }
3380 }
3381 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3388 let mut query = self.selection.select("withDefaultTerminalCmd");
3389 query = query.arg(
3390 "args",
3391 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3392 );
3393 Container {
3394 proc: self.proc.clone(),
3395 selection: query,
3396 graphql_client: self.graphql_client.clone(),
3397 }
3398 }
3399 pub fn with_default_terminal_cmd_opts(
3406 &self,
3407 args: Vec<impl Into<String>>,
3408 opts: ContainerWithDefaultTerminalCmdOpts,
3409 ) -> Container {
3410 let mut query = self.selection.select("withDefaultTerminalCmd");
3411 query = query.arg(
3412 "args",
3413 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3414 );
3415 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3416 query = query.arg(
3417 "experimentalPrivilegedNesting",
3418 experimental_privileged_nesting,
3419 );
3420 }
3421 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3422 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3423 }
3424 Container {
3425 proc: self.proc.clone(),
3426 selection: query,
3427 graphql_client: self.graphql_client.clone(),
3428 }
3429 }
3430 pub fn with_directory(
3438 &self,
3439 path: impl Into<String>,
3440 source: impl IntoID<DirectoryId>,
3441 ) -> Container {
3442 let mut query = self.selection.select("withDirectory");
3443 query = query.arg("path", path.into());
3444 query = query.arg_lazy(
3445 "source",
3446 Box::new(move || {
3447 let source = source.clone();
3448 Box::pin(async move { source.into_id().await.unwrap().quote() })
3449 }),
3450 );
3451 Container {
3452 proc: self.proc.clone(),
3453 selection: query,
3454 graphql_client: self.graphql_client.clone(),
3455 }
3456 }
3457 pub fn with_directory_opts<'a>(
3465 &self,
3466 path: impl Into<String>,
3467 source: impl IntoID<DirectoryId>,
3468 opts: ContainerWithDirectoryOpts<'a>,
3469 ) -> Container {
3470 let mut query = self.selection.select("withDirectory");
3471 query = query.arg("path", path.into());
3472 query = query.arg_lazy(
3473 "source",
3474 Box::new(move || {
3475 let source = source.clone();
3476 Box::pin(async move { source.into_id().await.unwrap().quote() })
3477 }),
3478 );
3479 if let Some(exclude) = opts.exclude {
3480 query = query.arg("exclude", exclude);
3481 }
3482 if let Some(include) = opts.include {
3483 query = query.arg("include", include);
3484 }
3485 if let Some(owner) = opts.owner {
3486 query = query.arg("owner", owner);
3487 }
3488 if let Some(expand) = opts.expand {
3489 query = query.arg("expand", expand);
3490 }
3491 Container {
3492 proc: self.proc.clone(),
3493 selection: query,
3494 graphql_client: self.graphql_client.clone(),
3495 }
3496 }
3497 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3504 let mut query = self.selection.select("withEntrypoint");
3505 query = query.arg(
3506 "args",
3507 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3508 );
3509 Container {
3510 proc: self.proc.clone(),
3511 selection: query,
3512 graphql_client: self.graphql_client.clone(),
3513 }
3514 }
3515 pub fn with_entrypoint_opts(
3522 &self,
3523 args: Vec<impl Into<String>>,
3524 opts: ContainerWithEntrypointOpts,
3525 ) -> Container {
3526 let mut query = self.selection.select("withEntrypoint");
3527 query = query.arg(
3528 "args",
3529 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3530 );
3531 if let Some(keep_default_args) = opts.keep_default_args {
3532 query = query.arg("keepDefaultArgs", keep_default_args);
3533 }
3534 Container {
3535 proc: self.proc.clone(),
3536 selection: query,
3537 graphql_client: self.graphql_client.clone(),
3538 }
3539 }
3540 pub fn with_env_variable(
3548 &self,
3549 name: impl Into<String>,
3550 value: impl Into<String>,
3551 ) -> Container {
3552 let mut query = self.selection.select("withEnvVariable");
3553 query = query.arg("name", name.into());
3554 query = query.arg("value", value.into());
3555 Container {
3556 proc: self.proc.clone(),
3557 selection: query,
3558 graphql_client: self.graphql_client.clone(),
3559 }
3560 }
3561 pub fn with_env_variable_opts(
3569 &self,
3570 name: impl Into<String>,
3571 value: impl Into<String>,
3572 opts: ContainerWithEnvVariableOpts,
3573 ) -> Container {
3574 let mut query = self.selection.select("withEnvVariable");
3575 query = query.arg("name", name.into());
3576 query = query.arg("value", value.into());
3577 if let Some(expand) = opts.expand {
3578 query = query.arg("expand", expand);
3579 }
3580 Container {
3581 proc: self.proc.clone(),
3582 selection: query,
3583 graphql_client: self.graphql_client.clone(),
3584 }
3585 }
3586 pub fn with_error(&self, err: impl Into<String>) -> Container {
3592 let mut query = self.selection.select("withError");
3593 query = query.arg("err", err.into());
3594 Container {
3595 proc: self.proc.clone(),
3596 selection: query,
3597 graphql_client: self.graphql_client.clone(),
3598 }
3599 }
3600 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3611 let mut query = self.selection.select("withExec");
3612 query = query.arg(
3613 "args",
3614 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3615 );
3616 Container {
3617 proc: self.proc.clone(),
3618 selection: query,
3619 graphql_client: self.graphql_client.clone(),
3620 }
3621 }
3622 pub fn with_exec_opts<'a>(
3633 &self,
3634 args: Vec<impl Into<String>>,
3635 opts: ContainerWithExecOpts<'a>,
3636 ) -> Container {
3637 let mut query = self.selection.select("withExec");
3638 query = query.arg(
3639 "args",
3640 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3641 );
3642 if let Some(use_entrypoint) = opts.use_entrypoint {
3643 query = query.arg("useEntrypoint", use_entrypoint);
3644 }
3645 if let Some(stdin) = opts.stdin {
3646 query = query.arg("stdin", stdin);
3647 }
3648 if let Some(redirect_stdin) = opts.redirect_stdin {
3649 query = query.arg("redirectStdin", redirect_stdin);
3650 }
3651 if let Some(redirect_stdout) = opts.redirect_stdout {
3652 query = query.arg("redirectStdout", redirect_stdout);
3653 }
3654 if let Some(redirect_stderr) = opts.redirect_stderr {
3655 query = query.arg("redirectStderr", redirect_stderr);
3656 }
3657 if let Some(expect) = opts.expect {
3658 query = query.arg("expect", expect);
3659 }
3660 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3661 query = query.arg(
3662 "experimentalPrivilegedNesting",
3663 experimental_privileged_nesting,
3664 );
3665 }
3666 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3667 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3668 }
3669 if let Some(expand) = opts.expand {
3670 query = query.arg("expand", expand);
3671 }
3672 if let Some(no_init) = opts.no_init {
3673 query = query.arg("noInit", no_init);
3674 }
3675 Container {
3676 proc: self.proc.clone(),
3677 selection: query,
3678 graphql_client: self.graphql_client.clone(),
3679 }
3680 }
3681 pub fn with_exposed_port(&self, port: isize) -> Container {
3691 let mut query = self.selection.select("withExposedPort");
3692 query = query.arg("port", port);
3693 Container {
3694 proc: self.proc.clone(),
3695 selection: query,
3696 graphql_client: self.graphql_client.clone(),
3697 }
3698 }
3699 pub fn with_exposed_port_opts<'a>(
3709 &self,
3710 port: isize,
3711 opts: ContainerWithExposedPortOpts<'a>,
3712 ) -> Container {
3713 let mut query = self.selection.select("withExposedPort");
3714 query = query.arg("port", port);
3715 if let Some(protocol) = opts.protocol {
3716 query = query.arg("protocol", protocol);
3717 }
3718 if let Some(description) = opts.description {
3719 query = query.arg("description", description);
3720 }
3721 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3722 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3723 }
3724 Container {
3725 proc: self.proc.clone(),
3726 selection: query,
3727 graphql_client: self.graphql_client.clone(),
3728 }
3729 }
3730 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3738 let mut query = self.selection.select("withFile");
3739 query = query.arg("path", path.into());
3740 query = query.arg_lazy(
3741 "source",
3742 Box::new(move || {
3743 let source = source.clone();
3744 Box::pin(async move { source.into_id().await.unwrap().quote() })
3745 }),
3746 );
3747 Container {
3748 proc: self.proc.clone(),
3749 selection: query,
3750 graphql_client: self.graphql_client.clone(),
3751 }
3752 }
3753 pub fn with_file_opts<'a>(
3761 &self,
3762 path: impl Into<String>,
3763 source: impl IntoID<FileId>,
3764 opts: ContainerWithFileOpts<'a>,
3765 ) -> Container {
3766 let mut query = self.selection.select("withFile");
3767 query = query.arg("path", path.into());
3768 query = query.arg_lazy(
3769 "source",
3770 Box::new(move || {
3771 let source = source.clone();
3772 Box::pin(async move { source.into_id().await.unwrap().quote() })
3773 }),
3774 );
3775 if let Some(permissions) = opts.permissions {
3776 query = query.arg("permissions", permissions);
3777 }
3778 if let Some(owner) = opts.owner {
3779 query = query.arg("owner", owner);
3780 }
3781 if let Some(expand) = opts.expand {
3782 query = query.arg("expand", expand);
3783 }
3784 Container {
3785 proc: self.proc.clone(),
3786 selection: query,
3787 graphql_client: self.graphql_client.clone(),
3788 }
3789 }
3790 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3798 let mut query = self.selection.select("withFiles");
3799 query = query.arg("path", path.into());
3800 query = query.arg("sources", sources);
3801 Container {
3802 proc: self.proc.clone(),
3803 selection: query,
3804 graphql_client: self.graphql_client.clone(),
3805 }
3806 }
3807 pub fn with_files_opts<'a>(
3815 &self,
3816 path: impl Into<String>,
3817 sources: Vec<FileId>,
3818 opts: ContainerWithFilesOpts<'a>,
3819 ) -> Container {
3820 let mut query = self.selection.select("withFiles");
3821 query = query.arg("path", path.into());
3822 query = query.arg("sources", sources);
3823 if let Some(permissions) = opts.permissions {
3824 query = query.arg("permissions", permissions);
3825 }
3826 if let Some(owner) = opts.owner {
3827 query = query.arg("owner", owner);
3828 }
3829 if let Some(expand) = opts.expand {
3830 query = query.arg("expand", expand);
3831 }
3832 Container {
3833 proc: self.proc.clone(),
3834 selection: query,
3835 graphql_client: self.graphql_client.clone(),
3836 }
3837 }
3838 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3845 let mut query = self.selection.select("withLabel");
3846 query = query.arg("name", name.into());
3847 query = query.arg("value", value.into());
3848 Container {
3849 proc: self.proc.clone(),
3850 selection: query,
3851 graphql_client: self.graphql_client.clone(),
3852 }
3853 }
3854 pub fn with_mounted_cache(
3862 &self,
3863 path: impl Into<String>,
3864 cache: impl IntoID<CacheVolumeId>,
3865 ) -> Container {
3866 let mut query = self.selection.select("withMountedCache");
3867 query = query.arg("path", path.into());
3868 query = query.arg_lazy(
3869 "cache",
3870 Box::new(move || {
3871 let cache = cache.clone();
3872 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3873 }),
3874 );
3875 Container {
3876 proc: self.proc.clone(),
3877 selection: query,
3878 graphql_client: self.graphql_client.clone(),
3879 }
3880 }
3881 pub fn with_mounted_cache_opts<'a>(
3889 &self,
3890 path: impl Into<String>,
3891 cache: impl IntoID<CacheVolumeId>,
3892 opts: ContainerWithMountedCacheOpts<'a>,
3893 ) -> Container {
3894 let mut query = self.selection.select("withMountedCache");
3895 query = query.arg("path", path.into());
3896 query = query.arg_lazy(
3897 "cache",
3898 Box::new(move || {
3899 let cache = cache.clone();
3900 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3901 }),
3902 );
3903 if let Some(source) = opts.source {
3904 query = query.arg("source", source);
3905 }
3906 if let Some(sharing) = opts.sharing {
3907 query = query.arg("sharing", sharing);
3908 }
3909 if let Some(owner) = opts.owner {
3910 query = query.arg("owner", owner);
3911 }
3912 if let Some(expand) = opts.expand {
3913 query = query.arg("expand", expand);
3914 }
3915 Container {
3916 proc: self.proc.clone(),
3917 selection: query,
3918 graphql_client: self.graphql_client.clone(),
3919 }
3920 }
3921 pub fn with_mounted_directory(
3929 &self,
3930 path: impl Into<String>,
3931 source: impl IntoID<DirectoryId>,
3932 ) -> Container {
3933 let mut query = self.selection.select("withMountedDirectory");
3934 query = query.arg("path", path.into());
3935 query = query.arg_lazy(
3936 "source",
3937 Box::new(move || {
3938 let source = source.clone();
3939 Box::pin(async move { source.into_id().await.unwrap().quote() })
3940 }),
3941 );
3942 Container {
3943 proc: self.proc.clone(),
3944 selection: query,
3945 graphql_client: self.graphql_client.clone(),
3946 }
3947 }
3948 pub fn with_mounted_directory_opts<'a>(
3956 &self,
3957 path: impl Into<String>,
3958 source: impl IntoID<DirectoryId>,
3959 opts: ContainerWithMountedDirectoryOpts<'a>,
3960 ) -> Container {
3961 let mut query = self.selection.select("withMountedDirectory");
3962 query = query.arg("path", path.into());
3963 query = query.arg_lazy(
3964 "source",
3965 Box::new(move || {
3966 let source = source.clone();
3967 Box::pin(async move { source.into_id().await.unwrap().quote() })
3968 }),
3969 );
3970 if let Some(owner) = opts.owner {
3971 query = query.arg("owner", owner);
3972 }
3973 if let Some(expand) = opts.expand {
3974 query = query.arg("expand", expand);
3975 }
3976 Container {
3977 proc: self.proc.clone(),
3978 selection: query,
3979 graphql_client: self.graphql_client.clone(),
3980 }
3981 }
3982 pub fn with_mounted_file(
3990 &self,
3991 path: impl Into<String>,
3992 source: impl IntoID<FileId>,
3993 ) -> Container {
3994 let mut query = self.selection.select("withMountedFile");
3995 query = query.arg("path", path.into());
3996 query = query.arg_lazy(
3997 "source",
3998 Box::new(move || {
3999 let source = source.clone();
4000 Box::pin(async move { source.into_id().await.unwrap().quote() })
4001 }),
4002 );
4003 Container {
4004 proc: self.proc.clone(),
4005 selection: query,
4006 graphql_client: self.graphql_client.clone(),
4007 }
4008 }
4009 pub fn with_mounted_file_opts<'a>(
4017 &self,
4018 path: impl Into<String>,
4019 source: impl IntoID<FileId>,
4020 opts: ContainerWithMountedFileOpts<'a>,
4021 ) -> Container {
4022 let mut query = self.selection.select("withMountedFile");
4023 query = query.arg("path", path.into());
4024 query = query.arg_lazy(
4025 "source",
4026 Box::new(move || {
4027 let source = source.clone();
4028 Box::pin(async move { source.into_id().await.unwrap().quote() })
4029 }),
4030 );
4031 if let Some(owner) = opts.owner {
4032 query = query.arg("owner", owner);
4033 }
4034 if let Some(expand) = opts.expand {
4035 query = query.arg("expand", expand);
4036 }
4037 Container {
4038 proc: self.proc.clone(),
4039 selection: query,
4040 graphql_client: self.graphql_client.clone(),
4041 }
4042 }
4043 pub fn with_mounted_secret(
4051 &self,
4052 path: impl Into<String>,
4053 source: impl IntoID<SecretId>,
4054 ) -> Container {
4055 let mut query = self.selection.select("withMountedSecret");
4056 query = query.arg("path", path.into());
4057 query = query.arg_lazy(
4058 "source",
4059 Box::new(move || {
4060 let source = source.clone();
4061 Box::pin(async move { source.into_id().await.unwrap().quote() })
4062 }),
4063 );
4064 Container {
4065 proc: self.proc.clone(),
4066 selection: query,
4067 graphql_client: self.graphql_client.clone(),
4068 }
4069 }
4070 pub fn with_mounted_secret_opts<'a>(
4078 &self,
4079 path: impl Into<String>,
4080 source: impl IntoID<SecretId>,
4081 opts: ContainerWithMountedSecretOpts<'a>,
4082 ) -> Container {
4083 let mut query = self.selection.select("withMountedSecret");
4084 query = query.arg("path", path.into());
4085 query = query.arg_lazy(
4086 "source",
4087 Box::new(move || {
4088 let source = source.clone();
4089 Box::pin(async move { source.into_id().await.unwrap().quote() })
4090 }),
4091 );
4092 if let Some(owner) = opts.owner {
4093 query = query.arg("owner", owner);
4094 }
4095 if let Some(mode) = opts.mode {
4096 query = query.arg("mode", mode);
4097 }
4098 if let Some(expand) = opts.expand {
4099 query = query.arg("expand", expand);
4100 }
4101 Container {
4102 proc: self.proc.clone(),
4103 selection: query,
4104 graphql_client: self.graphql_client.clone(),
4105 }
4106 }
4107 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4114 let mut query = self.selection.select("withMountedTemp");
4115 query = query.arg("path", path.into());
4116 Container {
4117 proc: self.proc.clone(),
4118 selection: query,
4119 graphql_client: self.graphql_client.clone(),
4120 }
4121 }
4122 pub fn with_mounted_temp_opts(
4129 &self,
4130 path: impl Into<String>,
4131 opts: ContainerWithMountedTempOpts,
4132 ) -> Container {
4133 let mut query = self.selection.select("withMountedTemp");
4134 query = query.arg("path", path.into());
4135 if let Some(size) = opts.size {
4136 query = query.arg("size", size);
4137 }
4138 if let Some(expand) = opts.expand {
4139 query = query.arg("expand", expand);
4140 }
4141 Container {
4142 proc: self.proc.clone(),
4143 selection: query,
4144 graphql_client: self.graphql_client.clone(),
4145 }
4146 }
4147 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4155 let mut query = self.selection.select("withNewFile");
4156 query = query.arg("path", path.into());
4157 query = query.arg("contents", contents.into());
4158 Container {
4159 proc: self.proc.clone(),
4160 selection: query,
4161 graphql_client: self.graphql_client.clone(),
4162 }
4163 }
4164 pub fn with_new_file_opts<'a>(
4172 &self,
4173 path: impl Into<String>,
4174 contents: impl Into<String>,
4175 opts: ContainerWithNewFileOpts<'a>,
4176 ) -> Container {
4177 let mut query = self.selection.select("withNewFile");
4178 query = query.arg("path", path.into());
4179 query = query.arg("contents", contents.into());
4180 if let Some(permissions) = opts.permissions {
4181 query = query.arg("permissions", permissions);
4182 }
4183 if let Some(owner) = opts.owner {
4184 query = query.arg("owner", owner);
4185 }
4186 if let Some(expand) = opts.expand {
4187 query = query.arg("expand", expand);
4188 }
4189 Container {
4190 proc: self.proc.clone(),
4191 selection: query,
4192 graphql_client: self.graphql_client.clone(),
4193 }
4194 }
4195 pub fn with_registry_auth(
4203 &self,
4204 address: impl Into<String>,
4205 username: impl Into<String>,
4206 secret: impl IntoID<SecretId>,
4207 ) -> Container {
4208 let mut query = self.selection.select("withRegistryAuth");
4209 query = query.arg("address", address.into());
4210 query = query.arg("username", username.into());
4211 query = query.arg_lazy(
4212 "secret",
4213 Box::new(move || {
4214 let secret = secret.clone();
4215 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4216 }),
4217 );
4218 Container {
4219 proc: self.proc.clone(),
4220 selection: query,
4221 graphql_client: self.graphql_client.clone(),
4222 }
4223 }
4224 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4230 let mut query = self.selection.select("withRootfs");
4231 query = query.arg_lazy(
4232 "directory",
4233 Box::new(move || {
4234 let directory = directory.clone();
4235 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4236 }),
4237 );
4238 Container {
4239 proc: self.proc.clone(),
4240 selection: query,
4241 graphql_client: self.graphql_client.clone(),
4242 }
4243 }
4244 pub fn with_secret_variable(
4251 &self,
4252 name: impl Into<String>,
4253 secret: impl IntoID<SecretId>,
4254 ) -> Container {
4255 let mut query = self.selection.select("withSecretVariable");
4256 query = query.arg("name", name.into());
4257 query = query.arg_lazy(
4258 "secret",
4259 Box::new(move || {
4260 let secret = secret.clone();
4261 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4262 }),
4263 );
4264 Container {
4265 proc: self.proc.clone(),
4266 selection: query,
4267 graphql_client: self.graphql_client.clone(),
4268 }
4269 }
4270 pub fn with_service_binding(
4280 &self,
4281 alias: impl Into<String>,
4282 service: impl IntoID<ServiceId>,
4283 ) -> Container {
4284 let mut query = self.selection.select("withServiceBinding");
4285 query = query.arg("alias", alias.into());
4286 query = query.arg_lazy(
4287 "service",
4288 Box::new(move || {
4289 let service = service.clone();
4290 Box::pin(async move { service.into_id().await.unwrap().quote() })
4291 }),
4292 );
4293 Container {
4294 proc: self.proc.clone(),
4295 selection: query,
4296 graphql_client: self.graphql_client.clone(),
4297 }
4298 }
4299 pub fn with_symlink(
4307 &self,
4308 target: impl Into<String>,
4309 link_name: impl Into<String>,
4310 ) -> Container {
4311 let mut query = self.selection.select("withSymlink");
4312 query = query.arg("target", target.into());
4313 query = query.arg("linkName", link_name.into());
4314 Container {
4315 proc: self.proc.clone(),
4316 selection: query,
4317 graphql_client: self.graphql_client.clone(),
4318 }
4319 }
4320 pub fn with_symlink_opts(
4328 &self,
4329 target: impl Into<String>,
4330 link_name: impl Into<String>,
4331 opts: ContainerWithSymlinkOpts,
4332 ) -> Container {
4333 let mut query = self.selection.select("withSymlink");
4334 query = query.arg("target", target.into());
4335 query = query.arg("linkName", link_name.into());
4336 if let Some(expand) = opts.expand {
4337 query = query.arg("expand", expand);
4338 }
4339 Container {
4340 proc: self.proc.clone(),
4341 selection: query,
4342 graphql_client: self.graphql_client.clone(),
4343 }
4344 }
4345 pub fn with_unix_socket(
4353 &self,
4354 path: impl Into<String>,
4355 source: impl IntoID<SocketId>,
4356 ) -> Container {
4357 let mut query = self.selection.select("withUnixSocket");
4358 query = query.arg("path", path.into());
4359 query = query.arg_lazy(
4360 "source",
4361 Box::new(move || {
4362 let source = source.clone();
4363 Box::pin(async move { source.into_id().await.unwrap().quote() })
4364 }),
4365 );
4366 Container {
4367 proc: self.proc.clone(),
4368 selection: query,
4369 graphql_client: self.graphql_client.clone(),
4370 }
4371 }
4372 pub fn with_unix_socket_opts<'a>(
4380 &self,
4381 path: impl Into<String>,
4382 source: impl IntoID<SocketId>,
4383 opts: ContainerWithUnixSocketOpts<'a>,
4384 ) -> Container {
4385 let mut query = self.selection.select("withUnixSocket");
4386 query = query.arg("path", path.into());
4387 query = query.arg_lazy(
4388 "source",
4389 Box::new(move || {
4390 let source = source.clone();
4391 Box::pin(async move { source.into_id().await.unwrap().quote() })
4392 }),
4393 );
4394 if let Some(owner) = opts.owner {
4395 query = query.arg("owner", owner);
4396 }
4397 if let Some(expand) = opts.expand {
4398 query = query.arg("expand", expand);
4399 }
4400 Container {
4401 proc: self.proc.clone(),
4402 selection: query,
4403 graphql_client: self.graphql_client.clone(),
4404 }
4405 }
4406 pub fn with_user(&self, name: impl Into<String>) -> Container {
4412 let mut query = self.selection.select("withUser");
4413 query = query.arg("name", name.into());
4414 Container {
4415 proc: self.proc.clone(),
4416 selection: query,
4417 graphql_client: self.graphql_client.clone(),
4418 }
4419 }
4420 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4427 let mut query = self.selection.select("withWorkdir");
4428 query = query.arg("path", path.into());
4429 Container {
4430 proc: self.proc.clone(),
4431 selection: query,
4432 graphql_client: self.graphql_client.clone(),
4433 }
4434 }
4435 pub fn with_workdir_opts(
4442 &self,
4443 path: impl Into<String>,
4444 opts: ContainerWithWorkdirOpts,
4445 ) -> Container {
4446 let mut query = self.selection.select("withWorkdir");
4447 query = query.arg("path", path.into());
4448 if let Some(expand) = opts.expand {
4449 query = query.arg("expand", expand);
4450 }
4451 Container {
4452 proc: self.proc.clone(),
4453 selection: query,
4454 graphql_client: self.graphql_client.clone(),
4455 }
4456 }
4457 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4463 let mut query = self.selection.select("withoutAnnotation");
4464 query = query.arg("name", name.into());
4465 Container {
4466 proc: self.proc.clone(),
4467 selection: query,
4468 graphql_client: self.graphql_client.clone(),
4469 }
4470 }
4471 pub fn without_default_args(&self) -> Container {
4473 let query = self.selection.select("withoutDefaultArgs");
4474 Container {
4475 proc: self.proc.clone(),
4476 selection: query,
4477 graphql_client: self.graphql_client.clone(),
4478 }
4479 }
4480 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4487 let mut query = self.selection.select("withoutDirectory");
4488 query = query.arg("path", path.into());
4489 Container {
4490 proc: self.proc.clone(),
4491 selection: query,
4492 graphql_client: self.graphql_client.clone(),
4493 }
4494 }
4495 pub fn without_directory_opts(
4502 &self,
4503 path: impl Into<String>,
4504 opts: ContainerWithoutDirectoryOpts,
4505 ) -> Container {
4506 let mut query = self.selection.select("withoutDirectory");
4507 query = query.arg("path", path.into());
4508 if let Some(expand) = opts.expand {
4509 query = query.arg("expand", expand);
4510 }
4511 Container {
4512 proc: self.proc.clone(),
4513 selection: query,
4514 graphql_client: self.graphql_client.clone(),
4515 }
4516 }
4517 pub fn without_entrypoint(&self) -> Container {
4523 let query = self.selection.select("withoutEntrypoint");
4524 Container {
4525 proc: self.proc.clone(),
4526 selection: query,
4527 graphql_client: self.graphql_client.clone(),
4528 }
4529 }
4530 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4536 let mut query = self.selection.select("withoutEntrypoint");
4537 if let Some(keep_default_args) = opts.keep_default_args {
4538 query = query.arg("keepDefaultArgs", keep_default_args);
4539 }
4540 Container {
4541 proc: self.proc.clone(),
4542 selection: query,
4543 graphql_client: self.graphql_client.clone(),
4544 }
4545 }
4546 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4552 let mut query = self.selection.select("withoutEnvVariable");
4553 query = query.arg("name", name.into());
4554 Container {
4555 proc: self.proc.clone(),
4556 selection: query,
4557 graphql_client: self.graphql_client.clone(),
4558 }
4559 }
4560 pub fn without_exposed_port(&self, port: isize) -> Container {
4567 let mut query = self.selection.select("withoutExposedPort");
4568 query = query.arg("port", port);
4569 Container {
4570 proc: self.proc.clone(),
4571 selection: query,
4572 graphql_client: self.graphql_client.clone(),
4573 }
4574 }
4575 pub fn without_exposed_port_opts(
4582 &self,
4583 port: isize,
4584 opts: ContainerWithoutExposedPortOpts,
4585 ) -> Container {
4586 let mut query = self.selection.select("withoutExposedPort");
4587 query = query.arg("port", port);
4588 if let Some(protocol) = opts.protocol {
4589 query = query.arg("protocol", protocol);
4590 }
4591 Container {
4592 proc: self.proc.clone(),
4593 selection: query,
4594 graphql_client: self.graphql_client.clone(),
4595 }
4596 }
4597 pub fn without_file(&self, path: impl Into<String>) -> Container {
4604 let mut query = self.selection.select("withoutFile");
4605 query = query.arg("path", path.into());
4606 Container {
4607 proc: self.proc.clone(),
4608 selection: query,
4609 graphql_client: self.graphql_client.clone(),
4610 }
4611 }
4612 pub fn without_file_opts(
4619 &self,
4620 path: impl Into<String>,
4621 opts: ContainerWithoutFileOpts,
4622 ) -> Container {
4623 let mut query = self.selection.select("withoutFile");
4624 query = query.arg("path", path.into());
4625 if let Some(expand) = opts.expand {
4626 query = query.arg("expand", expand);
4627 }
4628 Container {
4629 proc: self.proc.clone(),
4630 selection: query,
4631 graphql_client: self.graphql_client.clone(),
4632 }
4633 }
4634 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4641 let mut query = self.selection.select("withoutFiles");
4642 query = query.arg(
4643 "paths",
4644 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4645 );
4646 Container {
4647 proc: self.proc.clone(),
4648 selection: query,
4649 graphql_client: self.graphql_client.clone(),
4650 }
4651 }
4652 pub fn without_files_opts(
4659 &self,
4660 paths: Vec<impl Into<String>>,
4661 opts: ContainerWithoutFilesOpts,
4662 ) -> Container {
4663 let mut query = self.selection.select("withoutFiles");
4664 query = query.arg(
4665 "paths",
4666 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4667 );
4668 if let Some(expand) = opts.expand {
4669 query = query.arg("expand", expand);
4670 }
4671 Container {
4672 proc: self.proc.clone(),
4673 selection: query,
4674 graphql_client: self.graphql_client.clone(),
4675 }
4676 }
4677 pub fn without_label(&self, name: impl Into<String>) -> Container {
4683 let mut query = self.selection.select("withoutLabel");
4684 query = query.arg("name", name.into());
4685 Container {
4686 proc: self.proc.clone(),
4687 selection: query,
4688 graphql_client: self.graphql_client.clone(),
4689 }
4690 }
4691 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4698 let mut query = self.selection.select("withoutMount");
4699 query = query.arg("path", path.into());
4700 Container {
4701 proc: self.proc.clone(),
4702 selection: query,
4703 graphql_client: self.graphql_client.clone(),
4704 }
4705 }
4706 pub fn without_mount_opts(
4713 &self,
4714 path: impl Into<String>,
4715 opts: ContainerWithoutMountOpts,
4716 ) -> Container {
4717 let mut query = self.selection.select("withoutMount");
4718 query = query.arg("path", path.into());
4719 if let Some(expand) = opts.expand {
4720 query = query.arg("expand", expand);
4721 }
4722 Container {
4723 proc: self.proc.clone(),
4724 selection: query,
4725 graphql_client: self.graphql_client.clone(),
4726 }
4727 }
4728 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4736 let mut query = self.selection.select("withoutRegistryAuth");
4737 query = query.arg("address", address.into());
4738 Container {
4739 proc: self.proc.clone(),
4740 selection: query,
4741 graphql_client: self.graphql_client.clone(),
4742 }
4743 }
4744 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4750 let mut query = self.selection.select("withoutSecretVariable");
4751 query = query.arg("name", name.into());
4752 Container {
4753 proc: self.proc.clone(),
4754 selection: query,
4755 graphql_client: self.graphql_client.clone(),
4756 }
4757 }
4758 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4765 let mut query = self.selection.select("withoutUnixSocket");
4766 query = query.arg("path", path.into());
4767 Container {
4768 proc: self.proc.clone(),
4769 selection: query,
4770 graphql_client: self.graphql_client.clone(),
4771 }
4772 }
4773 pub fn without_unix_socket_opts(
4780 &self,
4781 path: impl Into<String>,
4782 opts: ContainerWithoutUnixSocketOpts,
4783 ) -> Container {
4784 let mut query = self.selection.select("withoutUnixSocket");
4785 query = query.arg("path", path.into());
4786 if let Some(expand) = opts.expand {
4787 query = query.arg("expand", expand);
4788 }
4789 Container {
4790 proc: self.proc.clone(),
4791 selection: query,
4792 graphql_client: self.graphql_client.clone(),
4793 }
4794 }
4795 pub fn without_user(&self) -> Container {
4798 let query = self.selection.select("withoutUser");
4799 Container {
4800 proc: self.proc.clone(),
4801 selection: query,
4802 graphql_client: self.graphql_client.clone(),
4803 }
4804 }
4805 pub fn without_workdir(&self) -> Container {
4808 let query = self.selection.select("withoutWorkdir");
4809 Container {
4810 proc: self.proc.clone(),
4811 selection: query,
4812 graphql_client: self.graphql_client.clone(),
4813 }
4814 }
4815 pub async fn workdir(&self) -> Result<String, DaggerError> {
4817 let query = self.selection.select("workdir");
4818 query.execute(self.graphql_client.clone()).await
4819 }
4820}
4821#[derive(Clone)]
4822pub struct CurrentModule {
4823 pub proc: Option<Arc<DaggerSessionProc>>,
4824 pub selection: Selection,
4825 pub graphql_client: DynGraphQLClient,
4826}
4827#[derive(Builder, Debug, PartialEq)]
4828pub struct CurrentModuleWorkdirOpts<'a> {
4829 #[builder(setter(into, strip_option), default)]
4831 pub exclude: Option<Vec<&'a str>>,
4832 #[builder(setter(into, strip_option), default)]
4834 pub include: Option<Vec<&'a str>>,
4835}
4836impl CurrentModule {
4837 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4839 let query = self.selection.select("id");
4840 query.execute(self.graphql_client.clone()).await
4841 }
4842 pub async fn name(&self) -> Result<String, DaggerError> {
4844 let query = self.selection.select("name");
4845 query.execute(self.graphql_client.clone()).await
4846 }
4847 pub fn source(&self) -> Directory {
4849 let query = self.selection.select("source");
4850 Directory {
4851 proc: self.proc.clone(),
4852 selection: query,
4853 graphql_client: self.graphql_client.clone(),
4854 }
4855 }
4856 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4863 let mut query = self.selection.select("workdir");
4864 query = query.arg("path", path.into());
4865 Directory {
4866 proc: self.proc.clone(),
4867 selection: query,
4868 graphql_client: self.graphql_client.clone(),
4869 }
4870 }
4871 pub fn workdir_opts<'a>(
4878 &self,
4879 path: impl Into<String>,
4880 opts: CurrentModuleWorkdirOpts<'a>,
4881 ) -> Directory {
4882 let mut query = self.selection.select("workdir");
4883 query = query.arg("path", path.into());
4884 if let Some(exclude) = opts.exclude {
4885 query = query.arg("exclude", exclude);
4886 }
4887 if let Some(include) = opts.include {
4888 query = query.arg("include", include);
4889 }
4890 Directory {
4891 proc: self.proc.clone(),
4892 selection: query,
4893 graphql_client: self.graphql_client.clone(),
4894 }
4895 }
4896 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4902 let mut query = self.selection.select("workdirFile");
4903 query = query.arg("path", path.into());
4904 File {
4905 proc: self.proc.clone(),
4906 selection: query,
4907 graphql_client: self.graphql_client.clone(),
4908 }
4909 }
4910}
4911#[derive(Clone)]
4912pub struct Directory {
4913 pub proc: Option<Arc<DaggerSessionProc>>,
4914 pub selection: Selection,
4915 pub graphql_client: DynGraphQLClient,
4916}
4917#[derive(Builder, Debug, PartialEq)]
4918pub struct DirectoryAsModuleOpts<'a> {
4919 #[builder(setter(into, strip_option), default)]
4922 pub source_root_path: Option<&'a str>,
4923}
4924#[derive(Builder, Debug, PartialEq)]
4925pub struct DirectoryAsModuleSourceOpts<'a> {
4926 #[builder(setter(into, strip_option), default)]
4929 pub source_root_path: Option<&'a str>,
4930}
4931#[derive(Builder, Debug, PartialEq)]
4932pub struct DirectoryDockerBuildOpts<'a> {
4933 #[builder(setter(into, strip_option), default)]
4935 pub build_args: Option<Vec<BuildArg>>,
4936 #[builder(setter(into, strip_option), default)]
4938 pub dockerfile: Option<&'a str>,
4939 #[builder(setter(into, strip_option), default)]
4942 pub no_init: Option<bool>,
4943 #[builder(setter(into, strip_option), default)]
4945 pub platform: Option<Platform>,
4946 #[builder(setter(into, strip_option), default)]
4949 pub secrets: Option<Vec<SecretId>>,
4950 #[builder(setter(into, strip_option), default)]
4952 pub target: Option<&'a str>,
4953}
4954#[derive(Builder, Debug, PartialEq)]
4955pub struct DirectoryEntriesOpts<'a> {
4956 #[builder(setter(into, strip_option), default)]
4958 pub path: Option<&'a str>,
4959}
4960#[derive(Builder, Debug, PartialEq)]
4961pub struct DirectoryExistsOpts {
4962 #[builder(setter(into, strip_option), default)]
4964 pub do_not_follow_symlinks: Option<bool>,
4965 #[builder(setter(into, strip_option), default)]
4967 pub expected_type: Option<ExistsType>,
4968}
4969#[derive(Builder, Debug, PartialEq)]
4970pub struct DirectoryExportOpts {
4971 #[builder(setter(into, strip_option), default)]
4973 pub wipe: Option<bool>,
4974}
4975#[derive(Builder, Debug, PartialEq)]
4976pub struct DirectoryFilterOpts<'a> {
4977 #[builder(setter(into, strip_option), default)]
4979 pub exclude: Option<Vec<&'a str>>,
4980 #[builder(setter(into, strip_option), default)]
4982 pub include: Option<Vec<&'a str>>,
4983}
4984#[derive(Builder, Debug, PartialEq)]
4985pub struct DirectorySearchOpts<'a> {
4986 #[builder(setter(into, strip_option), default)]
4988 pub dotall: Option<bool>,
4989 #[builder(setter(into, strip_option), default)]
4991 pub files_only: Option<bool>,
4992 #[builder(setter(into, strip_option), default)]
4994 pub globs: Option<Vec<&'a str>>,
4995 #[builder(setter(into, strip_option), default)]
4997 pub insensitive: Option<bool>,
4998 #[builder(setter(into, strip_option), default)]
5000 pub limit: Option<isize>,
5001 #[builder(setter(into, strip_option), default)]
5003 pub literal: Option<bool>,
5004 #[builder(setter(into, strip_option), default)]
5006 pub multiline: Option<bool>,
5007 #[builder(setter(into, strip_option), default)]
5009 pub paths: Option<Vec<&'a str>>,
5010 #[builder(setter(into, strip_option), default)]
5012 pub skip_hidden: Option<bool>,
5013 #[builder(setter(into, strip_option), default)]
5015 pub skip_ignored: Option<bool>,
5016}
5017#[derive(Builder, Debug, PartialEq)]
5018pub struct DirectoryTerminalOpts<'a> {
5019 #[builder(setter(into, strip_option), default)]
5021 pub cmd: Option<Vec<&'a str>>,
5022 #[builder(setter(into, strip_option), default)]
5024 pub container: Option<ContainerId>,
5025 #[builder(setter(into, strip_option), default)]
5027 pub experimental_privileged_nesting: Option<bool>,
5028 #[builder(setter(into, strip_option), default)]
5030 pub insecure_root_capabilities: Option<bool>,
5031}
5032#[derive(Builder, Debug, PartialEq)]
5033pub struct DirectoryWithDirectoryOpts<'a> {
5034 #[builder(setter(into, strip_option), default)]
5036 pub exclude: Option<Vec<&'a str>>,
5037 #[builder(setter(into, strip_option), default)]
5039 pub include: Option<Vec<&'a str>>,
5040 #[builder(setter(into, strip_option), default)]
5044 pub owner: Option<&'a str>,
5045}
5046#[derive(Builder, Debug, PartialEq)]
5047pub struct DirectoryWithFileOpts<'a> {
5048 #[builder(setter(into, strip_option), default)]
5052 pub owner: Option<&'a str>,
5053 #[builder(setter(into, strip_option), default)]
5055 pub permissions: Option<isize>,
5056}
5057#[derive(Builder, Debug, PartialEq)]
5058pub struct DirectoryWithFilesOpts {
5059 #[builder(setter(into, strip_option), default)]
5061 pub permissions: Option<isize>,
5062}
5063#[derive(Builder, Debug, PartialEq)]
5064pub struct DirectoryWithNewDirectoryOpts {
5065 #[builder(setter(into, strip_option), default)]
5067 pub permissions: Option<isize>,
5068}
5069#[derive(Builder, Debug, PartialEq)]
5070pub struct DirectoryWithNewFileOpts {
5071 #[builder(setter(into, strip_option), default)]
5073 pub permissions: Option<isize>,
5074}
5075impl Directory {
5076 pub fn as_git(&self) -> GitRepository {
5078 let query = self.selection.select("asGit");
5079 GitRepository {
5080 proc: self.proc.clone(),
5081 selection: query,
5082 graphql_client: self.graphql_client.clone(),
5083 }
5084 }
5085 pub fn as_module(&self) -> Module {
5091 let query = self.selection.select("asModule");
5092 Module {
5093 proc: self.proc.clone(),
5094 selection: query,
5095 graphql_client: self.graphql_client.clone(),
5096 }
5097 }
5098 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5104 let mut query = self.selection.select("asModule");
5105 if let Some(source_root_path) = opts.source_root_path {
5106 query = query.arg("sourceRootPath", source_root_path);
5107 }
5108 Module {
5109 proc: self.proc.clone(),
5110 selection: query,
5111 graphql_client: self.graphql_client.clone(),
5112 }
5113 }
5114 pub fn as_module_source(&self) -> ModuleSource {
5120 let query = self.selection.select("asModuleSource");
5121 ModuleSource {
5122 proc: self.proc.clone(),
5123 selection: query,
5124 graphql_client: self.graphql_client.clone(),
5125 }
5126 }
5127 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5133 let mut query = self.selection.select("asModuleSource");
5134 if let Some(source_root_path) = opts.source_root_path {
5135 query = query.arg("sourceRootPath", source_root_path);
5136 }
5137 ModuleSource {
5138 proc: self.proc.clone(),
5139 selection: query,
5140 graphql_client: self.graphql_client.clone(),
5141 }
5142 }
5143 pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5150 let mut query = self.selection.select("changes");
5151 query = query.arg_lazy(
5152 "from",
5153 Box::new(move || {
5154 let from = from.clone();
5155 Box::pin(async move { from.into_id().await.unwrap().quote() })
5156 }),
5157 );
5158 Changeset {
5159 proc: self.proc.clone(),
5160 selection: query,
5161 graphql_client: self.graphql_client.clone(),
5162 }
5163 }
5164 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5175 let mut query = self.selection.select("chown");
5176 query = query.arg("path", path.into());
5177 query = query.arg("owner", owner.into());
5178 Directory {
5179 proc: self.proc.clone(),
5180 selection: query,
5181 graphql_client: self.graphql_client.clone(),
5182 }
5183 }
5184 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5190 let mut query = self.selection.select("diff");
5191 query = query.arg_lazy(
5192 "other",
5193 Box::new(move || {
5194 let other = other.clone();
5195 Box::pin(async move { other.into_id().await.unwrap().quote() })
5196 }),
5197 );
5198 Directory {
5199 proc: self.proc.clone(),
5200 selection: query,
5201 graphql_client: self.graphql_client.clone(),
5202 }
5203 }
5204 pub async fn digest(&self) -> Result<String, DaggerError> {
5206 let query = self.selection.select("digest");
5207 query.execute(self.graphql_client.clone()).await
5208 }
5209 pub fn directory(&self, path: impl Into<String>) -> Directory {
5215 let mut query = self.selection.select("directory");
5216 query = query.arg("path", path.into());
5217 Directory {
5218 proc: self.proc.clone(),
5219 selection: query,
5220 graphql_client: self.graphql_client.clone(),
5221 }
5222 }
5223 pub fn docker_build(&self) -> Container {
5229 let query = self.selection.select("dockerBuild");
5230 Container {
5231 proc: self.proc.clone(),
5232 selection: query,
5233 graphql_client: self.graphql_client.clone(),
5234 }
5235 }
5236 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5242 let mut query = self.selection.select("dockerBuild");
5243 if let Some(dockerfile) = opts.dockerfile {
5244 query = query.arg("dockerfile", dockerfile);
5245 }
5246 if let Some(platform) = opts.platform {
5247 query = query.arg("platform", platform);
5248 }
5249 if let Some(build_args) = opts.build_args {
5250 query = query.arg("buildArgs", build_args);
5251 }
5252 if let Some(target) = opts.target {
5253 query = query.arg("target", target);
5254 }
5255 if let Some(secrets) = opts.secrets {
5256 query = query.arg("secrets", secrets);
5257 }
5258 if let Some(no_init) = opts.no_init {
5259 query = query.arg("noInit", no_init);
5260 }
5261 Container {
5262 proc: self.proc.clone(),
5263 selection: query,
5264 graphql_client: self.graphql_client.clone(),
5265 }
5266 }
5267 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5273 let query = self.selection.select("entries");
5274 query.execute(self.graphql_client.clone()).await
5275 }
5276 pub async fn entries_opts<'a>(
5282 &self,
5283 opts: DirectoryEntriesOpts<'a>,
5284 ) -> Result<Vec<String>, DaggerError> {
5285 let mut query = self.selection.select("entries");
5286 if let Some(path) = opts.path {
5287 query = query.arg("path", path);
5288 }
5289 query.execute(self.graphql_client.clone()).await
5290 }
5291 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5298 let mut query = self.selection.select("exists");
5299 query = query.arg("path", path.into());
5300 query.execute(self.graphql_client.clone()).await
5301 }
5302 pub async fn exists_opts(
5309 &self,
5310 path: impl Into<String>,
5311 opts: DirectoryExistsOpts,
5312 ) -> Result<bool, DaggerError> {
5313 let mut query = self.selection.select("exists");
5314 query = query.arg("path", path.into());
5315 if let Some(expected_type) = opts.expected_type {
5316 query = query.arg("expectedType", expected_type);
5317 }
5318 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5319 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5320 }
5321 query.execute(self.graphql_client.clone()).await
5322 }
5323 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5330 let mut query = self.selection.select("export");
5331 query = query.arg("path", path.into());
5332 query.execute(self.graphql_client.clone()).await
5333 }
5334 pub async fn export_opts(
5341 &self,
5342 path: impl Into<String>,
5343 opts: DirectoryExportOpts,
5344 ) -> Result<String, DaggerError> {
5345 let mut query = self.selection.select("export");
5346 query = query.arg("path", path.into());
5347 if let Some(wipe) = opts.wipe {
5348 query = query.arg("wipe", wipe);
5349 }
5350 query.execute(self.graphql_client.clone()).await
5351 }
5352 pub fn file(&self, path: impl Into<String>) -> File {
5358 let mut query = self.selection.select("file");
5359 query = query.arg("path", path.into());
5360 File {
5361 proc: self.proc.clone(),
5362 selection: query,
5363 graphql_client: self.graphql_client.clone(),
5364 }
5365 }
5366 pub fn filter(&self) -> Directory {
5372 let query = self.selection.select("filter");
5373 Directory {
5374 proc: self.proc.clone(),
5375 selection: query,
5376 graphql_client: self.graphql_client.clone(),
5377 }
5378 }
5379 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5385 let mut query = self.selection.select("filter");
5386 if let Some(exclude) = opts.exclude {
5387 query = query.arg("exclude", exclude);
5388 }
5389 if let Some(include) = opts.include {
5390 query = query.arg("include", include);
5391 }
5392 Directory {
5393 proc: self.proc.clone(),
5394 selection: query,
5395 graphql_client: self.graphql_client.clone(),
5396 }
5397 }
5398 pub async fn find_up(
5405 &self,
5406 name: impl Into<String>,
5407 start: impl Into<String>,
5408 ) -> Result<String, DaggerError> {
5409 let mut query = self.selection.select("findUp");
5410 query = query.arg("name", name.into());
5411 query = query.arg("start", start.into());
5412 query.execute(self.graphql_client.clone()).await
5413 }
5414 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5420 let mut query = self.selection.select("glob");
5421 query = query.arg("pattern", pattern.into());
5422 query.execute(self.graphql_client.clone()).await
5423 }
5424 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5426 let query = self.selection.select("id");
5427 query.execute(self.graphql_client.clone()).await
5428 }
5429 pub async fn name(&self) -> Result<String, DaggerError> {
5431 let query = self.selection.select("name");
5432 query.execute(self.graphql_client.clone()).await
5433 }
5434 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5442 let mut query = self.selection.select("search");
5443 query = query.arg("pattern", pattern.into());
5444 vec![SearchResult {
5445 proc: self.proc.clone(),
5446 selection: query,
5447 graphql_client: self.graphql_client.clone(),
5448 }]
5449 }
5450 pub fn search_opts<'a>(
5458 &self,
5459 pattern: impl Into<String>,
5460 opts: DirectorySearchOpts<'a>,
5461 ) -> Vec<SearchResult> {
5462 let mut query = self.selection.select("search");
5463 query = query.arg("pattern", pattern.into());
5464 if let Some(paths) = opts.paths {
5465 query = query.arg("paths", paths);
5466 }
5467 if let Some(globs) = opts.globs {
5468 query = query.arg("globs", globs);
5469 }
5470 if let Some(literal) = opts.literal {
5471 query = query.arg("literal", literal);
5472 }
5473 if let Some(multiline) = opts.multiline {
5474 query = query.arg("multiline", multiline);
5475 }
5476 if let Some(dotall) = opts.dotall {
5477 query = query.arg("dotall", dotall);
5478 }
5479 if let Some(insensitive) = opts.insensitive {
5480 query = query.arg("insensitive", insensitive);
5481 }
5482 if let Some(skip_ignored) = opts.skip_ignored {
5483 query = query.arg("skipIgnored", skip_ignored);
5484 }
5485 if let Some(skip_hidden) = opts.skip_hidden {
5486 query = query.arg("skipHidden", skip_hidden);
5487 }
5488 if let Some(files_only) = opts.files_only {
5489 query = query.arg("filesOnly", files_only);
5490 }
5491 if let Some(limit) = opts.limit {
5492 query = query.arg("limit", limit);
5493 }
5494 vec![SearchResult {
5495 proc: self.proc.clone(),
5496 selection: query,
5497 graphql_client: self.graphql_client.clone(),
5498 }]
5499 }
5500 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5502 let query = self.selection.select("sync");
5503 query.execute(self.graphql_client.clone()).await
5504 }
5505 pub fn terminal(&self) -> Directory {
5511 let query = self.selection.select("terminal");
5512 Directory {
5513 proc: self.proc.clone(),
5514 selection: query,
5515 graphql_client: self.graphql_client.clone(),
5516 }
5517 }
5518 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5524 let mut query = self.selection.select("terminal");
5525 if let Some(container) = opts.container {
5526 query = query.arg("container", container);
5527 }
5528 if let Some(cmd) = opts.cmd {
5529 query = query.arg("cmd", cmd);
5530 }
5531 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5532 query = query.arg(
5533 "experimentalPrivilegedNesting",
5534 experimental_privileged_nesting,
5535 );
5536 }
5537 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5538 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5539 }
5540 Directory {
5541 proc: self.proc.clone(),
5542 selection: query,
5543 graphql_client: self.graphql_client.clone(),
5544 }
5545 }
5546 pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5552 let mut query = self.selection.select("withChanges");
5553 query = query.arg_lazy(
5554 "changes",
5555 Box::new(move || {
5556 let changes = changes.clone();
5557 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5558 }),
5559 );
5560 Directory {
5561 proc: self.proc.clone(),
5562 selection: query,
5563 graphql_client: self.graphql_client.clone(),
5564 }
5565 }
5566 pub fn with_directory(
5574 &self,
5575 path: impl Into<String>,
5576 source: impl IntoID<DirectoryId>,
5577 ) -> Directory {
5578 let mut query = self.selection.select("withDirectory");
5579 query = query.arg("path", path.into());
5580 query = query.arg_lazy(
5581 "source",
5582 Box::new(move || {
5583 let source = source.clone();
5584 Box::pin(async move { source.into_id().await.unwrap().quote() })
5585 }),
5586 );
5587 Directory {
5588 proc: self.proc.clone(),
5589 selection: query,
5590 graphql_client: self.graphql_client.clone(),
5591 }
5592 }
5593 pub fn with_directory_opts<'a>(
5601 &self,
5602 path: impl Into<String>,
5603 source: impl IntoID<DirectoryId>,
5604 opts: DirectoryWithDirectoryOpts<'a>,
5605 ) -> Directory {
5606 let mut query = self.selection.select("withDirectory");
5607 query = query.arg("path", path.into());
5608 query = query.arg_lazy(
5609 "source",
5610 Box::new(move || {
5611 let source = source.clone();
5612 Box::pin(async move { source.into_id().await.unwrap().quote() })
5613 }),
5614 );
5615 if let Some(exclude) = opts.exclude {
5616 query = query.arg("exclude", exclude);
5617 }
5618 if let Some(include) = opts.include {
5619 query = query.arg("include", include);
5620 }
5621 if let Some(owner) = opts.owner {
5622 query = query.arg("owner", owner);
5623 }
5624 Directory {
5625 proc: self.proc.clone(),
5626 selection: query,
5627 graphql_client: self.graphql_client.clone(),
5628 }
5629 }
5630 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5636 let mut query = self.selection.select("withError");
5637 query = query.arg("err", err.into());
5638 Directory {
5639 proc: self.proc.clone(),
5640 selection: query,
5641 graphql_client: self.graphql_client.clone(),
5642 }
5643 }
5644 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5652 let mut query = self.selection.select("withFile");
5653 query = query.arg("path", path.into());
5654 query = query.arg_lazy(
5655 "source",
5656 Box::new(move || {
5657 let source = source.clone();
5658 Box::pin(async move { source.into_id().await.unwrap().quote() })
5659 }),
5660 );
5661 Directory {
5662 proc: self.proc.clone(),
5663 selection: query,
5664 graphql_client: self.graphql_client.clone(),
5665 }
5666 }
5667 pub fn with_file_opts<'a>(
5675 &self,
5676 path: impl Into<String>,
5677 source: impl IntoID<FileId>,
5678 opts: DirectoryWithFileOpts<'a>,
5679 ) -> Directory {
5680 let mut query = self.selection.select("withFile");
5681 query = query.arg("path", path.into());
5682 query = query.arg_lazy(
5683 "source",
5684 Box::new(move || {
5685 let source = source.clone();
5686 Box::pin(async move { source.into_id().await.unwrap().quote() })
5687 }),
5688 );
5689 if let Some(permissions) = opts.permissions {
5690 query = query.arg("permissions", permissions);
5691 }
5692 if let Some(owner) = opts.owner {
5693 query = query.arg("owner", owner);
5694 }
5695 Directory {
5696 proc: self.proc.clone(),
5697 selection: query,
5698 graphql_client: self.graphql_client.clone(),
5699 }
5700 }
5701 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5709 let mut query = self.selection.select("withFiles");
5710 query = query.arg("path", path.into());
5711 query = query.arg("sources", sources);
5712 Directory {
5713 proc: self.proc.clone(),
5714 selection: query,
5715 graphql_client: self.graphql_client.clone(),
5716 }
5717 }
5718 pub fn with_files_opts(
5726 &self,
5727 path: impl Into<String>,
5728 sources: Vec<FileId>,
5729 opts: DirectoryWithFilesOpts,
5730 ) -> Directory {
5731 let mut query = self.selection.select("withFiles");
5732 query = query.arg("path", path.into());
5733 query = query.arg("sources", sources);
5734 if let Some(permissions) = opts.permissions {
5735 query = query.arg("permissions", permissions);
5736 }
5737 Directory {
5738 proc: self.proc.clone(),
5739 selection: query,
5740 graphql_client: self.graphql_client.clone(),
5741 }
5742 }
5743 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5750 let mut query = self.selection.select("withNewDirectory");
5751 query = query.arg("path", path.into());
5752 Directory {
5753 proc: self.proc.clone(),
5754 selection: query,
5755 graphql_client: self.graphql_client.clone(),
5756 }
5757 }
5758 pub fn with_new_directory_opts(
5765 &self,
5766 path: impl Into<String>,
5767 opts: DirectoryWithNewDirectoryOpts,
5768 ) -> Directory {
5769 let mut query = self.selection.select("withNewDirectory");
5770 query = query.arg("path", path.into());
5771 if let Some(permissions) = opts.permissions {
5772 query = query.arg("permissions", permissions);
5773 }
5774 Directory {
5775 proc: self.proc.clone(),
5776 selection: query,
5777 graphql_client: self.graphql_client.clone(),
5778 }
5779 }
5780 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5788 let mut query = self.selection.select("withNewFile");
5789 query = query.arg("path", path.into());
5790 query = query.arg("contents", contents.into());
5791 Directory {
5792 proc: self.proc.clone(),
5793 selection: query,
5794 graphql_client: self.graphql_client.clone(),
5795 }
5796 }
5797 pub fn with_new_file_opts(
5805 &self,
5806 path: impl Into<String>,
5807 contents: impl Into<String>,
5808 opts: DirectoryWithNewFileOpts,
5809 ) -> Directory {
5810 let mut query = self.selection.select("withNewFile");
5811 query = query.arg("path", path.into());
5812 query = query.arg("contents", contents.into());
5813 if let Some(permissions) = opts.permissions {
5814 query = query.arg("permissions", permissions);
5815 }
5816 Directory {
5817 proc: self.proc.clone(),
5818 selection: query,
5819 graphql_client: self.graphql_client.clone(),
5820 }
5821 }
5822 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5828 let mut query = self.selection.select("withPatch");
5829 query = query.arg("patch", patch.into());
5830 Directory {
5831 proc: self.proc.clone(),
5832 selection: query,
5833 graphql_client: self.graphql_client.clone(),
5834 }
5835 }
5836 pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
5842 let mut query = self.selection.select("withPatchFile");
5843 query = query.arg_lazy(
5844 "patch",
5845 Box::new(move || {
5846 let patch = patch.clone();
5847 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5848 }),
5849 );
5850 Directory {
5851 proc: self.proc.clone(),
5852 selection: query,
5853 graphql_client: self.graphql_client.clone(),
5854 }
5855 }
5856 pub fn with_symlink(
5863 &self,
5864 target: impl Into<String>,
5865 link_name: impl Into<String>,
5866 ) -> Directory {
5867 let mut query = self.selection.select("withSymlink");
5868 query = query.arg("target", target.into());
5869 query = query.arg("linkName", link_name.into());
5870 Directory {
5871 proc: self.proc.clone(),
5872 selection: query,
5873 graphql_client: self.graphql_client.clone(),
5874 }
5875 }
5876 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5884 let mut query = self.selection.select("withTimestamps");
5885 query = query.arg("timestamp", timestamp);
5886 Directory {
5887 proc: self.proc.clone(),
5888 selection: query,
5889 graphql_client: self.graphql_client.clone(),
5890 }
5891 }
5892 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5898 let mut query = self.selection.select("withoutDirectory");
5899 query = query.arg("path", path.into());
5900 Directory {
5901 proc: self.proc.clone(),
5902 selection: query,
5903 graphql_client: self.graphql_client.clone(),
5904 }
5905 }
5906 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5912 let mut query = self.selection.select("withoutFile");
5913 query = query.arg("path", path.into());
5914 Directory {
5915 proc: self.proc.clone(),
5916 selection: query,
5917 graphql_client: self.graphql_client.clone(),
5918 }
5919 }
5920 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5926 let mut query = self.selection.select("withoutFiles");
5927 query = query.arg(
5928 "paths",
5929 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5930 );
5931 Directory {
5932 proc: self.proc.clone(),
5933 selection: query,
5934 graphql_client: self.graphql_client.clone(),
5935 }
5936 }
5937}
5938#[derive(Clone)]
5939pub struct Engine {
5940 pub proc: Option<Arc<DaggerSessionProc>>,
5941 pub selection: Selection,
5942 pub graphql_client: DynGraphQLClient,
5943}
5944impl Engine {
5945 pub async fn id(&self) -> Result<EngineId, DaggerError> {
5947 let query = self.selection.select("id");
5948 query.execute(self.graphql_client.clone()).await
5949 }
5950 pub fn local_cache(&self) -> EngineCache {
5952 let query = self.selection.select("localCache");
5953 EngineCache {
5954 proc: self.proc.clone(),
5955 selection: query,
5956 graphql_client: self.graphql_client.clone(),
5957 }
5958 }
5959 pub async fn name(&self) -> Result<String, DaggerError> {
5961 let query = self.selection.select("name");
5962 query.execute(self.graphql_client.clone()).await
5963 }
5964}
5965#[derive(Clone)]
5966pub struct EngineCache {
5967 pub proc: Option<Arc<DaggerSessionProc>>,
5968 pub selection: Selection,
5969 pub graphql_client: DynGraphQLClient,
5970}
5971#[derive(Builder, Debug, PartialEq)]
5972pub struct EngineCacheEntrySetOpts<'a> {
5973 #[builder(setter(into, strip_option), default)]
5974 pub key: Option<&'a str>,
5975}
5976#[derive(Builder, Debug, PartialEq)]
5977pub struct EngineCachePruneOpts {
5978 #[builder(setter(into, strip_option), default)]
5980 pub use_default_policy: Option<bool>,
5981}
5982impl EngineCache {
5983 pub fn entry_set(&self) -> EngineCacheEntrySet {
5989 let query = self.selection.select("entrySet");
5990 EngineCacheEntrySet {
5991 proc: self.proc.clone(),
5992 selection: query,
5993 graphql_client: self.graphql_client.clone(),
5994 }
5995 }
5996 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6002 let mut query = self.selection.select("entrySet");
6003 if let Some(key) = opts.key {
6004 query = query.arg("key", key);
6005 }
6006 EngineCacheEntrySet {
6007 proc: self.proc.clone(),
6008 selection: query,
6009 graphql_client: self.graphql_client.clone(),
6010 }
6011 }
6012 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
6014 let query = self.selection.select("id");
6015 query.execute(self.graphql_client.clone()).await
6016 }
6017 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6019 let query = self.selection.select("maxUsedSpace");
6020 query.execute(self.graphql_client.clone()).await
6021 }
6022 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6024 let query = self.selection.select("minFreeSpace");
6025 query.execute(self.graphql_client.clone()).await
6026 }
6027 pub async fn prune(&self) -> Result<Void, DaggerError> {
6033 let query = self.selection.select("prune");
6034 query.execute(self.graphql_client.clone()).await
6035 }
6036 pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
6042 let mut query = self.selection.select("prune");
6043 if let Some(use_default_policy) = opts.use_default_policy {
6044 query = query.arg("useDefaultPolicy", use_default_policy);
6045 }
6046 query.execute(self.graphql_client.clone()).await
6047 }
6048 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6050 let query = self.selection.select("reservedSpace");
6051 query.execute(self.graphql_client.clone()).await
6052 }
6053 pub async fn target_space(&self) -> Result<isize, DaggerError> {
6055 let query = self.selection.select("targetSpace");
6056 query.execute(self.graphql_client.clone()).await
6057 }
6058}
6059#[derive(Clone)]
6060pub struct EngineCacheEntry {
6061 pub proc: Option<Arc<DaggerSessionProc>>,
6062 pub selection: Selection,
6063 pub graphql_client: DynGraphQLClient,
6064}
6065impl EngineCacheEntry {
6066 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6068 let query = self.selection.select("activelyUsed");
6069 query.execute(self.graphql_client.clone()).await
6070 }
6071 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6073 let query = self.selection.select("createdTimeUnixNano");
6074 query.execute(self.graphql_client.clone()).await
6075 }
6076 pub async fn description(&self) -> Result<String, DaggerError> {
6078 let query = self.selection.select("description");
6079 query.execute(self.graphql_client.clone()).await
6080 }
6081 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6083 let query = self.selection.select("diskSpaceBytes");
6084 query.execute(self.graphql_client.clone()).await
6085 }
6086 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6088 let query = self.selection.select("id");
6089 query.execute(self.graphql_client.clone()).await
6090 }
6091 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6093 let query = self.selection.select("mostRecentUseTimeUnixNano");
6094 query.execute(self.graphql_client.clone()).await
6095 }
6096}
6097#[derive(Clone)]
6098pub struct EngineCacheEntrySet {
6099 pub proc: Option<Arc<DaggerSessionProc>>,
6100 pub selection: Selection,
6101 pub graphql_client: DynGraphQLClient,
6102}
6103impl EngineCacheEntrySet {
6104 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6106 let query = self.selection.select("diskSpaceBytes");
6107 query.execute(self.graphql_client.clone()).await
6108 }
6109 pub fn entries(&self) -> Vec<EngineCacheEntry> {
6111 let query = self.selection.select("entries");
6112 vec![EngineCacheEntry {
6113 proc: self.proc.clone(),
6114 selection: query,
6115 graphql_client: self.graphql_client.clone(),
6116 }]
6117 }
6118 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6120 let query = self.selection.select("entryCount");
6121 query.execute(self.graphql_client.clone()).await
6122 }
6123 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6125 let query = self.selection.select("id");
6126 query.execute(self.graphql_client.clone()).await
6127 }
6128}
6129#[derive(Clone)]
6130pub struct EnumTypeDef {
6131 pub proc: Option<Arc<DaggerSessionProc>>,
6132 pub selection: Selection,
6133 pub graphql_client: DynGraphQLClient,
6134}
6135impl EnumTypeDef {
6136 pub async fn description(&self) -> Result<String, DaggerError> {
6138 let query = self.selection.select("description");
6139 query.execute(self.graphql_client.clone()).await
6140 }
6141 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6143 let query = self.selection.select("id");
6144 query.execute(self.graphql_client.clone()).await
6145 }
6146 pub fn members(&self) -> Vec<EnumValueTypeDef> {
6148 let query = self.selection.select("members");
6149 vec![EnumValueTypeDef {
6150 proc: self.proc.clone(),
6151 selection: query,
6152 graphql_client: self.graphql_client.clone(),
6153 }]
6154 }
6155 pub async fn name(&self) -> Result<String, DaggerError> {
6157 let query = self.selection.select("name");
6158 query.execute(self.graphql_client.clone()).await
6159 }
6160 pub fn source_map(&self) -> SourceMap {
6162 let query = self.selection.select("sourceMap");
6163 SourceMap {
6164 proc: self.proc.clone(),
6165 selection: query,
6166 graphql_client: self.graphql_client.clone(),
6167 }
6168 }
6169 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6171 let query = self.selection.select("sourceModuleName");
6172 query.execute(self.graphql_client.clone()).await
6173 }
6174 pub fn values(&self) -> Vec<EnumValueTypeDef> {
6175 let query = self.selection.select("values");
6176 vec![EnumValueTypeDef {
6177 proc: self.proc.clone(),
6178 selection: query,
6179 graphql_client: self.graphql_client.clone(),
6180 }]
6181 }
6182}
6183#[derive(Clone)]
6184pub struct EnumValueTypeDef {
6185 pub proc: Option<Arc<DaggerSessionProc>>,
6186 pub selection: Selection,
6187 pub graphql_client: DynGraphQLClient,
6188}
6189impl EnumValueTypeDef {
6190 pub async fn description(&self) -> Result<String, DaggerError> {
6192 let query = self.selection.select("description");
6193 query.execute(self.graphql_client.clone()).await
6194 }
6195 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6197 let query = self.selection.select("id");
6198 query.execute(self.graphql_client.clone()).await
6199 }
6200 pub async fn name(&self) -> Result<String, DaggerError> {
6202 let query = self.selection.select("name");
6203 query.execute(self.graphql_client.clone()).await
6204 }
6205 pub fn source_map(&self) -> SourceMap {
6207 let query = self.selection.select("sourceMap");
6208 SourceMap {
6209 proc: self.proc.clone(),
6210 selection: query,
6211 graphql_client: self.graphql_client.clone(),
6212 }
6213 }
6214 pub async fn value(&self) -> Result<String, DaggerError> {
6216 let query = self.selection.select("value");
6217 query.execute(self.graphql_client.clone()).await
6218 }
6219}
6220#[derive(Clone)]
6221pub struct Env {
6222 pub proc: Option<Arc<DaggerSessionProc>>,
6223 pub selection: Selection,
6224 pub graphql_client: DynGraphQLClient,
6225}
6226impl Env {
6227 pub async fn id(&self) -> Result<EnvId, DaggerError> {
6229 let query = self.selection.select("id");
6230 query.execute(self.graphql_client.clone()).await
6231 }
6232 pub fn input(&self, name: impl Into<String>) -> Binding {
6234 let mut query = self.selection.select("input");
6235 query = query.arg("name", name.into());
6236 Binding {
6237 proc: self.proc.clone(),
6238 selection: query,
6239 graphql_client: self.graphql_client.clone(),
6240 }
6241 }
6242 pub fn inputs(&self) -> Vec<Binding> {
6244 let query = self.selection.select("inputs");
6245 vec![Binding {
6246 proc: self.proc.clone(),
6247 selection: query,
6248 graphql_client: self.graphql_client.clone(),
6249 }]
6250 }
6251 pub fn output(&self, name: impl Into<String>) -> Binding {
6253 let mut query = self.selection.select("output");
6254 query = query.arg("name", name.into());
6255 Binding {
6256 proc: self.proc.clone(),
6257 selection: query,
6258 graphql_client: self.graphql_client.clone(),
6259 }
6260 }
6261 pub fn outputs(&self) -> Vec<Binding> {
6263 let query = self.selection.select("outputs");
6264 vec![Binding {
6265 proc: self.proc.clone(),
6266 selection: query,
6267 graphql_client: self.graphql_client.clone(),
6268 }]
6269 }
6270 pub fn with_address_input(
6278 &self,
6279 name: impl Into<String>,
6280 value: impl IntoID<AddressId>,
6281 description: impl Into<String>,
6282 ) -> Env {
6283 let mut query = self.selection.select("withAddressInput");
6284 query = query.arg("name", name.into());
6285 query = query.arg_lazy(
6286 "value",
6287 Box::new(move || {
6288 let value = value.clone();
6289 Box::pin(async move { value.into_id().await.unwrap().quote() })
6290 }),
6291 );
6292 query = query.arg("description", description.into());
6293 Env {
6294 proc: self.proc.clone(),
6295 selection: query,
6296 graphql_client: self.graphql_client.clone(),
6297 }
6298 }
6299 pub fn with_address_output(
6306 &self,
6307 name: impl Into<String>,
6308 description: impl Into<String>,
6309 ) -> Env {
6310 let mut query = self.selection.select("withAddressOutput");
6311 query = query.arg("name", name.into());
6312 query = query.arg("description", description.into());
6313 Env {
6314 proc: self.proc.clone(),
6315 selection: query,
6316 graphql_client: self.graphql_client.clone(),
6317 }
6318 }
6319 pub fn with_cache_volume_input(
6327 &self,
6328 name: impl Into<String>,
6329 value: impl IntoID<CacheVolumeId>,
6330 description: impl Into<String>,
6331 ) -> Env {
6332 let mut query = self.selection.select("withCacheVolumeInput");
6333 query = query.arg("name", name.into());
6334 query = query.arg_lazy(
6335 "value",
6336 Box::new(move || {
6337 let value = value.clone();
6338 Box::pin(async move { value.into_id().await.unwrap().quote() })
6339 }),
6340 );
6341 query = query.arg("description", description.into());
6342 Env {
6343 proc: self.proc.clone(),
6344 selection: query,
6345 graphql_client: self.graphql_client.clone(),
6346 }
6347 }
6348 pub fn with_cache_volume_output(
6355 &self,
6356 name: impl Into<String>,
6357 description: impl Into<String>,
6358 ) -> Env {
6359 let mut query = self.selection.select("withCacheVolumeOutput");
6360 query = query.arg("name", name.into());
6361 query = query.arg("description", description.into());
6362 Env {
6363 proc: self.proc.clone(),
6364 selection: query,
6365 graphql_client: self.graphql_client.clone(),
6366 }
6367 }
6368 pub fn with_changeset_input(
6376 &self,
6377 name: impl Into<String>,
6378 value: impl IntoID<ChangesetId>,
6379 description: impl Into<String>,
6380 ) -> Env {
6381 let mut query = self.selection.select("withChangesetInput");
6382 query = query.arg("name", name.into());
6383 query = query.arg_lazy(
6384 "value",
6385 Box::new(move || {
6386 let value = value.clone();
6387 Box::pin(async move { value.into_id().await.unwrap().quote() })
6388 }),
6389 );
6390 query = query.arg("description", description.into());
6391 Env {
6392 proc: self.proc.clone(),
6393 selection: query,
6394 graphql_client: self.graphql_client.clone(),
6395 }
6396 }
6397 pub fn with_changeset_output(
6404 &self,
6405 name: impl Into<String>,
6406 description: impl Into<String>,
6407 ) -> Env {
6408 let mut query = self.selection.select("withChangesetOutput");
6409 query = query.arg("name", name.into());
6410 query = query.arg("description", description.into());
6411 Env {
6412 proc: self.proc.clone(),
6413 selection: query,
6414 graphql_client: self.graphql_client.clone(),
6415 }
6416 }
6417 pub fn with_cloud_input(
6425 &self,
6426 name: impl Into<String>,
6427 value: impl IntoID<CloudId>,
6428 description: impl Into<String>,
6429 ) -> Env {
6430 let mut query = self.selection.select("withCloudInput");
6431 query = query.arg("name", name.into());
6432 query = query.arg_lazy(
6433 "value",
6434 Box::new(move || {
6435 let value = value.clone();
6436 Box::pin(async move { value.into_id().await.unwrap().quote() })
6437 }),
6438 );
6439 query = query.arg("description", description.into());
6440 Env {
6441 proc: self.proc.clone(),
6442 selection: query,
6443 graphql_client: self.graphql_client.clone(),
6444 }
6445 }
6446 pub fn with_cloud_output(
6453 &self,
6454 name: impl Into<String>,
6455 description: impl Into<String>,
6456 ) -> Env {
6457 let mut query = self.selection.select("withCloudOutput");
6458 query = query.arg("name", name.into());
6459 query = query.arg("description", description.into());
6460 Env {
6461 proc: self.proc.clone(),
6462 selection: query,
6463 graphql_client: self.graphql_client.clone(),
6464 }
6465 }
6466 pub fn with_container_input(
6474 &self,
6475 name: impl Into<String>,
6476 value: impl IntoID<ContainerId>,
6477 description: impl Into<String>,
6478 ) -> Env {
6479 let mut query = self.selection.select("withContainerInput");
6480 query = query.arg("name", name.into());
6481 query = query.arg_lazy(
6482 "value",
6483 Box::new(move || {
6484 let value = value.clone();
6485 Box::pin(async move { value.into_id().await.unwrap().quote() })
6486 }),
6487 );
6488 query = query.arg("description", description.into());
6489 Env {
6490 proc: self.proc.clone(),
6491 selection: query,
6492 graphql_client: self.graphql_client.clone(),
6493 }
6494 }
6495 pub fn with_container_output(
6502 &self,
6503 name: impl Into<String>,
6504 description: impl Into<String>,
6505 ) -> Env {
6506 let mut query = self.selection.select("withContainerOutput");
6507 query = query.arg("name", name.into());
6508 query = query.arg("description", description.into());
6509 Env {
6510 proc: self.proc.clone(),
6511 selection: query,
6512 graphql_client: self.graphql_client.clone(),
6513 }
6514 }
6515 pub fn with_current_module(&self) -> Env {
6518 let query = self.selection.select("withCurrentModule");
6519 Env {
6520 proc: self.proc.clone(),
6521 selection: query,
6522 graphql_client: self.graphql_client.clone(),
6523 }
6524 }
6525 pub fn with_directory_input(
6533 &self,
6534 name: impl Into<String>,
6535 value: impl IntoID<DirectoryId>,
6536 description: impl Into<String>,
6537 ) -> Env {
6538 let mut query = self.selection.select("withDirectoryInput");
6539 query = query.arg("name", name.into());
6540 query = query.arg_lazy(
6541 "value",
6542 Box::new(move || {
6543 let value = value.clone();
6544 Box::pin(async move { value.into_id().await.unwrap().quote() })
6545 }),
6546 );
6547 query = query.arg("description", description.into());
6548 Env {
6549 proc: self.proc.clone(),
6550 selection: query,
6551 graphql_client: self.graphql_client.clone(),
6552 }
6553 }
6554 pub fn with_directory_output(
6561 &self,
6562 name: impl Into<String>,
6563 description: impl Into<String>,
6564 ) -> Env {
6565 let mut query = self.selection.select("withDirectoryOutput");
6566 query = query.arg("name", name.into());
6567 query = query.arg("description", description.into());
6568 Env {
6569 proc: self.proc.clone(),
6570 selection: query,
6571 graphql_client: self.graphql_client.clone(),
6572 }
6573 }
6574 pub fn with_env_file_input(
6582 &self,
6583 name: impl Into<String>,
6584 value: impl IntoID<EnvFileId>,
6585 description: impl Into<String>,
6586 ) -> Env {
6587 let mut query = self.selection.select("withEnvFileInput");
6588 query = query.arg("name", name.into());
6589 query = query.arg_lazy(
6590 "value",
6591 Box::new(move || {
6592 let value = value.clone();
6593 Box::pin(async move { value.into_id().await.unwrap().quote() })
6594 }),
6595 );
6596 query = query.arg("description", description.into());
6597 Env {
6598 proc: self.proc.clone(),
6599 selection: query,
6600 graphql_client: self.graphql_client.clone(),
6601 }
6602 }
6603 pub fn with_env_file_output(
6610 &self,
6611 name: impl Into<String>,
6612 description: impl Into<String>,
6613 ) -> Env {
6614 let mut query = self.selection.select("withEnvFileOutput");
6615 query = query.arg("name", name.into());
6616 query = query.arg("description", description.into());
6617 Env {
6618 proc: self.proc.clone(),
6619 selection: query,
6620 graphql_client: self.graphql_client.clone(),
6621 }
6622 }
6623 pub fn with_env_input(
6631 &self,
6632 name: impl Into<String>,
6633 value: impl IntoID<EnvId>,
6634 description: impl Into<String>,
6635 ) -> Env {
6636 let mut query = self.selection.select("withEnvInput");
6637 query = query.arg("name", name.into());
6638 query = query.arg_lazy(
6639 "value",
6640 Box::new(move || {
6641 let value = value.clone();
6642 Box::pin(async move { value.into_id().await.unwrap().quote() })
6643 }),
6644 );
6645 query = query.arg("description", description.into());
6646 Env {
6647 proc: self.proc.clone(),
6648 selection: query,
6649 graphql_client: self.graphql_client.clone(),
6650 }
6651 }
6652 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6659 let mut query = self.selection.select("withEnvOutput");
6660 query = query.arg("name", name.into());
6661 query = query.arg("description", description.into());
6662 Env {
6663 proc: self.proc.clone(),
6664 selection: query,
6665 graphql_client: self.graphql_client.clone(),
6666 }
6667 }
6668 pub fn with_file_input(
6676 &self,
6677 name: impl Into<String>,
6678 value: impl IntoID<FileId>,
6679 description: impl Into<String>,
6680 ) -> Env {
6681 let mut query = self.selection.select("withFileInput");
6682 query = query.arg("name", name.into());
6683 query = query.arg_lazy(
6684 "value",
6685 Box::new(move || {
6686 let value = value.clone();
6687 Box::pin(async move { value.into_id().await.unwrap().quote() })
6688 }),
6689 );
6690 query = query.arg("description", description.into());
6691 Env {
6692 proc: self.proc.clone(),
6693 selection: query,
6694 graphql_client: self.graphql_client.clone(),
6695 }
6696 }
6697 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6704 let mut query = self.selection.select("withFileOutput");
6705 query = query.arg("name", name.into());
6706 query = query.arg("description", description.into());
6707 Env {
6708 proc: self.proc.clone(),
6709 selection: query,
6710 graphql_client: self.graphql_client.clone(),
6711 }
6712 }
6713 pub fn with_git_ref_input(
6721 &self,
6722 name: impl Into<String>,
6723 value: impl IntoID<GitRefId>,
6724 description: impl Into<String>,
6725 ) -> Env {
6726 let mut query = self.selection.select("withGitRefInput");
6727 query = query.arg("name", name.into());
6728 query = query.arg_lazy(
6729 "value",
6730 Box::new(move || {
6731 let value = value.clone();
6732 Box::pin(async move { value.into_id().await.unwrap().quote() })
6733 }),
6734 );
6735 query = query.arg("description", description.into());
6736 Env {
6737 proc: self.proc.clone(),
6738 selection: query,
6739 graphql_client: self.graphql_client.clone(),
6740 }
6741 }
6742 pub fn with_git_ref_output(
6749 &self,
6750 name: impl Into<String>,
6751 description: impl Into<String>,
6752 ) -> Env {
6753 let mut query = self.selection.select("withGitRefOutput");
6754 query = query.arg("name", name.into());
6755 query = query.arg("description", description.into());
6756 Env {
6757 proc: self.proc.clone(),
6758 selection: query,
6759 graphql_client: self.graphql_client.clone(),
6760 }
6761 }
6762 pub fn with_git_repository_input(
6770 &self,
6771 name: impl Into<String>,
6772 value: impl IntoID<GitRepositoryId>,
6773 description: impl Into<String>,
6774 ) -> Env {
6775 let mut query = self.selection.select("withGitRepositoryInput");
6776 query = query.arg("name", name.into());
6777 query = query.arg_lazy(
6778 "value",
6779 Box::new(move || {
6780 let value = value.clone();
6781 Box::pin(async move { value.into_id().await.unwrap().quote() })
6782 }),
6783 );
6784 query = query.arg("description", description.into());
6785 Env {
6786 proc: self.proc.clone(),
6787 selection: query,
6788 graphql_client: self.graphql_client.clone(),
6789 }
6790 }
6791 pub fn with_git_repository_output(
6798 &self,
6799 name: impl Into<String>,
6800 description: impl Into<String>,
6801 ) -> Env {
6802 let mut query = self.selection.select("withGitRepositoryOutput");
6803 query = query.arg("name", name.into());
6804 query = query.arg("description", description.into());
6805 Env {
6806 proc: self.proc.clone(),
6807 selection: query,
6808 graphql_client: self.graphql_client.clone(),
6809 }
6810 }
6811 pub fn with_json_value_input(
6819 &self,
6820 name: impl Into<String>,
6821 value: impl IntoID<JsonValueId>,
6822 description: impl Into<String>,
6823 ) -> Env {
6824 let mut query = self.selection.select("withJSONValueInput");
6825 query = query.arg("name", name.into());
6826 query = query.arg_lazy(
6827 "value",
6828 Box::new(move || {
6829 let value = value.clone();
6830 Box::pin(async move { value.into_id().await.unwrap().quote() })
6831 }),
6832 );
6833 query = query.arg("description", description.into());
6834 Env {
6835 proc: self.proc.clone(),
6836 selection: query,
6837 graphql_client: self.graphql_client.clone(),
6838 }
6839 }
6840 pub fn with_json_value_output(
6847 &self,
6848 name: impl Into<String>,
6849 description: impl Into<String>,
6850 ) -> Env {
6851 let mut query = self.selection.select("withJSONValueOutput");
6852 query = query.arg("name", name.into());
6853 query = query.arg("description", description.into());
6854 Env {
6855 proc: self.proc.clone(),
6856 selection: query,
6857 graphql_client: self.graphql_client.clone(),
6858 }
6859 }
6860 pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
6863 let mut query = self.selection.select("withModule");
6864 query = query.arg_lazy(
6865 "module",
6866 Box::new(move || {
6867 let module = module.clone();
6868 Box::pin(async move { module.into_id().await.unwrap().quote() })
6869 }),
6870 );
6871 Env {
6872 proc: self.proc.clone(),
6873 selection: query,
6874 graphql_client: self.graphql_client.clone(),
6875 }
6876 }
6877 pub fn with_module_config_client_input(
6885 &self,
6886 name: impl Into<String>,
6887 value: impl IntoID<ModuleConfigClientId>,
6888 description: impl Into<String>,
6889 ) -> Env {
6890 let mut query = self.selection.select("withModuleConfigClientInput");
6891 query = query.arg("name", name.into());
6892 query = query.arg_lazy(
6893 "value",
6894 Box::new(move || {
6895 let value = value.clone();
6896 Box::pin(async move { value.into_id().await.unwrap().quote() })
6897 }),
6898 );
6899 query = query.arg("description", description.into());
6900 Env {
6901 proc: self.proc.clone(),
6902 selection: query,
6903 graphql_client: self.graphql_client.clone(),
6904 }
6905 }
6906 pub fn with_module_config_client_output(
6913 &self,
6914 name: impl Into<String>,
6915 description: impl Into<String>,
6916 ) -> Env {
6917 let mut query = self.selection.select("withModuleConfigClientOutput");
6918 query = query.arg("name", name.into());
6919 query = query.arg("description", description.into());
6920 Env {
6921 proc: self.proc.clone(),
6922 selection: query,
6923 graphql_client: self.graphql_client.clone(),
6924 }
6925 }
6926 pub fn with_module_input(
6934 &self,
6935 name: impl Into<String>,
6936 value: impl IntoID<ModuleId>,
6937 description: impl Into<String>,
6938 ) -> Env {
6939 let mut query = self.selection.select("withModuleInput");
6940 query = query.arg("name", name.into());
6941 query = query.arg_lazy(
6942 "value",
6943 Box::new(move || {
6944 let value = value.clone();
6945 Box::pin(async move { value.into_id().await.unwrap().quote() })
6946 }),
6947 );
6948 query = query.arg("description", description.into());
6949 Env {
6950 proc: self.proc.clone(),
6951 selection: query,
6952 graphql_client: self.graphql_client.clone(),
6953 }
6954 }
6955 pub fn with_module_output(
6962 &self,
6963 name: impl Into<String>,
6964 description: impl Into<String>,
6965 ) -> Env {
6966 let mut query = self.selection.select("withModuleOutput");
6967 query = query.arg("name", name.into());
6968 query = query.arg("description", description.into());
6969 Env {
6970 proc: self.proc.clone(),
6971 selection: query,
6972 graphql_client: self.graphql_client.clone(),
6973 }
6974 }
6975 pub fn with_module_source_input(
6983 &self,
6984 name: impl Into<String>,
6985 value: impl IntoID<ModuleSourceId>,
6986 description: impl Into<String>,
6987 ) -> Env {
6988 let mut query = self.selection.select("withModuleSourceInput");
6989 query = query.arg("name", name.into());
6990 query = query.arg_lazy(
6991 "value",
6992 Box::new(move || {
6993 let value = value.clone();
6994 Box::pin(async move { value.into_id().await.unwrap().quote() })
6995 }),
6996 );
6997 query = query.arg("description", description.into());
6998 Env {
6999 proc: self.proc.clone(),
7000 selection: query,
7001 graphql_client: self.graphql_client.clone(),
7002 }
7003 }
7004 pub fn with_module_source_output(
7011 &self,
7012 name: impl Into<String>,
7013 description: impl Into<String>,
7014 ) -> Env {
7015 let mut query = self.selection.select("withModuleSourceOutput");
7016 query = query.arg("name", name.into());
7017 query = query.arg("description", description.into());
7018 Env {
7019 proc: self.proc.clone(),
7020 selection: query,
7021 graphql_client: self.graphql_client.clone(),
7022 }
7023 }
7024 pub fn with_search_result_input(
7032 &self,
7033 name: impl Into<String>,
7034 value: impl IntoID<SearchResultId>,
7035 description: impl Into<String>,
7036 ) -> Env {
7037 let mut query = self.selection.select("withSearchResultInput");
7038 query = query.arg("name", name.into());
7039 query = query.arg_lazy(
7040 "value",
7041 Box::new(move || {
7042 let value = value.clone();
7043 Box::pin(async move { value.into_id().await.unwrap().quote() })
7044 }),
7045 );
7046 query = query.arg("description", description.into());
7047 Env {
7048 proc: self.proc.clone(),
7049 selection: query,
7050 graphql_client: self.graphql_client.clone(),
7051 }
7052 }
7053 pub fn with_search_result_output(
7060 &self,
7061 name: impl Into<String>,
7062 description: impl Into<String>,
7063 ) -> Env {
7064 let mut query = self.selection.select("withSearchResultOutput");
7065 query = query.arg("name", name.into());
7066 query = query.arg("description", description.into());
7067 Env {
7068 proc: self.proc.clone(),
7069 selection: query,
7070 graphql_client: self.graphql_client.clone(),
7071 }
7072 }
7073 pub fn with_search_submatch_input(
7081 &self,
7082 name: impl Into<String>,
7083 value: impl IntoID<SearchSubmatchId>,
7084 description: impl Into<String>,
7085 ) -> Env {
7086 let mut query = self.selection.select("withSearchSubmatchInput");
7087 query = query.arg("name", name.into());
7088 query = query.arg_lazy(
7089 "value",
7090 Box::new(move || {
7091 let value = value.clone();
7092 Box::pin(async move { value.into_id().await.unwrap().quote() })
7093 }),
7094 );
7095 query = query.arg("description", description.into());
7096 Env {
7097 proc: self.proc.clone(),
7098 selection: query,
7099 graphql_client: self.graphql_client.clone(),
7100 }
7101 }
7102 pub fn with_search_submatch_output(
7109 &self,
7110 name: impl Into<String>,
7111 description: impl Into<String>,
7112 ) -> Env {
7113 let mut query = self.selection.select("withSearchSubmatchOutput");
7114 query = query.arg("name", name.into());
7115 query = query.arg("description", description.into());
7116 Env {
7117 proc: self.proc.clone(),
7118 selection: query,
7119 graphql_client: self.graphql_client.clone(),
7120 }
7121 }
7122 pub fn with_secret_input(
7130 &self,
7131 name: impl Into<String>,
7132 value: impl IntoID<SecretId>,
7133 description: impl Into<String>,
7134 ) -> Env {
7135 let mut query = self.selection.select("withSecretInput");
7136 query = query.arg("name", name.into());
7137 query = query.arg_lazy(
7138 "value",
7139 Box::new(move || {
7140 let value = value.clone();
7141 Box::pin(async move { value.into_id().await.unwrap().quote() })
7142 }),
7143 );
7144 query = query.arg("description", description.into());
7145 Env {
7146 proc: self.proc.clone(),
7147 selection: query,
7148 graphql_client: self.graphql_client.clone(),
7149 }
7150 }
7151 pub fn with_secret_output(
7158 &self,
7159 name: impl Into<String>,
7160 description: impl Into<String>,
7161 ) -> Env {
7162 let mut query = self.selection.select("withSecretOutput");
7163 query = query.arg("name", name.into());
7164 query = query.arg("description", description.into());
7165 Env {
7166 proc: self.proc.clone(),
7167 selection: query,
7168 graphql_client: self.graphql_client.clone(),
7169 }
7170 }
7171 pub fn with_service_input(
7179 &self,
7180 name: impl Into<String>,
7181 value: impl IntoID<ServiceId>,
7182 description: impl Into<String>,
7183 ) -> Env {
7184 let mut query = self.selection.select("withServiceInput");
7185 query = query.arg("name", name.into());
7186 query = query.arg_lazy(
7187 "value",
7188 Box::new(move || {
7189 let value = value.clone();
7190 Box::pin(async move { value.into_id().await.unwrap().quote() })
7191 }),
7192 );
7193 query = query.arg("description", description.into());
7194 Env {
7195 proc: self.proc.clone(),
7196 selection: query,
7197 graphql_client: self.graphql_client.clone(),
7198 }
7199 }
7200 pub fn with_service_output(
7207 &self,
7208 name: impl Into<String>,
7209 description: impl Into<String>,
7210 ) -> Env {
7211 let mut query = self.selection.select("withServiceOutput");
7212 query = query.arg("name", name.into());
7213 query = query.arg("description", description.into());
7214 Env {
7215 proc: self.proc.clone(),
7216 selection: query,
7217 graphql_client: self.graphql_client.clone(),
7218 }
7219 }
7220 pub fn with_socket_input(
7228 &self,
7229 name: impl Into<String>,
7230 value: impl IntoID<SocketId>,
7231 description: impl Into<String>,
7232 ) -> Env {
7233 let mut query = self.selection.select("withSocketInput");
7234 query = query.arg("name", name.into());
7235 query = query.arg_lazy(
7236 "value",
7237 Box::new(move || {
7238 let value = value.clone();
7239 Box::pin(async move { value.into_id().await.unwrap().quote() })
7240 }),
7241 );
7242 query = query.arg("description", description.into());
7243 Env {
7244 proc: self.proc.clone(),
7245 selection: query,
7246 graphql_client: self.graphql_client.clone(),
7247 }
7248 }
7249 pub fn with_socket_output(
7256 &self,
7257 name: impl Into<String>,
7258 description: impl Into<String>,
7259 ) -> Env {
7260 let mut query = self.selection.select("withSocketOutput");
7261 query = query.arg("name", name.into());
7262 query = query.arg("description", description.into());
7263 Env {
7264 proc: self.proc.clone(),
7265 selection: query,
7266 graphql_client: self.graphql_client.clone(),
7267 }
7268 }
7269 pub fn with_string_input(
7277 &self,
7278 name: impl Into<String>,
7279 value: impl Into<String>,
7280 description: impl Into<String>,
7281 ) -> Env {
7282 let mut query = self.selection.select("withStringInput");
7283 query = query.arg("name", name.into());
7284 query = query.arg("value", value.into());
7285 query = query.arg("description", description.into());
7286 Env {
7287 proc: self.proc.clone(),
7288 selection: query,
7289 graphql_client: self.graphql_client.clone(),
7290 }
7291 }
7292 pub fn with_string_output(
7299 &self,
7300 name: impl Into<String>,
7301 description: impl Into<String>,
7302 ) -> Env {
7303 let mut query = self.selection.select("withStringOutput");
7304 query = query.arg("name", name.into());
7305 query = query.arg("description", description.into());
7306 Env {
7307 proc: self.proc.clone(),
7308 selection: query,
7309 graphql_client: self.graphql_client.clone(),
7310 }
7311 }
7312 pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
7318 let mut query = self.selection.select("withWorkspace");
7319 query = query.arg_lazy(
7320 "workspace",
7321 Box::new(move || {
7322 let workspace = workspace.clone();
7323 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7324 }),
7325 );
7326 Env {
7327 proc: self.proc.clone(),
7328 selection: query,
7329 graphql_client: self.graphql_client.clone(),
7330 }
7331 }
7332 pub fn without_outputs(&self) -> Env {
7334 let query = self.selection.select("withoutOutputs");
7335 Env {
7336 proc: self.proc.clone(),
7337 selection: query,
7338 graphql_client: self.graphql_client.clone(),
7339 }
7340 }
7341 pub fn workspace(&self) -> Directory {
7342 let query = self.selection.select("workspace");
7343 Directory {
7344 proc: self.proc.clone(),
7345 selection: query,
7346 graphql_client: self.graphql_client.clone(),
7347 }
7348 }
7349}
7350#[derive(Clone)]
7351pub struct EnvFile {
7352 pub proc: Option<Arc<DaggerSessionProc>>,
7353 pub selection: Selection,
7354 pub graphql_client: DynGraphQLClient,
7355}
7356#[derive(Builder, Debug, PartialEq)]
7357pub struct EnvFileGetOpts {
7358 #[builder(setter(into, strip_option), default)]
7360 pub raw: Option<bool>,
7361}
7362#[derive(Builder, Debug, PartialEq)]
7363pub struct EnvFileVariablesOpts {
7364 #[builder(setter(into, strip_option), default)]
7366 pub raw: Option<bool>,
7367}
7368impl EnvFile {
7369 pub fn as_file(&self) -> File {
7371 let query = self.selection.select("asFile");
7372 File {
7373 proc: self.proc.clone(),
7374 selection: query,
7375 graphql_client: self.graphql_client.clone(),
7376 }
7377 }
7378 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7384 let mut query = self.selection.select("exists");
7385 query = query.arg("name", name.into());
7386 query.execute(self.graphql_client.clone()).await
7387 }
7388 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7395 let mut query = self.selection.select("get");
7396 query = query.arg("name", name.into());
7397 query.execute(self.graphql_client.clone()).await
7398 }
7399 pub async fn get_opts(
7406 &self,
7407 name: impl Into<String>,
7408 opts: EnvFileGetOpts,
7409 ) -> Result<String, DaggerError> {
7410 let mut query = self.selection.select("get");
7411 query = query.arg("name", name.into());
7412 if let Some(raw) = opts.raw {
7413 query = query.arg("raw", raw);
7414 }
7415 query.execute(self.graphql_client.clone()).await
7416 }
7417 pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7419 let query = self.selection.select("id");
7420 query.execute(self.graphql_client.clone()).await
7421 }
7422 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
7428 let mut query = self.selection.select("namespace");
7429 query = query.arg("prefix", prefix.into());
7430 EnvFile {
7431 proc: self.proc.clone(),
7432 selection: query,
7433 graphql_client: self.graphql_client.clone(),
7434 }
7435 }
7436 pub fn variables(&self) -> Vec<EnvVariable> {
7442 let query = self.selection.select("variables");
7443 vec![EnvVariable {
7444 proc: self.proc.clone(),
7445 selection: query,
7446 graphql_client: self.graphql_client.clone(),
7447 }]
7448 }
7449 pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
7455 let mut query = self.selection.select("variables");
7456 if let Some(raw) = opts.raw {
7457 query = query.arg("raw", raw);
7458 }
7459 vec![EnvVariable {
7460 proc: self.proc.clone(),
7461 selection: query,
7462 graphql_client: self.graphql_client.clone(),
7463 }]
7464 }
7465 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7472 let mut query = self.selection.select("withVariable");
7473 query = query.arg("name", name.into());
7474 query = query.arg("value", value.into());
7475 EnvFile {
7476 proc: self.proc.clone(),
7477 selection: query,
7478 graphql_client: self.graphql_client.clone(),
7479 }
7480 }
7481 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7487 let mut query = self.selection.select("withoutVariable");
7488 query = query.arg("name", name.into());
7489 EnvFile {
7490 proc: self.proc.clone(),
7491 selection: query,
7492 graphql_client: self.graphql_client.clone(),
7493 }
7494 }
7495}
7496#[derive(Clone)]
7497pub struct EnvVariable {
7498 pub proc: Option<Arc<DaggerSessionProc>>,
7499 pub selection: Selection,
7500 pub graphql_client: DynGraphQLClient,
7501}
7502impl EnvVariable {
7503 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
7505 let query = self.selection.select("id");
7506 query.execute(self.graphql_client.clone()).await
7507 }
7508 pub async fn name(&self) -> Result<String, DaggerError> {
7510 let query = self.selection.select("name");
7511 query.execute(self.graphql_client.clone()).await
7512 }
7513 pub async fn value(&self) -> Result<String, DaggerError> {
7515 let query = self.selection.select("value");
7516 query.execute(self.graphql_client.clone()).await
7517 }
7518}
7519#[derive(Clone)]
7520pub struct Error {
7521 pub proc: Option<Arc<DaggerSessionProc>>,
7522 pub selection: Selection,
7523 pub graphql_client: DynGraphQLClient,
7524}
7525impl Error {
7526 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
7528 let query = self.selection.select("id");
7529 query.execute(self.graphql_client.clone()).await
7530 }
7531 pub async fn message(&self) -> Result<String, DaggerError> {
7533 let query = self.selection.select("message");
7534 query.execute(self.graphql_client.clone()).await
7535 }
7536 pub fn values(&self) -> Vec<ErrorValue> {
7538 let query = self.selection.select("values");
7539 vec![ErrorValue {
7540 proc: self.proc.clone(),
7541 selection: query,
7542 graphql_client: self.graphql_client.clone(),
7543 }]
7544 }
7545 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7552 let mut query = self.selection.select("withValue");
7553 query = query.arg("name", name.into());
7554 query = query.arg("value", value);
7555 Error {
7556 proc: self.proc.clone(),
7557 selection: query,
7558 graphql_client: self.graphql_client.clone(),
7559 }
7560 }
7561}
7562#[derive(Clone)]
7563pub struct ErrorValue {
7564 pub proc: Option<Arc<DaggerSessionProc>>,
7565 pub selection: Selection,
7566 pub graphql_client: DynGraphQLClient,
7567}
7568impl ErrorValue {
7569 pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
7571 let query = self.selection.select("id");
7572 query.execute(self.graphql_client.clone()).await
7573 }
7574 pub async fn name(&self) -> Result<String, DaggerError> {
7576 let query = self.selection.select("name");
7577 query.execute(self.graphql_client.clone()).await
7578 }
7579 pub async fn value(&self) -> Result<Json, DaggerError> {
7581 let query = self.selection.select("value");
7582 query.execute(self.graphql_client.clone()).await
7583 }
7584}
7585#[derive(Clone)]
7586pub struct FieldTypeDef {
7587 pub proc: Option<Arc<DaggerSessionProc>>,
7588 pub selection: Selection,
7589 pub graphql_client: DynGraphQLClient,
7590}
7591impl FieldTypeDef {
7592 pub async fn description(&self) -> Result<String, DaggerError> {
7594 let query = self.selection.select("description");
7595 query.execute(self.graphql_client.clone()).await
7596 }
7597 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
7599 let query = self.selection.select("id");
7600 query.execute(self.graphql_client.clone()).await
7601 }
7602 pub async fn name(&self) -> Result<String, DaggerError> {
7604 let query = self.selection.select("name");
7605 query.execute(self.graphql_client.clone()).await
7606 }
7607 pub fn source_map(&self) -> SourceMap {
7609 let query = self.selection.select("sourceMap");
7610 SourceMap {
7611 proc: self.proc.clone(),
7612 selection: query,
7613 graphql_client: self.graphql_client.clone(),
7614 }
7615 }
7616 pub fn type_def(&self) -> TypeDef {
7618 let query = self.selection.select("typeDef");
7619 TypeDef {
7620 proc: self.proc.clone(),
7621 selection: query,
7622 graphql_client: self.graphql_client.clone(),
7623 }
7624 }
7625}
7626#[derive(Clone)]
7627pub struct File {
7628 pub proc: Option<Arc<DaggerSessionProc>>,
7629 pub selection: Selection,
7630 pub graphql_client: DynGraphQLClient,
7631}
7632#[derive(Builder, Debug, PartialEq)]
7633pub struct FileAsEnvFileOpts {
7634 #[builder(setter(into, strip_option), default)]
7636 pub expand: Option<bool>,
7637}
7638#[derive(Builder, Debug, PartialEq)]
7639pub struct FileContentsOpts {
7640 #[builder(setter(into, strip_option), default)]
7642 pub limit_lines: Option<isize>,
7643 #[builder(setter(into, strip_option), default)]
7645 pub offset_lines: Option<isize>,
7646}
7647#[derive(Builder, Debug, PartialEq)]
7648pub struct FileDigestOpts {
7649 #[builder(setter(into, strip_option), default)]
7651 pub exclude_metadata: Option<bool>,
7652}
7653#[derive(Builder, Debug, PartialEq)]
7654pub struct FileExportOpts {
7655 #[builder(setter(into, strip_option), default)]
7657 pub allow_parent_dir_path: Option<bool>,
7658}
7659#[derive(Builder, Debug, PartialEq)]
7660pub struct FileSearchOpts<'a> {
7661 #[builder(setter(into, strip_option), default)]
7663 pub dotall: Option<bool>,
7664 #[builder(setter(into, strip_option), default)]
7666 pub files_only: Option<bool>,
7667 #[builder(setter(into, strip_option), default)]
7668 pub globs: Option<Vec<&'a str>>,
7669 #[builder(setter(into, strip_option), default)]
7671 pub insensitive: Option<bool>,
7672 #[builder(setter(into, strip_option), default)]
7674 pub limit: Option<isize>,
7675 #[builder(setter(into, strip_option), default)]
7677 pub literal: Option<bool>,
7678 #[builder(setter(into, strip_option), default)]
7680 pub multiline: Option<bool>,
7681 #[builder(setter(into, strip_option), default)]
7682 pub paths: Option<Vec<&'a str>>,
7683 #[builder(setter(into, strip_option), default)]
7685 pub skip_hidden: Option<bool>,
7686 #[builder(setter(into, strip_option), default)]
7688 pub skip_ignored: Option<bool>,
7689}
7690#[derive(Builder, Debug, PartialEq)]
7691pub struct FileWithReplacedOpts {
7692 #[builder(setter(into, strip_option), default)]
7694 pub all: Option<bool>,
7695 #[builder(setter(into, strip_option), default)]
7697 pub first_from: Option<isize>,
7698}
7699impl File {
7700 pub fn as_env_file(&self) -> EnvFile {
7706 let query = self.selection.select("asEnvFile");
7707 EnvFile {
7708 proc: self.proc.clone(),
7709 selection: query,
7710 graphql_client: self.graphql_client.clone(),
7711 }
7712 }
7713 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7719 let mut query = self.selection.select("asEnvFile");
7720 if let Some(expand) = opts.expand {
7721 query = query.arg("expand", expand);
7722 }
7723 EnvFile {
7724 proc: self.proc.clone(),
7725 selection: query,
7726 graphql_client: self.graphql_client.clone(),
7727 }
7728 }
7729 pub fn chown(&self, owner: impl Into<String>) -> File {
7739 let mut query = self.selection.select("chown");
7740 query = query.arg("owner", owner.into());
7741 File {
7742 proc: self.proc.clone(),
7743 selection: query,
7744 graphql_client: self.graphql_client.clone(),
7745 }
7746 }
7747 pub async fn contents(&self) -> Result<String, DaggerError> {
7753 let query = self.selection.select("contents");
7754 query.execute(self.graphql_client.clone()).await
7755 }
7756 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7762 let mut query = self.selection.select("contents");
7763 if let Some(offset_lines) = opts.offset_lines {
7764 query = query.arg("offsetLines", offset_lines);
7765 }
7766 if let Some(limit_lines) = opts.limit_lines {
7767 query = query.arg("limitLines", limit_lines);
7768 }
7769 query.execute(self.graphql_client.clone()).await
7770 }
7771 pub async fn digest(&self) -> Result<String, DaggerError> {
7777 let query = self.selection.select("digest");
7778 query.execute(self.graphql_client.clone()).await
7779 }
7780 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7786 let mut query = self.selection.select("digest");
7787 if let Some(exclude_metadata) = opts.exclude_metadata {
7788 query = query.arg("excludeMetadata", exclude_metadata);
7789 }
7790 query.execute(self.graphql_client.clone()).await
7791 }
7792 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7799 let mut query = self.selection.select("export");
7800 query = query.arg("path", path.into());
7801 query.execute(self.graphql_client.clone()).await
7802 }
7803 pub async fn export_opts(
7810 &self,
7811 path: impl Into<String>,
7812 opts: FileExportOpts,
7813 ) -> Result<String, DaggerError> {
7814 let mut query = self.selection.select("export");
7815 query = query.arg("path", path.into());
7816 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7817 query = query.arg("allowParentDirPath", allow_parent_dir_path);
7818 }
7819 query.execute(self.graphql_client.clone()).await
7820 }
7821 pub async fn id(&self) -> Result<FileId, DaggerError> {
7823 let query = self.selection.select("id");
7824 query.execute(self.graphql_client.clone()).await
7825 }
7826 pub async fn name(&self) -> Result<String, DaggerError> {
7828 let query = self.selection.select("name");
7829 query.execute(self.graphql_client.clone()).await
7830 }
7831 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7839 let mut query = self.selection.select("search");
7840 query = query.arg("pattern", pattern.into());
7841 vec![SearchResult {
7842 proc: self.proc.clone(),
7843 selection: query,
7844 graphql_client: self.graphql_client.clone(),
7845 }]
7846 }
7847 pub fn search_opts<'a>(
7855 &self,
7856 pattern: impl Into<String>,
7857 opts: FileSearchOpts<'a>,
7858 ) -> Vec<SearchResult> {
7859 let mut query = self.selection.select("search");
7860 query = query.arg("pattern", pattern.into());
7861 if let Some(literal) = opts.literal {
7862 query = query.arg("literal", literal);
7863 }
7864 if let Some(multiline) = opts.multiline {
7865 query = query.arg("multiline", multiline);
7866 }
7867 if let Some(dotall) = opts.dotall {
7868 query = query.arg("dotall", dotall);
7869 }
7870 if let Some(insensitive) = opts.insensitive {
7871 query = query.arg("insensitive", insensitive);
7872 }
7873 if let Some(skip_ignored) = opts.skip_ignored {
7874 query = query.arg("skipIgnored", skip_ignored);
7875 }
7876 if let Some(skip_hidden) = opts.skip_hidden {
7877 query = query.arg("skipHidden", skip_hidden);
7878 }
7879 if let Some(files_only) = opts.files_only {
7880 query = query.arg("filesOnly", files_only);
7881 }
7882 if let Some(limit) = opts.limit {
7883 query = query.arg("limit", limit);
7884 }
7885 if let Some(paths) = opts.paths {
7886 query = query.arg("paths", paths);
7887 }
7888 if let Some(globs) = opts.globs {
7889 query = query.arg("globs", globs);
7890 }
7891 vec![SearchResult {
7892 proc: self.proc.clone(),
7893 selection: query,
7894 graphql_client: self.graphql_client.clone(),
7895 }]
7896 }
7897 pub async fn size(&self) -> Result<isize, DaggerError> {
7899 let query = self.selection.select("size");
7900 query.execute(self.graphql_client.clone()).await
7901 }
7902 pub async fn sync(&self) -> Result<FileId, DaggerError> {
7904 let query = self.selection.select("sync");
7905 query.execute(self.graphql_client.clone()).await
7906 }
7907 pub fn with_name(&self, name: impl Into<String>) -> File {
7913 let mut query = self.selection.select("withName");
7914 query = query.arg("name", name.into());
7915 File {
7916 proc: self.proc.clone(),
7917 selection: query,
7918 graphql_client: self.graphql_client.clone(),
7919 }
7920 }
7921 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7933 let mut query = self.selection.select("withReplaced");
7934 query = query.arg("search", search.into());
7935 query = query.arg("replacement", replacement.into());
7936 File {
7937 proc: self.proc.clone(),
7938 selection: query,
7939 graphql_client: self.graphql_client.clone(),
7940 }
7941 }
7942 pub fn with_replaced_opts(
7954 &self,
7955 search: impl Into<String>,
7956 replacement: impl Into<String>,
7957 opts: FileWithReplacedOpts,
7958 ) -> File {
7959 let mut query = self.selection.select("withReplaced");
7960 query = query.arg("search", search.into());
7961 query = query.arg("replacement", replacement.into());
7962 if let Some(all) = opts.all {
7963 query = query.arg("all", all);
7964 }
7965 if let Some(first_from) = opts.first_from {
7966 query = query.arg("firstFrom", first_from);
7967 }
7968 File {
7969 proc: self.proc.clone(),
7970 selection: query,
7971 graphql_client: self.graphql_client.clone(),
7972 }
7973 }
7974 pub fn with_timestamps(&self, timestamp: isize) -> File {
7982 let mut query = self.selection.select("withTimestamps");
7983 query = query.arg("timestamp", timestamp);
7984 File {
7985 proc: self.proc.clone(),
7986 selection: query,
7987 graphql_client: self.graphql_client.clone(),
7988 }
7989 }
7990}
7991#[derive(Clone)]
7992pub struct Function {
7993 pub proc: Option<Arc<DaggerSessionProc>>,
7994 pub selection: Selection,
7995 pub graphql_client: DynGraphQLClient,
7996}
7997#[derive(Builder, Debug, PartialEq)]
7998pub struct FunctionWithArgOpts<'a> {
7999 #[builder(setter(into, strip_option), default)]
8001 pub default_path: Option<&'a str>,
8002 #[builder(setter(into, strip_option), default)]
8004 pub default_value: Option<Json>,
8005 #[builder(setter(into, strip_option), default)]
8007 pub description: Option<&'a str>,
8008 #[builder(setter(into, strip_option), default)]
8010 pub ignore: Option<Vec<&'a str>>,
8011 #[builder(setter(into, strip_option), default)]
8013 pub source_map: Option<SourceMapId>,
8014}
8015impl Function {
8016 pub fn args(&self) -> Vec<FunctionArg> {
8018 let query = self.selection.select("args");
8019 vec![FunctionArg {
8020 proc: self.proc.clone(),
8021 selection: query,
8022 graphql_client: self.graphql_client.clone(),
8023 }]
8024 }
8025 pub async fn description(&self) -> Result<String, DaggerError> {
8027 let query = self.selection.select("description");
8028 query.execute(self.graphql_client.clone()).await
8029 }
8030 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
8032 let query = self.selection.select("id");
8033 query.execute(self.graphql_client.clone()).await
8034 }
8035 pub async fn name(&self) -> Result<String, DaggerError> {
8037 let query = self.selection.select("name");
8038 query.execute(self.graphql_client.clone()).await
8039 }
8040 pub fn return_type(&self) -> TypeDef {
8042 let query = self.selection.select("returnType");
8043 TypeDef {
8044 proc: self.proc.clone(),
8045 selection: query,
8046 graphql_client: self.graphql_client.clone(),
8047 }
8048 }
8049 pub fn source_map(&self) -> SourceMap {
8051 let query = self.selection.select("sourceMap");
8052 SourceMap {
8053 proc: self.proc.clone(),
8054 selection: query,
8055 graphql_client: self.graphql_client.clone(),
8056 }
8057 }
8058 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
8066 let mut query = self.selection.select("withArg");
8067 query = query.arg("name", name.into());
8068 query = query.arg_lazy(
8069 "typeDef",
8070 Box::new(move || {
8071 let type_def = type_def.clone();
8072 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8073 }),
8074 );
8075 Function {
8076 proc: self.proc.clone(),
8077 selection: query,
8078 graphql_client: self.graphql_client.clone(),
8079 }
8080 }
8081 pub fn with_arg_opts<'a>(
8089 &self,
8090 name: impl Into<String>,
8091 type_def: impl IntoID<TypeDefId>,
8092 opts: FunctionWithArgOpts<'a>,
8093 ) -> Function {
8094 let mut query = self.selection.select("withArg");
8095 query = query.arg("name", name.into());
8096 query = query.arg_lazy(
8097 "typeDef",
8098 Box::new(move || {
8099 let type_def = type_def.clone();
8100 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8101 }),
8102 );
8103 if let Some(description) = opts.description {
8104 query = query.arg("description", description);
8105 }
8106 if let Some(default_value) = opts.default_value {
8107 query = query.arg("defaultValue", default_value);
8108 }
8109 if let Some(default_path) = opts.default_path {
8110 query = query.arg("defaultPath", default_path);
8111 }
8112 if let Some(ignore) = opts.ignore {
8113 query = query.arg("ignore", ignore);
8114 }
8115 if let Some(source_map) = opts.source_map {
8116 query = query.arg("sourceMap", source_map);
8117 }
8118 Function {
8119 proc: self.proc.clone(),
8120 selection: query,
8121 graphql_client: self.graphql_client.clone(),
8122 }
8123 }
8124 pub fn with_description(&self, description: impl Into<String>) -> Function {
8130 let mut query = self.selection.select("withDescription");
8131 query = query.arg("description", description.into());
8132 Function {
8133 proc: self.proc.clone(),
8134 selection: query,
8135 graphql_client: self.graphql_client.clone(),
8136 }
8137 }
8138 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
8144 let mut query = self.selection.select("withSourceMap");
8145 query = query.arg_lazy(
8146 "sourceMap",
8147 Box::new(move || {
8148 let source_map = source_map.clone();
8149 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8150 }),
8151 );
8152 Function {
8153 proc: self.proc.clone(),
8154 selection: query,
8155 graphql_client: self.graphql_client.clone(),
8156 }
8157 }
8158}
8159#[derive(Clone)]
8160pub struct FunctionArg {
8161 pub proc: Option<Arc<DaggerSessionProc>>,
8162 pub selection: Selection,
8163 pub graphql_client: DynGraphQLClient,
8164}
8165impl FunctionArg {
8166 pub async fn default_path(&self) -> Result<String, DaggerError> {
8168 let query = self.selection.select("defaultPath");
8169 query.execute(self.graphql_client.clone()).await
8170 }
8171 pub async fn default_value(&self) -> Result<Json, DaggerError> {
8173 let query = self.selection.select("defaultValue");
8174 query.execute(self.graphql_client.clone()).await
8175 }
8176 pub async fn description(&self) -> Result<String, DaggerError> {
8178 let query = self.selection.select("description");
8179 query.execute(self.graphql_client.clone()).await
8180 }
8181 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
8183 let query = self.selection.select("id");
8184 query.execute(self.graphql_client.clone()).await
8185 }
8186 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8188 let query = self.selection.select("ignore");
8189 query.execute(self.graphql_client.clone()).await
8190 }
8191 pub async fn name(&self) -> Result<String, DaggerError> {
8193 let query = self.selection.select("name");
8194 query.execute(self.graphql_client.clone()).await
8195 }
8196 pub fn source_map(&self) -> SourceMap {
8198 let query = self.selection.select("sourceMap");
8199 SourceMap {
8200 proc: self.proc.clone(),
8201 selection: query,
8202 graphql_client: self.graphql_client.clone(),
8203 }
8204 }
8205 pub fn type_def(&self) -> TypeDef {
8207 let query = self.selection.select("typeDef");
8208 TypeDef {
8209 proc: self.proc.clone(),
8210 selection: query,
8211 graphql_client: self.graphql_client.clone(),
8212 }
8213 }
8214}
8215#[derive(Clone)]
8216pub struct FunctionCall {
8217 pub proc: Option<Arc<DaggerSessionProc>>,
8218 pub selection: Selection,
8219 pub graphql_client: DynGraphQLClient,
8220}
8221impl FunctionCall {
8222 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
8224 let query = self.selection.select("id");
8225 query.execute(self.graphql_client.clone()).await
8226 }
8227 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
8229 let query = self.selection.select("inputArgs");
8230 vec![FunctionCallArgValue {
8231 proc: self.proc.clone(),
8232 selection: query,
8233 graphql_client: self.graphql_client.clone(),
8234 }]
8235 }
8236 pub async fn name(&self) -> Result<String, DaggerError> {
8238 let query = self.selection.select("name");
8239 query.execute(self.graphql_client.clone()).await
8240 }
8241 pub async fn parent(&self) -> Result<Json, DaggerError> {
8243 let query = self.selection.select("parent");
8244 query.execute(self.graphql_client.clone()).await
8245 }
8246 pub async fn parent_name(&self) -> Result<String, DaggerError> {
8248 let query = self.selection.select("parentName");
8249 query.execute(self.graphql_client.clone()).await
8250 }
8251 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
8257 let mut query = self.selection.select("returnError");
8258 query = query.arg_lazy(
8259 "error",
8260 Box::new(move || {
8261 let error = error.clone();
8262 Box::pin(async move { error.into_id().await.unwrap().quote() })
8263 }),
8264 );
8265 query.execute(self.graphql_client.clone()).await
8266 }
8267 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8273 let mut query = self.selection.select("returnValue");
8274 query = query.arg("value", value);
8275 query.execute(self.graphql_client.clone()).await
8276 }
8277}
8278#[derive(Clone)]
8279pub struct FunctionCallArgValue {
8280 pub proc: Option<Arc<DaggerSessionProc>>,
8281 pub selection: Selection,
8282 pub graphql_client: DynGraphQLClient,
8283}
8284impl FunctionCallArgValue {
8285 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8287 let query = self.selection.select("id");
8288 query.execute(self.graphql_client.clone()).await
8289 }
8290 pub async fn name(&self) -> Result<String, DaggerError> {
8292 let query = self.selection.select("name");
8293 query.execute(self.graphql_client.clone()).await
8294 }
8295 pub async fn value(&self) -> Result<Json, DaggerError> {
8297 let query = self.selection.select("value");
8298 query.execute(self.graphql_client.clone()).await
8299 }
8300}
8301#[derive(Clone)]
8302pub struct GeneratedCode {
8303 pub proc: Option<Arc<DaggerSessionProc>>,
8304 pub selection: Selection,
8305 pub graphql_client: DynGraphQLClient,
8306}
8307impl GeneratedCode {
8308 pub fn code(&self) -> Directory {
8310 let query = self.selection.select("code");
8311 Directory {
8312 proc: self.proc.clone(),
8313 selection: query,
8314 graphql_client: self.graphql_client.clone(),
8315 }
8316 }
8317 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8319 let query = self.selection.select("id");
8320 query.execute(self.graphql_client.clone()).await
8321 }
8322 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8324 let query = self.selection.select("vcsGeneratedPaths");
8325 query.execute(self.graphql_client.clone()).await
8326 }
8327 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8329 let query = self.selection.select("vcsIgnoredPaths");
8330 query.execute(self.graphql_client.clone()).await
8331 }
8332 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8334 let mut query = self.selection.select("withVCSGeneratedPaths");
8335 query = query.arg(
8336 "paths",
8337 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8338 );
8339 GeneratedCode {
8340 proc: self.proc.clone(),
8341 selection: query,
8342 graphql_client: self.graphql_client.clone(),
8343 }
8344 }
8345 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8347 let mut query = self.selection.select("withVCSIgnoredPaths");
8348 query = query.arg(
8349 "paths",
8350 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8351 );
8352 GeneratedCode {
8353 proc: self.proc.clone(),
8354 selection: query,
8355 graphql_client: self.graphql_client.clone(),
8356 }
8357 }
8358}
8359#[derive(Clone)]
8360pub struct GitRef {
8361 pub proc: Option<Arc<DaggerSessionProc>>,
8362 pub selection: Selection,
8363 pub graphql_client: DynGraphQLClient,
8364}
8365#[derive(Builder, Debug, PartialEq)]
8366pub struct GitRefTreeOpts {
8367 #[builder(setter(into, strip_option), default)]
8369 pub depth: Option<isize>,
8370 #[builder(setter(into, strip_option), default)]
8372 pub discard_git_dir: Option<bool>,
8373}
8374impl GitRef {
8375 pub async fn commit(&self) -> Result<String, DaggerError> {
8377 let query = self.selection.select("commit");
8378 query.execute(self.graphql_client.clone()).await
8379 }
8380 pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
8386 let mut query = self.selection.select("commonAncestor");
8387 query = query.arg_lazy(
8388 "other",
8389 Box::new(move || {
8390 let other = other.clone();
8391 Box::pin(async move { other.into_id().await.unwrap().quote() })
8392 }),
8393 );
8394 GitRef {
8395 proc: self.proc.clone(),
8396 selection: query,
8397 graphql_client: self.graphql_client.clone(),
8398 }
8399 }
8400 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
8402 let query = self.selection.select("id");
8403 query.execute(self.graphql_client.clone()).await
8404 }
8405 pub async fn r#ref(&self) -> Result<String, DaggerError> {
8407 let query = self.selection.select("ref");
8408 query.execute(self.graphql_client.clone()).await
8409 }
8410 pub fn tree(&self) -> Directory {
8416 let query = self.selection.select("tree");
8417 Directory {
8418 proc: self.proc.clone(),
8419 selection: query,
8420 graphql_client: self.graphql_client.clone(),
8421 }
8422 }
8423 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
8429 let mut query = self.selection.select("tree");
8430 if let Some(discard_git_dir) = opts.discard_git_dir {
8431 query = query.arg("discardGitDir", discard_git_dir);
8432 }
8433 if let Some(depth) = opts.depth {
8434 query = query.arg("depth", depth);
8435 }
8436 Directory {
8437 proc: self.proc.clone(),
8438 selection: query,
8439 graphql_client: self.graphql_client.clone(),
8440 }
8441 }
8442}
8443#[derive(Clone)]
8444pub struct GitRepository {
8445 pub proc: Option<Arc<DaggerSessionProc>>,
8446 pub selection: Selection,
8447 pub graphql_client: DynGraphQLClient,
8448}
8449#[derive(Builder, Debug, PartialEq)]
8450pub struct GitRepositoryBranchesOpts<'a> {
8451 #[builder(setter(into, strip_option), default)]
8453 pub patterns: Option<Vec<&'a str>>,
8454}
8455#[derive(Builder, Debug, PartialEq)]
8456pub struct GitRepositoryTagsOpts<'a> {
8457 #[builder(setter(into, strip_option), default)]
8459 pub patterns: Option<Vec<&'a str>>,
8460}
8461impl GitRepository {
8462 pub fn branch(&self, name: impl Into<String>) -> GitRef {
8468 let mut query = self.selection.select("branch");
8469 query = query.arg("name", name.into());
8470 GitRef {
8471 proc: self.proc.clone(),
8472 selection: query,
8473 graphql_client: self.graphql_client.clone(),
8474 }
8475 }
8476 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
8482 let query = self.selection.select("branches");
8483 query.execute(self.graphql_client.clone()).await
8484 }
8485 pub async fn branches_opts<'a>(
8491 &self,
8492 opts: GitRepositoryBranchesOpts<'a>,
8493 ) -> Result<Vec<String>, DaggerError> {
8494 let mut query = self.selection.select("branches");
8495 if let Some(patterns) = opts.patterns {
8496 query = query.arg("patterns", patterns);
8497 }
8498 query.execute(self.graphql_client.clone()).await
8499 }
8500 pub fn commit(&self, id: impl Into<String>) -> GitRef {
8506 let mut query = self.selection.select("commit");
8507 query = query.arg("id", id.into());
8508 GitRef {
8509 proc: self.proc.clone(),
8510 selection: query,
8511 graphql_client: self.graphql_client.clone(),
8512 }
8513 }
8514 pub fn head(&self) -> GitRef {
8516 let query = self.selection.select("head");
8517 GitRef {
8518 proc: self.proc.clone(),
8519 selection: query,
8520 graphql_client: self.graphql_client.clone(),
8521 }
8522 }
8523 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
8525 let query = self.selection.select("id");
8526 query.execute(self.graphql_client.clone()).await
8527 }
8528 pub fn latest_version(&self) -> GitRef {
8530 let query = self.selection.select("latestVersion");
8531 GitRef {
8532 proc: self.proc.clone(),
8533 selection: query,
8534 graphql_client: self.graphql_client.clone(),
8535 }
8536 }
8537 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
8543 let mut query = self.selection.select("ref");
8544 query = query.arg("name", name.into());
8545 GitRef {
8546 proc: self.proc.clone(),
8547 selection: query,
8548 graphql_client: self.graphql_client.clone(),
8549 }
8550 }
8551 pub fn tag(&self, name: impl Into<String>) -> GitRef {
8557 let mut query = self.selection.select("tag");
8558 query = query.arg("name", name.into());
8559 GitRef {
8560 proc: self.proc.clone(),
8561 selection: query,
8562 graphql_client: self.graphql_client.clone(),
8563 }
8564 }
8565 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
8571 let query = self.selection.select("tags");
8572 query.execute(self.graphql_client.clone()).await
8573 }
8574 pub async fn tags_opts<'a>(
8580 &self,
8581 opts: GitRepositoryTagsOpts<'a>,
8582 ) -> Result<Vec<String>, DaggerError> {
8583 let mut query = self.selection.select("tags");
8584 if let Some(patterns) = opts.patterns {
8585 query = query.arg("patterns", patterns);
8586 }
8587 query.execute(self.graphql_client.clone()).await
8588 }
8589 pub async fn url(&self) -> Result<String, DaggerError> {
8591 let query = self.selection.select("url");
8592 query.execute(self.graphql_client.clone()).await
8593 }
8594}
8595#[derive(Clone)]
8596pub struct Host {
8597 pub proc: Option<Arc<DaggerSessionProc>>,
8598 pub selection: Selection,
8599 pub graphql_client: DynGraphQLClient,
8600}
8601#[derive(Builder, Debug, PartialEq)]
8602pub struct HostDirectoryOpts<'a> {
8603 #[builder(setter(into, strip_option), default)]
8605 pub exclude: Option<Vec<&'a str>>,
8606 #[builder(setter(into, strip_option), default)]
8608 pub gitignore: Option<bool>,
8609 #[builder(setter(into, strip_option), default)]
8611 pub include: Option<Vec<&'a str>>,
8612 #[builder(setter(into, strip_option), default)]
8614 pub no_cache: Option<bool>,
8615}
8616#[derive(Builder, Debug, PartialEq)]
8617pub struct HostFileOpts {
8618 #[builder(setter(into, strip_option), default)]
8620 pub no_cache: Option<bool>,
8621}
8622#[derive(Builder, Debug, PartialEq)]
8623pub struct HostFindUpOpts {
8624 #[builder(setter(into, strip_option), default)]
8625 pub no_cache: Option<bool>,
8626}
8627#[derive(Builder, Debug, PartialEq)]
8628pub struct HostServiceOpts<'a> {
8629 #[builder(setter(into, strip_option), default)]
8631 pub host: Option<&'a str>,
8632}
8633#[derive(Builder, Debug, PartialEq)]
8634pub struct HostTunnelOpts {
8635 #[builder(setter(into, strip_option), default)]
8638 pub native: Option<bool>,
8639 #[builder(setter(into, strip_option), default)]
8644 pub ports: Option<Vec<PortForward>>,
8645}
8646impl Host {
8647 pub fn container_image(&self, name: impl Into<String>) -> Container {
8653 let mut query = self.selection.select("containerImage");
8654 query = query.arg("name", name.into());
8655 Container {
8656 proc: self.proc.clone(),
8657 selection: query,
8658 graphql_client: self.graphql_client.clone(),
8659 }
8660 }
8661 pub fn directory(&self, path: impl Into<String>) -> Directory {
8668 let mut query = self.selection.select("directory");
8669 query = query.arg("path", path.into());
8670 Directory {
8671 proc: self.proc.clone(),
8672 selection: query,
8673 graphql_client: self.graphql_client.clone(),
8674 }
8675 }
8676 pub fn directory_opts<'a>(
8683 &self,
8684 path: impl Into<String>,
8685 opts: HostDirectoryOpts<'a>,
8686 ) -> Directory {
8687 let mut query = self.selection.select("directory");
8688 query = query.arg("path", path.into());
8689 if let Some(exclude) = opts.exclude {
8690 query = query.arg("exclude", exclude);
8691 }
8692 if let Some(include) = opts.include {
8693 query = query.arg("include", include);
8694 }
8695 if let Some(no_cache) = opts.no_cache {
8696 query = query.arg("noCache", no_cache);
8697 }
8698 if let Some(gitignore) = opts.gitignore {
8699 query = query.arg("gitignore", gitignore);
8700 }
8701 Directory {
8702 proc: self.proc.clone(),
8703 selection: query,
8704 graphql_client: self.graphql_client.clone(),
8705 }
8706 }
8707 pub fn file(&self, path: impl Into<String>) -> File {
8714 let mut query = self.selection.select("file");
8715 query = query.arg("path", path.into());
8716 File {
8717 proc: self.proc.clone(),
8718 selection: query,
8719 graphql_client: self.graphql_client.clone(),
8720 }
8721 }
8722 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
8729 let mut query = self.selection.select("file");
8730 query = query.arg("path", path.into());
8731 if let Some(no_cache) = opts.no_cache {
8732 query = query.arg("noCache", no_cache);
8733 }
8734 File {
8735 proc: self.proc.clone(),
8736 selection: query,
8737 graphql_client: self.graphql_client.clone(),
8738 }
8739 }
8740 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8747 let mut query = self.selection.select("findUp");
8748 query = query.arg("name", name.into());
8749 query.execute(self.graphql_client.clone()).await
8750 }
8751 pub async fn find_up_opts(
8758 &self,
8759 name: impl Into<String>,
8760 opts: HostFindUpOpts,
8761 ) -> Result<String, DaggerError> {
8762 let mut query = self.selection.select("findUp");
8763 query = query.arg("name", name.into());
8764 if let Some(no_cache) = opts.no_cache {
8765 query = query.arg("noCache", no_cache);
8766 }
8767 query.execute(self.graphql_client.clone()).await
8768 }
8769 pub async fn id(&self) -> Result<HostId, DaggerError> {
8771 let query = self.selection.select("id");
8772 query.execute(self.graphql_client.clone()).await
8773 }
8774 pub fn service(&self, ports: Vec<PortForward>) -> Service {
8785 let mut query = self.selection.select("service");
8786 query = query.arg("ports", ports);
8787 Service {
8788 proc: self.proc.clone(),
8789 selection: query,
8790 graphql_client: self.graphql_client.clone(),
8791 }
8792 }
8793 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8804 let mut query = self.selection.select("service");
8805 query = query.arg("ports", ports);
8806 if let Some(host) = opts.host {
8807 query = query.arg("host", host);
8808 }
8809 Service {
8810 proc: self.proc.clone(),
8811 selection: query,
8812 graphql_client: self.graphql_client.clone(),
8813 }
8814 }
8815 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8822 let mut query = self.selection.select("tunnel");
8823 query = query.arg_lazy(
8824 "service",
8825 Box::new(move || {
8826 let service = service.clone();
8827 Box::pin(async move { service.into_id().await.unwrap().quote() })
8828 }),
8829 );
8830 Service {
8831 proc: self.proc.clone(),
8832 selection: query,
8833 graphql_client: self.graphql_client.clone(),
8834 }
8835 }
8836 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8843 let mut query = self.selection.select("tunnel");
8844 query = query.arg_lazy(
8845 "service",
8846 Box::new(move || {
8847 let service = service.clone();
8848 Box::pin(async move { service.into_id().await.unwrap().quote() })
8849 }),
8850 );
8851 if let Some(native) = opts.native {
8852 query = query.arg("native", native);
8853 }
8854 if let Some(ports) = opts.ports {
8855 query = query.arg("ports", ports);
8856 }
8857 Service {
8858 proc: self.proc.clone(),
8859 selection: query,
8860 graphql_client: self.graphql_client.clone(),
8861 }
8862 }
8863 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
8869 let mut query = self.selection.select("unixSocket");
8870 query = query.arg("path", path.into());
8871 Socket {
8872 proc: self.proc.clone(),
8873 selection: query,
8874 graphql_client: self.graphql_client.clone(),
8875 }
8876 }
8877}
8878#[derive(Clone)]
8879pub struct InputTypeDef {
8880 pub proc: Option<Arc<DaggerSessionProc>>,
8881 pub selection: Selection,
8882 pub graphql_client: DynGraphQLClient,
8883}
8884impl InputTypeDef {
8885 pub fn fields(&self) -> Vec<FieldTypeDef> {
8887 let query = self.selection.select("fields");
8888 vec![FieldTypeDef {
8889 proc: self.proc.clone(),
8890 selection: query,
8891 graphql_client: self.graphql_client.clone(),
8892 }]
8893 }
8894 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
8896 let query = self.selection.select("id");
8897 query.execute(self.graphql_client.clone()).await
8898 }
8899 pub async fn name(&self) -> Result<String, DaggerError> {
8901 let query = self.selection.select("name");
8902 query.execute(self.graphql_client.clone()).await
8903 }
8904}
8905#[derive(Clone)]
8906pub struct InterfaceTypeDef {
8907 pub proc: Option<Arc<DaggerSessionProc>>,
8908 pub selection: Selection,
8909 pub graphql_client: DynGraphQLClient,
8910}
8911impl InterfaceTypeDef {
8912 pub async fn description(&self) -> Result<String, DaggerError> {
8914 let query = self.selection.select("description");
8915 query.execute(self.graphql_client.clone()).await
8916 }
8917 pub fn functions(&self) -> Vec<Function> {
8919 let query = self.selection.select("functions");
8920 vec![Function {
8921 proc: self.proc.clone(),
8922 selection: query,
8923 graphql_client: self.graphql_client.clone(),
8924 }]
8925 }
8926 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
8928 let query = self.selection.select("id");
8929 query.execute(self.graphql_client.clone()).await
8930 }
8931 pub async fn name(&self) -> Result<String, DaggerError> {
8933 let query = self.selection.select("name");
8934 query.execute(self.graphql_client.clone()).await
8935 }
8936 pub fn source_map(&self) -> SourceMap {
8938 let query = self.selection.select("sourceMap");
8939 SourceMap {
8940 proc: self.proc.clone(),
8941 selection: query,
8942 graphql_client: self.graphql_client.clone(),
8943 }
8944 }
8945 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8947 let query = self.selection.select("sourceModuleName");
8948 query.execute(self.graphql_client.clone()).await
8949 }
8950}
8951#[derive(Clone)]
8952pub struct JsonValue {
8953 pub proc: Option<Arc<DaggerSessionProc>>,
8954 pub selection: Selection,
8955 pub graphql_client: DynGraphQLClient,
8956}
8957#[derive(Builder, Debug, PartialEq)]
8958pub struct JsonValueContentsOpts<'a> {
8959 #[builder(setter(into, strip_option), default)]
8961 pub indent: Option<&'a str>,
8962 #[builder(setter(into, strip_option), default)]
8964 pub pretty: Option<bool>,
8965}
8966impl JsonValue {
8967 pub fn as_array(&self) -> Vec<JsonValue> {
8969 let query = self.selection.select("asArray");
8970 vec![JsonValue {
8971 proc: self.proc.clone(),
8972 selection: query,
8973 graphql_client: self.graphql_client.clone(),
8974 }]
8975 }
8976 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
8978 let query = self.selection.select("asBoolean");
8979 query.execute(self.graphql_client.clone()).await
8980 }
8981 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
8983 let query = self.selection.select("asInteger");
8984 query.execute(self.graphql_client.clone()).await
8985 }
8986 pub async fn as_string(&self) -> Result<String, DaggerError> {
8988 let query = self.selection.select("asString");
8989 query.execute(self.graphql_client.clone()).await
8990 }
8991 pub async fn contents(&self) -> Result<Json, DaggerError> {
8997 let query = self.selection.select("contents");
8998 query.execute(self.graphql_client.clone()).await
8999 }
9000 pub async fn contents_opts<'a>(
9006 &self,
9007 opts: JsonValueContentsOpts<'a>,
9008 ) -> Result<Json, DaggerError> {
9009 let mut query = self.selection.select("contents");
9010 if let Some(pretty) = opts.pretty {
9011 query = query.arg("pretty", pretty);
9012 }
9013 if let Some(indent) = opts.indent {
9014 query = query.arg("indent", indent);
9015 }
9016 query.execute(self.graphql_client.clone()).await
9017 }
9018 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
9024 let mut query = self.selection.select("field");
9025 query = query.arg(
9026 "path",
9027 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9028 );
9029 JsonValue {
9030 proc: self.proc.clone(),
9031 selection: query,
9032 graphql_client: self.graphql_client.clone(),
9033 }
9034 }
9035 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
9037 let query = self.selection.select("fields");
9038 query.execute(self.graphql_client.clone()).await
9039 }
9040 pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
9042 let query = self.selection.select("id");
9043 query.execute(self.graphql_client.clone()).await
9044 }
9045 pub fn new_boolean(&self, value: bool) -> JsonValue {
9051 let mut query = self.selection.select("newBoolean");
9052 query = query.arg("value", value);
9053 JsonValue {
9054 proc: self.proc.clone(),
9055 selection: query,
9056 graphql_client: self.graphql_client.clone(),
9057 }
9058 }
9059 pub fn new_integer(&self, value: isize) -> JsonValue {
9065 let mut query = self.selection.select("newInteger");
9066 query = query.arg("value", value);
9067 JsonValue {
9068 proc: self.proc.clone(),
9069 selection: query,
9070 graphql_client: self.graphql_client.clone(),
9071 }
9072 }
9073 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
9079 let mut query = self.selection.select("newString");
9080 query = query.arg("value", value.into());
9081 JsonValue {
9082 proc: self.proc.clone(),
9083 selection: query,
9084 graphql_client: self.graphql_client.clone(),
9085 }
9086 }
9087 pub fn with_contents(&self, contents: Json) -> JsonValue {
9093 let mut query = self.selection.select("withContents");
9094 query = query.arg("contents", contents);
9095 JsonValue {
9096 proc: self.proc.clone(),
9097 selection: query,
9098 graphql_client: self.graphql_client.clone(),
9099 }
9100 }
9101 pub fn with_field(
9108 &self,
9109 path: Vec<impl Into<String>>,
9110 value: impl IntoID<JsonValueId>,
9111 ) -> JsonValue {
9112 let mut query = self.selection.select("withField");
9113 query = query.arg(
9114 "path",
9115 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9116 );
9117 query = query.arg_lazy(
9118 "value",
9119 Box::new(move || {
9120 let value = value.clone();
9121 Box::pin(async move { value.into_id().await.unwrap().quote() })
9122 }),
9123 );
9124 JsonValue {
9125 proc: self.proc.clone(),
9126 selection: query,
9127 graphql_client: self.graphql_client.clone(),
9128 }
9129 }
9130}
9131#[derive(Clone)]
9132pub struct Llm {
9133 pub proc: Option<Arc<DaggerSessionProc>>,
9134 pub selection: Selection,
9135 pub graphql_client: DynGraphQLClient,
9136}
9137impl Llm {
9138 pub fn attempt(&self, number: isize) -> Llm {
9140 let mut query = self.selection.select("attempt");
9141 query = query.arg("number", number);
9142 Llm {
9143 proc: self.proc.clone(),
9144 selection: query,
9145 graphql_client: self.graphql_client.clone(),
9146 }
9147 }
9148 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
9150 let mut query = self.selection.select("bindResult");
9151 query = query.arg("name", name.into());
9152 Binding {
9153 proc: self.proc.clone(),
9154 selection: query,
9155 graphql_client: self.graphql_client.clone(),
9156 }
9157 }
9158 pub fn env(&self) -> Env {
9160 let query = self.selection.select("env");
9161 Env {
9162 proc: self.proc.clone(),
9163 selection: query,
9164 graphql_client: self.graphql_client.clone(),
9165 }
9166 }
9167 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
9169 let query = self.selection.select("hasPrompt");
9170 query.execute(self.graphql_client.clone()).await
9171 }
9172 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
9174 let query = self.selection.select("history");
9175 query.execute(self.graphql_client.clone()).await
9176 }
9177 pub async fn history_json(&self) -> Result<Json, DaggerError> {
9179 let query = self.selection.select("historyJSON");
9180 query.execute(self.graphql_client.clone()).await
9181 }
9182 pub async fn id(&self) -> Result<Llmid, DaggerError> {
9184 let query = self.selection.select("id");
9185 query.execute(self.graphql_client.clone()).await
9186 }
9187 pub async fn last_reply(&self) -> Result<String, DaggerError> {
9189 let query = self.selection.select("lastReply");
9190 query.execute(self.graphql_client.clone()).await
9191 }
9192 pub fn r#loop(&self) -> Llm {
9194 let query = self.selection.select("loop");
9195 Llm {
9196 proc: self.proc.clone(),
9197 selection: query,
9198 graphql_client: self.graphql_client.clone(),
9199 }
9200 }
9201 pub async fn model(&self) -> Result<String, DaggerError> {
9203 let query = self.selection.select("model");
9204 query.execute(self.graphql_client.clone()).await
9205 }
9206 pub async fn provider(&self) -> Result<String, DaggerError> {
9208 let query = self.selection.select("provider");
9209 query.execute(self.graphql_client.clone()).await
9210 }
9211 pub async fn step(&self) -> Result<Llmid, DaggerError> {
9213 let query = self.selection.select("step");
9214 query.execute(self.graphql_client.clone()).await
9215 }
9216 pub async fn sync(&self) -> Result<Llmid, DaggerError> {
9218 let query = self.selection.select("sync");
9219 query.execute(self.graphql_client.clone()).await
9220 }
9221 pub fn token_usage(&self) -> LlmTokenUsage {
9223 let query = self.selection.select("tokenUsage");
9224 LlmTokenUsage {
9225 proc: self.proc.clone(),
9226 selection: query,
9227 graphql_client: self.graphql_client.clone(),
9228 }
9229 }
9230 pub async fn tools(&self) -> Result<String, DaggerError> {
9232 let query = self.selection.select("tools");
9233 query.execute(self.graphql_client.clone()).await
9234 }
9235 pub fn with_blocked_function(
9244 &self,
9245 type_name: impl Into<String>,
9246 function: impl Into<String>,
9247 ) -> Llm {
9248 let mut query = self.selection.select("withBlockedFunction");
9249 query = query.arg("typeName", type_name.into());
9250 query = query.arg("function", function.into());
9251 Llm {
9252 proc: self.proc.clone(),
9253 selection: query,
9254 graphql_client: self.graphql_client.clone(),
9255 }
9256 }
9257 pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
9259 let mut query = self.selection.select("withEnv");
9260 query = query.arg_lazy(
9261 "env",
9262 Box::new(move || {
9263 let env = env.clone();
9264 Box::pin(async move { env.into_id().await.unwrap().quote() })
9265 }),
9266 );
9267 Llm {
9268 proc: self.proc.clone(),
9269 selection: query,
9270 graphql_client: self.graphql_client.clone(),
9271 }
9272 }
9273 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
9280 let mut query = self.selection.select("withMCPServer");
9281 query = query.arg("name", name.into());
9282 query = query.arg_lazy(
9283 "service",
9284 Box::new(move || {
9285 let service = service.clone();
9286 Box::pin(async move { service.into_id().await.unwrap().quote() })
9287 }),
9288 );
9289 Llm {
9290 proc: self.proc.clone(),
9291 selection: query,
9292 graphql_client: self.graphql_client.clone(),
9293 }
9294 }
9295 pub fn with_model(&self, model: impl Into<String>) -> Llm {
9301 let mut query = self.selection.select("withModel");
9302 query = query.arg("model", model.into());
9303 Llm {
9304 proc: self.proc.clone(),
9305 selection: query,
9306 graphql_client: self.graphql_client.clone(),
9307 }
9308 }
9309 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9315 let mut query = self.selection.select("withPrompt");
9316 query = query.arg("prompt", prompt.into());
9317 Llm {
9318 proc: self.proc.clone(),
9319 selection: query,
9320 graphql_client: self.graphql_client.clone(),
9321 }
9322 }
9323 pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9329 let mut query = self.selection.select("withPromptFile");
9330 query = query.arg_lazy(
9331 "file",
9332 Box::new(move || {
9333 let file = file.clone();
9334 Box::pin(async move { file.into_id().await.unwrap().quote() })
9335 }),
9336 );
9337 Llm {
9338 proc: self.proc.clone(),
9339 selection: query,
9340 graphql_client: self.graphql_client.clone(),
9341 }
9342 }
9343 pub fn with_static_tools(&self) -> Llm {
9345 let query = self.selection.select("withStaticTools");
9346 Llm {
9347 proc: self.proc.clone(),
9348 selection: query,
9349 graphql_client: self.graphql_client.clone(),
9350 }
9351 }
9352 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
9358 let mut query = self.selection.select("withSystemPrompt");
9359 query = query.arg("prompt", prompt.into());
9360 Llm {
9361 proc: self.proc.clone(),
9362 selection: query,
9363 graphql_client: self.graphql_client.clone(),
9364 }
9365 }
9366 pub fn without_default_system_prompt(&self) -> Llm {
9368 let query = self.selection.select("withoutDefaultSystemPrompt");
9369 Llm {
9370 proc: self.proc.clone(),
9371 selection: query,
9372 graphql_client: self.graphql_client.clone(),
9373 }
9374 }
9375}
9376#[derive(Clone)]
9377pub struct LlmTokenUsage {
9378 pub proc: Option<Arc<DaggerSessionProc>>,
9379 pub selection: Selection,
9380 pub graphql_client: DynGraphQLClient,
9381}
9382impl LlmTokenUsage {
9383 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
9384 let query = self.selection.select("cachedTokenReads");
9385 query.execute(self.graphql_client.clone()).await
9386 }
9387 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
9388 let query = self.selection.select("cachedTokenWrites");
9389 query.execute(self.graphql_client.clone()).await
9390 }
9391 pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
9393 let query = self.selection.select("id");
9394 query.execute(self.graphql_client.clone()).await
9395 }
9396 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
9397 let query = self.selection.select("inputTokens");
9398 query.execute(self.graphql_client.clone()).await
9399 }
9400 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
9401 let query = self.selection.select("outputTokens");
9402 query.execute(self.graphql_client.clone()).await
9403 }
9404 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
9405 let query = self.selection.select("totalTokens");
9406 query.execute(self.graphql_client.clone()).await
9407 }
9408}
9409#[derive(Clone)]
9410pub struct Label {
9411 pub proc: Option<Arc<DaggerSessionProc>>,
9412 pub selection: Selection,
9413 pub graphql_client: DynGraphQLClient,
9414}
9415impl Label {
9416 pub async fn id(&self) -> Result<LabelId, DaggerError> {
9418 let query = self.selection.select("id");
9419 query.execute(self.graphql_client.clone()).await
9420 }
9421 pub async fn name(&self) -> Result<String, DaggerError> {
9423 let query = self.selection.select("name");
9424 query.execute(self.graphql_client.clone()).await
9425 }
9426 pub async fn value(&self) -> Result<String, DaggerError> {
9428 let query = self.selection.select("value");
9429 query.execute(self.graphql_client.clone()).await
9430 }
9431}
9432#[derive(Clone)]
9433pub struct ListTypeDef {
9434 pub proc: Option<Arc<DaggerSessionProc>>,
9435 pub selection: Selection,
9436 pub graphql_client: DynGraphQLClient,
9437}
9438impl ListTypeDef {
9439 pub fn element_type_def(&self) -> TypeDef {
9441 let query = self.selection.select("elementTypeDef");
9442 TypeDef {
9443 proc: self.proc.clone(),
9444 selection: query,
9445 graphql_client: self.graphql_client.clone(),
9446 }
9447 }
9448 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
9450 let query = self.selection.select("id");
9451 query.execute(self.graphql_client.clone()).await
9452 }
9453}
9454#[derive(Clone)]
9455pub struct Module {
9456 pub proc: Option<Arc<DaggerSessionProc>>,
9457 pub selection: Selection,
9458 pub graphql_client: DynGraphQLClient,
9459}
9460#[derive(Builder, Debug, PartialEq)]
9461pub struct ModuleServeOpts {
9462 #[builder(setter(into, strip_option), default)]
9464 pub include_dependencies: Option<bool>,
9465}
9466impl Module {
9467 pub fn dependencies(&self) -> Vec<Module> {
9469 let query = self.selection.select("dependencies");
9470 vec![Module {
9471 proc: self.proc.clone(),
9472 selection: query,
9473 graphql_client: self.graphql_client.clone(),
9474 }]
9475 }
9476 pub async fn description(&self) -> Result<String, DaggerError> {
9478 let query = self.selection.select("description");
9479 query.execute(self.graphql_client.clone()).await
9480 }
9481 pub fn enums(&self) -> Vec<TypeDef> {
9483 let query = self.selection.select("enums");
9484 vec![TypeDef {
9485 proc: self.proc.clone(),
9486 selection: query,
9487 graphql_client: self.graphql_client.clone(),
9488 }]
9489 }
9490 pub fn generated_context_directory(&self) -> Directory {
9492 let query = self.selection.select("generatedContextDirectory");
9493 Directory {
9494 proc: self.proc.clone(),
9495 selection: query,
9496 graphql_client: self.graphql_client.clone(),
9497 }
9498 }
9499 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
9501 let query = self.selection.select("id");
9502 query.execute(self.graphql_client.clone()).await
9503 }
9504 pub fn interfaces(&self) -> Vec<TypeDef> {
9506 let query = self.selection.select("interfaces");
9507 vec![TypeDef {
9508 proc: self.proc.clone(),
9509 selection: query,
9510 graphql_client: self.graphql_client.clone(),
9511 }]
9512 }
9513 pub fn introspection_schema_json(&self) -> File {
9517 let query = self.selection.select("introspectionSchemaJSON");
9518 File {
9519 proc: self.proc.clone(),
9520 selection: query,
9521 graphql_client: self.graphql_client.clone(),
9522 }
9523 }
9524 pub async fn name(&self) -> Result<String, DaggerError> {
9526 let query = self.selection.select("name");
9527 query.execute(self.graphql_client.clone()).await
9528 }
9529 pub fn objects(&self) -> Vec<TypeDef> {
9531 let query = self.selection.select("objects");
9532 vec![TypeDef {
9533 proc: self.proc.clone(),
9534 selection: query,
9535 graphql_client: self.graphql_client.clone(),
9536 }]
9537 }
9538 pub fn runtime(&self) -> Container {
9540 let query = self.selection.select("runtime");
9541 Container {
9542 proc: self.proc.clone(),
9543 selection: query,
9544 graphql_client: self.graphql_client.clone(),
9545 }
9546 }
9547 pub fn sdk(&self) -> SdkConfig {
9549 let query = self.selection.select("sdk");
9550 SdkConfig {
9551 proc: self.proc.clone(),
9552 selection: query,
9553 graphql_client: self.graphql_client.clone(),
9554 }
9555 }
9556 pub async fn serve(&self) -> Result<Void, DaggerError> {
9563 let query = self.selection.select("serve");
9564 query.execute(self.graphql_client.clone()).await
9565 }
9566 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
9573 let mut query = self.selection.select("serve");
9574 if let Some(include_dependencies) = opts.include_dependencies {
9575 query = query.arg("includeDependencies", include_dependencies);
9576 }
9577 query.execute(self.graphql_client.clone()).await
9578 }
9579 pub fn source(&self) -> ModuleSource {
9581 let query = self.selection.select("source");
9582 ModuleSource {
9583 proc: self.proc.clone(),
9584 selection: query,
9585 graphql_client: self.graphql_client.clone(),
9586 }
9587 }
9588 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
9590 let query = self.selection.select("sync");
9591 query.execute(self.graphql_client.clone()).await
9592 }
9593 pub fn user_defaults(&self) -> EnvFile {
9595 let query = self.selection.select("userDefaults");
9596 EnvFile {
9597 proc: self.proc.clone(),
9598 selection: query,
9599 graphql_client: self.graphql_client.clone(),
9600 }
9601 }
9602 pub fn with_description(&self, description: impl Into<String>) -> Module {
9608 let mut query = self.selection.select("withDescription");
9609 query = query.arg("description", description.into());
9610 Module {
9611 proc: self.proc.clone(),
9612 selection: query,
9613 graphql_client: self.graphql_client.clone(),
9614 }
9615 }
9616 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
9618 let mut query = self.selection.select("withEnum");
9619 query = query.arg_lazy(
9620 "enum",
9621 Box::new(move || {
9622 let r#enum = r#enum.clone();
9623 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
9624 }),
9625 );
9626 Module {
9627 proc: self.proc.clone(),
9628 selection: query,
9629 graphql_client: self.graphql_client.clone(),
9630 }
9631 }
9632 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
9634 let mut query = self.selection.select("withInterface");
9635 query = query.arg_lazy(
9636 "iface",
9637 Box::new(move || {
9638 let iface = iface.clone();
9639 Box::pin(async move { iface.into_id().await.unwrap().quote() })
9640 }),
9641 );
9642 Module {
9643 proc: self.proc.clone(),
9644 selection: query,
9645 graphql_client: self.graphql_client.clone(),
9646 }
9647 }
9648 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
9650 let mut query = self.selection.select("withObject");
9651 query = query.arg_lazy(
9652 "object",
9653 Box::new(move || {
9654 let object = object.clone();
9655 Box::pin(async move { object.into_id().await.unwrap().quote() })
9656 }),
9657 );
9658 Module {
9659 proc: self.proc.clone(),
9660 selection: query,
9661 graphql_client: self.graphql_client.clone(),
9662 }
9663 }
9664}
9665#[derive(Clone)]
9666pub struct ModuleConfigClient {
9667 pub proc: Option<Arc<DaggerSessionProc>>,
9668 pub selection: Selection,
9669 pub graphql_client: DynGraphQLClient,
9670}
9671impl ModuleConfigClient {
9672 pub async fn directory(&self) -> Result<String, DaggerError> {
9674 let query = self.selection.select("directory");
9675 query.execute(self.graphql_client.clone()).await
9676 }
9677 pub async fn generator(&self) -> Result<String, DaggerError> {
9679 let query = self.selection.select("generator");
9680 query.execute(self.graphql_client.clone()).await
9681 }
9682 pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
9684 let query = self.selection.select("id");
9685 query.execute(self.graphql_client.clone()).await
9686 }
9687}
9688#[derive(Clone)]
9689pub struct ModuleSource {
9690 pub proc: Option<Arc<DaggerSessionProc>>,
9691 pub selection: Selection,
9692 pub graphql_client: DynGraphQLClient,
9693}
9694impl ModuleSource {
9695 pub fn as_module(&self) -> Module {
9697 let query = self.selection.select("asModule");
9698 Module {
9699 proc: self.proc.clone(),
9700 selection: query,
9701 graphql_client: self.graphql_client.clone(),
9702 }
9703 }
9704 pub async fn as_string(&self) -> Result<String, DaggerError> {
9706 let query = self.selection.select("asString");
9707 query.execute(self.graphql_client.clone()).await
9708 }
9709 pub fn blueprint(&self) -> ModuleSource {
9711 let query = self.selection.select("blueprint");
9712 ModuleSource {
9713 proc: self.proc.clone(),
9714 selection: query,
9715 graphql_client: self.graphql_client.clone(),
9716 }
9717 }
9718 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
9720 let query = self.selection.select("cloneRef");
9721 query.execute(self.graphql_client.clone()).await
9722 }
9723 pub async fn commit(&self) -> Result<String, DaggerError> {
9725 let query = self.selection.select("commit");
9726 query.execute(self.graphql_client.clone()).await
9727 }
9728 pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
9730 let query = self.selection.select("configClients");
9731 vec![ModuleConfigClient {
9732 proc: self.proc.clone(),
9733 selection: query,
9734 graphql_client: self.graphql_client.clone(),
9735 }]
9736 }
9737 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
9739 let query = self.selection.select("configExists");
9740 query.execute(self.graphql_client.clone()).await
9741 }
9742 pub fn context_directory(&self) -> Directory {
9744 let query = self.selection.select("contextDirectory");
9745 Directory {
9746 proc: self.proc.clone(),
9747 selection: query,
9748 graphql_client: self.graphql_client.clone(),
9749 }
9750 }
9751 pub fn dependencies(&self) -> Vec<ModuleSource> {
9753 let query = self.selection.select("dependencies");
9754 vec![ModuleSource {
9755 proc: self.proc.clone(),
9756 selection: query,
9757 graphql_client: self.graphql_client.clone(),
9758 }]
9759 }
9760 pub async fn digest(&self) -> Result<String, DaggerError> {
9762 let query = self.selection.select("digest");
9763 query.execute(self.graphql_client.clone()).await
9764 }
9765 pub fn directory(&self, path: impl Into<String>) -> Directory {
9771 let mut query = self.selection.select("directory");
9772 query = query.arg("path", path.into());
9773 Directory {
9774 proc: self.proc.clone(),
9775 selection: query,
9776 graphql_client: self.graphql_client.clone(),
9777 }
9778 }
9779 pub async fn engine_version(&self) -> Result<String, DaggerError> {
9781 let query = self.selection.select("engineVersion");
9782 query.execute(self.graphql_client.clone()).await
9783 }
9784 pub fn generated_context_directory(&self) -> Directory {
9786 let query = self.selection.select("generatedContextDirectory");
9787 Directory {
9788 proc: self.proc.clone(),
9789 selection: query,
9790 graphql_client: self.graphql_client.clone(),
9791 }
9792 }
9793 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
9795 let query = self.selection.select("htmlRepoURL");
9796 query.execute(self.graphql_client.clone()).await
9797 }
9798 pub async fn html_url(&self) -> Result<String, DaggerError> {
9800 let query = self.selection.select("htmlURL");
9801 query.execute(self.graphql_client.clone()).await
9802 }
9803 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
9805 let query = self.selection.select("id");
9806 query.execute(self.graphql_client.clone()).await
9807 }
9808 pub fn introspection_schema_json(&self) -> File {
9812 let query = self.selection.select("introspectionSchemaJSON");
9813 File {
9814 proc: self.proc.clone(),
9815 selection: query,
9816 graphql_client: self.graphql_client.clone(),
9817 }
9818 }
9819 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
9821 let query = self.selection.select("kind");
9822 query.execute(self.graphql_client.clone()).await
9823 }
9824 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
9826 let query = self.selection.select("localContextDirectoryPath");
9827 query.execute(self.graphql_client.clone()).await
9828 }
9829 pub async fn module_name(&self) -> Result<String, DaggerError> {
9831 let query = self.selection.select("moduleName");
9832 query.execute(self.graphql_client.clone()).await
9833 }
9834 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
9836 let query = self.selection.select("moduleOriginalName");
9837 query.execute(self.graphql_client.clone()).await
9838 }
9839 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
9841 let query = self.selection.select("originalSubpath");
9842 query.execute(self.graphql_client.clone()).await
9843 }
9844 pub async fn pin(&self) -> Result<String, DaggerError> {
9846 let query = self.selection.select("pin");
9847 query.execute(self.graphql_client.clone()).await
9848 }
9849 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
9851 let query = self.selection.select("repoRootPath");
9852 query.execute(self.graphql_client.clone()).await
9853 }
9854 pub fn sdk(&self) -> SdkConfig {
9856 let query = self.selection.select("sdk");
9857 SdkConfig {
9858 proc: self.proc.clone(),
9859 selection: query,
9860 graphql_client: self.graphql_client.clone(),
9861 }
9862 }
9863 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9865 let query = self.selection.select("sourceRootSubpath");
9866 query.execute(self.graphql_client.clone()).await
9867 }
9868 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9870 let query = self.selection.select("sourceSubpath");
9871 query.execute(self.graphql_client.clone()).await
9872 }
9873 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9875 let query = self.selection.select("sync");
9876 query.execute(self.graphql_client.clone()).await
9877 }
9878 pub fn user_defaults(&self) -> EnvFile {
9880 let query = self.selection.select("userDefaults");
9881 EnvFile {
9882 proc: self.proc.clone(),
9883 selection: query,
9884 graphql_client: self.graphql_client.clone(),
9885 }
9886 }
9887 pub async fn version(&self) -> Result<String, DaggerError> {
9889 let query = self.selection.select("version");
9890 query.execute(self.graphql_client.clone()).await
9891 }
9892 pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9898 let mut query = self.selection.select("withBlueprint");
9899 query = query.arg_lazy(
9900 "blueprint",
9901 Box::new(move || {
9902 let blueprint = blueprint.clone();
9903 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
9904 }),
9905 );
9906 ModuleSource {
9907 proc: self.proc.clone(),
9908 selection: query,
9909 graphql_client: self.graphql_client.clone(),
9910 }
9911 }
9912 pub fn with_client(
9919 &self,
9920 generator: impl Into<String>,
9921 output_dir: impl Into<String>,
9922 ) -> ModuleSource {
9923 let mut query = self.selection.select("withClient");
9924 query = query.arg("generator", generator.into());
9925 query = query.arg("outputDir", output_dir.into());
9926 ModuleSource {
9927 proc: self.proc.clone(),
9928 selection: query,
9929 graphql_client: self.graphql_client.clone(),
9930 }
9931 }
9932 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
9938 let mut query = self.selection.select("withDependencies");
9939 query = query.arg("dependencies", dependencies);
9940 ModuleSource {
9941 proc: self.proc.clone(),
9942 selection: query,
9943 graphql_client: self.graphql_client.clone(),
9944 }
9945 }
9946 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
9952 let mut query = self.selection.select("withEngineVersion");
9953 query = query.arg("version", version.into());
9954 ModuleSource {
9955 proc: self.proc.clone(),
9956 selection: query,
9957 graphql_client: self.graphql_client.clone(),
9958 }
9959 }
9960 pub fn with_experimental_features(
9966 &self,
9967 features: Vec<ModuleSourceExperimentalFeature>,
9968 ) -> ModuleSource {
9969 let mut query = self.selection.select("withExperimentalFeatures");
9970 query = query.arg("features", features);
9971 ModuleSource {
9972 proc: self.proc.clone(),
9973 selection: query,
9974 graphql_client: self.graphql_client.clone(),
9975 }
9976 }
9977 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
9983 let mut query = self.selection.select("withIncludes");
9984 query = query.arg(
9985 "patterns",
9986 patterns
9987 .into_iter()
9988 .map(|i| i.into())
9989 .collect::<Vec<String>>(),
9990 );
9991 ModuleSource {
9992 proc: self.proc.clone(),
9993 selection: query,
9994 graphql_client: self.graphql_client.clone(),
9995 }
9996 }
9997 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
10003 let mut query = self.selection.select("withName");
10004 query = query.arg("name", name.into());
10005 ModuleSource {
10006 proc: self.proc.clone(),
10007 selection: query,
10008 graphql_client: self.graphql_client.clone(),
10009 }
10010 }
10011 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
10017 let mut query = self.selection.select("withSDK");
10018 query = query.arg("source", source.into());
10019 ModuleSource {
10020 proc: self.proc.clone(),
10021 selection: query,
10022 graphql_client: self.graphql_client.clone(),
10023 }
10024 }
10025 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
10031 let mut query = self.selection.select("withSourceSubpath");
10032 query = query.arg("path", path.into());
10033 ModuleSource {
10034 proc: self.proc.clone(),
10035 selection: query,
10036 graphql_client: self.graphql_client.clone(),
10037 }
10038 }
10039 pub fn with_update_blueprint(&self) -> ModuleSource {
10041 let query = self.selection.select("withUpdateBlueprint");
10042 ModuleSource {
10043 proc: self.proc.clone(),
10044 selection: query,
10045 graphql_client: self.graphql_client.clone(),
10046 }
10047 }
10048 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10054 let mut query = self.selection.select("withUpdateDependencies");
10055 query = query.arg(
10056 "dependencies",
10057 dependencies
10058 .into_iter()
10059 .map(|i| i.into())
10060 .collect::<Vec<String>>(),
10061 );
10062 ModuleSource {
10063 proc: self.proc.clone(),
10064 selection: query,
10065 graphql_client: self.graphql_client.clone(),
10066 }
10067 }
10068 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
10074 let mut query = self.selection.select("withUpdatedClients");
10075 query = query.arg(
10076 "clients",
10077 clients
10078 .into_iter()
10079 .map(|i| i.into())
10080 .collect::<Vec<String>>(),
10081 );
10082 ModuleSource {
10083 proc: self.proc.clone(),
10084 selection: query,
10085 graphql_client: self.graphql_client.clone(),
10086 }
10087 }
10088 pub fn without_blueprint(&self) -> ModuleSource {
10090 let query = self.selection.select("withoutBlueprint");
10091 ModuleSource {
10092 proc: self.proc.clone(),
10093 selection: query,
10094 graphql_client: self.graphql_client.clone(),
10095 }
10096 }
10097 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
10103 let mut query = self.selection.select("withoutClient");
10104 query = query.arg("path", path.into());
10105 ModuleSource {
10106 proc: self.proc.clone(),
10107 selection: query,
10108 graphql_client: self.graphql_client.clone(),
10109 }
10110 }
10111 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10117 let mut query = self.selection.select("withoutDependencies");
10118 query = query.arg(
10119 "dependencies",
10120 dependencies
10121 .into_iter()
10122 .map(|i| i.into())
10123 .collect::<Vec<String>>(),
10124 );
10125 ModuleSource {
10126 proc: self.proc.clone(),
10127 selection: query,
10128 graphql_client: self.graphql_client.clone(),
10129 }
10130 }
10131 pub fn without_experimental_features(
10137 &self,
10138 features: Vec<ModuleSourceExperimentalFeature>,
10139 ) -> ModuleSource {
10140 let mut query = self.selection.select("withoutExperimentalFeatures");
10141 query = query.arg("features", features);
10142 ModuleSource {
10143 proc: self.proc.clone(),
10144 selection: query,
10145 graphql_client: self.graphql_client.clone(),
10146 }
10147 }
10148}
10149#[derive(Clone)]
10150pub struct ObjectTypeDef {
10151 pub proc: Option<Arc<DaggerSessionProc>>,
10152 pub selection: Selection,
10153 pub graphql_client: DynGraphQLClient,
10154}
10155impl ObjectTypeDef {
10156 pub fn constructor(&self) -> Function {
10158 let query = self.selection.select("constructor");
10159 Function {
10160 proc: self.proc.clone(),
10161 selection: query,
10162 graphql_client: self.graphql_client.clone(),
10163 }
10164 }
10165 pub async fn description(&self) -> Result<String, DaggerError> {
10167 let query = self.selection.select("description");
10168 query.execute(self.graphql_client.clone()).await
10169 }
10170 pub fn fields(&self) -> Vec<FieldTypeDef> {
10172 let query = self.selection.select("fields");
10173 vec![FieldTypeDef {
10174 proc: self.proc.clone(),
10175 selection: query,
10176 graphql_client: self.graphql_client.clone(),
10177 }]
10178 }
10179 pub fn functions(&self) -> Vec<Function> {
10181 let query = self.selection.select("functions");
10182 vec![Function {
10183 proc: self.proc.clone(),
10184 selection: query,
10185 graphql_client: self.graphql_client.clone(),
10186 }]
10187 }
10188 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
10190 let query = self.selection.select("id");
10191 query.execute(self.graphql_client.clone()).await
10192 }
10193 pub async fn name(&self) -> Result<String, DaggerError> {
10195 let query = self.selection.select("name");
10196 query.execute(self.graphql_client.clone()).await
10197 }
10198 pub fn source_map(&self) -> SourceMap {
10200 let query = self.selection.select("sourceMap");
10201 SourceMap {
10202 proc: self.proc.clone(),
10203 selection: query,
10204 graphql_client: self.graphql_client.clone(),
10205 }
10206 }
10207 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10209 let query = self.selection.select("sourceModuleName");
10210 query.execute(self.graphql_client.clone()).await
10211 }
10212}
10213#[derive(Clone)]
10214pub struct Port {
10215 pub proc: Option<Arc<DaggerSessionProc>>,
10216 pub selection: Selection,
10217 pub graphql_client: DynGraphQLClient,
10218}
10219impl Port {
10220 pub async fn description(&self) -> Result<String, DaggerError> {
10222 let query = self.selection.select("description");
10223 query.execute(self.graphql_client.clone()).await
10224 }
10225 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
10227 let query = self.selection.select("experimentalSkipHealthcheck");
10228 query.execute(self.graphql_client.clone()).await
10229 }
10230 pub async fn id(&self) -> Result<PortId, DaggerError> {
10232 let query = self.selection.select("id");
10233 query.execute(self.graphql_client.clone()).await
10234 }
10235 pub async fn port(&self) -> Result<isize, DaggerError> {
10237 let query = self.selection.select("port");
10238 query.execute(self.graphql_client.clone()).await
10239 }
10240 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
10242 let query = self.selection.select("protocol");
10243 query.execute(self.graphql_client.clone()).await
10244 }
10245}
10246#[derive(Clone)]
10247pub struct Query {
10248 pub proc: Option<Arc<DaggerSessionProc>>,
10249 pub selection: Selection,
10250 pub graphql_client: DynGraphQLClient,
10251}
10252#[derive(Builder, Debug, PartialEq)]
10253pub struct QueryContainerOpts {
10254 #[builder(setter(into, strip_option), default)]
10256 pub platform: Option<Platform>,
10257}
10258#[derive(Builder, Debug, PartialEq)]
10259pub struct QueryEnvOpts {
10260 #[builder(setter(into, strip_option), default)]
10262 pub privileged: Option<bool>,
10263 #[builder(setter(into, strip_option), default)]
10265 pub writable: Option<bool>,
10266}
10267#[derive(Builder, Debug, PartialEq)]
10268pub struct QueryEnvFileOpts {
10269 #[builder(setter(into, strip_option), default)]
10271 pub expand: Option<bool>,
10272}
10273#[derive(Builder, Debug, PartialEq)]
10274pub struct QueryFileOpts {
10275 #[builder(setter(into, strip_option), default)]
10277 pub permissions: Option<isize>,
10278}
10279#[derive(Builder, Debug, PartialEq)]
10280pub struct QueryGitOpts<'a> {
10281 #[builder(setter(into, strip_option), default)]
10283 pub experimental_service_host: Option<ServiceId>,
10284 #[builder(setter(into, strip_option), default)]
10286 pub http_auth_header: Option<SecretId>,
10287 #[builder(setter(into, strip_option), default)]
10289 pub http_auth_token: Option<SecretId>,
10290 #[builder(setter(into, strip_option), default)]
10292 pub http_auth_username: Option<&'a str>,
10293 #[builder(setter(into, strip_option), default)]
10295 pub keep_git_dir: Option<bool>,
10296 #[builder(setter(into, strip_option), default)]
10298 pub ssh_auth_socket: Option<SocketId>,
10299 #[builder(setter(into, strip_option), default)]
10301 pub ssh_known_hosts: Option<&'a str>,
10302}
10303#[derive(Builder, Debug, PartialEq)]
10304pub struct QueryHttpOpts<'a> {
10305 #[builder(setter(into, strip_option), default)]
10307 pub auth_header: Option<SecretId>,
10308 #[builder(setter(into, strip_option), default)]
10310 pub experimental_service_host: Option<ServiceId>,
10311 #[builder(setter(into, strip_option), default)]
10313 pub name: Option<&'a str>,
10314 #[builder(setter(into, strip_option), default)]
10316 pub permissions: Option<isize>,
10317}
10318#[derive(Builder, Debug, PartialEq)]
10319pub struct QueryLlmOpts<'a> {
10320 #[builder(setter(into, strip_option), default)]
10322 pub max_api_calls: Option<isize>,
10323 #[builder(setter(into, strip_option), default)]
10325 pub model: Option<&'a str>,
10326}
10327#[derive(Builder, Debug, PartialEq)]
10328pub struct QueryModuleSourceOpts<'a> {
10329 #[builder(setter(into, strip_option), default)]
10331 pub allow_not_exists: Option<bool>,
10332 #[builder(setter(into, strip_option), default)]
10334 pub disable_find_up: Option<bool>,
10335 #[builder(setter(into, strip_option), default)]
10337 pub ref_pin: Option<&'a str>,
10338 #[builder(setter(into, strip_option), default)]
10340 pub require_kind: Option<ModuleSourceKind>,
10341}
10342#[derive(Builder, Debug, PartialEq)]
10343pub struct QuerySecretOpts<'a> {
10344 #[builder(setter(into, strip_option), default)]
10348 pub cache_key: Option<&'a str>,
10349}
10350impl Query {
10351 pub fn address(&self, value: impl Into<String>) -> Address {
10353 let mut query = self.selection.select("address");
10354 query = query.arg("value", value.into());
10355 Address {
10356 proc: self.proc.clone(),
10357 selection: query,
10358 graphql_client: self.graphql_client.clone(),
10359 }
10360 }
10361 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
10367 let mut query = self.selection.select("cacheVolume");
10368 query = query.arg("key", key.into());
10369 CacheVolume {
10370 proc: self.proc.clone(),
10371 selection: query,
10372 graphql_client: self.graphql_client.clone(),
10373 }
10374 }
10375 pub fn cloud(&self) -> Cloud {
10377 let query = self.selection.select("cloud");
10378 Cloud {
10379 proc: self.proc.clone(),
10380 selection: query,
10381 graphql_client: self.graphql_client.clone(),
10382 }
10383 }
10384 pub fn container(&self) -> Container {
10391 let query = self.selection.select("container");
10392 Container {
10393 proc: self.proc.clone(),
10394 selection: query,
10395 graphql_client: self.graphql_client.clone(),
10396 }
10397 }
10398 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10405 let mut query = self.selection.select("container");
10406 if let Some(platform) = opts.platform {
10407 query = query.arg("platform", platform);
10408 }
10409 Container {
10410 proc: self.proc.clone(),
10411 selection: query,
10412 graphql_client: self.graphql_client.clone(),
10413 }
10414 }
10415 pub fn current_env(&self) -> Env {
10419 let query = self.selection.select("currentEnv");
10420 Env {
10421 proc: self.proc.clone(),
10422 selection: query,
10423 graphql_client: self.graphql_client.clone(),
10424 }
10425 }
10426 pub fn current_function_call(&self) -> FunctionCall {
10429 let query = self.selection.select("currentFunctionCall");
10430 FunctionCall {
10431 proc: self.proc.clone(),
10432 selection: query,
10433 graphql_client: self.graphql_client.clone(),
10434 }
10435 }
10436 pub fn current_module(&self) -> CurrentModule {
10438 let query = self.selection.select("currentModule");
10439 CurrentModule {
10440 proc: self.proc.clone(),
10441 selection: query,
10442 graphql_client: self.graphql_client.clone(),
10443 }
10444 }
10445 pub fn current_type_defs(&self) -> Vec<TypeDef> {
10447 let query = self.selection.select("currentTypeDefs");
10448 vec![TypeDef {
10449 proc: self.proc.clone(),
10450 selection: query,
10451 graphql_client: self.graphql_client.clone(),
10452 }]
10453 }
10454 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
10456 let query = self.selection.select("defaultPlatform");
10457 query.execute(self.graphql_client.clone()).await
10458 }
10459 pub fn directory(&self) -> Directory {
10461 let query = self.selection.select("directory");
10462 Directory {
10463 proc: self.proc.clone(),
10464 selection: query,
10465 graphql_client: self.graphql_client.clone(),
10466 }
10467 }
10468 pub fn engine(&self) -> Engine {
10470 let query = self.selection.select("engine");
10471 Engine {
10472 proc: self.proc.clone(),
10473 selection: query,
10474 graphql_client: self.graphql_client.clone(),
10475 }
10476 }
10477 pub fn env(&self) -> Env {
10483 let query = self.selection.select("env");
10484 Env {
10485 proc: self.proc.clone(),
10486 selection: query,
10487 graphql_client: self.graphql_client.clone(),
10488 }
10489 }
10490 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
10496 let mut query = self.selection.select("env");
10497 if let Some(privileged) = opts.privileged {
10498 query = query.arg("privileged", privileged);
10499 }
10500 if let Some(writable) = opts.writable {
10501 query = query.arg("writable", writable);
10502 }
10503 Env {
10504 proc: self.proc.clone(),
10505 selection: query,
10506 graphql_client: self.graphql_client.clone(),
10507 }
10508 }
10509 pub fn env_file(&self) -> EnvFile {
10515 let query = self.selection.select("envFile");
10516 EnvFile {
10517 proc: self.proc.clone(),
10518 selection: query,
10519 graphql_client: self.graphql_client.clone(),
10520 }
10521 }
10522 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
10528 let mut query = self.selection.select("envFile");
10529 if let Some(expand) = opts.expand {
10530 query = query.arg("expand", expand);
10531 }
10532 EnvFile {
10533 proc: self.proc.clone(),
10534 selection: query,
10535 graphql_client: self.graphql_client.clone(),
10536 }
10537 }
10538 pub fn error(&self, message: impl Into<String>) -> Error {
10544 let mut query = self.selection.select("error");
10545 query = query.arg("message", message.into());
10546 Error {
10547 proc: self.proc.clone(),
10548 selection: query,
10549 graphql_client: self.graphql_client.clone(),
10550 }
10551 }
10552 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
10560 let mut query = self.selection.select("file");
10561 query = query.arg("name", name.into());
10562 query = query.arg("contents", contents.into());
10563 File {
10564 proc: self.proc.clone(),
10565 selection: query,
10566 graphql_client: self.graphql_client.clone(),
10567 }
10568 }
10569 pub fn file_opts(
10577 &self,
10578 name: impl Into<String>,
10579 contents: impl Into<String>,
10580 opts: QueryFileOpts,
10581 ) -> File {
10582 let mut query = self.selection.select("file");
10583 query = query.arg("name", name.into());
10584 query = query.arg("contents", contents.into());
10585 if let Some(permissions) = opts.permissions {
10586 query = query.arg("permissions", permissions);
10587 }
10588 File {
10589 proc: self.proc.clone(),
10590 selection: query,
10591 graphql_client: self.graphql_client.clone(),
10592 }
10593 }
10594 pub fn function(
10601 &self,
10602 name: impl Into<String>,
10603 return_type: impl IntoID<TypeDefId>,
10604 ) -> Function {
10605 let mut query = self.selection.select("function");
10606 query = query.arg("name", name.into());
10607 query = query.arg_lazy(
10608 "returnType",
10609 Box::new(move || {
10610 let return_type = return_type.clone();
10611 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
10612 }),
10613 );
10614 Function {
10615 proc: self.proc.clone(),
10616 selection: query,
10617 graphql_client: self.graphql_client.clone(),
10618 }
10619 }
10620 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
10622 let mut query = self.selection.select("generatedCode");
10623 query = query.arg_lazy(
10624 "code",
10625 Box::new(move || {
10626 let code = code.clone();
10627 Box::pin(async move { code.into_id().await.unwrap().quote() })
10628 }),
10629 );
10630 GeneratedCode {
10631 proc: self.proc.clone(),
10632 selection: query,
10633 graphql_client: self.graphql_client.clone(),
10634 }
10635 }
10636 pub fn git(&self, url: impl Into<String>) -> GitRepository {
10647 let mut query = self.selection.select("git");
10648 query = query.arg("url", url.into());
10649 GitRepository {
10650 proc: self.proc.clone(),
10651 selection: query,
10652 graphql_client: self.graphql_client.clone(),
10653 }
10654 }
10655 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
10666 let mut query = self.selection.select("git");
10667 query = query.arg("url", url.into());
10668 if let Some(keep_git_dir) = opts.keep_git_dir {
10669 query = query.arg("keepGitDir", keep_git_dir);
10670 }
10671 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
10672 query = query.arg("sshKnownHosts", ssh_known_hosts);
10673 }
10674 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
10675 query = query.arg("sshAuthSocket", ssh_auth_socket);
10676 }
10677 if let Some(http_auth_username) = opts.http_auth_username {
10678 query = query.arg("httpAuthUsername", http_auth_username);
10679 }
10680 if let Some(http_auth_token) = opts.http_auth_token {
10681 query = query.arg("httpAuthToken", http_auth_token);
10682 }
10683 if let Some(http_auth_header) = opts.http_auth_header {
10684 query = query.arg("httpAuthHeader", http_auth_header);
10685 }
10686 if let Some(experimental_service_host) = opts.experimental_service_host {
10687 query = query.arg("experimentalServiceHost", experimental_service_host);
10688 }
10689 GitRepository {
10690 proc: self.proc.clone(),
10691 selection: query,
10692 graphql_client: self.graphql_client.clone(),
10693 }
10694 }
10695 pub fn host(&self) -> Host {
10697 let query = self.selection.select("host");
10698 Host {
10699 proc: self.proc.clone(),
10700 selection: query,
10701 graphql_client: self.graphql_client.clone(),
10702 }
10703 }
10704 pub fn http(&self, url: impl Into<String>) -> File {
10711 let mut query = self.selection.select("http");
10712 query = query.arg("url", url.into());
10713 File {
10714 proc: self.proc.clone(),
10715 selection: query,
10716 graphql_client: self.graphql_client.clone(),
10717 }
10718 }
10719 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
10726 let mut query = self.selection.select("http");
10727 query = query.arg("url", url.into());
10728 if let Some(name) = opts.name {
10729 query = query.arg("name", name);
10730 }
10731 if let Some(permissions) = opts.permissions {
10732 query = query.arg("permissions", permissions);
10733 }
10734 if let Some(auth_header) = opts.auth_header {
10735 query = query.arg("authHeader", auth_header);
10736 }
10737 if let Some(experimental_service_host) = opts.experimental_service_host {
10738 query = query.arg("experimentalServiceHost", experimental_service_host);
10739 }
10740 File {
10741 proc: self.proc.clone(),
10742 selection: query,
10743 graphql_client: self.graphql_client.clone(),
10744 }
10745 }
10746 pub fn json(&self) -> JsonValue {
10748 let query = self.selection.select("json");
10749 JsonValue {
10750 proc: self.proc.clone(),
10751 selection: query,
10752 graphql_client: self.graphql_client.clone(),
10753 }
10754 }
10755 pub fn llm(&self) -> Llm {
10761 let query = self.selection.select("llm");
10762 Llm {
10763 proc: self.proc.clone(),
10764 selection: query,
10765 graphql_client: self.graphql_client.clone(),
10766 }
10767 }
10768 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
10774 let mut query = self.selection.select("llm");
10775 if let Some(model) = opts.model {
10776 query = query.arg("model", model);
10777 }
10778 if let Some(max_api_calls) = opts.max_api_calls {
10779 query = query.arg("maxAPICalls", max_api_calls);
10780 }
10781 Llm {
10782 proc: self.proc.clone(),
10783 selection: query,
10784 graphql_client: self.graphql_client.clone(),
10785 }
10786 }
10787 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
10789 let mut query = self.selection.select("loadAddressFromID");
10790 query = query.arg_lazy(
10791 "id",
10792 Box::new(move || {
10793 let id = id.clone();
10794 Box::pin(async move { id.into_id().await.unwrap().quote() })
10795 }),
10796 );
10797 Address {
10798 proc: self.proc.clone(),
10799 selection: query,
10800 graphql_client: self.graphql_client.clone(),
10801 }
10802 }
10803 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
10805 let mut query = self.selection.select("loadBindingFromID");
10806 query = query.arg_lazy(
10807 "id",
10808 Box::new(move || {
10809 let id = id.clone();
10810 Box::pin(async move { id.into_id().await.unwrap().quote() })
10811 }),
10812 );
10813 Binding {
10814 proc: self.proc.clone(),
10815 selection: query,
10816 graphql_client: self.graphql_client.clone(),
10817 }
10818 }
10819 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
10821 let mut query = self.selection.select("loadCacheVolumeFromID");
10822 query = query.arg_lazy(
10823 "id",
10824 Box::new(move || {
10825 let id = id.clone();
10826 Box::pin(async move { id.into_id().await.unwrap().quote() })
10827 }),
10828 );
10829 CacheVolume {
10830 proc: self.proc.clone(),
10831 selection: query,
10832 graphql_client: self.graphql_client.clone(),
10833 }
10834 }
10835 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
10837 let mut query = self.selection.select("loadChangesetFromID");
10838 query = query.arg_lazy(
10839 "id",
10840 Box::new(move || {
10841 let id = id.clone();
10842 Box::pin(async move { id.into_id().await.unwrap().quote() })
10843 }),
10844 );
10845 Changeset {
10846 proc: self.proc.clone(),
10847 selection: query,
10848 graphql_client: self.graphql_client.clone(),
10849 }
10850 }
10851 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
10853 let mut query = self.selection.select("loadCloudFromID");
10854 query = query.arg_lazy(
10855 "id",
10856 Box::new(move || {
10857 let id = id.clone();
10858 Box::pin(async move { id.into_id().await.unwrap().quote() })
10859 }),
10860 );
10861 Cloud {
10862 proc: self.proc.clone(),
10863 selection: query,
10864 graphql_client: self.graphql_client.clone(),
10865 }
10866 }
10867 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
10869 let mut query = self.selection.select("loadContainerFromID");
10870 query = query.arg_lazy(
10871 "id",
10872 Box::new(move || {
10873 let id = id.clone();
10874 Box::pin(async move { id.into_id().await.unwrap().quote() })
10875 }),
10876 );
10877 Container {
10878 proc: self.proc.clone(),
10879 selection: query,
10880 graphql_client: self.graphql_client.clone(),
10881 }
10882 }
10883 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
10885 let mut query = self.selection.select("loadCurrentModuleFromID");
10886 query = query.arg_lazy(
10887 "id",
10888 Box::new(move || {
10889 let id = id.clone();
10890 Box::pin(async move { id.into_id().await.unwrap().quote() })
10891 }),
10892 );
10893 CurrentModule {
10894 proc: self.proc.clone(),
10895 selection: query,
10896 graphql_client: self.graphql_client.clone(),
10897 }
10898 }
10899 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
10901 let mut query = self.selection.select("loadDirectoryFromID");
10902 query = query.arg_lazy(
10903 "id",
10904 Box::new(move || {
10905 let id = id.clone();
10906 Box::pin(async move { id.into_id().await.unwrap().quote() })
10907 }),
10908 );
10909 Directory {
10910 proc: self.proc.clone(),
10911 selection: query,
10912 graphql_client: self.graphql_client.clone(),
10913 }
10914 }
10915 pub fn load_engine_cache_entry_from_id(
10917 &self,
10918 id: impl IntoID<EngineCacheEntryId>,
10919 ) -> EngineCacheEntry {
10920 let mut query = self.selection.select("loadEngineCacheEntryFromID");
10921 query = query.arg_lazy(
10922 "id",
10923 Box::new(move || {
10924 let id = id.clone();
10925 Box::pin(async move { id.into_id().await.unwrap().quote() })
10926 }),
10927 );
10928 EngineCacheEntry {
10929 proc: self.proc.clone(),
10930 selection: query,
10931 graphql_client: self.graphql_client.clone(),
10932 }
10933 }
10934 pub fn load_engine_cache_entry_set_from_id(
10936 &self,
10937 id: impl IntoID<EngineCacheEntrySetId>,
10938 ) -> EngineCacheEntrySet {
10939 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
10940 query = query.arg_lazy(
10941 "id",
10942 Box::new(move || {
10943 let id = id.clone();
10944 Box::pin(async move { id.into_id().await.unwrap().quote() })
10945 }),
10946 );
10947 EngineCacheEntrySet {
10948 proc: self.proc.clone(),
10949 selection: query,
10950 graphql_client: self.graphql_client.clone(),
10951 }
10952 }
10953 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
10955 let mut query = self.selection.select("loadEngineCacheFromID");
10956 query = query.arg_lazy(
10957 "id",
10958 Box::new(move || {
10959 let id = id.clone();
10960 Box::pin(async move { id.into_id().await.unwrap().quote() })
10961 }),
10962 );
10963 EngineCache {
10964 proc: self.proc.clone(),
10965 selection: query,
10966 graphql_client: self.graphql_client.clone(),
10967 }
10968 }
10969 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
10971 let mut query = self.selection.select("loadEngineFromID");
10972 query = query.arg_lazy(
10973 "id",
10974 Box::new(move || {
10975 let id = id.clone();
10976 Box::pin(async move { id.into_id().await.unwrap().quote() })
10977 }),
10978 );
10979 Engine {
10980 proc: self.proc.clone(),
10981 selection: query,
10982 graphql_client: self.graphql_client.clone(),
10983 }
10984 }
10985 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
10987 let mut query = self.selection.select("loadEnumTypeDefFromID");
10988 query = query.arg_lazy(
10989 "id",
10990 Box::new(move || {
10991 let id = id.clone();
10992 Box::pin(async move { id.into_id().await.unwrap().quote() })
10993 }),
10994 );
10995 EnumTypeDef {
10996 proc: self.proc.clone(),
10997 selection: query,
10998 graphql_client: self.graphql_client.clone(),
10999 }
11000 }
11001 pub fn load_enum_value_type_def_from_id(
11003 &self,
11004 id: impl IntoID<EnumValueTypeDefId>,
11005 ) -> EnumValueTypeDef {
11006 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
11007 query = query.arg_lazy(
11008 "id",
11009 Box::new(move || {
11010 let id = id.clone();
11011 Box::pin(async move { id.into_id().await.unwrap().quote() })
11012 }),
11013 );
11014 EnumValueTypeDef {
11015 proc: self.proc.clone(),
11016 selection: query,
11017 graphql_client: self.graphql_client.clone(),
11018 }
11019 }
11020 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
11022 let mut query = self.selection.select("loadEnvFileFromID");
11023 query = query.arg_lazy(
11024 "id",
11025 Box::new(move || {
11026 let id = id.clone();
11027 Box::pin(async move { id.into_id().await.unwrap().quote() })
11028 }),
11029 );
11030 EnvFile {
11031 proc: self.proc.clone(),
11032 selection: query,
11033 graphql_client: self.graphql_client.clone(),
11034 }
11035 }
11036 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
11038 let mut query = self.selection.select("loadEnvFromID");
11039 query = query.arg_lazy(
11040 "id",
11041 Box::new(move || {
11042 let id = id.clone();
11043 Box::pin(async move { id.into_id().await.unwrap().quote() })
11044 }),
11045 );
11046 Env {
11047 proc: self.proc.clone(),
11048 selection: query,
11049 graphql_client: self.graphql_client.clone(),
11050 }
11051 }
11052 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
11054 let mut query = self.selection.select("loadEnvVariableFromID");
11055 query = query.arg_lazy(
11056 "id",
11057 Box::new(move || {
11058 let id = id.clone();
11059 Box::pin(async move { id.into_id().await.unwrap().quote() })
11060 }),
11061 );
11062 EnvVariable {
11063 proc: self.proc.clone(),
11064 selection: query,
11065 graphql_client: self.graphql_client.clone(),
11066 }
11067 }
11068 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
11070 let mut query = self.selection.select("loadErrorFromID");
11071 query = query.arg_lazy(
11072 "id",
11073 Box::new(move || {
11074 let id = id.clone();
11075 Box::pin(async move { id.into_id().await.unwrap().quote() })
11076 }),
11077 );
11078 Error {
11079 proc: self.proc.clone(),
11080 selection: query,
11081 graphql_client: self.graphql_client.clone(),
11082 }
11083 }
11084 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
11086 let mut query = self.selection.select("loadErrorValueFromID");
11087 query = query.arg_lazy(
11088 "id",
11089 Box::new(move || {
11090 let id = id.clone();
11091 Box::pin(async move { id.into_id().await.unwrap().quote() })
11092 }),
11093 );
11094 ErrorValue {
11095 proc: self.proc.clone(),
11096 selection: query,
11097 graphql_client: self.graphql_client.clone(),
11098 }
11099 }
11100 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
11102 let mut query = self.selection.select("loadFieldTypeDefFromID");
11103 query = query.arg_lazy(
11104 "id",
11105 Box::new(move || {
11106 let id = id.clone();
11107 Box::pin(async move { id.into_id().await.unwrap().quote() })
11108 }),
11109 );
11110 FieldTypeDef {
11111 proc: self.proc.clone(),
11112 selection: query,
11113 graphql_client: self.graphql_client.clone(),
11114 }
11115 }
11116 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
11118 let mut query = self.selection.select("loadFileFromID");
11119 query = query.arg_lazy(
11120 "id",
11121 Box::new(move || {
11122 let id = id.clone();
11123 Box::pin(async move { id.into_id().await.unwrap().quote() })
11124 }),
11125 );
11126 File {
11127 proc: self.proc.clone(),
11128 selection: query,
11129 graphql_client: self.graphql_client.clone(),
11130 }
11131 }
11132 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
11134 let mut query = self.selection.select("loadFunctionArgFromID");
11135 query = query.arg_lazy(
11136 "id",
11137 Box::new(move || {
11138 let id = id.clone();
11139 Box::pin(async move { id.into_id().await.unwrap().quote() })
11140 }),
11141 );
11142 FunctionArg {
11143 proc: self.proc.clone(),
11144 selection: query,
11145 graphql_client: self.graphql_client.clone(),
11146 }
11147 }
11148 pub fn load_function_call_arg_value_from_id(
11150 &self,
11151 id: impl IntoID<FunctionCallArgValueId>,
11152 ) -> FunctionCallArgValue {
11153 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
11154 query = query.arg_lazy(
11155 "id",
11156 Box::new(move || {
11157 let id = id.clone();
11158 Box::pin(async move { id.into_id().await.unwrap().quote() })
11159 }),
11160 );
11161 FunctionCallArgValue {
11162 proc: self.proc.clone(),
11163 selection: query,
11164 graphql_client: self.graphql_client.clone(),
11165 }
11166 }
11167 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
11169 let mut query = self.selection.select("loadFunctionCallFromID");
11170 query = query.arg_lazy(
11171 "id",
11172 Box::new(move || {
11173 let id = id.clone();
11174 Box::pin(async move { id.into_id().await.unwrap().quote() })
11175 }),
11176 );
11177 FunctionCall {
11178 proc: self.proc.clone(),
11179 selection: query,
11180 graphql_client: self.graphql_client.clone(),
11181 }
11182 }
11183 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
11185 let mut query = self.selection.select("loadFunctionFromID");
11186 query = query.arg_lazy(
11187 "id",
11188 Box::new(move || {
11189 let id = id.clone();
11190 Box::pin(async move { id.into_id().await.unwrap().quote() })
11191 }),
11192 );
11193 Function {
11194 proc: self.proc.clone(),
11195 selection: query,
11196 graphql_client: self.graphql_client.clone(),
11197 }
11198 }
11199 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
11201 let mut query = self.selection.select("loadGeneratedCodeFromID");
11202 query = query.arg_lazy(
11203 "id",
11204 Box::new(move || {
11205 let id = id.clone();
11206 Box::pin(async move { id.into_id().await.unwrap().quote() })
11207 }),
11208 );
11209 GeneratedCode {
11210 proc: self.proc.clone(),
11211 selection: query,
11212 graphql_client: self.graphql_client.clone(),
11213 }
11214 }
11215 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
11217 let mut query = self.selection.select("loadGitRefFromID");
11218 query = query.arg_lazy(
11219 "id",
11220 Box::new(move || {
11221 let id = id.clone();
11222 Box::pin(async move { id.into_id().await.unwrap().quote() })
11223 }),
11224 );
11225 GitRef {
11226 proc: self.proc.clone(),
11227 selection: query,
11228 graphql_client: self.graphql_client.clone(),
11229 }
11230 }
11231 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
11233 let mut query = self.selection.select("loadGitRepositoryFromID");
11234 query = query.arg_lazy(
11235 "id",
11236 Box::new(move || {
11237 let id = id.clone();
11238 Box::pin(async move { id.into_id().await.unwrap().quote() })
11239 }),
11240 );
11241 GitRepository {
11242 proc: self.proc.clone(),
11243 selection: query,
11244 graphql_client: self.graphql_client.clone(),
11245 }
11246 }
11247 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
11249 let mut query = self.selection.select("loadHostFromID");
11250 query = query.arg_lazy(
11251 "id",
11252 Box::new(move || {
11253 let id = id.clone();
11254 Box::pin(async move { id.into_id().await.unwrap().quote() })
11255 }),
11256 );
11257 Host {
11258 proc: self.proc.clone(),
11259 selection: query,
11260 graphql_client: self.graphql_client.clone(),
11261 }
11262 }
11263 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
11265 let mut query = self.selection.select("loadInputTypeDefFromID");
11266 query = query.arg_lazy(
11267 "id",
11268 Box::new(move || {
11269 let id = id.clone();
11270 Box::pin(async move { id.into_id().await.unwrap().quote() })
11271 }),
11272 );
11273 InputTypeDef {
11274 proc: self.proc.clone(),
11275 selection: query,
11276 graphql_client: self.graphql_client.clone(),
11277 }
11278 }
11279 pub fn load_interface_type_def_from_id(
11281 &self,
11282 id: impl IntoID<InterfaceTypeDefId>,
11283 ) -> InterfaceTypeDef {
11284 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
11285 query = query.arg_lazy(
11286 "id",
11287 Box::new(move || {
11288 let id = id.clone();
11289 Box::pin(async move { id.into_id().await.unwrap().quote() })
11290 }),
11291 );
11292 InterfaceTypeDef {
11293 proc: self.proc.clone(),
11294 selection: query,
11295 graphql_client: self.graphql_client.clone(),
11296 }
11297 }
11298 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
11300 let mut query = self.selection.select("loadJSONValueFromID");
11301 query = query.arg_lazy(
11302 "id",
11303 Box::new(move || {
11304 let id = id.clone();
11305 Box::pin(async move { id.into_id().await.unwrap().quote() })
11306 }),
11307 );
11308 JsonValue {
11309 proc: self.proc.clone(),
11310 selection: query,
11311 graphql_client: self.graphql_client.clone(),
11312 }
11313 }
11314 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
11316 let mut query = self.selection.select("loadLLMFromID");
11317 query = query.arg_lazy(
11318 "id",
11319 Box::new(move || {
11320 let id = id.clone();
11321 Box::pin(async move { id.into_id().await.unwrap().quote() })
11322 }),
11323 );
11324 Llm {
11325 proc: self.proc.clone(),
11326 selection: query,
11327 graphql_client: self.graphql_client.clone(),
11328 }
11329 }
11330 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
11332 let mut query = self.selection.select("loadLLMTokenUsageFromID");
11333 query = query.arg_lazy(
11334 "id",
11335 Box::new(move || {
11336 let id = id.clone();
11337 Box::pin(async move { id.into_id().await.unwrap().quote() })
11338 }),
11339 );
11340 LlmTokenUsage {
11341 proc: self.proc.clone(),
11342 selection: query,
11343 graphql_client: self.graphql_client.clone(),
11344 }
11345 }
11346 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
11348 let mut query = self.selection.select("loadLabelFromID");
11349 query = query.arg_lazy(
11350 "id",
11351 Box::new(move || {
11352 let id = id.clone();
11353 Box::pin(async move { id.into_id().await.unwrap().quote() })
11354 }),
11355 );
11356 Label {
11357 proc: self.proc.clone(),
11358 selection: query,
11359 graphql_client: self.graphql_client.clone(),
11360 }
11361 }
11362 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
11364 let mut query = self.selection.select("loadListTypeDefFromID");
11365 query = query.arg_lazy(
11366 "id",
11367 Box::new(move || {
11368 let id = id.clone();
11369 Box::pin(async move { id.into_id().await.unwrap().quote() })
11370 }),
11371 );
11372 ListTypeDef {
11373 proc: self.proc.clone(),
11374 selection: query,
11375 graphql_client: self.graphql_client.clone(),
11376 }
11377 }
11378 pub fn load_module_config_client_from_id(
11380 &self,
11381 id: impl IntoID<ModuleConfigClientId>,
11382 ) -> ModuleConfigClient {
11383 let mut query = self.selection.select("loadModuleConfigClientFromID");
11384 query = query.arg_lazy(
11385 "id",
11386 Box::new(move || {
11387 let id = id.clone();
11388 Box::pin(async move { id.into_id().await.unwrap().quote() })
11389 }),
11390 );
11391 ModuleConfigClient {
11392 proc: self.proc.clone(),
11393 selection: query,
11394 graphql_client: self.graphql_client.clone(),
11395 }
11396 }
11397 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
11399 let mut query = self.selection.select("loadModuleFromID");
11400 query = query.arg_lazy(
11401 "id",
11402 Box::new(move || {
11403 let id = id.clone();
11404 Box::pin(async move { id.into_id().await.unwrap().quote() })
11405 }),
11406 );
11407 Module {
11408 proc: self.proc.clone(),
11409 selection: query,
11410 graphql_client: self.graphql_client.clone(),
11411 }
11412 }
11413 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
11415 let mut query = self.selection.select("loadModuleSourceFromID");
11416 query = query.arg_lazy(
11417 "id",
11418 Box::new(move || {
11419 let id = id.clone();
11420 Box::pin(async move { id.into_id().await.unwrap().quote() })
11421 }),
11422 );
11423 ModuleSource {
11424 proc: self.proc.clone(),
11425 selection: query,
11426 graphql_client: self.graphql_client.clone(),
11427 }
11428 }
11429 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
11431 let mut query = self.selection.select("loadObjectTypeDefFromID");
11432 query = query.arg_lazy(
11433 "id",
11434 Box::new(move || {
11435 let id = id.clone();
11436 Box::pin(async move { id.into_id().await.unwrap().quote() })
11437 }),
11438 );
11439 ObjectTypeDef {
11440 proc: self.proc.clone(),
11441 selection: query,
11442 graphql_client: self.graphql_client.clone(),
11443 }
11444 }
11445 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
11447 let mut query = self.selection.select("loadPortFromID");
11448 query = query.arg_lazy(
11449 "id",
11450 Box::new(move || {
11451 let id = id.clone();
11452 Box::pin(async move { id.into_id().await.unwrap().quote() })
11453 }),
11454 );
11455 Port {
11456 proc: self.proc.clone(),
11457 selection: query,
11458 graphql_client: self.graphql_client.clone(),
11459 }
11460 }
11461 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
11463 let mut query = self.selection.select("loadSDKConfigFromID");
11464 query = query.arg_lazy(
11465 "id",
11466 Box::new(move || {
11467 let id = id.clone();
11468 Box::pin(async move { id.into_id().await.unwrap().quote() })
11469 }),
11470 );
11471 SdkConfig {
11472 proc: self.proc.clone(),
11473 selection: query,
11474 graphql_client: self.graphql_client.clone(),
11475 }
11476 }
11477 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
11479 let mut query = self.selection.select("loadScalarTypeDefFromID");
11480 query = query.arg_lazy(
11481 "id",
11482 Box::new(move || {
11483 let id = id.clone();
11484 Box::pin(async move { id.into_id().await.unwrap().quote() })
11485 }),
11486 );
11487 ScalarTypeDef {
11488 proc: self.proc.clone(),
11489 selection: query,
11490 graphql_client: self.graphql_client.clone(),
11491 }
11492 }
11493 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
11495 let mut query = self.selection.select("loadSearchResultFromID");
11496 query = query.arg_lazy(
11497 "id",
11498 Box::new(move || {
11499 let id = id.clone();
11500 Box::pin(async move { id.into_id().await.unwrap().quote() })
11501 }),
11502 );
11503 SearchResult {
11504 proc: self.proc.clone(),
11505 selection: query,
11506 graphql_client: self.graphql_client.clone(),
11507 }
11508 }
11509 pub fn load_search_submatch_from_id(
11511 &self,
11512 id: impl IntoID<SearchSubmatchId>,
11513 ) -> SearchSubmatch {
11514 let mut query = self.selection.select("loadSearchSubmatchFromID");
11515 query = query.arg_lazy(
11516 "id",
11517 Box::new(move || {
11518 let id = id.clone();
11519 Box::pin(async move { id.into_id().await.unwrap().quote() })
11520 }),
11521 );
11522 SearchSubmatch {
11523 proc: self.proc.clone(),
11524 selection: query,
11525 graphql_client: self.graphql_client.clone(),
11526 }
11527 }
11528 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
11530 let mut query = self.selection.select("loadSecretFromID");
11531 query = query.arg_lazy(
11532 "id",
11533 Box::new(move || {
11534 let id = id.clone();
11535 Box::pin(async move { id.into_id().await.unwrap().quote() })
11536 }),
11537 );
11538 Secret {
11539 proc: self.proc.clone(),
11540 selection: query,
11541 graphql_client: self.graphql_client.clone(),
11542 }
11543 }
11544 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
11546 let mut query = self.selection.select("loadServiceFromID");
11547 query = query.arg_lazy(
11548 "id",
11549 Box::new(move || {
11550 let id = id.clone();
11551 Box::pin(async move { id.into_id().await.unwrap().quote() })
11552 }),
11553 );
11554 Service {
11555 proc: self.proc.clone(),
11556 selection: query,
11557 graphql_client: self.graphql_client.clone(),
11558 }
11559 }
11560 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
11562 let mut query = self.selection.select("loadSocketFromID");
11563 query = query.arg_lazy(
11564 "id",
11565 Box::new(move || {
11566 let id = id.clone();
11567 Box::pin(async move { id.into_id().await.unwrap().quote() })
11568 }),
11569 );
11570 Socket {
11571 proc: self.proc.clone(),
11572 selection: query,
11573 graphql_client: self.graphql_client.clone(),
11574 }
11575 }
11576 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
11578 let mut query = self.selection.select("loadSourceMapFromID");
11579 query = query.arg_lazy(
11580 "id",
11581 Box::new(move || {
11582 let id = id.clone();
11583 Box::pin(async move { id.into_id().await.unwrap().quote() })
11584 }),
11585 );
11586 SourceMap {
11587 proc: self.proc.clone(),
11588 selection: query,
11589 graphql_client: self.graphql_client.clone(),
11590 }
11591 }
11592 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
11594 let mut query = self.selection.select("loadTerminalFromID");
11595 query = query.arg_lazy(
11596 "id",
11597 Box::new(move || {
11598 let id = id.clone();
11599 Box::pin(async move { id.into_id().await.unwrap().quote() })
11600 }),
11601 );
11602 Terminal {
11603 proc: self.proc.clone(),
11604 selection: query,
11605 graphql_client: self.graphql_client.clone(),
11606 }
11607 }
11608 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
11610 let mut query = self.selection.select("loadTypeDefFromID");
11611 query = query.arg_lazy(
11612 "id",
11613 Box::new(move || {
11614 let id = id.clone();
11615 Box::pin(async move { id.into_id().await.unwrap().quote() })
11616 }),
11617 );
11618 TypeDef {
11619 proc: self.proc.clone(),
11620 selection: query,
11621 graphql_client: self.graphql_client.clone(),
11622 }
11623 }
11624 pub fn module(&self) -> Module {
11626 let query = self.selection.select("module");
11627 Module {
11628 proc: self.proc.clone(),
11629 selection: query,
11630 graphql_client: self.graphql_client.clone(),
11631 }
11632 }
11633 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
11640 let mut query = self.selection.select("moduleSource");
11641 query = query.arg("refString", ref_string.into());
11642 ModuleSource {
11643 proc: self.proc.clone(),
11644 selection: query,
11645 graphql_client: self.graphql_client.clone(),
11646 }
11647 }
11648 pub fn module_source_opts<'a>(
11655 &self,
11656 ref_string: impl Into<String>,
11657 opts: QueryModuleSourceOpts<'a>,
11658 ) -> ModuleSource {
11659 let mut query = self.selection.select("moduleSource");
11660 query = query.arg("refString", ref_string.into());
11661 if let Some(ref_pin) = opts.ref_pin {
11662 query = query.arg("refPin", ref_pin);
11663 }
11664 if let Some(disable_find_up) = opts.disable_find_up {
11665 query = query.arg("disableFindUp", disable_find_up);
11666 }
11667 if let Some(allow_not_exists) = opts.allow_not_exists {
11668 query = query.arg("allowNotExists", allow_not_exists);
11669 }
11670 if let Some(require_kind) = opts.require_kind {
11671 query = query.arg("requireKind", require_kind);
11672 }
11673 ModuleSource {
11674 proc: self.proc.clone(),
11675 selection: query,
11676 graphql_client: self.graphql_client.clone(),
11677 }
11678 }
11679 pub fn secret(&self, uri: impl Into<String>) -> Secret {
11686 let mut query = self.selection.select("secret");
11687 query = query.arg("uri", uri.into());
11688 Secret {
11689 proc: self.proc.clone(),
11690 selection: query,
11691 graphql_client: self.graphql_client.clone(),
11692 }
11693 }
11694 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
11701 let mut query = self.selection.select("secret");
11702 query = query.arg("uri", uri.into());
11703 if let Some(cache_key) = opts.cache_key {
11704 query = query.arg("cacheKey", cache_key);
11705 }
11706 Secret {
11707 proc: self.proc.clone(),
11708 selection: query,
11709 graphql_client: self.graphql_client.clone(),
11710 }
11711 }
11712 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
11720 let mut query = self.selection.select("setSecret");
11721 query = query.arg("name", name.into());
11722 query = query.arg("plaintext", plaintext.into());
11723 Secret {
11724 proc: self.proc.clone(),
11725 selection: query,
11726 graphql_client: self.graphql_client.clone(),
11727 }
11728 }
11729 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
11737 let mut query = self.selection.select("sourceMap");
11738 query = query.arg("filename", filename.into());
11739 query = query.arg("line", line);
11740 query = query.arg("column", column);
11741 SourceMap {
11742 proc: self.proc.clone(),
11743 selection: query,
11744 graphql_client: self.graphql_client.clone(),
11745 }
11746 }
11747 pub fn type_def(&self) -> TypeDef {
11749 let query = self.selection.select("typeDef");
11750 TypeDef {
11751 proc: self.proc.clone(),
11752 selection: query,
11753 graphql_client: self.graphql_client.clone(),
11754 }
11755 }
11756 pub async fn version(&self) -> Result<String, DaggerError> {
11758 let query = self.selection.select("version");
11759 query.execute(self.graphql_client.clone()).await
11760 }
11761}
11762#[derive(Clone)]
11763pub struct SdkConfig {
11764 pub proc: Option<Arc<DaggerSessionProc>>,
11765 pub selection: Selection,
11766 pub graphql_client: DynGraphQLClient,
11767}
11768impl SdkConfig {
11769 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
11771 let query = self.selection.select("id");
11772 query.execute(self.graphql_client.clone()).await
11773 }
11774 pub async fn source(&self) -> Result<String, DaggerError> {
11776 let query = self.selection.select("source");
11777 query.execute(self.graphql_client.clone()).await
11778 }
11779}
11780#[derive(Clone)]
11781pub struct ScalarTypeDef {
11782 pub proc: Option<Arc<DaggerSessionProc>>,
11783 pub selection: Selection,
11784 pub graphql_client: DynGraphQLClient,
11785}
11786impl ScalarTypeDef {
11787 pub async fn description(&self) -> Result<String, DaggerError> {
11789 let query = self.selection.select("description");
11790 query.execute(self.graphql_client.clone()).await
11791 }
11792 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
11794 let query = self.selection.select("id");
11795 query.execute(self.graphql_client.clone()).await
11796 }
11797 pub async fn name(&self) -> Result<String, DaggerError> {
11799 let query = self.selection.select("name");
11800 query.execute(self.graphql_client.clone()).await
11801 }
11802 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11804 let query = self.selection.select("sourceModuleName");
11805 query.execute(self.graphql_client.clone()).await
11806 }
11807}
11808#[derive(Clone)]
11809pub struct SearchResult {
11810 pub proc: Option<Arc<DaggerSessionProc>>,
11811 pub selection: Selection,
11812 pub graphql_client: DynGraphQLClient,
11813}
11814impl SearchResult {
11815 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
11817 let query = self.selection.select("absoluteOffset");
11818 query.execute(self.graphql_client.clone()).await
11819 }
11820 pub async fn file_path(&self) -> Result<String, DaggerError> {
11822 let query = self.selection.select("filePath");
11823 query.execute(self.graphql_client.clone()).await
11824 }
11825 pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
11827 let query = self.selection.select("id");
11828 query.execute(self.graphql_client.clone()).await
11829 }
11830 pub async fn line_number(&self) -> Result<isize, DaggerError> {
11832 let query = self.selection.select("lineNumber");
11833 query.execute(self.graphql_client.clone()).await
11834 }
11835 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
11837 let query = self.selection.select("matchedLines");
11838 query.execute(self.graphql_client.clone()).await
11839 }
11840 pub fn submatches(&self) -> Vec<SearchSubmatch> {
11842 let query = self.selection.select("submatches");
11843 vec![SearchSubmatch {
11844 proc: self.proc.clone(),
11845 selection: query,
11846 graphql_client: self.graphql_client.clone(),
11847 }]
11848 }
11849}
11850#[derive(Clone)]
11851pub struct SearchSubmatch {
11852 pub proc: Option<Arc<DaggerSessionProc>>,
11853 pub selection: Selection,
11854 pub graphql_client: DynGraphQLClient,
11855}
11856impl SearchSubmatch {
11857 pub async fn end(&self) -> Result<isize, DaggerError> {
11859 let query = self.selection.select("end");
11860 query.execute(self.graphql_client.clone()).await
11861 }
11862 pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
11864 let query = self.selection.select("id");
11865 query.execute(self.graphql_client.clone()).await
11866 }
11867 pub async fn start(&self) -> Result<isize, DaggerError> {
11869 let query = self.selection.select("start");
11870 query.execute(self.graphql_client.clone()).await
11871 }
11872 pub async fn text(&self) -> Result<String, DaggerError> {
11874 let query = self.selection.select("text");
11875 query.execute(self.graphql_client.clone()).await
11876 }
11877}
11878#[derive(Clone)]
11879pub struct Secret {
11880 pub proc: Option<Arc<DaggerSessionProc>>,
11881 pub selection: Selection,
11882 pub graphql_client: DynGraphQLClient,
11883}
11884impl Secret {
11885 pub async fn id(&self) -> Result<SecretId, DaggerError> {
11887 let query = self.selection.select("id");
11888 query.execute(self.graphql_client.clone()).await
11889 }
11890 pub async fn name(&self) -> Result<String, DaggerError> {
11892 let query = self.selection.select("name");
11893 query.execute(self.graphql_client.clone()).await
11894 }
11895 pub async fn plaintext(&self) -> Result<String, DaggerError> {
11897 let query = self.selection.select("plaintext");
11898 query.execute(self.graphql_client.clone()).await
11899 }
11900 pub async fn uri(&self) -> Result<String, DaggerError> {
11902 let query = self.selection.select("uri");
11903 query.execute(self.graphql_client.clone()).await
11904 }
11905}
11906#[derive(Clone)]
11907pub struct Service {
11908 pub proc: Option<Arc<DaggerSessionProc>>,
11909 pub selection: Selection,
11910 pub graphql_client: DynGraphQLClient,
11911}
11912#[derive(Builder, Debug, PartialEq)]
11913pub struct ServiceEndpointOpts<'a> {
11914 #[builder(setter(into, strip_option), default)]
11916 pub port: Option<isize>,
11917 #[builder(setter(into, strip_option), default)]
11919 pub scheme: Option<&'a str>,
11920}
11921#[derive(Builder, Debug, PartialEq)]
11922pub struct ServiceStopOpts {
11923 #[builder(setter(into, strip_option), default)]
11925 pub kill: Option<bool>,
11926}
11927#[derive(Builder, Debug, PartialEq)]
11928pub struct ServiceTerminalOpts<'a> {
11929 #[builder(setter(into, strip_option), default)]
11930 pub cmd: Option<Vec<&'a str>>,
11931}
11932#[derive(Builder, Debug, PartialEq)]
11933pub struct ServiceUpOpts {
11934 #[builder(setter(into, strip_option), default)]
11937 pub ports: Option<Vec<PortForward>>,
11938 #[builder(setter(into, strip_option), default)]
11940 pub random: Option<bool>,
11941}
11942impl Service {
11943 pub async fn endpoint(&self) -> Result<String, DaggerError> {
11951 let query = self.selection.select("endpoint");
11952 query.execute(self.graphql_client.clone()).await
11953 }
11954 pub async fn endpoint_opts<'a>(
11962 &self,
11963 opts: ServiceEndpointOpts<'a>,
11964 ) -> Result<String, DaggerError> {
11965 let mut query = self.selection.select("endpoint");
11966 if let Some(port) = opts.port {
11967 query = query.arg("port", port);
11968 }
11969 if let Some(scheme) = opts.scheme {
11970 query = query.arg("scheme", scheme);
11971 }
11972 query.execute(self.graphql_client.clone()).await
11973 }
11974 pub async fn hostname(&self) -> Result<String, DaggerError> {
11976 let query = self.selection.select("hostname");
11977 query.execute(self.graphql_client.clone()).await
11978 }
11979 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
11981 let query = self.selection.select("id");
11982 query.execute(self.graphql_client.clone()).await
11983 }
11984 pub fn ports(&self) -> Vec<Port> {
11986 let query = self.selection.select("ports");
11987 vec![Port {
11988 proc: self.proc.clone(),
11989 selection: query,
11990 graphql_client: self.graphql_client.clone(),
11991 }]
11992 }
11993 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
11996 let query = self.selection.select("start");
11997 query.execute(self.graphql_client.clone()).await
11998 }
11999 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
12005 let query = self.selection.select("stop");
12006 query.execute(self.graphql_client.clone()).await
12007 }
12008 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
12014 let mut query = self.selection.select("stop");
12015 if let Some(kill) = opts.kill {
12016 query = query.arg("kill", kill);
12017 }
12018 query.execute(self.graphql_client.clone()).await
12019 }
12020 pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
12022 let query = self.selection.select("sync");
12023 query.execute(self.graphql_client.clone()).await
12024 }
12025 pub fn terminal(&self) -> Service {
12030 let query = self.selection.select("terminal");
12031 Service {
12032 proc: self.proc.clone(),
12033 selection: query,
12034 graphql_client: self.graphql_client.clone(),
12035 }
12036 }
12037 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
12042 let mut query = self.selection.select("terminal");
12043 if let Some(cmd) = opts.cmd {
12044 query = query.arg("cmd", cmd);
12045 }
12046 Service {
12047 proc: self.proc.clone(),
12048 selection: query,
12049 graphql_client: self.graphql_client.clone(),
12050 }
12051 }
12052 pub async fn up(&self) -> Result<Void, DaggerError> {
12058 let query = self.selection.select("up");
12059 query.execute(self.graphql_client.clone()).await
12060 }
12061 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
12067 let mut query = self.selection.select("up");
12068 if let Some(ports) = opts.ports {
12069 query = query.arg("ports", ports);
12070 }
12071 if let Some(random) = opts.random {
12072 query = query.arg("random", random);
12073 }
12074 query.execute(self.graphql_client.clone()).await
12075 }
12076 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
12082 let mut query = self.selection.select("withHostname");
12083 query = query.arg("hostname", hostname.into());
12084 Service {
12085 proc: self.proc.clone(),
12086 selection: query,
12087 graphql_client: self.graphql_client.clone(),
12088 }
12089 }
12090}
12091#[derive(Clone)]
12092pub struct Socket {
12093 pub proc: Option<Arc<DaggerSessionProc>>,
12094 pub selection: Selection,
12095 pub graphql_client: DynGraphQLClient,
12096}
12097impl Socket {
12098 pub async fn id(&self) -> Result<SocketId, DaggerError> {
12100 let query = self.selection.select("id");
12101 query.execute(self.graphql_client.clone()).await
12102 }
12103}
12104#[derive(Clone)]
12105pub struct SourceMap {
12106 pub proc: Option<Arc<DaggerSessionProc>>,
12107 pub selection: Selection,
12108 pub graphql_client: DynGraphQLClient,
12109}
12110impl SourceMap {
12111 pub async fn column(&self) -> Result<isize, DaggerError> {
12113 let query = self.selection.select("column");
12114 query.execute(self.graphql_client.clone()).await
12115 }
12116 pub async fn filename(&self) -> Result<String, DaggerError> {
12118 let query = self.selection.select("filename");
12119 query.execute(self.graphql_client.clone()).await
12120 }
12121 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
12123 let query = self.selection.select("id");
12124 query.execute(self.graphql_client.clone()).await
12125 }
12126 pub async fn line(&self) -> Result<isize, DaggerError> {
12128 let query = self.selection.select("line");
12129 query.execute(self.graphql_client.clone()).await
12130 }
12131 pub async fn module(&self) -> Result<String, DaggerError> {
12133 let query = self.selection.select("module");
12134 query.execute(self.graphql_client.clone()).await
12135 }
12136 pub async fn url(&self) -> Result<String, DaggerError> {
12138 let query = self.selection.select("url");
12139 query.execute(self.graphql_client.clone()).await
12140 }
12141}
12142#[derive(Clone)]
12143pub struct Terminal {
12144 pub proc: Option<Arc<DaggerSessionProc>>,
12145 pub selection: Selection,
12146 pub graphql_client: DynGraphQLClient,
12147}
12148impl Terminal {
12149 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
12151 let query = self.selection.select("id");
12152 query.execute(self.graphql_client.clone()).await
12153 }
12154 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
12157 let query = self.selection.select("sync");
12158 query.execute(self.graphql_client.clone()).await
12159 }
12160}
12161#[derive(Clone)]
12162pub struct TypeDef {
12163 pub proc: Option<Arc<DaggerSessionProc>>,
12164 pub selection: Selection,
12165 pub graphql_client: DynGraphQLClient,
12166}
12167#[derive(Builder, Debug, PartialEq)]
12168pub struct TypeDefWithEnumOpts<'a> {
12169 #[builder(setter(into, strip_option), default)]
12171 pub description: Option<&'a str>,
12172 #[builder(setter(into, strip_option), default)]
12174 pub source_map: Option<SourceMapId>,
12175}
12176#[derive(Builder, Debug, PartialEq)]
12177pub struct TypeDefWithEnumMemberOpts<'a> {
12178 #[builder(setter(into, strip_option), default)]
12180 pub description: Option<&'a str>,
12181 #[builder(setter(into, strip_option), default)]
12183 pub source_map: Option<SourceMapId>,
12184 #[builder(setter(into, strip_option), default)]
12186 pub value: Option<&'a str>,
12187}
12188#[derive(Builder, Debug, PartialEq)]
12189pub struct TypeDefWithEnumValueOpts<'a> {
12190 #[builder(setter(into, strip_option), default)]
12192 pub description: Option<&'a str>,
12193 #[builder(setter(into, strip_option), default)]
12195 pub source_map: Option<SourceMapId>,
12196}
12197#[derive(Builder, Debug, PartialEq)]
12198pub struct TypeDefWithFieldOpts<'a> {
12199 #[builder(setter(into, strip_option), default)]
12201 pub description: Option<&'a str>,
12202 #[builder(setter(into, strip_option), default)]
12204 pub source_map: Option<SourceMapId>,
12205}
12206#[derive(Builder, Debug, PartialEq)]
12207pub struct TypeDefWithInterfaceOpts<'a> {
12208 #[builder(setter(into, strip_option), default)]
12209 pub description: Option<&'a str>,
12210 #[builder(setter(into, strip_option), default)]
12211 pub source_map: Option<SourceMapId>,
12212}
12213#[derive(Builder, Debug, PartialEq)]
12214pub struct TypeDefWithObjectOpts<'a> {
12215 #[builder(setter(into, strip_option), default)]
12216 pub description: Option<&'a str>,
12217 #[builder(setter(into, strip_option), default)]
12218 pub source_map: Option<SourceMapId>,
12219}
12220#[derive(Builder, Debug, PartialEq)]
12221pub struct TypeDefWithScalarOpts<'a> {
12222 #[builder(setter(into, strip_option), default)]
12223 pub description: Option<&'a str>,
12224}
12225impl TypeDef {
12226 pub fn as_enum(&self) -> EnumTypeDef {
12228 let query = self.selection.select("asEnum");
12229 EnumTypeDef {
12230 proc: self.proc.clone(),
12231 selection: query,
12232 graphql_client: self.graphql_client.clone(),
12233 }
12234 }
12235 pub fn as_input(&self) -> InputTypeDef {
12237 let query = self.selection.select("asInput");
12238 InputTypeDef {
12239 proc: self.proc.clone(),
12240 selection: query,
12241 graphql_client: self.graphql_client.clone(),
12242 }
12243 }
12244 pub fn as_interface(&self) -> InterfaceTypeDef {
12246 let query = self.selection.select("asInterface");
12247 InterfaceTypeDef {
12248 proc: self.proc.clone(),
12249 selection: query,
12250 graphql_client: self.graphql_client.clone(),
12251 }
12252 }
12253 pub fn as_list(&self) -> ListTypeDef {
12255 let query = self.selection.select("asList");
12256 ListTypeDef {
12257 proc: self.proc.clone(),
12258 selection: query,
12259 graphql_client: self.graphql_client.clone(),
12260 }
12261 }
12262 pub fn as_object(&self) -> ObjectTypeDef {
12264 let query = self.selection.select("asObject");
12265 ObjectTypeDef {
12266 proc: self.proc.clone(),
12267 selection: query,
12268 graphql_client: self.graphql_client.clone(),
12269 }
12270 }
12271 pub fn as_scalar(&self) -> ScalarTypeDef {
12273 let query = self.selection.select("asScalar");
12274 ScalarTypeDef {
12275 proc: self.proc.clone(),
12276 selection: query,
12277 graphql_client: self.graphql_client.clone(),
12278 }
12279 }
12280 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
12282 let query = self.selection.select("id");
12283 query.execute(self.graphql_client.clone()).await
12284 }
12285 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
12287 let query = self.selection.select("kind");
12288 query.execute(self.graphql_client.clone()).await
12289 }
12290 pub async fn optional(&self) -> Result<bool, DaggerError> {
12292 let query = self.selection.select("optional");
12293 query.execute(self.graphql_client.clone()).await
12294 }
12295 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12297 let mut query = self.selection.select("withConstructor");
12298 query = query.arg_lazy(
12299 "function",
12300 Box::new(move || {
12301 let function = function.clone();
12302 Box::pin(async move { function.into_id().await.unwrap().quote() })
12303 }),
12304 );
12305 TypeDef {
12306 proc: self.proc.clone(),
12307 selection: query,
12308 graphql_client: self.graphql_client.clone(),
12309 }
12310 }
12311 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
12319 let mut query = self.selection.select("withEnum");
12320 query = query.arg("name", name.into());
12321 TypeDef {
12322 proc: self.proc.clone(),
12323 selection: query,
12324 graphql_client: self.graphql_client.clone(),
12325 }
12326 }
12327 pub fn with_enum_opts<'a>(
12335 &self,
12336 name: impl Into<String>,
12337 opts: TypeDefWithEnumOpts<'a>,
12338 ) -> TypeDef {
12339 let mut query = self.selection.select("withEnum");
12340 query = query.arg("name", name.into());
12341 if let Some(description) = opts.description {
12342 query = query.arg("description", description);
12343 }
12344 if let Some(source_map) = opts.source_map {
12345 query = query.arg("sourceMap", source_map);
12346 }
12347 TypeDef {
12348 proc: self.proc.clone(),
12349 selection: query,
12350 graphql_client: self.graphql_client.clone(),
12351 }
12352 }
12353 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
12360 let mut query = self.selection.select("withEnumMember");
12361 query = query.arg("name", name.into());
12362 TypeDef {
12363 proc: self.proc.clone(),
12364 selection: query,
12365 graphql_client: self.graphql_client.clone(),
12366 }
12367 }
12368 pub fn with_enum_member_opts<'a>(
12375 &self,
12376 name: impl Into<String>,
12377 opts: TypeDefWithEnumMemberOpts<'a>,
12378 ) -> TypeDef {
12379 let mut query = self.selection.select("withEnumMember");
12380 query = query.arg("name", name.into());
12381 if let Some(value) = opts.value {
12382 query = query.arg("value", value);
12383 }
12384 if let Some(description) = opts.description {
12385 query = query.arg("description", description);
12386 }
12387 if let Some(source_map) = opts.source_map {
12388 query = query.arg("sourceMap", source_map);
12389 }
12390 TypeDef {
12391 proc: self.proc.clone(),
12392 selection: query,
12393 graphql_client: self.graphql_client.clone(),
12394 }
12395 }
12396 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
12403 let mut query = self.selection.select("withEnumValue");
12404 query = query.arg("value", value.into());
12405 TypeDef {
12406 proc: self.proc.clone(),
12407 selection: query,
12408 graphql_client: self.graphql_client.clone(),
12409 }
12410 }
12411 pub fn with_enum_value_opts<'a>(
12418 &self,
12419 value: impl Into<String>,
12420 opts: TypeDefWithEnumValueOpts<'a>,
12421 ) -> TypeDef {
12422 let mut query = self.selection.select("withEnumValue");
12423 query = query.arg("value", value.into());
12424 if let Some(description) = opts.description {
12425 query = query.arg("description", description);
12426 }
12427 if let Some(source_map) = opts.source_map {
12428 query = query.arg("sourceMap", source_map);
12429 }
12430 TypeDef {
12431 proc: self.proc.clone(),
12432 selection: query,
12433 graphql_client: self.graphql_client.clone(),
12434 }
12435 }
12436 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
12444 let mut query = self.selection.select("withField");
12445 query = query.arg("name", name.into());
12446 query = query.arg_lazy(
12447 "typeDef",
12448 Box::new(move || {
12449 let type_def = type_def.clone();
12450 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12451 }),
12452 );
12453 TypeDef {
12454 proc: self.proc.clone(),
12455 selection: query,
12456 graphql_client: self.graphql_client.clone(),
12457 }
12458 }
12459 pub fn with_field_opts<'a>(
12467 &self,
12468 name: impl Into<String>,
12469 type_def: impl IntoID<TypeDefId>,
12470 opts: TypeDefWithFieldOpts<'a>,
12471 ) -> TypeDef {
12472 let mut query = self.selection.select("withField");
12473 query = query.arg("name", name.into());
12474 query = query.arg_lazy(
12475 "typeDef",
12476 Box::new(move || {
12477 let type_def = type_def.clone();
12478 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12479 }),
12480 );
12481 if let Some(description) = opts.description {
12482 query = query.arg("description", description);
12483 }
12484 if let Some(source_map) = opts.source_map {
12485 query = query.arg("sourceMap", source_map);
12486 }
12487 TypeDef {
12488 proc: self.proc.clone(),
12489 selection: query,
12490 graphql_client: self.graphql_client.clone(),
12491 }
12492 }
12493 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12495 let mut query = self.selection.select("withFunction");
12496 query = query.arg_lazy(
12497 "function",
12498 Box::new(move || {
12499 let function = function.clone();
12500 Box::pin(async move { function.into_id().await.unwrap().quote() })
12501 }),
12502 );
12503 TypeDef {
12504 proc: self.proc.clone(),
12505 selection: query,
12506 graphql_client: self.graphql_client.clone(),
12507 }
12508 }
12509 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
12515 let mut query = self.selection.select("withInterface");
12516 query = query.arg("name", name.into());
12517 TypeDef {
12518 proc: self.proc.clone(),
12519 selection: query,
12520 graphql_client: self.graphql_client.clone(),
12521 }
12522 }
12523 pub fn with_interface_opts<'a>(
12529 &self,
12530 name: impl Into<String>,
12531 opts: TypeDefWithInterfaceOpts<'a>,
12532 ) -> TypeDef {
12533 let mut query = self.selection.select("withInterface");
12534 query = query.arg("name", name.into());
12535 if let Some(description) = opts.description {
12536 query = query.arg("description", description);
12537 }
12538 if let Some(source_map) = opts.source_map {
12539 query = query.arg("sourceMap", source_map);
12540 }
12541 TypeDef {
12542 proc: self.proc.clone(),
12543 selection: query,
12544 graphql_client: self.graphql_client.clone(),
12545 }
12546 }
12547 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
12549 let mut query = self.selection.select("withKind");
12550 query = query.arg("kind", kind);
12551 TypeDef {
12552 proc: self.proc.clone(),
12553 selection: query,
12554 graphql_client: self.graphql_client.clone(),
12555 }
12556 }
12557 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
12559 let mut query = self.selection.select("withListOf");
12560 query = query.arg_lazy(
12561 "elementType",
12562 Box::new(move || {
12563 let element_type = element_type.clone();
12564 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
12565 }),
12566 );
12567 TypeDef {
12568 proc: self.proc.clone(),
12569 selection: query,
12570 graphql_client: self.graphql_client.clone(),
12571 }
12572 }
12573 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
12580 let mut query = self.selection.select("withObject");
12581 query = query.arg("name", name.into());
12582 TypeDef {
12583 proc: self.proc.clone(),
12584 selection: query,
12585 graphql_client: self.graphql_client.clone(),
12586 }
12587 }
12588 pub fn with_object_opts<'a>(
12595 &self,
12596 name: impl Into<String>,
12597 opts: TypeDefWithObjectOpts<'a>,
12598 ) -> TypeDef {
12599 let mut query = self.selection.select("withObject");
12600 query = query.arg("name", name.into());
12601 if let Some(description) = opts.description {
12602 query = query.arg("description", description);
12603 }
12604 if let Some(source_map) = opts.source_map {
12605 query = query.arg("sourceMap", source_map);
12606 }
12607 TypeDef {
12608 proc: self.proc.clone(),
12609 selection: query,
12610 graphql_client: self.graphql_client.clone(),
12611 }
12612 }
12613 pub fn with_optional(&self, optional: bool) -> TypeDef {
12615 let mut query = self.selection.select("withOptional");
12616 query = query.arg("optional", optional);
12617 TypeDef {
12618 proc: self.proc.clone(),
12619 selection: query,
12620 graphql_client: self.graphql_client.clone(),
12621 }
12622 }
12623 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
12629 let mut query = self.selection.select("withScalar");
12630 query = query.arg("name", name.into());
12631 TypeDef {
12632 proc: self.proc.clone(),
12633 selection: query,
12634 graphql_client: self.graphql_client.clone(),
12635 }
12636 }
12637 pub fn with_scalar_opts<'a>(
12643 &self,
12644 name: impl Into<String>,
12645 opts: TypeDefWithScalarOpts<'a>,
12646 ) -> TypeDef {
12647 let mut query = self.selection.select("withScalar");
12648 query = query.arg("name", name.into());
12649 if let Some(description) = opts.description {
12650 query = query.arg("description", description);
12651 }
12652 TypeDef {
12653 proc: self.proc.clone(),
12654 selection: query,
12655 graphql_client: self.graphql_client.clone(),
12656 }
12657 }
12658}
12659#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12660pub enum CacheSharingMode {
12661 #[serde(rename = "LOCKED")]
12662 Locked,
12663 #[serde(rename = "PRIVATE")]
12664 Private,
12665 #[serde(rename = "SHARED")]
12666 Shared,
12667}
12668#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12669pub enum ExistsType {
12670 #[serde(rename = "DIRECTORY_TYPE")]
12671 DirectoryType,
12672 #[serde(rename = "REGULAR_TYPE")]
12673 RegularType,
12674 #[serde(rename = "SYMLINK_TYPE")]
12675 SymlinkType,
12676}
12677#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12678pub enum ImageLayerCompression {
12679 #[serde(rename = "EStarGZ")]
12680 EStarGz,
12681 #[serde(rename = "ESTARGZ")]
12682 Estargz,
12683 #[serde(rename = "Gzip")]
12684 Gzip,
12685 #[serde(rename = "Uncompressed")]
12686 Uncompressed,
12687 #[serde(rename = "Zstd")]
12688 Zstd,
12689}
12690#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12691pub enum ImageMediaTypes {
12692 #[serde(rename = "DOCKER")]
12693 Docker,
12694 #[serde(rename = "DockerMediaTypes")]
12695 DockerMediaTypes,
12696 #[serde(rename = "OCI")]
12697 Oci,
12698 #[serde(rename = "OCIMediaTypes")]
12699 OciMediaTypes,
12700}
12701#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12702pub enum ModuleSourceExperimentalFeature {
12703 #[serde(rename = "SELF_CALLS")]
12704 SelfCalls,
12705}
12706#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12707pub enum ModuleSourceKind {
12708 #[serde(rename = "DIR")]
12709 Dir,
12710 #[serde(rename = "DIR_SOURCE")]
12711 DirSource,
12712 #[serde(rename = "GIT")]
12713 Git,
12714 #[serde(rename = "GIT_SOURCE")]
12715 GitSource,
12716 #[serde(rename = "LOCAL")]
12717 Local,
12718 #[serde(rename = "LOCAL_SOURCE")]
12719 LocalSource,
12720}
12721#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12722pub enum NetworkProtocol {
12723 #[serde(rename = "TCP")]
12724 Tcp,
12725 #[serde(rename = "UDP")]
12726 Udp,
12727}
12728#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12729pub enum ReturnType {
12730 #[serde(rename = "ANY")]
12731 Any,
12732 #[serde(rename = "FAILURE")]
12733 Failure,
12734 #[serde(rename = "SUCCESS")]
12735 Success,
12736}
12737#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12738pub enum TypeDefKind {
12739 #[serde(rename = "BOOLEAN")]
12740 Boolean,
12741 #[serde(rename = "BOOLEAN_KIND")]
12742 BooleanKind,
12743 #[serde(rename = "ENUM")]
12744 Enum,
12745 #[serde(rename = "ENUM_KIND")]
12746 EnumKind,
12747 #[serde(rename = "FLOAT")]
12748 Float,
12749 #[serde(rename = "FLOAT_KIND")]
12750 FloatKind,
12751 #[serde(rename = "INPUT")]
12752 Input,
12753 #[serde(rename = "INPUT_KIND")]
12754 InputKind,
12755 #[serde(rename = "INTEGER")]
12756 Integer,
12757 #[serde(rename = "INTEGER_KIND")]
12758 IntegerKind,
12759 #[serde(rename = "INTERFACE")]
12760 Interface,
12761 #[serde(rename = "INTERFACE_KIND")]
12762 InterfaceKind,
12763 #[serde(rename = "LIST")]
12764 List,
12765 #[serde(rename = "LIST_KIND")]
12766 ListKind,
12767 #[serde(rename = "OBJECT")]
12768 Object,
12769 #[serde(rename = "OBJECT_KIND")]
12770 ObjectKind,
12771 #[serde(rename = "SCALAR")]
12772 Scalar,
12773 #[serde(rename = "SCALAR_KIND")]
12774 ScalarKind,
12775 #[serde(rename = "STRING")]
12776 String,
12777 #[serde(rename = "STRING_KIND")]
12778 StringKind,
12779 #[serde(rename = "VOID")]
12780 Void,
12781 #[serde(rename = "VOID_KIND")]
12782 VoidKind,
12783}