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 BindingId(pub String);
14impl From<&str> for BindingId {
15 fn from(value: &str) -> Self {
16 Self(value.to_string())
17 }
18}
19impl From<String> for BindingId {
20 fn from(value: String) -> Self {
21 Self(value)
22 }
23}
24impl IntoID<BindingId> for Binding {
25 fn into_id(
26 self,
27 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
28 {
29 Box::pin(async move { self.id().await })
30 }
31}
32impl IntoID<BindingId> for BindingId {
33 fn into_id(
34 self,
35 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
36 {
37 Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
38 }
39}
40impl BindingId {
41 fn quote(&self) -> String {
42 format!("\"{}\"", self.0.clone())
43 }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct CacheVolumeId(pub String);
47impl From<&str> for CacheVolumeId {
48 fn from(value: &str) -> Self {
49 Self(value.to_string())
50 }
51}
52impl From<String> for CacheVolumeId {
53 fn from(value: String) -> Self {
54 Self(value)
55 }
56}
57impl IntoID<CacheVolumeId> for CacheVolume {
58 fn into_id(
59 self,
60 ) -> std::pin::Pin<
61 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
62 > {
63 Box::pin(async move { self.id().await })
64 }
65}
66impl IntoID<CacheVolumeId> for CacheVolumeId {
67 fn into_id(
68 self,
69 ) -> std::pin::Pin<
70 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
71 > {
72 Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
73 }
74}
75impl CacheVolumeId {
76 fn quote(&self) -> String {
77 format!("\"{}\"", self.0.clone())
78 }
79}
80#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
81pub struct CloudId(pub String);
82impl From<&str> for CloudId {
83 fn from(value: &str) -> Self {
84 Self(value.to_string())
85 }
86}
87impl From<String> for CloudId {
88 fn from(value: String) -> Self {
89 Self(value)
90 }
91}
92impl IntoID<CloudId> for Cloud {
93 fn into_id(
94 self,
95 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
96 {
97 Box::pin(async move { self.id().await })
98 }
99}
100impl IntoID<CloudId> for CloudId {
101 fn into_id(
102 self,
103 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
104 {
105 Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
106 }
107}
108impl CloudId {
109 fn quote(&self) -> String {
110 format!("\"{}\"", self.0.clone())
111 }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ContainerId(pub String);
115impl From<&str> for ContainerId {
116 fn from(value: &str) -> Self {
117 Self(value.to_string())
118 }
119}
120impl From<String> for ContainerId {
121 fn from(value: String) -> Self {
122 Self(value)
123 }
124}
125impl IntoID<ContainerId> for Container {
126 fn into_id(
127 self,
128 ) -> std::pin::Pin<
129 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
130 > {
131 Box::pin(async move { self.id().await })
132 }
133}
134impl IntoID<ContainerId> for ContainerId {
135 fn into_id(
136 self,
137 ) -> std::pin::Pin<
138 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
139 > {
140 Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
141 }
142}
143impl ContainerId {
144 fn quote(&self) -> String {
145 format!("\"{}\"", self.0.clone())
146 }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CurrentModuleId(pub String);
150impl From<&str> for CurrentModuleId {
151 fn from(value: &str) -> Self {
152 Self(value.to_string())
153 }
154}
155impl From<String> for CurrentModuleId {
156 fn from(value: String) -> Self {
157 Self(value)
158 }
159}
160impl IntoID<CurrentModuleId> for CurrentModule {
161 fn into_id(
162 self,
163 ) -> std::pin::Pin<
164 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
165 > {
166 Box::pin(async move { self.id().await })
167 }
168}
169impl IntoID<CurrentModuleId> for CurrentModuleId {
170 fn into_id(
171 self,
172 ) -> std::pin::Pin<
173 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
174 > {
175 Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
176 }
177}
178impl CurrentModuleId {
179 fn quote(&self) -> String {
180 format!("\"{}\"", self.0.clone())
181 }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct DirectoryId(pub String);
185impl From<&str> for DirectoryId {
186 fn from(value: &str) -> Self {
187 Self(value.to_string())
188 }
189}
190impl From<String> for DirectoryId {
191 fn from(value: String) -> Self {
192 Self(value)
193 }
194}
195impl IntoID<DirectoryId> for Directory {
196 fn into_id(
197 self,
198 ) -> std::pin::Pin<
199 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
200 > {
201 Box::pin(async move { self.id().await })
202 }
203}
204impl IntoID<DirectoryId> for DirectoryId {
205 fn into_id(
206 self,
207 ) -> std::pin::Pin<
208 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
209 > {
210 Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
211 }
212}
213impl DirectoryId {
214 fn quote(&self) -> String {
215 format!("\"{}\"", self.0.clone())
216 }
217}
218#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
219pub struct EngineCacheEntryId(pub String);
220impl From<&str> for EngineCacheEntryId {
221 fn from(value: &str) -> Self {
222 Self(value.to_string())
223 }
224}
225impl From<String> for EngineCacheEntryId {
226 fn from(value: String) -> Self {
227 Self(value)
228 }
229}
230impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
231 fn into_id(
232 self,
233 ) -> std::pin::Pin<
234 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
235 > {
236 Box::pin(async move { self.id().await })
237 }
238}
239impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
240 fn into_id(
241 self,
242 ) -> std::pin::Pin<
243 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
244 > {
245 Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
246 }
247}
248impl EngineCacheEntryId {
249 fn quote(&self) -> String {
250 format!("\"{}\"", self.0.clone())
251 }
252}
253#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
254pub struct EngineCacheEntrySetId(pub String);
255impl From<&str> for EngineCacheEntrySetId {
256 fn from(value: &str) -> Self {
257 Self(value.to_string())
258 }
259}
260impl From<String> for EngineCacheEntrySetId {
261 fn from(value: String) -> Self {
262 Self(value)
263 }
264}
265impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
266 fn into_id(
267 self,
268 ) -> std::pin::Pin<
269 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
270 > {
271 Box::pin(async move { self.id().await })
272 }
273}
274impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
275 fn into_id(
276 self,
277 ) -> std::pin::Pin<
278 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
279 > {
280 Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
281 }
282}
283impl EngineCacheEntrySetId {
284 fn quote(&self) -> String {
285 format!("\"{}\"", self.0.clone())
286 }
287}
288#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
289pub struct EngineCacheId(pub String);
290impl From<&str> for EngineCacheId {
291 fn from(value: &str) -> Self {
292 Self(value.to_string())
293 }
294}
295impl From<String> for EngineCacheId {
296 fn from(value: String) -> Self {
297 Self(value)
298 }
299}
300impl IntoID<EngineCacheId> for EngineCache {
301 fn into_id(
302 self,
303 ) -> std::pin::Pin<
304 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
305 > {
306 Box::pin(async move { self.id().await })
307 }
308}
309impl IntoID<EngineCacheId> for EngineCacheId {
310 fn into_id(
311 self,
312 ) -> std::pin::Pin<
313 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
314 > {
315 Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
316 }
317}
318impl EngineCacheId {
319 fn quote(&self) -> String {
320 format!("\"{}\"", self.0.clone())
321 }
322}
323#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
324pub struct EngineId(pub String);
325impl From<&str> for EngineId {
326 fn from(value: &str) -> Self {
327 Self(value.to_string())
328 }
329}
330impl From<String> for EngineId {
331 fn from(value: String) -> Self {
332 Self(value)
333 }
334}
335impl IntoID<EngineId> for Engine {
336 fn into_id(
337 self,
338 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
339 {
340 Box::pin(async move { self.id().await })
341 }
342}
343impl IntoID<EngineId> for EngineId {
344 fn into_id(
345 self,
346 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
347 {
348 Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
349 }
350}
351impl EngineId {
352 fn quote(&self) -> String {
353 format!("\"{}\"", self.0.clone())
354 }
355}
356#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
357pub struct EnumTypeDefId(pub String);
358impl From<&str> for EnumTypeDefId {
359 fn from(value: &str) -> Self {
360 Self(value.to_string())
361 }
362}
363impl From<String> for EnumTypeDefId {
364 fn from(value: String) -> Self {
365 Self(value)
366 }
367}
368impl IntoID<EnumTypeDefId> for EnumTypeDef {
369 fn into_id(
370 self,
371 ) -> std::pin::Pin<
372 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
373 > {
374 Box::pin(async move { self.id().await })
375 }
376}
377impl IntoID<EnumTypeDefId> for EnumTypeDefId {
378 fn into_id(
379 self,
380 ) -> std::pin::Pin<
381 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
382 > {
383 Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
384 }
385}
386impl EnumTypeDefId {
387 fn quote(&self) -> String {
388 format!("\"{}\"", self.0.clone())
389 }
390}
391#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
392pub struct EnumValueTypeDefId(pub String);
393impl From<&str> for EnumValueTypeDefId {
394 fn from(value: &str) -> Self {
395 Self(value.to_string())
396 }
397}
398impl From<String> for EnumValueTypeDefId {
399 fn from(value: String) -> Self {
400 Self(value)
401 }
402}
403impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
404 fn into_id(
405 self,
406 ) -> std::pin::Pin<
407 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
408 > {
409 Box::pin(async move { self.id().await })
410 }
411}
412impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
413 fn into_id(
414 self,
415 ) -> std::pin::Pin<
416 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
417 > {
418 Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
419 }
420}
421impl EnumValueTypeDefId {
422 fn quote(&self) -> String {
423 format!("\"{}\"", self.0.clone())
424 }
425}
426#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
427pub struct EnvId(pub String);
428impl From<&str> for EnvId {
429 fn from(value: &str) -> Self {
430 Self(value.to_string())
431 }
432}
433impl From<String> for EnvId {
434 fn from(value: String) -> Self {
435 Self(value)
436 }
437}
438impl IntoID<EnvId> for Env {
439 fn into_id(
440 self,
441 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
442 {
443 Box::pin(async move { self.id().await })
444 }
445}
446impl IntoID<EnvId> for EnvId {
447 fn into_id(
448 self,
449 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
450 {
451 Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
452 }
453}
454impl EnvId {
455 fn quote(&self) -> String {
456 format!("\"{}\"", self.0.clone())
457 }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EnvVariableId(pub String);
461impl From<&str> for EnvVariableId {
462 fn from(value: &str) -> Self {
463 Self(value.to_string())
464 }
465}
466impl From<String> for EnvVariableId {
467 fn from(value: String) -> Self {
468 Self(value)
469 }
470}
471impl IntoID<EnvVariableId> for EnvVariable {
472 fn into_id(
473 self,
474 ) -> std::pin::Pin<
475 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
476 > {
477 Box::pin(async move { self.id().await })
478 }
479}
480impl IntoID<EnvVariableId> for EnvVariableId {
481 fn into_id(
482 self,
483 ) -> std::pin::Pin<
484 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
485 > {
486 Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
487 }
488}
489impl EnvVariableId {
490 fn quote(&self) -> String {
491 format!("\"{}\"", self.0.clone())
492 }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct ErrorId(pub String);
496impl From<&str> for ErrorId {
497 fn from(value: &str) -> Self {
498 Self(value.to_string())
499 }
500}
501impl From<String> for ErrorId {
502 fn from(value: String) -> Self {
503 Self(value)
504 }
505}
506impl IntoID<ErrorId> for Error {
507 fn into_id(
508 self,
509 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
510 {
511 Box::pin(async move { self.id().await })
512 }
513}
514impl IntoID<ErrorId> for ErrorId {
515 fn into_id(
516 self,
517 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
518 {
519 Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
520 }
521}
522impl ErrorId {
523 fn quote(&self) -> String {
524 format!("\"{}\"", self.0.clone())
525 }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct ErrorValueId(pub String);
529impl From<&str> for ErrorValueId {
530 fn from(value: &str) -> Self {
531 Self(value.to_string())
532 }
533}
534impl From<String> for ErrorValueId {
535 fn from(value: String) -> Self {
536 Self(value)
537 }
538}
539impl IntoID<ErrorValueId> for ErrorValue {
540 fn into_id(
541 self,
542 ) -> std::pin::Pin<
543 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
544 > {
545 Box::pin(async move { self.id().await })
546 }
547}
548impl IntoID<ErrorValueId> for ErrorValueId {
549 fn into_id(
550 self,
551 ) -> std::pin::Pin<
552 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
553 > {
554 Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
555 }
556}
557impl ErrorValueId {
558 fn quote(&self) -> String {
559 format!("\"{}\"", self.0.clone())
560 }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct FieldTypeDefId(pub String);
564impl From<&str> for FieldTypeDefId {
565 fn from(value: &str) -> Self {
566 Self(value.to_string())
567 }
568}
569impl From<String> for FieldTypeDefId {
570 fn from(value: String) -> Self {
571 Self(value)
572 }
573}
574impl IntoID<FieldTypeDefId> for FieldTypeDef {
575 fn into_id(
576 self,
577 ) -> std::pin::Pin<
578 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
579 > {
580 Box::pin(async move { self.id().await })
581 }
582}
583impl IntoID<FieldTypeDefId> for FieldTypeDefId {
584 fn into_id(
585 self,
586 ) -> std::pin::Pin<
587 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
588 > {
589 Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
590 }
591}
592impl FieldTypeDefId {
593 fn quote(&self) -> String {
594 format!("\"{}\"", self.0.clone())
595 }
596}
597#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
598pub struct FileId(pub String);
599impl From<&str> for FileId {
600 fn from(value: &str) -> Self {
601 Self(value.to_string())
602 }
603}
604impl From<String> for FileId {
605 fn from(value: String) -> Self {
606 Self(value)
607 }
608}
609impl IntoID<FileId> for File {
610 fn into_id(
611 self,
612 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
613 {
614 Box::pin(async move { self.id().await })
615 }
616}
617impl IntoID<FileId> for FileId {
618 fn into_id(
619 self,
620 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
621 {
622 Box::pin(async move { Ok::<FileId, DaggerError>(self) })
623 }
624}
625impl FileId {
626 fn quote(&self) -> String {
627 format!("\"{}\"", self.0.clone())
628 }
629}
630#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
631pub struct FunctionArgId(pub String);
632impl From<&str> for FunctionArgId {
633 fn from(value: &str) -> Self {
634 Self(value.to_string())
635 }
636}
637impl From<String> for FunctionArgId {
638 fn from(value: String) -> Self {
639 Self(value)
640 }
641}
642impl IntoID<FunctionArgId> for FunctionArg {
643 fn into_id(
644 self,
645 ) -> std::pin::Pin<
646 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
647 > {
648 Box::pin(async move { self.id().await })
649 }
650}
651impl IntoID<FunctionArgId> for FunctionArgId {
652 fn into_id(
653 self,
654 ) -> std::pin::Pin<
655 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
656 > {
657 Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
658 }
659}
660impl FunctionArgId {
661 fn quote(&self) -> String {
662 format!("\"{}\"", self.0.clone())
663 }
664}
665#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
666pub struct FunctionCallArgValueId(pub String);
667impl From<&str> for FunctionCallArgValueId {
668 fn from(value: &str) -> Self {
669 Self(value.to_string())
670 }
671}
672impl From<String> for FunctionCallArgValueId {
673 fn from(value: String) -> Self {
674 Self(value)
675 }
676}
677impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
678 fn into_id(
679 self,
680 ) -> std::pin::Pin<
681 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
682 > {
683 Box::pin(async move { self.id().await })
684 }
685}
686impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
687 fn into_id(
688 self,
689 ) -> std::pin::Pin<
690 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
691 > {
692 Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
693 }
694}
695impl FunctionCallArgValueId {
696 fn quote(&self) -> String {
697 format!("\"{}\"", self.0.clone())
698 }
699}
700#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
701pub struct FunctionCallId(pub String);
702impl From<&str> for FunctionCallId {
703 fn from(value: &str) -> Self {
704 Self(value.to_string())
705 }
706}
707impl From<String> for FunctionCallId {
708 fn from(value: String) -> Self {
709 Self(value)
710 }
711}
712impl IntoID<FunctionCallId> for FunctionCall {
713 fn into_id(
714 self,
715 ) -> std::pin::Pin<
716 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
717 > {
718 Box::pin(async move { self.id().await })
719 }
720}
721impl IntoID<FunctionCallId> for FunctionCallId {
722 fn into_id(
723 self,
724 ) -> std::pin::Pin<
725 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
726 > {
727 Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
728 }
729}
730impl FunctionCallId {
731 fn quote(&self) -> String {
732 format!("\"{}\"", self.0.clone())
733 }
734}
735#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
736pub struct FunctionId(pub String);
737impl From<&str> for FunctionId {
738 fn from(value: &str) -> Self {
739 Self(value.to_string())
740 }
741}
742impl From<String> for FunctionId {
743 fn from(value: String) -> Self {
744 Self(value)
745 }
746}
747impl IntoID<FunctionId> for Function {
748 fn into_id(
749 self,
750 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
751 {
752 Box::pin(async move { self.id().await })
753 }
754}
755impl IntoID<FunctionId> for FunctionId {
756 fn into_id(
757 self,
758 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
759 {
760 Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
761 }
762}
763impl FunctionId {
764 fn quote(&self) -> String {
765 format!("\"{}\"", self.0.clone())
766 }
767}
768#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
769pub struct GeneratedCodeId(pub String);
770impl From<&str> for GeneratedCodeId {
771 fn from(value: &str) -> Self {
772 Self(value.to_string())
773 }
774}
775impl From<String> for GeneratedCodeId {
776 fn from(value: String) -> Self {
777 Self(value)
778 }
779}
780impl IntoID<GeneratedCodeId> for GeneratedCode {
781 fn into_id(
782 self,
783 ) -> std::pin::Pin<
784 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
785 > {
786 Box::pin(async move { self.id().await })
787 }
788}
789impl IntoID<GeneratedCodeId> for GeneratedCodeId {
790 fn into_id(
791 self,
792 ) -> std::pin::Pin<
793 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
794 > {
795 Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
796 }
797}
798impl GeneratedCodeId {
799 fn quote(&self) -> String {
800 format!("\"{}\"", self.0.clone())
801 }
802}
803#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
804pub struct GitRefId(pub String);
805impl From<&str> for GitRefId {
806 fn from(value: &str) -> Self {
807 Self(value.to_string())
808 }
809}
810impl From<String> for GitRefId {
811 fn from(value: String) -> Self {
812 Self(value)
813 }
814}
815impl IntoID<GitRefId> for GitRef {
816 fn into_id(
817 self,
818 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
819 {
820 Box::pin(async move { self.id().await })
821 }
822}
823impl IntoID<GitRefId> for GitRefId {
824 fn into_id(
825 self,
826 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
827 {
828 Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
829 }
830}
831impl GitRefId {
832 fn quote(&self) -> String {
833 format!("\"{}\"", self.0.clone())
834 }
835}
836#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
837pub struct GitRepositoryId(pub String);
838impl From<&str> for GitRepositoryId {
839 fn from(value: &str) -> Self {
840 Self(value.to_string())
841 }
842}
843impl From<String> for GitRepositoryId {
844 fn from(value: String) -> Self {
845 Self(value)
846 }
847}
848impl IntoID<GitRepositoryId> for GitRepository {
849 fn into_id(
850 self,
851 ) -> std::pin::Pin<
852 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
853 > {
854 Box::pin(async move { self.id().await })
855 }
856}
857impl IntoID<GitRepositoryId> for GitRepositoryId {
858 fn into_id(
859 self,
860 ) -> std::pin::Pin<
861 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
862 > {
863 Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
864 }
865}
866impl GitRepositoryId {
867 fn quote(&self) -> String {
868 format!("\"{}\"", self.0.clone())
869 }
870}
871#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
872pub struct HostId(pub String);
873impl From<&str> for HostId {
874 fn from(value: &str) -> Self {
875 Self(value.to_string())
876 }
877}
878impl From<String> for HostId {
879 fn from(value: String) -> Self {
880 Self(value)
881 }
882}
883impl IntoID<HostId> for Host {
884 fn into_id(
885 self,
886 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
887 {
888 Box::pin(async move { self.id().await })
889 }
890}
891impl IntoID<HostId> for HostId {
892 fn into_id(
893 self,
894 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
895 {
896 Box::pin(async move { Ok::<HostId, DaggerError>(self) })
897 }
898}
899impl HostId {
900 fn quote(&self) -> String {
901 format!("\"{}\"", self.0.clone())
902 }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct InputTypeDefId(pub String);
906impl From<&str> for InputTypeDefId {
907 fn from(value: &str) -> Self {
908 Self(value.to_string())
909 }
910}
911impl From<String> for InputTypeDefId {
912 fn from(value: String) -> Self {
913 Self(value)
914 }
915}
916impl IntoID<InputTypeDefId> for InputTypeDef {
917 fn into_id(
918 self,
919 ) -> std::pin::Pin<
920 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
921 > {
922 Box::pin(async move { self.id().await })
923 }
924}
925impl IntoID<InputTypeDefId> for InputTypeDefId {
926 fn into_id(
927 self,
928 ) -> std::pin::Pin<
929 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
930 > {
931 Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
932 }
933}
934impl InputTypeDefId {
935 fn quote(&self) -> String {
936 format!("\"{}\"", self.0.clone())
937 }
938}
939#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
940pub struct InterfaceTypeDefId(pub String);
941impl From<&str> for InterfaceTypeDefId {
942 fn from(value: &str) -> Self {
943 Self(value.to_string())
944 }
945}
946impl From<String> for InterfaceTypeDefId {
947 fn from(value: String) -> Self {
948 Self(value)
949 }
950}
951impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
952 fn into_id(
953 self,
954 ) -> std::pin::Pin<
955 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
956 > {
957 Box::pin(async move { self.id().await })
958 }
959}
960impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
961 fn into_id(
962 self,
963 ) -> std::pin::Pin<
964 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
965 > {
966 Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
967 }
968}
969impl InterfaceTypeDefId {
970 fn quote(&self) -> String {
971 format!("\"{}\"", self.0.clone())
972 }
973}
974#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
975pub struct Json(pub String);
976impl From<&str> for Json {
977 fn from(value: &str) -> Self {
978 Self(value.to_string())
979 }
980}
981impl From<String> for Json {
982 fn from(value: String) -> Self {
983 Self(value)
984 }
985}
986impl Json {
987 fn quote(&self) -> String {
988 format!("\"{}\"", self.0.clone())
989 }
990}
991#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
992pub struct JsonValueId(pub String);
993impl From<&str> for JsonValueId {
994 fn from(value: &str) -> Self {
995 Self(value.to_string())
996 }
997}
998impl From<String> for JsonValueId {
999 fn from(value: String) -> Self {
1000 Self(value)
1001 }
1002}
1003impl IntoID<JsonValueId> for JsonValue {
1004 fn into_id(
1005 self,
1006 ) -> std::pin::Pin<
1007 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1008 > {
1009 Box::pin(async move { self.id().await })
1010 }
1011}
1012impl IntoID<JsonValueId> for JsonValueId {
1013 fn into_id(
1014 self,
1015 ) -> std::pin::Pin<
1016 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1017 > {
1018 Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1019 }
1020}
1021impl JsonValueId {
1022 fn quote(&self) -> String {
1023 format!("\"{}\"", self.0.clone())
1024 }
1025}
1026#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1027pub struct Llmid(pub String);
1028impl From<&str> for Llmid {
1029 fn from(value: &str) -> Self {
1030 Self(value.to_string())
1031 }
1032}
1033impl From<String> for Llmid {
1034 fn from(value: String) -> Self {
1035 Self(value)
1036 }
1037}
1038impl IntoID<Llmid> for Llm {
1039 fn into_id(
1040 self,
1041 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1042 {
1043 Box::pin(async move { self.id().await })
1044 }
1045}
1046impl IntoID<Llmid> for Llmid {
1047 fn into_id(
1048 self,
1049 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1050 {
1051 Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1052 }
1053}
1054impl Llmid {
1055 fn quote(&self) -> String {
1056 format!("\"{}\"", self.0.clone())
1057 }
1058}
1059#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1060pub struct LlmTokenUsageId(pub String);
1061impl From<&str> for LlmTokenUsageId {
1062 fn from(value: &str) -> Self {
1063 Self(value.to_string())
1064 }
1065}
1066impl From<String> for LlmTokenUsageId {
1067 fn from(value: String) -> Self {
1068 Self(value)
1069 }
1070}
1071impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1072 fn into_id(
1073 self,
1074 ) -> std::pin::Pin<
1075 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1076 > {
1077 Box::pin(async move { self.id().await })
1078 }
1079}
1080impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1081 fn into_id(
1082 self,
1083 ) -> std::pin::Pin<
1084 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1085 > {
1086 Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1087 }
1088}
1089impl LlmTokenUsageId {
1090 fn quote(&self) -> String {
1091 format!("\"{}\"", self.0.clone())
1092 }
1093}
1094#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1095pub struct LabelId(pub String);
1096impl From<&str> for LabelId {
1097 fn from(value: &str) -> Self {
1098 Self(value.to_string())
1099 }
1100}
1101impl From<String> for LabelId {
1102 fn from(value: String) -> Self {
1103 Self(value)
1104 }
1105}
1106impl IntoID<LabelId> for Label {
1107 fn into_id(
1108 self,
1109 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1110 {
1111 Box::pin(async move { self.id().await })
1112 }
1113}
1114impl IntoID<LabelId> for LabelId {
1115 fn into_id(
1116 self,
1117 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1118 {
1119 Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1120 }
1121}
1122impl LabelId {
1123 fn quote(&self) -> String {
1124 format!("\"{}\"", self.0.clone())
1125 }
1126}
1127#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1128pub struct ListTypeDefId(pub String);
1129impl From<&str> for ListTypeDefId {
1130 fn from(value: &str) -> Self {
1131 Self(value.to_string())
1132 }
1133}
1134impl From<String> for ListTypeDefId {
1135 fn from(value: String) -> Self {
1136 Self(value)
1137 }
1138}
1139impl IntoID<ListTypeDefId> for ListTypeDef {
1140 fn into_id(
1141 self,
1142 ) -> std::pin::Pin<
1143 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1144 > {
1145 Box::pin(async move { self.id().await })
1146 }
1147}
1148impl IntoID<ListTypeDefId> for ListTypeDefId {
1149 fn into_id(
1150 self,
1151 ) -> std::pin::Pin<
1152 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1153 > {
1154 Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1155 }
1156}
1157impl ListTypeDefId {
1158 fn quote(&self) -> String {
1159 format!("\"{}\"", self.0.clone())
1160 }
1161}
1162#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1163pub struct ModuleConfigClientId(pub String);
1164impl From<&str> for ModuleConfigClientId {
1165 fn from(value: &str) -> Self {
1166 Self(value.to_string())
1167 }
1168}
1169impl From<String> for ModuleConfigClientId {
1170 fn from(value: String) -> Self {
1171 Self(value)
1172 }
1173}
1174impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1175 fn into_id(
1176 self,
1177 ) -> std::pin::Pin<
1178 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1179 > {
1180 Box::pin(async move { self.id().await })
1181 }
1182}
1183impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1184 fn into_id(
1185 self,
1186 ) -> std::pin::Pin<
1187 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1188 > {
1189 Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1190 }
1191}
1192impl ModuleConfigClientId {
1193 fn quote(&self) -> String {
1194 format!("\"{}\"", self.0.clone())
1195 }
1196}
1197#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1198pub struct ModuleId(pub String);
1199impl From<&str> for ModuleId {
1200 fn from(value: &str) -> Self {
1201 Self(value.to_string())
1202 }
1203}
1204impl From<String> for ModuleId {
1205 fn from(value: String) -> Self {
1206 Self(value)
1207 }
1208}
1209impl IntoID<ModuleId> for Module {
1210 fn into_id(
1211 self,
1212 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1213 {
1214 Box::pin(async move { self.id().await })
1215 }
1216}
1217impl IntoID<ModuleId> for ModuleId {
1218 fn into_id(
1219 self,
1220 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1221 {
1222 Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1223 }
1224}
1225impl ModuleId {
1226 fn quote(&self) -> String {
1227 format!("\"{}\"", self.0.clone())
1228 }
1229}
1230#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1231pub struct ModuleSourceId(pub String);
1232impl From<&str> for ModuleSourceId {
1233 fn from(value: &str) -> Self {
1234 Self(value.to_string())
1235 }
1236}
1237impl From<String> for ModuleSourceId {
1238 fn from(value: String) -> Self {
1239 Self(value)
1240 }
1241}
1242impl IntoID<ModuleSourceId> for ModuleSource {
1243 fn into_id(
1244 self,
1245 ) -> std::pin::Pin<
1246 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1247 > {
1248 Box::pin(async move { self.id().await })
1249 }
1250}
1251impl IntoID<ModuleSourceId> for ModuleSourceId {
1252 fn into_id(
1253 self,
1254 ) -> std::pin::Pin<
1255 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1256 > {
1257 Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1258 }
1259}
1260impl ModuleSourceId {
1261 fn quote(&self) -> String {
1262 format!("\"{}\"", self.0.clone())
1263 }
1264}
1265#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1266pub struct ObjectTypeDefId(pub String);
1267impl From<&str> for ObjectTypeDefId {
1268 fn from(value: &str) -> Self {
1269 Self(value.to_string())
1270 }
1271}
1272impl From<String> for ObjectTypeDefId {
1273 fn from(value: String) -> Self {
1274 Self(value)
1275 }
1276}
1277impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1278 fn into_id(
1279 self,
1280 ) -> std::pin::Pin<
1281 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1282 > {
1283 Box::pin(async move { self.id().await })
1284 }
1285}
1286impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1287 fn into_id(
1288 self,
1289 ) -> std::pin::Pin<
1290 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1291 > {
1292 Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1293 }
1294}
1295impl ObjectTypeDefId {
1296 fn quote(&self) -> String {
1297 format!("\"{}\"", self.0.clone())
1298 }
1299}
1300#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1301pub struct Platform(pub String);
1302impl From<&str> for Platform {
1303 fn from(value: &str) -> Self {
1304 Self(value.to_string())
1305 }
1306}
1307impl From<String> for Platform {
1308 fn from(value: String) -> Self {
1309 Self(value)
1310 }
1311}
1312impl Platform {
1313 fn quote(&self) -> String {
1314 format!("\"{}\"", self.0.clone())
1315 }
1316}
1317#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1318pub struct PortId(pub String);
1319impl From<&str> for PortId {
1320 fn from(value: &str) -> Self {
1321 Self(value.to_string())
1322 }
1323}
1324impl From<String> for PortId {
1325 fn from(value: String) -> Self {
1326 Self(value)
1327 }
1328}
1329impl IntoID<PortId> for Port {
1330 fn into_id(
1331 self,
1332 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1333 {
1334 Box::pin(async move { self.id().await })
1335 }
1336}
1337impl IntoID<PortId> for PortId {
1338 fn into_id(
1339 self,
1340 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1341 {
1342 Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1343 }
1344}
1345impl PortId {
1346 fn quote(&self) -> String {
1347 format!("\"{}\"", self.0.clone())
1348 }
1349}
1350#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1351pub struct SdkConfigId(pub String);
1352impl From<&str> for SdkConfigId {
1353 fn from(value: &str) -> Self {
1354 Self(value.to_string())
1355 }
1356}
1357impl From<String> for SdkConfigId {
1358 fn from(value: String) -> Self {
1359 Self(value)
1360 }
1361}
1362impl IntoID<SdkConfigId> for SdkConfig {
1363 fn into_id(
1364 self,
1365 ) -> std::pin::Pin<
1366 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1367 > {
1368 Box::pin(async move { self.id().await })
1369 }
1370}
1371impl IntoID<SdkConfigId> for SdkConfigId {
1372 fn into_id(
1373 self,
1374 ) -> std::pin::Pin<
1375 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1376 > {
1377 Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1378 }
1379}
1380impl SdkConfigId {
1381 fn quote(&self) -> String {
1382 format!("\"{}\"", self.0.clone())
1383 }
1384}
1385#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1386pub struct ScalarTypeDefId(pub String);
1387impl From<&str> for ScalarTypeDefId {
1388 fn from(value: &str) -> Self {
1389 Self(value.to_string())
1390 }
1391}
1392impl From<String> for ScalarTypeDefId {
1393 fn from(value: String) -> Self {
1394 Self(value)
1395 }
1396}
1397impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1398 fn into_id(
1399 self,
1400 ) -> std::pin::Pin<
1401 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1402 > {
1403 Box::pin(async move { self.id().await })
1404 }
1405}
1406impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1407 fn into_id(
1408 self,
1409 ) -> std::pin::Pin<
1410 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1411 > {
1412 Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1413 }
1414}
1415impl ScalarTypeDefId {
1416 fn quote(&self) -> String {
1417 format!("\"{}\"", self.0.clone())
1418 }
1419}
1420#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1421pub struct SearchResultId(pub String);
1422impl From<&str> for SearchResultId {
1423 fn from(value: &str) -> Self {
1424 Self(value.to_string())
1425 }
1426}
1427impl From<String> for SearchResultId {
1428 fn from(value: String) -> Self {
1429 Self(value)
1430 }
1431}
1432impl IntoID<SearchResultId> for SearchResult {
1433 fn into_id(
1434 self,
1435 ) -> std::pin::Pin<
1436 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1437 > {
1438 Box::pin(async move { self.id().await })
1439 }
1440}
1441impl IntoID<SearchResultId> for SearchResultId {
1442 fn into_id(
1443 self,
1444 ) -> std::pin::Pin<
1445 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1446 > {
1447 Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1448 }
1449}
1450impl SearchResultId {
1451 fn quote(&self) -> String {
1452 format!("\"{}\"", self.0.clone())
1453 }
1454}
1455#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1456pub struct SearchSubmatchId(pub String);
1457impl From<&str> for SearchSubmatchId {
1458 fn from(value: &str) -> Self {
1459 Self(value.to_string())
1460 }
1461}
1462impl From<String> for SearchSubmatchId {
1463 fn from(value: String) -> Self {
1464 Self(value)
1465 }
1466}
1467impl IntoID<SearchSubmatchId> for SearchSubmatch {
1468 fn into_id(
1469 self,
1470 ) -> std::pin::Pin<
1471 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1472 > {
1473 Box::pin(async move { self.id().await })
1474 }
1475}
1476impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1477 fn into_id(
1478 self,
1479 ) -> std::pin::Pin<
1480 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1481 > {
1482 Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1483 }
1484}
1485impl SearchSubmatchId {
1486 fn quote(&self) -> String {
1487 format!("\"{}\"", self.0.clone())
1488 }
1489}
1490#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1491pub struct SecretId(pub String);
1492impl From<&str> for SecretId {
1493 fn from(value: &str) -> Self {
1494 Self(value.to_string())
1495 }
1496}
1497impl From<String> for SecretId {
1498 fn from(value: String) -> Self {
1499 Self(value)
1500 }
1501}
1502impl IntoID<SecretId> for Secret {
1503 fn into_id(
1504 self,
1505 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1506 {
1507 Box::pin(async move { self.id().await })
1508 }
1509}
1510impl IntoID<SecretId> for SecretId {
1511 fn into_id(
1512 self,
1513 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1514 {
1515 Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1516 }
1517}
1518impl SecretId {
1519 fn quote(&self) -> String {
1520 format!("\"{}\"", self.0.clone())
1521 }
1522}
1523#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1524pub struct ServiceId(pub String);
1525impl From<&str> for ServiceId {
1526 fn from(value: &str) -> Self {
1527 Self(value.to_string())
1528 }
1529}
1530impl From<String> for ServiceId {
1531 fn from(value: String) -> Self {
1532 Self(value)
1533 }
1534}
1535impl IntoID<ServiceId> for Service {
1536 fn into_id(
1537 self,
1538 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1539 {
1540 Box::pin(async move { self.id().await })
1541 }
1542}
1543impl IntoID<ServiceId> for ServiceId {
1544 fn into_id(
1545 self,
1546 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1547 {
1548 Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1549 }
1550}
1551impl ServiceId {
1552 fn quote(&self) -> String {
1553 format!("\"{}\"", self.0.clone())
1554 }
1555}
1556#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1557pub struct SocketId(pub String);
1558impl From<&str> for SocketId {
1559 fn from(value: &str) -> Self {
1560 Self(value.to_string())
1561 }
1562}
1563impl From<String> for SocketId {
1564 fn from(value: String) -> Self {
1565 Self(value)
1566 }
1567}
1568impl IntoID<SocketId> for Socket {
1569 fn into_id(
1570 self,
1571 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1572 {
1573 Box::pin(async move { self.id().await })
1574 }
1575}
1576impl IntoID<SocketId> for SocketId {
1577 fn into_id(
1578 self,
1579 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1580 {
1581 Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1582 }
1583}
1584impl SocketId {
1585 fn quote(&self) -> String {
1586 format!("\"{}\"", self.0.clone())
1587 }
1588}
1589#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1590pub struct SourceMapId(pub String);
1591impl From<&str> for SourceMapId {
1592 fn from(value: &str) -> Self {
1593 Self(value.to_string())
1594 }
1595}
1596impl From<String> for SourceMapId {
1597 fn from(value: String) -> Self {
1598 Self(value)
1599 }
1600}
1601impl IntoID<SourceMapId> for SourceMap {
1602 fn into_id(
1603 self,
1604 ) -> std::pin::Pin<
1605 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1606 > {
1607 Box::pin(async move { self.id().await })
1608 }
1609}
1610impl IntoID<SourceMapId> for SourceMapId {
1611 fn into_id(
1612 self,
1613 ) -> std::pin::Pin<
1614 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1615 > {
1616 Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1617 }
1618}
1619impl SourceMapId {
1620 fn quote(&self) -> String {
1621 format!("\"{}\"", self.0.clone())
1622 }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct TerminalId(pub String);
1626impl From<&str> for TerminalId {
1627 fn from(value: &str) -> Self {
1628 Self(value.to_string())
1629 }
1630}
1631impl From<String> for TerminalId {
1632 fn from(value: String) -> Self {
1633 Self(value)
1634 }
1635}
1636impl IntoID<TerminalId> for Terminal {
1637 fn into_id(
1638 self,
1639 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1640 {
1641 Box::pin(async move { self.id().await })
1642 }
1643}
1644impl IntoID<TerminalId> for TerminalId {
1645 fn into_id(
1646 self,
1647 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1648 {
1649 Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1650 }
1651}
1652impl TerminalId {
1653 fn quote(&self) -> String {
1654 format!("\"{}\"", self.0.clone())
1655 }
1656}
1657#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1658pub struct TypeDefId(pub String);
1659impl From<&str> for TypeDefId {
1660 fn from(value: &str) -> Self {
1661 Self(value.to_string())
1662 }
1663}
1664impl From<String> for TypeDefId {
1665 fn from(value: String) -> Self {
1666 Self(value)
1667 }
1668}
1669impl IntoID<TypeDefId> for TypeDef {
1670 fn into_id(
1671 self,
1672 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1673 {
1674 Box::pin(async move { self.id().await })
1675 }
1676}
1677impl IntoID<TypeDefId> for TypeDefId {
1678 fn into_id(
1679 self,
1680 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1681 {
1682 Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1683 }
1684}
1685impl TypeDefId {
1686 fn quote(&self) -> String {
1687 format!("\"{}\"", self.0.clone())
1688 }
1689}
1690#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1691pub struct Void(pub String);
1692impl From<&str> for Void {
1693 fn from(value: &str) -> Self {
1694 Self(value.to_string())
1695 }
1696}
1697impl From<String> for Void {
1698 fn from(value: String) -> Self {
1699 Self(value)
1700 }
1701}
1702impl Void {
1703 fn quote(&self) -> String {
1704 format!("\"{}\"", self.0.clone())
1705 }
1706}
1707#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1708pub struct BuildArg {
1709 pub name: String,
1710 pub value: String,
1711}
1712#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1713pub struct PipelineLabel {
1714 pub name: String,
1715 pub value: String,
1716}
1717#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1718pub struct PortForward {
1719 pub backend: isize,
1720 pub frontend: isize,
1721 pub protocol: NetworkProtocol,
1722}
1723#[derive(Clone)]
1724pub struct Binding {
1725 pub proc: Option<Arc<DaggerSessionProc>>,
1726 pub selection: Selection,
1727 pub graphql_client: DynGraphQLClient,
1728}
1729impl Binding {
1730 pub fn as_cache_volume(&self) -> CacheVolume {
1732 let query = self.selection.select("asCacheVolume");
1733 CacheVolume {
1734 proc: self.proc.clone(),
1735 selection: query,
1736 graphql_client: self.graphql_client.clone(),
1737 }
1738 }
1739 pub fn as_cloud(&self) -> Cloud {
1741 let query = self.selection.select("asCloud");
1742 Cloud {
1743 proc: self.proc.clone(),
1744 selection: query,
1745 graphql_client: self.graphql_client.clone(),
1746 }
1747 }
1748 pub fn as_container(&self) -> Container {
1750 let query = self.selection.select("asContainer");
1751 Container {
1752 proc: self.proc.clone(),
1753 selection: query,
1754 graphql_client: self.graphql_client.clone(),
1755 }
1756 }
1757 pub fn as_directory(&self) -> Directory {
1759 let query = self.selection.select("asDirectory");
1760 Directory {
1761 proc: self.proc.clone(),
1762 selection: query,
1763 graphql_client: self.graphql_client.clone(),
1764 }
1765 }
1766 pub fn as_env(&self) -> Env {
1768 let query = self.selection.select("asEnv");
1769 Env {
1770 proc: self.proc.clone(),
1771 selection: query,
1772 graphql_client: self.graphql_client.clone(),
1773 }
1774 }
1775 pub fn as_file(&self) -> File {
1777 let query = self.selection.select("asFile");
1778 File {
1779 proc: self.proc.clone(),
1780 selection: query,
1781 graphql_client: self.graphql_client.clone(),
1782 }
1783 }
1784 pub fn as_git_ref(&self) -> GitRef {
1786 let query = self.selection.select("asGitRef");
1787 GitRef {
1788 proc: self.proc.clone(),
1789 selection: query,
1790 graphql_client: self.graphql_client.clone(),
1791 }
1792 }
1793 pub fn as_git_repository(&self) -> GitRepository {
1795 let query = self.selection.select("asGitRepository");
1796 GitRepository {
1797 proc: self.proc.clone(),
1798 selection: query,
1799 graphql_client: self.graphql_client.clone(),
1800 }
1801 }
1802 pub fn as_json_value(&self) -> JsonValue {
1804 let query = self.selection.select("asJSONValue");
1805 JsonValue {
1806 proc: self.proc.clone(),
1807 selection: query,
1808 graphql_client: self.graphql_client.clone(),
1809 }
1810 }
1811 pub fn as_llm(&self) -> Llm {
1813 let query = self.selection.select("asLLM");
1814 Llm {
1815 proc: self.proc.clone(),
1816 selection: query,
1817 graphql_client: self.graphql_client.clone(),
1818 }
1819 }
1820 pub fn as_module(&self) -> Module {
1822 let query = self.selection.select("asModule");
1823 Module {
1824 proc: self.proc.clone(),
1825 selection: query,
1826 graphql_client: self.graphql_client.clone(),
1827 }
1828 }
1829 pub fn as_module_config_client(&self) -> ModuleConfigClient {
1831 let query = self.selection.select("asModuleConfigClient");
1832 ModuleConfigClient {
1833 proc: self.proc.clone(),
1834 selection: query,
1835 graphql_client: self.graphql_client.clone(),
1836 }
1837 }
1838 pub fn as_module_source(&self) -> ModuleSource {
1840 let query = self.selection.select("asModuleSource");
1841 ModuleSource {
1842 proc: self.proc.clone(),
1843 selection: query,
1844 graphql_client: self.graphql_client.clone(),
1845 }
1846 }
1847 pub fn as_search_result(&self) -> SearchResult {
1849 let query = self.selection.select("asSearchResult");
1850 SearchResult {
1851 proc: self.proc.clone(),
1852 selection: query,
1853 graphql_client: self.graphql_client.clone(),
1854 }
1855 }
1856 pub fn as_search_submatch(&self) -> SearchSubmatch {
1858 let query = self.selection.select("asSearchSubmatch");
1859 SearchSubmatch {
1860 proc: self.proc.clone(),
1861 selection: query,
1862 graphql_client: self.graphql_client.clone(),
1863 }
1864 }
1865 pub fn as_secret(&self) -> Secret {
1867 let query = self.selection.select("asSecret");
1868 Secret {
1869 proc: self.proc.clone(),
1870 selection: query,
1871 graphql_client: self.graphql_client.clone(),
1872 }
1873 }
1874 pub fn as_service(&self) -> Service {
1876 let query = self.selection.select("asService");
1877 Service {
1878 proc: self.proc.clone(),
1879 selection: query,
1880 graphql_client: self.graphql_client.clone(),
1881 }
1882 }
1883 pub fn as_socket(&self) -> Socket {
1885 let query = self.selection.select("asSocket");
1886 Socket {
1887 proc: self.proc.clone(),
1888 selection: query,
1889 graphql_client: self.graphql_client.clone(),
1890 }
1891 }
1892 pub async fn as_string(&self) -> Result<String, DaggerError> {
1894 let query = self.selection.select("asString");
1895 query.execute(self.graphql_client.clone()).await
1896 }
1897 pub async fn digest(&self) -> Result<String, DaggerError> {
1899 let query = self.selection.select("digest");
1900 query.execute(self.graphql_client.clone()).await
1901 }
1902 pub async fn id(&self) -> Result<BindingId, DaggerError> {
1904 let query = self.selection.select("id");
1905 query.execute(self.graphql_client.clone()).await
1906 }
1907 pub async fn is_null(&self) -> Result<bool, DaggerError> {
1909 let query = self.selection.select("isNull");
1910 query.execute(self.graphql_client.clone()).await
1911 }
1912 pub async fn name(&self) -> Result<String, DaggerError> {
1914 let query = self.selection.select("name");
1915 query.execute(self.graphql_client.clone()).await
1916 }
1917 pub async fn type_name(&self) -> Result<String, DaggerError> {
1919 let query = self.selection.select("typeName");
1920 query.execute(self.graphql_client.clone()).await
1921 }
1922}
1923#[derive(Clone)]
1924pub struct CacheVolume {
1925 pub proc: Option<Arc<DaggerSessionProc>>,
1926 pub selection: Selection,
1927 pub graphql_client: DynGraphQLClient,
1928}
1929impl CacheVolume {
1930 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
1932 let query = self.selection.select("id");
1933 query.execute(self.graphql_client.clone()).await
1934 }
1935}
1936#[derive(Clone)]
1937pub struct Cloud {
1938 pub proc: Option<Arc<DaggerSessionProc>>,
1939 pub selection: Selection,
1940 pub graphql_client: DynGraphQLClient,
1941}
1942impl Cloud {
1943 pub async fn id(&self) -> Result<CloudId, DaggerError> {
1945 let query = self.selection.select("id");
1946 query.execute(self.graphql_client.clone()).await
1947 }
1948 pub async fn trace_url(&self) -> Result<String, DaggerError> {
1950 let query = self.selection.select("traceURL");
1951 query.execute(self.graphql_client.clone()).await
1952 }
1953}
1954#[derive(Clone)]
1955pub struct Container {
1956 pub proc: Option<Arc<DaggerSessionProc>>,
1957 pub selection: Selection,
1958 pub graphql_client: DynGraphQLClient,
1959}
1960#[derive(Builder, Debug, PartialEq)]
1961pub struct ContainerAsServiceOpts<'a> {
1962 #[builder(setter(into, strip_option), default)]
1965 pub args: Option<Vec<&'a str>>,
1966 #[builder(setter(into, strip_option), default)]
1968 pub expand: Option<bool>,
1969 #[builder(setter(into, strip_option), default)]
1971 pub experimental_privileged_nesting: Option<bool>,
1972 #[builder(setter(into, strip_option), default)]
1974 pub insecure_root_capabilities: Option<bool>,
1975 #[builder(setter(into, strip_option), default)]
1978 pub no_init: Option<bool>,
1979 #[builder(setter(into, strip_option), default)]
1981 pub use_entrypoint: Option<bool>,
1982}
1983#[derive(Builder, Debug, PartialEq)]
1984pub struct ContainerAsTarballOpts {
1985 #[builder(setter(into, strip_option), default)]
1988 pub forced_compression: Option<ImageLayerCompression>,
1989 #[builder(setter(into, strip_option), default)]
1992 pub media_types: Option<ImageMediaTypes>,
1993 #[builder(setter(into, strip_option), default)]
1996 pub platform_variants: Option<Vec<ContainerId>>,
1997}
1998#[derive(Builder, Debug, PartialEq)]
1999pub struct ContainerBuildOpts<'a> {
2000 #[builder(setter(into, strip_option), default)]
2002 pub build_args: Option<Vec<BuildArg>>,
2003 #[builder(setter(into, strip_option), default)]
2005 pub dockerfile: Option<&'a str>,
2006 #[builder(setter(into, strip_option), default)]
2009 pub no_init: Option<bool>,
2010 #[builder(setter(into, strip_option), default)]
2014 pub secrets: Option<Vec<SecretId>>,
2015 #[builder(setter(into, strip_option), default)]
2017 pub target: Option<&'a str>,
2018}
2019#[derive(Builder, Debug, PartialEq)]
2020pub struct ContainerDirectoryOpts {
2021 #[builder(setter(into, strip_option), default)]
2023 pub expand: Option<bool>,
2024}
2025#[derive(Builder, Debug, PartialEq)]
2026pub struct ContainerExistsOpts {
2027 #[builder(setter(into, strip_option), default)]
2029 pub do_not_follow_symlinks: Option<bool>,
2030 #[builder(setter(into, strip_option), default)]
2032 pub expected_type: Option<ExistsType>,
2033}
2034#[derive(Builder, Debug, PartialEq)]
2035pub struct ContainerExportOpts {
2036 #[builder(setter(into, strip_option), default)]
2038 pub expand: Option<bool>,
2039 #[builder(setter(into, strip_option), default)]
2042 pub forced_compression: Option<ImageLayerCompression>,
2043 #[builder(setter(into, strip_option), default)]
2046 pub media_types: Option<ImageMediaTypes>,
2047 #[builder(setter(into, strip_option), default)]
2050 pub platform_variants: Option<Vec<ContainerId>>,
2051}
2052#[derive(Builder, Debug, PartialEq)]
2053pub struct ContainerExportImageOpts {
2054 #[builder(setter(into, strip_option), default)]
2057 pub forced_compression: Option<ImageLayerCompression>,
2058 #[builder(setter(into, strip_option), default)]
2061 pub media_types: Option<ImageMediaTypes>,
2062 #[builder(setter(into, strip_option), default)]
2065 pub platform_variants: Option<Vec<ContainerId>>,
2066}
2067#[derive(Builder, Debug, PartialEq)]
2068pub struct ContainerFileOpts {
2069 #[builder(setter(into, strip_option), default)]
2071 pub expand: Option<bool>,
2072}
2073#[derive(Builder, Debug, PartialEq)]
2074pub struct ContainerImportOpts<'a> {
2075 #[builder(setter(into, strip_option), default)]
2077 pub tag: Option<&'a str>,
2078}
2079#[derive(Builder, Debug, PartialEq)]
2080pub struct ContainerPublishOpts {
2081 #[builder(setter(into, strip_option), default)]
2084 pub forced_compression: Option<ImageLayerCompression>,
2085 #[builder(setter(into, strip_option), default)]
2088 pub media_types: Option<ImageMediaTypes>,
2089 #[builder(setter(into, strip_option), default)]
2092 pub platform_variants: Option<Vec<ContainerId>>,
2093}
2094#[derive(Builder, Debug, PartialEq)]
2095pub struct ContainerTerminalOpts<'a> {
2096 #[builder(setter(into, strip_option), default)]
2098 pub cmd: Option<Vec<&'a str>>,
2099 #[builder(setter(into, strip_option), default)]
2101 pub experimental_privileged_nesting: Option<bool>,
2102 #[builder(setter(into, strip_option), default)]
2104 pub insecure_root_capabilities: Option<bool>,
2105}
2106#[derive(Builder, Debug, PartialEq)]
2107pub struct ContainerUpOpts<'a> {
2108 #[builder(setter(into, strip_option), default)]
2111 pub args: Option<Vec<&'a str>>,
2112 #[builder(setter(into, strip_option), default)]
2114 pub expand: Option<bool>,
2115 #[builder(setter(into, strip_option), default)]
2117 pub experimental_privileged_nesting: Option<bool>,
2118 #[builder(setter(into, strip_option), default)]
2120 pub insecure_root_capabilities: Option<bool>,
2121 #[builder(setter(into, strip_option), default)]
2124 pub no_init: Option<bool>,
2125 #[builder(setter(into, strip_option), default)]
2128 pub ports: Option<Vec<PortForward>>,
2129 #[builder(setter(into, strip_option), default)]
2131 pub random: Option<bool>,
2132 #[builder(setter(into, strip_option), default)]
2134 pub use_entrypoint: Option<bool>,
2135}
2136#[derive(Builder, Debug, PartialEq)]
2137pub struct ContainerWithDefaultTerminalCmdOpts {
2138 #[builder(setter(into, strip_option), default)]
2140 pub experimental_privileged_nesting: Option<bool>,
2141 #[builder(setter(into, strip_option), default)]
2143 pub insecure_root_capabilities: Option<bool>,
2144}
2145#[derive(Builder, Debug, PartialEq)]
2146pub struct ContainerWithDirectoryOpts<'a> {
2147 #[builder(setter(into, strip_option), default)]
2149 pub exclude: Option<Vec<&'a str>>,
2150 #[builder(setter(into, strip_option), default)]
2152 pub expand: Option<bool>,
2153 #[builder(setter(into, strip_option), default)]
2155 pub include: Option<Vec<&'a str>>,
2156 #[builder(setter(into, strip_option), default)]
2160 pub owner: Option<&'a str>,
2161}
2162#[derive(Builder, Debug, PartialEq)]
2163pub struct ContainerWithEntrypointOpts {
2164 #[builder(setter(into, strip_option), default)]
2166 pub keep_default_args: Option<bool>,
2167}
2168#[derive(Builder, Debug, PartialEq)]
2169pub struct ContainerWithEnvVariableOpts {
2170 #[builder(setter(into, strip_option), default)]
2172 pub expand: Option<bool>,
2173}
2174#[derive(Builder, Debug, PartialEq)]
2175pub struct ContainerWithExecOpts<'a> {
2176 #[builder(setter(into, strip_option), default)]
2178 pub expand: Option<bool>,
2179 #[builder(setter(into, strip_option), default)]
2181 pub expect: Option<ReturnType>,
2182 #[builder(setter(into, strip_option), default)]
2184 pub experimental_privileged_nesting: Option<bool>,
2185 #[builder(setter(into, strip_option), default)]
2188 pub insecure_root_capabilities: Option<bool>,
2189 #[builder(setter(into, strip_option), default)]
2192 pub no_init: Option<bool>,
2193 #[builder(setter(into, strip_option), default)]
2195 pub redirect_stderr: Option<&'a str>,
2196 #[builder(setter(into, strip_option), default)]
2198 pub redirect_stdin: Option<&'a str>,
2199 #[builder(setter(into, strip_option), default)]
2201 pub redirect_stdout: Option<&'a str>,
2202 #[builder(setter(into, strip_option), default)]
2204 pub stdin: Option<&'a str>,
2205 #[builder(setter(into, strip_option), default)]
2207 pub use_entrypoint: Option<bool>,
2208}
2209#[derive(Builder, Debug, PartialEq)]
2210pub struct ContainerWithExposedPortOpts<'a> {
2211 #[builder(setter(into, strip_option), default)]
2213 pub description: Option<&'a str>,
2214 #[builder(setter(into, strip_option), default)]
2216 pub experimental_skip_healthcheck: Option<bool>,
2217 #[builder(setter(into, strip_option), default)]
2219 pub protocol: Option<NetworkProtocol>,
2220}
2221#[derive(Builder, Debug, PartialEq)]
2222pub struct ContainerWithFileOpts<'a> {
2223 #[builder(setter(into, strip_option), default)]
2225 pub expand: Option<bool>,
2226 #[builder(setter(into, strip_option), default)]
2230 pub owner: Option<&'a str>,
2231 #[builder(setter(into, strip_option), default)]
2233 pub permissions: Option<isize>,
2234}
2235#[derive(Builder, Debug, PartialEq)]
2236pub struct ContainerWithFilesOpts<'a> {
2237 #[builder(setter(into, strip_option), default)]
2239 pub expand: Option<bool>,
2240 #[builder(setter(into, strip_option), default)]
2244 pub owner: Option<&'a str>,
2245 #[builder(setter(into, strip_option), default)]
2247 pub permissions: Option<isize>,
2248}
2249#[derive(Builder, Debug, PartialEq)]
2250pub struct ContainerWithMountedCacheOpts<'a> {
2251 #[builder(setter(into, strip_option), default)]
2253 pub expand: Option<bool>,
2254 #[builder(setter(into, strip_option), default)]
2259 pub owner: Option<&'a str>,
2260 #[builder(setter(into, strip_option), default)]
2262 pub sharing: Option<CacheSharingMode>,
2263 #[builder(setter(into, strip_option), default)]
2265 pub source: Option<DirectoryId>,
2266}
2267#[derive(Builder, Debug, PartialEq)]
2268pub struct ContainerWithMountedDirectoryOpts<'a> {
2269 #[builder(setter(into, strip_option), default)]
2271 pub expand: Option<bool>,
2272 #[builder(setter(into, strip_option), default)]
2276 pub owner: Option<&'a str>,
2277}
2278#[derive(Builder, Debug, PartialEq)]
2279pub struct ContainerWithMountedFileOpts<'a> {
2280 #[builder(setter(into, strip_option), default)]
2282 pub expand: Option<bool>,
2283 #[builder(setter(into, strip_option), default)]
2287 pub owner: Option<&'a str>,
2288}
2289#[derive(Builder, Debug, PartialEq)]
2290pub struct ContainerWithMountedSecretOpts<'a> {
2291 #[builder(setter(into, strip_option), default)]
2293 pub expand: Option<bool>,
2294 #[builder(setter(into, strip_option), default)]
2297 pub mode: Option<isize>,
2298 #[builder(setter(into, strip_option), default)]
2302 pub owner: Option<&'a str>,
2303}
2304#[derive(Builder, Debug, PartialEq)]
2305pub struct ContainerWithMountedTempOpts {
2306 #[builder(setter(into, strip_option), default)]
2308 pub expand: Option<bool>,
2309 #[builder(setter(into, strip_option), default)]
2311 pub size: Option<isize>,
2312}
2313#[derive(Builder, Debug, PartialEq)]
2314pub struct ContainerWithNewFileOpts<'a> {
2315 #[builder(setter(into, strip_option), default)]
2317 pub expand: Option<bool>,
2318 #[builder(setter(into, strip_option), default)]
2322 pub owner: Option<&'a str>,
2323 #[builder(setter(into, strip_option), default)]
2325 pub permissions: Option<isize>,
2326}
2327#[derive(Builder, Debug, PartialEq)]
2328pub struct ContainerWithSymlinkOpts {
2329 #[builder(setter(into, strip_option), default)]
2331 pub expand: Option<bool>,
2332}
2333#[derive(Builder, Debug, PartialEq)]
2334pub struct ContainerWithUnixSocketOpts<'a> {
2335 #[builder(setter(into, strip_option), default)]
2337 pub expand: Option<bool>,
2338 #[builder(setter(into, strip_option), default)]
2342 pub owner: Option<&'a str>,
2343}
2344#[derive(Builder, Debug, PartialEq)]
2345pub struct ContainerWithWorkdirOpts {
2346 #[builder(setter(into, strip_option), default)]
2348 pub expand: Option<bool>,
2349}
2350#[derive(Builder, Debug, PartialEq)]
2351pub struct ContainerWithoutDirectoryOpts {
2352 #[builder(setter(into, strip_option), default)]
2354 pub expand: Option<bool>,
2355}
2356#[derive(Builder, Debug, PartialEq)]
2357pub struct ContainerWithoutEntrypointOpts {
2358 #[builder(setter(into, strip_option), default)]
2360 pub keep_default_args: Option<bool>,
2361}
2362#[derive(Builder, Debug, PartialEq)]
2363pub struct ContainerWithoutExposedPortOpts {
2364 #[builder(setter(into, strip_option), default)]
2366 pub protocol: Option<NetworkProtocol>,
2367}
2368#[derive(Builder, Debug, PartialEq)]
2369pub struct ContainerWithoutFileOpts {
2370 #[builder(setter(into, strip_option), default)]
2372 pub expand: Option<bool>,
2373}
2374#[derive(Builder, Debug, PartialEq)]
2375pub struct ContainerWithoutFilesOpts {
2376 #[builder(setter(into, strip_option), default)]
2378 pub expand: Option<bool>,
2379}
2380#[derive(Builder, Debug, PartialEq)]
2381pub struct ContainerWithoutMountOpts {
2382 #[builder(setter(into, strip_option), default)]
2384 pub expand: Option<bool>,
2385}
2386#[derive(Builder, Debug, PartialEq)]
2387pub struct ContainerWithoutUnixSocketOpts {
2388 #[builder(setter(into, strip_option), default)]
2390 pub expand: Option<bool>,
2391}
2392impl Container {
2393 pub fn as_service(&self) -> Service {
2400 let query = self.selection.select("asService");
2401 Service {
2402 proc: self.proc.clone(),
2403 selection: query,
2404 graphql_client: self.graphql_client.clone(),
2405 }
2406 }
2407 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2414 let mut query = self.selection.select("asService");
2415 if let Some(args) = opts.args {
2416 query = query.arg("args", args);
2417 }
2418 if let Some(use_entrypoint) = opts.use_entrypoint {
2419 query = query.arg("useEntrypoint", use_entrypoint);
2420 }
2421 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2422 query = query.arg(
2423 "experimentalPrivilegedNesting",
2424 experimental_privileged_nesting,
2425 );
2426 }
2427 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2428 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2429 }
2430 if let Some(expand) = opts.expand {
2431 query = query.arg("expand", expand);
2432 }
2433 if let Some(no_init) = opts.no_init {
2434 query = query.arg("noInit", no_init);
2435 }
2436 Service {
2437 proc: self.proc.clone(),
2438 selection: query,
2439 graphql_client: self.graphql_client.clone(),
2440 }
2441 }
2442 pub fn as_tarball(&self) -> File {
2448 let query = self.selection.select("asTarball");
2449 File {
2450 proc: self.proc.clone(),
2451 selection: query,
2452 graphql_client: self.graphql_client.clone(),
2453 }
2454 }
2455 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2461 let mut query = self.selection.select("asTarball");
2462 if let Some(platform_variants) = opts.platform_variants {
2463 query = query.arg("platformVariants", platform_variants);
2464 }
2465 if let Some(forced_compression) = opts.forced_compression {
2466 query = query.arg("forcedCompression", forced_compression);
2467 }
2468 if let Some(media_types) = opts.media_types {
2469 query = query.arg("mediaTypes", media_types);
2470 }
2471 File {
2472 proc: self.proc.clone(),
2473 selection: query,
2474 graphql_client: self.graphql_client.clone(),
2475 }
2476 }
2477 pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
2484 let mut query = self.selection.select("build");
2485 query = query.arg_lazy(
2486 "context",
2487 Box::new(move || {
2488 let context = context.clone();
2489 Box::pin(async move { context.into_id().await.unwrap().quote() })
2490 }),
2491 );
2492 Container {
2493 proc: self.proc.clone(),
2494 selection: query,
2495 graphql_client: self.graphql_client.clone(),
2496 }
2497 }
2498 pub fn build_opts<'a>(
2505 &self,
2506 context: impl IntoID<DirectoryId>,
2507 opts: ContainerBuildOpts<'a>,
2508 ) -> Container {
2509 let mut query = self.selection.select("build");
2510 query = query.arg_lazy(
2511 "context",
2512 Box::new(move || {
2513 let context = context.clone();
2514 Box::pin(async move { context.into_id().await.unwrap().quote() })
2515 }),
2516 );
2517 if let Some(dockerfile) = opts.dockerfile {
2518 query = query.arg("dockerfile", dockerfile);
2519 }
2520 if let Some(target) = opts.target {
2521 query = query.arg("target", target);
2522 }
2523 if let Some(build_args) = opts.build_args {
2524 query = query.arg("buildArgs", build_args);
2525 }
2526 if let Some(secrets) = opts.secrets {
2527 query = query.arg("secrets", secrets);
2528 }
2529 if let Some(no_init) = opts.no_init {
2530 query = query.arg("noInit", no_init);
2531 }
2532 Container {
2533 proc: self.proc.clone(),
2534 selection: query,
2535 graphql_client: self.graphql_client.clone(),
2536 }
2537 }
2538 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2541 let query = self.selection.select("combinedOutput");
2542 query.execute(self.graphql_client.clone()).await
2543 }
2544 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2546 let query = self.selection.select("defaultArgs");
2547 query.execute(self.graphql_client.clone()).await
2548 }
2549 pub fn directory(&self, path: impl Into<String>) -> Directory {
2557 let mut query = self.selection.select("directory");
2558 query = query.arg("path", path.into());
2559 Directory {
2560 proc: self.proc.clone(),
2561 selection: query,
2562 graphql_client: self.graphql_client.clone(),
2563 }
2564 }
2565 pub fn directory_opts(
2573 &self,
2574 path: impl Into<String>,
2575 opts: ContainerDirectoryOpts,
2576 ) -> Directory {
2577 let mut query = self.selection.select("directory");
2578 query = query.arg("path", path.into());
2579 if let Some(expand) = opts.expand {
2580 query = query.arg("expand", expand);
2581 }
2582 Directory {
2583 proc: self.proc.clone(),
2584 selection: query,
2585 graphql_client: self.graphql_client.clone(),
2586 }
2587 }
2588 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2590 let query = self.selection.select("entrypoint");
2591 query.execute(self.graphql_client.clone()).await
2592 }
2593 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2599 let mut query = self.selection.select("envVariable");
2600 query = query.arg("name", name.into());
2601 query.execute(self.graphql_client.clone()).await
2602 }
2603 pub fn env_variables(&self) -> Vec<EnvVariable> {
2605 let query = self.selection.select("envVariables");
2606 vec![EnvVariable {
2607 proc: self.proc.clone(),
2608 selection: query,
2609 graphql_client: self.graphql_client.clone(),
2610 }]
2611 }
2612 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2619 let mut query = self.selection.select("exists");
2620 query = query.arg("path", path.into());
2621 query.execute(self.graphql_client.clone()).await
2622 }
2623 pub async fn exists_opts(
2630 &self,
2631 path: impl Into<String>,
2632 opts: ContainerExistsOpts,
2633 ) -> Result<bool, DaggerError> {
2634 let mut query = self.selection.select("exists");
2635 query = query.arg("path", path.into());
2636 if let Some(expected_type) = opts.expected_type {
2637 query = query.arg("expectedType", expected_type);
2638 }
2639 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2640 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2641 }
2642 query.execute(self.graphql_client.clone()).await
2643 }
2644 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2647 let query = self.selection.select("exitCode");
2648 query.execute(self.graphql_client.clone()).await
2649 }
2650 pub fn experimental_with_all_gp_us(&self) -> Container {
2654 let query = self.selection.select("experimentalWithAllGPUs");
2655 Container {
2656 proc: self.proc.clone(),
2657 selection: query,
2658 graphql_client: self.graphql_client.clone(),
2659 }
2660 }
2661 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2669 let mut query = self.selection.select("experimentalWithGPU");
2670 query = query.arg(
2671 "devices",
2672 devices
2673 .into_iter()
2674 .map(|i| i.into())
2675 .collect::<Vec<String>>(),
2676 );
2677 Container {
2678 proc: self.proc.clone(),
2679 selection: query,
2680 graphql_client: self.graphql_client.clone(),
2681 }
2682 }
2683 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2693 let mut query = self.selection.select("export");
2694 query = query.arg("path", path.into());
2695 query.execute(self.graphql_client.clone()).await
2696 }
2697 pub async fn export_opts(
2707 &self,
2708 path: impl Into<String>,
2709 opts: ContainerExportOpts,
2710 ) -> Result<String, DaggerError> {
2711 let mut query = self.selection.select("export");
2712 query = query.arg("path", path.into());
2713 if let Some(platform_variants) = opts.platform_variants {
2714 query = query.arg("platformVariants", platform_variants);
2715 }
2716 if let Some(forced_compression) = opts.forced_compression {
2717 query = query.arg("forcedCompression", forced_compression);
2718 }
2719 if let Some(media_types) = opts.media_types {
2720 query = query.arg("mediaTypes", media_types);
2721 }
2722 if let Some(expand) = opts.expand {
2723 query = query.arg("expand", expand);
2724 }
2725 query.execute(self.graphql_client.clone()).await
2726 }
2727 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2734 let mut query = self.selection.select("exportImage");
2735 query = query.arg("name", name.into());
2736 query.execute(self.graphql_client.clone()).await
2737 }
2738 pub async fn export_image_opts(
2745 &self,
2746 name: impl Into<String>,
2747 opts: ContainerExportImageOpts,
2748 ) -> Result<Void, DaggerError> {
2749 let mut query = self.selection.select("exportImage");
2750 query = query.arg("name", name.into());
2751 if let Some(platform_variants) = opts.platform_variants {
2752 query = query.arg("platformVariants", platform_variants);
2753 }
2754 if let Some(forced_compression) = opts.forced_compression {
2755 query = query.arg("forcedCompression", forced_compression);
2756 }
2757 if let Some(media_types) = opts.media_types {
2758 query = query.arg("mediaTypes", media_types);
2759 }
2760 query.execute(self.graphql_client.clone()).await
2761 }
2762 pub fn exposed_ports(&self) -> Vec<Port> {
2765 let query = self.selection.select("exposedPorts");
2766 vec![Port {
2767 proc: self.proc.clone(),
2768 selection: query,
2769 graphql_client: self.graphql_client.clone(),
2770 }]
2771 }
2772 pub fn file(&self, path: impl Into<String>) -> File {
2780 let mut query = self.selection.select("file");
2781 query = query.arg("path", path.into());
2782 File {
2783 proc: self.proc.clone(),
2784 selection: query,
2785 graphql_client: self.graphql_client.clone(),
2786 }
2787 }
2788 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2796 let mut query = self.selection.select("file");
2797 query = query.arg("path", path.into());
2798 if let Some(expand) = opts.expand {
2799 query = query.arg("expand", expand);
2800 }
2801 File {
2802 proc: self.proc.clone(),
2803 selection: query,
2804 graphql_client: self.graphql_client.clone(),
2805 }
2806 }
2807 pub fn from(&self, address: impl Into<String>) -> Container {
2813 let mut query = self.selection.select("from");
2814 query = query.arg("address", address.into());
2815 Container {
2816 proc: self.proc.clone(),
2817 selection: query,
2818 graphql_client: self.graphql_client.clone(),
2819 }
2820 }
2821 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2823 let query = self.selection.select("id");
2824 query.execute(self.graphql_client.clone()).await
2825 }
2826 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2828 let query = self.selection.select("imageRef");
2829 query.execute(self.graphql_client.clone()).await
2830 }
2831 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2838 let mut query = self.selection.select("import");
2839 query = query.arg_lazy(
2840 "source",
2841 Box::new(move || {
2842 let source = source.clone();
2843 Box::pin(async move { source.into_id().await.unwrap().quote() })
2844 }),
2845 );
2846 Container {
2847 proc: self.proc.clone(),
2848 selection: query,
2849 graphql_client: self.graphql_client.clone(),
2850 }
2851 }
2852 pub fn import_opts<'a>(
2859 &self,
2860 source: impl IntoID<FileId>,
2861 opts: ContainerImportOpts<'a>,
2862 ) -> Container {
2863 let mut query = self.selection.select("import");
2864 query = query.arg_lazy(
2865 "source",
2866 Box::new(move || {
2867 let source = source.clone();
2868 Box::pin(async move { source.into_id().await.unwrap().quote() })
2869 }),
2870 );
2871 if let Some(tag) = opts.tag {
2872 query = query.arg("tag", tag);
2873 }
2874 Container {
2875 proc: self.proc.clone(),
2876 selection: query,
2877 graphql_client: self.graphql_client.clone(),
2878 }
2879 }
2880 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2886 let mut query = self.selection.select("label");
2887 query = query.arg("name", name.into());
2888 query.execute(self.graphql_client.clone()).await
2889 }
2890 pub fn labels(&self) -> Vec<Label> {
2892 let query = self.selection.select("labels");
2893 vec![Label {
2894 proc: self.proc.clone(),
2895 selection: query,
2896 graphql_client: self.graphql_client.clone(),
2897 }]
2898 }
2899 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2901 let query = self.selection.select("mounts");
2902 query.execute(self.graphql_client.clone()).await
2903 }
2904 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2906 let query = self.selection.select("platform");
2907 query.execute(self.graphql_client.clone()).await
2908 }
2909 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2919 let mut query = self.selection.select("publish");
2920 query = query.arg("address", address.into());
2921 query.execute(self.graphql_client.clone()).await
2922 }
2923 pub async fn publish_opts(
2933 &self,
2934 address: impl Into<String>,
2935 opts: ContainerPublishOpts,
2936 ) -> Result<String, DaggerError> {
2937 let mut query = self.selection.select("publish");
2938 query = query.arg("address", address.into());
2939 if let Some(platform_variants) = opts.platform_variants {
2940 query = query.arg("platformVariants", platform_variants);
2941 }
2942 if let Some(forced_compression) = opts.forced_compression {
2943 query = query.arg("forcedCompression", forced_compression);
2944 }
2945 if let Some(media_types) = opts.media_types {
2946 query = query.arg("mediaTypes", media_types);
2947 }
2948 query.execute(self.graphql_client.clone()).await
2949 }
2950 pub fn rootfs(&self) -> Directory {
2952 let query = self.selection.select("rootfs");
2953 Directory {
2954 proc: self.proc.clone(),
2955 selection: query,
2956 graphql_client: self.graphql_client.clone(),
2957 }
2958 }
2959 pub async fn stderr(&self) -> Result<String, DaggerError> {
2962 let query = self.selection.select("stderr");
2963 query.execute(self.graphql_client.clone()).await
2964 }
2965 pub async fn stdout(&self) -> Result<String, DaggerError> {
2968 let query = self.selection.select("stdout");
2969 query.execute(self.graphql_client.clone()).await
2970 }
2971 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
2974 let query = self.selection.select("sync");
2975 query.execute(self.graphql_client.clone()).await
2976 }
2977 pub fn terminal(&self) -> Container {
2983 let query = self.selection.select("terminal");
2984 Container {
2985 proc: self.proc.clone(),
2986 selection: query,
2987 graphql_client: self.graphql_client.clone(),
2988 }
2989 }
2990 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2996 let mut query = self.selection.select("terminal");
2997 if let Some(cmd) = opts.cmd {
2998 query = query.arg("cmd", cmd);
2999 }
3000 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3001 query = query.arg(
3002 "experimentalPrivilegedNesting",
3003 experimental_privileged_nesting,
3004 );
3005 }
3006 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3007 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3008 }
3009 Container {
3010 proc: self.proc.clone(),
3011 selection: query,
3012 graphql_client: self.graphql_client.clone(),
3013 }
3014 }
3015 pub async fn up(&self) -> Result<Void, DaggerError> {
3022 let query = self.selection.select("up");
3023 query.execute(self.graphql_client.clone()).await
3024 }
3025 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3032 let mut query = self.selection.select("up");
3033 if let Some(random) = opts.random {
3034 query = query.arg("random", random);
3035 }
3036 if let Some(ports) = opts.ports {
3037 query = query.arg("ports", ports);
3038 }
3039 if let Some(args) = opts.args {
3040 query = query.arg("args", args);
3041 }
3042 if let Some(use_entrypoint) = opts.use_entrypoint {
3043 query = query.arg("useEntrypoint", use_entrypoint);
3044 }
3045 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3046 query = query.arg(
3047 "experimentalPrivilegedNesting",
3048 experimental_privileged_nesting,
3049 );
3050 }
3051 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3052 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3053 }
3054 if let Some(expand) = opts.expand {
3055 query = query.arg("expand", expand);
3056 }
3057 if let Some(no_init) = opts.no_init {
3058 query = query.arg("noInit", no_init);
3059 }
3060 query.execute(self.graphql_client.clone()).await
3061 }
3062 pub async fn user(&self) -> Result<String, DaggerError> {
3064 let query = self.selection.select("user");
3065 query.execute(self.graphql_client.clone()).await
3066 }
3067 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3074 let mut query = self.selection.select("withAnnotation");
3075 query = query.arg("name", name.into());
3076 query = query.arg("value", value.into());
3077 Container {
3078 proc: self.proc.clone(),
3079 selection: query,
3080 graphql_client: self.graphql_client.clone(),
3081 }
3082 }
3083 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3089 let mut query = self.selection.select("withDefaultArgs");
3090 query = query.arg(
3091 "args",
3092 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3093 );
3094 Container {
3095 proc: self.proc.clone(),
3096 selection: query,
3097 graphql_client: self.graphql_client.clone(),
3098 }
3099 }
3100 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3107 let mut query = self.selection.select("withDefaultTerminalCmd");
3108 query = query.arg(
3109 "args",
3110 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3111 );
3112 Container {
3113 proc: self.proc.clone(),
3114 selection: query,
3115 graphql_client: self.graphql_client.clone(),
3116 }
3117 }
3118 pub fn with_default_terminal_cmd_opts(
3125 &self,
3126 args: Vec<impl Into<String>>,
3127 opts: ContainerWithDefaultTerminalCmdOpts,
3128 ) -> Container {
3129 let mut query = self.selection.select("withDefaultTerminalCmd");
3130 query = query.arg(
3131 "args",
3132 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3133 );
3134 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3135 query = query.arg(
3136 "experimentalPrivilegedNesting",
3137 experimental_privileged_nesting,
3138 );
3139 }
3140 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3141 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3142 }
3143 Container {
3144 proc: self.proc.clone(),
3145 selection: query,
3146 graphql_client: self.graphql_client.clone(),
3147 }
3148 }
3149 pub fn with_directory(
3157 &self,
3158 path: impl Into<String>,
3159 directory: impl IntoID<DirectoryId>,
3160 ) -> Container {
3161 let mut query = self.selection.select("withDirectory");
3162 query = query.arg("path", path.into());
3163 query = query.arg_lazy(
3164 "directory",
3165 Box::new(move || {
3166 let directory = directory.clone();
3167 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3168 }),
3169 );
3170 Container {
3171 proc: self.proc.clone(),
3172 selection: query,
3173 graphql_client: self.graphql_client.clone(),
3174 }
3175 }
3176 pub fn with_directory_opts<'a>(
3184 &self,
3185 path: impl Into<String>,
3186 directory: impl IntoID<DirectoryId>,
3187 opts: ContainerWithDirectoryOpts<'a>,
3188 ) -> Container {
3189 let mut query = self.selection.select("withDirectory");
3190 query = query.arg("path", path.into());
3191 query = query.arg_lazy(
3192 "directory",
3193 Box::new(move || {
3194 let directory = directory.clone();
3195 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3196 }),
3197 );
3198 if let Some(exclude) = opts.exclude {
3199 query = query.arg("exclude", exclude);
3200 }
3201 if let Some(include) = opts.include {
3202 query = query.arg("include", include);
3203 }
3204 if let Some(owner) = opts.owner {
3205 query = query.arg("owner", owner);
3206 }
3207 if let Some(expand) = opts.expand {
3208 query = query.arg("expand", expand);
3209 }
3210 Container {
3211 proc: self.proc.clone(),
3212 selection: query,
3213 graphql_client: self.graphql_client.clone(),
3214 }
3215 }
3216 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3223 let mut query = self.selection.select("withEntrypoint");
3224 query = query.arg(
3225 "args",
3226 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3227 );
3228 Container {
3229 proc: self.proc.clone(),
3230 selection: query,
3231 graphql_client: self.graphql_client.clone(),
3232 }
3233 }
3234 pub fn with_entrypoint_opts(
3241 &self,
3242 args: Vec<impl Into<String>>,
3243 opts: ContainerWithEntrypointOpts,
3244 ) -> Container {
3245 let mut query = self.selection.select("withEntrypoint");
3246 query = query.arg(
3247 "args",
3248 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3249 );
3250 if let Some(keep_default_args) = opts.keep_default_args {
3251 query = query.arg("keepDefaultArgs", keep_default_args);
3252 }
3253 Container {
3254 proc: self.proc.clone(),
3255 selection: query,
3256 graphql_client: self.graphql_client.clone(),
3257 }
3258 }
3259 pub fn with_env_variable(
3267 &self,
3268 name: impl Into<String>,
3269 value: impl Into<String>,
3270 ) -> Container {
3271 let mut query = self.selection.select("withEnvVariable");
3272 query = query.arg("name", name.into());
3273 query = query.arg("value", value.into());
3274 Container {
3275 proc: self.proc.clone(),
3276 selection: query,
3277 graphql_client: self.graphql_client.clone(),
3278 }
3279 }
3280 pub fn with_env_variable_opts(
3288 &self,
3289 name: impl Into<String>,
3290 value: impl Into<String>,
3291 opts: ContainerWithEnvVariableOpts,
3292 ) -> Container {
3293 let mut query = self.selection.select("withEnvVariable");
3294 query = query.arg("name", name.into());
3295 query = query.arg("value", value.into());
3296 if let Some(expand) = opts.expand {
3297 query = query.arg("expand", expand);
3298 }
3299 Container {
3300 proc: self.proc.clone(),
3301 selection: query,
3302 graphql_client: self.graphql_client.clone(),
3303 }
3304 }
3305 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3316 let mut query = self.selection.select("withExec");
3317 query = query.arg(
3318 "args",
3319 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3320 );
3321 Container {
3322 proc: self.proc.clone(),
3323 selection: query,
3324 graphql_client: self.graphql_client.clone(),
3325 }
3326 }
3327 pub fn with_exec_opts<'a>(
3338 &self,
3339 args: Vec<impl Into<String>>,
3340 opts: ContainerWithExecOpts<'a>,
3341 ) -> Container {
3342 let mut query = self.selection.select("withExec");
3343 query = query.arg(
3344 "args",
3345 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3346 );
3347 if let Some(use_entrypoint) = opts.use_entrypoint {
3348 query = query.arg("useEntrypoint", use_entrypoint);
3349 }
3350 if let Some(stdin) = opts.stdin {
3351 query = query.arg("stdin", stdin);
3352 }
3353 if let Some(redirect_stdin) = opts.redirect_stdin {
3354 query = query.arg("redirectStdin", redirect_stdin);
3355 }
3356 if let Some(redirect_stdout) = opts.redirect_stdout {
3357 query = query.arg("redirectStdout", redirect_stdout);
3358 }
3359 if let Some(redirect_stderr) = opts.redirect_stderr {
3360 query = query.arg("redirectStderr", redirect_stderr);
3361 }
3362 if let Some(expect) = opts.expect {
3363 query = query.arg("expect", expect);
3364 }
3365 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3366 query = query.arg(
3367 "experimentalPrivilegedNesting",
3368 experimental_privileged_nesting,
3369 );
3370 }
3371 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3372 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3373 }
3374 if let Some(expand) = opts.expand {
3375 query = query.arg("expand", expand);
3376 }
3377 if let Some(no_init) = opts.no_init {
3378 query = query.arg("noInit", no_init);
3379 }
3380 Container {
3381 proc: self.proc.clone(),
3382 selection: query,
3383 graphql_client: self.graphql_client.clone(),
3384 }
3385 }
3386 pub fn with_exposed_port(&self, port: isize) -> Container {
3396 let mut query = self.selection.select("withExposedPort");
3397 query = query.arg("port", port);
3398 Container {
3399 proc: self.proc.clone(),
3400 selection: query,
3401 graphql_client: self.graphql_client.clone(),
3402 }
3403 }
3404 pub fn with_exposed_port_opts<'a>(
3414 &self,
3415 port: isize,
3416 opts: ContainerWithExposedPortOpts<'a>,
3417 ) -> Container {
3418 let mut query = self.selection.select("withExposedPort");
3419 query = query.arg("port", port);
3420 if let Some(protocol) = opts.protocol {
3421 query = query.arg("protocol", protocol);
3422 }
3423 if let Some(description) = opts.description {
3424 query = query.arg("description", description);
3425 }
3426 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3427 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3428 }
3429 Container {
3430 proc: self.proc.clone(),
3431 selection: query,
3432 graphql_client: self.graphql_client.clone(),
3433 }
3434 }
3435 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3443 let mut query = self.selection.select("withFile");
3444 query = query.arg("path", path.into());
3445 query = query.arg_lazy(
3446 "source",
3447 Box::new(move || {
3448 let source = source.clone();
3449 Box::pin(async move { source.into_id().await.unwrap().quote() })
3450 }),
3451 );
3452 Container {
3453 proc: self.proc.clone(),
3454 selection: query,
3455 graphql_client: self.graphql_client.clone(),
3456 }
3457 }
3458 pub fn with_file_opts<'a>(
3466 &self,
3467 path: impl Into<String>,
3468 source: impl IntoID<FileId>,
3469 opts: ContainerWithFileOpts<'a>,
3470 ) -> Container {
3471 let mut query = self.selection.select("withFile");
3472 query = query.arg("path", path.into());
3473 query = query.arg_lazy(
3474 "source",
3475 Box::new(move || {
3476 let source = source.clone();
3477 Box::pin(async move { source.into_id().await.unwrap().quote() })
3478 }),
3479 );
3480 if let Some(permissions) = opts.permissions {
3481 query = query.arg("permissions", permissions);
3482 }
3483 if let Some(owner) = opts.owner {
3484 query = query.arg("owner", owner);
3485 }
3486 if let Some(expand) = opts.expand {
3487 query = query.arg("expand", expand);
3488 }
3489 Container {
3490 proc: self.proc.clone(),
3491 selection: query,
3492 graphql_client: self.graphql_client.clone(),
3493 }
3494 }
3495 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3503 let mut query = self.selection.select("withFiles");
3504 query = query.arg("path", path.into());
3505 query = query.arg("sources", sources);
3506 Container {
3507 proc: self.proc.clone(),
3508 selection: query,
3509 graphql_client: self.graphql_client.clone(),
3510 }
3511 }
3512 pub fn with_files_opts<'a>(
3520 &self,
3521 path: impl Into<String>,
3522 sources: Vec<FileId>,
3523 opts: ContainerWithFilesOpts<'a>,
3524 ) -> Container {
3525 let mut query = self.selection.select("withFiles");
3526 query = query.arg("path", path.into());
3527 query = query.arg("sources", sources);
3528 if let Some(permissions) = opts.permissions {
3529 query = query.arg("permissions", permissions);
3530 }
3531 if let Some(owner) = opts.owner {
3532 query = query.arg("owner", owner);
3533 }
3534 if let Some(expand) = opts.expand {
3535 query = query.arg("expand", expand);
3536 }
3537 Container {
3538 proc: self.proc.clone(),
3539 selection: query,
3540 graphql_client: self.graphql_client.clone(),
3541 }
3542 }
3543 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3550 let mut query = self.selection.select("withLabel");
3551 query = query.arg("name", name.into());
3552 query = query.arg("value", value.into());
3553 Container {
3554 proc: self.proc.clone(),
3555 selection: query,
3556 graphql_client: self.graphql_client.clone(),
3557 }
3558 }
3559 pub fn with_mounted_cache(
3567 &self,
3568 path: impl Into<String>,
3569 cache: impl IntoID<CacheVolumeId>,
3570 ) -> Container {
3571 let mut query = self.selection.select("withMountedCache");
3572 query = query.arg("path", path.into());
3573 query = query.arg_lazy(
3574 "cache",
3575 Box::new(move || {
3576 let cache = cache.clone();
3577 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3578 }),
3579 );
3580 Container {
3581 proc: self.proc.clone(),
3582 selection: query,
3583 graphql_client: self.graphql_client.clone(),
3584 }
3585 }
3586 pub fn with_mounted_cache_opts<'a>(
3594 &self,
3595 path: impl Into<String>,
3596 cache: impl IntoID<CacheVolumeId>,
3597 opts: ContainerWithMountedCacheOpts<'a>,
3598 ) -> Container {
3599 let mut query = self.selection.select("withMountedCache");
3600 query = query.arg("path", path.into());
3601 query = query.arg_lazy(
3602 "cache",
3603 Box::new(move || {
3604 let cache = cache.clone();
3605 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3606 }),
3607 );
3608 if let Some(source) = opts.source {
3609 query = query.arg("source", source);
3610 }
3611 if let Some(sharing) = opts.sharing {
3612 query = query.arg("sharing", sharing);
3613 }
3614 if let Some(owner) = opts.owner {
3615 query = query.arg("owner", owner);
3616 }
3617 if let Some(expand) = opts.expand {
3618 query = query.arg("expand", expand);
3619 }
3620 Container {
3621 proc: self.proc.clone(),
3622 selection: query,
3623 graphql_client: self.graphql_client.clone(),
3624 }
3625 }
3626 pub fn with_mounted_directory(
3634 &self,
3635 path: impl Into<String>,
3636 source: impl IntoID<DirectoryId>,
3637 ) -> Container {
3638 let mut query = self.selection.select("withMountedDirectory");
3639 query = query.arg("path", path.into());
3640 query = query.arg_lazy(
3641 "source",
3642 Box::new(move || {
3643 let source = source.clone();
3644 Box::pin(async move { source.into_id().await.unwrap().quote() })
3645 }),
3646 );
3647 Container {
3648 proc: self.proc.clone(),
3649 selection: query,
3650 graphql_client: self.graphql_client.clone(),
3651 }
3652 }
3653 pub fn with_mounted_directory_opts<'a>(
3661 &self,
3662 path: impl Into<String>,
3663 source: impl IntoID<DirectoryId>,
3664 opts: ContainerWithMountedDirectoryOpts<'a>,
3665 ) -> Container {
3666 let mut query = self.selection.select("withMountedDirectory");
3667 query = query.arg("path", path.into());
3668 query = query.arg_lazy(
3669 "source",
3670 Box::new(move || {
3671 let source = source.clone();
3672 Box::pin(async move { source.into_id().await.unwrap().quote() })
3673 }),
3674 );
3675 if let Some(owner) = opts.owner {
3676 query = query.arg("owner", owner);
3677 }
3678 if let Some(expand) = opts.expand {
3679 query = query.arg("expand", expand);
3680 }
3681 Container {
3682 proc: self.proc.clone(),
3683 selection: query,
3684 graphql_client: self.graphql_client.clone(),
3685 }
3686 }
3687 pub fn with_mounted_file(
3695 &self,
3696 path: impl Into<String>,
3697 source: impl IntoID<FileId>,
3698 ) -> Container {
3699 let mut query = self.selection.select("withMountedFile");
3700 query = query.arg("path", path.into());
3701 query = query.arg_lazy(
3702 "source",
3703 Box::new(move || {
3704 let source = source.clone();
3705 Box::pin(async move { source.into_id().await.unwrap().quote() })
3706 }),
3707 );
3708 Container {
3709 proc: self.proc.clone(),
3710 selection: query,
3711 graphql_client: self.graphql_client.clone(),
3712 }
3713 }
3714 pub fn with_mounted_file_opts<'a>(
3722 &self,
3723 path: impl Into<String>,
3724 source: impl IntoID<FileId>,
3725 opts: ContainerWithMountedFileOpts<'a>,
3726 ) -> Container {
3727 let mut query = self.selection.select("withMountedFile");
3728 query = query.arg("path", path.into());
3729 query = query.arg_lazy(
3730 "source",
3731 Box::new(move || {
3732 let source = source.clone();
3733 Box::pin(async move { source.into_id().await.unwrap().quote() })
3734 }),
3735 );
3736 if let Some(owner) = opts.owner {
3737 query = query.arg("owner", owner);
3738 }
3739 if let Some(expand) = opts.expand {
3740 query = query.arg("expand", expand);
3741 }
3742 Container {
3743 proc: self.proc.clone(),
3744 selection: query,
3745 graphql_client: self.graphql_client.clone(),
3746 }
3747 }
3748 pub fn with_mounted_secret(
3756 &self,
3757 path: impl Into<String>,
3758 source: impl IntoID<SecretId>,
3759 ) -> Container {
3760 let mut query = self.selection.select("withMountedSecret");
3761 query = query.arg("path", path.into());
3762 query = query.arg_lazy(
3763 "source",
3764 Box::new(move || {
3765 let source = source.clone();
3766 Box::pin(async move { source.into_id().await.unwrap().quote() })
3767 }),
3768 );
3769 Container {
3770 proc: self.proc.clone(),
3771 selection: query,
3772 graphql_client: self.graphql_client.clone(),
3773 }
3774 }
3775 pub fn with_mounted_secret_opts<'a>(
3783 &self,
3784 path: impl Into<String>,
3785 source: impl IntoID<SecretId>,
3786 opts: ContainerWithMountedSecretOpts<'a>,
3787 ) -> Container {
3788 let mut query = self.selection.select("withMountedSecret");
3789 query = query.arg("path", path.into());
3790 query = query.arg_lazy(
3791 "source",
3792 Box::new(move || {
3793 let source = source.clone();
3794 Box::pin(async move { source.into_id().await.unwrap().quote() })
3795 }),
3796 );
3797 if let Some(owner) = opts.owner {
3798 query = query.arg("owner", owner);
3799 }
3800 if let Some(mode) = opts.mode {
3801 query = query.arg("mode", mode);
3802 }
3803 if let Some(expand) = opts.expand {
3804 query = query.arg("expand", expand);
3805 }
3806 Container {
3807 proc: self.proc.clone(),
3808 selection: query,
3809 graphql_client: self.graphql_client.clone(),
3810 }
3811 }
3812 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3819 let mut query = self.selection.select("withMountedTemp");
3820 query = query.arg("path", path.into());
3821 Container {
3822 proc: self.proc.clone(),
3823 selection: query,
3824 graphql_client: self.graphql_client.clone(),
3825 }
3826 }
3827 pub fn with_mounted_temp_opts(
3834 &self,
3835 path: impl Into<String>,
3836 opts: ContainerWithMountedTempOpts,
3837 ) -> Container {
3838 let mut query = self.selection.select("withMountedTemp");
3839 query = query.arg("path", path.into());
3840 if let Some(size) = opts.size {
3841 query = query.arg("size", size);
3842 }
3843 if let Some(expand) = opts.expand {
3844 query = query.arg("expand", expand);
3845 }
3846 Container {
3847 proc: self.proc.clone(),
3848 selection: query,
3849 graphql_client: self.graphql_client.clone(),
3850 }
3851 }
3852 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3860 let mut query = self.selection.select("withNewFile");
3861 query = query.arg("path", path.into());
3862 query = query.arg("contents", contents.into());
3863 Container {
3864 proc: self.proc.clone(),
3865 selection: query,
3866 graphql_client: self.graphql_client.clone(),
3867 }
3868 }
3869 pub fn with_new_file_opts<'a>(
3877 &self,
3878 path: impl Into<String>,
3879 contents: impl Into<String>,
3880 opts: ContainerWithNewFileOpts<'a>,
3881 ) -> Container {
3882 let mut query = self.selection.select("withNewFile");
3883 query = query.arg("path", path.into());
3884 query = query.arg("contents", contents.into());
3885 if let Some(permissions) = opts.permissions {
3886 query = query.arg("permissions", permissions);
3887 }
3888 if let Some(owner) = opts.owner {
3889 query = query.arg("owner", owner);
3890 }
3891 if let Some(expand) = opts.expand {
3892 query = query.arg("expand", expand);
3893 }
3894 Container {
3895 proc: self.proc.clone(),
3896 selection: query,
3897 graphql_client: self.graphql_client.clone(),
3898 }
3899 }
3900 pub fn with_registry_auth(
3908 &self,
3909 address: impl Into<String>,
3910 username: impl Into<String>,
3911 secret: impl IntoID<SecretId>,
3912 ) -> Container {
3913 let mut query = self.selection.select("withRegistryAuth");
3914 query = query.arg("address", address.into());
3915 query = query.arg("username", username.into());
3916 query = query.arg_lazy(
3917 "secret",
3918 Box::new(move || {
3919 let secret = secret.clone();
3920 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3921 }),
3922 );
3923 Container {
3924 proc: self.proc.clone(),
3925 selection: query,
3926 graphql_client: self.graphql_client.clone(),
3927 }
3928 }
3929 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
3935 let mut query = self.selection.select("withRootfs");
3936 query = query.arg_lazy(
3937 "directory",
3938 Box::new(move || {
3939 let directory = directory.clone();
3940 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3941 }),
3942 );
3943 Container {
3944 proc: self.proc.clone(),
3945 selection: query,
3946 graphql_client: self.graphql_client.clone(),
3947 }
3948 }
3949 pub fn with_secret_variable(
3956 &self,
3957 name: impl Into<String>,
3958 secret: impl IntoID<SecretId>,
3959 ) -> Container {
3960 let mut query = self.selection.select("withSecretVariable");
3961 query = query.arg("name", name.into());
3962 query = query.arg_lazy(
3963 "secret",
3964 Box::new(move || {
3965 let secret = secret.clone();
3966 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3967 }),
3968 );
3969 Container {
3970 proc: self.proc.clone(),
3971 selection: query,
3972 graphql_client: self.graphql_client.clone(),
3973 }
3974 }
3975 pub fn with_service_binding(
3985 &self,
3986 alias: impl Into<String>,
3987 service: impl IntoID<ServiceId>,
3988 ) -> Container {
3989 let mut query = self.selection.select("withServiceBinding");
3990 query = query.arg("alias", alias.into());
3991 query = query.arg_lazy(
3992 "service",
3993 Box::new(move || {
3994 let service = service.clone();
3995 Box::pin(async move { service.into_id().await.unwrap().quote() })
3996 }),
3997 );
3998 Container {
3999 proc: self.proc.clone(),
4000 selection: query,
4001 graphql_client: self.graphql_client.clone(),
4002 }
4003 }
4004 pub fn with_symlink(
4012 &self,
4013 target: impl Into<String>,
4014 link_name: impl Into<String>,
4015 ) -> Container {
4016 let mut query = self.selection.select("withSymlink");
4017 query = query.arg("target", target.into());
4018 query = query.arg("linkName", link_name.into());
4019 Container {
4020 proc: self.proc.clone(),
4021 selection: query,
4022 graphql_client: self.graphql_client.clone(),
4023 }
4024 }
4025 pub fn with_symlink_opts(
4033 &self,
4034 target: impl Into<String>,
4035 link_name: impl Into<String>,
4036 opts: ContainerWithSymlinkOpts,
4037 ) -> Container {
4038 let mut query = self.selection.select("withSymlink");
4039 query = query.arg("target", target.into());
4040 query = query.arg("linkName", link_name.into());
4041 if let Some(expand) = opts.expand {
4042 query = query.arg("expand", expand);
4043 }
4044 Container {
4045 proc: self.proc.clone(),
4046 selection: query,
4047 graphql_client: self.graphql_client.clone(),
4048 }
4049 }
4050 pub fn with_unix_socket(
4058 &self,
4059 path: impl Into<String>,
4060 source: impl IntoID<SocketId>,
4061 ) -> Container {
4062 let mut query = self.selection.select("withUnixSocket");
4063 query = query.arg("path", path.into());
4064 query = query.arg_lazy(
4065 "source",
4066 Box::new(move || {
4067 let source = source.clone();
4068 Box::pin(async move { source.into_id().await.unwrap().quote() })
4069 }),
4070 );
4071 Container {
4072 proc: self.proc.clone(),
4073 selection: query,
4074 graphql_client: self.graphql_client.clone(),
4075 }
4076 }
4077 pub fn with_unix_socket_opts<'a>(
4085 &self,
4086 path: impl Into<String>,
4087 source: impl IntoID<SocketId>,
4088 opts: ContainerWithUnixSocketOpts<'a>,
4089 ) -> Container {
4090 let mut query = self.selection.select("withUnixSocket");
4091 query = query.arg("path", path.into());
4092 query = query.arg_lazy(
4093 "source",
4094 Box::new(move || {
4095 let source = source.clone();
4096 Box::pin(async move { source.into_id().await.unwrap().quote() })
4097 }),
4098 );
4099 if let Some(owner) = opts.owner {
4100 query = query.arg("owner", owner);
4101 }
4102 if let Some(expand) = opts.expand {
4103 query = query.arg("expand", expand);
4104 }
4105 Container {
4106 proc: self.proc.clone(),
4107 selection: query,
4108 graphql_client: self.graphql_client.clone(),
4109 }
4110 }
4111 pub fn with_user(&self, name: impl Into<String>) -> Container {
4117 let mut query = self.selection.select("withUser");
4118 query = query.arg("name", name.into());
4119 Container {
4120 proc: self.proc.clone(),
4121 selection: query,
4122 graphql_client: self.graphql_client.clone(),
4123 }
4124 }
4125 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4132 let mut query = self.selection.select("withWorkdir");
4133 query = query.arg("path", path.into());
4134 Container {
4135 proc: self.proc.clone(),
4136 selection: query,
4137 graphql_client: self.graphql_client.clone(),
4138 }
4139 }
4140 pub fn with_workdir_opts(
4147 &self,
4148 path: impl Into<String>,
4149 opts: ContainerWithWorkdirOpts,
4150 ) -> Container {
4151 let mut query = self.selection.select("withWorkdir");
4152 query = query.arg("path", path.into());
4153 if let Some(expand) = opts.expand {
4154 query = query.arg("expand", expand);
4155 }
4156 Container {
4157 proc: self.proc.clone(),
4158 selection: query,
4159 graphql_client: self.graphql_client.clone(),
4160 }
4161 }
4162 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4168 let mut query = self.selection.select("withoutAnnotation");
4169 query = query.arg("name", name.into());
4170 Container {
4171 proc: self.proc.clone(),
4172 selection: query,
4173 graphql_client: self.graphql_client.clone(),
4174 }
4175 }
4176 pub fn without_default_args(&self) -> Container {
4178 let query = self.selection.select("withoutDefaultArgs");
4179 Container {
4180 proc: self.proc.clone(),
4181 selection: query,
4182 graphql_client: self.graphql_client.clone(),
4183 }
4184 }
4185 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4192 let mut query = self.selection.select("withoutDirectory");
4193 query = query.arg("path", path.into());
4194 Container {
4195 proc: self.proc.clone(),
4196 selection: query,
4197 graphql_client: self.graphql_client.clone(),
4198 }
4199 }
4200 pub fn without_directory_opts(
4207 &self,
4208 path: impl Into<String>,
4209 opts: ContainerWithoutDirectoryOpts,
4210 ) -> Container {
4211 let mut query = self.selection.select("withoutDirectory");
4212 query = query.arg("path", path.into());
4213 if let Some(expand) = opts.expand {
4214 query = query.arg("expand", expand);
4215 }
4216 Container {
4217 proc: self.proc.clone(),
4218 selection: query,
4219 graphql_client: self.graphql_client.clone(),
4220 }
4221 }
4222 pub fn without_entrypoint(&self) -> Container {
4228 let query = self.selection.select("withoutEntrypoint");
4229 Container {
4230 proc: self.proc.clone(),
4231 selection: query,
4232 graphql_client: self.graphql_client.clone(),
4233 }
4234 }
4235 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4241 let mut query = self.selection.select("withoutEntrypoint");
4242 if let Some(keep_default_args) = opts.keep_default_args {
4243 query = query.arg("keepDefaultArgs", keep_default_args);
4244 }
4245 Container {
4246 proc: self.proc.clone(),
4247 selection: query,
4248 graphql_client: self.graphql_client.clone(),
4249 }
4250 }
4251 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4257 let mut query = self.selection.select("withoutEnvVariable");
4258 query = query.arg("name", name.into());
4259 Container {
4260 proc: self.proc.clone(),
4261 selection: query,
4262 graphql_client: self.graphql_client.clone(),
4263 }
4264 }
4265 pub fn without_exposed_port(&self, port: isize) -> Container {
4272 let mut query = self.selection.select("withoutExposedPort");
4273 query = query.arg("port", port);
4274 Container {
4275 proc: self.proc.clone(),
4276 selection: query,
4277 graphql_client: self.graphql_client.clone(),
4278 }
4279 }
4280 pub fn without_exposed_port_opts(
4287 &self,
4288 port: isize,
4289 opts: ContainerWithoutExposedPortOpts,
4290 ) -> Container {
4291 let mut query = self.selection.select("withoutExposedPort");
4292 query = query.arg("port", port);
4293 if let Some(protocol) = opts.protocol {
4294 query = query.arg("protocol", protocol);
4295 }
4296 Container {
4297 proc: self.proc.clone(),
4298 selection: query,
4299 graphql_client: self.graphql_client.clone(),
4300 }
4301 }
4302 pub fn without_file(&self, path: impl Into<String>) -> Container {
4309 let mut query = self.selection.select("withoutFile");
4310 query = query.arg("path", path.into());
4311 Container {
4312 proc: self.proc.clone(),
4313 selection: query,
4314 graphql_client: self.graphql_client.clone(),
4315 }
4316 }
4317 pub fn without_file_opts(
4324 &self,
4325 path: impl Into<String>,
4326 opts: ContainerWithoutFileOpts,
4327 ) -> Container {
4328 let mut query = self.selection.select("withoutFile");
4329 query = query.arg("path", path.into());
4330 if let Some(expand) = opts.expand {
4331 query = query.arg("expand", expand);
4332 }
4333 Container {
4334 proc: self.proc.clone(),
4335 selection: query,
4336 graphql_client: self.graphql_client.clone(),
4337 }
4338 }
4339 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4346 let mut query = self.selection.select("withoutFiles");
4347 query = query.arg(
4348 "paths",
4349 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4350 );
4351 Container {
4352 proc: self.proc.clone(),
4353 selection: query,
4354 graphql_client: self.graphql_client.clone(),
4355 }
4356 }
4357 pub fn without_files_opts(
4364 &self,
4365 paths: Vec<impl Into<String>>,
4366 opts: ContainerWithoutFilesOpts,
4367 ) -> Container {
4368 let mut query = self.selection.select("withoutFiles");
4369 query = query.arg(
4370 "paths",
4371 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4372 );
4373 if let Some(expand) = opts.expand {
4374 query = query.arg("expand", expand);
4375 }
4376 Container {
4377 proc: self.proc.clone(),
4378 selection: query,
4379 graphql_client: self.graphql_client.clone(),
4380 }
4381 }
4382 pub fn without_label(&self, name: impl Into<String>) -> Container {
4388 let mut query = self.selection.select("withoutLabel");
4389 query = query.arg("name", name.into());
4390 Container {
4391 proc: self.proc.clone(),
4392 selection: query,
4393 graphql_client: self.graphql_client.clone(),
4394 }
4395 }
4396 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4403 let mut query = self.selection.select("withoutMount");
4404 query = query.arg("path", path.into());
4405 Container {
4406 proc: self.proc.clone(),
4407 selection: query,
4408 graphql_client: self.graphql_client.clone(),
4409 }
4410 }
4411 pub fn without_mount_opts(
4418 &self,
4419 path: impl Into<String>,
4420 opts: ContainerWithoutMountOpts,
4421 ) -> Container {
4422 let mut query = self.selection.select("withoutMount");
4423 query = query.arg("path", path.into());
4424 if let Some(expand) = opts.expand {
4425 query = query.arg("expand", expand);
4426 }
4427 Container {
4428 proc: self.proc.clone(),
4429 selection: query,
4430 graphql_client: self.graphql_client.clone(),
4431 }
4432 }
4433 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4441 let mut query = self.selection.select("withoutRegistryAuth");
4442 query = query.arg("address", address.into());
4443 Container {
4444 proc: self.proc.clone(),
4445 selection: query,
4446 graphql_client: self.graphql_client.clone(),
4447 }
4448 }
4449 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4455 let mut query = self.selection.select("withoutSecretVariable");
4456 query = query.arg("name", name.into());
4457 Container {
4458 proc: self.proc.clone(),
4459 selection: query,
4460 graphql_client: self.graphql_client.clone(),
4461 }
4462 }
4463 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4470 let mut query = self.selection.select("withoutUnixSocket");
4471 query = query.arg("path", path.into());
4472 Container {
4473 proc: self.proc.clone(),
4474 selection: query,
4475 graphql_client: self.graphql_client.clone(),
4476 }
4477 }
4478 pub fn without_unix_socket_opts(
4485 &self,
4486 path: impl Into<String>,
4487 opts: ContainerWithoutUnixSocketOpts,
4488 ) -> Container {
4489 let mut query = self.selection.select("withoutUnixSocket");
4490 query = query.arg("path", path.into());
4491 if let Some(expand) = opts.expand {
4492 query = query.arg("expand", expand);
4493 }
4494 Container {
4495 proc: self.proc.clone(),
4496 selection: query,
4497 graphql_client: self.graphql_client.clone(),
4498 }
4499 }
4500 pub fn without_user(&self) -> Container {
4503 let query = self.selection.select("withoutUser");
4504 Container {
4505 proc: self.proc.clone(),
4506 selection: query,
4507 graphql_client: self.graphql_client.clone(),
4508 }
4509 }
4510 pub fn without_workdir(&self) -> Container {
4513 let query = self.selection.select("withoutWorkdir");
4514 Container {
4515 proc: self.proc.clone(),
4516 selection: query,
4517 graphql_client: self.graphql_client.clone(),
4518 }
4519 }
4520 pub async fn workdir(&self) -> Result<String, DaggerError> {
4522 let query = self.selection.select("workdir");
4523 query.execute(self.graphql_client.clone()).await
4524 }
4525}
4526#[derive(Clone)]
4527pub struct CurrentModule {
4528 pub proc: Option<Arc<DaggerSessionProc>>,
4529 pub selection: Selection,
4530 pub graphql_client: DynGraphQLClient,
4531}
4532#[derive(Builder, Debug, PartialEq)]
4533pub struct CurrentModuleWorkdirOpts<'a> {
4534 #[builder(setter(into, strip_option), default)]
4536 pub exclude: Option<Vec<&'a str>>,
4537 #[builder(setter(into, strip_option), default)]
4539 pub include: Option<Vec<&'a str>>,
4540}
4541impl CurrentModule {
4542 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4544 let query = self.selection.select("id");
4545 query.execute(self.graphql_client.clone()).await
4546 }
4547 pub async fn name(&self) -> Result<String, DaggerError> {
4549 let query = self.selection.select("name");
4550 query.execute(self.graphql_client.clone()).await
4551 }
4552 pub fn source(&self) -> Directory {
4554 let query = self.selection.select("source");
4555 Directory {
4556 proc: self.proc.clone(),
4557 selection: query,
4558 graphql_client: self.graphql_client.clone(),
4559 }
4560 }
4561 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4568 let mut query = self.selection.select("workdir");
4569 query = query.arg("path", path.into());
4570 Directory {
4571 proc: self.proc.clone(),
4572 selection: query,
4573 graphql_client: self.graphql_client.clone(),
4574 }
4575 }
4576 pub fn workdir_opts<'a>(
4583 &self,
4584 path: impl Into<String>,
4585 opts: CurrentModuleWorkdirOpts<'a>,
4586 ) -> Directory {
4587 let mut query = self.selection.select("workdir");
4588 query = query.arg("path", path.into());
4589 if let Some(exclude) = opts.exclude {
4590 query = query.arg("exclude", exclude);
4591 }
4592 if let Some(include) = opts.include {
4593 query = query.arg("include", include);
4594 }
4595 Directory {
4596 proc: self.proc.clone(),
4597 selection: query,
4598 graphql_client: self.graphql_client.clone(),
4599 }
4600 }
4601 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4607 let mut query = self.selection.select("workdirFile");
4608 query = query.arg("path", path.into());
4609 File {
4610 proc: self.proc.clone(),
4611 selection: query,
4612 graphql_client: self.graphql_client.clone(),
4613 }
4614 }
4615}
4616#[derive(Clone)]
4617pub struct Directory {
4618 pub proc: Option<Arc<DaggerSessionProc>>,
4619 pub selection: Selection,
4620 pub graphql_client: DynGraphQLClient,
4621}
4622#[derive(Builder, Debug, PartialEq)]
4623pub struct DirectoryAsModuleOpts<'a> {
4624 #[builder(setter(into, strip_option), default)]
4627 pub source_root_path: Option<&'a str>,
4628}
4629#[derive(Builder, Debug, PartialEq)]
4630pub struct DirectoryAsModuleSourceOpts<'a> {
4631 #[builder(setter(into, strip_option), default)]
4634 pub source_root_path: Option<&'a str>,
4635}
4636#[derive(Builder, Debug, PartialEq)]
4637pub struct DirectoryDockerBuildOpts<'a> {
4638 #[builder(setter(into, strip_option), default)]
4640 pub build_args: Option<Vec<BuildArg>>,
4641 #[builder(setter(into, strip_option), default)]
4643 pub dockerfile: Option<&'a str>,
4644 #[builder(setter(into, strip_option), default)]
4647 pub no_init: Option<bool>,
4648 #[builder(setter(into, strip_option), default)]
4650 pub platform: Option<Platform>,
4651 #[builder(setter(into, strip_option), default)]
4654 pub secrets: Option<Vec<SecretId>>,
4655 #[builder(setter(into, strip_option), default)]
4657 pub target: Option<&'a str>,
4658}
4659#[derive(Builder, Debug, PartialEq)]
4660pub struct DirectoryEntriesOpts<'a> {
4661 #[builder(setter(into, strip_option), default)]
4663 pub path: Option<&'a str>,
4664}
4665#[derive(Builder, Debug, PartialEq)]
4666pub struct DirectoryExistsOpts {
4667 #[builder(setter(into, strip_option), default)]
4669 pub do_not_follow_symlinks: Option<bool>,
4670 #[builder(setter(into, strip_option), default)]
4672 pub expected_type: Option<ExistsType>,
4673}
4674#[derive(Builder, Debug, PartialEq)]
4675pub struct DirectoryExportOpts {
4676 #[builder(setter(into, strip_option), default)]
4678 pub wipe: Option<bool>,
4679}
4680#[derive(Builder, Debug, PartialEq)]
4681pub struct DirectoryFilterOpts<'a> {
4682 #[builder(setter(into, strip_option), default)]
4684 pub exclude: Option<Vec<&'a str>>,
4685 #[builder(setter(into, strip_option), default)]
4687 pub include: Option<Vec<&'a str>>,
4688}
4689#[derive(Builder, Debug, PartialEq)]
4690pub struct DirectorySearchOpts<'a> {
4691 #[builder(setter(into, strip_option), default)]
4693 pub dotall: Option<bool>,
4694 #[builder(setter(into, strip_option), default)]
4696 pub files_only: Option<bool>,
4697 #[builder(setter(into, strip_option), default)]
4699 pub globs: Option<Vec<&'a str>>,
4700 #[builder(setter(into, strip_option), default)]
4702 pub insensitive: Option<bool>,
4703 #[builder(setter(into, strip_option), default)]
4705 pub limit: Option<isize>,
4706 #[builder(setter(into, strip_option), default)]
4708 pub literal: Option<bool>,
4709 #[builder(setter(into, strip_option), default)]
4711 pub multiline: Option<bool>,
4712 #[builder(setter(into, strip_option), default)]
4714 pub paths: Option<Vec<&'a str>>,
4715 #[builder(setter(into, strip_option), default)]
4717 pub skip_hidden: Option<bool>,
4718 #[builder(setter(into, strip_option), default)]
4720 pub skip_ignored: Option<bool>,
4721}
4722#[derive(Builder, Debug, PartialEq)]
4723pub struct DirectoryTerminalOpts<'a> {
4724 #[builder(setter(into, strip_option), default)]
4726 pub cmd: Option<Vec<&'a str>>,
4727 #[builder(setter(into, strip_option), default)]
4729 pub container: Option<ContainerId>,
4730 #[builder(setter(into, strip_option), default)]
4732 pub experimental_privileged_nesting: Option<bool>,
4733 #[builder(setter(into, strip_option), default)]
4735 pub insecure_root_capabilities: Option<bool>,
4736}
4737#[derive(Builder, Debug, PartialEq)]
4738pub struct DirectoryWithDirectoryOpts<'a> {
4739 #[builder(setter(into, strip_option), default)]
4741 pub exclude: Option<Vec<&'a str>>,
4742 #[builder(setter(into, strip_option), default)]
4744 pub include: Option<Vec<&'a str>>,
4745}
4746#[derive(Builder, Debug, PartialEq)]
4747pub struct DirectoryWithFileOpts {
4748 #[builder(setter(into, strip_option), default)]
4750 pub permissions: Option<isize>,
4751}
4752#[derive(Builder, Debug, PartialEq)]
4753pub struct DirectoryWithFilesOpts {
4754 #[builder(setter(into, strip_option), default)]
4756 pub permissions: Option<isize>,
4757}
4758#[derive(Builder, Debug, PartialEq)]
4759pub struct DirectoryWithNewDirectoryOpts {
4760 #[builder(setter(into, strip_option), default)]
4762 pub permissions: Option<isize>,
4763}
4764#[derive(Builder, Debug, PartialEq)]
4765pub struct DirectoryWithNewFileOpts {
4766 #[builder(setter(into, strip_option), default)]
4768 pub permissions: Option<isize>,
4769}
4770impl Directory {
4771 pub fn as_git(&self) -> GitRepository {
4773 let query = self.selection.select("asGit");
4774 GitRepository {
4775 proc: self.proc.clone(),
4776 selection: query,
4777 graphql_client: self.graphql_client.clone(),
4778 }
4779 }
4780 pub fn as_module(&self) -> Module {
4786 let query = self.selection.select("asModule");
4787 Module {
4788 proc: self.proc.clone(),
4789 selection: query,
4790 graphql_client: self.graphql_client.clone(),
4791 }
4792 }
4793 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4799 let mut query = self.selection.select("asModule");
4800 if let Some(source_root_path) = opts.source_root_path {
4801 query = query.arg("sourceRootPath", source_root_path);
4802 }
4803 Module {
4804 proc: self.proc.clone(),
4805 selection: query,
4806 graphql_client: self.graphql_client.clone(),
4807 }
4808 }
4809 pub fn as_module_source(&self) -> ModuleSource {
4815 let query = self.selection.select("asModuleSource");
4816 ModuleSource {
4817 proc: self.proc.clone(),
4818 selection: query,
4819 graphql_client: self.graphql_client.clone(),
4820 }
4821 }
4822 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4828 let mut query = self.selection.select("asModuleSource");
4829 if let Some(source_root_path) = opts.source_root_path {
4830 query = query.arg("sourceRootPath", source_root_path);
4831 }
4832 ModuleSource {
4833 proc: self.proc.clone(),
4834 selection: query,
4835 graphql_client: self.graphql_client.clone(),
4836 }
4837 }
4838 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
4844 let mut query = self.selection.select("diff");
4845 query = query.arg_lazy(
4846 "other",
4847 Box::new(move || {
4848 let other = other.clone();
4849 Box::pin(async move { other.into_id().await.unwrap().quote() })
4850 }),
4851 );
4852 Directory {
4853 proc: self.proc.clone(),
4854 selection: query,
4855 graphql_client: self.graphql_client.clone(),
4856 }
4857 }
4858 pub async fn digest(&self) -> Result<String, DaggerError> {
4860 let query = self.selection.select("digest");
4861 query.execute(self.graphql_client.clone()).await
4862 }
4863 pub fn directory(&self, path: impl Into<String>) -> Directory {
4869 let mut query = self.selection.select("directory");
4870 query = query.arg("path", path.into());
4871 Directory {
4872 proc: self.proc.clone(),
4873 selection: query,
4874 graphql_client: self.graphql_client.clone(),
4875 }
4876 }
4877 pub fn docker_build(&self) -> Container {
4883 let query = self.selection.select("dockerBuild");
4884 Container {
4885 proc: self.proc.clone(),
4886 selection: query,
4887 graphql_client: self.graphql_client.clone(),
4888 }
4889 }
4890 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4896 let mut query = self.selection.select("dockerBuild");
4897 if let Some(dockerfile) = opts.dockerfile {
4898 query = query.arg("dockerfile", dockerfile);
4899 }
4900 if let Some(platform) = opts.platform {
4901 query = query.arg("platform", platform);
4902 }
4903 if let Some(build_args) = opts.build_args {
4904 query = query.arg("buildArgs", build_args);
4905 }
4906 if let Some(target) = opts.target {
4907 query = query.arg("target", target);
4908 }
4909 if let Some(secrets) = opts.secrets {
4910 query = query.arg("secrets", secrets);
4911 }
4912 if let Some(no_init) = opts.no_init {
4913 query = query.arg("noInit", no_init);
4914 }
4915 Container {
4916 proc: self.proc.clone(),
4917 selection: query,
4918 graphql_client: self.graphql_client.clone(),
4919 }
4920 }
4921 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4927 let query = self.selection.select("entries");
4928 query.execute(self.graphql_client.clone()).await
4929 }
4930 pub async fn entries_opts<'a>(
4936 &self,
4937 opts: DirectoryEntriesOpts<'a>,
4938 ) -> Result<Vec<String>, DaggerError> {
4939 let mut query = self.selection.select("entries");
4940 if let Some(path) = opts.path {
4941 query = query.arg("path", path);
4942 }
4943 query.execute(self.graphql_client.clone()).await
4944 }
4945 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4952 let mut query = self.selection.select("exists");
4953 query = query.arg("path", path.into());
4954 query.execute(self.graphql_client.clone()).await
4955 }
4956 pub async fn exists_opts(
4963 &self,
4964 path: impl Into<String>,
4965 opts: DirectoryExistsOpts,
4966 ) -> Result<bool, DaggerError> {
4967 let mut query = self.selection.select("exists");
4968 query = query.arg("path", path.into());
4969 if let Some(expected_type) = opts.expected_type {
4970 query = query.arg("expectedType", expected_type);
4971 }
4972 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4973 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4974 }
4975 query.execute(self.graphql_client.clone()).await
4976 }
4977 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4984 let mut query = self.selection.select("export");
4985 query = query.arg("path", path.into());
4986 query.execute(self.graphql_client.clone()).await
4987 }
4988 pub async fn export_opts(
4995 &self,
4996 path: impl Into<String>,
4997 opts: DirectoryExportOpts,
4998 ) -> Result<String, DaggerError> {
4999 let mut query = self.selection.select("export");
5000 query = query.arg("path", path.into());
5001 if let Some(wipe) = opts.wipe {
5002 query = query.arg("wipe", wipe);
5003 }
5004 query.execute(self.graphql_client.clone()).await
5005 }
5006 pub fn file(&self, path: impl Into<String>) -> File {
5012 let mut query = self.selection.select("file");
5013 query = query.arg("path", path.into());
5014 File {
5015 proc: self.proc.clone(),
5016 selection: query,
5017 graphql_client: self.graphql_client.clone(),
5018 }
5019 }
5020 pub fn filter(&self) -> Directory {
5026 let query = self.selection.select("filter");
5027 Directory {
5028 proc: self.proc.clone(),
5029 selection: query,
5030 graphql_client: self.graphql_client.clone(),
5031 }
5032 }
5033 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5039 let mut query = self.selection.select("filter");
5040 if let Some(exclude) = opts.exclude {
5041 query = query.arg("exclude", exclude);
5042 }
5043 if let Some(include) = opts.include {
5044 query = query.arg("include", include);
5045 }
5046 Directory {
5047 proc: self.proc.clone(),
5048 selection: query,
5049 graphql_client: self.graphql_client.clone(),
5050 }
5051 }
5052 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5058 let mut query = self.selection.select("glob");
5059 query = query.arg("pattern", pattern.into());
5060 query.execute(self.graphql_client.clone()).await
5061 }
5062 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5064 let query = self.selection.select("id");
5065 query.execute(self.graphql_client.clone()).await
5066 }
5067 pub async fn name(&self) -> Result<String, DaggerError> {
5069 let query = self.selection.select("name");
5070 query.execute(self.graphql_client.clone()).await
5071 }
5072 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5080 let mut query = self.selection.select("search");
5081 query = query.arg("pattern", pattern.into());
5082 vec![SearchResult {
5083 proc: self.proc.clone(),
5084 selection: query,
5085 graphql_client: self.graphql_client.clone(),
5086 }]
5087 }
5088 pub fn search_opts<'a>(
5096 &self,
5097 pattern: impl Into<String>,
5098 opts: DirectorySearchOpts<'a>,
5099 ) -> Vec<SearchResult> {
5100 let mut query = self.selection.select("search");
5101 query = query.arg("pattern", pattern.into());
5102 if let Some(paths) = opts.paths {
5103 query = query.arg("paths", paths);
5104 }
5105 if let Some(globs) = opts.globs {
5106 query = query.arg("globs", globs);
5107 }
5108 if let Some(literal) = opts.literal {
5109 query = query.arg("literal", literal);
5110 }
5111 if let Some(multiline) = opts.multiline {
5112 query = query.arg("multiline", multiline);
5113 }
5114 if let Some(dotall) = opts.dotall {
5115 query = query.arg("dotall", dotall);
5116 }
5117 if let Some(insensitive) = opts.insensitive {
5118 query = query.arg("insensitive", insensitive);
5119 }
5120 if let Some(skip_ignored) = opts.skip_ignored {
5121 query = query.arg("skipIgnored", skip_ignored);
5122 }
5123 if let Some(skip_hidden) = opts.skip_hidden {
5124 query = query.arg("skipHidden", skip_hidden);
5125 }
5126 if let Some(files_only) = opts.files_only {
5127 query = query.arg("filesOnly", files_only);
5128 }
5129 if let Some(limit) = opts.limit {
5130 query = query.arg("limit", limit);
5131 }
5132 vec![SearchResult {
5133 proc: self.proc.clone(),
5134 selection: query,
5135 graphql_client: self.graphql_client.clone(),
5136 }]
5137 }
5138 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5140 let query = self.selection.select("sync");
5141 query.execute(self.graphql_client.clone()).await
5142 }
5143 pub fn terminal(&self) -> Directory {
5149 let query = self.selection.select("terminal");
5150 Directory {
5151 proc: self.proc.clone(),
5152 selection: query,
5153 graphql_client: self.graphql_client.clone(),
5154 }
5155 }
5156 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5162 let mut query = self.selection.select("terminal");
5163 if let Some(container) = opts.container {
5164 query = query.arg("container", container);
5165 }
5166 if let Some(cmd) = opts.cmd {
5167 query = query.arg("cmd", cmd);
5168 }
5169 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5170 query = query.arg(
5171 "experimentalPrivilegedNesting",
5172 experimental_privileged_nesting,
5173 );
5174 }
5175 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5176 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5177 }
5178 Directory {
5179 proc: self.proc.clone(),
5180 selection: query,
5181 graphql_client: self.graphql_client.clone(),
5182 }
5183 }
5184 pub fn with_directory(
5192 &self,
5193 path: impl Into<String>,
5194 directory: impl IntoID<DirectoryId>,
5195 ) -> Directory {
5196 let mut query = self.selection.select("withDirectory");
5197 query = query.arg("path", path.into());
5198 query = query.arg_lazy(
5199 "directory",
5200 Box::new(move || {
5201 let directory = directory.clone();
5202 Box::pin(async move { directory.into_id().await.unwrap().quote() })
5203 }),
5204 );
5205 Directory {
5206 proc: self.proc.clone(),
5207 selection: query,
5208 graphql_client: self.graphql_client.clone(),
5209 }
5210 }
5211 pub fn with_directory_opts<'a>(
5219 &self,
5220 path: impl Into<String>,
5221 directory: impl IntoID<DirectoryId>,
5222 opts: DirectoryWithDirectoryOpts<'a>,
5223 ) -> Directory {
5224 let mut query = self.selection.select("withDirectory");
5225 query = query.arg("path", path.into());
5226 query = query.arg_lazy(
5227 "directory",
5228 Box::new(move || {
5229 let directory = directory.clone();
5230 Box::pin(async move { directory.into_id().await.unwrap().quote() })
5231 }),
5232 );
5233 if let Some(exclude) = opts.exclude {
5234 query = query.arg("exclude", exclude);
5235 }
5236 if let Some(include) = opts.include {
5237 query = query.arg("include", include);
5238 }
5239 Directory {
5240 proc: self.proc.clone(),
5241 selection: query,
5242 graphql_client: self.graphql_client.clone(),
5243 }
5244 }
5245 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5253 let mut query = self.selection.select("withFile");
5254 query = query.arg("path", path.into());
5255 query = query.arg_lazy(
5256 "source",
5257 Box::new(move || {
5258 let source = source.clone();
5259 Box::pin(async move { source.into_id().await.unwrap().quote() })
5260 }),
5261 );
5262 Directory {
5263 proc: self.proc.clone(),
5264 selection: query,
5265 graphql_client: self.graphql_client.clone(),
5266 }
5267 }
5268 pub fn with_file_opts(
5276 &self,
5277 path: impl Into<String>,
5278 source: impl IntoID<FileId>,
5279 opts: DirectoryWithFileOpts,
5280 ) -> Directory {
5281 let mut query = self.selection.select("withFile");
5282 query = query.arg("path", path.into());
5283 query = query.arg_lazy(
5284 "source",
5285 Box::new(move || {
5286 let source = source.clone();
5287 Box::pin(async move { source.into_id().await.unwrap().quote() })
5288 }),
5289 );
5290 if let Some(permissions) = opts.permissions {
5291 query = query.arg("permissions", permissions);
5292 }
5293 Directory {
5294 proc: self.proc.clone(),
5295 selection: query,
5296 graphql_client: self.graphql_client.clone(),
5297 }
5298 }
5299 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5307 let mut query = self.selection.select("withFiles");
5308 query = query.arg("path", path.into());
5309 query = query.arg("sources", sources);
5310 Directory {
5311 proc: self.proc.clone(),
5312 selection: query,
5313 graphql_client: self.graphql_client.clone(),
5314 }
5315 }
5316 pub fn with_files_opts(
5324 &self,
5325 path: impl Into<String>,
5326 sources: Vec<FileId>,
5327 opts: DirectoryWithFilesOpts,
5328 ) -> Directory {
5329 let mut query = self.selection.select("withFiles");
5330 query = query.arg("path", path.into());
5331 query = query.arg("sources", sources);
5332 if let Some(permissions) = opts.permissions {
5333 query = query.arg("permissions", permissions);
5334 }
5335 Directory {
5336 proc: self.proc.clone(),
5337 selection: query,
5338 graphql_client: self.graphql_client.clone(),
5339 }
5340 }
5341 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5348 let mut query = self.selection.select("withNewDirectory");
5349 query = query.arg("path", path.into());
5350 Directory {
5351 proc: self.proc.clone(),
5352 selection: query,
5353 graphql_client: self.graphql_client.clone(),
5354 }
5355 }
5356 pub fn with_new_directory_opts(
5363 &self,
5364 path: impl Into<String>,
5365 opts: DirectoryWithNewDirectoryOpts,
5366 ) -> Directory {
5367 let mut query = self.selection.select("withNewDirectory");
5368 query = query.arg("path", path.into());
5369 if let Some(permissions) = opts.permissions {
5370 query = query.arg("permissions", permissions);
5371 }
5372 Directory {
5373 proc: self.proc.clone(),
5374 selection: query,
5375 graphql_client: self.graphql_client.clone(),
5376 }
5377 }
5378 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5386 let mut query = self.selection.select("withNewFile");
5387 query = query.arg("path", path.into());
5388 query = query.arg("contents", contents.into());
5389 Directory {
5390 proc: self.proc.clone(),
5391 selection: query,
5392 graphql_client: self.graphql_client.clone(),
5393 }
5394 }
5395 pub fn with_new_file_opts(
5403 &self,
5404 path: impl Into<String>,
5405 contents: impl Into<String>,
5406 opts: DirectoryWithNewFileOpts,
5407 ) -> Directory {
5408 let mut query = self.selection.select("withNewFile");
5409 query = query.arg("path", path.into());
5410 query = query.arg("contents", contents.into());
5411 if let Some(permissions) = opts.permissions {
5412 query = query.arg("permissions", permissions);
5413 }
5414 Directory {
5415 proc: self.proc.clone(),
5416 selection: query,
5417 graphql_client: self.graphql_client.clone(),
5418 }
5419 }
5420 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5426 let mut query = self.selection.select("withPatch");
5427 query = query.arg("patch", patch.into());
5428 Directory {
5429 proc: self.proc.clone(),
5430 selection: query,
5431 graphql_client: self.graphql_client.clone(),
5432 }
5433 }
5434 pub fn with_symlink(
5441 &self,
5442 target: impl Into<String>,
5443 link_name: impl Into<String>,
5444 ) -> Directory {
5445 let mut query = self.selection.select("withSymlink");
5446 query = query.arg("target", target.into());
5447 query = query.arg("linkName", link_name.into());
5448 Directory {
5449 proc: self.proc.clone(),
5450 selection: query,
5451 graphql_client: self.graphql_client.clone(),
5452 }
5453 }
5454 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5462 let mut query = self.selection.select("withTimestamps");
5463 query = query.arg("timestamp", timestamp);
5464 Directory {
5465 proc: self.proc.clone(),
5466 selection: query,
5467 graphql_client: self.graphql_client.clone(),
5468 }
5469 }
5470 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5476 let mut query = self.selection.select("withoutDirectory");
5477 query = query.arg("path", path.into());
5478 Directory {
5479 proc: self.proc.clone(),
5480 selection: query,
5481 graphql_client: self.graphql_client.clone(),
5482 }
5483 }
5484 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5490 let mut query = self.selection.select("withoutFile");
5491 query = query.arg("path", path.into());
5492 Directory {
5493 proc: self.proc.clone(),
5494 selection: query,
5495 graphql_client: self.graphql_client.clone(),
5496 }
5497 }
5498 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5504 let mut query = self.selection.select("withoutFiles");
5505 query = query.arg(
5506 "paths",
5507 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5508 );
5509 Directory {
5510 proc: self.proc.clone(),
5511 selection: query,
5512 graphql_client: self.graphql_client.clone(),
5513 }
5514 }
5515}
5516#[derive(Clone)]
5517pub struct Engine {
5518 pub proc: Option<Arc<DaggerSessionProc>>,
5519 pub selection: Selection,
5520 pub graphql_client: DynGraphQLClient,
5521}
5522impl Engine {
5523 pub async fn id(&self) -> Result<EngineId, DaggerError> {
5525 let query = self.selection.select("id");
5526 query.execute(self.graphql_client.clone()).await
5527 }
5528 pub fn local_cache(&self) -> EngineCache {
5530 let query = self.selection.select("localCache");
5531 EngineCache {
5532 proc: self.proc.clone(),
5533 selection: query,
5534 graphql_client: self.graphql_client.clone(),
5535 }
5536 }
5537}
5538#[derive(Clone)]
5539pub struct EngineCache {
5540 pub proc: Option<Arc<DaggerSessionProc>>,
5541 pub selection: Selection,
5542 pub graphql_client: DynGraphQLClient,
5543}
5544#[derive(Builder, Debug, PartialEq)]
5545pub struct EngineCacheEntrySetOpts<'a> {
5546 #[builder(setter(into, strip_option), default)]
5547 pub key: Option<&'a str>,
5548}
5549#[derive(Builder, Debug, PartialEq)]
5550pub struct EngineCachePruneOpts {
5551 #[builder(setter(into, strip_option), default)]
5553 pub use_default_policy: Option<bool>,
5554}
5555impl EngineCache {
5556 pub fn entry_set(&self) -> EngineCacheEntrySet {
5562 let query = self.selection.select("entrySet");
5563 EngineCacheEntrySet {
5564 proc: self.proc.clone(),
5565 selection: query,
5566 graphql_client: self.graphql_client.clone(),
5567 }
5568 }
5569 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5575 let mut query = self.selection.select("entrySet");
5576 if let Some(key) = opts.key {
5577 query = query.arg("key", key);
5578 }
5579 EngineCacheEntrySet {
5580 proc: self.proc.clone(),
5581 selection: query,
5582 graphql_client: self.graphql_client.clone(),
5583 }
5584 }
5585 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
5587 let query = self.selection.select("id");
5588 query.execute(self.graphql_client.clone()).await
5589 }
5590 pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
5592 let query = self.selection.select("keepBytes");
5593 query.execute(self.graphql_client.clone()).await
5594 }
5595 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5597 let query = self.selection.select("maxUsedSpace");
5598 query.execute(self.graphql_client.clone()).await
5599 }
5600 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5602 let query = self.selection.select("minFreeSpace");
5603 query.execute(self.graphql_client.clone()).await
5604 }
5605 pub async fn prune(&self) -> Result<Void, DaggerError> {
5611 let query = self.selection.select("prune");
5612 query.execute(self.graphql_client.clone()).await
5613 }
5614 pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
5620 let mut query = self.selection.select("prune");
5621 if let Some(use_default_policy) = opts.use_default_policy {
5622 query = query.arg("useDefaultPolicy", use_default_policy);
5623 }
5624 query.execute(self.graphql_client.clone()).await
5625 }
5626 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5628 let query = self.selection.select("reservedSpace");
5629 query.execute(self.graphql_client.clone()).await
5630 }
5631 pub async fn target_space(&self) -> Result<isize, DaggerError> {
5633 let query = self.selection.select("targetSpace");
5634 query.execute(self.graphql_client.clone()).await
5635 }
5636}
5637#[derive(Clone)]
5638pub struct EngineCacheEntry {
5639 pub proc: Option<Arc<DaggerSessionProc>>,
5640 pub selection: Selection,
5641 pub graphql_client: DynGraphQLClient,
5642}
5643impl EngineCacheEntry {
5644 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5646 let query = self.selection.select("activelyUsed");
5647 query.execute(self.graphql_client.clone()).await
5648 }
5649 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5651 let query = self.selection.select("createdTimeUnixNano");
5652 query.execute(self.graphql_client.clone()).await
5653 }
5654 pub async fn description(&self) -> Result<String, DaggerError> {
5656 let query = self.selection.select("description");
5657 query.execute(self.graphql_client.clone()).await
5658 }
5659 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5661 let query = self.selection.select("diskSpaceBytes");
5662 query.execute(self.graphql_client.clone()).await
5663 }
5664 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
5666 let query = self.selection.select("id");
5667 query.execute(self.graphql_client.clone()).await
5668 }
5669 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5671 let query = self.selection.select("mostRecentUseTimeUnixNano");
5672 query.execute(self.graphql_client.clone()).await
5673 }
5674}
5675#[derive(Clone)]
5676pub struct EngineCacheEntrySet {
5677 pub proc: Option<Arc<DaggerSessionProc>>,
5678 pub selection: Selection,
5679 pub graphql_client: DynGraphQLClient,
5680}
5681impl EngineCacheEntrySet {
5682 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5684 let query = self.selection.select("diskSpaceBytes");
5685 query.execute(self.graphql_client.clone()).await
5686 }
5687 pub fn entries(&self) -> Vec<EngineCacheEntry> {
5689 let query = self.selection.select("entries");
5690 vec![EngineCacheEntry {
5691 proc: self.proc.clone(),
5692 selection: query,
5693 graphql_client: self.graphql_client.clone(),
5694 }]
5695 }
5696 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
5698 let query = self.selection.select("entryCount");
5699 query.execute(self.graphql_client.clone()).await
5700 }
5701 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
5703 let query = self.selection.select("id");
5704 query.execute(self.graphql_client.clone()).await
5705 }
5706}
5707#[derive(Clone)]
5708pub struct EnumTypeDef {
5709 pub proc: Option<Arc<DaggerSessionProc>>,
5710 pub selection: Selection,
5711 pub graphql_client: DynGraphQLClient,
5712}
5713impl EnumTypeDef {
5714 pub async fn description(&self) -> Result<String, DaggerError> {
5716 let query = self.selection.select("description");
5717 query.execute(self.graphql_client.clone()).await
5718 }
5719 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
5721 let query = self.selection.select("id");
5722 query.execute(self.graphql_client.clone()).await
5723 }
5724 pub fn members(&self) -> Vec<EnumValueTypeDef> {
5726 let query = self.selection.select("members");
5727 vec![EnumValueTypeDef {
5728 proc: self.proc.clone(),
5729 selection: query,
5730 graphql_client: self.graphql_client.clone(),
5731 }]
5732 }
5733 pub async fn name(&self) -> Result<String, DaggerError> {
5735 let query = self.selection.select("name");
5736 query.execute(self.graphql_client.clone()).await
5737 }
5738 pub fn source_map(&self) -> SourceMap {
5740 let query = self.selection.select("sourceMap");
5741 SourceMap {
5742 proc: self.proc.clone(),
5743 selection: query,
5744 graphql_client: self.graphql_client.clone(),
5745 }
5746 }
5747 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5749 let query = self.selection.select("sourceModuleName");
5750 query.execute(self.graphql_client.clone()).await
5751 }
5752 pub fn values(&self) -> Vec<EnumValueTypeDef> {
5753 let query = self.selection.select("values");
5754 vec![EnumValueTypeDef {
5755 proc: self.proc.clone(),
5756 selection: query,
5757 graphql_client: self.graphql_client.clone(),
5758 }]
5759 }
5760}
5761#[derive(Clone)]
5762pub struct EnumValueTypeDef {
5763 pub proc: Option<Arc<DaggerSessionProc>>,
5764 pub selection: Selection,
5765 pub graphql_client: DynGraphQLClient,
5766}
5767impl EnumValueTypeDef {
5768 pub async fn description(&self) -> Result<String, DaggerError> {
5770 let query = self.selection.select("description");
5771 query.execute(self.graphql_client.clone()).await
5772 }
5773 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
5775 let query = self.selection.select("id");
5776 query.execute(self.graphql_client.clone()).await
5777 }
5778 pub async fn name(&self) -> Result<String, DaggerError> {
5780 let query = self.selection.select("name");
5781 query.execute(self.graphql_client.clone()).await
5782 }
5783 pub fn source_map(&self) -> SourceMap {
5785 let query = self.selection.select("sourceMap");
5786 SourceMap {
5787 proc: self.proc.clone(),
5788 selection: query,
5789 graphql_client: self.graphql_client.clone(),
5790 }
5791 }
5792 pub async fn value(&self) -> Result<String, DaggerError> {
5794 let query = self.selection.select("value");
5795 query.execute(self.graphql_client.clone()).await
5796 }
5797}
5798#[derive(Clone)]
5799pub struct Env {
5800 pub proc: Option<Arc<DaggerSessionProc>>,
5801 pub selection: Selection,
5802 pub graphql_client: DynGraphQLClient,
5803}
5804impl Env {
5805 pub async fn id(&self) -> Result<EnvId, DaggerError> {
5807 let query = self.selection.select("id");
5808 query.execute(self.graphql_client.clone()).await
5809 }
5810 pub fn input(&self, name: impl Into<String>) -> Binding {
5812 let mut query = self.selection.select("input");
5813 query = query.arg("name", name.into());
5814 Binding {
5815 proc: self.proc.clone(),
5816 selection: query,
5817 graphql_client: self.graphql_client.clone(),
5818 }
5819 }
5820 pub fn inputs(&self) -> Vec<Binding> {
5822 let query = self.selection.select("inputs");
5823 vec![Binding {
5824 proc: self.proc.clone(),
5825 selection: query,
5826 graphql_client: self.graphql_client.clone(),
5827 }]
5828 }
5829 pub fn output(&self, name: impl Into<String>) -> Binding {
5831 let mut query = self.selection.select("output");
5832 query = query.arg("name", name.into());
5833 Binding {
5834 proc: self.proc.clone(),
5835 selection: query,
5836 graphql_client: self.graphql_client.clone(),
5837 }
5838 }
5839 pub fn outputs(&self) -> Vec<Binding> {
5841 let query = self.selection.select("outputs");
5842 vec![Binding {
5843 proc: self.proc.clone(),
5844 selection: query,
5845 graphql_client: self.graphql_client.clone(),
5846 }]
5847 }
5848 pub fn with_cache_volume_input(
5856 &self,
5857 name: impl Into<String>,
5858 value: impl IntoID<CacheVolumeId>,
5859 description: impl Into<String>,
5860 ) -> Env {
5861 let mut query = self.selection.select("withCacheVolumeInput");
5862 query = query.arg("name", name.into());
5863 query = query.arg_lazy(
5864 "value",
5865 Box::new(move || {
5866 let value = value.clone();
5867 Box::pin(async move { value.into_id().await.unwrap().quote() })
5868 }),
5869 );
5870 query = query.arg("description", description.into());
5871 Env {
5872 proc: self.proc.clone(),
5873 selection: query,
5874 graphql_client: self.graphql_client.clone(),
5875 }
5876 }
5877 pub fn with_cache_volume_output(
5884 &self,
5885 name: impl Into<String>,
5886 description: impl Into<String>,
5887 ) -> Env {
5888 let mut query = self.selection.select("withCacheVolumeOutput");
5889 query = query.arg("name", name.into());
5890 query = query.arg("description", description.into());
5891 Env {
5892 proc: self.proc.clone(),
5893 selection: query,
5894 graphql_client: self.graphql_client.clone(),
5895 }
5896 }
5897 pub fn with_cloud_input(
5905 &self,
5906 name: impl Into<String>,
5907 value: impl IntoID<CloudId>,
5908 description: impl Into<String>,
5909 ) -> Env {
5910 let mut query = self.selection.select("withCloudInput");
5911 query = query.arg("name", name.into());
5912 query = query.arg_lazy(
5913 "value",
5914 Box::new(move || {
5915 let value = value.clone();
5916 Box::pin(async move { value.into_id().await.unwrap().quote() })
5917 }),
5918 );
5919 query = query.arg("description", description.into());
5920 Env {
5921 proc: self.proc.clone(),
5922 selection: query,
5923 graphql_client: self.graphql_client.clone(),
5924 }
5925 }
5926 pub fn with_cloud_output(
5933 &self,
5934 name: impl Into<String>,
5935 description: impl Into<String>,
5936 ) -> Env {
5937 let mut query = self.selection.select("withCloudOutput");
5938 query = query.arg("name", name.into());
5939 query = query.arg("description", description.into());
5940 Env {
5941 proc: self.proc.clone(),
5942 selection: query,
5943 graphql_client: self.graphql_client.clone(),
5944 }
5945 }
5946 pub fn with_container_input(
5954 &self,
5955 name: impl Into<String>,
5956 value: impl IntoID<ContainerId>,
5957 description: impl Into<String>,
5958 ) -> Env {
5959 let mut query = self.selection.select("withContainerInput");
5960 query = query.arg("name", name.into());
5961 query = query.arg_lazy(
5962 "value",
5963 Box::new(move || {
5964 let value = value.clone();
5965 Box::pin(async move { value.into_id().await.unwrap().quote() })
5966 }),
5967 );
5968 query = query.arg("description", description.into());
5969 Env {
5970 proc: self.proc.clone(),
5971 selection: query,
5972 graphql_client: self.graphql_client.clone(),
5973 }
5974 }
5975 pub fn with_container_output(
5982 &self,
5983 name: impl Into<String>,
5984 description: impl Into<String>,
5985 ) -> Env {
5986 let mut query = self.selection.select("withContainerOutput");
5987 query = query.arg("name", name.into());
5988 query = query.arg("description", description.into());
5989 Env {
5990 proc: self.proc.clone(),
5991 selection: query,
5992 graphql_client: self.graphql_client.clone(),
5993 }
5994 }
5995 pub fn with_directory_input(
6003 &self,
6004 name: impl Into<String>,
6005 value: impl IntoID<DirectoryId>,
6006 description: impl Into<String>,
6007 ) -> Env {
6008 let mut query = self.selection.select("withDirectoryInput");
6009 query = query.arg("name", name.into());
6010 query = query.arg_lazy(
6011 "value",
6012 Box::new(move || {
6013 let value = value.clone();
6014 Box::pin(async move { value.into_id().await.unwrap().quote() })
6015 }),
6016 );
6017 query = query.arg("description", description.into());
6018 Env {
6019 proc: self.proc.clone(),
6020 selection: query,
6021 graphql_client: self.graphql_client.clone(),
6022 }
6023 }
6024 pub fn with_directory_output(
6031 &self,
6032 name: impl Into<String>,
6033 description: impl Into<String>,
6034 ) -> Env {
6035 let mut query = self.selection.select("withDirectoryOutput");
6036 query = query.arg("name", name.into());
6037 query = query.arg("description", description.into());
6038 Env {
6039 proc: self.proc.clone(),
6040 selection: query,
6041 graphql_client: self.graphql_client.clone(),
6042 }
6043 }
6044 pub fn with_env_input(
6052 &self,
6053 name: impl Into<String>,
6054 value: impl IntoID<EnvId>,
6055 description: impl Into<String>,
6056 ) -> Env {
6057 let mut query = self.selection.select("withEnvInput");
6058 query = query.arg("name", name.into());
6059 query = query.arg_lazy(
6060 "value",
6061 Box::new(move || {
6062 let value = value.clone();
6063 Box::pin(async move { value.into_id().await.unwrap().quote() })
6064 }),
6065 );
6066 query = query.arg("description", description.into());
6067 Env {
6068 proc: self.proc.clone(),
6069 selection: query,
6070 graphql_client: self.graphql_client.clone(),
6071 }
6072 }
6073 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6080 let mut query = self.selection.select("withEnvOutput");
6081 query = query.arg("name", name.into());
6082 query = query.arg("description", description.into());
6083 Env {
6084 proc: self.proc.clone(),
6085 selection: query,
6086 graphql_client: self.graphql_client.clone(),
6087 }
6088 }
6089 pub fn with_file_input(
6097 &self,
6098 name: impl Into<String>,
6099 value: impl IntoID<FileId>,
6100 description: impl Into<String>,
6101 ) -> Env {
6102 let mut query = self.selection.select("withFileInput");
6103 query = query.arg("name", name.into());
6104 query = query.arg_lazy(
6105 "value",
6106 Box::new(move || {
6107 let value = value.clone();
6108 Box::pin(async move { value.into_id().await.unwrap().quote() })
6109 }),
6110 );
6111 query = query.arg("description", description.into());
6112 Env {
6113 proc: self.proc.clone(),
6114 selection: query,
6115 graphql_client: self.graphql_client.clone(),
6116 }
6117 }
6118 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6125 let mut query = self.selection.select("withFileOutput");
6126 query = query.arg("name", name.into());
6127 query = query.arg("description", description.into());
6128 Env {
6129 proc: self.proc.clone(),
6130 selection: query,
6131 graphql_client: self.graphql_client.clone(),
6132 }
6133 }
6134 pub fn with_git_ref_input(
6142 &self,
6143 name: impl Into<String>,
6144 value: impl IntoID<GitRefId>,
6145 description: impl Into<String>,
6146 ) -> Env {
6147 let mut query = self.selection.select("withGitRefInput");
6148 query = query.arg("name", name.into());
6149 query = query.arg_lazy(
6150 "value",
6151 Box::new(move || {
6152 let value = value.clone();
6153 Box::pin(async move { value.into_id().await.unwrap().quote() })
6154 }),
6155 );
6156 query = query.arg("description", description.into());
6157 Env {
6158 proc: self.proc.clone(),
6159 selection: query,
6160 graphql_client: self.graphql_client.clone(),
6161 }
6162 }
6163 pub fn with_git_ref_output(
6170 &self,
6171 name: impl Into<String>,
6172 description: impl Into<String>,
6173 ) -> Env {
6174 let mut query = self.selection.select("withGitRefOutput");
6175 query = query.arg("name", name.into());
6176 query = query.arg("description", description.into());
6177 Env {
6178 proc: self.proc.clone(),
6179 selection: query,
6180 graphql_client: self.graphql_client.clone(),
6181 }
6182 }
6183 pub fn with_git_repository_input(
6191 &self,
6192 name: impl Into<String>,
6193 value: impl IntoID<GitRepositoryId>,
6194 description: impl Into<String>,
6195 ) -> Env {
6196 let mut query = self.selection.select("withGitRepositoryInput");
6197 query = query.arg("name", name.into());
6198 query = query.arg_lazy(
6199 "value",
6200 Box::new(move || {
6201 let value = value.clone();
6202 Box::pin(async move { value.into_id().await.unwrap().quote() })
6203 }),
6204 );
6205 query = query.arg("description", description.into());
6206 Env {
6207 proc: self.proc.clone(),
6208 selection: query,
6209 graphql_client: self.graphql_client.clone(),
6210 }
6211 }
6212 pub fn with_git_repository_output(
6219 &self,
6220 name: impl Into<String>,
6221 description: impl Into<String>,
6222 ) -> Env {
6223 let mut query = self.selection.select("withGitRepositoryOutput");
6224 query = query.arg("name", name.into());
6225 query = query.arg("description", description.into());
6226 Env {
6227 proc: self.proc.clone(),
6228 selection: query,
6229 graphql_client: self.graphql_client.clone(),
6230 }
6231 }
6232 pub fn with_json_value_input(
6240 &self,
6241 name: impl Into<String>,
6242 value: impl IntoID<JsonValueId>,
6243 description: impl Into<String>,
6244 ) -> Env {
6245 let mut query = self.selection.select("withJSONValueInput");
6246 query = query.arg("name", name.into());
6247 query = query.arg_lazy(
6248 "value",
6249 Box::new(move || {
6250 let value = value.clone();
6251 Box::pin(async move { value.into_id().await.unwrap().quote() })
6252 }),
6253 );
6254 query = query.arg("description", description.into());
6255 Env {
6256 proc: self.proc.clone(),
6257 selection: query,
6258 graphql_client: self.graphql_client.clone(),
6259 }
6260 }
6261 pub fn with_json_value_output(
6268 &self,
6269 name: impl Into<String>,
6270 description: impl Into<String>,
6271 ) -> Env {
6272 let mut query = self.selection.select("withJSONValueOutput");
6273 query = query.arg("name", name.into());
6274 query = query.arg("description", description.into());
6275 Env {
6276 proc: self.proc.clone(),
6277 selection: query,
6278 graphql_client: self.graphql_client.clone(),
6279 }
6280 }
6281 pub fn with_llm_input(
6289 &self,
6290 name: impl Into<String>,
6291 value: impl IntoID<Llmid>,
6292 description: impl Into<String>,
6293 ) -> Env {
6294 let mut query = self.selection.select("withLLMInput");
6295 query = query.arg("name", name.into());
6296 query = query.arg_lazy(
6297 "value",
6298 Box::new(move || {
6299 let value = value.clone();
6300 Box::pin(async move { value.into_id().await.unwrap().quote() })
6301 }),
6302 );
6303 query = query.arg("description", description.into());
6304 Env {
6305 proc: self.proc.clone(),
6306 selection: query,
6307 graphql_client: self.graphql_client.clone(),
6308 }
6309 }
6310 pub fn with_llm_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6317 let mut query = self.selection.select("withLLMOutput");
6318 query = query.arg("name", name.into());
6319 query = query.arg("description", description.into());
6320 Env {
6321 proc: self.proc.clone(),
6322 selection: query,
6323 graphql_client: self.graphql_client.clone(),
6324 }
6325 }
6326 pub fn with_module_config_client_input(
6334 &self,
6335 name: impl Into<String>,
6336 value: impl IntoID<ModuleConfigClientId>,
6337 description: impl Into<String>,
6338 ) -> Env {
6339 let mut query = self.selection.select("withModuleConfigClientInput");
6340 query = query.arg("name", name.into());
6341 query = query.arg_lazy(
6342 "value",
6343 Box::new(move || {
6344 let value = value.clone();
6345 Box::pin(async move { value.into_id().await.unwrap().quote() })
6346 }),
6347 );
6348 query = query.arg("description", description.into());
6349 Env {
6350 proc: self.proc.clone(),
6351 selection: query,
6352 graphql_client: self.graphql_client.clone(),
6353 }
6354 }
6355 pub fn with_module_config_client_output(
6362 &self,
6363 name: impl Into<String>,
6364 description: impl Into<String>,
6365 ) -> Env {
6366 let mut query = self.selection.select("withModuleConfigClientOutput");
6367 query = query.arg("name", name.into());
6368 query = query.arg("description", description.into());
6369 Env {
6370 proc: self.proc.clone(),
6371 selection: query,
6372 graphql_client: self.graphql_client.clone(),
6373 }
6374 }
6375 pub fn with_module_input(
6383 &self,
6384 name: impl Into<String>,
6385 value: impl IntoID<ModuleId>,
6386 description: impl Into<String>,
6387 ) -> Env {
6388 let mut query = self.selection.select("withModuleInput");
6389 query = query.arg("name", name.into());
6390 query = query.arg_lazy(
6391 "value",
6392 Box::new(move || {
6393 let value = value.clone();
6394 Box::pin(async move { value.into_id().await.unwrap().quote() })
6395 }),
6396 );
6397 query = query.arg("description", description.into());
6398 Env {
6399 proc: self.proc.clone(),
6400 selection: query,
6401 graphql_client: self.graphql_client.clone(),
6402 }
6403 }
6404 pub fn with_module_output(
6411 &self,
6412 name: impl Into<String>,
6413 description: impl Into<String>,
6414 ) -> Env {
6415 let mut query = self.selection.select("withModuleOutput");
6416 query = query.arg("name", name.into());
6417 query = query.arg("description", description.into());
6418 Env {
6419 proc: self.proc.clone(),
6420 selection: query,
6421 graphql_client: self.graphql_client.clone(),
6422 }
6423 }
6424 pub fn with_module_source_input(
6432 &self,
6433 name: impl Into<String>,
6434 value: impl IntoID<ModuleSourceId>,
6435 description: impl Into<String>,
6436 ) -> Env {
6437 let mut query = self.selection.select("withModuleSourceInput");
6438 query = query.arg("name", name.into());
6439 query = query.arg_lazy(
6440 "value",
6441 Box::new(move || {
6442 let value = value.clone();
6443 Box::pin(async move { value.into_id().await.unwrap().quote() })
6444 }),
6445 );
6446 query = query.arg("description", description.into());
6447 Env {
6448 proc: self.proc.clone(),
6449 selection: query,
6450 graphql_client: self.graphql_client.clone(),
6451 }
6452 }
6453 pub fn with_module_source_output(
6460 &self,
6461 name: impl Into<String>,
6462 description: impl Into<String>,
6463 ) -> Env {
6464 let mut query = self.selection.select("withModuleSourceOutput");
6465 query = query.arg("name", name.into());
6466 query = query.arg("description", description.into());
6467 Env {
6468 proc: self.proc.clone(),
6469 selection: query,
6470 graphql_client: self.graphql_client.clone(),
6471 }
6472 }
6473 pub fn with_search_result_input(
6481 &self,
6482 name: impl Into<String>,
6483 value: impl IntoID<SearchResultId>,
6484 description: impl Into<String>,
6485 ) -> Env {
6486 let mut query = self.selection.select("withSearchResultInput");
6487 query = query.arg("name", name.into());
6488 query = query.arg_lazy(
6489 "value",
6490 Box::new(move || {
6491 let value = value.clone();
6492 Box::pin(async move { value.into_id().await.unwrap().quote() })
6493 }),
6494 );
6495 query = query.arg("description", description.into());
6496 Env {
6497 proc: self.proc.clone(),
6498 selection: query,
6499 graphql_client: self.graphql_client.clone(),
6500 }
6501 }
6502 pub fn with_search_result_output(
6509 &self,
6510 name: impl Into<String>,
6511 description: impl Into<String>,
6512 ) -> Env {
6513 let mut query = self.selection.select("withSearchResultOutput");
6514 query = query.arg("name", name.into());
6515 query = query.arg("description", description.into());
6516 Env {
6517 proc: self.proc.clone(),
6518 selection: query,
6519 graphql_client: self.graphql_client.clone(),
6520 }
6521 }
6522 pub fn with_search_submatch_input(
6530 &self,
6531 name: impl Into<String>,
6532 value: impl IntoID<SearchSubmatchId>,
6533 description: impl Into<String>,
6534 ) -> Env {
6535 let mut query = self.selection.select("withSearchSubmatchInput");
6536 query = query.arg("name", name.into());
6537 query = query.arg_lazy(
6538 "value",
6539 Box::new(move || {
6540 let value = value.clone();
6541 Box::pin(async move { value.into_id().await.unwrap().quote() })
6542 }),
6543 );
6544 query = query.arg("description", description.into());
6545 Env {
6546 proc: self.proc.clone(),
6547 selection: query,
6548 graphql_client: self.graphql_client.clone(),
6549 }
6550 }
6551 pub fn with_search_submatch_output(
6558 &self,
6559 name: impl Into<String>,
6560 description: impl Into<String>,
6561 ) -> Env {
6562 let mut query = self.selection.select("withSearchSubmatchOutput");
6563 query = query.arg("name", name.into());
6564 query = query.arg("description", description.into());
6565 Env {
6566 proc: self.proc.clone(),
6567 selection: query,
6568 graphql_client: self.graphql_client.clone(),
6569 }
6570 }
6571 pub fn with_secret_input(
6579 &self,
6580 name: impl Into<String>,
6581 value: impl IntoID<SecretId>,
6582 description: impl Into<String>,
6583 ) -> Env {
6584 let mut query = self.selection.select("withSecretInput");
6585 query = query.arg("name", name.into());
6586 query = query.arg_lazy(
6587 "value",
6588 Box::new(move || {
6589 let value = value.clone();
6590 Box::pin(async move { value.into_id().await.unwrap().quote() })
6591 }),
6592 );
6593 query = query.arg("description", description.into());
6594 Env {
6595 proc: self.proc.clone(),
6596 selection: query,
6597 graphql_client: self.graphql_client.clone(),
6598 }
6599 }
6600 pub fn with_secret_output(
6607 &self,
6608 name: impl Into<String>,
6609 description: impl Into<String>,
6610 ) -> Env {
6611 let mut query = self.selection.select("withSecretOutput");
6612 query = query.arg("name", name.into());
6613 query = query.arg("description", description.into());
6614 Env {
6615 proc: self.proc.clone(),
6616 selection: query,
6617 graphql_client: self.graphql_client.clone(),
6618 }
6619 }
6620 pub fn with_service_input(
6628 &self,
6629 name: impl Into<String>,
6630 value: impl IntoID<ServiceId>,
6631 description: impl Into<String>,
6632 ) -> Env {
6633 let mut query = self.selection.select("withServiceInput");
6634 query = query.arg("name", name.into());
6635 query = query.arg_lazy(
6636 "value",
6637 Box::new(move || {
6638 let value = value.clone();
6639 Box::pin(async move { value.into_id().await.unwrap().quote() })
6640 }),
6641 );
6642 query = query.arg("description", description.into());
6643 Env {
6644 proc: self.proc.clone(),
6645 selection: query,
6646 graphql_client: self.graphql_client.clone(),
6647 }
6648 }
6649 pub fn with_service_output(
6656 &self,
6657 name: impl Into<String>,
6658 description: impl Into<String>,
6659 ) -> Env {
6660 let mut query = self.selection.select("withServiceOutput");
6661 query = query.arg("name", name.into());
6662 query = query.arg("description", description.into());
6663 Env {
6664 proc: self.proc.clone(),
6665 selection: query,
6666 graphql_client: self.graphql_client.clone(),
6667 }
6668 }
6669 pub fn with_socket_input(
6677 &self,
6678 name: impl Into<String>,
6679 value: impl IntoID<SocketId>,
6680 description: impl Into<String>,
6681 ) -> Env {
6682 let mut query = self.selection.select("withSocketInput");
6683 query = query.arg("name", name.into());
6684 query = query.arg_lazy(
6685 "value",
6686 Box::new(move || {
6687 let value = value.clone();
6688 Box::pin(async move { value.into_id().await.unwrap().quote() })
6689 }),
6690 );
6691 query = query.arg("description", description.into());
6692 Env {
6693 proc: self.proc.clone(),
6694 selection: query,
6695 graphql_client: self.graphql_client.clone(),
6696 }
6697 }
6698 pub fn with_socket_output(
6705 &self,
6706 name: impl Into<String>,
6707 description: impl Into<String>,
6708 ) -> Env {
6709 let mut query = self.selection.select("withSocketOutput");
6710 query = query.arg("name", name.into());
6711 query = query.arg("description", description.into());
6712 Env {
6713 proc: self.proc.clone(),
6714 selection: query,
6715 graphql_client: self.graphql_client.clone(),
6716 }
6717 }
6718 pub fn with_string_input(
6726 &self,
6727 name: impl Into<String>,
6728 value: impl Into<String>,
6729 description: impl Into<String>,
6730 ) -> Env {
6731 let mut query = self.selection.select("withStringInput");
6732 query = query.arg("name", name.into());
6733 query = query.arg("value", value.into());
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_string_output(
6748 &self,
6749 name: impl Into<String>,
6750 description: impl Into<String>,
6751 ) -> Env {
6752 let mut query = self.selection.select("withStringOutput");
6753 query = query.arg("name", name.into());
6754 query = query.arg("description", description.into());
6755 Env {
6756 proc: self.proc.clone(),
6757 selection: query,
6758 graphql_client: self.graphql_client.clone(),
6759 }
6760 }
6761}
6762#[derive(Clone)]
6763pub struct EnvVariable {
6764 pub proc: Option<Arc<DaggerSessionProc>>,
6765 pub selection: Selection,
6766 pub graphql_client: DynGraphQLClient,
6767}
6768impl EnvVariable {
6769 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
6771 let query = self.selection.select("id");
6772 query.execute(self.graphql_client.clone()).await
6773 }
6774 pub async fn name(&self) -> Result<String, DaggerError> {
6776 let query = self.selection.select("name");
6777 query.execute(self.graphql_client.clone()).await
6778 }
6779 pub async fn value(&self) -> Result<String, DaggerError> {
6781 let query = self.selection.select("value");
6782 query.execute(self.graphql_client.clone()).await
6783 }
6784}
6785#[derive(Clone)]
6786pub struct Error {
6787 pub proc: Option<Arc<DaggerSessionProc>>,
6788 pub selection: Selection,
6789 pub graphql_client: DynGraphQLClient,
6790}
6791impl Error {
6792 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
6794 let query = self.selection.select("id");
6795 query.execute(self.graphql_client.clone()).await
6796 }
6797 pub async fn message(&self) -> Result<String, DaggerError> {
6799 let query = self.selection.select("message");
6800 query.execute(self.graphql_client.clone()).await
6801 }
6802 pub fn values(&self) -> Vec<ErrorValue> {
6804 let query = self.selection.select("values");
6805 vec![ErrorValue {
6806 proc: self.proc.clone(),
6807 selection: query,
6808 graphql_client: self.graphql_client.clone(),
6809 }]
6810 }
6811 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
6818 let mut query = self.selection.select("withValue");
6819 query = query.arg("name", name.into());
6820 query = query.arg("value", value);
6821 Error {
6822 proc: self.proc.clone(),
6823 selection: query,
6824 graphql_client: self.graphql_client.clone(),
6825 }
6826 }
6827}
6828#[derive(Clone)]
6829pub struct ErrorValue {
6830 pub proc: Option<Arc<DaggerSessionProc>>,
6831 pub selection: Selection,
6832 pub graphql_client: DynGraphQLClient,
6833}
6834impl ErrorValue {
6835 pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
6837 let query = self.selection.select("id");
6838 query.execute(self.graphql_client.clone()).await
6839 }
6840 pub async fn name(&self) -> Result<String, DaggerError> {
6842 let query = self.selection.select("name");
6843 query.execute(self.graphql_client.clone()).await
6844 }
6845 pub async fn value(&self) -> Result<Json, DaggerError> {
6847 let query = self.selection.select("value");
6848 query.execute(self.graphql_client.clone()).await
6849 }
6850}
6851#[derive(Clone)]
6852pub struct FieldTypeDef {
6853 pub proc: Option<Arc<DaggerSessionProc>>,
6854 pub selection: Selection,
6855 pub graphql_client: DynGraphQLClient,
6856}
6857impl FieldTypeDef {
6858 pub async fn description(&self) -> Result<String, DaggerError> {
6860 let query = self.selection.select("description");
6861 query.execute(self.graphql_client.clone()).await
6862 }
6863 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
6865 let query = self.selection.select("id");
6866 query.execute(self.graphql_client.clone()).await
6867 }
6868 pub async fn name(&self) -> Result<String, DaggerError> {
6870 let query = self.selection.select("name");
6871 query.execute(self.graphql_client.clone()).await
6872 }
6873 pub fn source_map(&self) -> SourceMap {
6875 let query = self.selection.select("sourceMap");
6876 SourceMap {
6877 proc: self.proc.clone(),
6878 selection: query,
6879 graphql_client: self.graphql_client.clone(),
6880 }
6881 }
6882 pub fn type_def(&self) -> TypeDef {
6884 let query = self.selection.select("typeDef");
6885 TypeDef {
6886 proc: self.proc.clone(),
6887 selection: query,
6888 graphql_client: self.graphql_client.clone(),
6889 }
6890 }
6891}
6892#[derive(Clone)]
6893pub struct File {
6894 pub proc: Option<Arc<DaggerSessionProc>>,
6895 pub selection: Selection,
6896 pub graphql_client: DynGraphQLClient,
6897}
6898#[derive(Builder, Debug, PartialEq)]
6899pub struct FileContentsOpts {
6900 #[builder(setter(into, strip_option), default)]
6902 pub limit_lines: Option<isize>,
6903 #[builder(setter(into, strip_option), default)]
6905 pub offset_lines: Option<isize>,
6906}
6907#[derive(Builder, Debug, PartialEq)]
6908pub struct FileDigestOpts {
6909 #[builder(setter(into, strip_option), default)]
6911 pub exclude_metadata: Option<bool>,
6912}
6913#[derive(Builder, Debug, PartialEq)]
6914pub struct FileExportOpts {
6915 #[builder(setter(into, strip_option), default)]
6917 pub allow_parent_dir_path: Option<bool>,
6918}
6919#[derive(Builder, Debug, PartialEq)]
6920pub struct FileSearchOpts<'a> {
6921 #[builder(setter(into, strip_option), default)]
6923 pub dotall: Option<bool>,
6924 #[builder(setter(into, strip_option), default)]
6926 pub files_only: Option<bool>,
6927 #[builder(setter(into, strip_option), default)]
6928 pub globs: Option<Vec<&'a str>>,
6929 #[builder(setter(into, strip_option), default)]
6931 pub insensitive: Option<bool>,
6932 #[builder(setter(into, strip_option), default)]
6934 pub limit: Option<isize>,
6935 #[builder(setter(into, strip_option), default)]
6937 pub literal: Option<bool>,
6938 #[builder(setter(into, strip_option), default)]
6940 pub multiline: Option<bool>,
6941 #[builder(setter(into, strip_option), default)]
6942 pub paths: Option<Vec<&'a str>>,
6943 #[builder(setter(into, strip_option), default)]
6945 pub skip_hidden: Option<bool>,
6946 #[builder(setter(into, strip_option), default)]
6948 pub skip_ignored: Option<bool>,
6949}
6950#[derive(Builder, Debug, PartialEq)]
6951pub struct FileWithReplacedOpts {
6952 #[builder(setter(into, strip_option), default)]
6954 pub all: Option<bool>,
6955 #[builder(setter(into, strip_option), default)]
6957 pub first_from: Option<isize>,
6958}
6959impl File {
6960 pub async fn contents(&self) -> Result<String, DaggerError> {
6966 let query = self.selection.select("contents");
6967 query.execute(self.graphql_client.clone()).await
6968 }
6969 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
6975 let mut query = self.selection.select("contents");
6976 if let Some(offset_lines) = opts.offset_lines {
6977 query = query.arg("offsetLines", offset_lines);
6978 }
6979 if let Some(limit_lines) = opts.limit_lines {
6980 query = query.arg("limitLines", limit_lines);
6981 }
6982 query.execute(self.graphql_client.clone()).await
6983 }
6984 pub async fn digest(&self) -> Result<String, DaggerError> {
6990 let query = self.selection.select("digest");
6991 query.execute(self.graphql_client.clone()).await
6992 }
6993 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
6999 let mut query = self.selection.select("digest");
7000 if let Some(exclude_metadata) = opts.exclude_metadata {
7001 query = query.arg("excludeMetadata", exclude_metadata);
7002 }
7003 query.execute(self.graphql_client.clone()).await
7004 }
7005 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7012 let mut query = self.selection.select("export");
7013 query = query.arg("path", path.into());
7014 query.execute(self.graphql_client.clone()).await
7015 }
7016 pub async fn export_opts(
7023 &self,
7024 path: impl Into<String>,
7025 opts: FileExportOpts,
7026 ) -> Result<String, DaggerError> {
7027 let mut query = self.selection.select("export");
7028 query = query.arg("path", path.into());
7029 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7030 query = query.arg("allowParentDirPath", allow_parent_dir_path);
7031 }
7032 query.execute(self.graphql_client.clone()).await
7033 }
7034 pub async fn id(&self) -> Result<FileId, DaggerError> {
7036 let query = self.selection.select("id");
7037 query.execute(self.graphql_client.clone()).await
7038 }
7039 pub async fn name(&self) -> Result<String, DaggerError> {
7041 let query = self.selection.select("name");
7042 query.execute(self.graphql_client.clone()).await
7043 }
7044 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7052 let mut query = self.selection.select("search");
7053 query = query.arg("pattern", pattern.into());
7054 vec![SearchResult {
7055 proc: self.proc.clone(),
7056 selection: query,
7057 graphql_client: self.graphql_client.clone(),
7058 }]
7059 }
7060 pub fn search_opts<'a>(
7068 &self,
7069 pattern: impl Into<String>,
7070 opts: FileSearchOpts<'a>,
7071 ) -> Vec<SearchResult> {
7072 let mut query = self.selection.select("search");
7073 query = query.arg("pattern", pattern.into());
7074 if let Some(literal) = opts.literal {
7075 query = query.arg("literal", literal);
7076 }
7077 if let Some(multiline) = opts.multiline {
7078 query = query.arg("multiline", multiline);
7079 }
7080 if let Some(dotall) = opts.dotall {
7081 query = query.arg("dotall", dotall);
7082 }
7083 if let Some(insensitive) = opts.insensitive {
7084 query = query.arg("insensitive", insensitive);
7085 }
7086 if let Some(skip_ignored) = opts.skip_ignored {
7087 query = query.arg("skipIgnored", skip_ignored);
7088 }
7089 if let Some(skip_hidden) = opts.skip_hidden {
7090 query = query.arg("skipHidden", skip_hidden);
7091 }
7092 if let Some(files_only) = opts.files_only {
7093 query = query.arg("filesOnly", files_only);
7094 }
7095 if let Some(limit) = opts.limit {
7096 query = query.arg("limit", limit);
7097 }
7098 if let Some(paths) = opts.paths {
7099 query = query.arg("paths", paths);
7100 }
7101 if let Some(globs) = opts.globs {
7102 query = query.arg("globs", globs);
7103 }
7104 vec![SearchResult {
7105 proc: self.proc.clone(),
7106 selection: query,
7107 graphql_client: self.graphql_client.clone(),
7108 }]
7109 }
7110 pub async fn size(&self) -> Result<isize, DaggerError> {
7112 let query = self.selection.select("size");
7113 query.execute(self.graphql_client.clone()).await
7114 }
7115 pub async fn sync(&self) -> Result<FileId, DaggerError> {
7117 let query = self.selection.select("sync");
7118 query.execute(self.graphql_client.clone()).await
7119 }
7120 pub fn with_name(&self, name: impl Into<String>) -> File {
7126 let mut query = self.selection.select("withName");
7127 query = query.arg("name", name.into());
7128 File {
7129 proc: self.proc.clone(),
7130 selection: query,
7131 graphql_client: self.graphql_client.clone(),
7132 }
7133 }
7134 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7146 let mut query = self.selection.select("withReplaced");
7147 query = query.arg("search", search.into());
7148 query = query.arg("replacement", replacement.into());
7149 File {
7150 proc: self.proc.clone(),
7151 selection: query,
7152 graphql_client: self.graphql_client.clone(),
7153 }
7154 }
7155 pub fn with_replaced_opts(
7167 &self,
7168 search: impl Into<String>,
7169 replacement: impl Into<String>,
7170 opts: FileWithReplacedOpts,
7171 ) -> File {
7172 let mut query = self.selection.select("withReplaced");
7173 query = query.arg("search", search.into());
7174 query = query.arg("replacement", replacement.into());
7175 if let Some(all) = opts.all {
7176 query = query.arg("all", all);
7177 }
7178 if let Some(first_from) = opts.first_from {
7179 query = query.arg("firstFrom", first_from);
7180 }
7181 File {
7182 proc: self.proc.clone(),
7183 selection: query,
7184 graphql_client: self.graphql_client.clone(),
7185 }
7186 }
7187 pub fn with_timestamps(&self, timestamp: isize) -> File {
7195 let mut query = self.selection.select("withTimestamps");
7196 query = query.arg("timestamp", timestamp);
7197 File {
7198 proc: self.proc.clone(),
7199 selection: query,
7200 graphql_client: self.graphql_client.clone(),
7201 }
7202 }
7203}
7204#[derive(Clone)]
7205pub struct Function {
7206 pub proc: Option<Arc<DaggerSessionProc>>,
7207 pub selection: Selection,
7208 pub graphql_client: DynGraphQLClient,
7209}
7210#[derive(Builder, Debug, PartialEq)]
7211pub struct FunctionWithArgOpts<'a> {
7212 #[builder(setter(into, strip_option), default)]
7214 pub default_path: Option<&'a str>,
7215 #[builder(setter(into, strip_option), default)]
7217 pub default_value: Option<Json>,
7218 #[builder(setter(into, strip_option), default)]
7220 pub description: Option<&'a str>,
7221 #[builder(setter(into, strip_option), default)]
7223 pub ignore: Option<Vec<&'a str>>,
7224 #[builder(setter(into, strip_option), default)]
7226 pub source_map: Option<SourceMapId>,
7227}
7228impl Function {
7229 pub fn args(&self) -> Vec<FunctionArg> {
7231 let query = self.selection.select("args");
7232 vec![FunctionArg {
7233 proc: self.proc.clone(),
7234 selection: query,
7235 graphql_client: self.graphql_client.clone(),
7236 }]
7237 }
7238 pub async fn description(&self) -> Result<String, DaggerError> {
7240 let query = self.selection.select("description");
7241 query.execute(self.graphql_client.clone()).await
7242 }
7243 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
7245 let query = self.selection.select("id");
7246 query.execute(self.graphql_client.clone()).await
7247 }
7248 pub async fn name(&self) -> Result<String, DaggerError> {
7250 let query = self.selection.select("name");
7251 query.execute(self.graphql_client.clone()).await
7252 }
7253 pub fn return_type(&self) -> TypeDef {
7255 let query = self.selection.select("returnType");
7256 TypeDef {
7257 proc: self.proc.clone(),
7258 selection: query,
7259 graphql_client: self.graphql_client.clone(),
7260 }
7261 }
7262 pub fn source_map(&self) -> SourceMap {
7264 let query = self.selection.select("sourceMap");
7265 SourceMap {
7266 proc: self.proc.clone(),
7267 selection: query,
7268 graphql_client: self.graphql_client.clone(),
7269 }
7270 }
7271 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
7279 let mut query = self.selection.select("withArg");
7280 query = query.arg("name", name.into());
7281 query = query.arg_lazy(
7282 "typeDef",
7283 Box::new(move || {
7284 let type_def = type_def.clone();
7285 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7286 }),
7287 );
7288 Function {
7289 proc: self.proc.clone(),
7290 selection: query,
7291 graphql_client: self.graphql_client.clone(),
7292 }
7293 }
7294 pub fn with_arg_opts<'a>(
7302 &self,
7303 name: impl Into<String>,
7304 type_def: impl IntoID<TypeDefId>,
7305 opts: FunctionWithArgOpts<'a>,
7306 ) -> Function {
7307 let mut query = self.selection.select("withArg");
7308 query = query.arg("name", name.into());
7309 query = query.arg_lazy(
7310 "typeDef",
7311 Box::new(move || {
7312 let type_def = type_def.clone();
7313 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7314 }),
7315 );
7316 if let Some(description) = opts.description {
7317 query = query.arg("description", description);
7318 }
7319 if let Some(default_value) = opts.default_value {
7320 query = query.arg("defaultValue", default_value);
7321 }
7322 if let Some(default_path) = opts.default_path {
7323 query = query.arg("defaultPath", default_path);
7324 }
7325 if let Some(ignore) = opts.ignore {
7326 query = query.arg("ignore", ignore);
7327 }
7328 if let Some(source_map) = opts.source_map {
7329 query = query.arg("sourceMap", source_map);
7330 }
7331 Function {
7332 proc: self.proc.clone(),
7333 selection: query,
7334 graphql_client: self.graphql_client.clone(),
7335 }
7336 }
7337 pub fn with_description(&self, description: impl Into<String>) -> Function {
7343 let mut query = self.selection.select("withDescription");
7344 query = query.arg("description", description.into());
7345 Function {
7346 proc: self.proc.clone(),
7347 selection: query,
7348 graphql_client: self.graphql_client.clone(),
7349 }
7350 }
7351 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
7357 let mut query = self.selection.select("withSourceMap");
7358 query = query.arg_lazy(
7359 "sourceMap",
7360 Box::new(move || {
7361 let source_map = source_map.clone();
7362 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
7363 }),
7364 );
7365 Function {
7366 proc: self.proc.clone(),
7367 selection: query,
7368 graphql_client: self.graphql_client.clone(),
7369 }
7370 }
7371}
7372#[derive(Clone)]
7373pub struct FunctionArg {
7374 pub proc: Option<Arc<DaggerSessionProc>>,
7375 pub selection: Selection,
7376 pub graphql_client: DynGraphQLClient,
7377}
7378impl FunctionArg {
7379 pub async fn default_path(&self) -> Result<String, DaggerError> {
7381 let query = self.selection.select("defaultPath");
7382 query.execute(self.graphql_client.clone()).await
7383 }
7384 pub async fn default_value(&self) -> Result<Json, DaggerError> {
7386 let query = self.selection.select("defaultValue");
7387 query.execute(self.graphql_client.clone()).await
7388 }
7389 pub async fn description(&self) -> Result<String, DaggerError> {
7391 let query = self.selection.select("description");
7392 query.execute(self.graphql_client.clone()).await
7393 }
7394 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
7396 let query = self.selection.select("id");
7397 query.execute(self.graphql_client.clone()).await
7398 }
7399 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
7401 let query = self.selection.select("ignore");
7402 query.execute(self.graphql_client.clone()).await
7403 }
7404 pub async fn name(&self) -> Result<String, DaggerError> {
7406 let query = self.selection.select("name");
7407 query.execute(self.graphql_client.clone()).await
7408 }
7409 pub fn source_map(&self) -> SourceMap {
7411 let query = self.selection.select("sourceMap");
7412 SourceMap {
7413 proc: self.proc.clone(),
7414 selection: query,
7415 graphql_client: self.graphql_client.clone(),
7416 }
7417 }
7418 pub fn type_def(&self) -> TypeDef {
7420 let query = self.selection.select("typeDef");
7421 TypeDef {
7422 proc: self.proc.clone(),
7423 selection: query,
7424 graphql_client: self.graphql_client.clone(),
7425 }
7426 }
7427}
7428#[derive(Clone)]
7429pub struct FunctionCall {
7430 pub proc: Option<Arc<DaggerSessionProc>>,
7431 pub selection: Selection,
7432 pub graphql_client: DynGraphQLClient,
7433}
7434impl FunctionCall {
7435 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
7437 let query = self.selection.select("id");
7438 query.execute(self.graphql_client.clone()).await
7439 }
7440 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
7442 let query = self.selection.select("inputArgs");
7443 vec![FunctionCallArgValue {
7444 proc: self.proc.clone(),
7445 selection: query,
7446 graphql_client: self.graphql_client.clone(),
7447 }]
7448 }
7449 pub async fn name(&self) -> Result<String, DaggerError> {
7451 let query = self.selection.select("name");
7452 query.execute(self.graphql_client.clone()).await
7453 }
7454 pub async fn parent(&self) -> Result<Json, DaggerError> {
7456 let query = self.selection.select("parent");
7457 query.execute(self.graphql_client.clone()).await
7458 }
7459 pub async fn parent_name(&self) -> Result<String, DaggerError> {
7461 let query = self.selection.select("parentName");
7462 query.execute(self.graphql_client.clone()).await
7463 }
7464 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
7470 let mut query = self.selection.select("returnError");
7471 query = query.arg_lazy(
7472 "error",
7473 Box::new(move || {
7474 let error = error.clone();
7475 Box::pin(async move { error.into_id().await.unwrap().quote() })
7476 }),
7477 );
7478 query.execute(self.graphql_client.clone()).await
7479 }
7480 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
7486 let mut query = self.selection.select("returnValue");
7487 query = query.arg("value", value);
7488 query.execute(self.graphql_client.clone()).await
7489 }
7490}
7491#[derive(Clone)]
7492pub struct FunctionCallArgValue {
7493 pub proc: Option<Arc<DaggerSessionProc>>,
7494 pub selection: Selection,
7495 pub graphql_client: DynGraphQLClient,
7496}
7497impl FunctionCallArgValue {
7498 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
7500 let query = self.selection.select("id");
7501 query.execute(self.graphql_client.clone()).await
7502 }
7503 pub async fn name(&self) -> Result<String, DaggerError> {
7505 let query = self.selection.select("name");
7506 query.execute(self.graphql_client.clone()).await
7507 }
7508 pub async fn value(&self) -> Result<Json, DaggerError> {
7510 let query = self.selection.select("value");
7511 query.execute(self.graphql_client.clone()).await
7512 }
7513}
7514#[derive(Clone)]
7515pub struct GeneratedCode {
7516 pub proc: Option<Arc<DaggerSessionProc>>,
7517 pub selection: Selection,
7518 pub graphql_client: DynGraphQLClient,
7519}
7520impl GeneratedCode {
7521 pub fn code(&self) -> Directory {
7523 let query = self.selection.select("code");
7524 Directory {
7525 proc: self.proc.clone(),
7526 selection: query,
7527 graphql_client: self.graphql_client.clone(),
7528 }
7529 }
7530 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
7532 let query = self.selection.select("id");
7533 query.execute(self.graphql_client.clone()).await
7534 }
7535 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
7537 let query = self.selection.select("vcsGeneratedPaths");
7538 query.execute(self.graphql_client.clone()).await
7539 }
7540 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
7542 let query = self.selection.select("vcsIgnoredPaths");
7543 query.execute(self.graphql_client.clone()).await
7544 }
7545 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
7547 let mut query = self.selection.select("withVCSGeneratedPaths");
7548 query = query.arg(
7549 "paths",
7550 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7551 );
7552 GeneratedCode {
7553 proc: self.proc.clone(),
7554 selection: query,
7555 graphql_client: self.graphql_client.clone(),
7556 }
7557 }
7558 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
7560 let mut query = self.selection.select("withVCSIgnoredPaths");
7561 query = query.arg(
7562 "paths",
7563 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7564 );
7565 GeneratedCode {
7566 proc: self.proc.clone(),
7567 selection: query,
7568 graphql_client: self.graphql_client.clone(),
7569 }
7570 }
7571}
7572#[derive(Clone)]
7573pub struct GitRef {
7574 pub proc: Option<Arc<DaggerSessionProc>>,
7575 pub selection: Selection,
7576 pub graphql_client: DynGraphQLClient,
7577}
7578#[derive(Builder, Debug, PartialEq)]
7579pub struct GitRefTreeOpts {
7580 #[builder(setter(into, strip_option), default)]
7582 pub depth: Option<isize>,
7583 #[builder(setter(into, strip_option), default)]
7585 pub discard_git_dir: Option<bool>,
7586}
7587impl GitRef {
7588 pub async fn commit(&self) -> Result<String, DaggerError> {
7590 let query = self.selection.select("commit");
7591 query.execute(self.graphql_client.clone()).await
7592 }
7593 pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
7599 let mut query = self.selection.select("commonAncestor");
7600 query = query.arg_lazy(
7601 "other",
7602 Box::new(move || {
7603 let other = other.clone();
7604 Box::pin(async move { other.into_id().await.unwrap().quote() })
7605 }),
7606 );
7607 GitRef {
7608 proc: self.proc.clone(),
7609 selection: query,
7610 graphql_client: self.graphql_client.clone(),
7611 }
7612 }
7613 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
7615 let query = self.selection.select("id");
7616 query.execute(self.graphql_client.clone()).await
7617 }
7618 pub async fn r#ref(&self) -> Result<String, DaggerError> {
7620 let query = self.selection.select("ref");
7621 query.execute(self.graphql_client.clone()).await
7622 }
7623 pub fn tree(&self) -> Directory {
7629 let query = self.selection.select("tree");
7630 Directory {
7631 proc: self.proc.clone(),
7632 selection: query,
7633 graphql_client: self.graphql_client.clone(),
7634 }
7635 }
7636 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
7642 let mut query = self.selection.select("tree");
7643 if let Some(discard_git_dir) = opts.discard_git_dir {
7644 query = query.arg("discardGitDir", discard_git_dir);
7645 }
7646 if let Some(depth) = opts.depth {
7647 query = query.arg("depth", depth);
7648 }
7649 Directory {
7650 proc: self.proc.clone(),
7651 selection: query,
7652 graphql_client: self.graphql_client.clone(),
7653 }
7654 }
7655}
7656#[derive(Clone)]
7657pub struct GitRepository {
7658 pub proc: Option<Arc<DaggerSessionProc>>,
7659 pub selection: Selection,
7660 pub graphql_client: DynGraphQLClient,
7661}
7662#[derive(Builder, Debug, PartialEq)]
7663pub struct GitRepositoryBranchesOpts<'a> {
7664 #[builder(setter(into, strip_option), default)]
7666 pub patterns: Option<Vec<&'a str>>,
7667}
7668#[derive(Builder, Debug, PartialEq)]
7669pub struct GitRepositoryTagsOpts<'a> {
7670 #[builder(setter(into, strip_option), default)]
7672 pub patterns: Option<Vec<&'a str>>,
7673}
7674impl GitRepository {
7675 pub fn branch(&self, name: impl Into<String>) -> GitRef {
7681 let mut query = self.selection.select("branch");
7682 query = query.arg("name", name.into());
7683 GitRef {
7684 proc: self.proc.clone(),
7685 selection: query,
7686 graphql_client: self.graphql_client.clone(),
7687 }
7688 }
7689 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
7695 let query = self.selection.select("branches");
7696 query.execute(self.graphql_client.clone()).await
7697 }
7698 pub async fn branches_opts<'a>(
7704 &self,
7705 opts: GitRepositoryBranchesOpts<'a>,
7706 ) -> Result<Vec<String>, DaggerError> {
7707 let mut query = self.selection.select("branches");
7708 if let Some(patterns) = opts.patterns {
7709 query = query.arg("patterns", patterns);
7710 }
7711 query.execute(self.graphql_client.clone()).await
7712 }
7713 pub fn commit(&self, id: impl Into<String>) -> GitRef {
7719 let mut query = self.selection.select("commit");
7720 query = query.arg("id", id.into());
7721 GitRef {
7722 proc: self.proc.clone(),
7723 selection: query,
7724 graphql_client: self.graphql_client.clone(),
7725 }
7726 }
7727 pub fn head(&self) -> GitRef {
7729 let query = self.selection.select("head");
7730 GitRef {
7731 proc: self.proc.clone(),
7732 selection: query,
7733 graphql_client: self.graphql_client.clone(),
7734 }
7735 }
7736 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
7738 let query = self.selection.select("id");
7739 query.execute(self.graphql_client.clone()).await
7740 }
7741 pub fn latest_version(&self) -> GitRef {
7743 let query = self.selection.select("latestVersion");
7744 GitRef {
7745 proc: self.proc.clone(),
7746 selection: query,
7747 graphql_client: self.graphql_client.clone(),
7748 }
7749 }
7750 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
7756 let mut query = self.selection.select("ref");
7757 query = query.arg("name", name.into());
7758 GitRef {
7759 proc: self.proc.clone(),
7760 selection: query,
7761 graphql_client: self.graphql_client.clone(),
7762 }
7763 }
7764 pub fn tag(&self, name: impl Into<String>) -> GitRef {
7770 let mut query = self.selection.select("tag");
7771 query = query.arg("name", name.into());
7772 GitRef {
7773 proc: self.proc.clone(),
7774 selection: query,
7775 graphql_client: self.graphql_client.clone(),
7776 }
7777 }
7778 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
7784 let query = self.selection.select("tags");
7785 query.execute(self.graphql_client.clone()).await
7786 }
7787 pub async fn tags_opts<'a>(
7793 &self,
7794 opts: GitRepositoryTagsOpts<'a>,
7795 ) -> Result<Vec<String>, DaggerError> {
7796 let mut query = self.selection.select("tags");
7797 if let Some(patterns) = opts.patterns {
7798 query = query.arg("patterns", patterns);
7799 }
7800 query.execute(self.graphql_client.clone()).await
7801 }
7802 pub async fn url(&self) -> Result<String, DaggerError> {
7804 let query = self.selection.select("url");
7805 query.execute(self.graphql_client.clone()).await
7806 }
7807 pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
7813 let mut query = self.selection.select("withAuthHeader");
7814 query = query.arg_lazy(
7815 "header",
7816 Box::new(move || {
7817 let header = header.clone();
7818 Box::pin(async move { header.into_id().await.unwrap().quote() })
7819 }),
7820 );
7821 GitRepository {
7822 proc: self.proc.clone(),
7823 selection: query,
7824 graphql_client: self.graphql_client.clone(),
7825 }
7826 }
7827 pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
7833 let mut query = self.selection.select("withAuthToken");
7834 query = query.arg_lazy(
7835 "token",
7836 Box::new(move || {
7837 let token = token.clone();
7838 Box::pin(async move { token.into_id().await.unwrap().quote() })
7839 }),
7840 );
7841 GitRepository {
7842 proc: self.proc.clone(),
7843 selection: query,
7844 graphql_client: self.graphql_client.clone(),
7845 }
7846 }
7847}
7848#[derive(Clone)]
7849pub struct Host {
7850 pub proc: Option<Arc<DaggerSessionProc>>,
7851 pub selection: Selection,
7852 pub graphql_client: DynGraphQLClient,
7853}
7854#[derive(Builder, Debug, PartialEq)]
7855pub struct HostDirectoryOpts<'a> {
7856 #[builder(setter(into, strip_option), default)]
7858 pub exclude: Option<Vec<&'a str>>,
7859 #[builder(setter(into, strip_option), default)]
7861 pub include: Option<Vec<&'a str>>,
7862 #[builder(setter(into, strip_option), default)]
7864 pub no_cache: Option<bool>,
7865 #[builder(setter(into, strip_option), default)]
7867 pub no_git_auto_ignore: Option<bool>,
7868}
7869#[derive(Builder, Debug, PartialEq)]
7870pub struct HostFileOpts {
7871 #[builder(setter(into, strip_option), default)]
7873 pub no_cache: Option<bool>,
7874}
7875#[derive(Builder, Debug, PartialEq)]
7876pub struct HostServiceOpts<'a> {
7877 #[builder(setter(into, strip_option), default)]
7879 pub host: Option<&'a str>,
7880}
7881#[derive(Builder, Debug, PartialEq)]
7882pub struct HostTunnelOpts {
7883 #[builder(setter(into, strip_option), default)]
7886 pub native: Option<bool>,
7887 #[builder(setter(into, strip_option), default)]
7892 pub ports: Option<Vec<PortForward>>,
7893}
7894impl Host {
7895 pub fn container_image(&self, name: impl Into<String>) -> Container {
7901 let mut query = self.selection.select("containerImage");
7902 query = query.arg("name", name.into());
7903 Container {
7904 proc: self.proc.clone(),
7905 selection: query,
7906 graphql_client: self.graphql_client.clone(),
7907 }
7908 }
7909 pub fn directory(&self, path: impl Into<String>) -> Directory {
7916 let mut query = self.selection.select("directory");
7917 query = query.arg("path", path.into());
7918 Directory {
7919 proc: self.proc.clone(),
7920 selection: query,
7921 graphql_client: self.graphql_client.clone(),
7922 }
7923 }
7924 pub fn directory_opts<'a>(
7931 &self,
7932 path: impl Into<String>,
7933 opts: HostDirectoryOpts<'a>,
7934 ) -> Directory {
7935 let mut query = self.selection.select("directory");
7936 query = query.arg("path", path.into());
7937 if let Some(exclude) = opts.exclude {
7938 query = query.arg("exclude", exclude);
7939 }
7940 if let Some(include) = opts.include {
7941 query = query.arg("include", include);
7942 }
7943 if let Some(no_cache) = opts.no_cache {
7944 query = query.arg("noCache", no_cache);
7945 }
7946 if let Some(no_git_auto_ignore) = opts.no_git_auto_ignore {
7947 query = query.arg("noGitAutoIgnore", no_git_auto_ignore);
7948 }
7949 Directory {
7950 proc: self.proc.clone(),
7951 selection: query,
7952 graphql_client: self.graphql_client.clone(),
7953 }
7954 }
7955 pub fn file(&self, path: impl Into<String>) -> File {
7962 let mut query = self.selection.select("file");
7963 query = query.arg("path", path.into());
7964 File {
7965 proc: self.proc.clone(),
7966 selection: query,
7967 graphql_client: self.graphql_client.clone(),
7968 }
7969 }
7970 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
7977 let mut query = self.selection.select("file");
7978 query = query.arg("path", path.into());
7979 if let Some(no_cache) = opts.no_cache {
7980 query = query.arg("noCache", no_cache);
7981 }
7982 File {
7983 proc: self.proc.clone(),
7984 selection: query,
7985 graphql_client: self.graphql_client.clone(),
7986 }
7987 }
7988 pub async fn id(&self) -> Result<HostId, DaggerError> {
7990 let query = self.selection.select("id");
7991 query.execute(self.graphql_client.clone()).await
7992 }
7993 pub fn service(&self, ports: Vec<PortForward>) -> Service {
8004 let mut query = self.selection.select("service");
8005 query = query.arg("ports", ports);
8006 Service {
8007 proc: self.proc.clone(),
8008 selection: query,
8009 graphql_client: self.graphql_client.clone(),
8010 }
8011 }
8012 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8023 let mut query = self.selection.select("service");
8024 query = query.arg("ports", ports);
8025 if let Some(host) = opts.host {
8026 query = query.arg("host", host);
8027 }
8028 Service {
8029 proc: self.proc.clone(),
8030 selection: query,
8031 graphql_client: self.graphql_client.clone(),
8032 }
8033 }
8034 pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
8042 let mut query = self.selection.select("setSecretFile");
8043 query = query.arg("name", name.into());
8044 query = query.arg("path", path.into());
8045 Secret {
8046 proc: self.proc.clone(),
8047 selection: query,
8048 graphql_client: self.graphql_client.clone(),
8049 }
8050 }
8051 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8058 let mut query = self.selection.select("tunnel");
8059 query = query.arg_lazy(
8060 "service",
8061 Box::new(move || {
8062 let service = service.clone();
8063 Box::pin(async move { service.into_id().await.unwrap().quote() })
8064 }),
8065 );
8066 Service {
8067 proc: self.proc.clone(),
8068 selection: query,
8069 graphql_client: self.graphql_client.clone(),
8070 }
8071 }
8072 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8079 let mut query = self.selection.select("tunnel");
8080 query = query.arg_lazy(
8081 "service",
8082 Box::new(move || {
8083 let service = service.clone();
8084 Box::pin(async move { service.into_id().await.unwrap().quote() })
8085 }),
8086 );
8087 if let Some(native) = opts.native {
8088 query = query.arg("native", native);
8089 }
8090 if let Some(ports) = opts.ports {
8091 query = query.arg("ports", ports);
8092 }
8093 Service {
8094 proc: self.proc.clone(),
8095 selection: query,
8096 graphql_client: self.graphql_client.clone(),
8097 }
8098 }
8099 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
8105 let mut query = self.selection.select("unixSocket");
8106 query = query.arg("path", path.into());
8107 Socket {
8108 proc: self.proc.clone(),
8109 selection: query,
8110 graphql_client: self.graphql_client.clone(),
8111 }
8112 }
8113}
8114#[derive(Clone)]
8115pub struct InputTypeDef {
8116 pub proc: Option<Arc<DaggerSessionProc>>,
8117 pub selection: Selection,
8118 pub graphql_client: DynGraphQLClient,
8119}
8120impl InputTypeDef {
8121 pub fn fields(&self) -> Vec<FieldTypeDef> {
8123 let query = self.selection.select("fields");
8124 vec![FieldTypeDef {
8125 proc: self.proc.clone(),
8126 selection: query,
8127 graphql_client: self.graphql_client.clone(),
8128 }]
8129 }
8130 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
8132 let query = self.selection.select("id");
8133 query.execute(self.graphql_client.clone()).await
8134 }
8135 pub async fn name(&self) -> Result<String, DaggerError> {
8137 let query = self.selection.select("name");
8138 query.execute(self.graphql_client.clone()).await
8139 }
8140}
8141#[derive(Clone)]
8142pub struct InterfaceTypeDef {
8143 pub proc: Option<Arc<DaggerSessionProc>>,
8144 pub selection: Selection,
8145 pub graphql_client: DynGraphQLClient,
8146}
8147impl InterfaceTypeDef {
8148 pub async fn description(&self) -> Result<String, DaggerError> {
8150 let query = self.selection.select("description");
8151 query.execute(self.graphql_client.clone()).await
8152 }
8153 pub fn functions(&self) -> Vec<Function> {
8155 let query = self.selection.select("functions");
8156 vec![Function {
8157 proc: self.proc.clone(),
8158 selection: query,
8159 graphql_client: self.graphql_client.clone(),
8160 }]
8161 }
8162 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
8164 let query = self.selection.select("id");
8165 query.execute(self.graphql_client.clone()).await
8166 }
8167 pub async fn name(&self) -> Result<String, DaggerError> {
8169 let query = self.selection.select("name");
8170 query.execute(self.graphql_client.clone()).await
8171 }
8172 pub fn source_map(&self) -> SourceMap {
8174 let query = self.selection.select("sourceMap");
8175 SourceMap {
8176 proc: self.proc.clone(),
8177 selection: query,
8178 graphql_client: self.graphql_client.clone(),
8179 }
8180 }
8181 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8183 let query = self.selection.select("sourceModuleName");
8184 query.execute(self.graphql_client.clone()).await
8185 }
8186}
8187#[derive(Clone)]
8188pub struct JsonValue {
8189 pub proc: Option<Arc<DaggerSessionProc>>,
8190 pub selection: Selection,
8191 pub graphql_client: DynGraphQLClient,
8192}
8193#[derive(Builder, Debug, PartialEq)]
8194pub struct JsonValueContentsOpts<'a> {
8195 #[builder(setter(into, strip_option), default)]
8197 pub indent: Option<&'a str>,
8198 #[builder(setter(into, strip_option), default)]
8200 pub pretty: Option<bool>,
8201}
8202impl JsonValue {
8203 pub fn as_array(&self) -> Vec<JsonValue> {
8205 let query = self.selection.select("asArray");
8206 vec![JsonValue {
8207 proc: self.proc.clone(),
8208 selection: query,
8209 graphql_client: self.graphql_client.clone(),
8210 }]
8211 }
8212 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
8214 let query = self.selection.select("asBoolean");
8215 query.execute(self.graphql_client.clone()).await
8216 }
8217 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
8219 let query = self.selection.select("asInteger");
8220 query.execute(self.graphql_client.clone()).await
8221 }
8222 pub async fn as_string(&self) -> Result<String, DaggerError> {
8224 let query = self.selection.select("asString");
8225 query.execute(self.graphql_client.clone()).await
8226 }
8227 pub async fn contents(&self) -> Result<Json, DaggerError> {
8233 let query = self.selection.select("contents");
8234 query.execute(self.graphql_client.clone()).await
8235 }
8236 pub async fn contents_opts<'a>(
8242 &self,
8243 opts: JsonValueContentsOpts<'a>,
8244 ) -> Result<Json, DaggerError> {
8245 let mut query = self.selection.select("contents");
8246 if let Some(pretty) = opts.pretty {
8247 query = query.arg("pretty", pretty);
8248 }
8249 if let Some(indent) = opts.indent {
8250 query = query.arg("indent", indent);
8251 }
8252 query.execute(self.graphql_client.clone()).await
8253 }
8254 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
8260 let mut query = self.selection.select("field");
8261 query = query.arg(
8262 "path",
8263 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8264 );
8265 JsonValue {
8266 proc: self.proc.clone(),
8267 selection: query,
8268 graphql_client: self.graphql_client.clone(),
8269 }
8270 }
8271 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
8273 let query = self.selection.select("fields");
8274 query.execute(self.graphql_client.clone()).await
8275 }
8276 pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
8278 let query = self.selection.select("id");
8279 query.execute(self.graphql_client.clone()).await
8280 }
8281 pub fn new_boolean(&self, value: bool) -> JsonValue {
8287 let mut query = self.selection.select("newBoolean");
8288 query = query.arg("value", value);
8289 JsonValue {
8290 proc: self.proc.clone(),
8291 selection: query,
8292 graphql_client: self.graphql_client.clone(),
8293 }
8294 }
8295 pub fn new_integer(&self, value: isize) -> JsonValue {
8301 let mut query = self.selection.select("newInteger");
8302 query = query.arg("value", value);
8303 JsonValue {
8304 proc: self.proc.clone(),
8305 selection: query,
8306 graphql_client: self.graphql_client.clone(),
8307 }
8308 }
8309 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
8315 let mut query = self.selection.select("newString");
8316 query = query.arg("value", value.into());
8317 JsonValue {
8318 proc: self.proc.clone(),
8319 selection: query,
8320 graphql_client: self.graphql_client.clone(),
8321 }
8322 }
8323 pub fn with_contents(&self, contents: Json) -> JsonValue {
8329 let mut query = self.selection.select("withContents");
8330 query = query.arg("contents", contents);
8331 JsonValue {
8332 proc: self.proc.clone(),
8333 selection: query,
8334 graphql_client: self.graphql_client.clone(),
8335 }
8336 }
8337 pub fn with_field(
8344 &self,
8345 path: Vec<impl Into<String>>,
8346 value: impl IntoID<JsonValueId>,
8347 ) -> JsonValue {
8348 let mut query = self.selection.select("withField");
8349 query = query.arg(
8350 "path",
8351 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8352 );
8353 query = query.arg_lazy(
8354 "value",
8355 Box::new(move || {
8356 let value = value.clone();
8357 Box::pin(async move { value.into_id().await.unwrap().quote() })
8358 }),
8359 );
8360 JsonValue {
8361 proc: self.proc.clone(),
8362 selection: query,
8363 graphql_client: self.graphql_client.clone(),
8364 }
8365 }
8366}
8367#[derive(Clone)]
8368pub struct Llm {
8369 pub proc: Option<Arc<DaggerSessionProc>>,
8370 pub selection: Selection,
8371 pub graphql_client: DynGraphQLClient,
8372}
8373impl Llm {
8374 pub fn attempt(&self, number: isize) -> Llm {
8376 let mut query = self.selection.select("attempt");
8377 query = query.arg("number", number);
8378 Llm {
8379 proc: self.proc.clone(),
8380 selection: query,
8381 graphql_client: self.graphql_client.clone(),
8382 }
8383 }
8384 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
8386 let mut query = self.selection.select("bindResult");
8387 query = query.arg("name", name.into());
8388 Binding {
8389 proc: self.proc.clone(),
8390 selection: query,
8391 graphql_client: self.graphql_client.clone(),
8392 }
8393 }
8394 pub fn env(&self) -> Env {
8396 let query = self.selection.select("env");
8397 Env {
8398 proc: self.proc.clone(),
8399 selection: query,
8400 graphql_client: self.graphql_client.clone(),
8401 }
8402 }
8403 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
8405 let query = self.selection.select("history");
8406 query.execute(self.graphql_client.clone()).await
8407 }
8408 pub async fn history_json(&self) -> Result<Json, DaggerError> {
8410 let query = self.selection.select("historyJSON");
8411 query.execute(self.graphql_client.clone()).await
8412 }
8413 pub async fn id(&self) -> Result<Llmid, DaggerError> {
8415 let query = self.selection.select("id");
8416 query.execute(self.graphql_client.clone()).await
8417 }
8418 pub async fn last_reply(&self) -> Result<String, DaggerError> {
8420 let query = self.selection.select("lastReply");
8421 query.execute(self.graphql_client.clone()).await
8422 }
8423 pub fn r#loop(&self) -> Llm {
8425 let query = self.selection.select("loop");
8426 Llm {
8427 proc: self.proc.clone(),
8428 selection: query,
8429 graphql_client: self.graphql_client.clone(),
8430 }
8431 }
8432 pub async fn model(&self) -> Result<String, DaggerError> {
8434 let query = self.selection.select("model");
8435 query.execute(self.graphql_client.clone()).await
8436 }
8437 pub async fn provider(&self) -> Result<String, DaggerError> {
8439 let query = self.selection.select("provider");
8440 query.execute(self.graphql_client.clone()).await
8441 }
8442 pub async fn sync(&self) -> Result<Llmid, DaggerError> {
8444 let query = self.selection.select("sync");
8445 query.execute(self.graphql_client.clone()).await
8446 }
8447 pub fn token_usage(&self) -> LlmTokenUsage {
8449 let query = self.selection.select("tokenUsage");
8450 LlmTokenUsage {
8451 proc: self.proc.clone(),
8452 selection: query,
8453 graphql_client: self.graphql_client.clone(),
8454 }
8455 }
8456 pub async fn tools(&self) -> Result<String, DaggerError> {
8458 let query = self.selection.select("tools");
8459 query.execute(self.graphql_client.clone()).await
8460 }
8461 pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
8463 let mut query = self.selection.select("withEnv");
8464 query = query.arg_lazy(
8465 "env",
8466 Box::new(move || {
8467 let env = env.clone();
8468 Box::pin(async move { env.into_id().await.unwrap().quote() })
8469 }),
8470 );
8471 Llm {
8472 proc: self.proc.clone(),
8473 selection: query,
8474 graphql_client: self.graphql_client.clone(),
8475 }
8476 }
8477 pub fn with_model(&self, model: impl Into<String>) -> Llm {
8483 let mut query = self.selection.select("withModel");
8484 query = query.arg("model", model.into());
8485 Llm {
8486 proc: self.proc.clone(),
8487 selection: query,
8488 graphql_client: self.graphql_client.clone(),
8489 }
8490 }
8491 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
8497 let mut query = self.selection.select("withPrompt");
8498 query = query.arg("prompt", prompt.into());
8499 Llm {
8500 proc: self.proc.clone(),
8501 selection: query,
8502 graphql_client: self.graphql_client.clone(),
8503 }
8504 }
8505 pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
8511 let mut query = self.selection.select("withPromptFile");
8512 query = query.arg_lazy(
8513 "file",
8514 Box::new(move || {
8515 let file = file.clone();
8516 Box::pin(async move { file.into_id().await.unwrap().quote() })
8517 }),
8518 );
8519 Llm {
8520 proc: self.proc.clone(),
8521 selection: query,
8522 graphql_client: self.graphql_client.clone(),
8523 }
8524 }
8525 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
8531 let mut query = self.selection.select("withSystemPrompt");
8532 query = query.arg("prompt", prompt.into());
8533 Llm {
8534 proc: self.proc.clone(),
8535 selection: query,
8536 graphql_client: self.graphql_client.clone(),
8537 }
8538 }
8539 pub fn without_default_system_prompt(&self) -> Llm {
8541 let query = self.selection.select("withoutDefaultSystemPrompt");
8542 Llm {
8543 proc: self.proc.clone(),
8544 selection: query,
8545 graphql_client: self.graphql_client.clone(),
8546 }
8547 }
8548}
8549#[derive(Clone)]
8550pub struct LlmTokenUsage {
8551 pub proc: Option<Arc<DaggerSessionProc>>,
8552 pub selection: Selection,
8553 pub graphql_client: DynGraphQLClient,
8554}
8555impl LlmTokenUsage {
8556 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
8557 let query = self.selection.select("cachedTokenReads");
8558 query.execute(self.graphql_client.clone()).await
8559 }
8560 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
8561 let query = self.selection.select("cachedTokenWrites");
8562 query.execute(self.graphql_client.clone()).await
8563 }
8564 pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
8566 let query = self.selection.select("id");
8567 query.execute(self.graphql_client.clone()).await
8568 }
8569 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
8570 let query = self.selection.select("inputTokens");
8571 query.execute(self.graphql_client.clone()).await
8572 }
8573 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
8574 let query = self.selection.select("outputTokens");
8575 query.execute(self.graphql_client.clone()).await
8576 }
8577 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
8578 let query = self.selection.select("totalTokens");
8579 query.execute(self.graphql_client.clone()).await
8580 }
8581}
8582#[derive(Clone)]
8583pub struct Label {
8584 pub proc: Option<Arc<DaggerSessionProc>>,
8585 pub selection: Selection,
8586 pub graphql_client: DynGraphQLClient,
8587}
8588impl Label {
8589 pub async fn id(&self) -> Result<LabelId, DaggerError> {
8591 let query = self.selection.select("id");
8592 query.execute(self.graphql_client.clone()).await
8593 }
8594 pub async fn name(&self) -> Result<String, DaggerError> {
8596 let query = self.selection.select("name");
8597 query.execute(self.graphql_client.clone()).await
8598 }
8599 pub async fn value(&self) -> Result<String, DaggerError> {
8601 let query = self.selection.select("value");
8602 query.execute(self.graphql_client.clone()).await
8603 }
8604}
8605#[derive(Clone)]
8606pub struct ListTypeDef {
8607 pub proc: Option<Arc<DaggerSessionProc>>,
8608 pub selection: Selection,
8609 pub graphql_client: DynGraphQLClient,
8610}
8611impl ListTypeDef {
8612 pub fn element_type_def(&self) -> TypeDef {
8614 let query = self.selection.select("elementTypeDef");
8615 TypeDef {
8616 proc: self.proc.clone(),
8617 selection: query,
8618 graphql_client: self.graphql_client.clone(),
8619 }
8620 }
8621 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
8623 let query = self.selection.select("id");
8624 query.execute(self.graphql_client.clone()).await
8625 }
8626}
8627#[derive(Clone)]
8628pub struct Module {
8629 pub proc: Option<Arc<DaggerSessionProc>>,
8630 pub selection: Selection,
8631 pub graphql_client: DynGraphQLClient,
8632}
8633#[derive(Builder, Debug, PartialEq)]
8634pub struct ModuleServeOpts {
8635 #[builder(setter(into, strip_option), default)]
8637 pub include_dependencies: Option<bool>,
8638}
8639impl Module {
8640 pub fn dependencies(&self) -> Vec<Module> {
8642 let query = self.selection.select("dependencies");
8643 vec![Module {
8644 proc: self.proc.clone(),
8645 selection: query,
8646 graphql_client: self.graphql_client.clone(),
8647 }]
8648 }
8649 pub async fn description(&self) -> Result<String, DaggerError> {
8651 let query = self.selection.select("description");
8652 query.execute(self.graphql_client.clone()).await
8653 }
8654 pub fn enums(&self) -> Vec<TypeDef> {
8656 let query = self.selection.select("enums");
8657 vec![TypeDef {
8658 proc: self.proc.clone(),
8659 selection: query,
8660 graphql_client: self.graphql_client.clone(),
8661 }]
8662 }
8663 pub fn generated_context_directory(&self) -> Directory {
8665 let query = self.selection.select("generatedContextDirectory");
8666 Directory {
8667 proc: self.proc.clone(),
8668 selection: query,
8669 graphql_client: self.graphql_client.clone(),
8670 }
8671 }
8672 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
8674 let query = self.selection.select("id");
8675 query.execute(self.graphql_client.clone()).await
8676 }
8677 pub fn interfaces(&self) -> Vec<TypeDef> {
8679 let query = self.selection.select("interfaces");
8680 vec![TypeDef {
8681 proc: self.proc.clone(),
8682 selection: query,
8683 graphql_client: self.graphql_client.clone(),
8684 }]
8685 }
8686 pub async fn name(&self) -> Result<String, DaggerError> {
8688 let query = self.selection.select("name");
8689 query.execute(self.graphql_client.clone()).await
8690 }
8691 pub fn objects(&self) -> Vec<TypeDef> {
8693 let query = self.selection.select("objects");
8694 vec![TypeDef {
8695 proc: self.proc.clone(),
8696 selection: query,
8697 graphql_client: self.graphql_client.clone(),
8698 }]
8699 }
8700 pub fn runtime(&self) -> Container {
8702 let query = self.selection.select("runtime");
8703 Container {
8704 proc: self.proc.clone(),
8705 selection: query,
8706 graphql_client: self.graphql_client.clone(),
8707 }
8708 }
8709 pub fn sdk(&self) -> SdkConfig {
8711 let query = self.selection.select("sdk");
8712 SdkConfig {
8713 proc: self.proc.clone(),
8714 selection: query,
8715 graphql_client: self.graphql_client.clone(),
8716 }
8717 }
8718 pub async fn serve(&self) -> Result<Void, DaggerError> {
8725 let query = self.selection.select("serve");
8726 query.execute(self.graphql_client.clone()).await
8727 }
8728 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
8735 let mut query = self.selection.select("serve");
8736 if let Some(include_dependencies) = opts.include_dependencies {
8737 query = query.arg("includeDependencies", include_dependencies);
8738 }
8739 query.execute(self.graphql_client.clone()).await
8740 }
8741 pub fn source(&self) -> ModuleSource {
8743 let query = self.selection.select("source");
8744 ModuleSource {
8745 proc: self.proc.clone(),
8746 selection: query,
8747 graphql_client: self.graphql_client.clone(),
8748 }
8749 }
8750 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
8752 let query = self.selection.select("sync");
8753 query.execute(self.graphql_client.clone()).await
8754 }
8755 pub fn with_description(&self, description: impl Into<String>) -> Module {
8761 let mut query = self.selection.select("withDescription");
8762 query = query.arg("description", description.into());
8763 Module {
8764 proc: self.proc.clone(),
8765 selection: query,
8766 graphql_client: self.graphql_client.clone(),
8767 }
8768 }
8769 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
8771 let mut query = self.selection.select("withEnum");
8772 query = query.arg_lazy(
8773 "enum",
8774 Box::new(move || {
8775 let r#enum = r#enum.clone();
8776 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
8777 }),
8778 );
8779 Module {
8780 proc: self.proc.clone(),
8781 selection: query,
8782 graphql_client: self.graphql_client.clone(),
8783 }
8784 }
8785 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
8787 let mut query = self.selection.select("withInterface");
8788 query = query.arg_lazy(
8789 "iface",
8790 Box::new(move || {
8791 let iface = iface.clone();
8792 Box::pin(async move { iface.into_id().await.unwrap().quote() })
8793 }),
8794 );
8795 Module {
8796 proc: self.proc.clone(),
8797 selection: query,
8798 graphql_client: self.graphql_client.clone(),
8799 }
8800 }
8801 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
8803 let mut query = self.selection.select("withObject");
8804 query = query.arg_lazy(
8805 "object",
8806 Box::new(move || {
8807 let object = object.clone();
8808 Box::pin(async move { object.into_id().await.unwrap().quote() })
8809 }),
8810 );
8811 Module {
8812 proc: self.proc.clone(),
8813 selection: query,
8814 graphql_client: self.graphql_client.clone(),
8815 }
8816 }
8817}
8818#[derive(Clone)]
8819pub struct ModuleConfigClient {
8820 pub proc: Option<Arc<DaggerSessionProc>>,
8821 pub selection: Selection,
8822 pub graphql_client: DynGraphQLClient,
8823}
8824impl ModuleConfigClient {
8825 pub async fn directory(&self) -> Result<String, DaggerError> {
8827 let query = self.selection.select("directory");
8828 query.execute(self.graphql_client.clone()).await
8829 }
8830 pub async fn generator(&self) -> Result<String, DaggerError> {
8832 let query = self.selection.select("generator");
8833 query.execute(self.graphql_client.clone()).await
8834 }
8835 pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
8837 let query = self.selection.select("id");
8838 query.execute(self.graphql_client.clone()).await
8839 }
8840}
8841#[derive(Clone)]
8842pub struct ModuleSource {
8843 pub proc: Option<Arc<DaggerSessionProc>>,
8844 pub selection: Selection,
8845 pub graphql_client: DynGraphQLClient,
8846}
8847impl ModuleSource {
8848 pub fn as_module(&self) -> Module {
8850 let query = self.selection.select("asModule");
8851 Module {
8852 proc: self.proc.clone(),
8853 selection: query,
8854 graphql_client: self.graphql_client.clone(),
8855 }
8856 }
8857 pub async fn as_string(&self) -> Result<String, DaggerError> {
8859 let query = self.selection.select("asString");
8860 query.execute(self.graphql_client.clone()).await
8861 }
8862 pub fn blueprint(&self) -> ModuleSource {
8864 let query = self.selection.select("blueprint");
8865 ModuleSource {
8866 proc: self.proc.clone(),
8867 selection: query,
8868 graphql_client: self.graphql_client.clone(),
8869 }
8870 }
8871 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
8873 let query = self.selection.select("cloneRef");
8874 query.execute(self.graphql_client.clone()).await
8875 }
8876 pub async fn commit(&self) -> Result<String, DaggerError> {
8878 let query = self.selection.select("commit");
8879 query.execute(self.graphql_client.clone()).await
8880 }
8881 pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
8883 let query = self.selection.select("configClients");
8884 vec![ModuleConfigClient {
8885 proc: self.proc.clone(),
8886 selection: query,
8887 graphql_client: self.graphql_client.clone(),
8888 }]
8889 }
8890 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
8892 let query = self.selection.select("configExists");
8893 query.execute(self.graphql_client.clone()).await
8894 }
8895 pub fn context_directory(&self) -> Directory {
8897 let query = self.selection.select("contextDirectory");
8898 Directory {
8899 proc: self.proc.clone(),
8900 selection: query,
8901 graphql_client: self.graphql_client.clone(),
8902 }
8903 }
8904 pub fn dependencies(&self) -> Vec<ModuleSource> {
8906 let query = self.selection.select("dependencies");
8907 vec![ModuleSource {
8908 proc: self.proc.clone(),
8909 selection: query,
8910 graphql_client: self.graphql_client.clone(),
8911 }]
8912 }
8913 pub async fn digest(&self) -> Result<String, DaggerError> {
8915 let query = self.selection.select("digest");
8916 query.execute(self.graphql_client.clone()).await
8917 }
8918 pub fn directory(&self, path: impl Into<String>) -> Directory {
8924 let mut query = self.selection.select("directory");
8925 query = query.arg("path", path.into());
8926 Directory {
8927 proc: self.proc.clone(),
8928 selection: query,
8929 graphql_client: self.graphql_client.clone(),
8930 }
8931 }
8932 pub async fn engine_version(&self) -> Result<String, DaggerError> {
8934 let query = self.selection.select("engineVersion");
8935 query.execute(self.graphql_client.clone()).await
8936 }
8937 pub fn generated_context_directory(&self) -> Directory {
8939 let query = self.selection.select("generatedContextDirectory");
8940 Directory {
8941 proc: self.proc.clone(),
8942 selection: query,
8943 graphql_client: self.graphql_client.clone(),
8944 }
8945 }
8946 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
8948 let query = self.selection.select("htmlRepoURL");
8949 query.execute(self.graphql_client.clone()).await
8950 }
8951 pub async fn html_url(&self) -> Result<String, DaggerError> {
8953 let query = self.selection.select("htmlURL");
8954 query.execute(self.graphql_client.clone()).await
8955 }
8956 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
8958 let query = self.selection.select("id");
8959 query.execute(self.graphql_client.clone()).await
8960 }
8961 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
8963 let query = self.selection.select("kind");
8964 query.execute(self.graphql_client.clone()).await
8965 }
8966 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
8968 let query = self.selection.select("localContextDirectoryPath");
8969 query.execute(self.graphql_client.clone()).await
8970 }
8971 pub async fn module_name(&self) -> Result<String, DaggerError> {
8973 let query = self.selection.select("moduleName");
8974 query.execute(self.graphql_client.clone()).await
8975 }
8976 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
8978 let query = self.selection.select("moduleOriginalName");
8979 query.execute(self.graphql_client.clone()).await
8980 }
8981 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
8983 let query = self.selection.select("originalSubpath");
8984 query.execute(self.graphql_client.clone()).await
8985 }
8986 pub async fn pin(&self) -> Result<String, DaggerError> {
8988 let query = self.selection.select("pin");
8989 query.execute(self.graphql_client.clone()).await
8990 }
8991 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
8993 let query = self.selection.select("repoRootPath");
8994 query.execute(self.graphql_client.clone()).await
8995 }
8996 pub fn sdk(&self) -> SdkConfig {
8998 let query = self.selection.select("sdk");
8999 SdkConfig {
9000 proc: self.proc.clone(),
9001 selection: query,
9002 graphql_client: self.graphql_client.clone(),
9003 }
9004 }
9005 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9007 let query = self.selection.select("sourceRootSubpath");
9008 query.execute(self.graphql_client.clone()).await
9009 }
9010 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9012 let query = self.selection.select("sourceSubpath");
9013 query.execute(self.graphql_client.clone()).await
9014 }
9015 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9017 let query = self.selection.select("sync");
9018 query.execute(self.graphql_client.clone()).await
9019 }
9020 pub async fn version(&self) -> Result<String, DaggerError> {
9022 let query = self.selection.select("version");
9023 query.execute(self.graphql_client.clone()).await
9024 }
9025 pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9031 let mut query = self.selection.select("withBlueprint");
9032 query = query.arg_lazy(
9033 "blueprint",
9034 Box::new(move || {
9035 let blueprint = blueprint.clone();
9036 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
9037 }),
9038 );
9039 ModuleSource {
9040 proc: self.proc.clone(),
9041 selection: query,
9042 graphql_client: self.graphql_client.clone(),
9043 }
9044 }
9045 pub fn with_client(
9052 &self,
9053 generator: impl Into<String>,
9054 output_dir: impl Into<String>,
9055 ) -> ModuleSource {
9056 let mut query = self.selection.select("withClient");
9057 query = query.arg("generator", generator.into());
9058 query = query.arg("outputDir", output_dir.into());
9059 ModuleSource {
9060 proc: self.proc.clone(),
9061 selection: query,
9062 graphql_client: self.graphql_client.clone(),
9063 }
9064 }
9065 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
9071 let mut query = self.selection.select("withDependencies");
9072 query = query.arg("dependencies", dependencies);
9073 ModuleSource {
9074 proc: self.proc.clone(),
9075 selection: query,
9076 graphql_client: self.graphql_client.clone(),
9077 }
9078 }
9079 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
9085 let mut query = self.selection.select("withEngineVersion");
9086 query = query.arg("version", version.into());
9087 ModuleSource {
9088 proc: self.proc.clone(),
9089 selection: query,
9090 graphql_client: self.graphql_client.clone(),
9091 }
9092 }
9093 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
9099 let mut query = self.selection.select("withIncludes");
9100 query = query.arg(
9101 "patterns",
9102 patterns
9103 .into_iter()
9104 .map(|i| i.into())
9105 .collect::<Vec<String>>(),
9106 );
9107 ModuleSource {
9108 proc: self.proc.clone(),
9109 selection: query,
9110 graphql_client: self.graphql_client.clone(),
9111 }
9112 }
9113 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
9119 let mut query = self.selection.select("withName");
9120 query = query.arg("name", name.into());
9121 ModuleSource {
9122 proc: self.proc.clone(),
9123 selection: query,
9124 graphql_client: self.graphql_client.clone(),
9125 }
9126 }
9127 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
9133 let mut query = self.selection.select("withSDK");
9134 query = query.arg("source", source.into());
9135 ModuleSource {
9136 proc: self.proc.clone(),
9137 selection: query,
9138 graphql_client: self.graphql_client.clone(),
9139 }
9140 }
9141 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
9147 let mut query = self.selection.select("withSourceSubpath");
9148 query = query.arg("path", path.into());
9149 ModuleSource {
9150 proc: self.proc.clone(),
9151 selection: query,
9152 graphql_client: self.graphql_client.clone(),
9153 }
9154 }
9155 pub fn with_update_blueprint(&self) -> ModuleSource {
9157 let query = self.selection.select("withUpdateBlueprint");
9158 ModuleSource {
9159 proc: self.proc.clone(),
9160 selection: query,
9161 graphql_client: self.graphql_client.clone(),
9162 }
9163 }
9164 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9170 let mut query = self.selection.select("withUpdateDependencies");
9171 query = query.arg(
9172 "dependencies",
9173 dependencies
9174 .into_iter()
9175 .map(|i| i.into())
9176 .collect::<Vec<String>>(),
9177 );
9178 ModuleSource {
9179 proc: self.proc.clone(),
9180 selection: query,
9181 graphql_client: self.graphql_client.clone(),
9182 }
9183 }
9184 pub fn without_blueprint(&self) -> ModuleSource {
9186 let query = self.selection.select("withoutBlueprint");
9187 ModuleSource {
9188 proc: self.proc.clone(),
9189 selection: query,
9190 graphql_client: self.graphql_client.clone(),
9191 }
9192 }
9193 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
9199 let mut query = self.selection.select("withoutClient");
9200 query = query.arg("path", path.into());
9201 ModuleSource {
9202 proc: self.proc.clone(),
9203 selection: query,
9204 graphql_client: self.graphql_client.clone(),
9205 }
9206 }
9207 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9213 let mut query = self.selection.select("withoutDependencies");
9214 query = query.arg(
9215 "dependencies",
9216 dependencies
9217 .into_iter()
9218 .map(|i| i.into())
9219 .collect::<Vec<String>>(),
9220 );
9221 ModuleSource {
9222 proc: self.proc.clone(),
9223 selection: query,
9224 graphql_client: self.graphql_client.clone(),
9225 }
9226 }
9227}
9228#[derive(Clone)]
9229pub struct ObjectTypeDef {
9230 pub proc: Option<Arc<DaggerSessionProc>>,
9231 pub selection: Selection,
9232 pub graphql_client: DynGraphQLClient,
9233}
9234impl ObjectTypeDef {
9235 pub fn constructor(&self) -> Function {
9237 let query = self.selection.select("constructor");
9238 Function {
9239 proc: self.proc.clone(),
9240 selection: query,
9241 graphql_client: self.graphql_client.clone(),
9242 }
9243 }
9244 pub async fn description(&self) -> Result<String, DaggerError> {
9246 let query = self.selection.select("description");
9247 query.execute(self.graphql_client.clone()).await
9248 }
9249 pub fn fields(&self) -> Vec<FieldTypeDef> {
9251 let query = self.selection.select("fields");
9252 vec![FieldTypeDef {
9253 proc: self.proc.clone(),
9254 selection: query,
9255 graphql_client: self.graphql_client.clone(),
9256 }]
9257 }
9258 pub fn functions(&self) -> Vec<Function> {
9260 let query = self.selection.select("functions");
9261 vec![Function {
9262 proc: self.proc.clone(),
9263 selection: query,
9264 graphql_client: self.graphql_client.clone(),
9265 }]
9266 }
9267 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
9269 let query = self.selection.select("id");
9270 query.execute(self.graphql_client.clone()).await
9271 }
9272 pub async fn name(&self) -> Result<String, DaggerError> {
9274 let query = self.selection.select("name");
9275 query.execute(self.graphql_client.clone()).await
9276 }
9277 pub fn source_map(&self) -> SourceMap {
9279 let query = self.selection.select("sourceMap");
9280 SourceMap {
9281 proc: self.proc.clone(),
9282 selection: query,
9283 graphql_client: self.graphql_client.clone(),
9284 }
9285 }
9286 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9288 let query = self.selection.select("sourceModuleName");
9289 query.execute(self.graphql_client.clone()).await
9290 }
9291}
9292#[derive(Clone)]
9293pub struct Port {
9294 pub proc: Option<Arc<DaggerSessionProc>>,
9295 pub selection: Selection,
9296 pub graphql_client: DynGraphQLClient,
9297}
9298impl Port {
9299 pub async fn description(&self) -> Result<String, DaggerError> {
9301 let query = self.selection.select("description");
9302 query.execute(self.graphql_client.clone()).await
9303 }
9304 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
9306 let query = self.selection.select("experimentalSkipHealthcheck");
9307 query.execute(self.graphql_client.clone()).await
9308 }
9309 pub async fn id(&self) -> Result<PortId, DaggerError> {
9311 let query = self.selection.select("id");
9312 query.execute(self.graphql_client.clone()).await
9313 }
9314 pub async fn port(&self) -> Result<isize, DaggerError> {
9316 let query = self.selection.select("port");
9317 query.execute(self.graphql_client.clone()).await
9318 }
9319 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
9321 let query = self.selection.select("protocol");
9322 query.execute(self.graphql_client.clone()).await
9323 }
9324}
9325#[derive(Clone)]
9326pub struct Query {
9327 pub proc: Option<Arc<DaggerSessionProc>>,
9328 pub selection: Selection,
9329 pub graphql_client: DynGraphQLClient,
9330}
9331#[derive(Builder, Debug, PartialEq)]
9332pub struct QueryContainerOpts {
9333 #[builder(setter(into, strip_option), default)]
9335 pub platform: Option<Platform>,
9336}
9337#[derive(Builder, Debug, PartialEq)]
9338pub struct QueryEnvOpts {
9339 #[builder(setter(into, strip_option), default)]
9341 pub privileged: Option<bool>,
9342 #[builder(setter(into, strip_option), default)]
9344 pub writable: Option<bool>,
9345}
9346#[derive(Builder, Debug, PartialEq)]
9347pub struct QueryFileOpts {
9348 #[builder(setter(into, strip_option), default)]
9350 pub permissions: Option<isize>,
9351}
9352#[derive(Builder, Debug, PartialEq)]
9353pub struct QueryGitOpts<'a> {
9354 #[builder(setter(into, strip_option), default)]
9356 pub experimental_service_host: Option<ServiceId>,
9357 #[builder(setter(into, strip_option), default)]
9359 pub http_auth_header: Option<SecretId>,
9360 #[builder(setter(into, strip_option), default)]
9362 pub http_auth_token: Option<SecretId>,
9363 #[builder(setter(into, strip_option), default)]
9365 pub http_auth_username: Option<&'a str>,
9366 #[builder(setter(into, strip_option), default)]
9368 pub keep_git_dir: Option<bool>,
9369 #[builder(setter(into, strip_option), default)]
9371 pub ssh_auth_socket: Option<SocketId>,
9372 #[builder(setter(into, strip_option), default)]
9374 pub ssh_known_hosts: Option<&'a str>,
9375}
9376#[derive(Builder, Debug, PartialEq)]
9377pub struct QueryHttpOpts<'a> {
9378 #[builder(setter(into, strip_option), default)]
9380 pub auth_header: Option<SecretId>,
9381 #[builder(setter(into, strip_option), default)]
9383 pub experimental_service_host: Option<ServiceId>,
9384 #[builder(setter(into, strip_option), default)]
9386 pub name: Option<&'a str>,
9387 #[builder(setter(into, strip_option), default)]
9389 pub permissions: Option<isize>,
9390}
9391#[derive(Builder, Debug, PartialEq)]
9392pub struct QueryLlmOpts<'a> {
9393 #[builder(setter(into, strip_option), default)]
9395 pub max_api_calls: Option<isize>,
9396 #[builder(setter(into, strip_option), default)]
9398 pub model: Option<&'a str>,
9399}
9400#[derive(Builder, Debug, PartialEq)]
9401pub struct QueryModuleSourceOpts<'a> {
9402 #[builder(setter(into, strip_option), default)]
9404 pub allow_not_exists: Option<bool>,
9405 #[builder(setter(into, strip_option), default)]
9407 pub disable_find_up: Option<bool>,
9408 #[builder(setter(into, strip_option), default)]
9410 pub ref_pin: Option<&'a str>,
9411 #[builder(setter(into, strip_option), default)]
9413 pub require_kind: Option<ModuleSourceKind>,
9414}
9415#[derive(Builder, Debug, PartialEq)]
9416pub struct QuerySecretOpts<'a> {
9417 #[builder(setter(into, strip_option), default)]
9421 pub cache_key: Option<&'a str>,
9422}
9423impl Query {
9424 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
9430 let mut query = self.selection.select("cacheVolume");
9431 query = query.arg("key", key.into());
9432 CacheVolume {
9433 proc: self.proc.clone(),
9434 selection: query,
9435 graphql_client: self.graphql_client.clone(),
9436 }
9437 }
9438 pub fn cloud(&self) -> Cloud {
9440 let query = self.selection.select("cloud");
9441 Cloud {
9442 proc: self.proc.clone(),
9443 selection: query,
9444 graphql_client: self.graphql_client.clone(),
9445 }
9446 }
9447 pub fn container(&self) -> Container {
9454 let query = self.selection.select("container");
9455 Container {
9456 proc: self.proc.clone(),
9457 selection: query,
9458 graphql_client: self.graphql_client.clone(),
9459 }
9460 }
9461 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
9468 let mut query = self.selection.select("container");
9469 if let Some(platform) = opts.platform {
9470 query = query.arg("platform", platform);
9471 }
9472 Container {
9473 proc: self.proc.clone(),
9474 selection: query,
9475 graphql_client: self.graphql_client.clone(),
9476 }
9477 }
9478 pub fn current_function_call(&self) -> FunctionCall {
9481 let query = self.selection.select("currentFunctionCall");
9482 FunctionCall {
9483 proc: self.proc.clone(),
9484 selection: query,
9485 graphql_client: self.graphql_client.clone(),
9486 }
9487 }
9488 pub fn current_module(&self) -> CurrentModule {
9490 let query = self.selection.select("currentModule");
9491 CurrentModule {
9492 proc: self.proc.clone(),
9493 selection: query,
9494 graphql_client: self.graphql_client.clone(),
9495 }
9496 }
9497 pub fn current_type_defs(&self) -> Vec<TypeDef> {
9499 let query = self.selection.select("currentTypeDefs");
9500 vec![TypeDef {
9501 proc: self.proc.clone(),
9502 selection: query,
9503 graphql_client: self.graphql_client.clone(),
9504 }]
9505 }
9506 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
9508 let query = self.selection.select("defaultPlatform");
9509 query.execute(self.graphql_client.clone()).await
9510 }
9511 pub fn directory(&self) -> Directory {
9513 let query = self.selection.select("directory");
9514 Directory {
9515 proc: self.proc.clone(),
9516 selection: query,
9517 graphql_client: self.graphql_client.clone(),
9518 }
9519 }
9520 pub fn engine(&self) -> Engine {
9522 let query = self.selection.select("engine");
9523 Engine {
9524 proc: self.proc.clone(),
9525 selection: query,
9526 graphql_client: self.graphql_client.clone(),
9527 }
9528 }
9529 pub fn env(&self) -> Env {
9535 let query = self.selection.select("env");
9536 Env {
9537 proc: self.proc.clone(),
9538 selection: query,
9539 graphql_client: self.graphql_client.clone(),
9540 }
9541 }
9542 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
9548 let mut query = self.selection.select("env");
9549 if let Some(privileged) = opts.privileged {
9550 query = query.arg("privileged", privileged);
9551 }
9552 if let Some(writable) = opts.writable {
9553 query = query.arg("writable", writable);
9554 }
9555 Env {
9556 proc: self.proc.clone(),
9557 selection: query,
9558 graphql_client: self.graphql_client.clone(),
9559 }
9560 }
9561 pub fn error(&self, message: impl Into<String>) -> Error {
9567 let mut query = self.selection.select("error");
9568 query = query.arg("message", message.into());
9569 Error {
9570 proc: self.proc.clone(),
9571 selection: query,
9572 graphql_client: self.graphql_client.clone(),
9573 }
9574 }
9575 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
9583 let mut query = self.selection.select("file");
9584 query = query.arg("name", name.into());
9585 query = query.arg("contents", contents.into());
9586 File {
9587 proc: self.proc.clone(),
9588 selection: query,
9589 graphql_client: self.graphql_client.clone(),
9590 }
9591 }
9592 pub fn file_opts(
9600 &self,
9601 name: impl Into<String>,
9602 contents: impl Into<String>,
9603 opts: QueryFileOpts,
9604 ) -> File {
9605 let mut query = self.selection.select("file");
9606 query = query.arg("name", name.into());
9607 query = query.arg("contents", contents.into());
9608 if let Some(permissions) = opts.permissions {
9609 query = query.arg("permissions", permissions);
9610 }
9611 File {
9612 proc: self.proc.clone(),
9613 selection: query,
9614 graphql_client: self.graphql_client.clone(),
9615 }
9616 }
9617 pub fn function(
9624 &self,
9625 name: impl Into<String>,
9626 return_type: impl IntoID<TypeDefId>,
9627 ) -> Function {
9628 let mut query = self.selection.select("function");
9629 query = query.arg("name", name.into());
9630 query = query.arg_lazy(
9631 "returnType",
9632 Box::new(move || {
9633 let return_type = return_type.clone();
9634 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
9635 }),
9636 );
9637 Function {
9638 proc: self.proc.clone(),
9639 selection: query,
9640 graphql_client: self.graphql_client.clone(),
9641 }
9642 }
9643 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
9645 let mut query = self.selection.select("generatedCode");
9646 query = query.arg_lazy(
9647 "code",
9648 Box::new(move || {
9649 let code = code.clone();
9650 Box::pin(async move { code.into_id().await.unwrap().quote() })
9651 }),
9652 );
9653 GeneratedCode {
9654 proc: self.proc.clone(),
9655 selection: query,
9656 graphql_client: self.graphql_client.clone(),
9657 }
9658 }
9659 pub fn git(&self, url: impl Into<String>) -> GitRepository {
9670 let mut query = self.selection.select("git");
9671 query = query.arg("url", url.into());
9672 GitRepository {
9673 proc: self.proc.clone(),
9674 selection: query,
9675 graphql_client: self.graphql_client.clone(),
9676 }
9677 }
9678 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
9689 let mut query = self.selection.select("git");
9690 query = query.arg("url", url.into());
9691 if let Some(keep_git_dir) = opts.keep_git_dir {
9692 query = query.arg("keepGitDir", keep_git_dir);
9693 }
9694 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
9695 query = query.arg("sshKnownHosts", ssh_known_hosts);
9696 }
9697 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
9698 query = query.arg("sshAuthSocket", ssh_auth_socket);
9699 }
9700 if let Some(http_auth_username) = opts.http_auth_username {
9701 query = query.arg("httpAuthUsername", http_auth_username);
9702 }
9703 if let Some(http_auth_token) = opts.http_auth_token {
9704 query = query.arg("httpAuthToken", http_auth_token);
9705 }
9706 if let Some(http_auth_header) = opts.http_auth_header {
9707 query = query.arg("httpAuthHeader", http_auth_header);
9708 }
9709 if let Some(experimental_service_host) = opts.experimental_service_host {
9710 query = query.arg("experimentalServiceHost", experimental_service_host);
9711 }
9712 GitRepository {
9713 proc: self.proc.clone(),
9714 selection: query,
9715 graphql_client: self.graphql_client.clone(),
9716 }
9717 }
9718 pub fn host(&self) -> Host {
9720 let query = self.selection.select("host");
9721 Host {
9722 proc: self.proc.clone(),
9723 selection: query,
9724 graphql_client: self.graphql_client.clone(),
9725 }
9726 }
9727 pub fn http(&self, url: impl Into<String>) -> File {
9734 let mut query = self.selection.select("http");
9735 query = query.arg("url", url.into());
9736 File {
9737 proc: self.proc.clone(),
9738 selection: query,
9739 graphql_client: self.graphql_client.clone(),
9740 }
9741 }
9742 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
9749 let mut query = self.selection.select("http");
9750 query = query.arg("url", url.into());
9751 if let Some(name) = opts.name {
9752 query = query.arg("name", name);
9753 }
9754 if let Some(permissions) = opts.permissions {
9755 query = query.arg("permissions", permissions);
9756 }
9757 if let Some(auth_header) = opts.auth_header {
9758 query = query.arg("authHeader", auth_header);
9759 }
9760 if let Some(experimental_service_host) = opts.experimental_service_host {
9761 query = query.arg("experimentalServiceHost", experimental_service_host);
9762 }
9763 File {
9764 proc: self.proc.clone(),
9765 selection: query,
9766 graphql_client: self.graphql_client.clone(),
9767 }
9768 }
9769 pub fn json(&self) -> JsonValue {
9771 let query = self.selection.select("json");
9772 JsonValue {
9773 proc: self.proc.clone(),
9774 selection: query,
9775 graphql_client: self.graphql_client.clone(),
9776 }
9777 }
9778 pub fn llm(&self) -> Llm {
9784 let query = self.selection.select("llm");
9785 Llm {
9786 proc: self.proc.clone(),
9787 selection: query,
9788 graphql_client: self.graphql_client.clone(),
9789 }
9790 }
9791 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
9797 let mut query = self.selection.select("llm");
9798 if let Some(model) = opts.model {
9799 query = query.arg("model", model);
9800 }
9801 if let Some(max_api_calls) = opts.max_api_calls {
9802 query = query.arg("maxAPICalls", max_api_calls);
9803 }
9804 Llm {
9805 proc: self.proc.clone(),
9806 selection: query,
9807 graphql_client: self.graphql_client.clone(),
9808 }
9809 }
9810 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
9812 let mut query = self.selection.select("loadBindingFromID");
9813 query = query.arg_lazy(
9814 "id",
9815 Box::new(move || {
9816 let id = id.clone();
9817 Box::pin(async move { id.into_id().await.unwrap().quote() })
9818 }),
9819 );
9820 Binding {
9821 proc: self.proc.clone(),
9822 selection: query,
9823 graphql_client: self.graphql_client.clone(),
9824 }
9825 }
9826 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
9828 let mut query = self.selection.select("loadCacheVolumeFromID");
9829 query = query.arg_lazy(
9830 "id",
9831 Box::new(move || {
9832 let id = id.clone();
9833 Box::pin(async move { id.into_id().await.unwrap().quote() })
9834 }),
9835 );
9836 CacheVolume {
9837 proc: self.proc.clone(),
9838 selection: query,
9839 graphql_client: self.graphql_client.clone(),
9840 }
9841 }
9842 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
9844 let mut query = self.selection.select("loadCloudFromID");
9845 query = query.arg_lazy(
9846 "id",
9847 Box::new(move || {
9848 let id = id.clone();
9849 Box::pin(async move { id.into_id().await.unwrap().quote() })
9850 }),
9851 );
9852 Cloud {
9853 proc: self.proc.clone(),
9854 selection: query,
9855 graphql_client: self.graphql_client.clone(),
9856 }
9857 }
9858 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
9860 let mut query = self.selection.select("loadContainerFromID");
9861 query = query.arg_lazy(
9862 "id",
9863 Box::new(move || {
9864 let id = id.clone();
9865 Box::pin(async move { id.into_id().await.unwrap().quote() })
9866 }),
9867 );
9868 Container {
9869 proc: self.proc.clone(),
9870 selection: query,
9871 graphql_client: self.graphql_client.clone(),
9872 }
9873 }
9874 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
9876 let mut query = self.selection.select("loadCurrentModuleFromID");
9877 query = query.arg_lazy(
9878 "id",
9879 Box::new(move || {
9880 let id = id.clone();
9881 Box::pin(async move { id.into_id().await.unwrap().quote() })
9882 }),
9883 );
9884 CurrentModule {
9885 proc: self.proc.clone(),
9886 selection: query,
9887 graphql_client: self.graphql_client.clone(),
9888 }
9889 }
9890 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
9892 let mut query = self.selection.select("loadDirectoryFromID");
9893 query = query.arg_lazy(
9894 "id",
9895 Box::new(move || {
9896 let id = id.clone();
9897 Box::pin(async move { id.into_id().await.unwrap().quote() })
9898 }),
9899 );
9900 Directory {
9901 proc: self.proc.clone(),
9902 selection: query,
9903 graphql_client: self.graphql_client.clone(),
9904 }
9905 }
9906 pub fn load_engine_cache_entry_from_id(
9908 &self,
9909 id: impl IntoID<EngineCacheEntryId>,
9910 ) -> EngineCacheEntry {
9911 let mut query = self.selection.select("loadEngineCacheEntryFromID");
9912 query = query.arg_lazy(
9913 "id",
9914 Box::new(move || {
9915 let id = id.clone();
9916 Box::pin(async move { id.into_id().await.unwrap().quote() })
9917 }),
9918 );
9919 EngineCacheEntry {
9920 proc: self.proc.clone(),
9921 selection: query,
9922 graphql_client: self.graphql_client.clone(),
9923 }
9924 }
9925 pub fn load_engine_cache_entry_set_from_id(
9927 &self,
9928 id: impl IntoID<EngineCacheEntrySetId>,
9929 ) -> EngineCacheEntrySet {
9930 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
9931 query = query.arg_lazy(
9932 "id",
9933 Box::new(move || {
9934 let id = id.clone();
9935 Box::pin(async move { id.into_id().await.unwrap().quote() })
9936 }),
9937 );
9938 EngineCacheEntrySet {
9939 proc: self.proc.clone(),
9940 selection: query,
9941 graphql_client: self.graphql_client.clone(),
9942 }
9943 }
9944 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
9946 let mut query = self.selection.select("loadEngineCacheFromID");
9947 query = query.arg_lazy(
9948 "id",
9949 Box::new(move || {
9950 let id = id.clone();
9951 Box::pin(async move { id.into_id().await.unwrap().quote() })
9952 }),
9953 );
9954 EngineCache {
9955 proc: self.proc.clone(),
9956 selection: query,
9957 graphql_client: self.graphql_client.clone(),
9958 }
9959 }
9960 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
9962 let mut query = self.selection.select("loadEngineFromID");
9963 query = query.arg_lazy(
9964 "id",
9965 Box::new(move || {
9966 let id = id.clone();
9967 Box::pin(async move { id.into_id().await.unwrap().quote() })
9968 }),
9969 );
9970 Engine {
9971 proc: self.proc.clone(),
9972 selection: query,
9973 graphql_client: self.graphql_client.clone(),
9974 }
9975 }
9976 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
9978 let mut query = self.selection.select("loadEnumTypeDefFromID");
9979 query = query.arg_lazy(
9980 "id",
9981 Box::new(move || {
9982 let id = id.clone();
9983 Box::pin(async move { id.into_id().await.unwrap().quote() })
9984 }),
9985 );
9986 EnumTypeDef {
9987 proc: self.proc.clone(),
9988 selection: query,
9989 graphql_client: self.graphql_client.clone(),
9990 }
9991 }
9992 pub fn load_enum_value_type_def_from_id(
9994 &self,
9995 id: impl IntoID<EnumValueTypeDefId>,
9996 ) -> EnumValueTypeDef {
9997 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
9998 query = query.arg_lazy(
9999 "id",
10000 Box::new(move || {
10001 let id = id.clone();
10002 Box::pin(async move { id.into_id().await.unwrap().quote() })
10003 }),
10004 );
10005 EnumValueTypeDef {
10006 proc: self.proc.clone(),
10007 selection: query,
10008 graphql_client: self.graphql_client.clone(),
10009 }
10010 }
10011 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
10013 let mut query = self.selection.select("loadEnvFromID");
10014 query = query.arg_lazy(
10015 "id",
10016 Box::new(move || {
10017 let id = id.clone();
10018 Box::pin(async move { id.into_id().await.unwrap().quote() })
10019 }),
10020 );
10021 Env {
10022 proc: self.proc.clone(),
10023 selection: query,
10024 graphql_client: self.graphql_client.clone(),
10025 }
10026 }
10027 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
10029 let mut query = self.selection.select("loadEnvVariableFromID");
10030 query = query.arg_lazy(
10031 "id",
10032 Box::new(move || {
10033 let id = id.clone();
10034 Box::pin(async move { id.into_id().await.unwrap().quote() })
10035 }),
10036 );
10037 EnvVariable {
10038 proc: self.proc.clone(),
10039 selection: query,
10040 graphql_client: self.graphql_client.clone(),
10041 }
10042 }
10043 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
10045 let mut query = self.selection.select("loadErrorFromID");
10046 query = query.arg_lazy(
10047 "id",
10048 Box::new(move || {
10049 let id = id.clone();
10050 Box::pin(async move { id.into_id().await.unwrap().quote() })
10051 }),
10052 );
10053 Error {
10054 proc: self.proc.clone(),
10055 selection: query,
10056 graphql_client: self.graphql_client.clone(),
10057 }
10058 }
10059 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
10061 let mut query = self.selection.select("loadErrorValueFromID");
10062 query = query.arg_lazy(
10063 "id",
10064 Box::new(move || {
10065 let id = id.clone();
10066 Box::pin(async move { id.into_id().await.unwrap().quote() })
10067 }),
10068 );
10069 ErrorValue {
10070 proc: self.proc.clone(),
10071 selection: query,
10072 graphql_client: self.graphql_client.clone(),
10073 }
10074 }
10075 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
10077 let mut query = self.selection.select("loadFieldTypeDefFromID");
10078 query = query.arg_lazy(
10079 "id",
10080 Box::new(move || {
10081 let id = id.clone();
10082 Box::pin(async move { id.into_id().await.unwrap().quote() })
10083 }),
10084 );
10085 FieldTypeDef {
10086 proc: self.proc.clone(),
10087 selection: query,
10088 graphql_client: self.graphql_client.clone(),
10089 }
10090 }
10091 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
10093 let mut query = self.selection.select("loadFileFromID");
10094 query = query.arg_lazy(
10095 "id",
10096 Box::new(move || {
10097 let id = id.clone();
10098 Box::pin(async move { id.into_id().await.unwrap().quote() })
10099 }),
10100 );
10101 File {
10102 proc: self.proc.clone(),
10103 selection: query,
10104 graphql_client: self.graphql_client.clone(),
10105 }
10106 }
10107 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
10109 let mut query = self.selection.select("loadFunctionArgFromID");
10110 query = query.arg_lazy(
10111 "id",
10112 Box::new(move || {
10113 let id = id.clone();
10114 Box::pin(async move { id.into_id().await.unwrap().quote() })
10115 }),
10116 );
10117 FunctionArg {
10118 proc: self.proc.clone(),
10119 selection: query,
10120 graphql_client: self.graphql_client.clone(),
10121 }
10122 }
10123 pub fn load_function_call_arg_value_from_id(
10125 &self,
10126 id: impl IntoID<FunctionCallArgValueId>,
10127 ) -> FunctionCallArgValue {
10128 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
10129 query = query.arg_lazy(
10130 "id",
10131 Box::new(move || {
10132 let id = id.clone();
10133 Box::pin(async move { id.into_id().await.unwrap().quote() })
10134 }),
10135 );
10136 FunctionCallArgValue {
10137 proc: self.proc.clone(),
10138 selection: query,
10139 graphql_client: self.graphql_client.clone(),
10140 }
10141 }
10142 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
10144 let mut query = self.selection.select("loadFunctionCallFromID");
10145 query = query.arg_lazy(
10146 "id",
10147 Box::new(move || {
10148 let id = id.clone();
10149 Box::pin(async move { id.into_id().await.unwrap().quote() })
10150 }),
10151 );
10152 FunctionCall {
10153 proc: self.proc.clone(),
10154 selection: query,
10155 graphql_client: self.graphql_client.clone(),
10156 }
10157 }
10158 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
10160 let mut query = self.selection.select("loadFunctionFromID");
10161 query = query.arg_lazy(
10162 "id",
10163 Box::new(move || {
10164 let id = id.clone();
10165 Box::pin(async move { id.into_id().await.unwrap().quote() })
10166 }),
10167 );
10168 Function {
10169 proc: self.proc.clone(),
10170 selection: query,
10171 graphql_client: self.graphql_client.clone(),
10172 }
10173 }
10174 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
10176 let mut query = self.selection.select("loadGeneratedCodeFromID");
10177 query = query.arg_lazy(
10178 "id",
10179 Box::new(move || {
10180 let id = id.clone();
10181 Box::pin(async move { id.into_id().await.unwrap().quote() })
10182 }),
10183 );
10184 GeneratedCode {
10185 proc: self.proc.clone(),
10186 selection: query,
10187 graphql_client: self.graphql_client.clone(),
10188 }
10189 }
10190 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
10192 let mut query = self.selection.select("loadGitRefFromID");
10193 query = query.arg_lazy(
10194 "id",
10195 Box::new(move || {
10196 let id = id.clone();
10197 Box::pin(async move { id.into_id().await.unwrap().quote() })
10198 }),
10199 );
10200 GitRef {
10201 proc: self.proc.clone(),
10202 selection: query,
10203 graphql_client: self.graphql_client.clone(),
10204 }
10205 }
10206 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
10208 let mut query = self.selection.select("loadGitRepositoryFromID");
10209 query = query.arg_lazy(
10210 "id",
10211 Box::new(move || {
10212 let id = id.clone();
10213 Box::pin(async move { id.into_id().await.unwrap().quote() })
10214 }),
10215 );
10216 GitRepository {
10217 proc: self.proc.clone(),
10218 selection: query,
10219 graphql_client: self.graphql_client.clone(),
10220 }
10221 }
10222 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
10224 let mut query = self.selection.select("loadHostFromID");
10225 query = query.arg_lazy(
10226 "id",
10227 Box::new(move || {
10228 let id = id.clone();
10229 Box::pin(async move { id.into_id().await.unwrap().quote() })
10230 }),
10231 );
10232 Host {
10233 proc: self.proc.clone(),
10234 selection: query,
10235 graphql_client: self.graphql_client.clone(),
10236 }
10237 }
10238 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
10240 let mut query = self.selection.select("loadInputTypeDefFromID");
10241 query = query.arg_lazy(
10242 "id",
10243 Box::new(move || {
10244 let id = id.clone();
10245 Box::pin(async move { id.into_id().await.unwrap().quote() })
10246 }),
10247 );
10248 InputTypeDef {
10249 proc: self.proc.clone(),
10250 selection: query,
10251 graphql_client: self.graphql_client.clone(),
10252 }
10253 }
10254 pub fn load_interface_type_def_from_id(
10256 &self,
10257 id: impl IntoID<InterfaceTypeDefId>,
10258 ) -> InterfaceTypeDef {
10259 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
10260 query = query.arg_lazy(
10261 "id",
10262 Box::new(move || {
10263 let id = id.clone();
10264 Box::pin(async move { id.into_id().await.unwrap().quote() })
10265 }),
10266 );
10267 InterfaceTypeDef {
10268 proc: self.proc.clone(),
10269 selection: query,
10270 graphql_client: self.graphql_client.clone(),
10271 }
10272 }
10273 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
10275 let mut query = self.selection.select("loadJSONValueFromID");
10276 query = query.arg_lazy(
10277 "id",
10278 Box::new(move || {
10279 let id = id.clone();
10280 Box::pin(async move { id.into_id().await.unwrap().quote() })
10281 }),
10282 );
10283 JsonValue {
10284 proc: self.proc.clone(),
10285 selection: query,
10286 graphql_client: self.graphql_client.clone(),
10287 }
10288 }
10289 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
10291 let mut query = self.selection.select("loadLLMFromID");
10292 query = query.arg_lazy(
10293 "id",
10294 Box::new(move || {
10295 let id = id.clone();
10296 Box::pin(async move { id.into_id().await.unwrap().quote() })
10297 }),
10298 );
10299 Llm {
10300 proc: self.proc.clone(),
10301 selection: query,
10302 graphql_client: self.graphql_client.clone(),
10303 }
10304 }
10305 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
10307 let mut query = self.selection.select("loadLLMTokenUsageFromID");
10308 query = query.arg_lazy(
10309 "id",
10310 Box::new(move || {
10311 let id = id.clone();
10312 Box::pin(async move { id.into_id().await.unwrap().quote() })
10313 }),
10314 );
10315 LlmTokenUsage {
10316 proc: self.proc.clone(),
10317 selection: query,
10318 graphql_client: self.graphql_client.clone(),
10319 }
10320 }
10321 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
10323 let mut query = self.selection.select("loadLabelFromID");
10324 query = query.arg_lazy(
10325 "id",
10326 Box::new(move || {
10327 let id = id.clone();
10328 Box::pin(async move { id.into_id().await.unwrap().quote() })
10329 }),
10330 );
10331 Label {
10332 proc: self.proc.clone(),
10333 selection: query,
10334 graphql_client: self.graphql_client.clone(),
10335 }
10336 }
10337 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
10339 let mut query = self.selection.select("loadListTypeDefFromID");
10340 query = query.arg_lazy(
10341 "id",
10342 Box::new(move || {
10343 let id = id.clone();
10344 Box::pin(async move { id.into_id().await.unwrap().quote() })
10345 }),
10346 );
10347 ListTypeDef {
10348 proc: self.proc.clone(),
10349 selection: query,
10350 graphql_client: self.graphql_client.clone(),
10351 }
10352 }
10353 pub fn load_module_config_client_from_id(
10355 &self,
10356 id: impl IntoID<ModuleConfigClientId>,
10357 ) -> ModuleConfigClient {
10358 let mut query = self.selection.select("loadModuleConfigClientFromID");
10359 query = query.arg_lazy(
10360 "id",
10361 Box::new(move || {
10362 let id = id.clone();
10363 Box::pin(async move { id.into_id().await.unwrap().quote() })
10364 }),
10365 );
10366 ModuleConfigClient {
10367 proc: self.proc.clone(),
10368 selection: query,
10369 graphql_client: self.graphql_client.clone(),
10370 }
10371 }
10372 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
10374 let mut query = self.selection.select("loadModuleFromID");
10375 query = query.arg_lazy(
10376 "id",
10377 Box::new(move || {
10378 let id = id.clone();
10379 Box::pin(async move { id.into_id().await.unwrap().quote() })
10380 }),
10381 );
10382 Module {
10383 proc: self.proc.clone(),
10384 selection: query,
10385 graphql_client: self.graphql_client.clone(),
10386 }
10387 }
10388 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
10390 let mut query = self.selection.select("loadModuleSourceFromID");
10391 query = query.arg_lazy(
10392 "id",
10393 Box::new(move || {
10394 let id = id.clone();
10395 Box::pin(async move { id.into_id().await.unwrap().quote() })
10396 }),
10397 );
10398 ModuleSource {
10399 proc: self.proc.clone(),
10400 selection: query,
10401 graphql_client: self.graphql_client.clone(),
10402 }
10403 }
10404 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
10406 let mut query = self.selection.select("loadObjectTypeDefFromID");
10407 query = query.arg_lazy(
10408 "id",
10409 Box::new(move || {
10410 let id = id.clone();
10411 Box::pin(async move { id.into_id().await.unwrap().quote() })
10412 }),
10413 );
10414 ObjectTypeDef {
10415 proc: self.proc.clone(),
10416 selection: query,
10417 graphql_client: self.graphql_client.clone(),
10418 }
10419 }
10420 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
10422 let mut query = self.selection.select("loadPortFromID");
10423 query = query.arg_lazy(
10424 "id",
10425 Box::new(move || {
10426 let id = id.clone();
10427 Box::pin(async move { id.into_id().await.unwrap().quote() })
10428 }),
10429 );
10430 Port {
10431 proc: self.proc.clone(),
10432 selection: query,
10433 graphql_client: self.graphql_client.clone(),
10434 }
10435 }
10436 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
10438 let mut query = self.selection.select("loadSDKConfigFromID");
10439 query = query.arg_lazy(
10440 "id",
10441 Box::new(move || {
10442 let id = id.clone();
10443 Box::pin(async move { id.into_id().await.unwrap().quote() })
10444 }),
10445 );
10446 SdkConfig {
10447 proc: self.proc.clone(),
10448 selection: query,
10449 graphql_client: self.graphql_client.clone(),
10450 }
10451 }
10452 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
10454 let mut query = self.selection.select("loadScalarTypeDefFromID");
10455 query = query.arg_lazy(
10456 "id",
10457 Box::new(move || {
10458 let id = id.clone();
10459 Box::pin(async move { id.into_id().await.unwrap().quote() })
10460 }),
10461 );
10462 ScalarTypeDef {
10463 proc: self.proc.clone(),
10464 selection: query,
10465 graphql_client: self.graphql_client.clone(),
10466 }
10467 }
10468 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
10470 let mut query = self.selection.select("loadSearchResultFromID");
10471 query = query.arg_lazy(
10472 "id",
10473 Box::new(move || {
10474 let id = id.clone();
10475 Box::pin(async move { id.into_id().await.unwrap().quote() })
10476 }),
10477 );
10478 SearchResult {
10479 proc: self.proc.clone(),
10480 selection: query,
10481 graphql_client: self.graphql_client.clone(),
10482 }
10483 }
10484 pub fn load_search_submatch_from_id(
10486 &self,
10487 id: impl IntoID<SearchSubmatchId>,
10488 ) -> SearchSubmatch {
10489 let mut query = self.selection.select("loadSearchSubmatchFromID");
10490 query = query.arg_lazy(
10491 "id",
10492 Box::new(move || {
10493 let id = id.clone();
10494 Box::pin(async move { id.into_id().await.unwrap().quote() })
10495 }),
10496 );
10497 SearchSubmatch {
10498 proc: self.proc.clone(),
10499 selection: query,
10500 graphql_client: self.graphql_client.clone(),
10501 }
10502 }
10503 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
10505 let mut query = self.selection.select("loadSecretFromID");
10506 query = query.arg_lazy(
10507 "id",
10508 Box::new(move || {
10509 let id = id.clone();
10510 Box::pin(async move { id.into_id().await.unwrap().quote() })
10511 }),
10512 );
10513 Secret {
10514 proc: self.proc.clone(),
10515 selection: query,
10516 graphql_client: self.graphql_client.clone(),
10517 }
10518 }
10519 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
10521 let mut query = self.selection.select("loadServiceFromID");
10522 query = query.arg_lazy(
10523 "id",
10524 Box::new(move || {
10525 let id = id.clone();
10526 Box::pin(async move { id.into_id().await.unwrap().quote() })
10527 }),
10528 );
10529 Service {
10530 proc: self.proc.clone(),
10531 selection: query,
10532 graphql_client: self.graphql_client.clone(),
10533 }
10534 }
10535 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
10537 let mut query = self.selection.select("loadSocketFromID");
10538 query = query.arg_lazy(
10539 "id",
10540 Box::new(move || {
10541 let id = id.clone();
10542 Box::pin(async move { id.into_id().await.unwrap().quote() })
10543 }),
10544 );
10545 Socket {
10546 proc: self.proc.clone(),
10547 selection: query,
10548 graphql_client: self.graphql_client.clone(),
10549 }
10550 }
10551 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
10553 let mut query = self.selection.select("loadSourceMapFromID");
10554 query = query.arg_lazy(
10555 "id",
10556 Box::new(move || {
10557 let id = id.clone();
10558 Box::pin(async move { id.into_id().await.unwrap().quote() })
10559 }),
10560 );
10561 SourceMap {
10562 proc: self.proc.clone(),
10563 selection: query,
10564 graphql_client: self.graphql_client.clone(),
10565 }
10566 }
10567 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
10569 let mut query = self.selection.select("loadTerminalFromID");
10570 query = query.arg_lazy(
10571 "id",
10572 Box::new(move || {
10573 let id = id.clone();
10574 Box::pin(async move { id.into_id().await.unwrap().quote() })
10575 }),
10576 );
10577 Terminal {
10578 proc: self.proc.clone(),
10579 selection: query,
10580 graphql_client: self.graphql_client.clone(),
10581 }
10582 }
10583 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
10585 let mut query = self.selection.select("loadTypeDefFromID");
10586 query = query.arg_lazy(
10587 "id",
10588 Box::new(move || {
10589 let id = id.clone();
10590 Box::pin(async move { id.into_id().await.unwrap().quote() })
10591 }),
10592 );
10593 TypeDef {
10594 proc: self.proc.clone(),
10595 selection: query,
10596 graphql_client: self.graphql_client.clone(),
10597 }
10598 }
10599 pub fn module(&self) -> Module {
10601 let query = self.selection.select("module");
10602 Module {
10603 proc: self.proc.clone(),
10604 selection: query,
10605 graphql_client: self.graphql_client.clone(),
10606 }
10607 }
10608 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
10615 let mut query = self.selection.select("moduleSource");
10616 query = query.arg("refString", ref_string.into());
10617 ModuleSource {
10618 proc: self.proc.clone(),
10619 selection: query,
10620 graphql_client: self.graphql_client.clone(),
10621 }
10622 }
10623 pub fn module_source_opts<'a>(
10630 &self,
10631 ref_string: impl Into<String>,
10632 opts: QueryModuleSourceOpts<'a>,
10633 ) -> ModuleSource {
10634 let mut query = self.selection.select("moduleSource");
10635 query = query.arg("refString", ref_string.into());
10636 if let Some(ref_pin) = opts.ref_pin {
10637 query = query.arg("refPin", ref_pin);
10638 }
10639 if let Some(disable_find_up) = opts.disable_find_up {
10640 query = query.arg("disableFindUp", disable_find_up);
10641 }
10642 if let Some(allow_not_exists) = opts.allow_not_exists {
10643 query = query.arg("allowNotExists", allow_not_exists);
10644 }
10645 if let Some(require_kind) = opts.require_kind {
10646 query = query.arg("requireKind", require_kind);
10647 }
10648 ModuleSource {
10649 proc: self.proc.clone(),
10650 selection: query,
10651 graphql_client: self.graphql_client.clone(),
10652 }
10653 }
10654 pub fn secret(&self, uri: impl Into<String>) -> Secret {
10661 let mut query = self.selection.select("secret");
10662 query = query.arg("uri", uri.into());
10663 Secret {
10664 proc: self.proc.clone(),
10665 selection: query,
10666 graphql_client: self.graphql_client.clone(),
10667 }
10668 }
10669 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
10676 let mut query = self.selection.select("secret");
10677 query = query.arg("uri", uri.into());
10678 if let Some(cache_key) = opts.cache_key {
10679 query = query.arg("cacheKey", cache_key);
10680 }
10681 Secret {
10682 proc: self.proc.clone(),
10683 selection: query,
10684 graphql_client: self.graphql_client.clone(),
10685 }
10686 }
10687 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
10695 let mut query = self.selection.select("setSecret");
10696 query = query.arg("name", name.into());
10697 query = query.arg("plaintext", plaintext.into());
10698 Secret {
10699 proc: self.proc.clone(),
10700 selection: query,
10701 graphql_client: self.graphql_client.clone(),
10702 }
10703 }
10704 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
10712 let mut query = self.selection.select("sourceMap");
10713 query = query.arg("filename", filename.into());
10714 query = query.arg("line", line);
10715 query = query.arg("column", column);
10716 SourceMap {
10717 proc: self.proc.clone(),
10718 selection: query,
10719 graphql_client: self.graphql_client.clone(),
10720 }
10721 }
10722 pub fn type_def(&self) -> TypeDef {
10724 let query = self.selection.select("typeDef");
10725 TypeDef {
10726 proc: self.proc.clone(),
10727 selection: query,
10728 graphql_client: self.graphql_client.clone(),
10729 }
10730 }
10731 pub async fn version(&self) -> Result<String, DaggerError> {
10733 let query = self.selection.select("version");
10734 query.execute(self.graphql_client.clone()).await
10735 }
10736}
10737#[derive(Clone)]
10738pub struct SdkConfig {
10739 pub proc: Option<Arc<DaggerSessionProc>>,
10740 pub selection: Selection,
10741 pub graphql_client: DynGraphQLClient,
10742}
10743impl SdkConfig {
10744 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
10746 let query = self.selection.select("id");
10747 query.execute(self.graphql_client.clone()).await
10748 }
10749 pub async fn source(&self) -> Result<String, DaggerError> {
10751 let query = self.selection.select("source");
10752 query.execute(self.graphql_client.clone()).await
10753 }
10754}
10755#[derive(Clone)]
10756pub struct ScalarTypeDef {
10757 pub proc: Option<Arc<DaggerSessionProc>>,
10758 pub selection: Selection,
10759 pub graphql_client: DynGraphQLClient,
10760}
10761impl ScalarTypeDef {
10762 pub async fn description(&self) -> Result<String, DaggerError> {
10764 let query = self.selection.select("description");
10765 query.execute(self.graphql_client.clone()).await
10766 }
10767 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
10769 let query = self.selection.select("id");
10770 query.execute(self.graphql_client.clone()).await
10771 }
10772 pub async fn name(&self) -> Result<String, DaggerError> {
10774 let query = self.selection.select("name");
10775 query.execute(self.graphql_client.clone()).await
10776 }
10777 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10779 let query = self.selection.select("sourceModuleName");
10780 query.execute(self.graphql_client.clone()).await
10781 }
10782}
10783#[derive(Clone)]
10784pub struct SearchResult {
10785 pub proc: Option<Arc<DaggerSessionProc>>,
10786 pub selection: Selection,
10787 pub graphql_client: DynGraphQLClient,
10788}
10789impl SearchResult {
10790 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
10792 let query = self.selection.select("absoluteOffset");
10793 query.execute(self.graphql_client.clone()).await
10794 }
10795 pub async fn file_path(&self) -> Result<String, DaggerError> {
10797 let query = self.selection.select("filePath");
10798 query.execute(self.graphql_client.clone()).await
10799 }
10800 pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
10802 let query = self.selection.select("id");
10803 query.execute(self.graphql_client.clone()).await
10804 }
10805 pub async fn line_number(&self) -> Result<isize, DaggerError> {
10807 let query = self.selection.select("lineNumber");
10808 query.execute(self.graphql_client.clone()).await
10809 }
10810 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
10812 let query = self.selection.select("matchedLines");
10813 query.execute(self.graphql_client.clone()).await
10814 }
10815 pub fn submatches(&self) -> Vec<SearchSubmatch> {
10817 let query = self.selection.select("submatches");
10818 vec![SearchSubmatch {
10819 proc: self.proc.clone(),
10820 selection: query,
10821 graphql_client: self.graphql_client.clone(),
10822 }]
10823 }
10824}
10825#[derive(Clone)]
10826pub struct SearchSubmatch {
10827 pub proc: Option<Arc<DaggerSessionProc>>,
10828 pub selection: Selection,
10829 pub graphql_client: DynGraphQLClient,
10830}
10831impl SearchSubmatch {
10832 pub async fn end(&self) -> Result<isize, DaggerError> {
10834 let query = self.selection.select("end");
10835 query.execute(self.graphql_client.clone()).await
10836 }
10837 pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
10839 let query = self.selection.select("id");
10840 query.execute(self.graphql_client.clone()).await
10841 }
10842 pub async fn start(&self) -> Result<isize, DaggerError> {
10844 let query = self.selection.select("start");
10845 query.execute(self.graphql_client.clone()).await
10846 }
10847 pub async fn text(&self) -> Result<String, DaggerError> {
10849 let query = self.selection.select("text");
10850 query.execute(self.graphql_client.clone()).await
10851 }
10852}
10853#[derive(Clone)]
10854pub struct Secret {
10855 pub proc: Option<Arc<DaggerSessionProc>>,
10856 pub selection: Selection,
10857 pub graphql_client: DynGraphQLClient,
10858}
10859impl Secret {
10860 pub async fn id(&self) -> Result<SecretId, DaggerError> {
10862 let query = self.selection.select("id");
10863 query.execute(self.graphql_client.clone()).await
10864 }
10865 pub async fn name(&self) -> Result<String, DaggerError> {
10867 let query = self.selection.select("name");
10868 query.execute(self.graphql_client.clone()).await
10869 }
10870 pub async fn plaintext(&self) -> Result<String, DaggerError> {
10872 let query = self.selection.select("plaintext");
10873 query.execute(self.graphql_client.clone()).await
10874 }
10875 pub async fn uri(&self) -> Result<String, DaggerError> {
10877 let query = self.selection.select("uri");
10878 query.execute(self.graphql_client.clone()).await
10879 }
10880}
10881#[derive(Clone)]
10882pub struct Service {
10883 pub proc: Option<Arc<DaggerSessionProc>>,
10884 pub selection: Selection,
10885 pub graphql_client: DynGraphQLClient,
10886}
10887#[derive(Builder, Debug, PartialEq)]
10888pub struct ServiceEndpointOpts<'a> {
10889 #[builder(setter(into, strip_option), default)]
10891 pub port: Option<isize>,
10892 #[builder(setter(into, strip_option), default)]
10894 pub scheme: Option<&'a str>,
10895}
10896#[derive(Builder, Debug, PartialEq)]
10897pub struct ServiceStopOpts {
10898 #[builder(setter(into, strip_option), default)]
10900 pub kill: Option<bool>,
10901}
10902#[derive(Builder, Debug, PartialEq)]
10903pub struct ServiceTerminalOpts<'a> {
10904 #[builder(setter(into, strip_option), default)]
10905 pub cmd: Option<Vec<&'a str>>,
10906}
10907#[derive(Builder, Debug, PartialEq)]
10908pub struct ServiceUpOpts {
10909 #[builder(setter(into, strip_option), default)]
10912 pub ports: Option<Vec<PortForward>>,
10913 #[builder(setter(into, strip_option), default)]
10915 pub random: Option<bool>,
10916}
10917impl Service {
10918 pub async fn endpoint(&self) -> Result<String, DaggerError> {
10926 let query = self.selection.select("endpoint");
10927 query.execute(self.graphql_client.clone()).await
10928 }
10929 pub async fn endpoint_opts<'a>(
10937 &self,
10938 opts: ServiceEndpointOpts<'a>,
10939 ) -> Result<String, DaggerError> {
10940 let mut query = self.selection.select("endpoint");
10941 if let Some(port) = opts.port {
10942 query = query.arg("port", port);
10943 }
10944 if let Some(scheme) = opts.scheme {
10945 query = query.arg("scheme", scheme);
10946 }
10947 query.execute(self.graphql_client.clone()).await
10948 }
10949 pub async fn hostname(&self) -> Result<String, DaggerError> {
10951 let query = self.selection.select("hostname");
10952 query.execute(self.graphql_client.clone()).await
10953 }
10954 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
10956 let query = self.selection.select("id");
10957 query.execute(self.graphql_client.clone()).await
10958 }
10959 pub fn ports(&self) -> Vec<Port> {
10961 let query = self.selection.select("ports");
10962 vec![Port {
10963 proc: self.proc.clone(),
10964 selection: query,
10965 graphql_client: self.graphql_client.clone(),
10966 }]
10967 }
10968 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
10971 let query = self.selection.select("start");
10972 query.execute(self.graphql_client.clone()).await
10973 }
10974 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
10980 let query = self.selection.select("stop");
10981 query.execute(self.graphql_client.clone()).await
10982 }
10983 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
10989 let mut query = self.selection.select("stop");
10990 if let Some(kill) = opts.kill {
10991 query = query.arg("kill", kill);
10992 }
10993 query.execute(self.graphql_client.clone()).await
10994 }
10995 pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
10997 let query = self.selection.select("sync");
10998 query.execute(self.graphql_client.clone()).await
10999 }
11000 pub fn terminal(&self) -> Service {
11005 let query = self.selection.select("terminal");
11006 Service {
11007 proc: self.proc.clone(),
11008 selection: query,
11009 graphql_client: self.graphql_client.clone(),
11010 }
11011 }
11012 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
11017 let mut query = self.selection.select("terminal");
11018 if let Some(cmd) = opts.cmd {
11019 query = query.arg("cmd", cmd);
11020 }
11021 Service {
11022 proc: self.proc.clone(),
11023 selection: query,
11024 graphql_client: self.graphql_client.clone(),
11025 }
11026 }
11027 pub async fn up(&self) -> Result<Void, DaggerError> {
11033 let query = self.selection.select("up");
11034 query.execute(self.graphql_client.clone()).await
11035 }
11036 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
11042 let mut query = self.selection.select("up");
11043 if let Some(ports) = opts.ports {
11044 query = query.arg("ports", ports);
11045 }
11046 if let Some(random) = opts.random {
11047 query = query.arg("random", random);
11048 }
11049 query.execute(self.graphql_client.clone()).await
11050 }
11051 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
11057 let mut query = self.selection.select("withHostname");
11058 query = query.arg("hostname", hostname.into());
11059 Service {
11060 proc: self.proc.clone(),
11061 selection: query,
11062 graphql_client: self.graphql_client.clone(),
11063 }
11064 }
11065}
11066#[derive(Clone)]
11067pub struct Socket {
11068 pub proc: Option<Arc<DaggerSessionProc>>,
11069 pub selection: Selection,
11070 pub graphql_client: DynGraphQLClient,
11071}
11072impl Socket {
11073 pub async fn id(&self) -> Result<SocketId, DaggerError> {
11075 let query = self.selection.select("id");
11076 query.execute(self.graphql_client.clone()).await
11077 }
11078}
11079#[derive(Clone)]
11080pub struct SourceMap {
11081 pub proc: Option<Arc<DaggerSessionProc>>,
11082 pub selection: Selection,
11083 pub graphql_client: DynGraphQLClient,
11084}
11085impl SourceMap {
11086 pub async fn column(&self) -> Result<isize, DaggerError> {
11088 let query = self.selection.select("column");
11089 query.execute(self.graphql_client.clone()).await
11090 }
11091 pub async fn filename(&self) -> Result<String, DaggerError> {
11093 let query = self.selection.select("filename");
11094 query.execute(self.graphql_client.clone()).await
11095 }
11096 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
11098 let query = self.selection.select("id");
11099 query.execute(self.graphql_client.clone()).await
11100 }
11101 pub async fn line(&self) -> Result<isize, DaggerError> {
11103 let query = self.selection.select("line");
11104 query.execute(self.graphql_client.clone()).await
11105 }
11106 pub async fn module(&self) -> Result<String, DaggerError> {
11108 let query = self.selection.select("module");
11109 query.execute(self.graphql_client.clone()).await
11110 }
11111 pub async fn url(&self) -> Result<String, DaggerError> {
11113 let query = self.selection.select("url");
11114 query.execute(self.graphql_client.clone()).await
11115 }
11116}
11117#[derive(Clone)]
11118pub struct Terminal {
11119 pub proc: Option<Arc<DaggerSessionProc>>,
11120 pub selection: Selection,
11121 pub graphql_client: DynGraphQLClient,
11122}
11123impl Terminal {
11124 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
11126 let query = self.selection.select("id");
11127 query.execute(self.graphql_client.clone()).await
11128 }
11129 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
11132 let query = self.selection.select("sync");
11133 query.execute(self.graphql_client.clone()).await
11134 }
11135}
11136#[derive(Clone)]
11137pub struct TypeDef {
11138 pub proc: Option<Arc<DaggerSessionProc>>,
11139 pub selection: Selection,
11140 pub graphql_client: DynGraphQLClient,
11141}
11142#[derive(Builder, Debug, PartialEq)]
11143pub struct TypeDefWithEnumOpts<'a> {
11144 #[builder(setter(into, strip_option), default)]
11146 pub description: Option<&'a str>,
11147 #[builder(setter(into, strip_option), default)]
11149 pub source_map: Option<SourceMapId>,
11150}
11151#[derive(Builder, Debug, PartialEq)]
11152pub struct TypeDefWithEnumMemberOpts<'a> {
11153 #[builder(setter(into, strip_option), default)]
11155 pub description: Option<&'a str>,
11156 #[builder(setter(into, strip_option), default)]
11158 pub source_map: Option<SourceMapId>,
11159 #[builder(setter(into, strip_option), default)]
11161 pub value: Option<&'a str>,
11162}
11163#[derive(Builder, Debug, PartialEq)]
11164pub struct TypeDefWithEnumValueOpts<'a> {
11165 #[builder(setter(into, strip_option), default)]
11167 pub description: Option<&'a str>,
11168 #[builder(setter(into, strip_option), default)]
11170 pub source_map: Option<SourceMapId>,
11171}
11172#[derive(Builder, Debug, PartialEq)]
11173pub struct TypeDefWithFieldOpts<'a> {
11174 #[builder(setter(into, strip_option), default)]
11176 pub description: Option<&'a str>,
11177 #[builder(setter(into, strip_option), default)]
11179 pub source_map: Option<SourceMapId>,
11180}
11181#[derive(Builder, Debug, PartialEq)]
11182pub struct TypeDefWithInterfaceOpts<'a> {
11183 #[builder(setter(into, strip_option), default)]
11184 pub description: Option<&'a str>,
11185 #[builder(setter(into, strip_option), default)]
11186 pub source_map: Option<SourceMapId>,
11187}
11188#[derive(Builder, Debug, PartialEq)]
11189pub struct TypeDefWithObjectOpts<'a> {
11190 #[builder(setter(into, strip_option), default)]
11191 pub description: Option<&'a str>,
11192 #[builder(setter(into, strip_option), default)]
11193 pub source_map: Option<SourceMapId>,
11194}
11195#[derive(Builder, Debug, PartialEq)]
11196pub struct TypeDefWithScalarOpts<'a> {
11197 #[builder(setter(into, strip_option), default)]
11198 pub description: Option<&'a str>,
11199}
11200impl TypeDef {
11201 pub fn as_enum(&self) -> EnumTypeDef {
11203 let query = self.selection.select("asEnum");
11204 EnumTypeDef {
11205 proc: self.proc.clone(),
11206 selection: query,
11207 graphql_client: self.graphql_client.clone(),
11208 }
11209 }
11210 pub fn as_input(&self) -> InputTypeDef {
11212 let query = self.selection.select("asInput");
11213 InputTypeDef {
11214 proc: self.proc.clone(),
11215 selection: query,
11216 graphql_client: self.graphql_client.clone(),
11217 }
11218 }
11219 pub fn as_interface(&self) -> InterfaceTypeDef {
11221 let query = self.selection.select("asInterface");
11222 InterfaceTypeDef {
11223 proc: self.proc.clone(),
11224 selection: query,
11225 graphql_client: self.graphql_client.clone(),
11226 }
11227 }
11228 pub fn as_list(&self) -> ListTypeDef {
11230 let query = self.selection.select("asList");
11231 ListTypeDef {
11232 proc: self.proc.clone(),
11233 selection: query,
11234 graphql_client: self.graphql_client.clone(),
11235 }
11236 }
11237 pub fn as_object(&self) -> ObjectTypeDef {
11239 let query = self.selection.select("asObject");
11240 ObjectTypeDef {
11241 proc: self.proc.clone(),
11242 selection: query,
11243 graphql_client: self.graphql_client.clone(),
11244 }
11245 }
11246 pub fn as_scalar(&self) -> ScalarTypeDef {
11248 let query = self.selection.select("asScalar");
11249 ScalarTypeDef {
11250 proc: self.proc.clone(),
11251 selection: query,
11252 graphql_client: self.graphql_client.clone(),
11253 }
11254 }
11255 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
11257 let query = self.selection.select("id");
11258 query.execute(self.graphql_client.clone()).await
11259 }
11260 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
11262 let query = self.selection.select("kind");
11263 query.execute(self.graphql_client.clone()).await
11264 }
11265 pub async fn optional(&self) -> Result<bool, DaggerError> {
11267 let query = self.selection.select("optional");
11268 query.execute(self.graphql_client.clone()).await
11269 }
11270 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
11272 let mut query = self.selection.select("withConstructor");
11273 query = query.arg_lazy(
11274 "function",
11275 Box::new(move || {
11276 let function = function.clone();
11277 Box::pin(async move { function.into_id().await.unwrap().quote() })
11278 }),
11279 );
11280 TypeDef {
11281 proc: self.proc.clone(),
11282 selection: query,
11283 graphql_client: self.graphql_client.clone(),
11284 }
11285 }
11286 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
11294 let mut query = self.selection.select("withEnum");
11295 query = query.arg("name", name.into());
11296 TypeDef {
11297 proc: self.proc.clone(),
11298 selection: query,
11299 graphql_client: self.graphql_client.clone(),
11300 }
11301 }
11302 pub fn with_enum_opts<'a>(
11310 &self,
11311 name: impl Into<String>,
11312 opts: TypeDefWithEnumOpts<'a>,
11313 ) -> TypeDef {
11314 let mut query = self.selection.select("withEnum");
11315 query = query.arg("name", name.into());
11316 if let Some(description) = opts.description {
11317 query = query.arg("description", description);
11318 }
11319 if let Some(source_map) = opts.source_map {
11320 query = query.arg("sourceMap", source_map);
11321 }
11322 TypeDef {
11323 proc: self.proc.clone(),
11324 selection: query,
11325 graphql_client: self.graphql_client.clone(),
11326 }
11327 }
11328 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
11335 let mut query = self.selection.select("withEnumMember");
11336 query = query.arg("name", name.into());
11337 TypeDef {
11338 proc: self.proc.clone(),
11339 selection: query,
11340 graphql_client: self.graphql_client.clone(),
11341 }
11342 }
11343 pub fn with_enum_member_opts<'a>(
11350 &self,
11351 name: impl Into<String>,
11352 opts: TypeDefWithEnumMemberOpts<'a>,
11353 ) -> TypeDef {
11354 let mut query = self.selection.select("withEnumMember");
11355 query = query.arg("name", name.into());
11356 if let Some(value) = opts.value {
11357 query = query.arg("value", value);
11358 }
11359 if let Some(description) = opts.description {
11360 query = query.arg("description", description);
11361 }
11362 if let Some(source_map) = opts.source_map {
11363 query = query.arg("sourceMap", source_map);
11364 }
11365 TypeDef {
11366 proc: self.proc.clone(),
11367 selection: query,
11368 graphql_client: self.graphql_client.clone(),
11369 }
11370 }
11371 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
11378 let mut query = self.selection.select("withEnumValue");
11379 query = query.arg("value", value.into());
11380 TypeDef {
11381 proc: self.proc.clone(),
11382 selection: query,
11383 graphql_client: self.graphql_client.clone(),
11384 }
11385 }
11386 pub fn with_enum_value_opts<'a>(
11393 &self,
11394 value: impl Into<String>,
11395 opts: TypeDefWithEnumValueOpts<'a>,
11396 ) -> TypeDef {
11397 let mut query = self.selection.select("withEnumValue");
11398 query = query.arg("value", value.into());
11399 if let Some(description) = opts.description {
11400 query = query.arg("description", description);
11401 }
11402 if let Some(source_map) = opts.source_map {
11403 query = query.arg("sourceMap", source_map);
11404 }
11405 TypeDef {
11406 proc: self.proc.clone(),
11407 selection: query,
11408 graphql_client: self.graphql_client.clone(),
11409 }
11410 }
11411 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
11419 let mut query = self.selection.select("withField");
11420 query = query.arg("name", name.into());
11421 query = query.arg_lazy(
11422 "typeDef",
11423 Box::new(move || {
11424 let type_def = type_def.clone();
11425 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
11426 }),
11427 );
11428 TypeDef {
11429 proc: self.proc.clone(),
11430 selection: query,
11431 graphql_client: self.graphql_client.clone(),
11432 }
11433 }
11434 pub fn with_field_opts<'a>(
11442 &self,
11443 name: impl Into<String>,
11444 type_def: impl IntoID<TypeDefId>,
11445 opts: TypeDefWithFieldOpts<'a>,
11446 ) -> TypeDef {
11447 let mut query = self.selection.select("withField");
11448 query = query.arg("name", name.into());
11449 query = query.arg_lazy(
11450 "typeDef",
11451 Box::new(move || {
11452 let type_def = type_def.clone();
11453 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
11454 }),
11455 );
11456 if let Some(description) = opts.description {
11457 query = query.arg("description", description);
11458 }
11459 if let Some(source_map) = opts.source_map {
11460 query = query.arg("sourceMap", source_map);
11461 }
11462 TypeDef {
11463 proc: self.proc.clone(),
11464 selection: query,
11465 graphql_client: self.graphql_client.clone(),
11466 }
11467 }
11468 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
11470 let mut query = self.selection.select("withFunction");
11471 query = query.arg_lazy(
11472 "function",
11473 Box::new(move || {
11474 let function = function.clone();
11475 Box::pin(async move { function.into_id().await.unwrap().quote() })
11476 }),
11477 );
11478 TypeDef {
11479 proc: self.proc.clone(),
11480 selection: query,
11481 graphql_client: self.graphql_client.clone(),
11482 }
11483 }
11484 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
11490 let mut query = self.selection.select("withInterface");
11491 query = query.arg("name", name.into());
11492 TypeDef {
11493 proc: self.proc.clone(),
11494 selection: query,
11495 graphql_client: self.graphql_client.clone(),
11496 }
11497 }
11498 pub fn with_interface_opts<'a>(
11504 &self,
11505 name: impl Into<String>,
11506 opts: TypeDefWithInterfaceOpts<'a>,
11507 ) -> TypeDef {
11508 let mut query = self.selection.select("withInterface");
11509 query = query.arg("name", name.into());
11510 if let Some(description) = opts.description {
11511 query = query.arg("description", description);
11512 }
11513 if let Some(source_map) = opts.source_map {
11514 query = query.arg("sourceMap", source_map);
11515 }
11516 TypeDef {
11517 proc: self.proc.clone(),
11518 selection: query,
11519 graphql_client: self.graphql_client.clone(),
11520 }
11521 }
11522 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
11524 let mut query = self.selection.select("withKind");
11525 query = query.arg("kind", kind);
11526 TypeDef {
11527 proc: self.proc.clone(),
11528 selection: query,
11529 graphql_client: self.graphql_client.clone(),
11530 }
11531 }
11532 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
11534 let mut query = self.selection.select("withListOf");
11535 query = query.arg_lazy(
11536 "elementType",
11537 Box::new(move || {
11538 let element_type = element_type.clone();
11539 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
11540 }),
11541 );
11542 TypeDef {
11543 proc: self.proc.clone(),
11544 selection: query,
11545 graphql_client: self.graphql_client.clone(),
11546 }
11547 }
11548 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
11555 let mut query = self.selection.select("withObject");
11556 query = query.arg("name", name.into());
11557 TypeDef {
11558 proc: self.proc.clone(),
11559 selection: query,
11560 graphql_client: self.graphql_client.clone(),
11561 }
11562 }
11563 pub fn with_object_opts<'a>(
11570 &self,
11571 name: impl Into<String>,
11572 opts: TypeDefWithObjectOpts<'a>,
11573 ) -> TypeDef {
11574 let mut query = self.selection.select("withObject");
11575 query = query.arg("name", name.into());
11576 if let Some(description) = opts.description {
11577 query = query.arg("description", description);
11578 }
11579 if let Some(source_map) = opts.source_map {
11580 query = query.arg("sourceMap", source_map);
11581 }
11582 TypeDef {
11583 proc: self.proc.clone(),
11584 selection: query,
11585 graphql_client: self.graphql_client.clone(),
11586 }
11587 }
11588 pub fn with_optional(&self, optional: bool) -> TypeDef {
11590 let mut query = self.selection.select("withOptional");
11591 query = query.arg("optional", optional);
11592 TypeDef {
11593 proc: self.proc.clone(),
11594 selection: query,
11595 graphql_client: self.graphql_client.clone(),
11596 }
11597 }
11598 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
11604 let mut query = self.selection.select("withScalar");
11605 query = query.arg("name", name.into());
11606 TypeDef {
11607 proc: self.proc.clone(),
11608 selection: query,
11609 graphql_client: self.graphql_client.clone(),
11610 }
11611 }
11612 pub fn with_scalar_opts<'a>(
11618 &self,
11619 name: impl Into<String>,
11620 opts: TypeDefWithScalarOpts<'a>,
11621 ) -> TypeDef {
11622 let mut query = self.selection.select("withScalar");
11623 query = query.arg("name", name.into());
11624 if let Some(description) = opts.description {
11625 query = query.arg("description", description);
11626 }
11627 TypeDef {
11628 proc: self.proc.clone(),
11629 selection: query,
11630 graphql_client: self.graphql_client.clone(),
11631 }
11632 }
11633}
11634#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11635pub enum CacheSharingMode {
11636 #[serde(rename = "LOCKED")]
11637 Locked,
11638 #[serde(rename = "PRIVATE")]
11639 Private,
11640 #[serde(rename = "SHARED")]
11641 Shared,
11642}
11643#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11644pub enum ExistsType {
11645 #[serde(rename = "DIRECTORY_TYPE")]
11646 DirectoryType,
11647 #[serde(rename = "REGULAR_TYPE")]
11648 RegularType,
11649 #[serde(rename = "SYMLINK_TYPE")]
11650 SymlinkType,
11651}
11652#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11653pub enum ImageLayerCompression {
11654 #[serde(rename = "EStarGZ")]
11655 EStarGz,
11656 #[serde(rename = "ESTARGZ")]
11657 Estargz,
11658 #[serde(rename = "Gzip")]
11659 Gzip,
11660 #[serde(rename = "Uncompressed")]
11661 Uncompressed,
11662 #[serde(rename = "Zstd")]
11663 Zstd,
11664}
11665#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11666pub enum ImageMediaTypes {
11667 #[serde(rename = "DOCKER")]
11668 Docker,
11669 #[serde(rename = "DockerMediaTypes")]
11670 DockerMediaTypes,
11671 #[serde(rename = "OCI")]
11672 Oci,
11673 #[serde(rename = "OCIMediaTypes")]
11674 OciMediaTypes,
11675}
11676#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11677pub enum ModuleSourceKind {
11678 #[serde(rename = "DIR")]
11679 Dir,
11680 #[serde(rename = "DIR_SOURCE")]
11681 DirSource,
11682 #[serde(rename = "GIT")]
11683 Git,
11684 #[serde(rename = "GIT_SOURCE")]
11685 GitSource,
11686 #[serde(rename = "LOCAL")]
11687 Local,
11688 #[serde(rename = "LOCAL_SOURCE")]
11689 LocalSource,
11690}
11691#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11692pub enum NetworkProtocol {
11693 #[serde(rename = "TCP")]
11694 Tcp,
11695 #[serde(rename = "UDP")]
11696 Udp,
11697}
11698#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11699pub enum ReturnType {
11700 #[serde(rename = "ANY")]
11701 Any,
11702 #[serde(rename = "FAILURE")]
11703 Failure,
11704 #[serde(rename = "SUCCESS")]
11705 Success,
11706}
11707#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11708pub enum TypeDefKind {
11709 #[serde(rename = "BOOLEAN")]
11710 Boolean,
11711 #[serde(rename = "BOOLEAN_KIND")]
11712 BooleanKind,
11713 #[serde(rename = "ENUM")]
11714 Enum,
11715 #[serde(rename = "ENUM_KIND")]
11716 EnumKind,
11717 #[serde(rename = "FLOAT")]
11718 Float,
11719 #[serde(rename = "FLOAT_KIND")]
11720 FloatKind,
11721 #[serde(rename = "INPUT")]
11722 Input,
11723 #[serde(rename = "INPUT_KIND")]
11724 InputKind,
11725 #[serde(rename = "INTEGER")]
11726 Integer,
11727 #[serde(rename = "INTEGER_KIND")]
11728 IntegerKind,
11729 #[serde(rename = "INTERFACE")]
11730 Interface,
11731 #[serde(rename = "INTERFACE_KIND")]
11732 InterfaceKind,
11733 #[serde(rename = "LIST")]
11734 List,
11735 #[serde(rename = "LIST_KIND")]
11736 ListKind,
11737 #[serde(rename = "OBJECT")]
11738 Object,
11739 #[serde(rename = "OBJECT_KIND")]
11740 ObjectKind,
11741 #[serde(rename = "SCALAR")]
11742 Scalar,
11743 #[serde(rename = "SCALAR_KIND")]
11744 ScalarKind,
11745 #[serde(rename = "STRING")]
11746 String,
11747 #[serde(rename = "STRING_KIND")]
11748 StringKind,
11749 #[serde(rename = "VOID")]
11750 Void,
11751 #[serde(rename = "VOID_KIND")]
11752 VoidKind,
11753}