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 gitignore: Option<bool>,
1836 #[builder(setter(into, strip_option), default)]
1837 pub include: Option<Vec<&'a str>>,
1838 #[builder(setter(into, strip_option), default)]
1839 pub no_cache: Option<bool>,
1840}
1841#[derive(Builder, Debug, PartialEq)]
1842pub struct AddressFileOpts<'a> {
1843 #[builder(setter(into, strip_option), default)]
1844 pub exclude: Option<Vec<&'a str>>,
1845 #[builder(setter(into, strip_option), default)]
1846 pub gitignore: Option<bool>,
1847 #[builder(setter(into, strip_option), default)]
1848 pub include: Option<Vec<&'a str>>,
1849 #[builder(setter(into, strip_option), default)]
1850 pub no_cache: Option<bool>,
1851}
1852impl Address {
1853 pub fn container(&self) -> Container {
1855 let query = self.selection.select("container");
1856 Container {
1857 proc: self.proc.clone(),
1858 selection: query,
1859 graphql_client: self.graphql_client.clone(),
1860 }
1861 }
1862 pub fn directory(&self) -> Directory {
1868 let query = self.selection.select("directory");
1869 Directory {
1870 proc: self.proc.clone(),
1871 selection: query,
1872 graphql_client: self.graphql_client.clone(),
1873 }
1874 }
1875 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
1881 let mut query = self.selection.select("directory");
1882 if let Some(exclude) = opts.exclude {
1883 query = query.arg("exclude", exclude);
1884 }
1885 if let Some(include) = opts.include {
1886 query = query.arg("include", include);
1887 }
1888 if let Some(gitignore) = opts.gitignore {
1889 query = query.arg("gitignore", gitignore);
1890 }
1891 if let Some(no_cache) = opts.no_cache {
1892 query = query.arg("noCache", no_cache);
1893 }
1894 Directory {
1895 proc: self.proc.clone(),
1896 selection: query,
1897 graphql_client: self.graphql_client.clone(),
1898 }
1899 }
1900 pub fn file(&self) -> File {
1906 let query = self.selection.select("file");
1907 File {
1908 proc: self.proc.clone(),
1909 selection: query,
1910 graphql_client: self.graphql_client.clone(),
1911 }
1912 }
1913 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
1919 let mut query = self.selection.select("file");
1920 if let Some(exclude) = opts.exclude {
1921 query = query.arg("exclude", exclude);
1922 }
1923 if let Some(include) = opts.include {
1924 query = query.arg("include", include);
1925 }
1926 if let Some(gitignore) = opts.gitignore {
1927 query = query.arg("gitignore", gitignore);
1928 }
1929 if let Some(no_cache) = opts.no_cache {
1930 query = query.arg("noCache", no_cache);
1931 }
1932 File {
1933 proc: self.proc.clone(),
1934 selection: query,
1935 graphql_client: self.graphql_client.clone(),
1936 }
1937 }
1938 pub fn git_ref(&self) -> GitRef {
1940 let query = self.selection.select("gitRef");
1941 GitRef {
1942 proc: self.proc.clone(),
1943 selection: query,
1944 graphql_client: self.graphql_client.clone(),
1945 }
1946 }
1947 pub fn git_repository(&self) -> GitRepository {
1949 let query = self.selection.select("gitRepository");
1950 GitRepository {
1951 proc: self.proc.clone(),
1952 selection: query,
1953 graphql_client: self.graphql_client.clone(),
1954 }
1955 }
1956 pub async fn id(&self) -> Result<AddressId, DaggerError> {
1958 let query = self.selection.select("id");
1959 query.execute(self.graphql_client.clone()).await
1960 }
1961 pub fn secret(&self) -> Secret {
1963 let query = self.selection.select("secret");
1964 Secret {
1965 proc: self.proc.clone(),
1966 selection: query,
1967 graphql_client: self.graphql_client.clone(),
1968 }
1969 }
1970 pub fn service(&self) -> Service {
1972 let query = self.selection.select("service");
1973 Service {
1974 proc: self.proc.clone(),
1975 selection: query,
1976 graphql_client: self.graphql_client.clone(),
1977 }
1978 }
1979 pub fn socket(&self) -> Socket {
1981 let query = self.selection.select("socket");
1982 Socket {
1983 proc: self.proc.clone(),
1984 selection: query,
1985 graphql_client: self.graphql_client.clone(),
1986 }
1987 }
1988 pub async fn value(&self) -> Result<String, DaggerError> {
1990 let query = self.selection.select("value");
1991 query.execute(self.graphql_client.clone()).await
1992 }
1993}
1994#[derive(Clone)]
1995pub struct Binding {
1996 pub proc: Option<Arc<DaggerSessionProc>>,
1997 pub selection: Selection,
1998 pub graphql_client: DynGraphQLClient,
1999}
2000impl Binding {
2001 pub fn as_address(&self) -> Address {
2003 let query = self.selection.select("asAddress");
2004 Address {
2005 proc: self.proc.clone(),
2006 selection: query,
2007 graphql_client: self.graphql_client.clone(),
2008 }
2009 }
2010 pub fn as_cache_volume(&self) -> CacheVolume {
2012 let query = self.selection.select("asCacheVolume");
2013 CacheVolume {
2014 proc: self.proc.clone(),
2015 selection: query,
2016 graphql_client: self.graphql_client.clone(),
2017 }
2018 }
2019 pub fn as_changeset(&self) -> Changeset {
2021 let query = self.selection.select("asChangeset");
2022 Changeset {
2023 proc: self.proc.clone(),
2024 selection: query,
2025 graphql_client: self.graphql_client.clone(),
2026 }
2027 }
2028 pub fn as_cloud(&self) -> Cloud {
2030 let query = self.selection.select("asCloud");
2031 Cloud {
2032 proc: self.proc.clone(),
2033 selection: query,
2034 graphql_client: self.graphql_client.clone(),
2035 }
2036 }
2037 pub fn as_container(&self) -> Container {
2039 let query = self.selection.select("asContainer");
2040 Container {
2041 proc: self.proc.clone(),
2042 selection: query,
2043 graphql_client: self.graphql_client.clone(),
2044 }
2045 }
2046 pub fn as_directory(&self) -> Directory {
2048 let query = self.selection.select("asDirectory");
2049 Directory {
2050 proc: self.proc.clone(),
2051 selection: query,
2052 graphql_client: self.graphql_client.clone(),
2053 }
2054 }
2055 pub fn as_env(&self) -> Env {
2057 let query = self.selection.select("asEnv");
2058 Env {
2059 proc: self.proc.clone(),
2060 selection: query,
2061 graphql_client: self.graphql_client.clone(),
2062 }
2063 }
2064 pub fn as_env_file(&self) -> EnvFile {
2066 let query = self.selection.select("asEnvFile");
2067 EnvFile {
2068 proc: self.proc.clone(),
2069 selection: query,
2070 graphql_client: self.graphql_client.clone(),
2071 }
2072 }
2073 pub fn as_file(&self) -> File {
2075 let query = self.selection.select("asFile");
2076 File {
2077 proc: self.proc.clone(),
2078 selection: query,
2079 graphql_client: self.graphql_client.clone(),
2080 }
2081 }
2082 pub fn as_git_ref(&self) -> GitRef {
2084 let query = self.selection.select("asGitRef");
2085 GitRef {
2086 proc: self.proc.clone(),
2087 selection: query,
2088 graphql_client: self.graphql_client.clone(),
2089 }
2090 }
2091 pub fn as_git_repository(&self) -> GitRepository {
2093 let query = self.selection.select("asGitRepository");
2094 GitRepository {
2095 proc: self.proc.clone(),
2096 selection: query,
2097 graphql_client: self.graphql_client.clone(),
2098 }
2099 }
2100 pub fn as_json_value(&self) -> JsonValue {
2102 let query = self.selection.select("asJSONValue");
2103 JsonValue {
2104 proc: self.proc.clone(),
2105 selection: query,
2106 graphql_client: self.graphql_client.clone(),
2107 }
2108 }
2109 pub fn as_module(&self) -> Module {
2111 let query = self.selection.select("asModule");
2112 Module {
2113 proc: self.proc.clone(),
2114 selection: query,
2115 graphql_client: self.graphql_client.clone(),
2116 }
2117 }
2118 pub fn as_module_config_client(&self) -> ModuleConfigClient {
2120 let query = self.selection.select("asModuleConfigClient");
2121 ModuleConfigClient {
2122 proc: self.proc.clone(),
2123 selection: query,
2124 graphql_client: self.graphql_client.clone(),
2125 }
2126 }
2127 pub fn as_module_source(&self) -> ModuleSource {
2129 let query = self.selection.select("asModuleSource");
2130 ModuleSource {
2131 proc: self.proc.clone(),
2132 selection: query,
2133 graphql_client: self.graphql_client.clone(),
2134 }
2135 }
2136 pub fn as_search_result(&self) -> SearchResult {
2138 let query = self.selection.select("asSearchResult");
2139 SearchResult {
2140 proc: self.proc.clone(),
2141 selection: query,
2142 graphql_client: self.graphql_client.clone(),
2143 }
2144 }
2145 pub fn as_search_submatch(&self) -> SearchSubmatch {
2147 let query = self.selection.select("asSearchSubmatch");
2148 SearchSubmatch {
2149 proc: self.proc.clone(),
2150 selection: query,
2151 graphql_client: self.graphql_client.clone(),
2152 }
2153 }
2154 pub fn as_secret(&self) -> Secret {
2156 let query = self.selection.select("asSecret");
2157 Secret {
2158 proc: self.proc.clone(),
2159 selection: query,
2160 graphql_client: self.graphql_client.clone(),
2161 }
2162 }
2163 pub fn as_service(&self) -> Service {
2165 let query = self.selection.select("asService");
2166 Service {
2167 proc: self.proc.clone(),
2168 selection: query,
2169 graphql_client: self.graphql_client.clone(),
2170 }
2171 }
2172 pub fn as_socket(&self) -> Socket {
2174 let query = self.selection.select("asSocket");
2175 Socket {
2176 proc: self.proc.clone(),
2177 selection: query,
2178 graphql_client: self.graphql_client.clone(),
2179 }
2180 }
2181 pub async fn as_string(&self) -> Result<String, DaggerError> {
2183 let query = self.selection.select("asString");
2184 query.execute(self.graphql_client.clone()).await
2185 }
2186 pub async fn digest(&self) -> Result<String, DaggerError> {
2188 let query = self.selection.select("digest");
2189 query.execute(self.graphql_client.clone()).await
2190 }
2191 pub async fn id(&self) -> Result<BindingId, DaggerError> {
2193 let query = self.selection.select("id");
2194 query.execute(self.graphql_client.clone()).await
2195 }
2196 pub async fn is_null(&self) -> Result<bool, DaggerError> {
2198 let query = self.selection.select("isNull");
2199 query.execute(self.graphql_client.clone()).await
2200 }
2201 pub async fn name(&self) -> Result<String, DaggerError> {
2203 let query = self.selection.select("name");
2204 query.execute(self.graphql_client.clone()).await
2205 }
2206 pub async fn type_name(&self) -> Result<String, DaggerError> {
2208 let query = self.selection.select("typeName");
2209 query.execute(self.graphql_client.clone()).await
2210 }
2211}
2212#[derive(Clone)]
2213pub struct CacheVolume {
2214 pub proc: Option<Arc<DaggerSessionProc>>,
2215 pub selection: Selection,
2216 pub graphql_client: DynGraphQLClient,
2217}
2218impl CacheVolume {
2219 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2221 let query = self.selection.select("id");
2222 query.execute(self.graphql_client.clone()).await
2223 }
2224}
2225#[derive(Clone)]
2226pub struct Changeset {
2227 pub proc: Option<Arc<DaggerSessionProc>>,
2228 pub selection: Selection,
2229 pub graphql_client: DynGraphQLClient,
2230}
2231impl Changeset {
2232 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2234 let query = self.selection.select("addedPaths");
2235 query.execute(self.graphql_client.clone()).await
2236 }
2237 pub fn after(&self) -> Directory {
2239 let query = self.selection.select("after");
2240 Directory {
2241 proc: self.proc.clone(),
2242 selection: query,
2243 graphql_client: self.graphql_client.clone(),
2244 }
2245 }
2246 pub fn as_patch(&self) -> File {
2248 let query = self.selection.select("asPatch");
2249 File {
2250 proc: self.proc.clone(),
2251 selection: query,
2252 graphql_client: self.graphql_client.clone(),
2253 }
2254 }
2255 pub fn before(&self) -> Directory {
2257 let query = self.selection.select("before");
2258 Directory {
2259 proc: self.proc.clone(),
2260 selection: query,
2261 graphql_client: self.graphql_client.clone(),
2262 }
2263 }
2264 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2270 let mut query = self.selection.select("export");
2271 query = query.arg("path", path.into());
2272 query.execute(self.graphql_client.clone()).await
2273 }
2274 pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2276 let query = self.selection.select("id");
2277 query.execute(self.graphql_client.clone()).await
2278 }
2279 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2281 let query = self.selection.select("isEmpty");
2282 query.execute(self.graphql_client.clone()).await
2283 }
2284 pub fn layer(&self) -> Directory {
2286 let query = self.selection.select("layer");
2287 Directory {
2288 proc: self.proc.clone(),
2289 selection: query,
2290 graphql_client: self.graphql_client.clone(),
2291 }
2292 }
2293 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2295 let query = self.selection.select("modifiedPaths");
2296 query.execute(self.graphql_client.clone()).await
2297 }
2298 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2300 let query = self.selection.select("removedPaths");
2301 query.execute(self.graphql_client.clone()).await
2302 }
2303 pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2305 let query = self.selection.select("sync");
2306 query.execute(self.graphql_client.clone()).await
2307 }
2308}
2309#[derive(Clone)]
2310pub struct Cloud {
2311 pub proc: Option<Arc<DaggerSessionProc>>,
2312 pub selection: Selection,
2313 pub graphql_client: DynGraphQLClient,
2314}
2315impl Cloud {
2316 pub async fn id(&self) -> Result<CloudId, DaggerError> {
2318 let query = self.selection.select("id");
2319 query.execute(self.graphql_client.clone()).await
2320 }
2321 pub async fn trace_url(&self) -> Result<String, DaggerError> {
2323 let query = self.selection.select("traceURL");
2324 query.execute(self.graphql_client.clone()).await
2325 }
2326}
2327#[derive(Clone)]
2328pub struct Container {
2329 pub proc: Option<Arc<DaggerSessionProc>>,
2330 pub selection: Selection,
2331 pub graphql_client: DynGraphQLClient,
2332}
2333#[derive(Builder, Debug, PartialEq)]
2334pub struct ContainerAsServiceOpts<'a> {
2335 #[builder(setter(into, strip_option), default)]
2338 pub args: Option<Vec<&'a str>>,
2339 #[builder(setter(into, strip_option), default)]
2341 pub expand: Option<bool>,
2342 #[builder(setter(into, strip_option), default)]
2344 pub experimental_privileged_nesting: Option<bool>,
2345 #[builder(setter(into, strip_option), default)]
2347 pub insecure_root_capabilities: Option<bool>,
2348 #[builder(setter(into, strip_option), default)]
2351 pub no_init: Option<bool>,
2352 #[builder(setter(into, strip_option), default)]
2354 pub use_entrypoint: Option<bool>,
2355}
2356#[derive(Builder, Debug, PartialEq)]
2357pub struct ContainerAsTarballOpts {
2358 #[builder(setter(into, strip_option), default)]
2361 pub forced_compression: Option<ImageLayerCompression>,
2362 #[builder(setter(into, strip_option), default)]
2365 pub media_types: Option<ImageMediaTypes>,
2366 #[builder(setter(into, strip_option), default)]
2369 pub platform_variants: Option<Vec<ContainerId>>,
2370}
2371#[derive(Builder, Debug, PartialEq)]
2372pub struct ContainerDirectoryOpts {
2373 #[builder(setter(into, strip_option), default)]
2375 pub expand: Option<bool>,
2376}
2377#[derive(Builder, Debug, PartialEq)]
2378pub struct ContainerExistsOpts {
2379 #[builder(setter(into, strip_option), default)]
2381 pub do_not_follow_symlinks: Option<bool>,
2382 #[builder(setter(into, strip_option), default)]
2384 pub expected_type: Option<ExistsType>,
2385}
2386#[derive(Builder, Debug, PartialEq)]
2387pub struct ContainerExportOpts {
2388 #[builder(setter(into, strip_option), default)]
2390 pub expand: Option<bool>,
2391 #[builder(setter(into, strip_option), default)]
2394 pub forced_compression: Option<ImageLayerCompression>,
2395 #[builder(setter(into, strip_option), default)]
2398 pub media_types: Option<ImageMediaTypes>,
2399 #[builder(setter(into, strip_option), default)]
2402 pub platform_variants: Option<Vec<ContainerId>>,
2403}
2404#[derive(Builder, Debug, PartialEq)]
2405pub struct ContainerExportImageOpts {
2406 #[builder(setter(into, strip_option), default)]
2409 pub forced_compression: Option<ImageLayerCompression>,
2410 #[builder(setter(into, strip_option), default)]
2413 pub media_types: Option<ImageMediaTypes>,
2414 #[builder(setter(into, strip_option), default)]
2417 pub platform_variants: Option<Vec<ContainerId>>,
2418}
2419#[derive(Builder, Debug, PartialEq)]
2420pub struct ContainerFileOpts {
2421 #[builder(setter(into, strip_option), default)]
2423 pub expand: Option<bool>,
2424}
2425#[derive(Builder, Debug, PartialEq)]
2426pub struct ContainerImportOpts<'a> {
2427 #[builder(setter(into, strip_option), default)]
2429 pub tag: Option<&'a str>,
2430}
2431#[derive(Builder, Debug, PartialEq)]
2432pub struct ContainerPublishOpts {
2433 #[builder(setter(into, strip_option), default)]
2436 pub forced_compression: Option<ImageLayerCompression>,
2437 #[builder(setter(into, strip_option), default)]
2440 pub media_types: Option<ImageMediaTypes>,
2441 #[builder(setter(into, strip_option), default)]
2444 pub platform_variants: Option<Vec<ContainerId>>,
2445}
2446#[derive(Builder, Debug, PartialEq)]
2447pub struct ContainerTerminalOpts<'a> {
2448 #[builder(setter(into, strip_option), default)]
2450 pub cmd: Option<Vec<&'a str>>,
2451 #[builder(setter(into, strip_option), default)]
2453 pub experimental_privileged_nesting: Option<bool>,
2454 #[builder(setter(into, strip_option), default)]
2456 pub insecure_root_capabilities: Option<bool>,
2457}
2458#[derive(Builder, Debug, PartialEq)]
2459pub struct ContainerUpOpts<'a> {
2460 #[builder(setter(into, strip_option), default)]
2463 pub args: Option<Vec<&'a str>>,
2464 #[builder(setter(into, strip_option), default)]
2466 pub expand: Option<bool>,
2467 #[builder(setter(into, strip_option), default)]
2469 pub experimental_privileged_nesting: Option<bool>,
2470 #[builder(setter(into, strip_option), default)]
2472 pub insecure_root_capabilities: Option<bool>,
2473 #[builder(setter(into, strip_option), default)]
2476 pub no_init: Option<bool>,
2477 #[builder(setter(into, strip_option), default)]
2480 pub ports: Option<Vec<PortForward>>,
2481 #[builder(setter(into, strip_option), default)]
2483 pub random: Option<bool>,
2484 #[builder(setter(into, strip_option), default)]
2486 pub use_entrypoint: Option<bool>,
2487}
2488#[derive(Builder, Debug, PartialEq)]
2489pub struct ContainerWithDefaultTerminalCmdOpts {
2490 #[builder(setter(into, strip_option), default)]
2492 pub experimental_privileged_nesting: Option<bool>,
2493 #[builder(setter(into, strip_option), default)]
2495 pub insecure_root_capabilities: Option<bool>,
2496}
2497#[derive(Builder, Debug, PartialEq)]
2498pub struct ContainerWithDirectoryOpts<'a> {
2499 #[builder(setter(into, strip_option), default)]
2501 pub exclude: Option<Vec<&'a str>>,
2502 #[builder(setter(into, strip_option), default)]
2504 pub expand: Option<bool>,
2505 #[builder(setter(into, strip_option), default)]
2507 pub gitignore: Option<bool>,
2508 #[builder(setter(into, strip_option), default)]
2510 pub include: Option<Vec<&'a str>>,
2511 #[builder(setter(into, strip_option), default)]
2515 pub owner: Option<&'a str>,
2516}
2517#[derive(Builder, Debug, PartialEq)]
2518pub struct ContainerWithEntrypointOpts {
2519 #[builder(setter(into, strip_option), default)]
2521 pub keep_default_args: Option<bool>,
2522}
2523#[derive(Builder, Debug, PartialEq)]
2524pub struct ContainerWithEnvVariableOpts {
2525 #[builder(setter(into, strip_option), default)]
2527 pub expand: Option<bool>,
2528}
2529#[derive(Builder, Debug, PartialEq)]
2530pub struct ContainerWithExecOpts<'a> {
2531 #[builder(setter(into, strip_option), default)]
2533 pub expand: Option<bool>,
2534 #[builder(setter(into, strip_option), default)]
2536 pub expect: Option<ReturnType>,
2537 #[builder(setter(into, strip_option), default)]
2539 pub experimental_privileged_nesting: Option<bool>,
2540 #[builder(setter(into, strip_option), default)]
2543 pub insecure_root_capabilities: Option<bool>,
2544 #[builder(setter(into, strip_option), default)]
2547 pub no_init: Option<bool>,
2548 #[builder(setter(into, strip_option), default)]
2550 pub redirect_stderr: Option<&'a str>,
2551 #[builder(setter(into, strip_option), default)]
2553 pub redirect_stdin: Option<&'a str>,
2554 #[builder(setter(into, strip_option), default)]
2556 pub redirect_stdout: Option<&'a str>,
2557 #[builder(setter(into, strip_option), default)]
2559 pub stdin: Option<&'a str>,
2560 #[builder(setter(into, strip_option), default)]
2562 pub use_entrypoint: Option<bool>,
2563}
2564#[derive(Builder, Debug, PartialEq)]
2565pub struct ContainerWithExposedPortOpts<'a> {
2566 #[builder(setter(into, strip_option), default)]
2568 pub description: Option<&'a str>,
2569 #[builder(setter(into, strip_option), default)]
2571 pub experimental_skip_healthcheck: Option<bool>,
2572 #[builder(setter(into, strip_option), default)]
2574 pub protocol: Option<NetworkProtocol>,
2575}
2576#[derive(Builder, Debug, PartialEq)]
2577pub struct ContainerWithFileOpts<'a> {
2578 #[builder(setter(into, strip_option), default)]
2580 pub expand: Option<bool>,
2581 #[builder(setter(into, strip_option), default)]
2585 pub owner: Option<&'a str>,
2586 #[builder(setter(into, strip_option), default)]
2588 pub permissions: Option<isize>,
2589}
2590#[derive(Builder, Debug, PartialEq)]
2591pub struct ContainerWithFilesOpts<'a> {
2592 #[builder(setter(into, strip_option), default)]
2594 pub expand: Option<bool>,
2595 #[builder(setter(into, strip_option), default)]
2599 pub owner: Option<&'a str>,
2600 #[builder(setter(into, strip_option), default)]
2602 pub permissions: Option<isize>,
2603}
2604#[derive(Builder, Debug, PartialEq)]
2605pub struct ContainerWithMountedCacheOpts<'a> {
2606 #[builder(setter(into, strip_option), default)]
2608 pub expand: Option<bool>,
2609 #[builder(setter(into, strip_option), default)]
2614 pub owner: Option<&'a str>,
2615 #[builder(setter(into, strip_option), default)]
2617 pub sharing: Option<CacheSharingMode>,
2618 #[builder(setter(into, strip_option), default)]
2620 pub source: Option<DirectoryId>,
2621}
2622#[derive(Builder, Debug, PartialEq)]
2623pub struct ContainerWithMountedDirectoryOpts<'a> {
2624 #[builder(setter(into, strip_option), default)]
2626 pub expand: Option<bool>,
2627 #[builder(setter(into, strip_option), default)]
2631 pub owner: Option<&'a str>,
2632}
2633#[derive(Builder, Debug, PartialEq)]
2634pub struct ContainerWithMountedFileOpts<'a> {
2635 #[builder(setter(into, strip_option), default)]
2637 pub expand: Option<bool>,
2638 #[builder(setter(into, strip_option), default)]
2642 pub owner: Option<&'a str>,
2643}
2644#[derive(Builder, Debug, PartialEq)]
2645pub struct ContainerWithMountedSecretOpts<'a> {
2646 #[builder(setter(into, strip_option), default)]
2648 pub expand: Option<bool>,
2649 #[builder(setter(into, strip_option), default)]
2652 pub mode: Option<isize>,
2653 #[builder(setter(into, strip_option), default)]
2657 pub owner: Option<&'a str>,
2658}
2659#[derive(Builder, Debug, PartialEq)]
2660pub struct ContainerWithMountedTempOpts {
2661 #[builder(setter(into, strip_option), default)]
2663 pub expand: Option<bool>,
2664 #[builder(setter(into, strip_option), default)]
2666 pub size: Option<isize>,
2667}
2668#[derive(Builder, Debug, PartialEq)]
2669pub struct ContainerWithNewFileOpts<'a> {
2670 #[builder(setter(into, strip_option), default)]
2672 pub expand: Option<bool>,
2673 #[builder(setter(into, strip_option), default)]
2677 pub owner: Option<&'a str>,
2678 #[builder(setter(into, strip_option), default)]
2680 pub permissions: Option<isize>,
2681}
2682#[derive(Builder, Debug, PartialEq)]
2683pub struct ContainerWithSymlinkOpts {
2684 #[builder(setter(into, strip_option), default)]
2686 pub expand: Option<bool>,
2687}
2688#[derive(Builder, Debug, PartialEq)]
2689pub struct ContainerWithUnixSocketOpts<'a> {
2690 #[builder(setter(into, strip_option), default)]
2692 pub expand: Option<bool>,
2693 #[builder(setter(into, strip_option), default)]
2697 pub owner: Option<&'a str>,
2698}
2699#[derive(Builder, Debug, PartialEq)]
2700pub struct ContainerWithWorkdirOpts {
2701 #[builder(setter(into, strip_option), default)]
2703 pub expand: Option<bool>,
2704}
2705#[derive(Builder, Debug, PartialEq)]
2706pub struct ContainerWithoutDirectoryOpts {
2707 #[builder(setter(into, strip_option), default)]
2709 pub expand: Option<bool>,
2710}
2711#[derive(Builder, Debug, PartialEq)]
2712pub struct ContainerWithoutEntrypointOpts {
2713 #[builder(setter(into, strip_option), default)]
2715 pub keep_default_args: Option<bool>,
2716}
2717#[derive(Builder, Debug, PartialEq)]
2718pub struct ContainerWithoutExposedPortOpts {
2719 #[builder(setter(into, strip_option), default)]
2721 pub protocol: Option<NetworkProtocol>,
2722}
2723#[derive(Builder, Debug, PartialEq)]
2724pub struct ContainerWithoutFileOpts {
2725 #[builder(setter(into, strip_option), default)]
2727 pub expand: Option<bool>,
2728}
2729#[derive(Builder, Debug, PartialEq)]
2730pub struct ContainerWithoutFilesOpts {
2731 #[builder(setter(into, strip_option), default)]
2733 pub expand: Option<bool>,
2734}
2735#[derive(Builder, Debug, PartialEq)]
2736pub struct ContainerWithoutMountOpts {
2737 #[builder(setter(into, strip_option), default)]
2739 pub expand: Option<bool>,
2740}
2741#[derive(Builder, Debug, PartialEq)]
2742pub struct ContainerWithoutUnixSocketOpts {
2743 #[builder(setter(into, strip_option), default)]
2745 pub expand: Option<bool>,
2746}
2747impl Container {
2748 pub fn as_service(&self) -> Service {
2755 let query = self.selection.select("asService");
2756 Service {
2757 proc: self.proc.clone(),
2758 selection: query,
2759 graphql_client: self.graphql_client.clone(),
2760 }
2761 }
2762 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2769 let mut query = self.selection.select("asService");
2770 if let Some(args) = opts.args {
2771 query = query.arg("args", args);
2772 }
2773 if let Some(use_entrypoint) = opts.use_entrypoint {
2774 query = query.arg("useEntrypoint", use_entrypoint);
2775 }
2776 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2777 query = query.arg(
2778 "experimentalPrivilegedNesting",
2779 experimental_privileged_nesting,
2780 );
2781 }
2782 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2783 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2784 }
2785 if let Some(expand) = opts.expand {
2786 query = query.arg("expand", expand);
2787 }
2788 if let Some(no_init) = opts.no_init {
2789 query = query.arg("noInit", no_init);
2790 }
2791 Service {
2792 proc: self.proc.clone(),
2793 selection: query,
2794 graphql_client: self.graphql_client.clone(),
2795 }
2796 }
2797 pub fn as_tarball(&self) -> File {
2803 let query = self.selection.select("asTarball");
2804 File {
2805 proc: self.proc.clone(),
2806 selection: query,
2807 graphql_client: self.graphql_client.clone(),
2808 }
2809 }
2810 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2816 let mut query = self.selection.select("asTarball");
2817 if let Some(platform_variants) = opts.platform_variants {
2818 query = query.arg("platformVariants", platform_variants);
2819 }
2820 if let Some(forced_compression) = opts.forced_compression {
2821 query = query.arg("forcedCompression", forced_compression);
2822 }
2823 if let Some(media_types) = opts.media_types {
2824 query = query.arg("mediaTypes", media_types);
2825 }
2826 File {
2827 proc: self.proc.clone(),
2828 selection: query,
2829 graphql_client: self.graphql_client.clone(),
2830 }
2831 }
2832 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2835 let query = self.selection.select("combinedOutput");
2836 query.execute(self.graphql_client.clone()).await
2837 }
2838 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2840 let query = self.selection.select("defaultArgs");
2841 query.execute(self.graphql_client.clone()).await
2842 }
2843 pub fn directory(&self, path: impl Into<String>) -> Directory {
2851 let mut query = self.selection.select("directory");
2852 query = query.arg("path", path.into());
2853 Directory {
2854 proc: self.proc.clone(),
2855 selection: query,
2856 graphql_client: self.graphql_client.clone(),
2857 }
2858 }
2859 pub fn directory_opts(
2867 &self,
2868 path: impl Into<String>,
2869 opts: ContainerDirectoryOpts,
2870 ) -> Directory {
2871 let mut query = self.selection.select("directory");
2872 query = query.arg("path", path.into());
2873 if let Some(expand) = opts.expand {
2874 query = query.arg("expand", expand);
2875 }
2876 Directory {
2877 proc: self.proc.clone(),
2878 selection: query,
2879 graphql_client: self.graphql_client.clone(),
2880 }
2881 }
2882 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2884 let query = self.selection.select("entrypoint");
2885 query.execute(self.graphql_client.clone()).await
2886 }
2887 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2893 let mut query = self.selection.select("envVariable");
2894 query = query.arg("name", name.into());
2895 query.execute(self.graphql_client.clone()).await
2896 }
2897 pub fn env_variables(&self) -> Vec<EnvVariable> {
2899 let query = self.selection.select("envVariables");
2900 vec![EnvVariable {
2901 proc: self.proc.clone(),
2902 selection: query,
2903 graphql_client: self.graphql_client.clone(),
2904 }]
2905 }
2906 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2913 let mut query = self.selection.select("exists");
2914 query = query.arg("path", path.into());
2915 query.execute(self.graphql_client.clone()).await
2916 }
2917 pub async fn exists_opts(
2924 &self,
2925 path: impl Into<String>,
2926 opts: ContainerExistsOpts,
2927 ) -> Result<bool, DaggerError> {
2928 let mut query = self.selection.select("exists");
2929 query = query.arg("path", path.into());
2930 if let Some(expected_type) = opts.expected_type {
2931 query = query.arg("expectedType", expected_type);
2932 }
2933 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2934 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2935 }
2936 query.execute(self.graphql_client.clone()).await
2937 }
2938 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2941 let query = self.selection.select("exitCode");
2942 query.execute(self.graphql_client.clone()).await
2943 }
2944 pub fn experimental_with_all_gp_us(&self) -> Container {
2948 let query = self.selection.select("experimentalWithAllGPUs");
2949 Container {
2950 proc: self.proc.clone(),
2951 selection: query,
2952 graphql_client: self.graphql_client.clone(),
2953 }
2954 }
2955 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2963 let mut query = self.selection.select("experimentalWithGPU");
2964 query = query.arg(
2965 "devices",
2966 devices
2967 .into_iter()
2968 .map(|i| i.into())
2969 .collect::<Vec<String>>(),
2970 );
2971 Container {
2972 proc: self.proc.clone(),
2973 selection: query,
2974 graphql_client: self.graphql_client.clone(),
2975 }
2976 }
2977 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2987 let mut query = self.selection.select("export");
2988 query = query.arg("path", path.into());
2989 query.execute(self.graphql_client.clone()).await
2990 }
2991 pub async fn export_opts(
3001 &self,
3002 path: impl Into<String>,
3003 opts: ContainerExportOpts,
3004 ) -> Result<String, DaggerError> {
3005 let mut query = self.selection.select("export");
3006 query = query.arg("path", path.into());
3007 if let Some(platform_variants) = opts.platform_variants {
3008 query = query.arg("platformVariants", platform_variants);
3009 }
3010 if let Some(forced_compression) = opts.forced_compression {
3011 query = query.arg("forcedCompression", forced_compression);
3012 }
3013 if let Some(media_types) = opts.media_types {
3014 query = query.arg("mediaTypes", media_types);
3015 }
3016 if let Some(expand) = opts.expand {
3017 query = query.arg("expand", expand);
3018 }
3019 query.execute(self.graphql_client.clone()).await
3020 }
3021 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3028 let mut query = self.selection.select("exportImage");
3029 query = query.arg("name", name.into());
3030 query.execute(self.graphql_client.clone()).await
3031 }
3032 pub async fn export_image_opts(
3039 &self,
3040 name: impl Into<String>,
3041 opts: ContainerExportImageOpts,
3042 ) -> Result<Void, DaggerError> {
3043 let mut query = self.selection.select("exportImage");
3044 query = query.arg("name", name.into());
3045 if let Some(platform_variants) = opts.platform_variants {
3046 query = query.arg("platformVariants", platform_variants);
3047 }
3048 if let Some(forced_compression) = opts.forced_compression {
3049 query = query.arg("forcedCompression", forced_compression);
3050 }
3051 if let Some(media_types) = opts.media_types {
3052 query = query.arg("mediaTypes", media_types);
3053 }
3054 query.execute(self.graphql_client.clone()).await
3055 }
3056 pub fn exposed_ports(&self) -> Vec<Port> {
3059 let query = self.selection.select("exposedPorts");
3060 vec![Port {
3061 proc: self.proc.clone(),
3062 selection: query,
3063 graphql_client: self.graphql_client.clone(),
3064 }]
3065 }
3066 pub fn file(&self, path: impl Into<String>) -> File {
3074 let mut query = self.selection.select("file");
3075 query = query.arg("path", path.into());
3076 File {
3077 proc: self.proc.clone(),
3078 selection: query,
3079 graphql_client: self.graphql_client.clone(),
3080 }
3081 }
3082 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3090 let mut query = self.selection.select("file");
3091 query = query.arg("path", path.into());
3092 if let Some(expand) = opts.expand {
3093 query = query.arg("expand", expand);
3094 }
3095 File {
3096 proc: self.proc.clone(),
3097 selection: query,
3098 graphql_client: self.graphql_client.clone(),
3099 }
3100 }
3101 pub fn from(&self, address: impl Into<String>) -> Container {
3107 let mut query = self.selection.select("from");
3108 query = query.arg("address", address.into());
3109 Container {
3110 proc: self.proc.clone(),
3111 selection: query,
3112 graphql_client: self.graphql_client.clone(),
3113 }
3114 }
3115 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3117 let query = self.selection.select("id");
3118 query.execute(self.graphql_client.clone()).await
3119 }
3120 pub async fn image_ref(&self) -> Result<String, DaggerError> {
3122 let query = self.selection.select("imageRef");
3123 query.execute(self.graphql_client.clone()).await
3124 }
3125 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3132 let mut query = self.selection.select("import");
3133 query = query.arg_lazy(
3134 "source",
3135 Box::new(move || {
3136 let source = source.clone();
3137 Box::pin(async move { source.into_id().await.unwrap().quote() })
3138 }),
3139 );
3140 Container {
3141 proc: self.proc.clone(),
3142 selection: query,
3143 graphql_client: self.graphql_client.clone(),
3144 }
3145 }
3146 pub fn import_opts<'a>(
3153 &self,
3154 source: impl IntoID<FileId>,
3155 opts: ContainerImportOpts<'a>,
3156 ) -> Container {
3157 let mut query = self.selection.select("import");
3158 query = query.arg_lazy(
3159 "source",
3160 Box::new(move || {
3161 let source = source.clone();
3162 Box::pin(async move { source.into_id().await.unwrap().quote() })
3163 }),
3164 );
3165 if let Some(tag) = opts.tag {
3166 query = query.arg("tag", tag);
3167 }
3168 Container {
3169 proc: self.proc.clone(),
3170 selection: query,
3171 graphql_client: self.graphql_client.clone(),
3172 }
3173 }
3174 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3180 let mut query = self.selection.select("label");
3181 query = query.arg("name", name.into());
3182 query.execute(self.graphql_client.clone()).await
3183 }
3184 pub fn labels(&self) -> Vec<Label> {
3186 let query = self.selection.select("labels");
3187 vec![Label {
3188 proc: self.proc.clone(),
3189 selection: query,
3190 graphql_client: self.graphql_client.clone(),
3191 }]
3192 }
3193 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3195 let query = self.selection.select("mounts");
3196 query.execute(self.graphql_client.clone()).await
3197 }
3198 pub async fn platform(&self) -> Result<Platform, DaggerError> {
3200 let query = self.selection.select("platform");
3201 query.execute(self.graphql_client.clone()).await
3202 }
3203 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3213 let mut query = self.selection.select("publish");
3214 query = query.arg("address", address.into());
3215 query.execute(self.graphql_client.clone()).await
3216 }
3217 pub async fn publish_opts(
3227 &self,
3228 address: impl Into<String>,
3229 opts: ContainerPublishOpts,
3230 ) -> Result<String, DaggerError> {
3231 let mut query = self.selection.select("publish");
3232 query = query.arg("address", address.into());
3233 if let Some(platform_variants) = opts.platform_variants {
3234 query = query.arg("platformVariants", platform_variants);
3235 }
3236 if let Some(forced_compression) = opts.forced_compression {
3237 query = query.arg("forcedCompression", forced_compression);
3238 }
3239 if let Some(media_types) = opts.media_types {
3240 query = query.arg("mediaTypes", media_types);
3241 }
3242 query.execute(self.graphql_client.clone()).await
3243 }
3244 pub fn rootfs(&self) -> Directory {
3246 let query = self.selection.select("rootfs");
3247 Directory {
3248 proc: self.proc.clone(),
3249 selection: query,
3250 graphql_client: self.graphql_client.clone(),
3251 }
3252 }
3253 pub async fn stderr(&self) -> Result<String, DaggerError> {
3256 let query = self.selection.select("stderr");
3257 query.execute(self.graphql_client.clone()).await
3258 }
3259 pub async fn stdout(&self) -> Result<String, DaggerError> {
3262 let query = self.selection.select("stdout");
3263 query.execute(self.graphql_client.clone()).await
3264 }
3265 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3268 let query = self.selection.select("sync");
3269 query.execute(self.graphql_client.clone()).await
3270 }
3271 pub fn terminal(&self) -> Container {
3277 let query = self.selection.select("terminal");
3278 Container {
3279 proc: self.proc.clone(),
3280 selection: query,
3281 graphql_client: self.graphql_client.clone(),
3282 }
3283 }
3284 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3290 let mut query = self.selection.select("terminal");
3291 if let Some(cmd) = opts.cmd {
3292 query = query.arg("cmd", cmd);
3293 }
3294 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3295 query = query.arg(
3296 "experimentalPrivilegedNesting",
3297 experimental_privileged_nesting,
3298 );
3299 }
3300 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3301 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3302 }
3303 Container {
3304 proc: self.proc.clone(),
3305 selection: query,
3306 graphql_client: self.graphql_client.clone(),
3307 }
3308 }
3309 pub async fn up(&self) -> Result<Void, DaggerError> {
3316 let query = self.selection.select("up");
3317 query.execute(self.graphql_client.clone()).await
3318 }
3319 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3326 let mut query = self.selection.select("up");
3327 if let Some(random) = opts.random {
3328 query = query.arg("random", random);
3329 }
3330 if let Some(ports) = opts.ports {
3331 query = query.arg("ports", ports);
3332 }
3333 if let Some(args) = opts.args {
3334 query = query.arg("args", args);
3335 }
3336 if let Some(use_entrypoint) = opts.use_entrypoint {
3337 query = query.arg("useEntrypoint", use_entrypoint);
3338 }
3339 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3340 query = query.arg(
3341 "experimentalPrivilegedNesting",
3342 experimental_privileged_nesting,
3343 );
3344 }
3345 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3346 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3347 }
3348 if let Some(expand) = opts.expand {
3349 query = query.arg("expand", expand);
3350 }
3351 if let Some(no_init) = opts.no_init {
3352 query = query.arg("noInit", no_init);
3353 }
3354 query.execute(self.graphql_client.clone()).await
3355 }
3356 pub async fn user(&self) -> Result<String, DaggerError> {
3358 let query = self.selection.select("user");
3359 query.execute(self.graphql_client.clone()).await
3360 }
3361 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3368 let mut query = self.selection.select("withAnnotation");
3369 query = query.arg("name", name.into());
3370 query = query.arg("value", value.into());
3371 Container {
3372 proc: self.proc.clone(),
3373 selection: query,
3374 graphql_client: self.graphql_client.clone(),
3375 }
3376 }
3377 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3383 let mut query = self.selection.select("withDefaultArgs");
3384 query = query.arg(
3385 "args",
3386 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3387 );
3388 Container {
3389 proc: self.proc.clone(),
3390 selection: query,
3391 graphql_client: self.graphql_client.clone(),
3392 }
3393 }
3394 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3401 let mut query = self.selection.select("withDefaultTerminalCmd");
3402 query = query.arg(
3403 "args",
3404 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3405 );
3406 Container {
3407 proc: self.proc.clone(),
3408 selection: query,
3409 graphql_client: self.graphql_client.clone(),
3410 }
3411 }
3412 pub fn with_default_terminal_cmd_opts(
3419 &self,
3420 args: Vec<impl Into<String>>,
3421 opts: ContainerWithDefaultTerminalCmdOpts,
3422 ) -> Container {
3423 let mut query = self.selection.select("withDefaultTerminalCmd");
3424 query = query.arg(
3425 "args",
3426 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3427 );
3428 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3429 query = query.arg(
3430 "experimentalPrivilegedNesting",
3431 experimental_privileged_nesting,
3432 );
3433 }
3434 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3435 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3436 }
3437 Container {
3438 proc: self.proc.clone(),
3439 selection: query,
3440 graphql_client: self.graphql_client.clone(),
3441 }
3442 }
3443 pub fn with_directory(
3451 &self,
3452 path: impl Into<String>,
3453 source: impl IntoID<DirectoryId>,
3454 ) -> Container {
3455 let mut query = self.selection.select("withDirectory");
3456 query = query.arg("path", path.into());
3457 query = query.arg_lazy(
3458 "source",
3459 Box::new(move || {
3460 let source = source.clone();
3461 Box::pin(async move { source.into_id().await.unwrap().quote() })
3462 }),
3463 );
3464 Container {
3465 proc: self.proc.clone(),
3466 selection: query,
3467 graphql_client: self.graphql_client.clone(),
3468 }
3469 }
3470 pub fn with_directory_opts<'a>(
3478 &self,
3479 path: impl Into<String>,
3480 source: impl IntoID<DirectoryId>,
3481 opts: ContainerWithDirectoryOpts<'a>,
3482 ) -> Container {
3483 let mut query = self.selection.select("withDirectory");
3484 query = query.arg("path", path.into());
3485 query = query.arg_lazy(
3486 "source",
3487 Box::new(move || {
3488 let source = source.clone();
3489 Box::pin(async move { source.into_id().await.unwrap().quote() })
3490 }),
3491 );
3492 if let Some(exclude) = opts.exclude {
3493 query = query.arg("exclude", exclude);
3494 }
3495 if let Some(include) = opts.include {
3496 query = query.arg("include", include);
3497 }
3498 if let Some(gitignore) = opts.gitignore {
3499 query = query.arg("gitignore", gitignore);
3500 }
3501 if let Some(owner) = opts.owner {
3502 query = query.arg("owner", owner);
3503 }
3504 if let Some(expand) = opts.expand {
3505 query = query.arg("expand", expand);
3506 }
3507 Container {
3508 proc: self.proc.clone(),
3509 selection: query,
3510 graphql_client: self.graphql_client.clone(),
3511 }
3512 }
3513 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3520 let mut query = self.selection.select("withEntrypoint");
3521 query = query.arg(
3522 "args",
3523 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3524 );
3525 Container {
3526 proc: self.proc.clone(),
3527 selection: query,
3528 graphql_client: self.graphql_client.clone(),
3529 }
3530 }
3531 pub fn with_entrypoint_opts(
3538 &self,
3539 args: Vec<impl Into<String>>,
3540 opts: ContainerWithEntrypointOpts,
3541 ) -> Container {
3542 let mut query = self.selection.select("withEntrypoint");
3543 query = query.arg(
3544 "args",
3545 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3546 );
3547 if let Some(keep_default_args) = opts.keep_default_args {
3548 query = query.arg("keepDefaultArgs", keep_default_args);
3549 }
3550 Container {
3551 proc: self.proc.clone(),
3552 selection: query,
3553 graphql_client: self.graphql_client.clone(),
3554 }
3555 }
3556 pub fn with_env_variable(
3564 &self,
3565 name: impl Into<String>,
3566 value: impl Into<String>,
3567 ) -> Container {
3568 let mut query = self.selection.select("withEnvVariable");
3569 query = query.arg("name", name.into());
3570 query = query.arg("value", value.into());
3571 Container {
3572 proc: self.proc.clone(),
3573 selection: query,
3574 graphql_client: self.graphql_client.clone(),
3575 }
3576 }
3577 pub fn with_env_variable_opts(
3585 &self,
3586 name: impl Into<String>,
3587 value: impl Into<String>,
3588 opts: ContainerWithEnvVariableOpts,
3589 ) -> Container {
3590 let mut query = self.selection.select("withEnvVariable");
3591 query = query.arg("name", name.into());
3592 query = query.arg("value", value.into());
3593 if let Some(expand) = opts.expand {
3594 query = query.arg("expand", expand);
3595 }
3596 Container {
3597 proc: self.proc.clone(),
3598 selection: query,
3599 graphql_client: self.graphql_client.clone(),
3600 }
3601 }
3602 pub fn with_error(&self, err: impl Into<String>) -> Container {
3608 let mut query = self.selection.select("withError");
3609 query = query.arg("err", err.into());
3610 Container {
3611 proc: self.proc.clone(),
3612 selection: query,
3613 graphql_client: self.graphql_client.clone(),
3614 }
3615 }
3616 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3627 let mut query = self.selection.select("withExec");
3628 query = query.arg(
3629 "args",
3630 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3631 );
3632 Container {
3633 proc: self.proc.clone(),
3634 selection: query,
3635 graphql_client: self.graphql_client.clone(),
3636 }
3637 }
3638 pub fn with_exec_opts<'a>(
3649 &self,
3650 args: Vec<impl Into<String>>,
3651 opts: ContainerWithExecOpts<'a>,
3652 ) -> Container {
3653 let mut query = self.selection.select("withExec");
3654 query = query.arg(
3655 "args",
3656 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3657 );
3658 if let Some(use_entrypoint) = opts.use_entrypoint {
3659 query = query.arg("useEntrypoint", use_entrypoint);
3660 }
3661 if let Some(stdin) = opts.stdin {
3662 query = query.arg("stdin", stdin);
3663 }
3664 if let Some(redirect_stdin) = opts.redirect_stdin {
3665 query = query.arg("redirectStdin", redirect_stdin);
3666 }
3667 if let Some(redirect_stdout) = opts.redirect_stdout {
3668 query = query.arg("redirectStdout", redirect_stdout);
3669 }
3670 if let Some(redirect_stderr) = opts.redirect_stderr {
3671 query = query.arg("redirectStderr", redirect_stderr);
3672 }
3673 if let Some(expect) = opts.expect {
3674 query = query.arg("expect", expect);
3675 }
3676 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3677 query = query.arg(
3678 "experimentalPrivilegedNesting",
3679 experimental_privileged_nesting,
3680 );
3681 }
3682 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3683 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3684 }
3685 if let Some(expand) = opts.expand {
3686 query = query.arg("expand", expand);
3687 }
3688 if let Some(no_init) = opts.no_init {
3689 query = query.arg("noInit", no_init);
3690 }
3691 Container {
3692 proc: self.proc.clone(),
3693 selection: query,
3694 graphql_client: self.graphql_client.clone(),
3695 }
3696 }
3697 pub fn with_exposed_port(&self, port: isize) -> Container {
3707 let mut query = self.selection.select("withExposedPort");
3708 query = query.arg("port", port);
3709 Container {
3710 proc: self.proc.clone(),
3711 selection: query,
3712 graphql_client: self.graphql_client.clone(),
3713 }
3714 }
3715 pub fn with_exposed_port_opts<'a>(
3725 &self,
3726 port: isize,
3727 opts: ContainerWithExposedPortOpts<'a>,
3728 ) -> Container {
3729 let mut query = self.selection.select("withExposedPort");
3730 query = query.arg("port", port);
3731 if let Some(protocol) = opts.protocol {
3732 query = query.arg("protocol", protocol);
3733 }
3734 if let Some(description) = opts.description {
3735 query = query.arg("description", description);
3736 }
3737 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3738 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3739 }
3740 Container {
3741 proc: self.proc.clone(),
3742 selection: query,
3743 graphql_client: self.graphql_client.clone(),
3744 }
3745 }
3746 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3754 let mut query = self.selection.select("withFile");
3755 query = query.arg("path", path.into());
3756 query = query.arg_lazy(
3757 "source",
3758 Box::new(move || {
3759 let source = source.clone();
3760 Box::pin(async move { source.into_id().await.unwrap().quote() })
3761 }),
3762 );
3763 Container {
3764 proc: self.proc.clone(),
3765 selection: query,
3766 graphql_client: self.graphql_client.clone(),
3767 }
3768 }
3769 pub fn with_file_opts<'a>(
3777 &self,
3778 path: impl Into<String>,
3779 source: impl IntoID<FileId>,
3780 opts: ContainerWithFileOpts<'a>,
3781 ) -> Container {
3782 let mut query = self.selection.select("withFile");
3783 query = query.arg("path", path.into());
3784 query = query.arg_lazy(
3785 "source",
3786 Box::new(move || {
3787 let source = source.clone();
3788 Box::pin(async move { source.into_id().await.unwrap().quote() })
3789 }),
3790 );
3791 if let Some(permissions) = opts.permissions {
3792 query = query.arg("permissions", permissions);
3793 }
3794 if let Some(owner) = opts.owner {
3795 query = query.arg("owner", owner);
3796 }
3797 if let Some(expand) = opts.expand {
3798 query = query.arg("expand", expand);
3799 }
3800 Container {
3801 proc: self.proc.clone(),
3802 selection: query,
3803 graphql_client: self.graphql_client.clone(),
3804 }
3805 }
3806 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3814 let mut query = self.selection.select("withFiles");
3815 query = query.arg("path", path.into());
3816 query = query.arg("sources", sources);
3817 Container {
3818 proc: self.proc.clone(),
3819 selection: query,
3820 graphql_client: self.graphql_client.clone(),
3821 }
3822 }
3823 pub fn with_files_opts<'a>(
3831 &self,
3832 path: impl Into<String>,
3833 sources: Vec<FileId>,
3834 opts: ContainerWithFilesOpts<'a>,
3835 ) -> Container {
3836 let mut query = self.selection.select("withFiles");
3837 query = query.arg("path", path.into());
3838 query = query.arg("sources", sources);
3839 if let Some(permissions) = opts.permissions {
3840 query = query.arg("permissions", permissions);
3841 }
3842 if let Some(owner) = opts.owner {
3843 query = query.arg("owner", owner);
3844 }
3845 if let Some(expand) = opts.expand {
3846 query = query.arg("expand", expand);
3847 }
3848 Container {
3849 proc: self.proc.clone(),
3850 selection: query,
3851 graphql_client: self.graphql_client.clone(),
3852 }
3853 }
3854 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3861 let mut query = self.selection.select("withLabel");
3862 query = query.arg("name", name.into());
3863 query = query.arg("value", value.into());
3864 Container {
3865 proc: self.proc.clone(),
3866 selection: query,
3867 graphql_client: self.graphql_client.clone(),
3868 }
3869 }
3870 pub fn with_mounted_cache(
3878 &self,
3879 path: impl Into<String>,
3880 cache: impl IntoID<CacheVolumeId>,
3881 ) -> Container {
3882 let mut query = self.selection.select("withMountedCache");
3883 query = query.arg("path", path.into());
3884 query = query.arg_lazy(
3885 "cache",
3886 Box::new(move || {
3887 let cache = cache.clone();
3888 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3889 }),
3890 );
3891 Container {
3892 proc: self.proc.clone(),
3893 selection: query,
3894 graphql_client: self.graphql_client.clone(),
3895 }
3896 }
3897 pub fn with_mounted_cache_opts<'a>(
3905 &self,
3906 path: impl Into<String>,
3907 cache: impl IntoID<CacheVolumeId>,
3908 opts: ContainerWithMountedCacheOpts<'a>,
3909 ) -> Container {
3910 let mut query = self.selection.select("withMountedCache");
3911 query = query.arg("path", path.into());
3912 query = query.arg_lazy(
3913 "cache",
3914 Box::new(move || {
3915 let cache = cache.clone();
3916 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3917 }),
3918 );
3919 if let Some(source) = opts.source {
3920 query = query.arg("source", source);
3921 }
3922 if let Some(sharing) = opts.sharing {
3923 query = query.arg("sharing", sharing);
3924 }
3925 if let Some(owner) = opts.owner {
3926 query = query.arg("owner", owner);
3927 }
3928 if let Some(expand) = opts.expand {
3929 query = query.arg("expand", expand);
3930 }
3931 Container {
3932 proc: self.proc.clone(),
3933 selection: query,
3934 graphql_client: self.graphql_client.clone(),
3935 }
3936 }
3937 pub fn with_mounted_directory(
3945 &self,
3946 path: impl Into<String>,
3947 source: impl IntoID<DirectoryId>,
3948 ) -> Container {
3949 let mut query = self.selection.select("withMountedDirectory");
3950 query = query.arg("path", path.into());
3951 query = query.arg_lazy(
3952 "source",
3953 Box::new(move || {
3954 let source = source.clone();
3955 Box::pin(async move { source.into_id().await.unwrap().quote() })
3956 }),
3957 );
3958 Container {
3959 proc: self.proc.clone(),
3960 selection: query,
3961 graphql_client: self.graphql_client.clone(),
3962 }
3963 }
3964 pub fn with_mounted_directory_opts<'a>(
3972 &self,
3973 path: impl Into<String>,
3974 source: impl IntoID<DirectoryId>,
3975 opts: ContainerWithMountedDirectoryOpts<'a>,
3976 ) -> Container {
3977 let mut query = self.selection.select("withMountedDirectory");
3978 query = query.arg("path", path.into());
3979 query = query.arg_lazy(
3980 "source",
3981 Box::new(move || {
3982 let source = source.clone();
3983 Box::pin(async move { source.into_id().await.unwrap().quote() })
3984 }),
3985 );
3986 if let Some(owner) = opts.owner {
3987 query = query.arg("owner", owner);
3988 }
3989 if let Some(expand) = opts.expand {
3990 query = query.arg("expand", expand);
3991 }
3992 Container {
3993 proc: self.proc.clone(),
3994 selection: query,
3995 graphql_client: self.graphql_client.clone(),
3996 }
3997 }
3998 pub fn with_mounted_file(
4006 &self,
4007 path: impl Into<String>,
4008 source: impl IntoID<FileId>,
4009 ) -> Container {
4010 let mut query = self.selection.select("withMountedFile");
4011 query = query.arg("path", path.into());
4012 query = query.arg_lazy(
4013 "source",
4014 Box::new(move || {
4015 let source = source.clone();
4016 Box::pin(async move { source.into_id().await.unwrap().quote() })
4017 }),
4018 );
4019 Container {
4020 proc: self.proc.clone(),
4021 selection: query,
4022 graphql_client: self.graphql_client.clone(),
4023 }
4024 }
4025 pub fn with_mounted_file_opts<'a>(
4033 &self,
4034 path: impl Into<String>,
4035 source: impl IntoID<FileId>,
4036 opts: ContainerWithMountedFileOpts<'a>,
4037 ) -> Container {
4038 let mut query = self.selection.select("withMountedFile");
4039 query = query.arg("path", path.into());
4040 query = query.arg_lazy(
4041 "source",
4042 Box::new(move || {
4043 let source = source.clone();
4044 Box::pin(async move { source.into_id().await.unwrap().quote() })
4045 }),
4046 );
4047 if let Some(owner) = opts.owner {
4048 query = query.arg("owner", owner);
4049 }
4050 if let Some(expand) = opts.expand {
4051 query = query.arg("expand", expand);
4052 }
4053 Container {
4054 proc: self.proc.clone(),
4055 selection: query,
4056 graphql_client: self.graphql_client.clone(),
4057 }
4058 }
4059 pub fn with_mounted_secret(
4067 &self,
4068 path: impl Into<String>,
4069 source: impl IntoID<SecretId>,
4070 ) -> Container {
4071 let mut query = self.selection.select("withMountedSecret");
4072 query = query.arg("path", path.into());
4073 query = query.arg_lazy(
4074 "source",
4075 Box::new(move || {
4076 let source = source.clone();
4077 Box::pin(async move { source.into_id().await.unwrap().quote() })
4078 }),
4079 );
4080 Container {
4081 proc: self.proc.clone(),
4082 selection: query,
4083 graphql_client: self.graphql_client.clone(),
4084 }
4085 }
4086 pub fn with_mounted_secret_opts<'a>(
4094 &self,
4095 path: impl Into<String>,
4096 source: impl IntoID<SecretId>,
4097 opts: ContainerWithMountedSecretOpts<'a>,
4098 ) -> Container {
4099 let mut query = self.selection.select("withMountedSecret");
4100 query = query.arg("path", path.into());
4101 query = query.arg_lazy(
4102 "source",
4103 Box::new(move || {
4104 let source = source.clone();
4105 Box::pin(async move { source.into_id().await.unwrap().quote() })
4106 }),
4107 );
4108 if let Some(owner) = opts.owner {
4109 query = query.arg("owner", owner);
4110 }
4111 if let Some(mode) = opts.mode {
4112 query = query.arg("mode", mode);
4113 }
4114 if let Some(expand) = opts.expand {
4115 query = query.arg("expand", expand);
4116 }
4117 Container {
4118 proc: self.proc.clone(),
4119 selection: query,
4120 graphql_client: self.graphql_client.clone(),
4121 }
4122 }
4123 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4130 let mut query = self.selection.select("withMountedTemp");
4131 query = query.arg("path", path.into());
4132 Container {
4133 proc: self.proc.clone(),
4134 selection: query,
4135 graphql_client: self.graphql_client.clone(),
4136 }
4137 }
4138 pub fn with_mounted_temp_opts(
4145 &self,
4146 path: impl Into<String>,
4147 opts: ContainerWithMountedTempOpts,
4148 ) -> Container {
4149 let mut query = self.selection.select("withMountedTemp");
4150 query = query.arg("path", path.into());
4151 if let Some(size) = opts.size {
4152 query = query.arg("size", size);
4153 }
4154 if let Some(expand) = opts.expand {
4155 query = query.arg("expand", expand);
4156 }
4157 Container {
4158 proc: self.proc.clone(),
4159 selection: query,
4160 graphql_client: self.graphql_client.clone(),
4161 }
4162 }
4163 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4171 let mut query = self.selection.select("withNewFile");
4172 query = query.arg("path", path.into());
4173 query = query.arg("contents", contents.into());
4174 Container {
4175 proc: self.proc.clone(),
4176 selection: query,
4177 graphql_client: self.graphql_client.clone(),
4178 }
4179 }
4180 pub fn with_new_file_opts<'a>(
4188 &self,
4189 path: impl Into<String>,
4190 contents: impl Into<String>,
4191 opts: ContainerWithNewFileOpts<'a>,
4192 ) -> Container {
4193 let mut query = self.selection.select("withNewFile");
4194 query = query.arg("path", path.into());
4195 query = query.arg("contents", contents.into());
4196 if let Some(permissions) = opts.permissions {
4197 query = query.arg("permissions", permissions);
4198 }
4199 if let Some(owner) = opts.owner {
4200 query = query.arg("owner", owner);
4201 }
4202 if let Some(expand) = opts.expand {
4203 query = query.arg("expand", expand);
4204 }
4205 Container {
4206 proc: self.proc.clone(),
4207 selection: query,
4208 graphql_client: self.graphql_client.clone(),
4209 }
4210 }
4211 pub fn with_registry_auth(
4219 &self,
4220 address: impl Into<String>,
4221 username: impl Into<String>,
4222 secret: impl IntoID<SecretId>,
4223 ) -> Container {
4224 let mut query = self.selection.select("withRegistryAuth");
4225 query = query.arg("address", address.into());
4226 query = query.arg("username", username.into());
4227 query = query.arg_lazy(
4228 "secret",
4229 Box::new(move || {
4230 let secret = secret.clone();
4231 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4232 }),
4233 );
4234 Container {
4235 proc: self.proc.clone(),
4236 selection: query,
4237 graphql_client: self.graphql_client.clone(),
4238 }
4239 }
4240 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4246 let mut query = self.selection.select("withRootfs");
4247 query = query.arg_lazy(
4248 "directory",
4249 Box::new(move || {
4250 let directory = directory.clone();
4251 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4252 }),
4253 );
4254 Container {
4255 proc: self.proc.clone(),
4256 selection: query,
4257 graphql_client: self.graphql_client.clone(),
4258 }
4259 }
4260 pub fn with_secret_variable(
4267 &self,
4268 name: impl Into<String>,
4269 secret: impl IntoID<SecretId>,
4270 ) -> Container {
4271 let mut query = self.selection.select("withSecretVariable");
4272 query = query.arg("name", name.into());
4273 query = query.arg_lazy(
4274 "secret",
4275 Box::new(move || {
4276 let secret = secret.clone();
4277 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4278 }),
4279 );
4280 Container {
4281 proc: self.proc.clone(),
4282 selection: query,
4283 graphql_client: self.graphql_client.clone(),
4284 }
4285 }
4286 pub fn with_service_binding(
4296 &self,
4297 alias: impl Into<String>,
4298 service: impl IntoID<ServiceId>,
4299 ) -> Container {
4300 let mut query = self.selection.select("withServiceBinding");
4301 query = query.arg("alias", alias.into());
4302 query = query.arg_lazy(
4303 "service",
4304 Box::new(move || {
4305 let service = service.clone();
4306 Box::pin(async move { service.into_id().await.unwrap().quote() })
4307 }),
4308 );
4309 Container {
4310 proc: self.proc.clone(),
4311 selection: query,
4312 graphql_client: self.graphql_client.clone(),
4313 }
4314 }
4315 pub fn with_symlink(
4323 &self,
4324 target: impl Into<String>,
4325 link_name: impl Into<String>,
4326 ) -> Container {
4327 let mut query = self.selection.select("withSymlink");
4328 query = query.arg("target", target.into());
4329 query = query.arg("linkName", link_name.into());
4330 Container {
4331 proc: self.proc.clone(),
4332 selection: query,
4333 graphql_client: self.graphql_client.clone(),
4334 }
4335 }
4336 pub fn with_symlink_opts(
4344 &self,
4345 target: impl Into<String>,
4346 link_name: impl Into<String>,
4347 opts: ContainerWithSymlinkOpts,
4348 ) -> Container {
4349 let mut query = self.selection.select("withSymlink");
4350 query = query.arg("target", target.into());
4351 query = query.arg("linkName", link_name.into());
4352 if let Some(expand) = opts.expand {
4353 query = query.arg("expand", expand);
4354 }
4355 Container {
4356 proc: self.proc.clone(),
4357 selection: query,
4358 graphql_client: self.graphql_client.clone(),
4359 }
4360 }
4361 pub fn with_unix_socket(
4369 &self,
4370 path: impl Into<String>,
4371 source: impl IntoID<SocketId>,
4372 ) -> Container {
4373 let mut query = self.selection.select("withUnixSocket");
4374 query = query.arg("path", path.into());
4375 query = query.arg_lazy(
4376 "source",
4377 Box::new(move || {
4378 let source = source.clone();
4379 Box::pin(async move { source.into_id().await.unwrap().quote() })
4380 }),
4381 );
4382 Container {
4383 proc: self.proc.clone(),
4384 selection: query,
4385 graphql_client: self.graphql_client.clone(),
4386 }
4387 }
4388 pub fn with_unix_socket_opts<'a>(
4396 &self,
4397 path: impl Into<String>,
4398 source: impl IntoID<SocketId>,
4399 opts: ContainerWithUnixSocketOpts<'a>,
4400 ) -> Container {
4401 let mut query = self.selection.select("withUnixSocket");
4402 query = query.arg("path", path.into());
4403 query = query.arg_lazy(
4404 "source",
4405 Box::new(move || {
4406 let source = source.clone();
4407 Box::pin(async move { source.into_id().await.unwrap().quote() })
4408 }),
4409 );
4410 if let Some(owner) = opts.owner {
4411 query = query.arg("owner", owner);
4412 }
4413 if let Some(expand) = opts.expand {
4414 query = query.arg("expand", expand);
4415 }
4416 Container {
4417 proc: self.proc.clone(),
4418 selection: query,
4419 graphql_client: self.graphql_client.clone(),
4420 }
4421 }
4422 pub fn with_user(&self, name: impl Into<String>) -> Container {
4428 let mut query = self.selection.select("withUser");
4429 query = query.arg("name", name.into());
4430 Container {
4431 proc: self.proc.clone(),
4432 selection: query,
4433 graphql_client: self.graphql_client.clone(),
4434 }
4435 }
4436 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4443 let mut query = self.selection.select("withWorkdir");
4444 query = query.arg("path", path.into());
4445 Container {
4446 proc: self.proc.clone(),
4447 selection: query,
4448 graphql_client: self.graphql_client.clone(),
4449 }
4450 }
4451 pub fn with_workdir_opts(
4458 &self,
4459 path: impl Into<String>,
4460 opts: ContainerWithWorkdirOpts,
4461 ) -> Container {
4462 let mut query = self.selection.select("withWorkdir");
4463 query = query.arg("path", path.into());
4464 if let Some(expand) = opts.expand {
4465 query = query.arg("expand", expand);
4466 }
4467 Container {
4468 proc: self.proc.clone(),
4469 selection: query,
4470 graphql_client: self.graphql_client.clone(),
4471 }
4472 }
4473 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4479 let mut query = self.selection.select("withoutAnnotation");
4480 query = query.arg("name", name.into());
4481 Container {
4482 proc: self.proc.clone(),
4483 selection: query,
4484 graphql_client: self.graphql_client.clone(),
4485 }
4486 }
4487 pub fn without_default_args(&self) -> Container {
4489 let query = self.selection.select("withoutDefaultArgs");
4490 Container {
4491 proc: self.proc.clone(),
4492 selection: query,
4493 graphql_client: self.graphql_client.clone(),
4494 }
4495 }
4496 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4503 let mut query = self.selection.select("withoutDirectory");
4504 query = query.arg("path", path.into());
4505 Container {
4506 proc: self.proc.clone(),
4507 selection: query,
4508 graphql_client: self.graphql_client.clone(),
4509 }
4510 }
4511 pub fn without_directory_opts(
4518 &self,
4519 path: impl Into<String>,
4520 opts: ContainerWithoutDirectoryOpts,
4521 ) -> Container {
4522 let mut query = self.selection.select("withoutDirectory");
4523 query = query.arg("path", path.into());
4524 if let Some(expand) = opts.expand {
4525 query = query.arg("expand", expand);
4526 }
4527 Container {
4528 proc: self.proc.clone(),
4529 selection: query,
4530 graphql_client: self.graphql_client.clone(),
4531 }
4532 }
4533 pub fn without_entrypoint(&self) -> Container {
4539 let query = self.selection.select("withoutEntrypoint");
4540 Container {
4541 proc: self.proc.clone(),
4542 selection: query,
4543 graphql_client: self.graphql_client.clone(),
4544 }
4545 }
4546 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4552 let mut query = self.selection.select("withoutEntrypoint");
4553 if let Some(keep_default_args) = opts.keep_default_args {
4554 query = query.arg("keepDefaultArgs", keep_default_args);
4555 }
4556 Container {
4557 proc: self.proc.clone(),
4558 selection: query,
4559 graphql_client: self.graphql_client.clone(),
4560 }
4561 }
4562 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4568 let mut query = self.selection.select("withoutEnvVariable");
4569 query = query.arg("name", name.into());
4570 Container {
4571 proc: self.proc.clone(),
4572 selection: query,
4573 graphql_client: self.graphql_client.clone(),
4574 }
4575 }
4576 pub fn without_exposed_port(&self, port: isize) -> Container {
4583 let mut query = self.selection.select("withoutExposedPort");
4584 query = query.arg("port", port);
4585 Container {
4586 proc: self.proc.clone(),
4587 selection: query,
4588 graphql_client: self.graphql_client.clone(),
4589 }
4590 }
4591 pub fn without_exposed_port_opts(
4598 &self,
4599 port: isize,
4600 opts: ContainerWithoutExposedPortOpts,
4601 ) -> Container {
4602 let mut query = self.selection.select("withoutExposedPort");
4603 query = query.arg("port", port);
4604 if let Some(protocol) = opts.protocol {
4605 query = query.arg("protocol", protocol);
4606 }
4607 Container {
4608 proc: self.proc.clone(),
4609 selection: query,
4610 graphql_client: self.graphql_client.clone(),
4611 }
4612 }
4613 pub fn without_file(&self, path: impl Into<String>) -> Container {
4620 let mut query = self.selection.select("withoutFile");
4621 query = query.arg("path", path.into());
4622 Container {
4623 proc: self.proc.clone(),
4624 selection: query,
4625 graphql_client: self.graphql_client.clone(),
4626 }
4627 }
4628 pub fn without_file_opts(
4635 &self,
4636 path: impl Into<String>,
4637 opts: ContainerWithoutFileOpts,
4638 ) -> Container {
4639 let mut query = self.selection.select("withoutFile");
4640 query = query.arg("path", path.into());
4641 if let Some(expand) = opts.expand {
4642 query = query.arg("expand", expand);
4643 }
4644 Container {
4645 proc: self.proc.clone(),
4646 selection: query,
4647 graphql_client: self.graphql_client.clone(),
4648 }
4649 }
4650 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4657 let mut query = self.selection.select("withoutFiles");
4658 query = query.arg(
4659 "paths",
4660 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4661 );
4662 Container {
4663 proc: self.proc.clone(),
4664 selection: query,
4665 graphql_client: self.graphql_client.clone(),
4666 }
4667 }
4668 pub fn without_files_opts(
4675 &self,
4676 paths: Vec<impl Into<String>>,
4677 opts: ContainerWithoutFilesOpts,
4678 ) -> Container {
4679 let mut query = self.selection.select("withoutFiles");
4680 query = query.arg(
4681 "paths",
4682 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4683 );
4684 if let Some(expand) = opts.expand {
4685 query = query.arg("expand", expand);
4686 }
4687 Container {
4688 proc: self.proc.clone(),
4689 selection: query,
4690 graphql_client: self.graphql_client.clone(),
4691 }
4692 }
4693 pub fn without_label(&self, name: impl Into<String>) -> Container {
4699 let mut query = self.selection.select("withoutLabel");
4700 query = query.arg("name", name.into());
4701 Container {
4702 proc: self.proc.clone(),
4703 selection: query,
4704 graphql_client: self.graphql_client.clone(),
4705 }
4706 }
4707 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4714 let mut query = self.selection.select("withoutMount");
4715 query = query.arg("path", path.into());
4716 Container {
4717 proc: self.proc.clone(),
4718 selection: query,
4719 graphql_client: self.graphql_client.clone(),
4720 }
4721 }
4722 pub fn without_mount_opts(
4729 &self,
4730 path: impl Into<String>,
4731 opts: ContainerWithoutMountOpts,
4732 ) -> Container {
4733 let mut query = self.selection.select("withoutMount");
4734 query = query.arg("path", path.into());
4735 if let Some(expand) = opts.expand {
4736 query = query.arg("expand", expand);
4737 }
4738 Container {
4739 proc: self.proc.clone(),
4740 selection: query,
4741 graphql_client: self.graphql_client.clone(),
4742 }
4743 }
4744 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4752 let mut query = self.selection.select("withoutRegistryAuth");
4753 query = query.arg("address", address.into());
4754 Container {
4755 proc: self.proc.clone(),
4756 selection: query,
4757 graphql_client: self.graphql_client.clone(),
4758 }
4759 }
4760 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4766 let mut query = self.selection.select("withoutSecretVariable");
4767 query = query.arg("name", name.into());
4768 Container {
4769 proc: self.proc.clone(),
4770 selection: query,
4771 graphql_client: self.graphql_client.clone(),
4772 }
4773 }
4774 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4781 let mut query = self.selection.select("withoutUnixSocket");
4782 query = query.arg("path", path.into());
4783 Container {
4784 proc: self.proc.clone(),
4785 selection: query,
4786 graphql_client: self.graphql_client.clone(),
4787 }
4788 }
4789 pub fn without_unix_socket_opts(
4796 &self,
4797 path: impl Into<String>,
4798 opts: ContainerWithoutUnixSocketOpts,
4799 ) -> Container {
4800 let mut query = self.selection.select("withoutUnixSocket");
4801 query = query.arg("path", path.into());
4802 if let Some(expand) = opts.expand {
4803 query = query.arg("expand", expand);
4804 }
4805 Container {
4806 proc: self.proc.clone(),
4807 selection: query,
4808 graphql_client: self.graphql_client.clone(),
4809 }
4810 }
4811 pub fn without_user(&self) -> Container {
4814 let query = self.selection.select("withoutUser");
4815 Container {
4816 proc: self.proc.clone(),
4817 selection: query,
4818 graphql_client: self.graphql_client.clone(),
4819 }
4820 }
4821 pub fn without_workdir(&self) -> Container {
4824 let query = self.selection.select("withoutWorkdir");
4825 Container {
4826 proc: self.proc.clone(),
4827 selection: query,
4828 graphql_client: self.graphql_client.clone(),
4829 }
4830 }
4831 pub async fn workdir(&self) -> Result<String, DaggerError> {
4833 let query = self.selection.select("workdir");
4834 query.execute(self.graphql_client.clone()).await
4835 }
4836}
4837#[derive(Clone)]
4838pub struct CurrentModule {
4839 pub proc: Option<Arc<DaggerSessionProc>>,
4840 pub selection: Selection,
4841 pub graphql_client: DynGraphQLClient,
4842}
4843#[derive(Builder, Debug, PartialEq)]
4844pub struct CurrentModuleWorkdirOpts<'a> {
4845 #[builder(setter(into, strip_option), default)]
4847 pub exclude: Option<Vec<&'a str>>,
4848 #[builder(setter(into, strip_option), default)]
4850 pub gitignore: Option<bool>,
4851 #[builder(setter(into, strip_option), default)]
4853 pub include: Option<Vec<&'a str>>,
4854}
4855impl CurrentModule {
4856 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4858 let query = self.selection.select("id");
4859 query.execute(self.graphql_client.clone()).await
4860 }
4861 pub async fn name(&self) -> Result<String, DaggerError> {
4863 let query = self.selection.select("name");
4864 query.execute(self.graphql_client.clone()).await
4865 }
4866 pub fn source(&self) -> Directory {
4868 let query = self.selection.select("source");
4869 Directory {
4870 proc: self.proc.clone(),
4871 selection: query,
4872 graphql_client: self.graphql_client.clone(),
4873 }
4874 }
4875 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4882 let mut query = self.selection.select("workdir");
4883 query = query.arg("path", path.into());
4884 Directory {
4885 proc: self.proc.clone(),
4886 selection: query,
4887 graphql_client: self.graphql_client.clone(),
4888 }
4889 }
4890 pub fn workdir_opts<'a>(
4897 &self,
4898 path: impl Into<String>,
4899 opts: CurrentModuleWorkdirOpts<'a>,
4900 ) -> Directory {
4901 let mut query = self.selection.select("workdir");
4902 query = query.arg("path", path.into());
4903 if let Some(exclude) = opts.exclude {
4904 query = query.arg("exclude", exclude);
4905 }
4906 if let Some(include) = opts.include {
4907 query = query.arg("include", include);
4908 }
4909 if let Some(gitignore) = opts.gitignore {
4910 query = query.arg("gitignore", gitignore);
4911 }
4912 Directory {
4913 proc: self.proc.clone(),
4914 selection: query,
4915 graphql_client: self.graphql_client.clone(),
4916 }
4917 }
4918 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4924 let mut query = self.selection.select("workdirFile");
4925 query = query.arg("path", path.into());
4926 File {
4927 proc: self.proc.clone(),
4928 selection: query,
4929 graphql_client: self.graphql_client.clone(),
4930 }
4931 }
4932}
4933#[derive(Clone)]
4934pub struct Directory {
4935 pub proc: Option<Arc<DaggerSessionProc>>,
4936 pub selection: Selection,
4937 pub graphql_client: DynGraphQLClient,
4938}
4939#[derive(Builder, Debug, PartialEq)]
4940pub struct DirectoryAsModuleOpts<'a> {
4941 #[builder(setter(into, strip_option), default)]
4944 pub source_root_path: Option<&'a str>,
4945}
4946#[derive(Builder, Debug, PartialEq)]
4947pub struct DirectoryAsModuleSourceOpts<'a> {
4948 #[builder(setter(into, strip_option), default)]
4951 pub source_root_path: Option<&'a str>,
4952}
4953#[derive(Builder, Debug, PartialEq)]
4954pub struct DirectoryDockerBuildOpts<'a> {
4955 #[builder(setter(into, strip_option), default)]
4957 pub build_args: Option<Vec<BuildArg>>,
4958 #[builder(setter(into, strip_option), default)]
4960 pub dockerfile: Option<&'a str>,
4961 #[builder(setter(into, strip_option), default)]
4964 pub no_init: Option<bool>,
4965 #[builder(setter(into, strip_option), default)]
4967 pub platform: Option<Platform>,
4968 #[builder(setter(into, strip_option), default)]
4971 pub secrets: Option<Vec<SecretId>>,
4972 #[builder(setter(into, strip_option), default)]
4974 pub target: Option<&'a str>,
4975}
4976#[derive(Builder, Debug, PartialEq)]
4977pub struct DirectoryEntriesOpts<'a> {
4978 #[builder(setter(into, strip_option), default)]
4980 pub path: Option<&'a str>,
4981}
4982#[derive(Builder, Debug, PartialEq)]
4983pub struct DirectoryExistsOpts {
4984 #[builder(setter(into, strip_option), default)]
4986 pub do_not_follow_symlinks: Option<bool>,
4987 #[builder(setter(into, strip_option), default)]
4989 pub expected_type: Option<ExistsType>,
4990}
4991#[derive(Builder, Debug, PartialEq)]
4992pub struct DirectoryExportOpts {
4993 #[builder(setter(into, strip_option), default)]
4995 pub wipe: Option<bool>,
4996}
4997#[derive(Builder, Debug, PartialEq)]
4998pub struct DirectoryFilterOpts<'a> {
4999 #[builder(setter(into, strip_option), default)]
5001 pub exclude: Option<Vec<&'a str>>,
5002 #[builder(setter(into, strip_option), default)]
5004 pub gitignore: Option<bool>,
5005 #[builder(setter(into, strip_option), default)]
5007 pub include: Option<Vec<&'a str>>,
5008}
5009#[derive(Builder, Debug, PartialEq)]
5010pub struct DirectorySearchOpts<'a> {
5011 #[builder(setter(into, strip_option), default)]
5013 pub dotall: Option<bool>,
5014 #[builder(setter(into, strip_option), default)]
5016 pub files_only: Option<bool>,
5017 #[builder(setter(into, strip_option), default)]
5019 pub globs: Option<Vec<&'a str>>,
5020 #[builder(setter(into, strip_option), default)]
5022 pub insensitive: Option<bool>,
5023 #[builder(setter(into, strip_option), default)]
5025 pub limit: Option<isize>,
5026 #[builder(setter(into, strip_option), default)]
5028 pub literal: Option<bool>,
5029 #[builder(setter(into, strip_option), default)]
5031 pub multiline: Option<bool>,
5032 #[builder(setter(into, strip_option), default)]
5034 pub paths: Option<Vec<&'a str>>,
5035 #[builder(setter(into, strip_option), default)]
5037 pub skip_hidden: Option<bool>,
5038 #[builder(setter(into, strip_option), default)]
5040 pub skip_ignored: Option<bool>,
5041}
5042#[derive(Builder, Debug, PartialEq)]
5043pub struct DirectoryTerminalOpts<'a> {
5044 #[builder(setter(into, strip_option), default)]
5046 pub cmd: Option<Vec<&'a str>>,
5047 #[builder(setter(into, strip_option), default)]
5049 pub container: Option<ContainerId>,
5050 #[builder(setter(into, strip_option), default)]
5052 pub experimental_privileged_nesting: Option<bool>,
5053 #[builder(setter(into, strip_option), default)]
5055 pub insecure_root_capabilities: Option<bool>,
5056}
5057#[derive(Builder, Debug, PartialEq)]
5058pub struct DirectoryWithDirectoryOpts<'a> {
5059 #[builder(setter(into, strip_option), default)]
5061 pub exclude: Option<Vec<&'a str>>,
5062 #[builder(setter(into, strip_option), default)]
5064 pub gitignore: Option<bool>,
5065 #[builder(setter(into, strip_option), default)]
5067 pub include: Option<Vec<&'a str>>,
5068 #[builder(setter(into, strip_option), default)]
5072 pub owner: Option<&'a str>,
5073}
5074#[derive(Builder, Debug, PartialEq)]
5075pub struct DirectoryWithFileOpts<'a> {
5076 #[builder(setter(into, strip_option), default)]
5080 pub owner: Option<&'a str>,
5081 #[builder(setter(into, strip_option), default)]
5083 pub permissions: Option<isize>,
5084}
5085#[derive(Builder, Debug, PartialEq)]
5086pub struct DirectoryWithFilesOpts {
5087 #[builder(setter(into, strip_option), default)]
5089 pub permissions: Option<isize>,
5090}
5091#[derive(Builder, Debug, PartialEq)]
5092pub struct DirectoryWithNewDirectoryOpts {
5093 #[builder(setter(into, strip_option), default)]
5095 pub permissions: Option<isize>,
5096}
5097#[derive(Builder, Debug, PartialEq)]
5098pub struct DirectoryWithNewFileOpts {
5099 #[builder(setter(into, strip_option), default)]
5101 pub permissions: Option<isize>,
5102}
5103impl Directory {
5104 pub fn as_git(&self) -> GitRepository {
5106 let query = self.selection.select("asGit");
5107 GitRepository {
5108 proc: self.proc.clone(),
5109 selection: query,
5110 graphql_client: self.graphql_client.clone(),
5111 }
5112 }
5113 pub fn as_module(&self) -> Module {
5119 let query = self.selection.select("asModule");
5120 Module {
5121 proc: self.proc.clone(),
5122 selection: query,
5123 graphql_client: self.graphql_client.clone(),
5124 }
5125 }
5126 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5132 let mut query = self.selection.select("asModule");
5133 if let Some(source_root_path) = opts.source_root_path {
5134 query = query.arg("sourceRootPath", source_root_path);
5135 }
5136 Module {
5137 proc: self.proc.clone(),
5138 selection: query,
5139 graphql_client: self.graphql_client.clone(),
5140 }
5141 }
5142 pub fn as_module_source(&self) -> ModuleSource {
5148 let query = self.selection.select("asModuleSource");
5149 ModuleSource {
5150 proc: self.proc.clone(),
5151 selection: query,
5152 graphql_client: self.graphql_client.clone(),
5153 }
5154 }
5155 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5161 let mut query = self.selection.select("asModuleSource");
5162 if let Some(source_root_path) = opts.source_root_path {
5163 query = query.arg("sourceRootPath", source_root_path);
5164 }
5165 ModuleSource {
5166 proc: self.proc.clone(),
5167 selection: query,
5168 graphql_client: self.graphql_client.clone(),
5169 }
5170 }
5171 pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5178 let mut query = self.selection.select("changes");
5179 query = query.arg_lazy(
5180 "from",
5181 Box::new(move || {
5182 let from = from.clone();
5183 Box::pin(async move { from.into_id().await.unwrap().quote() })
5184 }),
5185 );
5186 Changeset {
5187 proc: self.proc.clone(),
5188 selection: query,
5189 graphql_client: self.graphql_client.clone(),
5190 }
5191 }
5192 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5203 let mut query = self.selection.select("chown");
5204 query = query.arg("path", path.into());
5205 query = query.arg("owner", owner.into());
5206 Directory {
5207 proc: self.proc.clone(),
5208 selection: query,
5209 graphql_client: self.graphql_client.clone(),
5210 }
5211 }
5212 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5218 let mut query = self.selection.select("diff");
5219 query = query.arg_lazy(
5220 "other",
5221 Box::new(move || {
5222 let other = other.clone();
5223 Box::pin(async move { other.into_id().await.unwrap().quote() })
5224 }),
5225 );
5226 Directory {
5227 proc: self.proc.clone(),
5228 selection: query,
5229 graphql_client: self.graphql_client.clone(),
5230 }
5231 }
5232 pub async fn digest(&self) -> Result<String, DaggerError> {
5234 let query = self.selection.select("digest");
5235 query.execute(self.graphql_client.clone()).await
5236 }
5237 pub fn directory(&self, path: impl Into<String>) -> Directory {
5243 let mut query = self.selection.select("directory");
5244 query = query.arg("path", path.into());
5245 Directory {
5246 proc: self.proc.clone(),
5247 selection: query,
5248 graphql_client: self.graphql_client.clone(),
5249 }
5250 }
5251 pub fn docker_build(&self) -> Container {
5257 let query = self.selection.select("dockerBuild");
5258 Container {
5259 proc: self.proc.clone(),
5260 selection: query,
5261 graphql_client: self.graphql_client.clone(),
5262 }
5263 }
5264 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5270 let mut query = self.selection.select("dockerBuild");
5271 if let Some(dockerfile) = opts.dockerfile {
5272 query = query.arg("dockerfile", dockerfile);
5273 }
5274 if let Some(platform) = opts.platform {
5275 query = query.arg("platform", platform);
5276 }
5277 if let Some(build_args) = opts.build_args {
5278 query = query.arg("buildArgs", build_args);
5279 }
5280 if let Some(target) = opts.target {
5281 query = query.arg("target", target);
5282 }
5283 if let Some(secrets) = opts.secrets {
5284 query = query.arg("secrets", secrets);
5285 }
5286 if let Some(no_init) = opts.no_init {
5287 query = query.arg("noInit", no_init);
5288 }
5289 Container {
5290 proc: self.proc.clone(),
5291 selection: query,
5292 graphql_client: self.graphql_client.clone(),
5293 }
5294 }
5295 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5301 let query = self.selection.select("entries");
5302 query.execute(self.graphql_client.clone()).await
5303 }
5304 pub async fn entries_opts<'a>(
5310 &self,
5311 opts: DirectoryEntriesOpts<'a>,
5312 ) -> Result<Vec<String>, DaggerError> {
5313 let mut query = self.selection.select("entries");
5314 if let Some(path) = opts.path {
5315 query = query.arg("path", path);
5316 }
5317 query.execute(self.graphql_client.clone()).await
5318 }
5319 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5326 let mut query = self.selection.select("exists");
5327 query = query.arg("path", path.into());
5328 query.execute(self.graphql_client.clone()).await
5329 }
5330 pub async fn exists_opts(
5337 &self,
5338 path: impl Into<String>,
5339 opts: DirectoryExistsOpts,
5340 ) -> Result<bool, DaggerError> {
5341 let mut query = self.selection.select("exists");
5342 query = query.arg("path", path.into());
5343 if let Some(expected_type) = opts.expected_type {
5344 query = query.arg("expectedType", expected_type);
5345 }
5346 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5347 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5348 }
5349 query.execute(self.graphql_client.clone()).await
5350 }
5351 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5358 let mut query = self.selection.select("export");
5359 query = query.arg("path", path.into());
5360 query.execute(self.graphql_client.clone()).await
5361 }
5362 pub async fn export_opts(
5369 &self,
5370 path: impl Into<String>,
5371 opts: DirectoryExportOpts,
5372 ) -> Result<String, DaggerError> {
5373 let mut query = self.selection.select("export");
5374 query = query.arg("path", path.into());
5375 if let Some(wipe) = opts.wipe {
5376 query = query.arg("wipe", wipe);
5377 }
5378 query.execute(self.graphql_client.clone()).await
5379 }
5380 pub fn file(&self, path: impl Into<String>) -> File {
5386 let mut query = self.selection.select("file");
5387 query = query.arg("path", path.into());
5388 File {
5389 proc: self.proc.clone(),
5390 selection: query,
5391 graphql_client: self.graphql_client.clone(),
5392 }
5393 }
5394 pub fn filter(&self) -> Directory {
5400 let query = self.selection.select("filter");
5401 Directory {
5402 proc: self.proc.clone(),
5403 selection: query,
5404 graphql_client: self.graphql_client.clone(),
5405 }
5406 }
5407 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5413 let mut query = self.selection.select("filter");
5414 if let Some(exclude) = opts.exclude {
5415 query = query.arg("exclude", exclude);
5416 }
5417 if let Some(include) = opts.include {
5418 query = query.arg("include", include);
5419 }
5420 if let Some(gitignore) = opts.gitignore {
5421 query = query.arg("gitignore", gitignore);
5422 }
5423 Directory {
5424 proc: self.proc.clone(),
5425 selection: query,
5426 graphql_client: self.graphql_client.clone(),
5427 }
5428 }
5429 pub async fn find_up(
5436 &self,
5437 name: impl Into<String>,
5438 start: impl Into<String>,
5439 ) -> Result<String, DaggerError> {
5440 let mut query = self.selection.select("findUp");
5441 query = query.arg("name", name.into());
5442 query = query.arg("start", start.into());
5443 query.execute(self.graphql_client.clone()).await
5444 }
5445 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5451 let mut query = self.selection.select("glob");
5452 query = query.arg("pattern", pattern.into());
5453 query.execute(self.graphql_client.clone()).await
5454 }
5455 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5457 let query = self.selection.select("id");
5458 query.execute(self.graphql_client.clone()).await
5459 }
5460 pub async fn name(&self) -> Result<String, DaggerError> {
5462 let query = self.selection.select("name");
5463 query.execute(self.graphql_client.clone()).await
5464 }
5465 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5473 let mut query = self.selection.select("search");
5474 query = query.arg("pattern", pattern.into());
5475 vec![SearchResult {
5476 proc: self.proc.clone(),
5477 selection: query,
5478 graphql_client: self.graphql_client.clone(),
5479 }]
5480 }
5481 pub fn search_opts<'a>(
5489 &self,
5490 pattern: impl Into<String>,
5491 opts: DirectorySearchOpts<'a>,
5492 ) -> Vec<SearchResult> {
5493 let mut query = self.selection.select("search");
5494 query = query.arg("pattern", pattern.into());
5495 if let Some(paths) = opts.paths {
5496 query = query.arg("paths", paths);
5497 }
5498 if let Some(globs) = opts.globs {
5499 query = query.arg("globs", globs);
5500 }
5501 if let Some(literal) = opts.literal {
5502 query = query.arg("literal", literal);
5503 }
5504 if let Some(multiline) = opts.multiline {
5505 query = query.arg("multiline", multiline);
5506 }
5507 if let Some(dotall) = opts.dotall {
5508 query = query.arg("dotall", dotall);
5509 }
5510 if let Some(insensitive) = opts.insensitive {
5511 query = query.arg("insensitive", insensitive);
5512 }
5513 if let Some(skip_ignored) = opts.skip_ignored {
5514 query = query.arg("skipIgnored", skip_ignored);
5515 }
5516 if let Some(skip_hidden) = opts.skip_hidden {
5517 query = query.arg("skipHidden", skip_hidden);
5518 }
5519 if let Some(files_only) = opts.files_only {
5520 query = query.arg("filesOnly", files_only);
5521 }
5522 if let Some(limit) = opts.limit {
5523 query = query.arg("limit", limit);
5524 }
5525 vec![SearchResult {
5526 proc: self.proc.clone(),
5527 selection: query,
5528 graphql_client: self.graphql_client.clone(),
5529 }]
5530 }
5531 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5533 let query = self.selection.select("sync");
5534 query.execute(self.graphql_client.clone()).await
5535 }
5536 pub fn terminal(&self) -> Directory {
5542 let query = self.selection.select("terminal");
5543 Directory {
5544 proc: self.proc.clone(),
5545 selection: query,
5546 graphql_client: self.graphql_client.clone(),
5547 }
5548 }
5549 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5555 let mut query = self.selection.select("terminal");
5556 if let Some(container) = opts.container {
5557 query = query.arg("container", container);
5558 }
5559 if let Some(cmd) = opts.cmd {
5560 query = query.arg("cmd", cmd);
5561 }
5562 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5563 query = query.arg(
5564 "experimentalPrivilegedNesting",
5565 experimental_privileged_nesting,
5566 );
5567 }
5568 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5569 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5570 }
5571 Directory {
5572 proc: self.proc.clone(),
5573 selection: query,
5574 graphql_client: self.graphql_client.clone(),
5575 }
5576 }
5577 pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5583 let mut query = self.selection.select("withChanges");
5584 query = query.arg_lazy(
5585 "changes",
5586 Box::new(move || {
5587 let changes = changes.clone();
5588 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5589 }),
5590 );
5591 Directory {
5592 proc: self.proc.clone(),
5593 selection: query,
5594 graphql_client: self.graphql_client.clone(),
5595 }
5596 }
5597 pub fn with_directory(
5605 &self,
5606 path: impl Into<String>,
5607 source: impl IntoID<DirectoryId>,
5608 ) -> Directory {
5609 let mut query = self.selection.select("withDirectory");
5610 query = query.arg("path", path.into());
5611 query = query.arg_lazy(
5612 "source",
5613 Box::new(move || {
5614 let source = source.clone();
5615 Box::pin(async move { source.into_id().await.unwrap().quote() })
5616 }),
5617 );
5618 Directory {
5619 proc: self.proc.clone(),
5620 selection: query,
5621 graphql_client: self.graphql_client.clone(),
5622 }
5623 }
5624 pub fn with_directory_opts<'a>(
5632 &self,
5633 path: impl Into<String>,
5634 source: impl IntoID<DirectoryId>,
5635 opts: DirectoryWithDirectoryOpts<'a>,
5636 ) -> Directory {
5637 let mut query = self.selection.select("withDirectory");
5638 query = query.arg("path", path.into());
5639 query = query.arg_lazy(
5640 "source",
5641 Box::new(move || {
5642 let source = source.clone();
5643 Box::pin(async move { source.into_id().await.unwrap().quote() })
5644 }),
5645 );
5646 if let Some(exclude) = opts.exclude {
5647 query = query.arg("exclude", exclude);
5648 }
5649 if let Some(include) = opts.include {
5650 query = query.arg("include", include);
5651 }
5652 if let Some(gitignore) = opts.gitignore {
5653 query = query.arg("gitignore", gitignore);
5654 }
5655 if let Some(owner) = opts.owner {
5656 query = query.arg("owner", owner);
5657 }
5658 Directory {
5659 proc: self.proc.clone(),
5660 selection: query,
5661 graphql_client: self.graphql_client.clone(),
5662 }
5663 }
5664 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5670 let mut query = self.selection.select("withError");
5671 query = query.arg("err", err.into());
5672 Directory {
5673 proc: self.proc.clone(),
5674 selection: query,
5675 graphql_client: self.graphql_client.clone(),
5676 }
5677 }
5678 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5686 let mut query = self.selection.select("withFile");
5687 query = query.arg("path", path.into());
5688 query = query.arg_lazy(
5689 "source",
5690 Box::new(move || {
5691 let source = source.clone();
5692 Box::pin(async move { source.into_id().await.unwrap().quote() })
5693 }),
5694 );
5695 Directory {
5696 proc: self.proc.clone(),
5697 selection: query,
5698 graphql_client: self.graphql_client.clone(),
5699 }
5700 }
5701 pub fn with_file_opts<'a>(
5709 &self,
5710 path: impl Into<String>,
5711 source: impl IntoID<FileId>,
5712 opts: DirectoryWithFileOpts<'a>,
5713 ) -> Directory {
5714 let mut query = self.selection.select("withFile");
5715 query = query.arg("path", path.into());
5716 query = query.arg_lazy(
5717 "source",
5718 Box::new(move || {
5719 let source = source.clone();
5720 Box::pin(async move { source.into_id().await.unwrap().quote() })
5721 }),
5722 );
5723 if let Some(permissions) = opts.permissions {
5724 query = query.arg("permissions", permissions);
5725 }
5726 if let Some(owner) = opts.owner {
5727 query = query.arg("owner", owner);
5728 }
5729 Directory {
5730 proc: self.proc.clone(),
5731 selection: query,
5732 graphql_client: self.graphql_client.clone(),
5733 }
5734 }
5735 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5743 let mut query = self.selection.select("withFiles");
5744 query = query.arg("path", path.into());
5745 query = query.arg("sources", sources);
5746 Directory {
5747 proc: self.proc.clone(),
5748 selection: query,
5749 graphql_client: self.graphql_client.clone(),
5750 }
5751 }
5752 pub fn with_files_opts(
5760 &self,
5761 path: impl Into<String>,
5762 sources: Vec<FileId>,
5763 opts: DirectoryWithFilesOpts,
5764 ) -> Directory {
5765 let mut query = self.selection.select("withFiles");
5766 query = query.arg("path", path.into());
5767 query = query.arg("sources", sources);
5768 if let Some(permissions) = opts.permissions {
5769 query = query.arg("permissions", permissions);
5770 }
5771 Directory {
5772 proc: self.proc.clone(),
5773 selection: query,
5774 graphql_client: self.graphql_client.clone(),
5775 }
5776 }
5777 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5784 let mut query = self.selection.select("withNewDirectory");
5785 query = query.arg("path", path.into());
5786 Directory {
5787 proc: self.proc.clone(),
5788 selection: query,
5789 graphql_client: self.graphql_client.clone(),
5790 }
5791 }
5792 pub fn with_new_directory_opts(
5799 &self,
5800 path: impl Into<String>,
5801 opts: DirectoryWithNewDirectoryOpts,
5802 ) -> Directory {
5803 let mut query = self.selection.select("withNewDirectory");
5804 query = query.arg("path", path.into());
5805 if let Some(permissions) = opts.permissions {
5806 query = query.arg("permissions", permissions);
5807 }
5808 Directory {
5809 proc: self.proc.clone(),
5810 selection: query,
5811 graphql_client: self.graphql_client.clone(),
5812 }
5813 }
5814 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5822 let mut query = self.selection.select("withNewFile");
5823 query = query.arg("path", path.into());
5824 query = query.arg("contents", contents.into());
5825 Directory {
5826 proc: self.proc.clone(),
5827 selection: query,
5828 graphql_client: self.graphql_client.clone(),
5829 }
5830 }
5831 pub fn with_new_file_opts(
5839 &self,
5840 path: impl Into<String>,
5841 contents: impl Into<String>,
5842 opts: DirectoryWithNewFileOpts,
5843 ) -> Directory {
5844 let mut query = self.selection.select("withNewFile");
5845 query = query.arg("path", path.into());
5846 query = query.arg("contents", contents.into());
5847 if let Some(permissions) = opts.permissions {
5848 query = query.arg("permissions", permissions);
5849 }
5850 Directory {
5851 proc: self.proc.clone(),
5852 selection: query,
5853 graphql_client: self.graphql_client.clone(),
5854 }
5855 }
5856 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5862 let mut query = self.selection.select("withPatch");
5863 query = query.arg("patch", patch.into());
5864 Directory {
5865 proc: self.proc.clone(),
5866 selection: query,
5867 graphql_client: self.graphql_client.clone(),
5868 }
5869 }
5870 pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
5876 let mut query = self.selection.select("withPatchFile");
5877 query = query.arg_lazy(
5878 "patch",
5879 Box::new(move || {
5880 let patch = patch.clone();
5881 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5882 }),
5883 );
5884 Directory {
5885 proc: self.proc.clone(),
5886 selection: query,
5887 graphql_client: self.graphql_client.clone(),
5888 }
5889 }
5890 pub fn with_symlink(
5897 &self,
5898 target: impl Into<String>,
5899 link_name: impl Into<String>,
5900 ) -> Directory {
5901 let mut query = self.selection.select("withSymlink");
5902 query = query.arg("target", target.into());
5903 query = query.arg("linkName", link_name.into());
5904 Directory {
5905 proc: self.proc.clone(),
5906 selection: query,
5907 graphql_client: self.graphql_client.clone(),
5908 }
5909 }
5910 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5918 let mut query = self.selection.select("withTimestamps");
5919 query = query.arg("timestamp", timestamp);
5920 Directory {
5921 proc: self.proc.clone(),
5922 selection: query,
5923 graphql_client: self.graphql_client.clone(),
5924 }
5925 }
5926 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5932 let mut query = self.selection.select("withoutDirectory");
5933 query = query.arg("path", path.into());
5934 Directory {
5935 proc: self.proc.clone(),
5936 selection: query,
5937 graphql_client: self.graphql_client.clone(),
5938 }
5939 }
5940 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5946 let mut query = self.selection.select("withoutFile");
5947 query = query.arg("path", path.into());
5948 Directory {
5949 proc: self.proc.clone(),
5950 selection: query,
5951 graphql_client: self.graphql_client.clone(),
5952 }
5953 }
5954 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5960 let mut query = self.selection.select("withoutFiles");
5961 query = query.arg(
5962 "paths",
5963 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5964 );
5965 Directory {
5966 proc: self.proc.clone(),
5967 selection: query,
5968 graphql_client: self.graphql_client.clone(),
5969 }
5970 }
5971}
5972#[derive(Clone)]
5973pub struct Engine {
5974 pub proc: Option<Arc<DaggerSessionProc>>,
5975 pub selection: Selection,
5976 pub graphql_client: DynGraphQLClient,
5977}
5978impl Engine {
5979 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5981 let query = self.selection.select("clients");
5982 query.execute(self.graphql_client.clone()).await
5983 }
5984 pub async fn id(&self) -> Result<EngineId, DaggerError> {
5986 let query = self.selection.select("id");
5987 query.execute(self.graphql_client.clone()).await
5988 }
5989 pub fn local_cache(&self) -> EngineCache {
5991 let query = self.selection.select("localCache");
5992 EngineCache {
5993 proc: self.proc.clone(),
5994 selection: query,
5995 graphql_client: self.graphql_client.clone(),
5996 }
5997 }
5998 pub async fn name(&self) -> Result<String, DaggerError> {
6000 let query = self.selection.select("name");
6001 query.execute(self.graphql_client.clone()).await
6002 }
6003}
6004#[derive(Clone)]
6005pub struct EngineCache {
6006 pub proc: Option<Arc<DaggerSessionProc>>,
6007 pub selection: Selection,
6008 pub graphql_client: DynGraphQLClient,
6009}
6010#[derive(Builder, Debug, PartialEq)]
6011pub struct EngineCacheEntrySetOpts<'a> {
6012 #[builder(setter(into, strip_option), default)]
6013 pub key: Option<&'a str>,
6014}
6015#[derive(Builder, Debug, PartialEq)]
6016pub struct EngineCachePruneOpts {
6017 #[builder(setter(into, strip_option), default)]
6019 pub use_default_policy: Option<bool>,
6020}
6021impl EngineCache {
6022 pub fn entry_set(&self) -> EngineCacheEntrySet {
6028 let query = self.selection.select("entrySet");
6029 EngineCacheEntrySet {
6030 proc: self.proc.clone(),
6031 selection: query,
6032 graphql_client: self.graphql_client.clone(),
6033 }
6034 }
6035 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6041 let mut query = self.selection.select("entrySet");
6042 if let Some(key) = opts.key {
6043 query = query.arg("key", key);
6044 }
6045 EngineCacheEntrySet {
6046 proc: self.proc.clone(),
6047 selection: query,
6048 graphql_client: self.graphql_client.clone(),
6049 }
6050 }
6051 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
6053 let query = self.selection.select("id");
6054 query.execute(self.graphql_client.clone()).await
6055 }
6056 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6058 let query = self.selection.select("maxUsedSpace");
6059 query.execute(self.graphql_client.clone()).await
6060 }
6061 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6063 let query = self.selection.select("minFreeSpace");
6064 query.execute(self.graphql_client.clone()).await
6065 }
6066 pub async fn prune(&self) -> Result<Void, DaggerError> {
6072 let query = self.selection.select("prune");
6073 query.execute(self.graphql_client.clone()).await
6074 }
6075 pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
6081 let mut query = self.selection.select("prune");
6082 if let Some(use_default_policy) = opts.use_default_policy {
6083 query = query.arg("useDefaultPolicy", use_default_policy);
6084 }
6085 query.execute(self.graphql_client.clone()).await
6086 }
6087 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6089 let query = self.selection.select("reservedSpace");
6090 query.execute(self.graphql_client.clone()).await
6091 }
6092 pub async fn target_space(&self) -> Result<isize, DaggerError> {
6094 let query = self.selection.select("targetSpace");
6095 query.execute(self.graphql_client.clone()).await
6096 }
6097}
6098#[derive(Clone)]
6099pub struct EngineCacheEntry {
6100 pub proc: Option<Arc<DaggerSessionProc>>,
6101 pub selection: Selection,
6102 pub graphql_client: DynGraphQLClient,
6103}
6104impl EngineCacheEntry {
6105 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6107 let query = self.selection.select("activelyUsed");
6108 query.execute(self.graphql_client.clone()).await
6109 }
6110 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6112 let query = self.selection.select("createdTimeUnixNano");
6113 query.execute(self.graphql_client.clone()).await
6114 }
6115 pub async fn description(&self) -> Result<String, DaggerError> {
6117 let query = self.selection.select("description");
6118 query.execute(self.graphql_client.clone()).await
6119 }
6120 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6122 let query = self.selection.select("diskSpaceBytes");
6123 query.execute(self.graphql_client.clone()).await
6124 }
6125 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6127 let query = self.selection.select("id");
6128 query.execute(self.graphql_client.clone()).await
6129 }
6130 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6132 let query = self.selection.select("mostRecentUseTimeUnixNano");
6133 query.execute(self.graphql_client.clone()).await
6134 }
6135}
6136#[derive(Clone)]
6137pub struct EngineCacheEntrySet {
6138 pub proc: Option<Arc<DaggerSessionProc>>,
6139 pub selection: Selection,
6140 pub graphql_client: DynGraphQLClient,
6141}
6142impl EngineCacheEntrySet {
6143 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6145 let query = self.selection.select("diskSpaceBytes");
6146 query.execute(self.graphql_client.clone()).await
6147 }
6148 pub fn entries(&self) -> Vec<EngineCacheEntry> {
6150 let query = self.selection.select("entries");
6151 vec![EngineCacheEntry {
6152 proc: self.proc.clone(),
6153 selection: query,
6154 graphql_client: self.graphql_client.clone(),
6155 }]
6156 }
6157 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6159 let query = self.selection.select("entryCount");
6160 query.execute(self.graphql_client.clone()).await
6161 }
6162 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6164 let query = self.selection.select("id");
6165 query.execute(self.graphql_client.clone()).await
6166 }
6167}
6168#[derive(Clone)]
6169pub struct EnumTypeDef {
6170 pub proc: Option<Arc<DaggerSessionProc>>,
6171 pub selection: Selection,
6172 pub graphql_client: DynGraphQLClient,
6173}
6174impl EnumTypeDef {
6175 pub async fn description(&self) -> Result<String, DaggerError> {
6177 let query = self.selection.select("description");
6178 query.execute(self.graphql_client.clone()).await
6179 }
6180 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6182 let query = self.selection.select("id");
6183 query.execute(self.graphql_client.clone()).await
6184 }
6185 pub fn members(&self) -> Vec<EnumValueTypeDef> {
6187 let query = self.selection.select("members");
6188 vec![EnumValueTypeDef {
6189 proc: self.proc.clone(),
6190 selection: query,
6191 graphql_client: self.graphql_client.clone(),
6192 }]
6193 }
6194 pub async fn name(&self) -> Result<String, DaggerError> {
6196 let query = self.selection.select("name");
6197 query.execute(self.graphql_client.clone()).await
6198 }
6199 pub fn source_map(&self) -> SourceMap {
6201 let query = self.selection.select("sourceMap");
6202 SourceMap {
6203 proc: self.proc.clone(),
6204 selection: query,
6205 graphql_client: self.graphql_client.clone(),
6206 }
6207 }
6208 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6210 let query = self.selection.select("sourceModuleName");
6211 query.execute(self.graphql_client.clone()).await
6212 }
6213 pub fn values(&self) -> Vec<EnumValueTypeDef> {
6214 let query = self.selection.select("values");
6215 vec![EnumValueTypeDef {
6216 proc: self.proc.clone(),
6217 selection: query,
6218 graphql_client: self.graphql_client.clone(),
6219 }]
6220 }
6221}
6222#[derive(Clone)]
6223pub struct EnumValueTypeDef {
6224 pub proc: Option<Arc<DaggerSessionProc>>,
6225 pub selection: Selection,
6226 pub graphql_client: DynGraphQLClient,
6227}
6228impl EnumValueTypeDef {
6229 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6231 let query = self.selection.select("deprecated");
6232 query.execute(self.graphql_client.clone()).await
6233 }
6234 pub async fn description(&self) -> Result<String, DaggerError> {
6236 let query = self.selection.select("description");
6237 query.execute(self.graphql_client.clone()).await
6238 }
6239 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6241 let query = self.selection.select("id");
6242 query.execute(self.graphql_client.clone()).await
6243 }
6244 pub async fn name(&self) -> Result<String, DaggerError> {
6246 let query = self.selection.select("name");
6247 query.execute(self.graphql_client.clone()).await
6248 }
6249 pub fn source_map(&self) -> SourceMap {
6251 let query = self.selection.select("sourceMap");
6252 SourceMap {
6253 proc: self.proc.clone(),
6254 selection: query,
6255 graphql_client: self.graphql_client.clone(),
6256 }
6257 }
6258 pub async fn value(&self) -> Result<String, DaggerError> {
6260 let query = self.selection.select("value");
6261 query.execute(self.graphql_client.clone()).await
6262 }
6263}
6264#[derive(Clone)]
6265pub struct Env {
6266 pub proc: Option<Arc<DaggerSessionProc>>,
6267 pub selection: Selection,
6268 pub graphql_client: DynGraphQLClient,
6269}
6270impl Env {
6271 pub async fn id(&self) -> Result<EnvId, DaggerError> {
6273 let query = self.selection.select("id");
6274 query.execute(self.graphql_client.clone()).await
6275 }
6276 pub fn input(&self, name: impl Into<String>) -> Binding {
6278 let mut query = self.selection.select("input");
6279 query = query.arg("name", name.into());
6280 Binding {
6281 proc: self.proc.clone(),
6282 selection: query,
6283 graphql_client: self.graphql_client.clone(),
6284 }
6285 }
6286 pub fn inputs(&self) -> Vec<Binding> {
6288 let query = self.selection.select("inputs");
6289 vec![Binding {
6290 proc: self.proc.clone(),
6291 selection: query,
6292 graphql_client: self.graphql_client.clone(),
6293 }]
6294 }
6295 pub fn output(&self, name: impl Into<String>) -> Binding {
6297 let mut query = self.selection.select("output");
6298 query = query.arg("name", name.into());
6299 Binding {
6300 proc: self.proc.clone(),
6301 selection: query,
6302 graphql_client: self.graphql_client.clone(),
6303 }
6304 }
6305 pub fn outputs(&self) -> Vec<Binding> {
6307 let query = self.selection.select("outputs");
6308 vec![Binding {
6309 proc: self.proc.clone(),
6310 selection: query,
6311 graphql_client: self.graphql_client.clone(),
6312 }]
6313 }
6314 pub fn with_address_input(
6322 &self,
6323 name: impl Into<String>,
6324 value: impl IntoID<AddressId>,
6325 description: impl Into<String>,
6326 ) -> Env {
6327 let mut query = self.selection.select("withAddressInput");
6328 query = query.arg("name", name.into());
6329 query = query.arg_lazy(
6330 "value",
6331 Box::new(move || {
6332 let value = value.clone();
6333 Box::pin(async move { value.into_id().await.unwrap().quote() })
6334 }),
6335 );
6336 query = query.arg("description", description.into());
6337 Env {
6338 proc: self.proc.clone(),
6339 selection: query,
6340 graphql_client: self.graphql_client.clone(),
6341 }
6342 }
6343 pub fn with_address_output(
6350 &self,
6351 name: impl Into<String>,
6352 description: impl Into<String>,
6353 ) -> Env {
6354 let mut query = self.selection.select("withAddressOutput");
6355 query = query.arg("name", name.into());
6356 query = query.arg("description", description.into());
6357 Env {
6358 proc: self.proc.clone(),
6359 selection: query,
6360 graphql_client: self.graphql_client.clone(),
6361 }
6362 }
6363 pub fn with_cache_volume_input(
6371 &self,
6372 name: impl Into<String>,
6373 value: impl IntoID<CacheVolumeId>,
6374 description: impl Into<String>,
6375 ) -> Env {
6376 let mut query = self.selection.select("withCacheVolumeInput");
6377 query = query.arg("name", name.into());
6378 query = query.arg_lazy(
6379 "value",
6380 Box::new(move || {
6381 let value = value.clone();
6382 Box::pin(async move { value.into_id().await.unwrap().quote() })
6383 }),
6384 );
6385 query = query.arg("description", description.into());
6386 Env {
6387 proc: self.proc.clone(),
6388 selection: query,
6389 graphql_client: self.graphql_client.clone(),
6390 }
6391 }
6392 pub fn with_cache_volume_output(
6399 &self,
6400 name: impl Into<String>,
6401 description: impl Into<String>,
6402 ) -> Env {
6403 let mut query = self.selection.select("withCacheVolumeOutput");
6404 query = query.arg("name", name.into());
6405 query = query.arg("description", description.into());
6406 Env {
6407 proc: self.proc.clone(),
6408 selection: query,
6409 graphql_client: self.graphql_client.clone(),
6410 }
6411 }
6412 pub fn with_changeset_input(
6420 &self,
6421 name: impl Into<String>,
6422 value: impl IntoID<ChangesetId>,
6423 description: impl Into<String>,
6424 ) -> Env {
6425 let mut query = self.selection.select("withChangesetInput");
6426 query = query.arg("name", name.into());
6427 query = query.arg_lazy(
6428 "value",
6429 Box::new(move || {
6430 let value = value.clone();
6431 Box::pin(async move { value.into_id().await.unwrap().quote() })
6432 }),
6433 );
6434 query = query.arg("description", description.into());
6435 Env {
6436 proc: self.proc.clone(),
6437 selection: query,
6438 graphql_client: self.graphql_client.clone(),
6439 }
6440 }
6441 pub fn with_changeset_output(
6448 &self,
6449 name: impl Into<String>,
6450 description: impl Into<String>,
6451 ) -> Env {
6452 let mut query = self.selection.select("withChangesetOutput");
6453 query = query.arg("name", name.into());
6454 query = query.arg("description", description.into());
6455 Env {
6456 proc: self.proc.clone(),
6457 selection: query,
6458 graphql_client: self.graphql_client.clone(),
6459 }
6460 }
6461 pub fn with_cloud_input(
6469 &self,
6470 name: impl Into<String>,
6471 value: impl IntoID<CloudId>,
6472 description: impl Into<String>,
6473 ) -> Env {
6474 let mut query = self.selection.select("withCloudInput");
6475 query = query.arg("name", name.into());
6476 query = query.arg_lazy(
6477 "value",
6478 Box::new(move || {
6479 let value = value.clone();
6480 Box::pin(async move { value.into_id().await.unwrap().quote() })
6481 }),
6482 );
6483 query = query.arg("description", description.into());
6484 Env {
6485 proc: self.proc.clone(),
6486 selection: query,
6487 graphql_client: self.graphql_client.clone(),
6488 }
6489 }
6490 pub fn with_cloud_output(
6497 &self,
6498 name: impl Into<String>,
6499 description: impl Into<String>,
6500 ) -> Env {
6501 let mut query = self.selection.select("withCloudOutput");
6502 query = query.arg("name", name.into());
6503 query = query.arg("description", description.into());
6504 Env {
6505 proc: self.proc.clone(),
6506 selection: query,
6507 graphql_client: self.graphql_client.clone(),
6508 }
6509 }
6510 pub fn with_container_input(
6518 &self,
6519 name: impl Into<String>,
6520 value: impl IntoID<ContainerId>,
6521 description: impl Into<String>,
6522 ) -> Env {
6523 let mut query = self.selection.select("withContainerInput");
6524 query = query.arg("name", name.into());
6525 query = query.arg_lazy(
6526 "value",
6527 Box::new(move || {
6528 let value = value.clone();
6529 Box::pin(async move { value.into_id().await.unwrap().quote() })
6530 }),
6531 );
6532 query = query.arg("description", description.into());
6533 Env {
6534 proc: self.proc.clone(),
6535 selection: query,
6536 graphql_client: self.graphql_client.clone(),
6537 }
6538 }
6539 pub fn with_container_output(
6546 &self,
6547 name: impl Into<String>,
6548 description: impl Into<String>,
6549 ) -> Env {
6550 let mut query = self.selection.select("withContainerOutput");
6551 query = query.arg("name", name.into());
6552 query = query.arg("description", description.into());
6553 Env {
6554 proc: self.proc.clone(),
6555 selection: query,
6556 graphql_client: self.graphql_client.clone(),
6557 }
6558 }
6559 pub fn with_current_module(&self) -> Env {
6562 let query = self.selection.select("withCurrentModule");
6563 Env {
6564 proc: self.proc.clone(),
6565 selection: query,
6566 graphql_client: self.graphql_client.clone(),
6567 }
6568 }
6569 pub fn with_directory_input(
6577 &self,
6578 name: impl Into<String>,
6579 value: impl IntoID<DirectoryId>,
6580 description: impl Into<String>,
6581 ) -> Env {
6582 let mut query = self.selection.select("withDirectoryInput");
6583 query = query.arg("name", name.into());
6584 query = query.arg_lazy(
6585 "value",
6586 Box::new(move || {
6587 let value = value.clone();
6588 Box::pin(async move { value.into_id().await.unwrap().quote() })
6589 }),
6590 );
6591 query = query.arg("description", description.into());
6592 Env {
6593 proc: self.proc.clone(),
6594 selection: query,
6595 graphql_client: self.graphql_client.clone(),
6596 }
6597 }
6598 pub fn with_directory_output(
6605 &self,
6606 name: impl Into<String>,
6607 description: impl Into<String>,
6608 ) -> Env {
6609 let mut query = self.selection.select("withDirectoryOutput");
6610 query = query.arg("name", name.into());
6611 query = query.arg("description", description.into());
6612 Env {
6613 proc: self.proc.clone(),
6614 selection: query,
6615 graphql_client: self.graphql_client.clone(),
6616 }
6617 }
6618 pub fn with_env_file_input(
6626 &self,
6627 name: impl Into<String>,
6628 value: impl IntoID<EnvFileId>,
6629 description: impl Into<String>,
6630 ) -> Env {
6631 let mut query = self.selection.select("withEnvFileInput");
6632 query = query.arg("name", name.into());
6633 query = query.arg_lazy(
6634 "value",
6635 Box::new(move || {
6636 let value = value.clone();
6637 Box::pin(async move { value.into_id().await.unwrap().quote() })
6638 }),
6639 );
6640 query = query.arg("description", description.into());
6641 Env {
6642 proc: self.proc.clone(),
6643 selection: query,
6644 graphql_client: self.graphql_client.clone(),
6645 }
6646 }
6647 pub fn with_env_file_output(
6654 &self,
6655 name: impl Into<String>,
6656 description: impl Into<String>,
6657 ) -> Env {
6658 let mut query = self.selection.select("withEnvFileOutput");
6659 query = query.arg("name", name.into());
6660 query = query.arg("description", description.into());
6661 Env {
6662 proc: self.proc.clone(),
6663 selection: query,
6664 graphql_client: self.graphql_client.clone(),
6665 }
6666 }
6667 pub fn with_env_input(
6675 &self,
6676 name: impl Into<String>,
6677 value: impl IntoID<EnvId>,
6678 description: impl Into<String>,
6679 ) -> Env {
6680 let mut query = self.selection.select("withEnvInput");
6681 query = query.arg("name", name.into());
6682 query = query.arg_lazy(
6683 "value",
6684 Box::new(move || {
6685 let value = value.clone();
6686 Box::pin(async move { value.into_id().await.unwrap().quote() })
6687 }),
6688 );
6689 query = query.arg("description", description.into());
6690 Env {
6691 proc: self.proc.clone(),
6692 selection: query,
6693 graphql_client: self.graphql_client.clone(),
6694 }
6695 }
6696 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6703 let mut query = self.selection.select("withEnvOutput");
6704 query = query.arg("name", name.into());
6705 query = query.arg("description", description.into());
6706 Env {
6707 proc: self.proc.clone(),
6708 selection: query,
6709 graphql_client: self.graphql_client.clone(),
6710 }
6711 }
6712 pub fn with_file_input(
6720 &self,
6721 name: impl Into<String>,
6722 value: impl IntoID<FileId>,
6723 description: impl Into<String>,
6724 ) -> Env {
6725 let mut query = self.selection.select("withFileInput");
6726 query = query.arg("name", name.into());
6727 query = query.arg_lazy(
6728 "value",
6729 Box::new(move || {
6730 let value = value.clone();
6731 Box::pin(async move { value.into_id().await.unwrap().quote() })
6732 }),
6733 );
6734 query = query.arg("description", description.into());
6735 Env {
6736 proc: self.proc.clone(),
6737 selection: query,
6738 graphql_client: self.graphql_client.clone(),
6739 }
6740 }
6741 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6748 let mut query = self.selection.select("withFileOutput");
6749 query = query.arg("name", name.into());
6750 query = query.arg("description", description.into());
6751 Env {
6752 proc: self.proc.clone(),
6753 selection: query,
6754 graphql_client: self.graphql_client.clone(),
6755 }
6756 }
6757 pub fn with_git_ref_input(
6765 &self,
6766 name: impl Into<String>,
6767 value: impl IntoID<GitRefId>,
6768 description: impl Into<String>,
6769 ) -> Env {
6770 let mut query = self.selection.select("withGitRefInput");
6771 query = query.arg("name", name.into());
6772 query = query.arg_lazy(
6773 "value",
6774 Box::new(move || {
6775 let value = value.clone();
6776 Box::pin(async move { value.into_id().await.unwrap().quote() })
6777 }),
6778 );
6779 query = query.arg("description", description.into());
6780 Env {
6781 proc: self.proc.clone(),
6782 selection: query,
6783 graphql_client: self.graphql_client.clone(),
6784 }
6785 }
6786 pub fn with_git_ref_output(
6793 &self,
6794 name: impl Into<String>,
6795 description: impl Into<String>,
6796 ) -> Env {
6797 let mut query = self.selection.select("withGitRefOutput");
6798 query = query.arg("name", name.into());
6799 query = query.arg("description", description.into());
6800 Env {
6801 proc: self.proc.clone(),
6802 selection: query,
6803 graphql_client: self.graphql_client.clone(),
6804 }
6805 }
6806 pub fn with_git_repository_input(
6814 &self,
6815 name: impl Into<String>,
6816 value: impl IntoID<GitRepositoryId>,
6817 description: impl Into<String>,
6818 ) -> Env {
6819 let mut query = self.selection.select("withGitRepositoryInput");
6820 query = query.arg("name", name.into());
6821 query = query.arg_lazy(
6822 "value",
6823 Box::new(move || {
6824 let value = value.clone();
6825 Box::pin(async move { value.into_id().await.unwrap().quote() })
6826 }),
6827 );
6828 query = query.arg("description", description.into());
6829 Env {
6830 proc: self.proc.clone(),
6831 selection: query,
6832 graphql_client: self.graphql_client.clone(),
6833 }
6834 }
6835 pub fn with_git_repository_output(
6842 &self,
6843 name: impl Into<String>,
6844 description: impl Into<String>,
6845 ) -> Env {
6846 let mut query = self.selection.select("withGitRepositoryOutput");
6847 query = query.arg("name", name.into());
6848 query = query.arg("description", description.into());
6849 Env {
6850 proc: self.proc.clone(),
6851 selection: query,
6852 graphql_client: self.graphql_client.clone(),
6853 }
6854 }
6855 pub fn with_json_value_input(
6863 &self,
6864 name: impl Into<String>,
6865 value: impl IntoID<JsonValueId>,
6866 description: impl Into<String>,
6867 ) -> Env {
6868 let mut query = self.selection.select("withJSONValueInput");
6869 query = query.arg("name", name.into());
6870 query = query.arg_lazy(
6871 "value",
6872 Box::new(move || {
6873 let value = value.clone();
6874 Box::pin(async move { value.into_id().await.unwrap().quote() })
6875 }),
6876 );
6877 query = query.arg("description", description.into());
6878 Env {
6879 proc: self.proc.clone(),
6880 selection: query,
6881 graphql_client: self.graphql_client.clone(),
6882 }
6883 }
6884 pub fn with_json_value_output(
6891 &self,
6892 name: impl Into<String>,
6893 description: impl Into<String>,
6894 ) -> Env {
6895 let mut query = self.selection.select("withJSONValueOutput");
6896 query = query.arg("name", name.into());
6897 query = query.arg("description", description.into());
6898 Env {
6899 proc: self.proc.clone(),
6900 selection: query,
6901 graphql_client: self.graphql_client.clone(),
6902 }
6903 }
6904 pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
6907 let mut query = self.selection.select("withModule");
6908 query = query.arg_lazy(
6909 "module",
6910 Box::new(move || {
6911 let module = module.clone();
6912 Box::pin(async move { module.into_id().await.unwrap().quote() })
6913 }),
6914 );
6915 Env {
6916 proc: self.proc.clone(),
6917 selection: query,
6918 graphql_client: self.graphql_client.clone(),
6919 }
6920 }
6921 pub fn with_module_config_client_input(
6929 &self,
6930 name: impl Into<String>,
6931 value: impl IntoID<ModuleConfigClientId>,
6932 description: impl Into<String>,
6933 ) -> Env {
6934 let mut query = self.selection.select("withModuleConfigClientInput");
6935 query = query.arg("name", name.into());
6936 query = query.arg_lazy(
6937 "value",
6938 Box::new(move || {
6939 let value = value.clone();
6940 Box::pin(async move { value.into_id().await.unwrap().quote() })
6941 }),
6942 );
6943 query = query.arg("description", description.into());
6944 Env {
6945 proc: self.proc.clone(),
6946 selection: query,
6947 graphql_client: self.graphql_client.clone(),
6948 }
6949 }
6950 pub fn with_module_config_client_output(
6957 &self,
6958 name: impl Into<String>,
6959 description: impl Into<String>,
6960 ) -> Env {
6961 let mut query = self.selection.select("withModuleConfigClientOutput");
6962 query = query.arg("name", name.into());
6963 query = query.arg("description", description.into());
6964 Env {
6965 proc: self.proc.clone(),
6966 selection: query,
6967 graphql_client: self.graphql_client.clone(),
6968 }
6969 }
6970 pub fn with_module_input(
6978 &self,
6979 name: impl Into<String>,
6980 value: impl IntoID<ModuleId>,
6981 description: impl Into<String>,
6982 ) -> Env {
6983 let mut query = self.selection.select("withModuleInput");
6984 query = query.arg("name", name.into());
6985 query = query.arg_lazy(
6986 "value",
6987 Box::new(move || {
6988 let value = value.clone();
6989 Box::pin(async move { value.into_id().await.unwrap().quote() })
6990 }),
6991 );
6992 query = query.arg("description", description.into());
6993 Env {
6994 proc: self.proc.clone(),
6995 selection: query,
6996 graphql_client: self.graphql_client.clone(),
6997 }
6998 }
6999 pub fn with_module_output(
7006 &self,
7007 name: impl Into<String>,
7008 description: impl Into<String>,
7009 ) -> Env {
7010 let mut query = self.selection.select("withModuleOutput");
7011 query = query.arg("name", name.into());
7012 query = query.arg("description", description.into());
7013 Env {
7014 proc: self.proc.clone(),
7015 selection: query,
7016 graphql_client: self.graphql_client.clone(),
7017 }
7018 }
7019 pub fn with_module_source_input(
7027 &self,
7028 name: impl Into<String>,
7029 value: impl IntoID<ModuleSourceId>,
7030 description: impl Into<String>,
7031 ) -> Env {
7032 let mut query = self.selection.select("withModuleSourceInput");
7033 query = query.arg("name", name.into());
7034 query = query.arg_lazy(
7035 "value",
7036 Box::new(move || {
7037 let value = value.clone();
7038 Box::pin(async move { value.into_id().await.unwrap().quote() })
7039 }),
7040 );
7041 query = query.arg("description", description.into());
7042 Env {
7043 proc: self.proc.clone(),
7044 selection: query,
7045 graphql_client: self.graphql_client.clone(),
7046 }
7047 }
7048 pub fn with_module_source_output(
7055 &self,
7056 name: impl Into<String>,
7057 description: impl Into<String>,
7058 ) -> Env {
7059 let mut query = self.selection.select("withModuleSourceOutput");
7060 query = query.arg("name", name.into());
7061 query = query.arg("description", description.into());
7062 Env {
7063 proc: self.proc.clone(),
7064 selection: query,
7065 graphql_client: self.graphql_client.clone(),
7066 }
7067 }
7068 pub fn with_search_result_input(
7076 &self,
7077 name: impl Into<String>,
7078 value: impl IntoID<SearchResultId>,
7079 description: impl Into<String>,
7080 ) -> Env {
7081 let mut query = self.selection.select("withSearchResultInput");
7082 query = query.arg("name", name.into());
7083 query = query.arg_lazy(
7084 "value",
7085 Box::new(move || {
7086 let value = value.clone();
7087 Box::pin(async move { value.into_id().await.unwrap().quote() })
7088 }),
7089 );
7090 query = query.arg("description", description.into());
7091 Env {
7092 proc: self.proc.clone(),
7093 selection: query,
7094 graphql_client: self.graphql_client.clone(),
7095 }
7096 }
7097 pub fn with_search_result_output(
7104 &self,
7105 name: impl Into<String>,
7106 description: impl Into<String>,
7107 ) -> Env {
7108 let mut query = self.selection.select("withSearchResultOutput");
7109 query = query.arg("name", name.into());
7110 query = query.arg("description", description.into());
7111 Env {
7112 proc: self.proc.clone(),
7113 selection: query,
7114 graphql_client: self.graphql_client.clone(),
7115 }
7116 }
7117 pub fn with_search_submatch_input(
7125 &self,
7126 name: impl Into<String>,
7127 value: impl IntoID<SearchSubmatchId>,
7128 description: impl Into<String>,
7129 ) -> Env {
7130 let mut query = self.selection.select("withSearchSubmatchInput");
7131 query = query.arg("name", name.into());
7132 query = query.arg_lazy(
7133 "value",
7134 Box::new(move || {
7135 let value = value.clone();
7136 Box::pin(async move { value.into_id().await.unwrap().quote() })
7137 }),
7138 );
7139 query = query.arg("description", description.into());
7140 Env {
7141 proc: self.proc.clone(),
7142 selection: query,
7143 graphql_client: self.graphql_client.clone(),
7144 }
7145 }
7146 pub fn with_search_submatch_output(
7153 &self,
7154 name: impl Into<String>,
7155 description: impl Into<String>,
7156 ) -> Env {
7157 let mut query = self.selection.select("withSearchSubmatchOutput");
7158 query = query.arg("name", name.into());
7159 query = query.arg("description", description.into());
7160 Env {
7161 proc: self.proc.clone(),
7162 selection: query,
7163 graphql_client: self.graphql_client.clone(),
7164 }
7165 }
7166 pub fn with_secret_input(
7174 &self,
7175 name: impl Into<String>,
7176 value: impl IntoID<SecretId>,
7177 description: impl Into<String>,
7178 ) -> Env {
7179 let mut query = self.selection.select("withSecretInput");
7180 query = query.arg("name", name.into());
7181 query = query.arg_lazy(
7182 "value",
7183 Box::new(move || {
7184 let value = value.clone();
7185 Box::pin(async move { value.into_id().await.unwrap().quote() })
7186 }),
7187 );
7188 query = query.arg("description", description.into());
7189 Env {
7190 proc: self.proc.clone(),
7191 selection: query,
7192 graphql_client: self.graphql_client.clone(),
7193 }
7194 }
7195 pub fn with_secret_output(
7202 &self,
7203 name: impl Into<String>,
7204 description: impl Into<String>,
7205 ) -> Env {
7206 let mut query = self.selection.select("withSecretOutput");
7207 query = query.arg("name", name.into());
7208 query = query.arg("description", description.into());
7209 Env {
7210 proc: self.proc.clone(),
7211 selection: query,
7212 graphql_client: self.graphql_client.clone(),
7213 }
7214 }
7215 pub fn with_service_input(
7223 &self,
7224 name: impl Into<String>,
7225 value: impl IntoID<ServiceId>,
7226 description: impl Into<String>,
7227 ) -> Env {
7228 let mut query = self.selection.select("withServiceInput");
7229 query = query.arg("name", name.into());
7230 query = query.arg_lazy(
7231 "value",
7232 Box::new(move || {
7233 let value = value.clone();
7234 Box::pin(async move { value.into_id().await.unwrap().quote() })
7235 }),
7236 );
7237 query = query.arg("description", description.into());
7238 Env {
7239 proc: self.proc.clone(),
7240 selection: query,
7241 graphql_client: self.graphql_client.clone(),
7242 }
7243 }
7244 pub fn with_service_output(
7251 &self,
7252 name: impl Into<String>,
7253 description: impl Into<String>,
7254 ) -> Env {
7255 let mut query = self.selection.select("withServiceOutput");
7256 query = query.arg("name", name.into());
7257 query = query.arg("description", description.into());
7258 Env {
7259 proc: self.proc.clone(),
7260 selection: query,
7261 graphql_client: self.graphql_client.clone(),
7262 }
7263 }
7264 pub fn with_socket_input(
7272 &self,
7273 name: impl Into<String>,
7274 value: impl IntoID<SocketId>,
7275 description: impl Into<String>,
7276 ) -> Env {
7277 let mut query = self.selection.select("withSocketInput");
7278 query = query.arg("name", name.into());
7279 query = query.arg_lazy(
7280 "value",
7281 Box::new(move || {
7282 let value = value.clone();
7283 Box::pin(async move { value.into_id().await.unwrap().quote() })
7284 }),
7285 );
7286 query = query.arg("description", description.into());
7287 Env {
7288 proc: self.proc.clone(),
7289 selection: query,
7290 graphql_client: self.graphql_client.clone(),
7291 }
7292 }
7293 pub fn with_socket_output(
7300 &self,
7301 name: impl Into<String>,
7302 description: impl Into<String>,
7303 ) -> Env {
7304 let mut query = self.selection.select("withSocketOutput");
7305 query = query.arg("name", name.into());
7306 query = query.arg("description", description.into());
7307 Env {
7308 proc: self.proc.clone(),
7309 selection: query,
7310 graphql_client: self.graphql_client.clone(),
7311 }
7312 }
7313 pub fn with_string_input(
7321 &self,
7322 name: impl Into<String>,
7323 value: impl Into<String>,
7324 description: impl Into<String>,
7325 ) -> Env {
7326 let mut query = self.selection.select("withStringInput");
7327 query = query.arg("name", name.into());
7328 query = query.arg("value", value.into());
7329 query = query.arg("description", description.into());
7330 Env {
7331 proc: self.proc.clone(),
7332 selection: query,
7333 graphql_client: self.graphql_client.clone(),
7334 }
7335 }
7336 pub fn with_string_output(
7343 &self,
7344 name: impl Into<String>,
7345 description: impl Into<String>,
7346 ) -> Env {
7347 let mut query = self.selection.select("withStringOutput");
7348 query = query.arg("name", name.into());
7349 query = query.arg("description", description.into());
7350 Env {
7351 proc: self.proc.clone(),
7352 selection: query,
7353 graphql_client: self.graphql_client.clone(),
7354 }
7355 }
7356 pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
7362 let mut query = self.selection.select("withWorkspace");
7363 query = query.arg_lazy(
7364 "workspace",
7365 Box::new(move || {
7366 let workspace = workspace.clone();
7367 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7368 }),
7369 );
7370 Env {
7371 proc: self.proc.clone(),
7372 selection: query,
7373 graphql_client: self.graphql_client.clone(),
7374 }
7375 }
7376 pub fn without_outputs(&self) -> Env {
7378 let query = self.selection.select("withoutOutputs");
7379 Env {
7380 proc: self.proc.clone(),
7381 selection: query,
7382 graphql_client: self.graphql_client.clone(),
7383 }
7384 }
7385 pub fn workspace(&self) -> Directory {
7386 let query = self.selection.select("workspace");
7387 Directory {
7388 proc: self.proc.clone(),
7389 selection: query,
7390 graphql_client: self.graphql_client.clone(),
7391 }
7392 }
7393}
7394#[derive(Clone)]
7395pub struct EnvFile {
7396 pub proc: Option<Arc<DaggerSessionProc>>,
7397 pub selection: Selection,
7398 pub graphql_client: DynGraphQLClient,
7399}
7400#[derive(Builder, Debug, PartialEq)]
7401pub struct EnvFileGetOpts {
7402 #[builder(setter(into, strip_option), default)]
7404 pub raw: Option<bool>,
7405}
7406#[derive(Builder, Debug, PartialEq)]
7407pub struct EnvFileVariablesOpts {
7408 #[builder(setter(into, strip_option), default)]
7410 pub raw: Option<bool>,
7411}
7412impl EnvFile {
7413 pub fn as_file(&self) -> File {
7415 let query = self.selection.select("asFile");
7416 File {
7417 proc: self.proc.clone(),
7418 selection: query,
7419 graphql_client: self.graphql_client.clone(),
7420 }
7421 }
7422 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7428 let mut query = self.selection.select("exists");
7429 query = query.arg("name", name.into());
7430 query.execute(self.graphql_client.clone()).await
7431 }
7432 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7439 let mut query = self.selection.select("get");
7440 query = query.arg("name", name.into());
7441 query.execute(self.graphql_client.clone()).await
7442 }
7443 pub async fn get_opts(
7450 &self,
7451 name: impl Into<String>,
7452 opts: EnvFileGetOpts,
7453 ) -> Result<String, DaggerError> {
7454 let mut query = self.selection.select("get");
7455 query = query.arg("name", name.into());
7456 if let Some(raw) = opts.raw {
7457 query = query.arg("raw", raw);
7458 }
7459 query.execute(self.graphql_client.clone()).await
7460 }
7461 pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7463 let query = self.selection.select("id");
7464 query.execute(self.graphql_client.clone()).await
7465 }
7466 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
7472 let mut query = self.selection.select("namespace");
7473 query = query.arg("prefix", prefix.into());
7474 EnvFile {
7475 proc: self.proc.clone(),
7476 selection: query,
7477 graphql_client: self.graphql_client.clone(),
7478 }
7479 }
7480 pub fn variables(&self) -> Vec<EnvVariable> {
7486 let query = self.selection.select("variables");
7487 vec![EnvVariable {
7488 proc: self.proc.clone(),
7489 selection: query,
7490 graphql_client: self.graphql_client.clone(),
7491 }]
7492 }
7493 pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
7499 let mut query = self.selection.select("variables");
7500 if let Some(raw) = opts.raw {
7501 query = query.arg("raw", raw);
7502 }
7503 vec![EnvVariable {
7504 proc: self.proc.clone(),
7505 selection: query,
7506 graphql_client: self.graphql_client.clone(),
7507 }]
7508 }
7509 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7516 let mut query = self.selection.select("withVariable");
7517 query = query.arg("name", name.into());
7518 query = query.arg("value", value.into());
7519 EnvFile {
7520 proc: self.proc.clone(),
7521 selection: query,
7522 graphql_client: self.graphql_client.clone(),
7523 }
7524 }
7525 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7531 let mut query = self.selection.select("withoutVariable");
7532 query = query.arg("name", name.into());
7533 EnvFile {
7534 proc: self.proc.clone(),
7535 selection: query,
7536 graphql_client: self.graphql_client.clone(),
7537 }
7538 }
7539}
7540#[derive(Clone)]
7541pub struct EnvVariable {
7542 pub proc: Option<Arc<DaggerSessionProc>>,
7543 pub selection: Selection,
7544 pub graphql_client: DynGraphQLClient,
7545}
7546impl EnvVariable {
7547 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
7549 let query = self.selection.select("id");
7550 query.execute(self.graphql_client.clone()).await
7551 }
7552 pub async fn name(&self) -> Result<String, DaggerError> {
7554 let query = self.selection.select("name");
7555 query.execute(self.graphql_client.clone()).await
7556 }
7557 pub async fn value(&self) -> Result<String, DaggerError> {
7559 let query = self.selection.select("value");
7560 query.execute(self.graphql_client.clone()).await
7561 }
7562}
7563#[derive(Clone)]
7564pub struct Error {
7565 pub proc: Option<Arc<DaggerSessionProc>>,
7566 pub selection: Selection,
7567 pub graphql_client: DynGraphQLClient,
7568}
7569impl Error {
7570 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
7572 let query = self.selection.select("id");
7573 query.execute(self.graphql_client.clone()).await
7574 }
7575 pub async fn message(&self) -> Result<String, DaggerError> {
7577 let query = self.selection.select("message");
7578 query.execute(self.graphql_client.clone()).await
7579 }
7580 pub fn values(&self) -> Vec<ErrorValue> {
7582 let query = self.selection.select("values");
7583 vec![ErrorValue {
7584 proc: self.proc.clone(),
7585 selection: query,
7586 graphql_client: self.graphql_client.clone(),
7587 }]
7588 }
7589 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7596 let mut query = self.selection.select("withValue");
7597 query = query.arg("name", name.into());
7598 query = query.arg("value", value);
7599 Error {
7600 proc: self.proc.clone(),
7601 selection: query,
7602 graphql_client: self.graphql_client.clone(),
7603 }
7604 }
7605}
7606#[derive(Clone)]
7607pub struct ErrorValue {
7608 pub proc: Option<Arc<DaggerSessionProc>>,
7609 pub selection: Selection,
7610 pub graphql_client: DynGraphQLClient,
7611}
7612impl ErrorValue {
7613 pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
7615 let query = self.selection.select("id");
7616 query.execute(self.graphql_client.clone()).await
7617 }
7618 pub async fn name(&self) -> Result<String, DaggerError> {
7620 let query = self.selection.select("name");
7621 query.execute(self.graphql_client.clone()).await
7622 }
7623 pub async fn value(&self) -> Result<Json, DaggerError> {
7625 let query = self.selection.select("value");
7626 query.execute(self.graphql_client.clone()).await
7627 }
7628}
7629#[derive(Clone)]
7630pub struct FieldTypeDef {
7631 pub proc: Option<Arc<DaggerSessionProc>>,
7632 pub selection: Selection,
7633 pub graphql_client: DynGraphQLClient,
7634}
7635impl FieldTypeDef {
7636 pub async fn deprecated(&self) -> Result<String, DaggerError> {
7638 let query = self.selection.select("deprecated");
7639 query.execute(self.graphql_client.clone()).await
7640 }
7641 pub async fn description(&self) -> Result<String, DaggerError> {
7643 let query = self.selection.select("description");
7644 query.execute(self.graphql_client.clone()).await
7645 }
7646 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
7648 let query = self.selection.select("id");
7649 query.execute(self.graphql_client.clone()).await
7650 }
7651 pub async fn name(&self) -> Result<String, DaggerError> {
7653 let query = self.selection.select("name");
7654 query.execute(self.graphql_client.clone()).await
7655 }
7656 pub fn source_map(&self) -> SourceMap {
7658 let query = self.selection.select("sourceMap");
7659 SourceMap {
7660 proc: self.proc.clone(),
7661 selection: query,
7662 graphql_client: self.graphql_client.clone(),
7663 }
7664 }
7665 pub fn type_def(&self) -> TypeDef {
7667 let query = self.selection.select("typeDef");
7668 TypeDef {
7669 proc: self.proc.clone(),
7670 selection: query,
7671 graphql_client: self.graphql_client.clone(),
7672 }
7673 }
7674}
7675#[derive(Clone)]
7676pub struct File {
7677 pub proc: Option<Arc<DaggerSessionProc>>,
7678 pub selection: Selection,
7679 pub graphql_client: DynGraphQLClient,
7680}
7681#[derive(Builder, Debug, PartialEq)]
7682pub struct FileAsEnvFileOpts {
7683 #[builder(setter(into, strip_option), default)]
7685 pub expand: Option<bool>,
7686}
7687#[derive(Builder, Debug, PartialEq)]
7688pub struct FileContentsOpts {
7689 #[builder(setter(into, strip_option), default)]
7691 pub limit_lines: Option<isize>,
7692 #[builder(setter(into, strip_option), default)]
7694 pub offset_lines: Option<isize>,
7695}
7696#[derive(Builder, Debug, PartialEq)]
7697pub struct FileDigestOpts {
7698 #[builder(setter(into, strip_option), default)]
7700 pub exclude_metadata: Option<bool>,
7701}
7702#[derive(Builder, Debug, PartialEq)]
7703pub struct FileExportOpts {
7704 #[builder(setter(into, strip_option), default)]
7706 pub allow_parent_dir_path: Option<bool>,
7707}
7708#[derive(Builder, Debug, PartialEq)]
7709pub struct FileSearchOpts<'a> {
7710 #[builder(setter(into, strip_option), default)]
7712 pub dotall: Option<bool>,
7713 #[builder(setter(into, strip_option), default)]
7715 pub files_only: Option<bool>,
7716 #[builder(setter(into, strip_option), default)]
7717 pub globs: Option<Vec<&'a str>>,
7718 #[builder(setter(into, strip_option), default)]
7720 pub insensitive: Option<bool>,
7721 #[builder(setter(into, strip_option), default)]
7723 pub limit: Option<isize>,
7724 #[builder(setter(into, strip_option), default)]
7726 pub literal: Option<bool>,
7727 #[builder(setter(into, strip_option), default)]
7729 pub multiline: Option<bool>,
7730 #[builder(setter(into, strip_option), default)]
7731 pub paths: Option<Vec<&'a str>>,
7732 #[builder(setter(into, strip_option), default)]
7734 pub skip_hidden: Option<bool>,
7735 #[builder(setter(into, strip_option), default)]
7737 pub skip_ignored: Option<bool>,
7738}
7739#[derive(Builder, Debug, PartialEq)]
7740pub struct FileWithReplacedOpts {
7741 #[builder(setter(into, strip_option), default)]
7743 pub all: Option<bool>,
7744 #[builder(setter(into, strip_option), default)]
7746 pub first_from: Option<isize>,
7747}
7748impl File {
7749 pub fn as_env_file(&self) -> EnvFile {
7755 let query = self.selection.select("asEnvFile");
7756 EnvFile {
7757 proc: self.proc.clone(),
7758 selection: query,
7759 graphql_client: self.graphql_client.clone(),
7760 }
7761 }
7762 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7768 let mut query = self.selection.select("asEnvFile");
7769 if let Some(expand) = opts.expand {
7770 query = query.arg("expand", expand);
7771 }
7772 EnvFile {
7773 proc: self.proc.clone(),
7774 selection: query,
7775 graphql_client: self.graphql_client.clone(),
7776 }
7777 }
7778 pub fn chown(&self, owner: impl Into<String>) -> File {
7788 let mut query = self.selection.select("chown");
7789 query = query.arg("owner", owner.into());
7790 File {
7791 proc: self.proc.clone(),
7792 selection: query,
7793 graphql_client: self.graphql_client.clone(),
7794 }
7795 }
7796 pub async fn contents(&self) -> Result<String, DaggerError> {
7802 let query = self.selection.select("contents");
7803 query.execute(self.graphql_client.clone()).await
7804 }
7805 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7811 let mut query = self.selection.select("contents");
7812 if let Some(offset_lines) = opts.offset_lines {
7813 query = query.arg("offsetLines", offset_lines);
7814 }
7815 if let Some(limit_lines) = opts.limit_lines {
7816 query = query.arg("limitLines", limit_lines);
7817 }
7818 query.execute(self.graphql_client.clone()).await
7819 }
7820 pub async fn digest(&self) -> Result<String, DaggerError> {
7826 let query = self.selection.select("digest");
7827 query.execute(self.graphql_client.clone()).await
7828 }
7829 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7835 let mut query = self.selection.select("digest");
7836 if let Some(exclude_metadata) = opts.exclude_metadata {
7837 query = query.arg("excludeMetadata", exclude_metadata);
7838 }
7839 query.execute(self.graphql_client.clone()).await
7840 }
7841 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7848 let mut query = self.selection.select("export");
7849 query = query.arg("path", path.into());
7850 query.execute(self.graphql_client.clone()).await
7851 }
7852 pub async fn export_opts(
7859 &self,
7860 path: impl Into<String>,
7861 opts: FileExportOpts,
7862 ) -> Result<String, DaggerError> {
7863 let mut query = self.selection.select("export");
7864 query = query.arg("path", path.into());
7865 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7866 query = query.arg("allowParentDirPath", allow_parent_dir_path);
7867 }
7868 query.execute(self.graphql_client.clone()).await
7869 }
7870 pub async fn id(&self) -> Result<FileId, DaggerError> {
7872 let query = self.selection.select("id");
7873 query.execute(self.graphql_client.clone()).await
7874 }
7875 pub async fn name(&self) -> Result<String, DaggerError> {
7877 let query = self.selection.select("name");
7878 query.execute(self.graphql_client.clone()).await
7879 }
7880 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7888 let mut query = self.selection.select("search");
7889 query = query.arg("pattern", pattern.into());
7890 vec![SearchResult {
7891 proc: self.proc.clone(),
7892 selection: query,
7893 graphql_client: self.graphql_client.clone(),
7894 }]
7895 }
7896 pub fn search_opts<'a>(
7904 &self,
7905 pattern: impl Into<String>,
7906 opts: FileSearchOpts<'a>,
7907 ) -> Vec<SearchResult> {
7908 let mut query = self.selection.select("search");
7909 query = query.arg("pattern", pattern.into());
7910 if let Some(literal) = opts.literal {
7911 query = query.arg("literal", literal);
7912 }
7913 if let Some(multiline) = opts.multiline {
7914 query = query.arg("multiline", multiline);
7915 }
7916 if let Some(dotall) = opts.dotall {
7917 query = query.arg("dotall", dotall);
7918 }
7919 if let Some(insensitive) = opts.insensitive {
7920 query = query.arg("insensitive", insensitive);
7921 }
7922 if let Some(skip_ignored) = opts.skip_ignored {
7923 query = query.arg("skipIgnored", skip_ignored);
7924 }
7925 if let Some(skip_hidden) = opts.skip_hidden {
7926 query = query.arg("skipHidden", skip_hidden);
7927 }
7928 if let Some(files_only) = opts.files_only {
7929 query = query.arg("filesOnly", files_only);
7930 }
7931 if let Some(limit) = opts.limit {
7932 query = query.arg("limit", limit);
7933 }
7934 if let Some(paths) = opts.paths {
7935 query = query.arg("paths", paths);
7936 }
7937 if let Some(globs) = opts.globs {
7938 query = query.arg("globs", globs);
7939 }
7940 vec![SearchResult {
7941 proc: self.proc.clone(),
7942 selection: query,
7943 graphql_client: self.graphql_client.clone(),
7944 }]
7945 }
7946 pub async fn size(&self) -> Result<isize, DaggerError> {
7948 let query = self.selection.select("size");
7949 query.execute(self.graphql_client.clone()).await
7950 }
7951 pub async fn sync(&self) -> Result<FileId, DaggerError> {
7953 let query = self.selection.select("sync");
7954 query.execute(self.graphql_client.clone()).await
7955 }
7956 pub fn with_name(&self, name: impl Into<String>) -> File {
7962 let mut query = self.selection.select("withName");
7963 query = query.arg("name", name.into());
7964 File {
7965 proc: self.proc.clone(),
7966 selection: query,
7967 graphql_client: self.graphql_client.clone(),
7968 }
7969 }
7970 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7982 let mut query = self.selection.select("withReplaced");
7983 query = query.arg("search", search.into());
7984 query = query.arg("replacement", replacement.into());
7985 File {
7986 proc: self.proc.clone(),
7987 selection: query,
7988 graphql_client: self.graphql_client.clone(),
7989 }
7990 }
7991 pub fn with_replaced_opts(
8003 &self,
8004 search: impl Into<String>,
8005 replacement: impl Into<String>,
8006 opts: FileWithReplacedOpts,
8007 ) -> File {
8008 let mut query = self.selection.select("withReplaced");
8009 query = query.arg("search", search.into());
8010 query = query.arg("replacement", replacement.into());
8011 if let Some(all) = opts.all {
8012 query = query.arg("all", all);
8013 }
8014 if let Some(first_from) = opts.first_from {
8015 query = query.arg("firstFrom", first_from);
8016 }
8017 File {
8018 proc: self.proc.clone(),
8019 selection: query,
8020 graphql_client: self.graphql_client.clone(),
8021 }
8022 }
8023 pub fn with_timestamps(&self, timestamp: isize) -> File {
8031 let mut query = self.selection.select("withTimestamps");
8032 query = query.arg("timestamp", timestamp);
8033 File {
8034 proc: self.proc.clone(),
8035 selection: query,
8036 graphql_client: self.graphql_client.clone(),
8037 }
8038 }
8039}
8040#[derive(Clone)]
8041pub struct Function {
8042 pub proc: Option<Arc<DaggerSessionProc>>,
8043 pub selection: Selection,
8044 pub graphql_client: DynGraphQLClient,
8045}
8046#[derive(Builder, Debug, PartialEq)]
8047pub struct FunctionWithArgOpts<'a> {
8048 #[builder(setter(into, strip_option), default)]
8050 pub default_path: Option<&'a str>,
8051 #[builder(setter(into, strip_option), default)]
8053 pub default_value: Option<Json>,
8054 #[builder(setter(into, strip_option), default)]
8056 pub deprecated: Option<&'a str>,
8057 #[builder(setter(into, strip_option), default)]
8059 pub description: Option<&'a str>,
8060 #[builder(setter(into, strip_option), default)]
8062 pub ignore: Option<Vec<&'a str>>,
8063 #[builder(setter(into, strip_option), default)]
8065 pub source_map: Option<SourceMapId>,
8066}
8067#[derive(Builder, Debug, PartialEq)]
8068pub struct FunctionWithCachePolicyOpts<'a> {
8069 #[builder(setter(into, strip_option), default)]
8071 pub time_to_live: Option<&'a str>,
8072}
8073#[derive(Builder, Debug, PartialEq)]
8074pub struct FunctionWithDeprecatedOpts<'a> {
8075 #[builder(setter(into, strip_option), default)]
8077 pub reason: Option<&'a str>,
8078}
8079impl Function {
8080 pub fn args(&self) -> Vec<FunctionArg> {
8082 let query = self.selection.select("args");
8083 vec![FunctionArg {
8084 proc: self.proc.clone(),
8085 selection: query,
8086 graphql_client: self.graphql_client.clone(),
8087 }]
8088 }
8089 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8091 let query = self.selection.select("deprecated");
8092 query.execute(self.graphql_client.clone()).await
8093 }
8094 pub async fn description(&self) -> Result<String, DaggerError> {
8096 let query = self.selection.select("description");
8097 query.execute(self.graphql_client.clone()).await
8098 }
8099 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
8101 let query = self.selection.select("id");
8102 query.execute(self.graphql_client.clone()).await
8103 }
8104 pub async fn name(&self) -> Result<String, DaggerError> {
8106 let query = self.selection.select("name");
8107 query.execute(self.graphql_client.clone()).await
8108 }
8109 pub fn return_type(&self) -> TypeDef {
8111 let query = self.selection.select("returnType");
8112 TypeDef {
8113 proc: self.proc.clone(),
8114 selection: query,
8115 graphql_client: self.graphql_client.clone(),
8116 }
8117 }
8118 pub fn source_map(&self) -> SourceMap {
8120 let query = self.selection.select("sourceMap");
8121 SourceMap {
8122 proc: self.proc.clone(),
8123 selection: query,
8124 graphql_client: self.graphql_client.clone(),
8125 }
8126 }
8127 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
8135 let mut query = self.selection.select("withArg");
8136 query = query.arg("name", name.into());
8137 query = query.arg_lazy(
8138 "typeDef",
8139 Box::new(move || {
8140 let type_def = type_def.clone();
8141 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8142 }),
8143 );
8144 Function {
8145 proc: self.proc.clone(),
8146 selection: query,
8147 graphql_client: self.graphql_client.clone(),
8148 }
8149 }
8150 pub fn with_arg_opts<'a>(
8158 &self,
8159 name: impl Into<String>,
8160 type_def: impl IntoID<TypeDefId>,
8161 opts: FunctionWithArgOpts<'a>,
8162 ) -> Function {
8163 let mut query = self.selection.select("withArg");
8164 query = query.arg("name", name.into());
8165 query = query.arg_lazy(
8166 "typeDef",
8167 Box::new(move || {
8168 let type_def = type_def.clone();
8169 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8170 }),
8171 );
8172 if let Some(description) = opts.description {
8173 query = query.arg("description", description);
8174 }
8175 if let Some(default_value) = opts.default_value {
8176 query = query.arg("defaultValue", default_value);
8177 }
8178 if let Some(default_path) = opts.default_path {
8179 query = query.arg("defaultPath", default_path);
8180 }
8181 if let Some(ignore) = opts.ignore {
8182 query = query.arg("ignore", ignore);
8183 }
8184 if let Some(source_map) = opts.source_map {
8185 query = query.arg("sourceMap", source_map);
8186 }
8187 if let Some(deprecated) = opts.deprecated {
8188 query = query.arg("deprecated", deprecated);
8189 }
8190 Function {
8191 proc: self.proc.clone(),
8192 selection: query,
8193 graphql_client: self.graphql_client.clone(),
8194 }
8195 }
8196 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
8203 let mut query = self.selection.select("withCachePolicy");
8204 query = query.arg("policy", policy);
8205 Function {
8206 proc: self.proc.clone(),
8207 selection: query,
8208 graphql_client: self.graphql_client.clone(),
8209 }
8210 }
8211 pub fn with_cache_policy_opts<'a>(
8218 &self,
8219 policy: FunctionCachePolicy,
8220 opts: FunctionWithCachePolicyOpts<'a>,
8221 ) -> Function {
8222 let mut query = self.selection.select("withCachePolicy");
8223 query = query.arg("policy", policy);
8224 if let Some(time_to_live) = opts.time_to_live {
8225 query = query.arg("timeToLive", time_to_live);
8226 }
8227 Function {
8228 proc: self.proc.clone(),
8229 selection: query,
8230 graphql_client: self.graphql_client.clone(),
8231 }
8232 }
8233 pub fn with_deprecated(&self) -> Function {
8239 let query = self.selection.select("withDeprecated");
8240 Function {
8241 proc: self.proc.clone(),
8242 selection: query,
8243 graphql_client: self.graphql_client.clone(),
8244 }
8245 }
8246 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
8252 let mut query = self.selection.select("withDeprecated");
8253 if let Some(reason) = opts.reason {
8254 query = query.arg("reason", reason);
8255 }
8256 Function {
8257 proc: self.proc.clone(),
8258 selection: query,
8259 graphql_client: self.graphql_client.clone(),
8260 }
8261 }
8262 pub fn with_description(&self, description: impl Into<String>) -> Function {
8268 let mut query = self.selection.select("withDescription");
8269 query = query.arg("description", description.into());
8270 Function {
8271 proc: self.proc.clone(),
8272 selection: query,
8273 graphql_client: self.graphql_client.clone(),
8274 }
8275 }
8276 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
8282 let mut query = self.selection.select("withSourceMap");
8283 query = query.arg_lazy(
8284 "sourceMap",
8285 Box::new(move || {
8286 let source_map = source_map.clone();
8287 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8288 }),
8289 );
8290 Function {
8291 proc: self.proc.clone(),
8292 selection: query,
8293 graphql_client: self.graphql_client.clone(),
8294 }
8295 }
8296}
8297#[derive(Clone)]
8298pub struct FunctionArg {
8299 pub proc: Option<Arc<DaggerSessionProc>>,
8300 pub selection: Selection,
8301 pub graphql_client: DynGraphQLClient,
8302}
8303impl FunctionArg {
8304 pub async fn default_path(&self) -> Result<String, DaggerError> {
8306 let query = self.selection.select("defaultPath");
8307 query.execute(self.graphql_client.clone()).await
8308 }
8309 pub async fn default_value(&self) -> Result<Json, DaggerError> {
8311 let query = self.selection.select("defaultValue");
8312 query.execute(self.graphql_client.clone()).await
8313 }
8314 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8316 let query = self.selection.select("deprecated");
8317 query.execute(self.graphql_client.clone()).await
8318 }
8319 pub async fn description(&self) -> Result<String, DaggerError> {
8321 let query = self.selection.select("description");
8322 query.execute(self.graphql_client.clone()).await
8323 }
8324 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
8326 let query = self.selection.select("id");
8327 query.execute(self.graphql_client.clone()).await
8328 }
8329 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8331 let query = self.selection.select("ignore");
8332 query.execute(self.graphql_client.clone()).await
8333 }
8334 pub async fn name(&self) -> Result<String, DaggerError> {
8336 let query = self.selection.select("name");
8337 query.execute(self.graphql_client.clone()).await
8338 }
8339 pub fn source_map(&self) -> SourceMap {
8341 let query = self.selection.select("sourceMap");
8342 SourceMap {
8343 proc: self.proc.clone(),
8344 selection: query,
8345 graphql_client: self.graphql_client.clone(),
8346 }
8347 }
8348 pub fn type_def(&self) -> TypeDef {
8350 let query = self.selection.select("typeDef");
8351 TypeDef {
8352 proc: self.proc.clone(),
8353 selection: query,
8354 graphql_client: self.graphql_client.clone(),
8355 }
8356 }
8357}
8358#[derive(Clone)]
8359pub struct FunctionCall {
8360 pub proc: Option<Arc<DaggerSessionProc>>,
8361 pub selection: Selection,
8362 pub graphql_client: DynGraphQLClient,
8363}
8364impl FunctionCall {
8365 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
8367 let query = self.selection.select("id");
8368 query.execute(self.graphql_client.clone()).await
8369 }
8370 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
8372 let query = self.selection.select("inputArgs");
8373 vec![FunctionCallArgValue {
8374 proc: self.proc.clone(),
8375 selection: query,
8376 graphql_client: self.graphql_client.clone(),
8377 }]
8378 }
8379 pub async fn name(&self) -> Result<String, DaggerError> {
8381 let query = self.selection.select("name");
8382 query.execute(self.graphql_client.clone()).await
8383 }
8384 pub async fn parent(&self) -> Result<Json, DaggerError> {
8386 let query = self.selection.select("parent");
8387 query.execute(self.graphql_client.clone()).await
8388 }
8389 pub async fn parent_name(&self) -> Result<String, DaggerError> {
8391 let query = self.selection.select("parentName");
8392 query.execute(self.graphql_client.clone()).await
8393 }
8394 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
8400 let mut query = self.selection.select("returnError");
8401 query = query.arg_lazy(
8402 "error",
8403 Box::new(move || {
8404 let error = error.clone();
8405 Box::pin(async move { error.into_id().await.unwrap().quote() })
8406 }),
8407 );
8408 query.execute(self.graphql_client.clone()).await
8409 }
8410 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8416 let mut query = self.selection.select("returnValue");
8417 query = query.arg("value", value);
8418 query.execute(self.graphql_client.clone()).await
8419 }
8420}
8421#[derive(Clone)]
8422pub struct FunctionCallArgValue {
8423 pub proc: Option<Arc<DaggerSessionProc>>,
8424 pub selection: Selection,
8425 pub graphql_client: DynGraphQLClient,
8426}
8427impl FunctionCallArgValue {
8428 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8430 let query = self.selection.select("id");
8431 query.execute(self.graphql_client.clone()).await
8432 }
8433 pub async fn name(&self) -> Result<String, DaggerError> {
8435 let query = self.selection.select("name");
8436 query.execute(self.graphql_client.clone()).await
8437 }
8438 pub async fn value(&self) -> Result<Json, DaggerError> {
8440 let query = self.selection.select("value");
8441 query.execute(self.graphql_client.clone()).await
8442 }
8443}
8444#[derive(Clone)]
8445pub struct GeneratedCode {
8446 pub proc: Option<Arc<DaggerSessionProc>>,
8447 pub selection: Selection,
8448 pub graphql_client: DynGraphQLClient,
8449}
8450impl GeneratedCode {
8451 pub fn code(&self) -> Directory {
8453 let query = self.selection.select("code");
8454 Directory {
8455 proc: self.proc.clone(),
8456 selection: query,
8457 graphql_client: self.graphql_client.clone(),
8458 }
8459 }
8460 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8462 let query = self.selection.select("id");
8463 query.execute(self.graphql_client.clone()).await
8464 }
8465 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8467 let query = self.selection.select("vcsGeneratedPaths");
8468 query.execute(self.graphql_client.clone()).await
8469 }
8470 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8472 let query = self.selection.select("vcsIgnoredPaths");
8473 query.execute(self.graphql_client.clone()).await
8474 }
8475 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8477 let mut query = self.selection.select("withVCSGeneratedPaths");
8478 query = query.arg(
8479 "paths",
8480 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8481 );
8482 GeneratedCode {
8483 proc: self.proc.clone(),
8484 selection: query,
8485 graphql_client: self.graphql_client.clone(),
8486 }
8487 }
8488 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8490 let mut query = self.selection.select("withVCSIgnoredPaths");
8491 query = query.arg(
8492 "paths",
8493 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8494 );
8495 GeneratedCode {
8496 proc: self.proc.clone(),
8497 selection: query,
8498 graphql_client: self.graphql_client.clone(),
8499 }
8500 }
8501}
8502#[derive(Clone)]
8503pub struct GitRef {
8504 pub proc: Option<Arc<DaggerSessionProc>>,
8505 pub selection: Selection,
8506 pub graphql_client: DynGraphQLClient,
8507}
8508#[derive(Builder, Debug, PartialEq)]
8509pub struct GitRefTreeOpts {
8510 #[builder(setter(into, strip_option), default)]
8512 pub depth: Option<isize>,
8513 #[builder(setter(into, strip_option), default)]
8515 pub discard_git_dir: Option<bool>,
8516}
8517impl GitRef {
8518 pub async fn commit(&self) -> Result<String, DaggerError> {
8520 let query = self.selection.select("commit");
8521 query.execute(self.graphql_client.clone()).await
8522 }
8523 pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
8529 let mut query = self.selection.select("commonAncestor");
8530 query = query.arg_lazy(
8531 "other",
8532 Box::new(move || {
8533 let other = other.clone();
8534 Box::pin(async move { other.into_id().await.unwrap().quote() })
8535 }),
8536 );
8537 GitRef {
8538 proc: self.proc.clone(),
8539 selection: query,
8540 graphql_client: self.graphql_client.clone(),
8541 }
8542 }
8543 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
8545 let query = self.selection.select("id");
8546 query.execute(self.graphql_client.clone()).await
8547 }
8548 pub async fn r#ref(&self) -> Result<String, DaggerError> {
8550 let query = self.selection.select("ref");
8551 query.execute(self.graphql_client.clone()).await
8552 }
8553 pub fn tree(&self) -> Directory {
8559 let query = self.selection.select("tree");
8560 Directory {
8561 proc: self.proc.clone(),
8562 selection: query,
8563 graphql_client: self.graphql_client.clone(),
8564 }
8565 }
8566 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
8572 let mut query = self.selection.select("tree");
8573 if let Some(discard_git_dir) = opts.discard_git_dir {
8574 query = query.arg("discardGitDir", discard_git_dir);
8575 }
8576 if let Some(depth) = opts.depth {
8577 query = query.arg("depth", depth);
8578 }
8579 Directory {
8580 proc: self.proc.clone(),
8581 selection: query,
8582 graphql_client: self.graphql_client.clone(),
8583 }
8584 }
8585}
8586#[derive(Clone)]
8587pub struct GitRepository {
8588 pub proc: Option<Arc<DaggerSessionProc>>,
8589 pub selection: Selection,
8590 pub graphql_client: DynGraphQLClient,
8591}
8592#[derive(Builder, Debug, PartialEq)]
8593pub struct GitRepositoryBranchesOpts<'a> {
8594 #[builder(setter(into, strip_option), default)]
8596 pub patterns: Option<Vec<&'a str>>,
8597}
8598#[derive(Builder, Debug, PartialEq)]
8599pub struct GitRepositoryTagsOpts<'a> {
8600 #[builder(setter(into, strip_option), default)]
8602 pub patterns: Option<Vec<&'a str>>,
8603}
8604impl GitRepository {
8605 pub fn branch(&self, name: impl Into<String>) -> GitRef {
8611 let mut query = self.selection.select("branch");
8612 query = query.arg("name", name.into());
8613 GitRef {
8614 proc: self.proc.clone(),
8615 selection: query,
8616 graphql_client: self.graphql_client.clone(),
8617 }
8618 }
8619 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
8625 let query = self.selection.select("branches");
8626 query.execute(self.graphql_client.clone()).await
8627 }
8628 pub async fn branches_opts<'a>(
8634 &self,
8635 opts: GitRepositoryBranchesOpts<'a>,
8636 ) -> Result<Vec<String>, DaggerError> {
8637 let mut query = self.selection.select("branches");
8638 if let Some(patterns) = opts.patterns {
8639 query = query.arg("patterns", patterns);
8640 }
8641 query.execute(self.graphql_client.clone()).await
8642 }
8643 pub fn commit(&self, id: impl Into<String>) -> GitRef {
8649 let mut query = self.selection.select("commit");
8650 query = query.arg("id", id.into());
8651 GitRef {
8652 proc: self.proc.clone(),
8653 selection: query,
8654 graphql_client: self.graphql_client.clone(),
8655 }
8656 }
8657 pub fn head(&self) -> GitRef {
8659 let query = self.selection.select("head");
8660 GitRef {
8661 proc: self.proc.clone(),
8662 selection: query,
8663 graphql_client: self.graphql_client.clone(),
8664 }
8665 }
8666 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
8668 let query = self.selection.select("id");
8669 query.execute(self.graphql_client.clone()).await
8670 }
8671 pub fn latest_version(&self) -> GitRef {
8673 let query = self.selection.select("latestVersion");
8674 GitRef {
8675 proc: self.proc.clone(),
8676 selection: query,
8677 graphql_client: self.graphql_client.clone(),
8678 }
8679 }
8680 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
8686 let mut query = self.selection.select("ref");
8687 query = query.arg("name", name.into());
8688 GitRef {
8689 proc: self.proc.clone(),
8690 selection: query,
8691 graphql_client: self.graphql_client.clone(),
8692 }
8693 }
8694 pub fn tag(&self, name: impl Into<String>) -> GitRef {
8700 let mut query = self.selection.select("tag");
8701 query = query.arg("name", name.into());
8702 GitRef {
8703 proc: self.proc.clone(),
8704 selection: query,
8705 graphql_client: self.graphql_client.clone(),
8706 }
8707 }
8708 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
8714 let query = self.selection.select("tags");
8715 query.execute(self.graphql_client.clone()).await
8716 }
8717 pub async fn tags_opts<'a>(
8723 &self,
8724 opts: GitRepositoryTagsOpts<'a>,
8725 ) -> Result<Vec<String>, DaggerError> {
8726 let mut query = self.selection.select("tags");
8727 if let Some(patterns) = opts.patterns {
8728 query = query.arg("patterns", patterns);
8729 }
8730 query.execute(self.graphql_client.clone()).await
8731 }
8732 pub fn uncommitted(&self) -> Changeset {
8734 let query = self.selection.select("uncommitted");
8735 Changeset {
8736 proc: self.proc.clone(),
8737 selection: query,
8738 graphql_client: self.graphql_client.clone(),
8739 }
8740 }
8741 pub async fn url(&self) -> Result<String, DaggerError> {
8743 let query = self.selection.select("url");
8744 query.execute(self.graphql_client.clone()).await
8745 }
8746}
8747#[derive(Clone)]
8748pub struct Host {
8749 pub proc: Option<Arc<DaggerSessionProc>>,
8750 pub selection: Selection,
8751 pub graphql_client: DynGraphQLClient,
8752}
8753#[derive(Builder, Debug, PartialEq)]
8754pub struct HostDirectoryOpts<'a> {
8755 #[builder(setter(into, strip_option), default)]
8757 pub exclude: Option<Vec<&'a str>>,
8758 #[builder(setter(into, strip_option), default)]
8760 pub gitignore: Option<bool>,
8761 #[builder(setter(into, strip_option), default)]
8763 pub include: Option<Vec<&'a str>>,
8764 #[builder(setter(into, strip_option), default)]
8766 pub no_cache: Option<bool>,
8767}
8768#[derive(Builder, Debug, PartialEq)]
8769pub struct HostFileOpts {
8770 #[builder(setter(into, strip_option), default)]
8772 pub no_cache: Option<bool>,
8773}
8774#[derive(Builder, Debug, PartialEq)]
8775pub struct HostFindUpOpts {
8776 #[builder(setter(into, strip_option), default)]
8777 pub no_cache: Option<bool>,
8778}
8779#[derive(Builder, Debug, PartialEq)]
8780pub struct HostServiceOpts<'a> {
8781 #[builder(setter(into, strip_option), default)]
8783 pub host: Option<&'a str>,
8784}
8785#[derive(Builder, Debug, PartialEq)]
8786pub struct HostTunnelOpts {
8787 #[builder(setter(into, strip_option), default)]
8790 pub native: Option<bool>,
8791 #[builder(setter(into, strip_option), default)]
8796 pub ports: Option<Vec<PortForward>>,
8797}
8798impl Host {
8799 pub fn container_image(&self, name: impl Into<String>) -> Container {
8805 let mut query = self.selection.select("containerImage");
8806 query = query.arg("name", name.into());
8807 Container {
8808 proc: self.proc.clone(),
8809 selection: query,
8810 graphql_client: self.graphql_client.clone(),
8811 }
8812 }
8813 pub fn directory(&self, path: impl Into<String>) -> Directory {
8820 let mut query = self.selection.select("directory");
8821 query = query.arg("path", path.into());
8822 Directory {
8823 proc: self.proc.clone(),
8824 selection: query,
8825 graphql_client: self.graphql_client.clone(),
8826 }
8827 }
8828 pub fn directory_opts<'a>(
8835 &self,
8836 path: impl Into<String>,
8837 opts: HostDirectoryOpts<'a>,
8838 ) -> Directory {
8839 let mut query = self.selection.select("directory");
8840 query = query.arg("path", path.into());
8841 if let Some(exclude) = opts.exclude {
8842 query = query.arg("exclude", exclude);
8843 }
8844 if let Some(include) = opts.include {
8845 query = query.arg("include", include);
8846 }
8847 if let Some(no_cache) = opts.no_cache {
8848 query = query.arg("noCache", no_cache);
8849 }
8850 if let Some(gitignore) = opts.gitignore {
8851 query = query.arg("gitignore", gitignore);
8852 }
8853 Directory {
8854 proc: self.proc.clone(),
8855 selection: query,
8856 graphql_client: self.graphql_client.clone(),
8857 }
8858 }
8859 pub fn file(&self, path: impl Into<String>) -> File {
8866 let mut query = self.selection.select("file");
8867 query = query.arg("path", path.into());
8868 File {
8869 proc: self.proc.clone(),
8870 selection: query,
8871 graphql_client: self.graphql_client.clone(),
8872 }
8873 }
8874 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
8881 let mut query = self.selection.select("file");
8882 query = query.arg("path", path.into());
8883 if let Some(no_cache) = opts.no_cache {
8884 query = query.arg("noCache", no_cache);
8885 }
8886 File {
8887 proc: self.proc.clone(),
8888 selection: query,
8889 graphql_client: self.graphql_client.clone(),
8890 }
8891 }
8892 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8899 let mut query = self.selection.select("findUp");
8900 query = query.arg("name", name.into());
8901 query.execute(self.graphql_client.clone()).await
8902 }
8903 pub async fn find_up_opts(
8910 &self,
8911 name: impl Into<String>,
8912 opts: HostFindUpOpts,
8913 ) -> Result<String, DaggerError> {
8914 let mut query = self.selection.select("findUp");
8915 query = query.arg("name", name.into());
8916 if let Some(no_cache) = opts.no_cache {
8917 query = query.arg("noCache", no_cache);
8918 }
8919 query.execute(self.graphql_client.clone()).await
8920 }
8921 pub async fn id(&self) -> Result<HostId, DaggerError> {
8923 let query = self.selection.select("id");
8924 query.execute(self.graphql_client.clone()).await
8925 }
8926 pub fn service(&self, ports: Vec<PortForward>) -> Service {
8937 let mut query = self.selection.select("service");
8938 query = query.arg("ports", ports);
8939 Service {
8940 proc: self.proc.clone(),
8941 selection: query,
8942 graphql_client: self.graphql_client.clone(),
8943 }
8944 }
8945 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8956 let mut query = self.selection.select("service");
8957 query = query.arg("ports", ports);
8958 if let Some(host) = opts.host {
8959 query = query.arg("host", host);
8960 }
8961 Service {
8962 proc: self.proc.clone(),
8963 selection: query,
8964 graphql_client: self.graphql_client.clone(),
8965 }
8966 }
8967 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8974 let mut query = self.selection.select("tunnel");
8975 query = query.arg_lazy(
8976 "service",
8977 Box::new(move || {
8978 let service = service.clone();
8979 Box::pin(async move { service.into_id().await.unwrap().quote() })
8980 }),
8981 );
8982 Service {
8983 proc: self.proc.clone(),
8984 selection: query,
8985 graphql_client: self.graphql_client.clone(),
8986 }
8987 }
8988 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8995 let mut query = self.selection.select("tunnel");
8996 query = query.arg_lazy(
8997 "service",
8998 Box::new(move || {
8999 let service = service.clone();
9000 Box::pin(async move { service.into_id().await.unwrap().quote() })
9001 }),
9002 );
9003 if let Some(native) = opts.native {
9004 query = query.arg("native", native);
9005 }
9006 if let Some(ports) = opts.ports {
9007 query = query.arg("ports", ports);
9008 }
9009 Service {
9010 proc: self.proc.clone(),
9011 selection: query,
9012 graphql_client: self.graphql_client.clone(),
9013 }
9014 }
9015 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
9021 let mut query = self.selection.select("unixSocket");
9022 query = query.arg("path", path.into());
9023 Socket {
9024 proc: self.proc.clone(),
9025 selection: query,
9026 graphql_client: self.graphql_client.clone(),
9027 }
9028 }
9029}
9030#[derive(Clone)]
9031pub struct InputTypeDef {
9032 pub proc: Option<Arc<DaggerSessionProc>>,
9033 pub selection: Selection,
9034 pub graphql_client: DynGraphQLClient,
9035}
9036impl InputTypeDef {
9037 pub fn fields(&self) -> Vec<FieldTypeDef> {
9039 let query = self.selection.select("fields");
9040 vec![FieldTypeDef {
9041 proc: self.proc.clone(),
9042 selection: query,
9043 graphql_client: self.graphql_client.clone(),
9044 }]
9045 }
9046 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
9048 let query = self.selection.select("id");
9049 query.execute(self.graphql_client.clone()).await
9050 }
9051 pub async fn name(&self) -> Result<String, DaggerError> {
9053 let query = self.selection.select("name");
9054 query.execute(self.graphql_client.clone()).await
9055 }
9056}
9057#[derive(Clone)]
9058pub struct InterfaceTypeDef {
9059 pub proc: Option<Arc<DaggerSessionProc>>,
9060 pub selection: Selection,
9061 pub graphql_client: DynGraphQLClient,
9062}
9063impl InterfaceTypeDef {
9064 pub async fn description(&self) -> Result<String, DaggerError> {
9066 let query = self.selection.select("description");
9067 query.execute(self.graphql_client.clone()).await
9068 }
9069 pub fn functions(&self) -> Vec<Function> {
9071 let query = self.selection.select("functions");
9072 vec![Function {
9073 proc: self.proc.clone(),
9074 selection: query,
9075 graphql_client: self.graphql_client.clone(),
9076 }]
9077 }
9078 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
9080 let query = self.selection.select("id");
9081 query.execute(self.graphql_client.clone()).await
9082 }
9083 pub async fn name(&self) -> Result<String, DaggerError> {
9085 let query = self.selection.select("name");
9086 query.execute(self.graphql_client.clone()).await
9087 }
9088 pub fn source_map(&self) -> SourceMap {
9090 let query = self.selection.select("sourceMap");
9091 SourceMap {
9092 proc: self.proc.clone(),
9093 selection: query,
9094 graphql_client: self.graphql_client.clone(),
9095 }
9096 }
9097 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9099 let query = self.selection.select("sourceModuleName");
9100 query.execute(self.graphql_client.clone()).await
9101 }
9102}
9103#[derive(Clone)]
9104pub struct JsonValue {
9105 pub proc: Option<Arc<DaggerSessionProc>>,
9106 pub selection: Selection,
9107 pub graphql_client: DynGraphQLClient,
9108}
9109#[derive(Builder, Debug, PartialEq)]
9110pub struct JsonValueContentsOpts<'a> {
9111 #[builder(setter(into, strip_option), default)]
9113 pub indent: Option<&'a str>,
9114 #[builder(setter(into, strip_option), default)]
9116 pub pretty: Option<bool>,
9117}
9118impl JsonValue {
9119 pub fn as_array(&self) -> Vec<JsonValue> {
9121 let query = self.selection.select("asArray");
9122 vec![JsonValue {
9123 proc: self.proc.clone(),
9124 selection: query,
9125 graphql_client: self.graphql_client.clone(),
9126 }]
9127 }
9128 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
9130 let query = self.selection.select("asBoolean");
9131 query.execute(self.graphql_client.clone()).await
9132 }
9133 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
9135 let query = self.selection.select("asInteger");
9136 query.execute(self.graphql_client.clone()).await
9137 }
9138 pub async fn as_string(&self) -> Result<String, DaggerError> {
9140 let query = self.selection.select("asString");
9141 query.execute(self.graphql_client.clone()).await
9142 }
9143 pub async fn contents(&self) -> Result<Json, DaggerError> {
9149 let query = self.selection.select("contents");
9150 query.execute(self.graphql_client.clone()).await
9151 }
9152 pub async fn contents_opts<'a>(
9158 &self,
9159 opts: JsonValueContentsOpts<'a>,
9160 ) -> Result<Json, DaggerError> {
9161 let mut query = self.selection.select("contents");
9162 if let Some(pretty) = opts.pretty {
9163 query = query.arg("pretty", pretty);
9164 }
9165 if let Some(indent) = opts.indent {
9166 query = query.arg("indent", indent);
9167 }
9168 query.execute(self.graphql_client.clone()).await
9169 }
9170 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
9176 let mut query = self.selection.select("field");
9177 query = query.arg(
9178 "path",
9179 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9180 );
9181 JsonValue {
9182 proc: self.proc.clone(),
9183 selection: query,
9184 graphql_client: self.graphql_client.clone(),
9185 }
9186 }
9187 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
9189 let query = self.selection.select("fields");
9190 query.execute(self.graphql_client.clone()).await
9191 }
9192 pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
9194 let query = self.selection.select("id");
9195 query.execute(self.graphql_client.clone()).await
9196 }
9197 pub fn new_boolean(&self, value: bool) -> JsonValue {
9203 let mut query = self.selection.select("newBoolean");
9204 query = query.arg("value", value);
9205 JsonValue {
9206 proc: self.proc.clone(),
9207 selection: query,
9208 graphql_client: self.graphql_client.clone(),
9209 }
9210 }
9211 pub fn new_integer(&self, value: isize) -> JsonValue {
9217 let mut query = self.selection.select("newInteger");
9218 query = query.arg("value", value);
9219 JsonValue {
9220 proc: self.proc.clone(),
9221 selection: query,
9222 graphql_client: self.graphql_client.clone(),
9223 }
9224 }
9225 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
9231 let mut query = self.selection.select("newString");
9232 query = query.arg("value", value.into());
9233 JsonValue {
9234 proc: self.proc.clone(),
9235 selection: query,
9236 graphql_client: self.graphql_client.clone(),
9237 }
9238 }
9239 pub fn with_contents(&self, contents: Json) -> JsonValue {
9245 let mut query = self.selection.select("withContents");
9246 query = query.arg("contents", contents);
9247 JsonValue {
9248 proc: self.proc.clone(),
9249 selection: query,
9250 graphql_client: self.graphql_client.clone(),
9251 }
9252 }
9253 pub fn with_field(
9260 &self,
9261 path: Vec<impl Into<String>>,
9262 value: impl IntoID<JsonValueId>,
9263 ) -> JsonValue {
9264 let mut query = self.selection.select("withField");
9265 query = query.arg(
9266 "path",
9267 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9268 );
9269 query = query.arg_lazy(
9270 "value",
9271 Box::new(move || {
9272 let value = value.clone();
9273 Box::pin(async move { value.into_id().await.unwrap().quote() })
9274 }),
9275 );
9276 JsonValue {
9277 proc: self.proc.clone(),
9278 selection: query,
9279 graphql_client: self.graphql_client.clone(),
9280 }
9281 }
9282}
9283#[derive(Clone)]
9284pub struct Llm {
9285 pub proc: Option<Arc<DaggerSessionProc>>,
9286 pub selection: Selection,
9287 pub graphql_client: DynGraphQLClient,
9288}
9289impl Llm {
9290 pub fn attempt(&self, number: isize) -> Llm {
9292 let mut query = self.selection.select("attempt");
9293 query = query.arg("number", number);
9294 Llm {
9295 proc: self.proc.clone(),
9296 selection: query,
9297 graphql_client: self.graphql_client.clone(),
9298 }
9299 }
9300 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
9302 let mut query = self.selection.select("bindResult");
9303 query = query.arg("name", name.into());
9304 Binding {
9305 proc: self.proc.clone(),
9306 selection: query,
9307 graphql_client: self.graphql_client.clone(),
9308 }
9309 }
9310 pub fn env(&self) -> Env {
9312 let query = self.selection.select("env");
9313 Env {
9314 proc: self.proc.clone(),
9315 selection: query,
9316 graphql_client: self.graphql_client.clone(),
9317 }
9318 }
9319 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
9321 let query = self.selection.select("hasPrompt");
9322 query.execute(self.graphql_client.clone()).await
9323 }
9324 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
9326 let query = self.selection.select("history");
9327 query.execute(self.graphql_client.clone()).await
9328 }
9329 pub async fn history_json(&self) -> Result<Json, DaggerError> {
9331 let query = self.selection.select("historyJSON");
9332 query.execute(self.graphql_client.clone()).await
9333 }
9334 pub async fn id(&self) -> Result<Llmid, DaggerError> {
9336 let query = self.selection.select("id");
9337 query.execute(self.graphql_client.clone()).await
9338 }
9339 pub async fn last_reply(&self) -> Result<String, DaggerError> {
9341 let query = self.selection.select("lastReply");
9342 query.execute(self.graphql_client.clone()).await
9343 }
9344 pub fn r#loop(&self) -> Llm {
9346 let query = self.selection.select("loop");
9347 Llm {
9348 proc: self.proc.clone(),
9349 selection: query,
9350 graphql_client: self.graphql_client.clone(),
9351 }
9352 }
9353 pub async fn model(&self) -> Result<String, DaggerError> {
9355 let query = self.selection.select("model");
9356 query.execute(self.graphql_client.clone()).await
9357 }
9358 pub async fn provider(&self) -> Result<String, DaggerError> {
9360 let query = self.selection.select("provider");
9361 query.execute(self.graphql_client.clone()).await
9362 }
9363 pub async fn step(&self) -> Result<Llmid, DaggerError> {
9365 let query = self.selection.select("step");
9366 query.execute(self.graphql_client.clone()).await
9367 }
9368 pub async fn sync(&self) -> Result<Llmid, DaggerError> {
9370 let query = self.selection.select("sync");
9371 query.execute(self.graphql_client.clone()).await
9372 }
9373 pub fn token_usage(&self) -> LlmTokenUsage {
9375 let query = self.selection.select("tokenUsage");
9376 LlmTokenUsage {
9377 proc: self.proc.clone(),
9378 selection: query,
9379 graphql_client: self.graphql_client.clone(),
9380 }
9381 }
9382 pub async fn tools(&self) -> Result<String, DaggerError> {
9384 let query = self.selection.select("tools");
9385 query.execute(self.graphql_client.clone()).await
9386 }
9387 pub fn with_blocked_function(
9396 &self,
9397 type_name: impl Into<String>,
9398 function: impl Into<String>,
9399 ) -> Llm {
9400 let mut query = self.selection.select("withBlockedFunction");
9401 query = query.arg("typeName", type_name.into());
9402 query = query.arg("function", function.into());
9403 Llm {
9404 proc: self.proc.clone(),
9405 selection: query,
9406 graphql_client: self.graphql_client.clone(),
9407 }
9408 }
9409 pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
9411 let mut query = self.selection.select("withEnv");
9412 query = query.arg_lazy(
9413 "env",
9414 Box::new(move || {
9415 let env = env.clone();
9416 Box::pin(async move { env.into_id().await.unwrap().quote() })
9417 }),
9418 );
9419 Llm {
9420 proc: self.proc.clone(),
9421 selection: query,
9422 graphql_client: self.graphql_client.clone(),
9423 }
9424 }
9425 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
9432 let mut query = self.selection.select("withMCPServer");
9433 query = query.arg("name", name.into());
9434 query = query.arg_lazy(
9435 "service",
9436 Box::new(move || {
9437 let service = service.clone();
9438 Box::pin(async move { service.into_id().await.unwrap().quote() })
9439 }),
9440 );
9441 Llm {
9442 proc: self.proc.clone(),
9443 selection: query,
9444 graphql_client: self.graphql_client.clone(),
9445 }
9446 }
9447 pub fn with_model(&self, model: impl Into<String>) -> Llm {
9453 let mut query = self.selection.select("withModel");
9454 query = query.arg("model", model.into());
9455 Llm {
9456 proc: self.proc.clone(),
9457 selection: query,
9458 graphql_client: self.graphql_client.clone(),
9459 }
9460 }
9461 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9467 let mut query = self.selection.select("withPrompt");
9468 query = query.arg("prompt", prompt.into());
9469 Llm {
9470 proc: self.proc.clone(),
9471 selection: query,
9472 graphql_client: self.graphql_client.clone(),
9473 }
9474 }
9475 pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9481 let mut query = self.selection.select("withPromptFile");
9482 query = query.arg_lazy(
9483 "file",
9484 Box::new(move || {
9485 let file = file.clone();
9486 Box::pin(async move { file.into_id().await.unwrap().quote() })
9487 }),
9488 );
9489 Llm {
9490 proc: self.proc.clone(),
9491 selection: query,
9492 graphql_client: self.graphql_client.clone(),
9493 }
9494 }
9495 pub fn with_static_tools(&self) -> Llm {
9497 let query = self.selection.select("withStaticTools");
9498 Llm {
9499 proc: self.proc.clone(),
9500 selection: query,
9501 graphql_client: self.graphql_client.clone(),
9502 }
9503 }
9504 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
9510 let mut query = self.selection.select("withSystemPrompt");
9511 query = query.arg("prompt", prompt.into());
9512 Llm {
9513 proc: self.proc.clone(),
9514 selection: query,
9515 graphql_client: self.graphql_client.clone(),
9516 }
9517 }
9518 pub fn without_default_system_prompt(&self) -> Llm {
9520 let query = self.selection.select("withoutDefaultSystemPrompt");
9521 Llm {
9522 proc: self.proc.clone(),
9523 selection: query,
9524 graphql_client: self.graphql_client.clone(),
9525 }
9526 }
9527 pub fn without_message_history(&self) -> Llm {
9529 let query = self.selection.select("withoutMessageHistory");
9530 Llm {
9531 proc: self.proc.clone(),
9532 selection: query,
9533 graphql_client: self.graphql_client.clone(),
9534 }
9535 }
9536 pub fn without_system_prompts(&self) -> Llm {
9538 let query = self.selection.select("withoutSystemPrompts");
9539 Llm {
9540 proc: self.proc.clone(),
9541 selection: query,
9542 graphql_client: self.graphql_client.clone(),
9543 }
9544 }
9545}
9546#[derive(Clone)]
9547pub struct LlmTokenUsage {
9548 pub proc: Option<Arc<DaggerSessionProc>>,
9549 pub selection: Selection,
9550 pub graphql_client: DynGraphQLClient,
9551}
9552impl LlmTokenUsage {
9553 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
9554 let query = self.selection.select("cachedTokenReads");
9555 query.execute(self.graphql_client.clone()).await
9556 }
9557 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
9558 let query = self.selection.select("cachedTokenWrites");
9559 query.execute(self.graphql_client.clone()).await
9560 }
9561 pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
9563 let query = self.selection.select("id");
9564 query.execute(self.graphql_client.clone()).await
9565 }
9566 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
9567 let query = self.selection.select("inputTokens");
9568 query.execute(self.graphql_client.clone()).await
9569 }
9570 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
9571 let query = self.selection.select("outputTokens");
9572 query.execute(self.graphql_client.clone()).await
9573 }
9574 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
9575 let query = self.selection.select("totalTokens");
9576 query.execute(self.graphql_client.clone()).await
9577 }
9578}
9579#[derive(Clone)]
9580pub struct Label {
9581 pub proc: Option<Arc<DaggerSessionProc>>,
9582 pub selection: Selection,
9583 pub graphql_client: DynGraphQLClient,
9584}
9585impl Label {
9586 pub async fn id(&self) -> Result<LabelId, DaggerError> {
9588 let query = self.selection.select("id");
9589 query.execute(self.graphql_client.clone()).await
9590 }
9591 pub async fn name(&self) -> Result<String, DaggerError> {
9593 let query = self.selection.select("name");
9594 query.execute(self.graphql_client.clone()).await
9595 }
9596 pub async fn value(&self) -> Result<String, DaggerError> {
9598 let query = self.selection.select("value");
9599 query.execute(self.graphql_client.clone()).await
9600 }
9601}
9602#[derive(Clone)]
9603pub struct ListTypeDef {
9604 pub proc: Option<Arc<DaggerSessionProc>>,
9605 pub selection: Selection,
9606 pub graphql_client: DynGraphQLClient,
9607}
9608impl ListTypeDef {
9609 pub fn element_type_def(&self) -> TypeDef {
9611 let query = self.selection.select("elementTypeDef");
9612 TypeDef {
9613 proc: self.proc.clone(),
9614 selection: query,
9615 graphql_client: self.graphql_client.clone(),
9616 }
9617 }
9618 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
9620 let query = self.selection.select("id");
9621 query.execute(self.graphql_client.clone()).await
9622 }
9623}
9624#[derive(Clone)]
9625pub struct Module {
9626 pub proc: Option<Arc<DaggerSessionProc>>,
9627 pub selection: Selection,
9628 pub graphql_client: DynGraphQLClient,
9629}
9630#[derive(Builder, Debug, PartialEq)]
9631pub struct ModuleServeOpts {
9632 #[builder(setter(into, strip_option), default)]
9634 pub include_dependencies: Option<bool>,
9635}
9636impl Module {
9637 pub fn dependencies(&self) -> Vec<Module> {
9639 let query = self.selection.select("dependencies");
9640 vec![Module {
9641 proc: self.proc.clone(),
9642 selection: query,
9643 graphql_client: self.graphql_client.clone(),
9644 }]
9645 }
9646 pub async fn description(&self) -> Result<String, DaggerError> {
9648 let query = self.selection.select("description");
9649 query.execute(self.graphql_client.clone()).await
9650 }
9651 pub fn enums(&self) -> Vec<TypeDef> {
9653 let query = self.selection.select("enums");
9654 vec![TypeDef {
9655 proc: self.proc.clone(),
9656 selection: query,
9657 graphql_client: self.graphql_client.clone(),
9658 }]
9659 }
9660 pub fn generated_context_directory(&self) -> Directory {
9662 let query = self.selection.select("generatedContextDirectory");
9663 Directory {
9664 proc: self.proc.clone(),
9665 selection: query,
9666 graphql_client: self.graphql_client.clone(),
9667 }
9668 }
9669 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
9671 let query = self.selection.select("id");
9672 query.execute(self.graphql_client.clone()).await
9673 }
9674 pub fn interfaces(&self) -> Vec<TypeDef> {
9676 let query = self.selection.select("interfaces");
9677 vec![TypeDef {
9678 proc: self.proc.clone(),
9679 selection: query,
9680 graphql_client: self.graphql_client.clone(),
9681 }]
9682 }
9683 pub fn introspection_schema_json(&self) -> File {
9687 let query = self.selection.select("introspectionSchemaJSON");
9688 File {
9689 proc: self.proc.clone(),
9690 selection: query,
9691 graphql_client: self.graphql_client.clone(),
9692 }
9693 }
9694 pub async fn name(&self) -> Result<String, DaggerError> {
9696 let query = self.selection.select("name");
9697 query.execute(self.graphql_client.clone()).await
9698 }
9699 pub fn objects(&self) -> Vec<TypeDef> {
9701 let query = self.selection.select("objects");
9702 vec![TypeDef {
9703 proc: self.proc.clone(),
9704 selection: query,
9705 graphql_client: self.graphql_client.clone(),
9706 }]
9707 }
9708 pub fn runtime(&self) -> Container {
9710 let query = self.selection.select("runtime");
9711 Container {
9712 proc: self.proc.clone(),
9713 selection: query,
9714 graphql_client: self.graphql_client.clone(),
9715 }
9716 }
9717 pub fn sdk(&self) -> SdkConfig {
9719 let query = self.selection.select("sdk");
9720 SdkConfig {
9721 proc: self.proc.clone(),
9722 selection: query,
9723 graphql_client: self.graphql_client.clone(),
9724 }
9725 }
9726 pub async fn serve(&self) -> Result<Void, DaggerError> {
9733 let query = self.selection.select("serve");
9734 query.execute(self.graphql_client.clone()).await
9735 }
9736 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
9743 let mut query = self.selection.select("serve");
9744 if let Some(include_dependencies) = opts.include_dependencies {
9745 query = query.arg("includeDependencies", include_dependencies);
9746 }
9747 query.execute(self.graphql_client.clone()).await
9748 }
9749 pub fn source(&self) -> ModuleSource {
9751 let query = self.selection.select("source");
9752 ModuleSource {
9753 proc: self.proc.clone(),
9754 selection: query,
9755 graphql_client: self.graphql_client.clone(),
9756 }
9757 }
9758 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
9760 let query = self.selection.select("sync");
9761 query.execute(self.graphql_client.clone()).await
9762 }
9763 pub fn user_defaults(&self) -> EnvFile {
9765 let query = self.selection.select("userDefaults");
9766 EnvFile {
9767 proc: self.proc.clone(),
9768 selection: query,
9769 graphql_client: self.graphql_client.clone(),
9770 }
9771 }
9772 pub fn with_description(&self, description: impl Into<String>) -> Module {
9778 let mut query = self.selection.select("withDescription");
9779 query = query.arg("description", description.into());
9780 Module {
9781 proc: self.proc.clone(),
9782 selection: query,
9783 graphql_client: self.graphql_client.clone(),
9784 }
9785 }
9786 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
9788 let mut query = self.selection.select("withEnum");
9789 query = query.arg_lazy(
9790 "enum",
9791 Box::new(move || {
9792 let r#enum = r#enum.clone();
9793 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
9794 }),
9795 );
9796 Module {
9797 proc: self.proc.clone(),
9798 selection: query,
9799 graphql_client: self.graphql_client.clone(),
9800 }
9801 }
9802 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
9804 let mut query = self.selection.select("withInterface");
9805 query = query.arg_lazy(
9806 "iface",
9807 Box::new(move || {
9808 let iface = iface.clone();
9809 Box::pin(async move { iface.into_id().await.unwrap().quote() })
9810 }),
9811 );
9812 Module {
9813 proc: self.proc.clone(),
9814 selection: query,
9815 graphql_client: self.graphql_client.clone(),
9816 }
9817 }
9818 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
9820 let mut query = self.selection.select("withObject");
9821 query = query.arg_lazy(
9822 "object",
9823 Box::new(move || {
9824 let object = object.clone();
9825 Box::pin(async move { object.into_id().await.unwrap().quote() })
9826 }),
9827 );
9828 Module {
9829 proc: self.proc.clone(),
9830 selection: query,
9831 graphql_client: self.graphql_client.clone(),
9832 }
9833 }
9834}
9835#[derive(Clone)]
9836pub struct ModuleConfigClient {
9837 pub proc: Option<Arc<DaggerSessionProc>>,
9838 pub selection: Selection,
9839 pub graphql_client: DynGraphQLClient,
9840}
9841impl ModuleConfigClient {
9842 pub async fn directory(&self) -> Result<String, DaggerError> {
9844 let query = self.selection.select("directory");
9845 query.execute(self.graphql_client.clone()).await
9846 }
9847 pub async fn generator(&self) -> Result<String, DaggerError> {
9849 let query = self.selection.select("generator");
9850 query.execute(self.graphql_client.clone()).await
9851 }
9852 pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
9854 let query = self.selection.select("id");
9855 query.execute(self.graphql_client.clone()).await
9856 }
9857}
9858#[derive(Clone)]
9859pub struct ModuleSource {
9860 pub proc: Option<Arc<DaggerSessionProc>>,
9861 pub selection: Selection,
9862 pub graphql_client: DynGraphQLClient,
9863}
9864impl ModuleSource {
9865 pub fn as_module(&self) -> Module {
9867 let query = self.selection.select("asModule");
9868 Module {
9869 proc: self.proc.clone(),
9870 selection: query,
9871 graphql_client: self.graphql_client.clone(),
9872 }
9873 }
9874 pub async fn as_string(&self) -> Result<String, DaggerError> {
9876 let query = self.selection.select("asString");
9877 query.execute(self.graphql_client.clone()).await
9878 }
9879 pub fn blueprint(&self) -> ModuleSource {
9881 let query = self.selection.select("blueprint");
9882 ModuleSource {
9883 proc: self.proc.clone(),
9884 selection: query,
9885 graphql_client: self.graphql_client.clone(),
9886 }
9887 }
9888 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
9890 let query = self.selection.select("cloneRef");
9891 query.execute(self.graphql_client.clone()).await
9892 }
9893 pub async fn commit(&self) -> Result<String, DaggerError> {
9895 let query = self.selection.select("commit");
9896 query.execute(self.graphql_client.clone()).await
9897 }
9898 pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
9900 let query = self.selection.select("configClients");
9901 vec![ModuleConfigClient {
9902 proc: self.proc.clone(),
9903 selection: query,
9904 graphql_client: self.graphql_client.clone(),
9905 }]
9906 }
9907 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
9909 let query = self.selection.select("configExists");
9910 query.execute(self.graphql_client.clone()).await
9911 }
9912 pub fn context_directory(&self) -> Directory {
9914 let query = self.selection.select("contextDirectory");
9915 Directory {
9916 proc: self.proc.clone(),
9917 selection: query,
9918 graphql_client: self.graphql_client.clone(),
9919 }
9920 }
9921 pub fn dependencies(&self) -> Vec<ModuleSource> {
9923 let query = self.selection.select("dependencies");
9924 vec![ModuleSource {
9925 proc: self.proc.clone(),
9926 selection: query,
9927 graphql_client: self.graphql_client.clone(),
9928 }]
9929 }
9930 pub async fn digest(&self) -> Result<String, DaggerError> {
9932 let query = self.selection.select("digest");
9933 query.execute(self.graphql_client.clone()).await
9934 }
9935 pub fn directory(&self, path: impl Into<String>) -> Directory {
9941 let mut query = self.selection.select("directory");
9942 query = query.arg("path", path.into());
9943 Directory {
9944 proc: self.proc.clone(),
9945 selection: query,
9946 graphql_client: self.graphql_client.clone(),
9947 }
9948 }
9949 pub async fn engine_version(&self) -> Result<String, DaggerError> {
9951 let query = self.selection.select("engineVersion");
9952 query.execute(self.graphql_client.clone()).await
9953 }
9954 pub fn generated_context_directory(&self) -> Directory {
9956 let query = self.selection.select("generatedContextDirectory");
9957 Directory {
9958 proc: self.proc.clone(),
9959 selection: query,
9960 graphql_client: self.graphql_client.clone(),
9961 }
9962 }
9963 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
9965 let query = self.selection.select("htmlRepoURL");
9966 query.execute(self.graphql_client.clone()).await
9967 }
9968 pub async fn html_url(&self) -> Result<String, DaggerError> {
9970 let query = self.selection.select("htmlURL");
9971 query.execute(self.graphql_client.clone()).await
9972 }
9973 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
9975 let query = self.selection.select("id");
9976 query.execute(self.graphql_client.clone()).await
9977 }
9978 pub fn introspection_schema_json(&self) -> File {
9982 let query = self.selection.select("introspectionSchemaJSON");
9983 File {
9984 proc: self.proc.clone(),
9985 selection: query,
9986 graphql_client: self.graphql_client.clone(),
9987 }
9988 }
9989 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
9991 let query = self.selection.select("kind");
9992 query.execute(self.graphql_client.clone()).await
9993 }
9994 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
9996 let query = self.selection.select("localContextDirectoryPath");
9997 query.execute(self.graphql_client.clone()).await
9998 }
9999 pub async fn module_name(&self) -> Result<String, DaggerError> {
10001 let query = self.selection.select("moduleName");
10002 query.execute(self.graphql_client.clone()).await
10003 }
10004 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
10006 let query = self.selection.select("moduleOriginalName");
10007 query.execute(self.graphql_client.clone()).await
10008 }
10009 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
10011 let query = self.selection.select("originalSubpath");
10012 query.execute(self.graphql_client.clone()).await
10013 }
10014 pub async fn pin(&self) -> Result<String, DaggerError> {
10016 let query = self.selection.select("pin");
10017 query.execute(self.graphql_client.clone()).await
10018 }
10019 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
10021 let query = self.selection.select("repoRootPath");
10022 query.execute(self.graphql_client.clone()).await
10023 }
10024 pub fn sdk(&self) -> SdkConfig {
10026 let query = self.selection.select("sdk");
10027 SdkConfig {
10028 proc: self.proc.clone(),
10029 selection: query,
10030 graphql_client: self.graphql_client.clone(),
10031 }
10032 }
10033 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
10035 let query = self.selection.select("sourceRootSubpath");
10036 query.execute(self.graphql_client.clone()).await
10037 }
10038 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
10040 let query = self.selection.select("sourceSubpath");
10041 query.execute(self.graphql_client.clone()).await
10042 }
10043 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
10045 let query = self.selection.select("sync");
10046 query.execute(self.graphql_client.clone()).await
10047 }
10048 pub fn toolchains(&self) -> Vec<ModuleSource> {
10050 let query = self.selection.select("toolchains");
10051 vec![ModuleSource {
10052 proc: self.proc.clone(),
10053 selection: query,
10054 graphql_client: self.graphql_client.clone(),
10055 }]
10056 }
10057 pub fn user_defaults(&self) -> EnvFile {
10059 let query = self.selection.select("userDefaults");
10060 EnvFile {
10061 proc: self.proc.clone(),
10062 selection: query,
10063 graphql_client: self.graphql_client.clone(),
10064 }
10065 }
10066 pub async fn version(&self) -> Result<String, DaggerError> {
10068 let query = self.selection.select("version");
10069 query.execute(self.graphql_client.clone()).await
10070 }
10071 pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
10077 let mut query = self.selection.select("withBlueprint");
10078 query = query.arg_lazy(
10079 "blueprint",
10080 Box::new(move || {
10081 let blueprint = blueprint.clone();
10082 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
10083 }),
10084 );
10085 ModuleSource {
10086 proc: self.proc.clone(),
10087 selection: query,
10088 graphql_client: self.graphql_client.clone(),
10089 }
10090 }
10091 pub fn with_client(
10098 &self,
10099 generator: impl Into<String>,
10100 output_dir: impl Into<String>,
10101 ) -> ModuleSource {
10102 let mut query = self.selection.select("withClient");
10103 query = query.arg("generator", generator.into());
10104 query = query.arg("outputDir", output_dir.into());
10105 ModuleSource {
10106 proc: self.proc.clone(),
10107 selection: query,
10108 graphql_client: self.graphql_client.clone(),
10109 }
10110 }
10111 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
10117 let mut query = self.selection.select("withDependencies");
10118 query = query.arg("dependencies", dependencies);
10119 ModuleSource {
10120 proc: self.proc.clone(),
10121 selection: query,
10122 graphql_client: self.graphql_client.clone(),
10123 }
10124 }
10125 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
10131 let mut query = self.selection.select("withEngineVersion");
10132 query = query.arg("version", version.into());
10133 ModuleSource {
10134 proc: self.proc.clone(),
10135 selection: query,
10136 graphql_client: self.graphql_client.clone(),
10137 }
10138 }
10139 pub fn with_experimental_features(
10145 &self,
10146 features: Vec<ModuleSourceExperimentalFeature>,
10147 ) -> ModuleSource {
10148 let mut query = self.selection.select("withExperimentalFeatures");
10149 query = query.arg("features", features);
10150 ModuleSource {
10151 proc: self.proc.clone(),
10152 selection: query,
10153 graphql_client: self.graphql_client.clone(),
10154 }
10155 }
10156 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
10162 let mut query = self.selection.select("withIncludes");
10163 query = query.arg(
10164 "patterns",
10165 patterns
10166 .into_iter()
10167 .map(|i| i.into())
10168 .collect::<Vec<String>>(),
10169 );
10170 ModuleSource {
10171 proc: self.proc.clone(),
10172 selection: query,
10173 graphql_client: self.graphql_client.clone(),
10174 }
10175 }
10176 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
10182 let mut query = self.selection.select("withName");
10183 query = query.arg("name", name.into());
10184 ModuleSource {
10185 proc: self.proc.clone(),
10186 selection: query,
10187 graphql_client: self.graphql_client.clone(),
10188 }
10189 }
10190 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
10196 let mut query = self.selection.select("withSDK");
10197 query = query.arg("source", source.into());
10198 ModuleSource {
10199 proc: self.proc.clone(),
10200 selection: query,
10201 graphql_client: self.graphql_client.clone(),
10202 }
10203 }
10204 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
10210 let mut query = self.selection.select("withSourceSubpath");
10211 query = query.arg("path", path.into());
10212 ModuleSource {
10213 proc: self.proc.clone(),
10214 selection: query,
10215 graphql_client: self.graphql_client.clone(),
10216 }
10217 }
10218 pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
10224 let mut query = self.selection.select("withToolchains");
10225 query = query.arg("toolchains", toolchains);
10226 ModuleSource {
10227 proc: self.proc.clone(),
10228 selection: query,
10229 graphql_client: self.graphql_client.clone(),
10230 }
10231 }
10232 pub fn with_update_blueprint(&self) -> ModuleSource {
10234 let query = self.selection.select("withUpdateBlueprint");
10235 ModuleSource {
10236 proc: self.proc.clone(),
10237 selection: query,
10238 graphql_client: self.graphql_client.clone(),
10239 }
10240 }
10241 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10247 let mut query = self.selection.select("withUpdateDependencies");
10248 query = query.arg(
10249 "dependencies",
10250 dependencies
10251 .into_iter()
10252 .map(|i| i.into())
10253 .collect::<Vec<String>>(),
10254 );
10255 ModuleSource {
10256 proc: self.proc.clone(),
10257 selection: query,
10258 graphql_client: self.graphql_client.clone(),
10259 }
10260 }
10261 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10267 let mut query = self.selection.select("withUpdateToolchains");
10268 query = query.arg(
10269 "toolchains",
10270 toolchains
10271 .into_iter()
10272 .map(|i| i.into())
10273 .collect::<Vec<String>>(),
10274 );
10275 ModuleSource {
10276 proc: self.proc.clone(),
10277 selection: query,
10278 graphql_client: self.graphql_client.clone(),
10279 }
10280 }
10281 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
10287 let mut query = self.selection.select("withUpdatedClients");
10288 query = query.arg(
10289 "clients",
10290 clients
10291 .into_iter()
10292 .map(|i| i.into())
10293 .collect::<Vec<String>>(),
10294 );
10295 ModuleSource {
10296 proc: self.proc.clone(),
10297 selection: query,
10298 graphql_client: self.graphql_client.clone(),
10299 }
10300 }
10301 pub fn without_blueprint(&self) -> ModuleSource {
10303 let query = self.selection.select("withoutBlueprint");
10304 ModuleSource {
10305 proc: self.proc.clone(),
10306 selection: query,
10307 graphql_client: self.graphql_client.clone(),
10308 }
10309 }
10310 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
10316 let mut query = self.selection.select("withoutClient");
10317 query = query.arg("path", path.into());
10318 ModuleSource {
10319 proc: self.proc.clone(),
10320 selection: query,
10321 graphql_client: self.graphql_client.clone(),
10322 }
10323 }
10324 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10330 let mut query = self.selection.select("withoutDependencies");
10331 query = query.arg(
10332 "dependencies",
10333 dependencies
10334 .into_iter()
10335 .map(|i| i.into())
10336 .collect::<Vec<String>>(),
10337 );
10338 ModuleSource {
10339 proc: self.proc.clone(),
10340 selection: query,
10341 graphql_client: self.graphql_client.clone(),
10342 }
10343 }
10344 pub fn without_experimental_features(
10350 &self,
10351 features: Vec<ModuleSourceExperimentalFeature>,
10352 ) -> ModuleSource {
10353 let mut query = self.selection.select("withoutExperimentalFeatures");
10354 query = query.arg("features", features);
10355 ModuleSource {
10356 proc: self.proc.clone(),
10357 selection: query,
10358 graphql_client: self.graphql_client.clone(),
10359 }
10360 }
10361 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10367 let mut query = self.selection.select("withoutToolchains");
10368 query = query.arg(
10369 "toolchains",
10370 toolchains
10371 .into_iter()
10372 .map(|i| i.into())
10373 .collect::<Vec<String>>(),
10374 );
10375 ModuleSource {
10376 proc: self.proc.clone(),
10377 selection: query,
10378 graphql_client: self.graphql_client.clone(),
10379 }
10380 }
10381}
10382#[derive(Clone)]
10383pub struct ObjectTypeDef {
10384 pub proc: Option<Arc<DaggerSessionProc>>,
10385 pub selection: Selection,
10386 pub graphql_client: DynGraphQLClient,
10387}
10388impl ObjectTypeDef {
10389 pub fn constructor(&self) -> Function {
10391 let query = self.selection.select("constructor");
10392 Function {
10393 proc: self.proc.clone(),
10394 selection: query,
10395 graphql_client: self.graphql_client.clone(),
10396 }
10397 }
10398 pub async fn deprecated(&self) -> Result<String, DaggerError> {
10400 let query = self.selection.select("deprecated");
10401 query.execute(self.graphql_client.clone()).await
10402 }
10403 pub async fn description(&self) -> Result<String, DaggerError> {
10405 let query = self.selection.select("description");
10406 query.execute(self.graphql_client.clone()).await
10407 }
10408 pub fn fields(&self) -> Vec<FieldTypeDef> {
10410 let query = self.selection.select("fields");
10411 vec![FieldTypeDef {
10412 proc: self.proc.clone(),
10413 selection: query,
10414 graphql_client: self.graphql_client.clone(),
10415 }]
10416 }
10417 pub fn functions(&self) -> Vec<Function> {
10419 let query = self.selection.select("functions");
10420 vec![Function {
10421 proc: self.proc.clone(),
10422 selection: query,
10423 graphql_client: self.graphql_client.clone(),
10424 }]
10425 }
10426 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
10428 let query = self.selection.select("id");
10429 query.execute(self.graphql_client.clone()).await
10430 }
10431 pub async fn name(&self) -> Result<String, DaggerError> {
10433 let query = self.selection.select("name");
10434 query.execute(self.graphql_client.clone()).await
10435 }
10436 pub fn source_map(&self) -> SourceMap {
10438 let query = self.selection.select("sourceMap");
10439 SourceMap {
10440 proc: self.proc.clone(),
10441 selection: query,
10442 graphql_client: self.graphql_client.clone(),
10443 }
10444 }
10445 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10447 let query = self.selection.select("sourceModuleName");
10448 query.execute(self.graphql_client.clone()).await
10449 }
10450}
10451#[derive(Clone)]
10452pub struct Port {
10453 pub proc: Option<Arc<DaggerSessionProc>>,
10454 pub selection: Selection,
10455 pub graphql_client: DynGraphQLClient,
10456}
10457impl Port {
10458 pub async fn description(&self) -> Result<String, DaggerError> {
10460 let query = self.selection.select("description");
10461 query.execute(self.graphql_client.clone()).await
10462 }
10463 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
10465 let query = self.selection.select("experimentalSkipHealthcheck");
10466 query.execute(self.graphql_client.clone()).await
10467 }
10468 pub async fn id(&self) -> Result<PortId, DaggerError> {
10470 let query = self.selection.select("id");
10471 query.execute(self.graphql_client.clone()).await
10472 }
10473 pub async fn port(&self) -> Result<isize, DaggerError> {
10475 let query = self.selection.select("port");
10476 query.execute(self.graphql_client.clone()).await
10477 }
10478 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
10480 let query = self.selection.select("protocol");
10481 query.execute(self.graphql_client.clone()).await
10482 }
10483}
10484#[derive(Clone)]
10485pub struct Query {
10486 pub proc: Option<Arc<DaggerSessionProc>>,
10487 pub selection: Selection,
10488 pub graphql_client: DynGraphQLClient,
10489}
10490#[derive(Builder, Debug, PartialEq)]
10491pub struct QueryContainerOpts {
10492 #[builder(setter(into, strip_option), default)]
10494 pub platform: Option<Platform>,
10495}
10496#[derive(Builder, Debug, PartialEq)]
10497pub struct QueryEnvOpts {
10498 #[builder(setter(into, strip_option), default)]
10500 pub privileged: Option<bool>,
10501 #[builder(setter(into, strip_option), default)]
10503 pub writable: Option<bool>,
10504}
10505#[derive(Builder, Debug, PartialEq)]
10506pub struct QueryEnvFileOpts {
10507 #[builder(setter(into, strip_option), default)]
10509 pub expand: Option<bool>,
10510}
10511#[derive(Builder, Debug, PartialEq)]
10512pub struct QueryFileOpts {
10513 #[builder(setter(into, strip_option), default)]
10515 pub permissions: Option<isize>,
10516}
10517#[derive(Builder, Debug, PartialEq)]
10518pub struct QueryGitOpts<'a> {
10519 #[builder(setter(into, strip_option), default)]
10521 pub experimental_service_host: Option<ServiceId>,
10522 #[builder(setter(into, strip_option), default)]
10524 pub http_auth_header: Option<SecretId>,
10525 #[builder(setter(into, strip_option), default)]
10527 pub http_auth_token: Option<SecretId>,
10528 #[builder(setter(into, strip_option), default)]
10530 pub http_auth_username: Option<&'a str>,
10531 #[builder(setter(into, strip_option), default)]
10533 pub keep_git_dir: Option<bool>,
10534 #[builder(setter(into, strip_option), default)]
10536 pub ssh_auth_socket: Option<SocketId>,
10537 #[builder(setter(into, strip_option), default)]
10539 pub ssh_known_hosts: Option<&'a str>,
10540}
10541#[derive(Builder, Debug, PartialEq)]
10542pub struct QueryHttpOpts<'a> {
10543 #[builder(setter(into, strip_option), default)]
10545 pub auth_header: Option<SecretId>,
10546 #[builder(setter(into, strip_option), default)]
10548 pub experimental_service_host: Option<ServiceId>,
10549 #[builder(setter(into, strip_option), default)]
10551 pub name: Option<&'a str>,
10552 #[builder(setter(into, strip_option), default)]
10554 pub permissions: Option<isize>,
10555}
10556#[derive(Builder, Debug, PartialEq)]
10557pub struct QueryLlmOpts<'a> {
10558 #[builder(setter(into, strip_option), default)]
10560 pub max_api_calls: Option<isize>,
10561 #[builder(setter(into, strip_option), default)]
10563 pub model: Option<&'a str>,
10564}
10565#[derive(Builder, Debug, PartialEq)]
10566pub struct QueryModuleSourceOpts<'a> {
10567 #[builder(setter(into, strip_option), default)]
10569 pub allow_not_exists: Option<bool>,
10570 #[builder(setter(into, strip_option), default)]
10572 pub disable_find_up: Option<bool>,
10573 #[builder(setter(into, strip_option), default)]
10575 pub ref_pin: Option<&'a str>,
10576 #[builder(setter(into, strip_option), default)]
10578 pub require_kind: Option<ModuleSourceKind>,
10579}
10580#[derive(Builder, Debug, PartialEq)]
10581pub struct QuerySecretOpts<'a> {
10582 #[builder(setter(into, strip_option), default)]
10586 pub cache_key: Option<&'a str>,
10587}
10588impl Query {
10589 pub fn address(&self, value: impl Into<String>) -> Address {
10591 let mut query = self.selection.select("address");
10592 query = query.arg("value", value.into());
10593 Address {
10594 proc: self.proc.clone(),
10595 selection: query,
10596 graphql_client: self.graphql_client.clone(),
10597 }
10598 }
10599 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
10605 let mut query = self.selection.select("cacheVolume");
10606 query = query.arg("key", key.into());
10607 CacheVolume {
10608 proc: self.proc.clone(),
10609 selection: query,
10610 graphql_client: self.graphql_client.clone(),
10611 }
10612 }
10613 pub fn cloud(&self) -> Cloud {
10615 let query = self.selection.select("cloud");
10616 Cloud {
10617 proc: self.proc.clone(),
10618 selection: query,
10619 graphql_client: self.graphql_client.clone(),
10620 }
10621 }
10622 pub fn container(&self) -> Container {
10629 let query = self.selection.select("container");
10630 Container {
10631 proc: self.proc.clone(),
10632 selection: query,
10633 graphql_client: self.graphql_client.clone(),
10634 }
10635 }
10636 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10643 let mut query = self.selection.select("container");
10644 if let Some(platform) = opts.platform {
10645 query = query.arg("platform", platform);
10646 }
10647 Container {
10648 proc: self.proc.clone(),
10649 selection: query,
10650 graphql_client: self.graphql_client.clone(),
10651 }
10652 }
10653 pub fn current_env(&self) -> Env {
10657 let query = self.selection.select("currentEnv");
10658 Env {
10659 proc: self.proc.clone(),
10660 selection: query,
10661 graphql_client: self.graphql_client.clone(),
10662 }
10663 }
10664 pub fn current_function_call(&self) -> FunctionCall {
10667 let query = self.selection.select("currentFunctionCall");
10668 FunctionCall {
10669 proc: self.proc.clone(),
10670 selection: query,
10671 graphql_client: self.graphql_client.clone(),
10672 }
10673 }
10674 pub fn current_module(&self) -> CurrentModule {
10676 let query = self.selection.select("currentModule");
10677 CurrentModule {
10678 proc: self.proc.clone(),
10679 selection: query,
10680 graphql_client: self.graphql_client.clone(),
10681 }
10682 }
10683 pub fn current_type_defs(&self) -> Vec<TypeDef> {
10685 let query = self.selection.select("currentTypeDefs");
10686 vec![TypeDef {
10687 proc: self.proc.clone(),
10688 selection: query,
10689 graphql_client: self.graphql_client.clone(),
10690 }]
10691 }
10692 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
10694 let query = self.selection.select("defaultPlatform");
10695 query.execute(self.graphql_client.clone()).await
10696 }
10697 pub fn directory(&self) -> Directory {
10699 let query = self.selection.select("directory");
10700 Directory {
10701 proc: self.proc.clone(),
10702 selection: query,
10703 graphql_client: self.graphql_client.clone(),
10704 }
10705 }
10706 pub fn engine(&self) -> Engine {
10708 let query = self.selection.select("engine");
10709 Engine {
10710 proc: self.proc.clone(),
10711 selection: query,
10712 graphql_client: self.graphql_client.clone(),
10713 }
10714 }
10715 pub fn env(&self) -> Env {
10721 let query = self.selection.select("env");
10722 Env {
10723 proc: self.proc.clone(),
10724 selection: query,
10725 graphql_client: self.graphql_client.clone(),
10726 }
10727 }
10728 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
10734 let mut query = self.selection.select("env");
10735 if let Some(privileged) = opts.privileged {
10736 query = query.arg("privileged", privileged);
10737 }
10738 if let Some(writable) = opts.writable {
10739 query = query.arg("writable", writable);
10740 }
10741 Env {
10742 proc: self.proc.clone(),
10743 selection: query,
10744 graphql_client: self.graphql_client.clone(),
10745 }
10746 }
10747 pub fn env_file(&self) -> EnvFile {
10753 let query = self.selection.select("envFile");
10754 EnvFile {
10755 proc: self.proc.clone(),
10756 selection: query,
10757 graphql_client: self.graphql_client.clone(),
10758 }
10759 }
10760 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
10766 let mut query = self.selection.select("envFile");
10767 if let Some(expand) = opts.expand {
10768 query = query.arg("expand", expand);
10769 }
10770 EnvFile {
10771 proc: self.proc.clone(),
10772 selection: query,
10773 graphql_client: self.graphql_client.clone(),
10774 }
10775 }
10776 pub fn error(&self, message: impl Into<String>) -> Error {
10782 let mut query = self.selection.select("error");
10783 query = query.arg("message", message.into());
10784 Error {
10785 proc: self.proc.clone(),
10786 selection: query,
10787 graphql_client: self.graphql_client.clone(),
10788 }
10789 }
10790 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
10798 let mut query = self.selection.select("file");
10799 query = query.arg("name", name.into());
10800 query = query.arg("contents", contents.into());
10801 File {
10802 proc: self.proc.clone(),
10803 selection: query,
10804 graphql_client: self.graphql_client.clone(),
10805 }
10806 }
10807 pub fn file_opts(
10815 &self,
10816 name: impl Into<String>,
10817 contents: impl Into<String>,
10818 opts: QueryFileOpts,
10819 ) -> File {
10820 let mut query = self.selection.select("file");
10821 query = query.arg("name", name.into());
10822 query = query.arg("contents", contents.into());
10823 if let Some(permissions) = opts.permissions {
10824 query = query.arg("permissions", permissions);
10825 }
10826 File {
10827 proc: self.proc.clone(),
10828 selection: query,
10829 graphql_client: self.graphql_client.clone(),
10830 }
10831 }
10832 pub fn function(
10839 &self,
10840 name: impl Into<String>,
10841 return_type: impl IntoID<TypeDefId>,
10842 ) -> Function {
10843 let mut query = self.selection.select("function");
10844 query = query.arg("name", name.into());
10845 query = query.arg_lazy(
10846 "returnType",
10847 Box::new(move || {
10848 let return_type = return_type.clone();
10849 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
10850 }),
10851 );
10852 Function {
10853 proc: self.proc.clone(),
10854 selection: query,
10855 graphql_client: self.graphql_client.clone(),
10856 }
10857 }
10858 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
10860 let mut query = self.selection.select("generatedCode");
10861 query = query.arg_lazy(
10862 "code",
10863 Box::new(move || {
10864 let code = code.clone();
10865 Box::pin(async move { code.into_id().await.unwrap().quote() })
10866 }),
10867 );
10868 GeneratedCode {
10869 proc: self.proc.clone(),
10870 selection: query,
10871 graphql_client: self.graphql_client.clone(),
10872 }
10873 }
10874 pub fn git(&self, url: impl Into<String>) -> GitRepository {
10885 let mut query = self.selection.select("git");
10886 query = query.arg("url", url.into());
10887 GitRepository {
10888 proc: self.proc.clone(),
10889 selection: query,
10890 graphql_client: self.graphql_client.clone(),
10891 }
10892 }
10893 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
10904 let mut query = self.selection.select("git");
10905 query = query.arg("url", url.into());
10906 if let Some(keep_git_dir) = opts.keep_git_dir {
10907 query = query.arg("keepGitDir", keep_git_dir);
10908 }
10909 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
10910 query = query.arg("sshKnownHosts", ssh_known_hosts);
10911 }
10912 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
10913 query = query.arg("sshAuthSocket", ssh_auth_socket);
10914 }
10915 if let Some(http_auth_username) = opts.http_auth_username {
10916 query = query.arg("httpAuthUsername", http_auth_username);
10917 }
10918 if let Some(http_auth_token) = opts.http_auth_token {
10919 query = query.arg("httpAuthToken", http_auth_token);
10920 }
10921 if let Some(http_auth_header) = opts.http_auth_header {
10922 query = query.arg("httpAuthHeader", http_auth_header);
10923 }
10924 if let Some(experimental_service_host) = opts.experimental_service_host {
10925 query = query.arg("experimentalServiceHost", experimental_service_host);
10926 }
10927 GitRepository {
10928 proc: self.proc.clone(),
10929 selection: query,
10930 graphql_client: self.graphql_client.clone(),
10931 }
10932 }
10933 pub fn host(&self) -> Host {
10935 let query = self.selection.select("host");
10936 Host {
10937 proc: self.proc.clone(),
10938 selection: query,
10939 graphql_client: self.graphql_client.clone(),
10940 }
10941 }
10942 pub fn http(&self, url: impl Into<String>) -> File {
10949 let mut query = self.selection.select("http");
10950 query = query.arg("url", url.into());
10951 File {
10952 proc: self.proc.clone(),
10953 selection: query,
10954 graphql_client: self.graphql_client.clone(),
10955 }
10956 }
10957 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
10964 let mut query = self.selection.select("http");
10965 query = query.arg("url", url.into());
10966 if let Some(name) = opts.name {
10967 query = query.arg("name", name);
10968 }
10969 if let Some(permissions) = opts.permissions {
10970 query = query.arg("permissions", permissions);
10971 }
10972 if let Some(auth_header) = opts.auth_header {
10973 query = query.arg("authHeader", auth_header);
10974 }
10975 if let Some(experimental_service_host) = opts.experimental_service_host {
10976 query = query.arg("experimentalServiceHost", experimental_service_host);
10977 }
10978 File {
10979 proc: self.proc.clone(),
10980 selection: query,
10981 graphql_client: self.graphql_client.clone(),
10982 }
10983 }
10984 pub fn json(&self) -> JsonValue {
10986 let query = self.selection.select("json");
10987 JsonValue {
10988 proc: self.proc.clone(),
10989 selection: query,
10990 graphql_client: self.graphql_client.clone(),
10991 }
10992 }
10993 pub fn llm(&self) -> Llm {
10999 let query = self.selection.select("llm");
11000 Llm {
11001 proc: self.proc.clone(),
11002 selection: query,
11003 graphql_client: self.graphql_client.clone(),
11004 }
11005 }
11006 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
11012 let mut query = self.selection.select("llm");
11013 if let Some(model) = opts.model {
11014 query = query.arg("model", model);
11015 }
11016 if let Some(max_api_calls) = opts.max_api_calls {
11017 query = query.arg("maxAPICalls", max_api_calls);
11018 }
11019 Llm {
11020 proc: self.proc.clone(),
11021 selection: query,
11022 graphql_client: self.graphql_client.clone(),
11023 }
11024 }
11025 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
11027 let mut query = self.selection.select("loadAddressFromID");
11028 query = query.arg_lazy(
11029 "id",
11030 Box::new(move || {
11031 let id = id.clone();
11032 Box::pin(async move { id.into_id().await.unwrap().quote() })
11033 }),
11034 );
11035 Address {
11036 proc: self.proc.clone(),
11037 selection: query,
11038 graphql_client: self.graphql_client.clone(),
11039 }
11040 }
11041 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
11043 let mut query = self.selection.select("loadBindingFromID");
11044 query = query.arg_lazy(
11045 "id",
11046 Box::new(move || {
11047 let id = id.clone();
11048 Box::pin(async move { id.into_id().await.unwrap().quote() })
11049 }),
11050 );
11051 Binding {
11052 proc: self.proc.clone(),
11053 selection: query,
11054 graphql_client: self.graphql_client.clone(),
11055 }
11056 }
11057 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
11059 let mut query = self.selection.select("loadCacheVolumeFromID");
11060 query = query.arg_lazy(
11061 "id",
11062 Box::new(move || {
11063 let id = id.clone();
11064 Box::pin(async move { id.into_id().await.unwrap().quote() })
11065 }),
11066 );
11067 CacheVolume {
11068 proc: self.proc.clone(),
11069 selection: query,
11070 graphql_client: self.graphql_client.clone(),
11071 }
11072 }
11073 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
11075 let mut query = self.selection.select("loadChangesetFromID");
11076 query = query.arg_lazy(
11077 "id",
11078 Box::new(move || {
11079 let id = id.clone();
11080 Box::pin(async move { id.into_id().await.unwrap().quote() })
11081 }),
11082 );
11083 Changeset {
11084 proc: self.proc.clone(),
11085 selection: query,
11086 graphql_client: self.graphql_client.clone(),
11087 }
11088 }
11089 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
11091 let mut query = self.selection.select("loadCloudFromID");
11092 query = query.arg_lazy(
11093 "id",
11094 Box::new(move || {
11095 let id = id.clone();
11096 Box::pin(async move { id.into_id().await.unwrap().quote() })
11097 }),
11098 );
11099 Cloud {
11100 proc: self.proc.clone(),
11101 selection: query,
11102 graphql_client: self.graphql_client.clone(),
11103 }
11104 }
11105 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
11107 let mut query = self.selection.select("loadContainerFromID");
11108 query = query.arg_lazy(
11109 "id",
11110 Box::new(move || {
11111 let id = id.clone();
11112 Box::pin(async move { id.into_id().await.unwrap().quote() })
11113 }),
11114 );
11115 Container {
11116 proc: self.proc.clone(),
11117 selection: query,
11118 graphql_client: self.graphql_client.clone(),
11119 }
11120 }
11121 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
11123 let mut query = self.selection.select("loadCurrentModuleFromID");
11124 query = query.arg_lazy(
11125 "id",
11126 Box::new(move || {
11127 let id = id.clone();
11128 Box::pin(async move { id.into_id().await.unwrap().quote() })
11129 }),
11130 );
11131 CurrentModule {
11132 proc: self.proc.clone(),
11133 selection: query,
11134 graphql_client: self.graphql_client.clone(),
11135 }
11136 }
11137 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
11139 let mut query = self.selection.select("loadDirectoryFromID");
11140 query = query.arg_lazy(
11141 "id",
11142 Box::new(move || {
11143 let id = id.clone();
11144 Box::pin(async move { id.into_id().await.unwrap().quote() })
11145 }),
11146 );
11147 Directory {
11148 proc: self.proc.clone(),
11149 selection: query,
11150 graphql_client: self.graphql_client.clone(),
11151 }
11152 }
11153 pub fn load_engine_cache_entry_from_id(
11155 &self,
11156 id: impl IntoID<EngineCacheEntryId>,
11157 ) -> EngineCacheEntry {
11158 let mut query = self.selection.select("loadEngineCacheEntryFromID");
11159 query = query.arg_lazy(
11160 "id",
11161 Box::new(move || {
11162 let id = id.clone();
11163 Box::pin(async move { id.into_id().await.unwrap().quote() })
11164 }),
11165 );
11166 EngineCacheEntry {
11167 proc: self.proc.clone(),
11168 selection: query,
11169 graphql_client: self.graphql_client.clone(),
11170 }
11171 }
11172 pub fn load_engine_cache_entry_set_from_id(
11174 &self,
11175 id: impl IntoID<EngineCacheEntrySetId>,
11176 ) -> EngineCacheEntrySet {
11177 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
11178 query = query.arg_lazy(
11179 "id",
11180 Box::new(move || {
11181 let id = id.clone();
11182 Box::pin(async move { id.into_id().await.unwrap().quote() })
11183 }),
11184 );
11185 EngineCacheEntrySet {
11186 proc: self.proc.clone(),
11187 selection: query,
11188 graphql_client: self.graphql_client.clone(),
11189 }
11190 }
11191 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
11193 let mut query = self.selection.select("loadEngineCacheFromID");
11194 query = query.arg_lazy(
11195 "id",
11196 Box::new(move || {
11197 let id = id.clone();
11198 Box::pin(async move { id.into_id().await.unwrap().quote() })
11199 }),
11200 );
11201 EngineCache {
11202 proc: self.proc.clone(),
11203 selection: query,
11204 graphql_client: self.graphql_client.clone(),
11205 }
11206 }
11207 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
11209 let mut query = self.selection.select("loadEngineFromID");
11210 query = query.arg_lazy(
11211 "id",
11212 Box::new(move || {
11213 let id = id.clone();
11214 Box::pin(async move { id.into_id().await.unwrap().quote() })
11215 }),
11216 );
11217 Engine {
11218 proc: self.proc.clone(),
11219 selection: query,
11220 graphql_client: self.graphql_client.clone(),
11221 }
11222 }
11223 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
11225 let mut query = self.selection.select("loadEnumTypeDefFromID");
11226 query = query.arg_lazy(
11227 "id",
11228 Box::new(move || {
11229 let id = id.clone();
11230 Box::pin(async move { id.into_id().await.unwrap().quote() })
11231 }),
11232 );
11233 EnumTypeDef {
11234 proc: self.proc.clone(),
11235 selection: query,
11236 graphql_client: self.graphql_client.clone(),
11237 }
11238 }
11239 pub fn load_enum_value_type_def_from_id(
11241 &self,
11242 id: impl IntoID<EnumValueTypeDefId>,
11243 ) -> EnumValueTypeDef {
11244 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
11245 query = query.arg_lazy(
11246 "id",
11247 Box::new(move || {
11248 let id = id.clone();
11249 Box::pin(async move { id.into_id().await.unwrap().quote() })
11250 }),
11251 );
11252 EnumValueTypeDef {
11253 proc: self.proc.clone(),
11254 selection: query,
11255 graphql_client: self.graphql_client.clone(),
11256 }
11257 }
11258 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
11260 let mut query = self.selection.select("loadEnvFileFromID");
11261 query = query.arg_lazy(
11262 "id",
11263 Box::new(move || {
11264 let id = id.clone();
11265 Box::pin(async move { id.into_id().await.unwrap().quote() })
11266 }),
11267 );
11268 EnvFile {
11269 proc: self.proc.clone(),
11270 selection: query,
11271 graphql_client: self.graphql_client.clone(),
11272 }
11273 }
11274 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
11276 let mut query = self.selection.select("loadEnvFromID");
11277 query = query.arg_lazy(
11278 "id",
11279 Box::new(move || {
11280 let id = id.clone();
11281 Box::pin(async move { id.into_id().await.unwrap().quote() })
11282 }),
11283 );
11284 Env {
11285 proc: self.proc.clone(),
11286 selection: query,
11287 graphql_client: self.graphql_client.clone(),
11288 }
11289 }
11290 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
11292 let mut query = self.selection.select("loadEnvVariableFromID");
11293 query = query.arg_lazy(
11294 "id",
11295 Box::new(move || {
11296 let id = id.clone();
11297 Box::pin(async move { id.into_id().await.unwrap().quote() })
11298 }),
11299 );
11300 EnvVariable {
11301 proc: self.proc.clone(),
11302 selection: query,
11303 graphql_client: self.graphql_client.clone(),
11304 }
11305 }
11306 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
11308 let mut query = self.selection.select("loadErrorFromID");
11309 query = query.arg_lazy(
11310 "id",
11311 Box::new(move || {
11312 let id = id.clone();
11313 Box::pin(async move { id.into_id().await.unwrap().quote() })
11314 }),
11315 );
11316 Error {
11317 proc: self.proc.clone(),
11318 selection: query,
11319 graphql_client: self.graphql_client.clone(),
11320 }
11321 }
11322 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
11324 let mut query = self.selection.select("loadErrorValueFromID");
11325 query = query.arg_lazy(
11326 "id",
11327 Box::new(move || {
11328 let id = id.clone();
11329 Box::pin(async move { id.into_id().await.unwrap().quote() })
11330 }),
11331 );
11332 ErrorValue {
11333 proc: self.proc.clone(),
11334 selection: query,
11335 graphql_client: self.graphql_client.clone(),
11336 }
11337 }
11338 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
11340 let mut query = self.selection.select("loadFieldTypeDefFromID");
11341 query = query.arg_lazy(
11342 "id",
11343 Box::new(move || {
11344 let id = id.clone();
11345 Box::pin(async move { id.into_id().await.unwrap().quote() })
11346 }),
11347 );
11348 FieldTypeDef {
11349 proc: self.proc.clone(),
11350 selection: query,
11351 graphql_client: self.graphql_client.clone(),
11352 }
11353 }
11354 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
11356 let mut query = self.selection.select("loadFileFromID");
11357 query = query.arg_lazy(
11358 "id",
11359 Box::new(move || {
11360 let id = id.clone();
11361 Box::pin(async move { id.into_id().await.unwrap().quote() })
11362 }),
11363 );
11364 File {
11365 proc: self.proc.clone(),
11366 selection: query,
11367 graphql_client: self.graphql_client.clone(),
11368 }
11369 }
11370 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
11372 let mut query = self.selection.select("loadFunctionArgFromID");
11373 query = query.arg_lazy(
11374 "id",
11375 Box::new(move || {
11376 let id = id.clone();
11377 Box::pin(async move { id.into_id().await.unwrap().quote() })
11378 }),
11379 );
11380 FunctionArg {
11381 proc: self.proc.clone(),
11382 selection: query,
11383 graphql_client: self.graphql_client.clone(),
11384 }
11385 }
11386 pub fn load_function_call_arg_value_from_id(
11388 &self,
11389 id: impl IntoID<FunctionCallArgValueId>,
11390 ) -> FunctionCallArgValue {
11391 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
11392 query = query.arg_lazy(
11393 "id",
11394 Box::new(move || {
11395 let id = id.clone();
11396 Box::pin(async move { id.into_id().await.unwrap().quote() })
11397 }),
11398 );
11399 FunctionCallArgValue {
11400 proc: self.proc.clone(),
11401 selection: query,
11402 graphql_client: self.graphql_client.clone(),
11403 }
11404 }
11405 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
11407 let mut query = self.selection.select("loadFunctionCallFromID");
11408 query = query.arg_lazy(
11409 "id",
11410 Box::new(move || {
11411 let id = id.clone();
11412 Box::pin(async move { id.into_id().await.unwrap().quote() })
11413 }),
11414 );
11415 FunctionCall {
11416 proc: self.proc.clone(),
11417 selection: query,
11418 graphql_client: self.graphql_client.clone(),
11419 }
11420 }
11421 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
11423 let mut query = self.selection.select("loadFunctionFromID");
11424 query = query.arg_lazy(
11425 "id",
11426 Box::new(move || {
11427 let id = id.clone();
11428 Box::pin(async move { id.into_id().await.unwrap().quote() })
11429 }),
11430 );
11431 Function {
11432 proc: self.proc.clone(),
11433 selection: query,
11434 graphql_client: self.graphql_client.clone(),
11435 }
11436 }
11437 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
11439 let mut query = self.selection.select("loadGeneratedCodeFromID");
11440 query = query.arg_lazy(
11441 "id",
11442 Box::new(move || {
11443 let id = id.clone();
11444 Box::pin(async move { id.into_id().await.unwrap().quote() })
11445 }),
11446 );
11447 GeneratedCode {
11448 proc: self.proc.clone(),
11449 selection: query,
11450 graphql_client: self.graphql_client.clone(),
11451 }
11452 }
11453 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
11455 let mut query = self.selection.select("loadGitRefFromID");
11456 query = query.arg_lazy(
11457 "id",
11458 Box::new(move || {
11459 let id = id.clone();
11460 Box::pin(async move { id.into_id().await.unwrap().quote() })
11461 }),
11462 );
11463 GitRef {
11464 proc: self.proc.clone(),
11465 selection: query,
11466 graphql_client: self.graphql_client.clone(),
11467 }
11468 }
11469 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
11471 let mut query = self.selection.select("loadGitRepositoryFromID");
11472 query = query.arg_lazy(
11473 "id",
11474 Box::new(move || {
11475 let id = id.clone();
11476 Box::pin(async move { id.into_id().await.unwrap().quote() })
11477 }),
11478 );
11479 GitRepository {
11480 proc: self.proc.clone(),
11481 selection: query,
11482 graphql_client: self.graphql_client.clone(),
11483 }
11484 }
11485 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
11487 let mut query = self.selection.select("loadHostFromID");
11488 query = query.arg_lazy(
11489 "id",
11490 Box::new(move || {
11491 let id = id.clone();
11492 Box::pin(async move { id.into_id().await.unwrap().quote() })
11493 }),
11494 );
11495 Host {
11496 proc: self.proc.clone(),
11497 selection: query,
11498 graphql_client: self.graphql_client.clone(),
11499 }
11500 }
11501 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
11503 let mut query = self.selection.select("loadInputTypeDefFromID");
11504 query = query.arg_lazy(
11505 "id",
11506 Box::new(move || {
11507 let id = id.clone();
11508 Box::pin(async move { id.into_id().await.unwrap().quote() })
11509 }),
11510 );
11511 InputTypeDef {
11512 proc: self.proc.clone(),
11513 selection: query,
11514 graphql_client: self.graphql_client.clone(),
11515 }
11516 }
11517 pub fn load_interface_type_def_from_id(
11519 &self,
11520 id: impl IntoID<InterfaceTypeDefId>,
11521 ) -> InterfaceTypeDef {
11522 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
11523 query = query.arg_lazy(
11524 "id",
11525 Box::new(move || {
11526 let id = id.clone();
11527 Box::pin(async move { id.into_id().await.unwrap().quote() })
11528 }),
11529 );
11530 InterfaceTypeDef {
11531 proc: self.proc.clone(),
11532 selection: query,
11533 graphql_client: self.graphql_client.clone(),
11534 }
11535 }
11536 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
11538 let mut query = self.selection.select("loadJSONValueFromID");
11539 query = query.arg_lazy(
11540 "id",
11541 Box::new(move || {
11542 let id = id.clone();
11543 Box::pin(async move { id.into_id().await.unwrap().quote() })
11544 }),
11545 );
11546 JsonValue {
11547 proc: self.proc.clone(),
11548 selection: query,
11549 graphql_client: self.graphql_client.clone(),
11550 }
11551 }
11552 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
11554 let mut query = self.selection.select("loadLLMFromID");
11555 query = query.arg_lazy(
11556 "id",
11557 Box::new(move || {
11558 let id = id.clone();
11559 Box::pin(async move { id.into_id().await.unwrap().quote() })
11560 }),
11561 );
11562 Llm {
11563 proc: self.proc.clone(),
11564 selection: query,
11565 graphql_client: self.graphql_client.clone(),
11566 }
11567 }
11568 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
11570 let mut query = self.selection.select("loadLLMTokenUsageFromID");
11571 query = query.arg_lazy(
11572 "id",
11573 Box::new(move || {
11574 let id = id.clone();
11575 Box::pin(async move { id.into_id().await.unwrap().quote() })
11576 }),
11577 );
11578 LlmTokenUsage {
11579 proc: self.proc.clone(),
11580 selection: query,
11581 graphql_client: self.graphql_client.clone(),
11582 }
11583 }
11584 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
11586 let mut query = self.selection.select("loadLabelFromID");
11587 query = query.arg_lazy(
11588 "id",
11589 Box::new(move || {
11590 let id = id.clone();
11591 Box::pin(async move { id.into_id().await.unwrap().quote() })
11592 }),
11593 );
11594 Label {
11595 proc: self.proc.clone(),
11596 selection: query,
11597 graphql_client: self.graphql_client.clone(),
11598 }
11599 }
11600 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
11602 let mut query = self.selection.select("loadListTypeDefFromID");
11603 query = query.arg_lazy(
11604 "id",
11605 Box::new(move || {
11606 let id = id.clone();
11607 Box::pin(async move { id.into_id().await.unwrap().quote() })
11608 }),
11609 );
11610 ListTypeDef {
11611 proc: self.proc.clone(),
11612 selection: query,
11613 graphql_client: self.graphql_client.clone(),
11614 }
11615 }
11616 pub fn load_module_config_client_from_id(
11618 &self,
11619 id: impl IntoID<ModuleConfigClientId>,
11620 ) -> ModuleConfigClient {
11621 let mut query = self.selection.select("loadModuleConfigClientFromID");
11622 query = query.arg_lazy(
11623 "id",
11624 Box::new(move || {
11625 let id = id.clone();
11626 Box::pin(async move { id.into_id().await.unwrap().quote() })
11627 }),
11628 );
11629 ModuleConfigClient {
11630 proc: self.proc.clone(),
11631 selection: query,
11632 graphql_client: self.graphql_client.clone(),
11633 }
11634 }
11635 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
11637 let mut query = self.selection.select("loadModuleFromID");
11638 query = query.arg_lazy(
11639 "id",
11640 Box::new(move || {
11641 let id = id.clone();
11642 Box::pin(async move { id.into_id().await.unwrap().quote() })
11643 }),
11644 );
11645 Module {
11646 proc: self.proc.clone(),
11647 selection: query,
11648 graphql_client: self.graphql_client.clone(),
11649 }
11650 }
11651 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
11653 let mut query = self.selection.select("loadModuleSourceFromID");
11654 query = query.arg_lazy(
11655 "id",
11656 Box::new(move || {
11657 let id = id.clone();
11658 Box::pin(async move { id.into_id().await.unwrap().quote() })
11659 }),
11660 );
11661 ModuleSource {
11662 proc: self.proc.clone(),
11663 selection: query,
11664 graphql_client: self.graphql_client.clone(),
11665 }
11666 }
11667 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
11669 let mut query = self.selection.select("loadObjectTypeDefFromID");
11670 query = query.arg_lazy(
11671 "id",
11672 Box::new(move || {
11673 let id = id.clone();
11674 Box::pin(async move { id.into_id().await.unwrap().quote() })
11675 }),
11676 );
11677 ObjectTypeDef {
11678 proc: self.proc.clone(),
11679 selection: query,
11680 graphql_client: self.graphql_client.clone(),
11681 }
11682 }
11683 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
11685 let mut query = self.selection.select("loadPortFromID");
11686 query = query.arg_lazy(
11687 "id",
11688 Box::new(move || {
11689 let id = id.clone();
11690 Box::pin(async move { id.into_id().await.unwrap().quote() })
11691 }),
11692 );
11693 Port {
11694 proc: self.proc.clone(),
11695 selection: query,
11696 graphql_client: self.graphql_client.clone(),
11697 }
11698 }
11699 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
11701 let mut query = self.selection.select("loadSDKConfigFromID");
11702 query = query.arg_lazy(
11703 "id",
11704 Box::new(move || {
11705 let id = id.clone();
11706 Box::pin(async move { id.into_id().await.unwrap().quote() })
11707 }),
11708 );
11709 SdkConfig {
11710 proc: self.proc.clone(),
11711 selection: query,
11712 graphql_client: self.graphql_client.clone(),
11713 }
11714 }
11715 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
11717 let mut query = self.selection.select("loadScalarTypeDefFromID");
11718 query = query.arg_lazy(
11719 "id",
11720 Box::new(move || {
11721 let id = id.clone();
11722 Box::pin(async move { id.into_id().await.unwrap().quote() })
11723 }),
11724 );
11725 ScalarTypeDef {
11726 proc: self.proc.clone(),
11727 selection: query,
11728 graphql_client: self.graphql_client.clone(),
11729 }
11730 }
11731 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
11733 let mut query = self.selection.select("loadSearchResultFromID");
11734 query = query.arg_lazy(
11735 "id",
11736 Box::new(move || {
11737 let id = id.clone();
11738 Box::pin(async move { id.into_id().await.unwrap().quote() })
11739 }),
11740 );
11741 SearchResult {
11742 proc: self.proc.clone(),
11743 selection: query,
11744 graphql_client: self.graphql_client.clone(),
11745 }
11746 }
11747 pub fn load_search_submatch_from_id(
11749 &self,
11750 id: impl IntoID<SearchSubmatchId>,
11751 ) -> SearchSubmatch {
11752 let mut query = self.selection.select("loadSearchSubmatchFromID");
11753 query = query.arg_lazy(
11754 "id",
11755 Box::new(move || {
11756 let id = id.clone();
11757 Box::pin(async move { id.into_id().await.unwrap().quote() })
11758 }),
11759 );
11760 SearchSubmatch {
11761 proc: self.proc.clone(),
11762 selection: query,
11763 graphql_client: self.graphql_client.clone(),
11764 }
11765 }
11766 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
11768 let mut query = self.selection.select("loadSecretFromID");
11769 query = query.arg_lazy(
11770 "id",
11771 Box::new(move || {
11772 let id = id.clone();
11773 Box::pin(async move { id.into_id().await.unwrap().quote() })
11774 }),
11775 );
11776 Secret {
11777 proc: self.proc.clone(),
11778 selection: query,
11779 graphql_client: self.graphql_client.clone(),
11780 }
11781 }
11782 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
11784 let mut query = self.selection.select("loadServiceFromID");
11785 query = query.arg_lazy(
11786 "id",
11787 Box::new(move || {
11788 let id = id.clone();
11789 Box::pin(async move { id.into_id().await.unwrap().quote() })
11790 }),
11791 );
11792 Service {
11793 proc: self.proc.clone(),
11794 selection: query,
11795 graphql_client: self.graphql_client.clone(),
11796 }
11797 }
11798 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
11800 let mut query = self.selection.select("loadSocketFromID");
11801 query = query.arg_lazy(
11802 "id",
11803 Box::new(move || {
11804 let id = id.clone();
11805 Box::pin(async move { id.into_id().await.unwrap().quote() })
11806 }),
11807 );
11808 Socket {
11809 proc: self.proc.clone(),
11810 selection: query,
11811 graphql_client: self.graphql_client.clone(),
11812 }
11813 }
11814 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
11816 let mut query = self.selection.select("loadSourceMapFromID");
11817 query = query.arg_lazy(
11818 "id",
11819 Box::new(move || {
11820 let id = id.clone();
11821 Box::pin(async move { id.into_id().await.unwrap().quote() })
11822 }),
11823 );
11824 SourceMap {
11825 proc: self.proc.clone(),
11826 selection: query,
11827 graphql_client: self.graphql_client.clone(),
11828 }
11829 }
11830 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
11832 let mut query = self.selection.select("loadTerminalFromID");
11833 query = query.arg_lazy(
11834 "id",
11835 Box::new(move || {
11836 let id = id.clone();
11837 Box::pin(async move { id.into_id().await.unwrap().quote() })
11838 }),
11839 );
11840 Terminal {
11841 proc: self.proc.clone(),
11842 selection: query,
11843 graphql_client: self.graphql_client.clone(),
11844 }
11845 }
11846 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
11848 let mut query = self.selection.select("loadTypeDefFromID");
11849 query = query.arg_lazy(
11850 "id",
11851 Box::new(move || {
11852 let id = id.clone();
11853 Box::pin(async move { id.into_id().await.unwrap().quote() })
11854 }),
11855 );
11856 TypeDef {
11857 proc: self.proc.clone(),
11858 selection: query,
11859 graphql_client: self.graphql_client.clone(),
11860 }
11861 }
11862 pub fn module(&self) -> Module {
11864 let query = self.selection.select("module");
11865 Module {
11866 proc: self.proc.clone(),
11867 selection: query,
11868 graphql_client: self.graphql_client.clone(),
11869 }
11870 }
11871 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
11878 let mut query = self.selection.select("moduleSource");
11879 query = query.arg("refString", ref_string.into());
11880 ModuleSource {
11881 proc: self.proc.clone(),
11882 selection: query,
11883 graphql_client: self.graphql_client.clone(),
11884 }
11885 }
11886 pub fn module_source_opts<'a>(
11893 &self,
11894 ref_string: impl Into<String>,
11895 opts: QueryModuleSourceOpts<'a>,
11896 ) -> ModuleSource {
11897 let mut query = self.selection.select("moduleSource");
11898 query = query.arg("refString", ref_string.into());
11899 if let Some(ref_pin) = opts.ref_pin {
11900 query = query.arg("refPin", ref_pin);
11901 }
11902 if let Some(disable_find_up) = opts.disable_find_up {
11903 query = query.arg("disableFindUp", disable_find_up);
11904 }
11905 if let Some(allow_not_exists) = opts.allow_not_exists {
11906 query = query.arg("allowNotExists", allow_not_exists);
11907 }
11908 if let Some(require_kind) = opts.require_kind {
11909 query = query.arg("requireKind", require_kind);
11910 }
11911 ModuleSource {
11912 proc: self.proc.clone(),
11913 selection: query,
11914 graphql_client: self.graphql_client.clone(),
11915 }
11916 }
11917 pub fn secret(&self, uri: impl Into<String>) -> Secret {
11924 let mut query = self.selection.select("secret");
11925 query = query.arg("uri", uri.into());
11926 Secret {
11927 proc: self.proc.clone(),
11928 selection: query,
11929 graphql_client: self.graphql_client.clone(),
11930 }
11931 }
11932 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
11939 let mut query = self.selection.select("secret");
11940 query = query.arg("uri", uri.into());
11941 if let Some(cache_key) = opts.cache_key {
11942 query = query.arg("cacheKey", cache_key);
11943 }
11944 Secret {
11945 proc: self.proc.clone(),
11946 selection: query,
11947 graphql_client: self.graphql_client.clone(),
11948 }
11949 }
11950 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
11958 let mut query = self.selection.select("setSecret");
11959 query = query.arg("name", name.into());
11960 query = query.arg("plaintext", plaintext.into());
11961 Secret {
11962 proc: self.proc.clone(),
11963 selection: query,
11964 graphql_client: self.graphql_client.clone(),
11965 }
11966 }
11967 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
11975 let mut query = self.selection.select("sourceMap");
11976 query = query.arg("filename", filename.into());
11977 query = query.arg("line", line);
11978 query = query.arg("column", column);
11979 SourceMap {
11980 proc: self.proc.clone(),
11981 selection: query,
11982 graphql_client: self.graphql_client.clone(),
11983 }
11984 }
11985 pub fn type_def(&self) -> TypeDef {
11987 let query = self.selection.select("typeDef");
11988 TypeDef {
11989 proc: self.proc.clone(),
11990 selection: query,
11991 graphql_client: self.graphql_client.clone(),
11992 }
11993 }
11994 pub async fn version(&self) -> Result<String, DaggerError> {
11996 let query = self.selection.select("version");
11997 query.execute(self.graphql_client.clone()).await
11998 }
11999}
12000#[derive(Clone)]
12001pub struct SdkConfig {
12002 pub proc: Option<Arc<DaggerSessionProc>>,
12003 pub selection: Selection,
12004 pub graphql_client: DynGraphQLClient,
12005}
12006impl SdkConfig {
12007 pub async fn debug(&self) -> Result<bool, DaggerError> {
12009 let query = self.selection.select("debug");
12010 query.execute(self.graphql_client.clone()).await
12011 }
12012 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
12014 let query = self.selection.select("id");
12015 query.execute(self.graphql_client.clone()).await
12016 }
12017 pub async fn source(&self) -> Result<String, DaggerError> {
12019 let query = self.selection.select("source");
12020 query.execute(self.graphql_client.clone()).await
12021 }
12022}
12023#[derive(Clone)]
12024pub struct ScalarTypeDef {
12025 pub proc: Option<Arc<DaggerSessionProc>>,
12026 pub selection: Selection,
12027 pub graphql_client: DynGraphQLClient,
12028}
12029impl ScalarTypeDef {
12030 pub async fn description(&self) -> Result<String, DaggerError> {
12032 let query = self.selection.select("description");
12033 query.execute(self.graphql_client.clone()).await
12034 }
12035 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
12037 let query = self.selection.select("id");
12038 query.execute(self.graphql_client.clone()).await
12039 }
12040 pub async fn name(&self) -> Result<String, DaggerError> {
12042 let query = self.selection.select("name");
12043 query.execute(self.graphql_client.clone()).await
12044 }
12045 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12047 let query = self.selection.select("sourceModuleName");
12048 query.execute(self.graphql_client.clone()).await
12049 }
12050}
12051#[derive(Clone)]
12052pub struct SearchResult {
12053 pub proc: Option<Arc<DaggerSessionProc>>,
12054 pub selection: Selection,
12055 pub graphql_client: DynGraphQLClient,
12056}
12057impl SearchResult {
12058 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
12060 let query = self.selection.select("absoluteOffset");
12061 query.execute(self.graphql_client.clone()).await
12062 }
12063 pub async fn file_path(&self) -> Result<String, DaggerError> {
12065 let query = self.selection.select("filePath");
12066 query.execute(self.graphql_client.clone()).await
12067 }
12068 pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
12070 let query = self.selection.select("id");
12071 query.execute(self.graphql_client.clone()).await
12072 }
12073 pub async fn line_number(&self) -> Result<isize, DaggerError> {
12075 let query = self.selection.select("lineNumber");
12076 query.execute(self.graphql_client.clone()).await
12077 }
12078 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
12080 let query = self.selection.select("matchedLines");
12081 query.execute(self.graphql_client.clone()).await
12082 }
12083 pub fn submatches(&self) -> Vec<SearchSubmatch> {
12085 let query = self.selection.select("submatches");
12086 vec![SearchSubmatch {
12087 proc: self.proc.clone(),
12088 selection: query,
12089 graphql_client: self.graphql_client.clone(),
12090 }]
12091 }
12092}
12093#[derive(Clone)]
12094pub struct SearchSubmatch {
12095 pub proc: Option<Arc<DaggerSessionProc>>,
12096 pub selection: Selection,
12097 pub graphql_client: DynGraphQLClient,
12098}
12099impl SearchSubmatch {
12100 pub async fn end(&self) -> Result<isize, DaggerError> {
12102 let query = self.selection.select("end");
12103 query.execute(self.graphql_client.clone()).await
12104 }
12105 pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
12107 let query = self.selection.select("id");
12108 query.execute(self.graphql_client.clone()).await
12109 }
12110 pub async fn start(&self) -> Result<isize, DaggerError> {
12112 let query = self.selection.select("start");
12113 query.execute(self.graphql_client.clone()).await
12114 }
12115 pub async fn text(&self) -> Result<String, DaggerError> {
12117 let query = self.selection.select("text");
12118 query.execute(self.graphql_client.clone()).await
12119 }
12120}
12121#[derive(Clone)]
12122pub struct Secret {
12123 pub proc: Option<Arc<DaggerSessionProc>>,
12124 pub selection: Selection,
12125 pub graphql_client: DynGraphQLClient,
12126}
12127impl Secret {
12128 pub async fn id(&self) -> Result<SecretId, DaggerError> {
12130 let query = self.selection.select("id");
12131 query.execute(self.graphql_client.clone()).await
12132 }
12133 pub async fn name(&self) -> Result<String, DaggerError> {
12135 let query = self.selection.select("name");
12136 query.execute(self.graphql_client.clone()).await
12137 }
12138 pub async fn plaintext(&self) -> Result<String, DaggerError> {
12140 let query = self.selection.select("plaintext");
12141 query.execute(self.graphql_client.clone()).await
12142 }
12143 pub async fn uri(&self) -> Result<String, DaggerError> {
12145 let query = self.selection.select("uri");
12146 query.execute(self.graphql_client.clone()).await
12147 }
12148}
12149#[derive(Clone)]
12150pub struct Service {
12151 pub proc: Option<Arc<DaggerSessionProc>>,
12152 pub selection: Selection,
12153 pub graphql_client: DynGraphQLClient,
12154}
12155#[derive(Builder, Debug, PartialEq)]
12156pub struct ServiceEndpointOpts<'a> {
12157 #[builder(setter(into, strip_option), default)]
12159 pub port: Option<isize>,
12160 #[builder(setter(into, strip_option), default)]
12162 pub scheme: Option<&'a str>,
12163}
12164#[derive(Builder, Debug, PartialEq)]
12165pub struct ServiceStopOpts {
12166 #[builder(setter(into, strip_option), default)]
12168 pub kill: Option<bool>,
12169}
12170#[derive(Builder, Debug, PartialEq)]
12171pub struct ServiceTerminalOpts<'a> {
12172 #[builder(setter(into, strip_option), default)]
12173 pub cmd: Option<Vec<&'a str>>,
12174}
12175#[derive(Builder, Debug, PartialEq)]
12176pub struct ServiceUpOpts {
12177 #[builder(setter(into, strip_option), default)]
12180 pub ports: Option<Vec<PortForward>>,
12181 #[builder(setter(into, strip_option), default)]
12183 pub random: Option<bool>,
12184}
12185impl Service {
12186 pub async fn endpoint(&self) -> Result<String, DaggerError> {
12194 let query = self.selection.select("endpoint");
12195 query.execute(self.graphql_client.clone()).await
12196 }
12197 pub async fn endpoint_opts<'a>(
12205 &self,
12206 opts: ServiceEndpointOpts<'a>,
12207 ) -> Result<String, DaggerError> {
12208 let mut query = self.selection.select("endpoint");
12209 if let Some(port) = opts.port {
12210 query = query.arg("port", port);
12211 }
12212 if let Some(scheme) = opts.scheme {
12213 query = query.arg("scheme", scheme);
12214 }
12215 query.execute(self.graphql_client.clone()).await
12216 }
12217 pub async fn hostname(&self) -> Result<String, DaggerError> {
12219 let query = self.selection.select("hostname");
12220 query.execute(self.graphql_client.clone()).await
12221 }
12222 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
12224 let query = self.selection.select("id");
12225 query.execute(self.graphql_client.clone()).await
12226 }
12227 pub fn ports(&self) -> Vec<Port> {
12229 let query = self.selection.select("ports");
12230 vec![Port {
12231 proc: self.proc.clone(),
12232 selection: query,
12233 graphql_client: self.graphql_client.clone(),
12234 }]
12235 }
12236 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
12239 let query = self.selection.select("start");
12240 query.execute(self.graphql_client.clone()).await
12241 }
12242 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
12248 let query = self.selection.select("stop");
12249 query.execute(self.graphql_client.clone()).await
12250 }
12251 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
12257 let mut query = self.selection.select("stop");
12258 if let Some(kill) = opts.kill {
12259 query = query.arg("kill", kill);
12260 }
12261 query.execute(self.graphql_client.clone()).await
12262 }
12263 pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
12265 let query = self.selection.select("sync");
12266 query.execute(self.graphql_client.clone()).await
12267 }
12268 pub fn terminal(&self) -> Service {
12273 let query = self.selection.select("terminal");
12274 Service {
12275 proc: self.proc.clone(),
12276 selection: query,
12277 graphql_client: self.graphql_client.clone(),
12278 }
12279 }
12280 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
12285 let mut query = self.selection.select("terminal");
12286 if let Some(cmd) = opts.cmd {
12287 query = query.arg("cmd", cmd);
12288 }
12289 Service {
12290 proc: self.proc.clone(),
12291 selection: query,
12292 graphql_client: self.graphql_client.clone(),
12293 }
12294 }
12295 pub async fn up(&self) -> Result<Void, DaggerError> {
12301 let query = self.selection.select("up");
12302 query.execute(self.graphql_client.clone()).await
12303 }
12304 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
12310 let mut query = self.selection.select("up");
12311 if let Some(ports) = opts.ports {
12312 query = query.arg("ports", ports);
12313 }
12314 if let Some(random) = opts.random {
12315 query = query.arg("random", random);
12316 }
12317 query.execute(self.graphql_client.clone()).await
12318 }
12319 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
12325 let mut query = self.selection.select("withHostname");
12326 query = query.arg("hostname", hostname.into());
12327 Service {
12328 proc: self.proc.clone(),
12329 selection: query,
12330 graphql_client: self.graphql_client.clone(),
12331 }
12332 }
12333}
12334#[derive(Clone)]
12335pub struct Socket {
12336 pub proc: Option<Arc<DaggerSessionProc>>,
12337 pub selection: Selection,
12338 pub graphql_client: DynGraphQLClient,
12339}
12340impl Socket {
12341 pub async fn id(&self) -> Result<SocketId, DaggerError> {
12343 let query = self.selection.select("id");
12344 query.execute(self.graphql_client.clone()).await
12345 }
12346}
12347#[derive(Clone)]
12348pub struct SourceMap {
12349 pub proc: Option<Arc<DaggerSessionProc>>,
12350 pub selection: Selection,
12351 pub graphql_client: DynGraphQLClient,
12352}
12353impl SourceMap {
12354 pub async fn column(&self) -> Result<isize, DaggerError> {
12356 let query = self.selection.select("column");
12357 query.execute(self.graphql_client.clone()).await
12358 }
12359 pub async fn filename(&self) -> Result<String, DaggerError> {
12361 let query = self.selection.select("filename");
12362 query.execute(self.graphql_client.clone()).await
12363 }
12364 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
12366 let query = self.selection.select("id");
12367 query.execute(self.graphql_client.clone()).await
12368 }
12369 pub async fn line(&self) -> Result<isize, DaggerError> {
12371 let query = self.selection.select("line");
12372 query.execute(self.graphql_client.clone()).await
12373 }
12374 pub async fn module(&self) -> Result<String, DaggerError> {
12376 let query = self.selection.select("module");
12377 query.execute(self.graphql_client.clone()).await
12378 }
12379 pub async fn url(&self) -> Result<String, DaggerError> {
12381 let query = self.selection.select("url");
12382 query.execute(self.graphql_client.clone()).await
12383 }
12384}
12385#[derive(Clone)]
12386pub struct Terminal {
12387 pub proc: Option<Arc<DaggerSessionProc>>,
12388 pub selection: Selection,
12389 pub graphql_client: DynGraphQLClient,
12390}
12391impl Terminal {
12392 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
12394 let query = self.selection.select("id");
12395 query.execute(self.graphql_client.clone()).await
12396 }
12397 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
12400 let query = self.selection.select("sync");
12401 query.execute(self.graphql_client.clone()).await
12402 }
12403}
12404#[derive(Clone)]
12405pub struct TypeDef {
12406 pub proc: Option<Arc<DaggerSessionProc>>,
12407 pub selection: Selection,
12408 pub graphql_client: DynGraphQLClient,
12409}
12410#[derive(Builder, Debug, PartialEq)]
12411pub struct TypeDefWithEnumOpts<'a> {
12412 #[builder(setter(into, strip_option), default)]
12414 pub description: Option<&'a str>,
12415 #[builder(setter(into, strip_option), default)]
12417 pub source_map: Option<SourceMapId>,
12418}
12419#[derive(Builder, Debug, PartialEq)]
12420pub struct TypeDefWithEnumMemberOpts<'a> {
12421 #[builder(setter(into, strip_option), default)]
12423 pub deprecated: Option<&'a str>,
12424 #[builder(setter(into, strip_option), default)]
12426 pub description: Option<&'a str>,
12427 #[builder(setter(into, strip_option), default)]
12429 pub source_map: Option<SourceMapId>,
12430 #[builder(setter(into, strip_option), default)]
12432 pub value: Option<&'a str>,
12433}
12434#[derive(Builder, Debug, PartialEq)]
12435pub struct TypeDefWithEnumValueOpts<'a> {
12436 #[builder(setter(into, strip_option), default)]
12438 pub deprecated: Option<&'a str>,
12439 #[builder(setter(into, strip_option), default)]
12441 pub description: Option<&'a str>,
12442 #[builder(setter(into, strip_option), default)]
12444 pub source_map: Option<SourceMapId>,
12445}
12446#[derive(Builder, Debug, PartialEq)]
12447pub struct TypeDefWithFieldOpts<'a> {
12448 #[builder(setter(into, strip_option), default)]
12450 pub deprecated: Option<&'a str>,
12451 #[builder(setter(into, strip_option), default)]
12453 pub description: Option<&'a str>,
12454 #[builder(setter(into, strip_option), default)]
12456 pub source_map: Option<SourceMapId>,
12457}
12458#[derive(Builder, Debug, PartialEq)]
12459pub struct TypeDefWithInterfaceOpts<'a> {
12460 #[builder(setter(into, strip_option), default)]
12461 pub description: Option<&'a str>,
12462 #[builder(setter(into, strip_option), default)]
12463 pub source_map: Option<SourceMapId>,
12464}
12465#[derive(Builder, Debug, PartialEq)]
12466pub struct TypeDefWithObjectOpts<'a> {
12467 #[builder(setter(into, strip_option), default)]
12468 pub deprecated: Option<&'a str>,
12469 #[builder(setter(into, strip_option), default)]
12470 pub description: Option<&'a str>,
12471 #[builder(setter(into, strip_option), default)]
12472 pub source_map: Option<SourceMapId>,
12473}
12474#[derive(Builder, Debug, PartialEq)]
12475pub struct TypeDefWithScalarOpts<'a> {
12476 #[builder(setter(into, strip_option), default)]
12477 pub description: Option<&'a str>,
12478}
12479impl TypeDef {
12480 pub fn as_enum(&self) -> EnumTypeDef {
12482 let query = self.selection.select("asEnum");
12483 EnumTypeDef {
12484 proc: self.proc.clone(),
12485 selection: query,
12486 graphql_client: self.graphql_client.clone(),
12487 }
12488 }
12489 pub fn as_input(&self) -> InputTypeDef {
12491 let query = self.selection.select("asInput");
12492 InputTypeDef {
12493 proc: self.proc.clone(),
12494 selection: query,
12495 graphql_client: self.graphql_client.clone(),
12496 }
12497 }
12498 pub fn as_interface(&self) -> InterfaceTypeDef {
12500 let query = self.selection.select("asInterface");
12501 InterfaceTypeDef {
12502 proc: self.proc.clone(),
12503 selection: query,
12504 graphql_client: self.graphql_client.clone(),
12505 }
12506 }
12507 pub fn as_list(&self) -> ListTypeDef {
12509 let query = self.selection.select("asList");
12510 ListTypeDef {
12511 proc: self.proc.clone(),
12512 selection: query,
12513 graphql_client: self.graphql_client.clone(),
12514 }
12515 }
12516 pub fn as_object(&self) -> ObjectTypeDef {
12518 let query = self.selection.select("asObject");
12519 ObjectTypeDef {
12520 proc: self.proc.clone(),
12521 selection: query,
12522 graphql_client: self.graphql_client.clone(),
12523 }
12524 }
12525 pub fn as_scalar(&self) -> ScalarTypeDef {
12527 let query = self.selection.select("asScalar");
12528 ScalarTypeDef {
12529 proc: self.proc.clone(),
12530 selection: query,
12531 graphql_client: self.graphql_client.clone(),
12532 }
12533 }
12534 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
12536 let query = self.selection.select("id");
12537 query.execute(self.graphql_client.clone()).await
12538 }
12539 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
12541 let query = self.selection.select("kind");
12542 query.execute(self.graphql_client.clone()).await
12543 }
12544 pub async fn optional(&self) -> Result<bool, DaggerError> {
12546 let query = self.selection.select("optional");
12547 query.execute(self.graphql_client.clone()).await
12548 }
12549 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12551 let mut query = self.selection.select("withConstructor");
12552 query = query.arg_lazy(
12553 "function",
12554 Box::new(move || {
12555 let function = function.clone();
12556 Box::pin(async move { function.into_id().await.unwrap().quote() })
12557 }),
12558 );
12559 TypeDef {
12560 proc: self.proc.clone(),
12561 selection: query,
12562 graphql_client: self.graphql_client.clone(),
12563 }
12564 }
12565 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
12573 let mut query = self.selection.select("withEnum");
12574 query = query.arg("name", name.into());
12575 TypeDef {
12576 proc: self.proc.clone(),
12577 selection: query,
12578 graphql_client: self.graphql_client.clone(),
12579 }
12580 }
12581 pub fn with_enum_opts<'a>(
12589 &self,
12590 name: impl Into<String>,
12591 opts: TypeDefWithEnumOpts<'a>,
12592 ) -> TypeDef {
12593 let mut query = self.selection.select("withEnum");
12594 query = query.arg("name", name.into());
12595 if let Some(description) = opts.description {
12596 query = query.arg("description", description);
12597 }
12598 if let Some(source_map) = opts.source_map {
12599 query = query.arg("sourceMap", source_map);
12600 }
12601 TypeDef {
12602 proc: self.proc.clone(),
12603 selection: query,
12604 graphql_client: self.graphql_client.clone(),
12605 }
12606 }
12607 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
12614 let mut query = self.selection.select("withEnumMember");
12615 query = query.arg("name", name.into());
12616 TypeDef {
12617 proc: self.proc.clone(),
12618 selection: query,
12619 graphql_client: self.graphql_client.clone(),
12620 }
12621 }
12622 pub fn with_enum_member_opts<'a>(
12629 &self,
12630 name: impl Into<String>,
12631 opts: TypeDefWithEnumMemberOpts<'a>,
12632 ) -> TypeDef {
12633 let mut query = self.selection.select("withEnumMember");
12634 query = query.arg("name", name.into());
12635 if let Some(value) = opts.value {
12636 query = query.arg("value", value);
12637 }
12638 if let Some(description) = opts.description {
12639 query = query.arg("description", description);
12640 }
12641 if let Some(source_map) = opts.source_map {
12642 query = query.arg("sourceMap", source_map);
12643 }
12644 if let Some(deprecated) = opts.deprecated {
12645 query = query.arg("deprecated", deprecated);
12646 }
12647 TypeDef {
12648 proc: self.proc.clone(),
12649 selection: query,
12650 graphql_client: self.graphql_client.clone(),
12651 }
12652 }
12653 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
12660 let mut query = self.selection.select("withEnumValue");
12661 query = query.arg("value", value.into());
12662 TypeDef {
12663 proc: self.proc.clone(),
12664 selection: query,
12665 graphql_client: self.graphql_client.clone(),
12666 }
12667 }
12668 pub fn with_enum_value_opts<'a>(
12675 &self,
12676 value: impl Into<String>,
12677 opts: TypeDefWithEnumValueOpts<'a>,
12678 ) -> TypeDef {
12679 let mut query = self.selection.select("withEnumValue");
12680 query = query.arg("value", value.into());
12681 if let Some(description) = opts.description {
12682 query = query.arg("description", description);
12683 }
12684 if let Some(source_map) = opts.source_map {
12685 query = query.arg("sourceMap", source_map);
12686 }
12687 if let Some(deprecated) = opts.deprecated {
12688 query = query.arg("deprecated", deprecated);
12689 }
12690 TypeDef {
12691 proc: self.proc.clone(),
12692 selection: query,
12693 graphql_client: self.graphql_client.clone(),
12694 }
12695 }
12696 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
12704 let mut query = self.selection.select("withField");
12705 query = query.arg("name", name.into());
12706 query = query.arg_lazy(
12707 "typeDef",
12708 Box::new(move || {
12709 let type_def = type_def.clone();
12710 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12711 }),
12712 );
12713 TypeDef {
12714 proc: self.proc.clone(),
12715 selection: query,
12716 graphql_client: self.graphql_client.clone(),
12717 }
12718 }
12719 pub fn with_field_opts<'a>(
12727 &self,
12728 name: impl Into<String>,
12729 type_def: impl IntoID<TypeDefId>,
12730 opts: TypeDefWithFieldOpts<'a>,
12731 ) -> TypeDef {
12732 let mut query = self.selection.select("withField");
12733 query = query.arg("name", name.into());
12734 query = query.arg_lazy(
12735 "typeDef",
12736 Box::new(move || {
12737 let type_def = type_def.clone();
12738 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12739 }),
12740 );
12741 if let Some(description) = opts.description {
12742 query = query.arg("description", description);
12743 }
12744 if let Some(source_map) = opts.source_map {
12745 query = query.arg("sourceMap", source_map);
12746 }
12747 if let Some(deprecated) = opts.deprecated {
12748 query = query.arg("deprecated", deprecated);
12749 }
12750 TypeDef {
12751 proc: self.proc.clone(),
12752 selection: query,
12753 graphql_client: self.graphql_client.clone(),
12754 }
12755 }
12756 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12758 let mut query = self.selection.select("withFunction");
12759 query = query.arg_lazy(
12760 "function",
12761 Box::new(move || {
12762 let function = function.clone();
12763 Box::pin(async move { function.into_id().await.unwrap().quote() })
12764 }),
12765 );
12766 TypeDef {
12767 proc: self.proc.clone(),
12768 selection: query,
12769 graphql_client: self.graphql_client.clone(),
12770 }
12771 }
12772 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
12778 let mut query = self.selection.select("withInterface");
12779 query = query.arg("name", name.into());
12780 TypeDef {
12781 proc: self.proc.clone(),
12782 selection: query,
12783 graphql_client: self.graphql_client.clone(),
12784 }
12785 }
12786 pub fn with_interface_opts<'a>(
12792 &self,
12793 name: impl Into<String>,
12794 opts: TypeDefWithInterfaceOpts<'a>,
12795 ) -> TypeDef {
12796 let mut query = self.selection.select("withInterface");
12797 query = query.arg("name", name.into());
12798 if let Some(description) = opts.description {
12799 query = query.arg("description", description);
12800 }
12801 if let Some(source_map) = opts.source_map {
12802 query = query.arg("sourceMap", source_map);
12803 }
12804 TypeDef {
12805 proc: self.proc.clone(),
12806 selection: query,
12807 graphql_client: self.graphql_client.clone(),
12808 }
12809 }
12810 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
12812 let mut query = self.selection.select("withKind");
12813 query = query.arg("kind", kind);
12814 TypeDef {
12815 proc: self.proc.clone(),
12816 selection: query,
12817 graphql_client: self.graphql_client.clone(),
12818 }
12819 }
12820 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
12822 let mut query = self.selection.select("withListOf");
12823 query = query.arg_lazy(
12824 "elementType",
12825 Box::new(move || {
12826 let element_type = element_type.clone();
12827 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
12828 }),
12829 );
12830 TypeDef {
12831 proc: self.proc.clone(),
12832 selection: query,
12833 graphql_client: self.graphql_client.clone(),
12834 }
12835 }
12836 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
12843 let mut query = self.selection.select("withObject");
12844 query = query.arg("name", name.into());
12845 TypeDef {
12846 proc: self.proc.clone(),
12847 selection: query,
12848 graphql_client: self.graphql_client.clone(),
12849 }
12850 }
12851 pub fn with_object_opts<'a>(
12858 &self,
12859 name: impl Into<String>,
12860 opts: TypeDefWithObjectOpts<'a>,
12861 ) -> TypeDef {
12862 let mut query = self.selection.select("withObject");
12863 query = query.arg("name", name.into());
12864 if let Some(description) = opts.description {
12865 query = query.arg("description", description);
12866 }
12867 if let Some(source_map) = opts.source_map {
12868 query = query.arg("sourceMap", source_map);
12869 }
12870 if let Some(deprecated) = opts.deprecated {
12871 query = query.arg("deprecated", deprecated);
12872 }
12873 TypeDef {
12874 proc: self.proc.clone(),
12875 selection: query,
12876 graphql_client: self.graphql_client.clone(),
12877 }
12878 }
12879 pub fn with_optional(&self, optional: bool) -> TypeDef {
12881 let mut query = self.selection.select("withOptional");
12882 query = query.arg("optional", optional);
12883 TypeDef {
12884 proc: self.proc.clone(),
12885 selection: query,
12886 graphql_client: self.graphql_client.clone(),
12887 }
12888 }
12889 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
12895 let mut query = self.selection.select("withScalar");
12896 query = query.arg("name", name.into());
12897 TypeDef {
12898 proc: self.proc.clone(),
12899 selection: query,
12900 graphql_client: self.graphql_client.clone(),
12901 }
12902 }
12903 pub fn with_scalar_opts<'a>(
12909 &self,
12910 name: impl Into<String>,
12911 opts: TypeDefWithScalarOpts<'a>,
12912 ) -> TypeDef {
12913 let mut query = self.selection.select("withScalar");
12914 query = query.arg("name", name.into());
12915 if let Some(description) = opts.description {
12916 query = query.arg("description", description);
12917 }
12918 TypeDef {
12919 proc: self.proc.clone(),
12920 selection: query,
12921 graphql_client: self.graphql_client.clone(),
12922 }
12923 }
12924}
12925#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12926pub enum CacheSharingMode {
12927 #[serde(rename = "LOCKED")]
12928 Locked,
12929 #[serde(rename = "PRIVATE")]
12930 Private,
12931 #[serde(rename = "SHARED")]
12932 Shared,
12933}
12934#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12935pub enum ExistsType {
12936 #[serde(rename = "DIRECTORY_TYPE")]
12937 DirectoryType,
12938 #[serde(rename = "REGULAR_TYPE")]
12939 RegularType,
12940 #[serde(rename = "SYMLINK_TYPE")]
12941 SymlinkType,
12942}
12943#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12944pub enum FunctionCachePolicy {
12945 #[serde(rename = "Default")]
12946 Default,
12947 #[serde(rename = "Never")]
12948 Never,
12949 #[serde(rename = "PerSession")]
12950 PerSession,
12951}
12952#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12953pub enum ImageLayerCompression {
12954 #[serde(rename = "EStarGZ")]
12955 EStarGz,
12956 #[serde(rename = "ESTARGZ")]
12957 Estargz,
12958 #[serde(rename = "Gzip")]
12959 Gzip,
12960 #[serde(rename = "Uncompressed")]
12961 Uncompressed,
12962 #[serde(rename = "Zstd")]
12963 Zstd,
12964}
12965#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12966pub enum ImageMediaTypes {
12967 #[serde(rename = "DOCKER")]
12968 Docker,
12969 #[serde(rename = "DockerMediaTypes")]
12970 DockerMediaTypes,
12971 #[serde(rename = "OCI")]
12972 Oci,
12973 #[serde(rename = "OCIMediaTypes")]
12974 OciMediaTypes,
12975}
12976#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12977pub enum ModuleSourceExperimentalFeature {
12978 #[serde(rename = "SELF_CALLS")]
12979 SelfCalls,
12980}
12981#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12982pub enum ModuleSourceKind {
12983 #[serde(rename = "DIR")]
12984 Dir,
12985 #[serde(rename = "DIR_SOURCE")]
12986 DirSource,
12987 #[serde(rename = "GIT")]
12988 Git,
12989 #[serde(rename = "GIT_SOURCE")]
12990 GitSource,
12991 #[serde(rename = "LOCAL")]
12992 Local,
12993 #[serde(rename = "LOCAL_SOURCE")]
12994 LocalSource,
12995}
12996#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12997pub enum NetworkProtocol {
12998 #[serde(rename = "TCP")]
12999 Tcp,
13000 #[serde(rename = "UDP")]
13001 Udp,
13002}
13003#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13004pub enum ReturnType {
13005 #[serde(rename = "ANY")]
13006 Any,
13007 #[serde(rename = "FAILURE")]
13008 Failure,
13009 #[serde(rename = "SUCCESS")]
13010 Success,
13011}
13012#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13013pub enum TypeDefKind {
13014 #[serde(rename = "BOOLEAN")]
13015 Boolean,
13016 #[serde(rename = "BOOLEAN_KIND")]
13017 BooleanKind,
13018 #[serde(rename = "ENUM")]
13019 Enum,
13020 #[serde(rename = "ENUM_KIND")]
13021 EnumKind,
13022 #[serde(rename = "FLOAT")]
13023 Float,
13024 #[serde(rename = "FLOAT_KIND")]
13025 FloatKind,
13026 #[serde(rename = "INPUT")]
13027 Input,
13028 #[serde(rename = "INPUT_KIND")]
13029 InputKind,
13030 #[serde(rename = "INTEGER")]
13031 Integer,
13032 #[serde(rename = "INTEGER_KIND")]
13033 IntegerKind,
13034 #[serde(rename = "INTERFACE")]
13035 Interface,
13036 #[serde(rename = "INTERFACE_KIND")]
13037 InterfaceKind,
13038 #[serde(rename = "LIST")]
13039 List,
13040 #[serde(rename = "LIST_KIND")]
13041 ListKind,
13042 #[serde(rename = "OBJECT")]
13043 Object,
13044 #[serde(rename = "OBJECT_KIND")]
13045 ObjectKind,
13046 #[serde(rename = "SCALAR")]
13047 Scalar,
13048 #[serde(rename = "SCALAR_KIND")]
13049 ScalarKind,
13050 #[serde(rename = "STRING")]
13051 String,
13052 #[serde(rename = "STRING_KIND")]
13053 StringKind,
13054 #[serde(rename = "VOID")]
13055 Void,
13056 #[serde(rename = "VOID_KIND")]
13057 VoidKind,
13058}