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 ChangesetId(pub String);
82impl From<&str> for ChangesetId {
83 fn from(value: &str) -> Self {
84 Self(value.to_string())
85 }
86}
87impl From<String> for ChangesetId {
88 fn from(value: String) -> Self {
89 Self(value)
90 }
91}
92impl IntoID<ChangesetId> for Changeset {
93 fn into_id(
94 self,
95 ) -> std::pin::Pin<
96 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
97 > {
98 Box::pin(async move { self.id().await })
99 }
100}
101impl IntoID<ChangesetId> for ChangesetId {
102 fn into_id(
103 self,
104 ) -> std::pin::Pin<
105 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
106 > {
107 Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
108 }
109}
110impl ChangesetId {
111 fn quote(&self) -> String {
112 format!("\"{}\"", self.0.clone())
113 }
114}
115#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
116pub struct CloudId(pub String);
117impl From<&str> for CloudId {
118 fn from(value: &str) -> Self {
119 Self(value.to_string())
120 }
121}
122impl From<String> for CloudId {
123 fn from(value: String) -> Self {
124 Self(value)
125 }
126}
127impl IntoID<CloudId> for Cloud {
128 fn into_id(
129 self,
130 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
131 {
132 Box::pin(async move { self.id().await })
133 }
134}
135impl IntoID<CloudId> for CloudId {
136 fn into_id(
137 self,
138 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
139 {
140 Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
141 }
142}
143impl CloudId {
144 fn quote(&self) -> String {
145 format!("\"{}\"", self.0.clone())
146 }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct ContainerId(pub String);
150impl From<&str> for ContainerId {
151 fn from(value: &str) -> Self {
152 Self(value.to_string())
153 }
154}
155impl From<String> for ContainerId {
156 fn from(value: String) -> Self {
157 Self(value)
158 }
159}
160impl IntoID<ContainerId> for Container {
161 fn into_id(
162 self,
163 ) -> std::pin::Pin<
164 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
165 > {
166 Box::pin(async move { self.id().await })
167 }
168}
169impl IntoID<ContainerId> for ContainerId {
170 fn into_id(
171 self,
172 ) -> std::pin::Pin<
173 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
174 > {
175 Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
176 }
177}
178impl ContainerId {
179 fn quote(&self) -> String {
180 format!("\"{}\"", self.0.clone())
181 }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct CurrentModuleId(pub String);
185impl From<&str> for CurrentModuleId {
186 fn from(value: &str) -> Self {
187 Self(value.to_string())
188 }
189}
190impl From<String> for CurrentModuleId {
191 fn from(value: String) -> Self {
192 Self(value)
193 }
194}
195impl IntoID<CurrentModuleId> for CurrentModule {
196 fn into_id(
197 self,
198 ) -> std::pin::Pin<
199 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
200 > {
201 Box::pin(async move { self.id().await })
202 }
203}
204impl IntoID<CurrentModuleId> for CurrentModuleId {
205 fn into_id(
206 self,
207 ) -> std::pin::Pin<
208 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
209 > {
210 Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
211 }
212}
213impl CurrentModuleId {
214 fn quote(&self) -> String {
215 format!("\"{}\"", self.0.clone())
216 }
217}
218#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
219pub struct DirectoryId(pub String);
220impl From<&str> for DirectoryId {
221 fn from(value: &str) -> Self {
222 Self(value.to_string())
223 }
224}
225impl From<String> for DirectoryId {
226 fn from(value: String) -> Self {
227 Self(value)
228 }
229}
230impl IntoID<DirectoryId> for Directory {
231 fn into_id(
232 self,
233 ) -> std::pin::Pin<
234 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
235 > {
236 Box::pin(async move { self.id().await })
237 }
238}
239impl IntoID<DirectoryId> for DirectoryId {
240 fn into_id(
241 self,
242 ) -> std::pin::Pin<
243 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
244 > {
245 Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
246 }
247}
248impl DirectoryId {
249 fn quote(&self) -> String {
250 format!("\"{}\"", self.0.clone())
251 }
252}
253#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
254pub struct EngineCacheEntryId(pub String);
255impl From<&str> for EngineCacheEntryId {
256 fn from(value: &str) -> Self {
257 Self(value.to_string())
258 }
259}
260impl From<String> for EngineCacheEntryId {
261 fn from(value: String) -> Self {
262 Self(value)
263 }
264}
265impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
266 fn into_id(
267 self,
268 ) -> std::pin::Pin<
269 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
270 > {
271 Box::pin(async move { self.id().await })
272 }
273}
274impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
275 fn into_id(
276 self,
277 ) -> std::pin::Pin<
278 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
279 > {
280 Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
281 }
282}
283impl EngineCacheEntryId {
284 fn quote(&self) -> String {
285 format!("\"{}\"", self.0.clone())
286 }
287}
288#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
289pub struct EngineCacheEntrySetId(pub String);
290impl From<&str> for EngineCacheEntrySetId {
291 fn from(value: &str) -> Self {
292 Self(value.to_string())
293 }
294}
295impl From<String> for EngineCacheEntrySetId {
296 fn from(value: String) -> Self {
297 Self(value)
298 }
299}
300impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
301 fn into_id(
302 self,
303 ) -> std::pin::Pin<
304 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
305 > {
306 Box::pin(async move { self.id().await })
307 }
308}
309impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
310 fn into_id(
311 self,
312 ) -> std::pin::Pin<
313 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
314 > {
315 Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
316 }
317}
318impl EngineCacheEntrySetId {
319 fn quote(&self) -> String {
320 format!("\"{}\"", self.0.clone())
321 }
322}
323#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
324pub struct EngineCacheId(pub String);
325impl From<&str> for EngineCacheId {
326 fn from(value: &str) -> Self {
327 Self(value.to_string())
328 }
329}
330impl From<String> for EngineCacheId {
331 fn from(value: String) -> Self {
332 Self(value)
333 }
334}
335impl IntoID<EngineCacheId> for EngineCache {
336 fn into_id(
337 self,
338 ) -> std::pin::Pin<
339 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
340 > {
341 Box::pin(async move { self.id().await })
342 }
343}
344impl IntoID<EngineCacheId> for EngineCacheId {
345 fn into_id(
346 self,
347 ) -> std::pin::Pin<
348 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
349 > {
350 Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
351 }
352}
353impl EngineCacheId {
354 fn quote(&self) -> String {
355 format!("\"{}\"", self.0.clone())
356 }
357}
358#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
359pub struct EngineId(pub String);
360impl From<&str> for EngineId {
361 fn from(value: &str) -> Self {
362 Self(value.to_string())
363 }
364}
365impl From<String> for EngineId {
366 fn from(value: String) -> Self {
367 Self(value)
368 }
369}
370impl IntoID<EngineId> for Engine {
371 fn into_id(
372 self,
373 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
374 {
375 Box::pin(async move { self.id().await })
376 }
377}
378impl IntoID<EngineId> for EngineId {
379 fn into_id(
380 self,
381 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
382 {
383 Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
384 }
385}
386impl EngineId {
387 fn quote(&self) -> String {
388 format!("\"{}\"", self.0.clone())
389 }
390}
391#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
392pub struct EnumTypeDefId(pub String);
393impl From<&str> for EnumTypeDefId {
394 fn from(value: &str) -> Self {
395 Self(value.to_string())
396 }
397}
398impl From<String> for EnumTypeDefId {
399 fn from(value: String) -> Self {
400 Self(value)
401 }
402}
403impl IntoID<EnumTypeDefId> for EnumTypeDef {
404 fn into_id(
405 self,
406 ) -> std::pin::Pin<
407 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
408 > {
409 Box::pin(async move { self.id().await })
410 }
411}
412impl IntoID<EnumTypeDefId> for EnumTypeDefId {
413 fn into_id(
414 self,
415 ) -> std::pin::Pin<
416 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
417 > {
418 Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
419 }
420}
421impl EnumTypeDefId {
422 fn quote(&self) -> String {
423 format!("\"{}\"", self.0.clone())
424 }
425}
426#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
427pub struct EnumValueTypeDefId(pub String);
428impl From<&str> for EnumValueTypeDefId {
429 fn from(value: &str) -> Self {
430 Self(value.to_string())
431 }
432}
433impl From<String> for EnumValueTypeDefId {
434 fn from(value: String) -> Self {
435 Self(value)
436 }
437}
438impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
439 fn into_id(
440 self,
441 ) -> std::pin::Pin<
442 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
443 > {
444 Box::pin(async move { self.id().await })
445 }
446}
447impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
448 fn into_id(
449 self,
450 ) -> std::pin::Pin<
451 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
452 > {
453 Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
454 }
455}
456impl EnumValueTypeDefId {
457 fn quote(&self) -> String {
458 format!("\"{}\"", self.0.clone())
459 }
460}
461#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
462pub struct EnvFileId(pub String);
463impl From<&str> for EnvFileId {
464 fn from(value: &str) -> Self {
465 Self(value.to_string())
466 }
467}
468impl From<String> for EnvFileId {
469 fn from(value: String) -> Self {
470 Self(value)
471 }
472}
473impl IntoID<EnvFileId> for EnvFile {
474 fn into_id(
475 self,
476 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
477 {
478 Box::pin(async move { self.id().await })
479 }
480}
481impl IntoID<EnvFileId> for EnvFileId {
482 fn into_id(
483 self,
484 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
485 {
486 Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
487 }
488}
489impl EnvFileId {
490 fn quote(&self) -> String {
491 format!("\"{}\"", self.0.clone())
492 }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct EnvId(pub String);
496impl From<&str> for EnvId {
497 fn from(value: &str) -> Self {
498 Self(value.to_string())
499 }
500}
501impl From<String> for EnvId {
502 fn from(value: String) -> Self {
503 Self(value)
504 }
505}
506impl IntoID<EnvId> for Env {
507 fn into_id(
508 self,
509 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
510 {
511 Box::pin(async move { self.id().await })
512 }
513}
514impl IntoID<EnvId> for EnvId {
515 fn into_id(
516 self,
517 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
518 {
519 Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
520 }
521}
522impl EnvId {
523 fn quote(&self) -> String {
524 format!("\"{}\"", self.0.clone())
525 }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EnvVariableId(pub String);
529impl From<&str> for EnvVariableId {
530 fn from(value: &str) -> Self {
531 Self(value.to_string())
532 }
533}
534impl From<String> for EnvVariableId {
535 fn from(value: String) -> Self {
536 Self(value)
537 }
538}
539impl IntoID<EnvVariableId> for EnvVariable {
540 fn into_id(
541 self,
542 ) -> std::pin::Pin<
543 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
544 > {
545 Box::pin(async move { self.id().await })
546 }
547}
548impl IntoID<EnvVariableId> for EnvVariableId {
549 fn into_id(
550 self,
551 ) -> std::pin::Pin<
552 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
553 > {
554 Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
555 }
556}
557impl EnvVariableId {
558 fn quote(&self) -> String {
559 format!("\"{}\"", self.0.clone())
560 }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct ErrorId(pub String);
564impl From<&str> for ErrorId {
565 fn from(value: &str) -> Self {
566 Self(value.to_string())
567 }
568}
569impl From<String> for ErrorId {
570 fn from(value: String) -> Self {
571 Self(value)
572 }
573}
574impl IntoID<ErrorId> for Error {
575 fn into_id(
576 self,
577 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
578 {
579 Box::pin(async move { self.id().await })
580 }
581}
582impl IntoID<ErrorId> for ErrorId {
583 fn into_id(
584 self,
585 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
586 {
587 Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
588 }
589}
590impl ErrorId {
591 fn quote(&self) -> String {
592 format!("\"{}\"", self.0.clone())
593 }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct ErrorValueId(pub String);
597impl From<&str> for ErrorValueId {
598 fn from(value: &str) -> Self {
599 Self(value.to_string())
600 }
601}
602impl From<String> for ErrorValueId {
603 fn from(value: String) -> Self {
604 Self(value)
605 }
606}
607impl IntoID<ErrorValueId> for ErrorValue {
608 fn into_id(
609 self,
610 ) -> std::pin::Pin<
611 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
612 > {
613 Box::pin(async move { self.id().await })
614 }
615}
616impl IntoID<ErrorValueId> for ErrorValueId {
617 fn into_id(
618 self,
619 ) -> std::pin::Pin<
620 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
621 > {
622 Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
623 }
624}
625impl ErrorValueId {
626 fn quote(&self) -> String {
627 format!("\"{}\"", self.0.clone())
628 }
629}
630#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
631pub struct FieldTypeDefId(pub String);
632impl From<&str> for FieldTypeDefId {
633 fn from(value: &str) -> Self {
634 Self(value.to_string())
635 }
636}
637impl From<String> for FieldTypeDefId {
638 fn from(value: String) -> Self {
639 Self(value)
640 }
641}
642impl IntoID<FieldTypeDefId> for FieldTypeDef {
643 fn into_id(
644 self,
645 ) -> std::pin::Pin<
646 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
647 > {
648 Box::pin(async move { self.id().await })
649 }
650}
651impl IntoID<FieldTypeDefId> for FieldTypeDefId {
652 fn into_id(
653 self,
654 ) -> std::pin::Pin<
655 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
656 > {
657 Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
658 }
659}
660impl FieldTypeDefId {
661 fn quote(&self) -> String {
662 format!("\"{}\"", self.0.clone())
663 }
664}
665#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
666pub struct FileId(pub String);
667impl From<&str> for FileId {
668 fn from(value: &str) -> Self {
669 Self(value.to_string())
670 }
671}
672impl From<String> for FileId {
673 fn from(value: String) -> Self {
674 Self(value)
675 }
676}
677impl IntoID<FileId> for File {
678 fn into_id(
679 self,
680 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
681 {
682 Box::pin(async move { self.id().await })
683 }
684}
685impl IntoID<FileId> for FileId {
686 fn into_id(
687 self,
688 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
689 {
690 Box::pin(async move { Ok::<FileId, DaggerError>(self) })
691 }
692}
693impl FileId {
694 fn quote(&self) -> String {
695 format!("\"{}\"", self.0.clone())
696 }
697}
698#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
699pub struct FunctionArgId(pub String);
700impl From<&str> for FunctionArgId {
701 fn from(value: &str) -> Self {
702 Self(value.to_string())
703 }
704}
705impl From<String> for FunctionArgId {
706 fn from(value: String) -> Self {
707 Self(value)
708 }
709}
710impl IntoID<FunctionArgId> for FunctionArg {
711 fn into_id(
712 self,
713 ) -> std::pin::Pin<
714 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
715 > {
716 Box::pin(async move { self.id().await })
717 }
718}
719impl IntoID<FunctionArgId> for FunctionArgId {
720 fn into_id(
721 self,
722 ) -> std::pin::Pin<
723 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
724 > {
725 Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
726 }
727}
728impl FunctionArgId {
729 fn quote(&self) -> String {
730 format!("\"{}\"", self.0.clone())
731 }
732}
733#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
734pub struct FunctionCallArgValueId(pub String);
735impl From<&str> for FunctionCallArgValueId {
736 fn from(value: &str) -> Self {
737 Self(value.to_string())
738 }
739}
740impl From<String> for FunctionCallArgValueId {
741 fn from(value: String) -> Self {
742 Self(value)
743 }
744}
745impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
746 fn into_id(
747 self,
748 ) -> std::pin::Pin<
749 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
750 > {
751 Box::pin(async move { self.id().await })
752 }
753}
754impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
755 fn into_id(
756 self,
757 ) -> std::pin::Pin<
758 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
759 > {
760 Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
761 }
762}
763impl FunctionCallArgValueId {
764 fn quote(&self) -> String {
765 format!("\"{}\"", self.0.clone())
766 }
767}
768#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
769pub struct FunctionCallId(pub String);
770impl From<&str> for FunctionCallId {
771 fn from(value: &str) -> Self {
772 Self(value.to_string())
773 }
774}
775impl From<String> for FunctionCallId {
776 fn from(value: String) -> Self {
777 Self(value)
778 }
779}
780impl IntoID<FunctionCallId> for FunctionCall {
781 fn into_id(
782 self,
783 ) -> std::pin::Pin<
784 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
785 > {
786 Box::pin(async move { self.id().await })
787 }
788}
789impl IntoID<FunctionCallId> for FunctionCallId {
790 fn into_id(
791 self,
792 ) -> std::pin::Pin<
793 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
794 > {
795 Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
796 }
797}
798impl FunctionCallId {
799 fn quote(&self) -> String {
800 format!("\"{}\"", self.0.clone())
801 }
802}
803#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
804pub struct FunctionId(pub String);
805impl From<&str> for FunctionId {
806 fn from(value: &str) -> Self {
807 Self(value.to_string())
808 }
809}
810impl From<String> for FunctionId {
811 fn from(value: String) -> Self {
812 Self(value)
813 }
814}
815impl IntoID<FunctionId> for Function {
816 fn into_id(
817 self,
818 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
819 {
820 Box::pin(async move { self.id().await })
821 }
822}
823impl IntoID<FunctionId> for FunctionId {
824 fn into_id(
825 self,
826 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
827 {
828 Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
829 }
830}
831impl FunctionId {
832 fn quote(&self) -> String {
833 format!("\"{}\"", self.0.clone())
834 }
835}
836#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
837pub struct GeneratedCodeId(pub String);
838impl From<&str> for GeneratedCodeId {
839 fn from(value: &str) -> Self {
840 Self(value.to_string())
841 }
842}
843impl From<String> for GeneratedCodeId {
844 fn from(value: String) -> Self {
845 Self(value)
846 }
847}
848impl IntoID<GeneratedCodeId> for GeneratedCode {
849 fn into_id(
850 self,
851 ) -> std::pin::Pin<
852 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
853 > {
854 Box::pin(async move { self.id().await })
855 }
856}
857impl IntoID<GeneratedCodeId> for GeneratedCodeId {
858 fn into_id(
859 self,
860 ) -> std::pin::Pin<
861 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
862 > {
863 Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
864 }
865}
866impl GeneratedCodeId {
867 fn quote(&self) -> String {
868 format!("\"{}\"", self.0.clone())
869 }
870}
871#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
872pub struct GitRefId(pub String);
873impl From<&str> for GitRefId {
874 fn from(value: &str) -> Self {
875 Self(value.to_string())
876 }
877}
878impl From<String> for GitRefId {
879 fn from(value: String) -> Self {
880 Self(value)
881 }
882}
883impl IntoID<GitRefId> for GitRef {
884 fn into_id(
885 self,
886 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
887 {
888 Box::pin(async move { self.id().await })
889 }
890}
891impl IntoID<GitRefId> for GitRefId {
892 fn into_id(
893 self,
894 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
895 {
896 Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
897 }
898}
899impl GitRefId {
900 fn quote(&self) -> String {
901 format!("\"{}\"", self.0.clone())
902 }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct GitRepositoryId(pub String);
906impl From<&str> for GitRepositoryId {
907 fn from(value: &str) -> Self {
908 Self(value.to_string())
909 }
910}
911impl From<String> for GitRepositoryId {
912 fn from(value: String) -> Self {
913 Self(value)
914 }
915}
916impl IntoID<GitRepositoryId> for GitRepository {
917 fn into_id(
918 self,
919 ) -> std::pin::Pin<
920 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
921 > {
922 Box::pin(async move { self.id().await })
923 }
924}
925impl IntoID<GitRepositoryId> for GitRepositoryId {
926 fn into_id(
927 self,
928 ) -> std::pin::Pin<
929 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
930 > {
931 Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
932 }
933}
934impl GitRepositoryId {
935 fn quote(&self) -> String {
936 format!("\"{}\"", self.0.clone())
937 }
938}
939#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
940pub struct HostId(pub String);
941impl From<&str> for HostId {
942 fn from(value: &str) -> Self {
943 Self(value.to_string())
944 }
945}
946impl From<String> for HostId {
947 fn from(value: String) -> Self {
948 Self(value)
949 }
950}
951impl IntoID<HostId> for Host {
952 fn into_id(
953 self,
954 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
955 {
956 Box::pin(async move { self.id().await })
957 }
958}
959impl IntoID<HostId> for HostId {
960 fn into_id(
961 self,
962 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
963 {
964 Box::pin(async move { Ok::<HostId, DaggerError>(self) })
965 }
966}
967impl HostId {
968 fn quote(&self) -> String {
969 format!("\"{}\"", self.0.clone())
970 }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct InputTypeDefId(pub String);
974impl From<&str> for InputTypeDefId {
975 fn from(value: &str) -> Self {
976 Self(value.to_string())
977 }
978}
979impl From<String> for InputTypeDefId {
980 fn from(value: String) -> Self {
981 Self(value)
982 }
983}
984impl IntoID<InputTypeDefId> for InputTypeDef {
985 fn into_id(
986 self,
987 ) -> std::pin::Pin<
988 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
989 > {
990 Box::pin(async move { self.id().await })
991 }
992}
993impl IntoID<InputTypeDefId> for InputTypeDefId {
994 fn into_id(
995 self,
996 ) -> std::pin::Pin<
997 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
998 > {
999 Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1000 }
1001}
1002impl InputTypeDefId {
1003 fn quote(&self) -> String {
1004 format!("\"{}\"", self.0.clone())
1005 }
1006}
1007#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1008pub struct InterfaceTypeDefId(pub String);
1009impl From<&str> for InterfaceTypeDefId {
1010 fn from(value: &str) -> Self {
1011 Self(value.to_string())
1012 }
1013}
1014impl From<String> for InterfaceTypeDefId {
1015 fn from(value: String) -> Self {
1016 Self(value)
1017 }
1018}
1019impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1020 fn into_id(
1021 self,
1022 ) -> std::pin::Pin<
1023 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1024 > {
1025 Box::pin(async move { self.id().await })
1026 }
1027}
1028impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1029 fn into_id(
1030 self,
1031 ) -> std::pin::Pin<
1032 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1033 > {
1034 Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1035 }
1036}
1037impl InterfaceTypeDefId {
1038 fn quote(&self) -> String {
1039 format!("\"{}\"", self.0.clone())
1040 }
1041}
1042#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1043pub struct Json(pub String);
1044impl From<&str> for Json {
1045 fn from(value: &str) -> Self {
1046 Self(value.to_string())
1047 }
1048}
1049impl From<String> for Json {
1050 fn from(value: String) -> Self {
1051 Self(value)
1052 }
1053}
1054impl Json {
1055 fn quote(&self) -> String {
1056 format!("\"{}\"", self.0.clone())
1057 }
1058}
1059#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1060pub struct JsonValueId(pub String);
1061impl From<&str> for JsonValueId {
1062 fn from(value: &str) -> Self {
1063 Self(value.to_string())
1064 }
1065}
1066impl From<String> for JsonValueId {
1067 fn from(value: String) -> Self {
1068 Self(value)
1069 }
1070}
1071impl IntoID<JsonValueId> for JsonValue {
1072 fn into_id(
1073 self,
1074 ) -> std::pin::Pin<
1075 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1076 > {
1077 Box::pin(async move { self.id().await })
1078 }
1079}
1080impl IntoID<JsonValueId> for JsonValueId {
1081 fn into_id(
1082 self,
1083 ) -> std::pin::Pin<
1084 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1085 > {
1086 Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1087 }
1088}
1089impl JsonValueId {
1090 fn quote(&self) -> String {
1091 format!("\"{}\"", self.0.clone())
1092 }
1093}
1094#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1095pub struct Llmid(pub String);
1096impl From<&str> for Llmid {
1097 fn from(value: &str) -> Self {
1098 Self(value.to_string())
1099 }
1100}
1101impl From<String> for Llmid {
1102 fn from(value: String) -> Self {
1103 Self(value)
1104 }
1105}
1106impl IntoID<Llmid> for Llm {
1107 fn into_id(
1108 self,
1109 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1110 {
1111 Box::pin(async move { self.id().await })
1112 }
1113}
1114impl IntoID<Llmid> for Llmid {
1115 fn into_id(
1116 self,
1117 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1118 {
1119 Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1120 }
1121}
1122impl Llmid {
1123 fn quote(&self) -> String {
1124 format!("\"{}\"", self.0.clone())
1125 }
1126}
1127#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1128pub struct LlmTokenUsageId(pub String);
1129impl From<&str> for LlmTokenUsageId {
1130 fn from(value: &str) -> Self {
1131 Self(value.to_string())
1132 }
1133}
1134impl From<String> for LlmTokenUsageId {
1135 fn from(value: String) -> Self {
1136 Self(value)
1137 }
1138}
1139impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1140 fn into_id(
1141 self,
1142 ) -> std::pin::Pin<
1143 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1144 > {
1145 Box::pin(async move { self.id().await })
1146 }
1147}
1148impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1149 fn into_id(
1150 self,
1151 ) -> std::pin::Pin<
1152 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1153 > {
1154 Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1155 }
1156}
1157impl LlmTokenUsageId {
1158 fn quote(&self) -> String {
1159 format!("\"{}\"", self.0.clone())
1160 }
1161}
1162#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1163pub struct LabelId(pub String);
1164impl From<&str> for LabelId {
1165 fn from(value: &str) -> Self {
1166 Self(value.to_string())
1167 }
1168}
1169impl From<String> for LabelId {
1170 fn from(value: String) -> Self {
1171 Self(value)
1172 }
1173}
1174impl IntoID<LabelId> for Label {
1175 fn into_id(
1176 self,
1177 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1178 {
1179 Box::pin(async move { self.id().await })
1180 }
1181}
1182impl IntoID<LabelId> for LabelId {
1183 fn into_id(
1184 self,
1185 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1186 {
1187 Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1188 }
1189}
1190impl LabelId {
1191 fn quote(&self) -> String {
1192 format!("\"{}\"", self.0.clone())
1193 }
1194}
1195#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1196pub struct ListTypeDefId(pub String);
1197impl From<&str> for ListTypeDefId {
1198 fn from(value: &str) -> Self {
1199 Self(value.to_string())
1200 }
1201}
1202impl From<String> for ListTypeDefId {
1203 fn from(value: String) -> Self {
1204 Self(value)
1205 }
1206}
1207impl IntoID<ListTypeDefId> for ListTypeDef {
1208 fn into_id(
1209 self,
1210 ) -> std::pin::Pin<
1211 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1212 > {
1213 Box::pin(async move { self.id().await })
1214 }
1215}
1216impl IntoID<ListTypeDefId> for ListTypeDefId {
1217 fn into_id(
1218 self,
1219 ) -> std::pin::Pin<
1220 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1221 > {
1222 Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1223 }
1224}
1225impl ListTypeDefId {
1226 fn quote(&self) -> String {
1227 format!("\"{}\"", self.0.clone())
1228 }
1229}
1230#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1231pub struct ModuleConfigClientId(pub String);
1232impl From<&str> for ModuleConfigClientId {
1233 fn from(value: &str) -> Self {
1234 Self(value.to_string())
1235 }
1236}
1237impl From<String> for ModuleConfigClientId {
1238 fn from(value: String) -> Self {
1239 Self(value)
1240 }
1241}
1242impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1243 fn into_id(
1244 self,
1245 ) -> std::pin::Pin<
1246 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1247 > {
1248 Box::pin(async move { self.id().await })
1249 }
1250}
1251impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1252 fn into_id(
1253 self,
1254 ) -> std::pin::Pin<
1255 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1256 > {
1257 Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1258 }
1259}
1260impl ModuleConfigClientId {
1261 fn quote(&self) -> String {
1262 format!("\"{}\"", self.0.clone())
1263 }
1264}
1265#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1266pub struct ModuleId(pub String);
1267impl From<&str> for ModuleId {
1268 fn from(value: &str) -> Self {
1269 Self(value.to_string())
1270 }
1271}
1272impl From<String> for ModuleId {
1273 fn from(value: String) -> Self {
1274 Self(value)
1275 }
1276}
1277impl IntoID<ModuleId> for Module {
1278 fn into_id(
1279 self,
1280 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1281 {
1282 Box::pin(async move { self.id().await })
1283 }
1284}
1285impl IntoID<ModuleId> for ModuleId {
1286 fn into_id(
1287 self,
1288 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1289 {
1290 Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1291 }
1292}
1293impl ModuleId {
1294 fn quote(&self) -> String {
1295 format!("\"{}\"", self.0.clone())
1296 }
1297}
1298#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1299pub struct ModuleSourceId(pub String);
1300impl From<&str> for ModuleSourceId {
1301 fn from(value: &str) -> Self {
1302 Self(value.to_string())
1303 }
1304}
1305impl From<String> for ModuleSourceId {
1306 fn from(value: String) -> Self {
1307 Self(value)
1308 }
1309}
1310impl IntoID<ModuleSourceId> for ModuleSource {
1311 fn into_id(
1312 self,
1313 ) -> std::pin::Pin<
1314 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1315 > {
1316 Box::pin(async move { self.id().await })
1317 }
1318}
1319impl IntoID<ModuleSourceId> for ModuleSourceId {
1320 fn into_id(
1321 self,
1322 ) -> std::pin::Pin<
1323 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1324 > {
1325 Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1326 }
1327}
1328impl ModuleSourceId {
1329 fn quote(&self) -> String {
1330 format!("\"{}\"", self.0.clone())
1331 }
1332}
1333#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1334pub struct ObjectTypeDefId(pub String);
1335impl From<&str> for ObjectTypeDefId {
1336 fn from(value: &str) -> Self {
1337 Self(value.to_string())
1338 }
1339}
1340impl From<String> for ObjectTypeDefId {
1341 fn from(value: String) -> Self {
1342 Self(value)
1343 }
1344}
1345impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1346 fn into_id(
1347 self,
1348 ) -> std::pin::Pin<
1349 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1350 > {
1351 Box::pin(async move { self.id().await })
1352 }
1353}
1354impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1355 fn into_id(
1356 self,
1357 ) -> std::pin::Pin<
1358 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1359 > {
1360 Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1361 }
1362}
1363impl ObjectTypeDefId {
1364 fn quote(&self) -> String {
1365 format!("\"{}\"", self.0.clone())
1366 }
1367}
1368#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1369pub struct Platform(pub String);
1370impl From<&str> for Platform {
1371 fn from(value: &str) -> Self {
1372 Self(value.to_string())
1373 }
1374}
1375impl From<String> for Platform {
1376 fn from(value: String) -> Self {
1377 Self(value)
1378 }
1379}
1380impl Platform {
1381 fn quote(&self) -> String {
1382 format!("\"{}\"", self.0.clone())
1383 }
1384}
1385#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1386pub struct PortId(pub String);
1387impl From<&str> for PortId {
1388 fn from(value: &str) -> Self {
1389 Self(value.to_string())
1390 }
1391}
1392impl From<String> for PortId {
1393 fn from(value: String) -> Self {
1394 Self(value)
1395 }
1396}
1397impl IntoID<PortId> for Port {
1398 fn into_id(
1399 self,
1400 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1401 {
1402 Box::pin(async move { self.id().await })
1403 }
1404}
1405impl IntoID<PortId> for PortId {
1406 fn into_id(
1407 self,
1408 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1409 {
1410 Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1411 }
1412}
1413impl PortId {
1414 fn quote(&self) -> String {
1415 format!("\"{}\"", self.0.clone())
1416 }
1417}
1418#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1419pub struct SdkConfigId(pub String);
1420impl From<&str> for SdkConfigId {
1421 fn from(value: &str) -> Self {
1422 Self(value.to_string())
1423 }
1424}
1425impl From<String> for SdkConfigId {
1426 fn from(value: String) -> Self {
1427 Self(value)
1428 }
1429}
1430impl IntoID<SdkConfigId> for SdkConfig {
1431 fn into_id(
1432 self,
1433 ) -> std::pin::Pin<
1434 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1435 > {
1436 Box::pin(async move { self.id().await })
1437 }
1438}
1439impl IntoID<SdkConfigId> for SdkConfigId {
1440 fn into_id(
1441 self,
1442 ) -> std::pin::Pin<
1443 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1444 > {
1445 Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1446 }
1447}
1448impl SdkConfigId {
1449 fn quote(&self) -> String {
1450 format!("\"{}\"", self.0.clone())
1451 }
1452}
1453#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1454pub struct ScalarTypeDefId(pub String);
1455impl From<&str> for ScalarTypeDefId {
1456 fn from(value: &str) -> Self {
1457 Self(value.to_string())
1458 }
1459}
1460impl From<String> for ScalarTypeDefId {
1461 fn from(value: String) -> Self {
1462 Self(value)
1463 }
1464}
1465impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1466 fn into_id(
1467 self,
1468 ) -> std::pin::Pin<
1469 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1470 > {
1471 Box::pin(async move { self.id().await })
1472 }
1473}
1474impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1475 fn into_id(
1476 self,
1477 ) -> std::pin::Pin<
1478 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1479 > {
1480 Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1481 }
1482}
1483impl ScalarTypeDefId {
1484 fn quote(&self) -> String {
1485 format!("\"{}\"", self.0.clone())
1486 }
1487}
1488#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1489pub struct SearchResultId(pub String);
1490impl From<&str> for SearchResultId {
1491 fn from(value: &str) -> Self {
1492 Self(value.to_string())
1493 }
1494}
1495impl From<String> for SearchResultId {
1496 fn from(value: String) -> Self {
1497 Self(value)
1498 }
1499}
1500impl IntoID<SearchResultId> for SearchResult {
1501 fn into_id(
1502 self,
1503 ) -> std::pin::Pin<
1504 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1505 > {
1506 Box::pin(async move { self.id().await })
1507 }
1508}
1509impl IntoID<SearchResultId> for SearchResultId {
1510 fn into_id(
1511 self,
1512 ) -> std::pin::Pin<
1513 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1514 > {
1515 Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1516 }
1517}
1518impl SearchResultId {
1519 fn quote(&self) -> String {
1520 format!("\"{}\"", self.0.clone())
1521 }
1522}
1523#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1524pub struct SearchSubmatchId(pub String);
1525impl From<&str> for SearchSubmatchId {
1526 fn from(value: &str) -> Self {
1527 Self(value.to_string())
1528 }
1529}
1530impl From<String> for SearchSubmatchId {
1531 fn from(value: String) -> Self {
1532 Self(value)
1533 }
1534}
1535impl IntoID<SearchSubmatchId> for SearchSubmatch {
1536 fn into_id(
1537 self,
1538 ) -> std::pin::Pin<
1539 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1540 > {
1541 Box::pin(async move { self.id().await })
1542 }
1543}
1544impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1545 fn into_id(
1546 self,
1547 ) -> std::pin::Pin<
1548 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1549 > {
1550 Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1551 }
1552}
1553impl SearchSubmatchId {
1554 fn quote(&self) -> String {
1555 format!("\"{}\"", self.0.clone())
1556 }
1557}
1558#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1559pub struct SecretId(pub String);
1560impl From<&str> for SecretId {
1561 fn from(value: &str) -> Self {
1562 Self(value.to_string())
1563 }
1564}
1565impl From<String> for SecretId {
1566 fn from(value: String) -> Self {
1567 Self(value)
1568 }
1569}
1570impl IntoID<SecretId> for Secret {
1571 fn into_id(
1572 self,
1573 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1574 {
1575 Box::pin(async move { self.id().await })
1576 }
1577}
1578impl IntoID<SecretId> for SecretId {
1579 fn into_id(
1580 self,
1581 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1582 {
1583 Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1584 }
1585}
1586impl SecretId {
1587 fn quote(&self) -> String {
1588 format!("\"{}\"", self.0.clone())
1589 }
1590}
1591#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1592pub struct ServiceId(pub String);
1593impl From<&str> for ServiceId {
1594 fn from(value: &str) -> Self {
1595 Self(value.to_string())
1596 }
1597}
1598impl From<String> for ServiceId {
1599 fn from(value: String) -> Self {
1600 Self(value)
1601 }
1602}
1603impl IntoID<ServiceId> for Service {
1604 fn into_id(
1605 self,
1606 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1607 {
1608 Box::pin(async move { self.id().await })
1609 }
1610}
1611impl IntoID<ServiceId> for ServiceId {
1612 fn into_id(
1613 self,
1614 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1615 {
1616 Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1617 }
1618}
1619impl ServiceId {
1620 fn quote(&self) -> String {
1621 format!("\"{}\"", self.0.clone())
1622 }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct SocketId(pub String);
1626impl From<&str> for SocketId {
1627 fn from(value: &str) -> Self {
1628 Self(value.to_string())
1629 }
1630}
1631impl From<String> for SocketId {
1632 fn from(value: String) -> Self {
1633 Self(value)
1634 }
1635}
1636impl IntoID<SocketId> for Socket {
1637 fn into_id(
1638 self,
1639 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1640 {
1641 Box::pin(async move { self.id().await })
1642 }
1643}
1644impl IntoID<SocketId> for SocketId {
1645 fn into_id(
1646 self,
1647 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1648 {
1649 Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1650 }
1651}
1652impl SocketId {
1653 fn quote(&self) -> String {
1654 format!("\"{}\"", self.0.clone())
1655 }
1656}
1657#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1658pub struct SourceMapId(pub String);
1659impl From<&str> for SourceMapId {
1660 fn from(value: &str) -> Self {
1661 Self(value.to_string())
1662 }
1663}
1664impl From<String> for SourceMapId {
1665 fn from(value: String) -> Self {
1666 Self(value)
1667 }
1668}
1669impl IntoID<SourceMapId> for SourceMap {
1670 fn into_id(
1671 self,
1672 ) -> std::pin::Pin<
1673 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1674 > {
1675 Box::pin(async move { self.id().await })
1676 }
1677}
1678impl IntoID<SourceMapId> for SourceMapId {
1679 fn into_id(
1680 self,
1681 ) -> std::pin::Pin<
1682 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1683 > {
1684 Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1685 }
1686}
1687impl SourceMapId {
1688 fn quote(&self) -> String {
1689 format!("\"{}\"", self.0.clone())
1690 }
1691}
1692#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1693pub struct TerminalId(pub String);
1694impl From<&str> for TerminalId {
1695 fn from(value: &str) -> Self {
1696 Self(value.to_string())
1697 }
1698}
1699impl From<String> for TerminalId {
1700 fn from(value: String) -> Self {
1701 Self(value)
1702 }
1703}
1704impl IntoID<TerminalId> for Terminal {
1705 fn into_id(
1706 self,
1707 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1708 {
1709 Box::pin(async move { self.id().await })
1710 }
1711}
1712impl IntoID<TerminalId> for TerminalId {
1713 fn into_id(
1714 self,
1715 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1716 {
1717 Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1718 }
1719}
1720impl TerminalId {
1721 fn quote(&self) -> String {
1722 format!("\"{}\"", self.0.clone())
1723 }
1724}
1725#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1726pub struct TypeDefId(pub String);
1727impl From<&str> for TypeDefId {
1728 fn from(value: &str) -> Self {
1729 Self(value.to_string())
1730 }
1731}
1732impl From<String> for TypeDefId {
1733 fn from(value: String) -> Self {
1734 Self(value)
1735 }
1736}
1737impl IntoID<TypeDefId> for TypeDef {
1738 fn into_id(
1739 self,
1740 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1741 {
1742 Box::pin(async move { self.id().await })
1743 }
1744}
1745impl IntoID<TypeDefId> for TypeDefId {
1746 fn into_id(
1747 self,
1748 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1749 {
1750 Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1751 }
1752}
1753impl TypeDefId {
1754 fn quote(&self) -> String {
1755 format!("\"{}\"", self.0.clone())
1756 }
1757}
1758#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1759pub struct Void(pub String);
1760impl From<&str> for Void {
1761 fn from(value: &str) -> Self {
1762 Self(value.to_string())
1763 }
1764}
1765impl From<String> for Void {
1766 fn from(value: String) -> Self {
1767 Self(value)
1768 }
1769}
1770impl Void {
1771 fn quote(&self) -> String {
1772 format!("\"{}\"", self.0.clone())
1773 }
1774}
1775#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1776pub struct BuildArg {
1777 pub name: String,
1778 pub value: String,
1779}
1780#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1781pub struct PipelineLabel {
1782 pub name: String,
1783 pub value: String,
1784}
1785#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1786pub struct PortForward {
1787 pub backend: isize,
1788 pub frontend: isize,
1789 pub protocol: NetworkProtocol,
1790}
1791#[derive(Clone)]
1792pub struct Binding {
1793 pub proc: Option<Arc<DaggerSessionProc>>,
1794 pub selection: Selection,
1795 pub graphql_client: DynGraphQLClient,
1796}
1797impl Binding {
1798 pub fn as_cache_volume(&self) -> CacheVolume {
1800 let query = self.selection.select("asCacheVolume");
1801 CacheVolume {
1802 proc: self.proc.clone(),
1803 selection: query,
1804 graphql_client: self.graphql_client.clone(),
1805 }
1806 }
1807 pub fn as_changeset(&self) -> Changeset {
1809 let query = self.selection.select("asChangeset");
1810 Changeset {
1811 proc: self.proc.clone(),
1812 selection: query,
1813 graphql_client: self.graphql_client.clone(),
1814 }
1815 }
1816 pub fn as_cloud(&self) -> Cloud {
1818 let query = self.selection.select("asCloud");
1819 Cloud {
1820 proc: self.proc.clone(),
1821 selection: query,
1822 graphql_client: self.graphql_client.clone(),
1823 }
1824 }
1825 pub fn as_container(&self) -> Container {
1827 let query = self.selection.select("asContainer");
1828 Container {
1829 proc: self.proc.clone(),
1830 selection: query,
1831 graphql_client: self.graphql_client.clone(),
1832 }
1833 }
1834 pub fn as_directory(&self) -> Directory {
1836 let query = self.selection.select("asDirectory");
1837 Directory {
1838 proc: self.proc.clone(),
1839 selection: query,
1840 graphql_client: self.graphql_client.clone(),
1841 }
1842 }
1843 pub fn as_env(&self) -> Env {
1845 let query = self.selection.select("asEnv");
1846 Env {
1847 proc: self.proc.clone(),
1848 selection: query,
1849 graphql_client: self.graphql_client.clone(),
1850 }
1851 }
1852 pub fn as_env_file(&self) -> EnvFile {
1854 let query = self.selection.select("asEnvFile");
1855 EnvFile {
1856 proc: self.proc.clone(),
1857 selection: query,
1858 graphql_client: self.graphql_client.clone(),
1859 }
1860 }
1861 pub fn as_file(&self) -> File {
1863 let query = self.selection.select("asFile");
1864 File {
1865 proc: self.proc.clone(),
1866 selection: query,
1867 graphql_client: self.graphql_client.clone(),
1868 }
1869 }
1870 pub fn as_git_ref(&self) -> GitRef {
1872 let query = self.selection.select("asGitRef");
1873 GitRef {
1874 proc: self.proc.clone(),
1875 selection: query,
1876 graphql_client: self.graphql_client.clone(),
1877 }
1878 }
1879 pub fn as_git_repository(&self) -> GitRepository {
1881 let query = self.selection.select("asGitRepository");
1882 GitRepository {
1883 proc: self.proc.clone(),
1884 selection: query,
1885 graphql_client: self.graphql_client.clone(),
1886 }
1887 }
1888 pub fn as_json_value(&self) -> JsonValue {
1890 let query = self.selection.select("asJSONValue");
1891 JsonValue {
1892 proc: self.proc.clone(),
1893 selection: query,
1894 graphql_client: self.graphql_client.clone(),
1895 }
1896 }
1897 pub fn as_llm(&self) -> Llm {
1899 let query = self.selection.select("asLLM");
1900 Llm {
1901 proc: self.proc.clone(),
1902 selection: query,
1903 graphql_client: self.graphql_client.clone(),
1904 }
1905 }
1906 pub fn as_module(&self) -> Module {
1908 let query = self.selection.select("asModule");
1909 Module {
1910 proc: self.proc.clone(),
1911 selection: query,
1912 graphql_client: self.graphql_client.clone(),
1913 }
1914 }
1915 pub fn as_module_config_client(&self) -> ModuleConfigClient {
1917 let query = self.selection.select("asModuleConfigClient");
1918 ModuleConfigClient {
1919 proc: self.proc.clone(),
1920 selection: query,
1921 graphql_client: self.graphql_client.clone(),
1922 }
1923 }
1924 pub fn as_module_source(&self) -> ModuleSource {
1926 let query = self.selection.select("asModuleSource");
1927 ModuleSource {
1928 proc: self.proc.clone(),
1929 selection: query,
1930 graphql_client: self.graphql_client.clone(),
1931 }
1932 }
1933 pub fn as_search_result(&self) -> SearchResult {
1935 let query = self.selection.select("asSearchResult");
1936 SearchResult {
1937 proc: self.proc.clone(),
1938 selection: query,
1939 graphql_client: self.graphql_client.clone(),
1940 }
1941 }
1942 pub fn as_search_submatch(&self) -> SearchSubmatch {
1944 let query = self.selection.select("asSearchSubmatch");
1945 SearchSubmatch {
1946 proc: self.proc.clone(),
1947 selection: query,
1948 graphql_client: self.graphql_client.clone(),
1949 }
1950 }
1951 pub fn as_secret(&self) -> Secret {
1953 let query = self.selection.select("asSecret");
1954 Secret {
1955 proc: self.proc.clone(),
1956 selection: query,
1957 graphql_client: self.graphql_client.clone(),
1958 }
1959 }
1960 pub fn as_service(&self) -> Service {
1962 let query = self.selection.select("asService");
1963 Service {
1964 proc: self.proc.clone(),
1965 selection: query,
1966 graphql_client: self.graphql_client.clone(),
1967 }
1968 }
1969 pub fn as_socket(&self) -> Socket {
1971 let query = self.selection.select("asSocket");
1972 Socket {
1973 proc: self.proc.clone(),
1974 selection: query,
1975 graphql_client: self.graphql_client.clone(),
1976 }
1977 }
1978 pub async fn as_string(&self) -> Result<String, DaggerError> {
1980 let query = self.selection.select("asString");
1981 query.execute(self.graphql_client.clone()).await
1982 }
1983 pub async fn digest(&self) -> Result<String, DaggerError> {
1985 let query = self.selection.select("digest");
1986 query.execute(self.graphql_client.clone()).await
1987 }
1988 pub async fn id(&self) -> Result<BindingId, DaggerError> {
1990 let query = self.selection.select("id");
1991 query.execute(self.graphql_client.clone()).await
1992 }
1993 pub async fn is_null(&self) -> Result<bool, DaggerError> {
1995 let query = self.selection.select("isNull");
1996 query.execute(self.graphql_client.clone()).await
1997 }
1998 pub async fn name(&self) -> Result<String, DaggerError> {
2000 let query = self.selection.select("name");
2001 query.execute(self.graphql_client.clone()).await
2002 }
2003 pub async fn type_name(&self) -> Result<String, DaggerError> {
2005 let query = self.selection.select("typeName");
2006 query.execute(self.graphql_client.clone()).await
2007 }
2008}
2009#[derive(Clone)]
2010pub struct CacheVolume {
2011 pub proc: Option<Arc<DaggerSessionProc>>,
2012 pub selection: Selection,
2013 pub graphql_client: DynGraphQLClient,
2014}
2015impl CacheVolume {
2016 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2018 let query = self.selection.select("id");
2019 query.execute(self.graphql_client.clone()).await
2020 }
2021}
2022#[derive(Clone)]
2023pub struct Changeset {
2024 pub proc: Option<Arc<DaggerSessionProc>>,
2025 pub selection: Selection,
2026 pub graphql_client: DynGraphQLClient,
2027}
2028impl Changeset {
2029 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2031 let query = self.selection.select("addedPaths");
2032 query.execute(self.graphql_client.clone()).await
2033 }
2034 pub fn after(&self) -> Directory {
2036 let query = self.selection.select("after");
2037 Directory {
2038 proc: self.proc.clone(),
2039 selection: query,
2040 graphql_client: self.graphql_client.clone(),
2041 }
2042 }
2043 pub fn as_patch(&self) -> File {
2045 let query = self.selection.select("asPatch");
2046 File {
2047 proc: self.proc.clone(),
2048 selection: query,
2049 graphql_client: self.graphql_client.clone(),
2050 }
2051 }
2052 pub fn before(&self) -> Directory {
2054 let query = self.selection.select("before");
2055 Directory {
2056 proc: self.proc.clone(),
2057 selection: query,
2058 graphql_client: self.graphql_client.clone(),
2059 }
2060 }
2061 pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2063 let query = self.selection.select("id");
2064 query.execute(self.graphql_client.clone()).await
2065 }
2066 pub fn layer(&self) -> Directory {
2068 let query = self.selection.select("layer");
2069 Directory {
2070 proc: self.proc.clone(),
2071 selection: query,
2072 graphql_client: self.graphql_client.clone(),
2073 }
2074 }
2075 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2077 let query = self.selection.select("modifiedPaths");
2078 query.execute(self.graphql_client.clone()).await
2079 }
2080 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2082 let query = self.selection.select("removedPaths");
2083 query.execute(self.graphql_client.clone()).await
2084 }
2085 pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2087 let query = self.selection.select("sync");
2088 query.execute(self.graphql_client.clone()).await
2089 }
2090}
2091#[derive(Clone)]
2092pub struct Cloud {
2093 pub proc: Option<Arc<DaggerSessionProc>>,
2094 pub selection: Selection,
2095 pub graphql_client: DynGraphQLClient,
2096}
2097impl Cloud {
2098 pub async fn id(&self) -> Result<CloudId, DaggerError> {
2100 let query = self.selection.select("id");
2101 query.execute(self.graphql_client.clone()).await
2102 }
2103 pub async fn trace_url(&self) -> Result<String, DaggerError> {
2105 let query = self.selection.select("traceURL");
2106 query.execute(self.graphql_client.clone()).await
2107 }
2108}
2109#[derive(Clone)]
2110pub struct Container {
2111 pub proc: Option<Arc<DaggerSessionProc>>,
2112 pub selection: Selection,
2113 pub graphql_client: DynGraphQLClient,
2114}
2115#[derive(Builder, Debug, PartialEq)]
2116pub struct ContainerAsServiceOpts<'a> {
2117 #[builder(setter(into, strip_option), default)]
2120 pub args: Option<Vec<&'a str>>,
2121 #[builder(setter(into, strip_option), default)]
2123 pub expand: Option<bool>,
2124 #[builder(setter(into, strip_option), default)]
2126 pub experimental_privileged_nesting: Option<bool>,
2127 #[builder(setter(into, strip_option), default)]
2129 pub insecure_root_capabilities: Option<bool>,
2130 #[builder(setter(into, strip_option), default)]
2133 pub no_init: Option<bool>,
2134 #[builder(setter(into, strip_option), default)]
2136 pub use_entrypoint: Option<bool>,
2137}
2138#[derive(Builder, Debug, PartialEq)]
2139pub struct ContainerAsTarballOpts {
2140 #[builder(setter(into, strip_option), default)]
2143 pub forced_compression: Option<ImageLayerCompression>,
2144 #[builder(setter(into, strip_option), default)]
2147 pub media_types: Option<ImageMediaTypes>,
2148 #[builder(setter(into, strip_option), default)]
2151 pub platform_variants: Option<Vec<ContainerId>>,
2152}
2153#[derive(Builder, Debug, PartialEq)]
2154pub struct ContainerBuildOpts<'a> {
2155 #[builder(setter(into, strip_option), default)]
2157 pub build_args: Option<Vec<BuildArg>>,
2158 #[builder(setter(into, strip_option), default)]
2160 pub dockerfile: Option<&'a str>,
2161 #[builder(setter(into, strip_option), default)]
2164 pub no_init: Option<bool>,
2165 #[builder(setter(into, strip_option), default)]
2169 pub secrets: Option<Vec<SecretId>>,
2170 #[builder(setter(into, strip_option), default)]
2172 pub target: Option<&'a str>,
2173}
2174#[derive(Builder, Debug, PartialEq)]
2175pub struct ContainerDirectoryOpts {
2176 #[builder(setter(into, strip_option), default)]
2178 pub expand: Option<bool>,
2179}
2180#[derive(Builder, Debug, PartialEq)]
2181pub struct ContainerExistsOpts {
2182 #[builder(setter(into, strip_option), default)]
2184 pub do_not_follow_symlinks: Option<bool>,
2185 #[builder(setter(into, strip_option), default)]
2187 pub expected_type: Option<ExistsType>,
2188}
2189#[derive(Builder, Debug, PartialEq)]
2190pub struct ContainerExportOpts {
2191 #[builder(setter(into, strip_option), default)]
2193 pub expand: Option<bool>,
2194 #[builder(setter(into, strip_option), default)]
2197 pub forced_compression: Option<ImageLayerCompression>,
2198 #[builder(setter(into, strip_option), default)]
2201 pub media_types: Option<ImageMediaTypes>,
2202 #[builder(setter(into, strip_option), default)]
2205 pub platform_variants: Option<Vec<ContainerId>>,
2206}
2207#[derive(Builder, Debug, PartialEq)]
2208pub struct ContainerExportImageOpts {
2209 #[builder(setter(into, strip_option), default)]
2212 pub forced_compression: Option<ImageLayerCompression>,
2213 #[builder(setter(into, strip_option), default)]
2216 pub media_types: Option<ImageMediaTypes>,
2217 #[builder(setter(into, strip_option), default)]
2220 pub platform_variants: Option<Vec<ContainerId>>,
2221}
2222#[derive(Builder, Debug, PartialEq)]
2223pub struct ContainerFileOpts {
2224 #[builder(setter(into, strip_option), default)]
2226 pub expand: Option<bool>,
2227}
2228#[derive(Builder, Debug, PartialEq)]
2229pub struct ContainerImportOpts<'a> {
2230 #[builder(setter(into, strip_option), default)]
2232 pub tag: Option<&'a str>,
2233}
2234#[derive(Builder, Debug, PartialEq)]
2235pub struct ContainerPublishOpts {
2236 #[builder(setter(into, strip_option), default)]
2239 pub forced_compression: Option<ImageLayerCompression>,
2240 #[builder(setter(into, strip_option), default)]
2243 pub media_types: Option<ImageMediaTypes>,
2244 #[builder(setter(into, strip_option), default)]
2247 pub platform_variants: Option<Vec<ContainerId>>,
2248}
2249#[derive(Builder, Debug, PartialEq)]
2250pub struct ContainerTerminalOpts<'a> {
2251 #[builder(setter(into, strip_option), default)]
2253 pub cmd: Option<Vec<&'a str>>,
2254 #[builder(setter(into, strip_option), default)]
2256 pub experimental_privileged_nesting: Option<bool>,
2257 #[builder(setter(into, strip_option), default)]
2259 pub insecure_root_capabilities: Option<bool>,
2260}
2261#[derive(Builder, Debug, PartialEq)]
2262pub struct ContainerUpOpts<'a> {
2263 #[builder(setter(into, strip_option), default)]
2266 pub args: Option<Vec<&'a str>>,
2267 #[builder(setter(into, strip_option), default)]
2269 pub expand: Option<bool>,
2270 #[builder(setter(into, strip_option), default)]
2272 pub experimental_privileged_nesting: Option<bool>,
2273 #[builder(setter(into, strip_option), default)]
2275 pub insecure_root_capabilities: Option<bool>,
2276 #[builder(setter(into, strip_option), default)]
2279 pub no_init: Option<bool>,
2280 #[builder(setter(into, strip_option), default)]
2283 pub ports: Option<Vec<PortForward>>,
2284 #[builder(setter(into, strip_option), default)]
2286 pub random: Option<bool>,
2287 #[builder(setter(into, strip_option), default)]
2289 pub use_entrypoint: Option<bool>,
2290}
2291#[derive(Builder, Debug, PartialEq)]
2292pub struct ContainerWithDefaultTerminalCmdOpts {
2293 #[builder(setter(into, strip_option), default)]
2295 pub experimental_privileged_nesting: Option<bool>,
2296 #[builder(setter(into, strip_option), default)]
2298 pub insecure_root_capabilities: Option<bool>,
2299}
2300#[derive(Builder, Debug, PartialEq)]
2301pub struct ContainerWithDirectoryOpts<'a> {
2302 #[builder(setter(into, strip_option), default)]
2304 pub exclude: Option<Vec<&'a str>>,
2305 #[builder(setter(into, strip_option), default)]
2307 pub expand: Option<bool>,
2308 #[builder(setter(into, strip_option), default)]
2310 pub include: Option<Vec<&'a str>>,
2311 #[builder(setter(into, strip_option), default)]
2315 pub owner: Option<&'a str>,
2316}
2317#[derive(Builder, Debug, PartialEq)]
2318pub struct ContainerWithEntrypointOpts {
2319 #[builder(setter(into, strip_option), default)]
2321 pub keep_default_args: Option<bool>,
2322}
2323#[derive(Builder, Debug, PartialEq)]
2324pub struct ContainerWithEnvVariableOpts {
2325 #[builder(setter(into, strip_option), default)]
2327 pub expand: Option<bool>,
2328}
2329#[derive(Builder, Debug, PartialEq)]
2330pub struct ContainerWithExecOpts<'a> {
2331 #[builder(setter(into, strip_option), default)]
2333 pub expand: Option<bool>,
2334 #[builder(setter(into, strip_option), default)]
2336 pub expect: Option<ReturnType>,
2337 #[builder(setter(into, strip_option), default)]
2339 pub experimental_privileged_nesting: Option<bool>,
2340 #[builder(setter(into, strip_option), default)]
2343 pub insecure_root_capabilities: Option<bool>,
2344 #[builder(setter(into, strip_option), default)]
2347 pub no_init: Option<bool>,
2348 #[builder(setter(into, strip_option), default)]
2350 pub redirect_stderr: Option<&'a str>,
2351 #[builder(setter(into, strip_option), default)]
2353 pub redirect_stdin: Option<&'a str>,
2354 #[builder(setter(into, strip_option), default)]
2356 pub redirect_stdout: Option<&'a str>,
2357 #[builder(setter(into, strip_option), default)]
2359 pub stdin: Option<&'a str>,
2360 #[builder(setter(into, strip_option), default)]
2362 pub use_entrypoint: Option<bool>,
2363}
2364#[derive(Builder, Debug, PartialEq)]
2365pub struct ContainerWithExposedPortOpts<'a> {
2366 #[builder(setter(into, strip_option), default)]
2368 pub description: Option<&'a str>,
2369 #[builder(setter(into, strip_option), default)]
2371 pub experimental_skip_healthcheck: Option<bool>,
2372 #[builder(setter(into, strip_option), default)]
2374 pub protocol: Option<NetworkProtocol>,
2375}
2376#[derive(Builder, Debug, PartialEq)]
2377pub struct ContainerWithFileOpts<'a> {
2378 #[builder(setter(into, strip_option), default)]
2380 pub expand: Option<bool>,
2381 #[builder(setter(into, strip_option), default)]
2385 pub owner: Option<&'a str>,
2386 #[builder(setter(into, strip_option), default)]
2388 pub permissions: Option<isize>,
2389}
2390#[derive(Builder, Debug, PartialEq)]
2391pub struct ContainerWithFilesOpts<'a> {
2392 #[builder(setter(into, strip_option), default)]
2394 pub expand: Option<bool>,
2395 #[builder(setter(into, strip_option), default)]
2399 pub owner: Option<&'a str>,
2400 #[builder(setter(into, strip_option), default)]
2402 pub permissions: Option<isize>,
2403}
2404#[derive(Builder, Debug, PartialEq)]
2405pub struct ContainerWithMountedCacheOpts<'a> {
2406 #[builder(setter(into, strip_option), default)]
2408 pub expand: Option<bool>,
2409 #[builder(setter(into, strip_option), default)]
2414 pub owner: Option<&'a str>,
2415 #[builder(setter(into, strip_option), default)]
2417 pub sharing: Option<CacheSharingMode>,
2418 #[builder(setter(into, strip_option), default)]
2420 pub source: Option<DirectoryId>,
2421}
2422#[derive(Builder, Debug, PartialEq)]
2423pub struct ContainerWithMountedDirectoryOpts<'a> {
2424 #[builder(setter(into, strip_option), default)]
2426 pub expand: Option<bool>,
2427 #[builder(setter(into, strip_option), default)]
2431 pub owner: Option<&'a str>,
2432}
2433#[derive(Builder, Debug, PartialEq)]
2434pub struct ContainerWithMountedFileOpts<'a> {
2435 #[builder(setter(into, strip_option), default)]
2437 pub expand: Option<bool>,
2438 #[builder(setter(into, strip_option), default)]
2442 pub owner: Option<&'a str>,
2443}
2444#[derive(Builder, Debug, PartialEq)]
2445pub struct ContainerWithMountedSecretOpts<'a> {
2446 #[builder(setter(into, strip_option), default)]
2448 pub expand: Option<bool>,
2449 #[builder(setter(into, strip_option), default)]
2452 pub mode: Option<isize>,
2453 #[builder(setter(into, strip_option), default)]
2457 pub owner: Option<&'a str>,
2458}
2459#[derive(Builder, Debug, PartialEq)]
2460pub struct ContainerWithMountedTempOpts {
2461 #[builder(setter(into, strip_option), default)]
2463 pub expand: Option<bool>,
2464 #[builder(setter(into, strip_option), default)]
2466 pub size: Option<isize>,
2467}
2468#[derive(Builder, Debug, PartialEq)]
2469pub struct ContainerWithNewFileOpts<'a> {
2470 #[builder(setter(into, strip_option), default)]
2472 pub expand: Option<bool>,
2473 #[builder(setter(into, strip_option), default)]
2477 pub owner: Option<&'a str>,
2478 #[builder(setter(into, strip_option), default)]
2480 pub permissions: Option<isize>,
2481}
2482#[derive(Builder, Debug, PartialEq)]
2483pub struct ContainerWithSymlinkOpts {
2484 #[builder(setter(into, strip_option), default)]
2486 pub expand: Option<bool>,
2487}
2488#[derive(Builder, Debug, PartialEq)]
2489pub struct ContainerWithUnixSocketOpts<'a> {
2490 #[builder(setter(into, strip_option), default)]
2492 pub expand: Option<bool>,
2493 #[builder(setter(into, strip_option), default)]
2497 pub owner: Option<&'a str>,
2498}
2499#[derive(Builder, Debug, PartialEq)]
2500pub struct ContainerWithWorkdirOpts {
2501 #[builder(setter(into, strip_option), default)]
2503 pub expand: Option<bool>,
2504}
2505#[derive(Builder, Debug, PartialEq)]
2506pub struct ContainerWithoutDirectoryOpts {
2507 #[builder(setter(into, strip_option), default)]
2509 pub expand: Option<bool>,
2510}
2511#[derive(Builder, Debug, PartialEq)]
2512pub struct ContainerWithoutEntrypointOpts {
2513 #[builder(setter(into, strip_option), default)]
2515 pub keep_default_args: Option<bool>,
2516}
2517#[derive(Builder, Debug, PartialEq)]
2518pub struct ContainerWithoutExposedPortOpts {
2519 #[builder(setter(into, strip_option), default)]
2521 pub protocol: Option<NetworkProtocol>,
2522}
2523#[derive(Builder, Debug, PartialEq)]
2524pub struct ContainerWithoutFileOpts {
2525 #[builder(setter(into, strip_option), default)]
2527 pub expand: Option<bool>,
2528}
2529#[derive(Builder, Debug, PartialEq)]
2530pub struct ContainerWithoutFilesOpts {
2531 #[builder(setter(into, strip_option), default)]
2533 pub expand: Option<bool>,
2534}
2535#[derive(Builder, Debug, PartialEq)]
2536pub struct ContainerWithoutMountOpts {
2537 #[builder(setter(into, strip_option), default)]
2539 pub expand: Option<bool>,
2540}
2541#[derive(Builder, Debug, PartialEq)]
2542pub struct ContainerWithoutUnixSocketOpts {
2543 #[builder(setter(into, strip_option), default)]
2545 pub expand: Option<bool>,
2546}
2547impl Container {
2548 pub fn as_service(&self) -> Service {
2555 let query = self.selection.select("asService");
2556 Service {
2557 proc: self.proc.clone(),
2558 selection: query,
2559 graphql_client: self.graphql_client.clone(),
2560 }
2561 }
2562 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2569 let mut query = self.selection.select("asService");
2570 if let Some(args) = opts.args {
2571 query = query.arg("args", args);
2572 }
2573 if let Some(use_entrypoint) = opts.use_entrypoint {
2574 query = query.arg("useEntrypoint", use_entrypoint);
2575 }
2576 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2577 query = query.arg(
2578 "experimentalPrivilegedNesting",
2579 experimental_privileged_nesting,
2580 );
2581 }
2582 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2583 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2584 }
2585 if let Some(expand) = opts.expand {
2586 query = query.arg("expand", expand);
2587 }
2588 if let Some(no_init) = opts.no_init {
2589 query = query.arg("noInit", no_init);
2590 }
2591 Service {
2592 proc: self.proc.clone(),
2593 selection: query,
2594 graphql_client: self.graphql_client.clone(),
2595 }
2596 }
2597 pub fn as_tarball(&self) -> File {
2603 let query = self.selection.select("asTarball");
2604 File {
2605 proc: self.proc.clone(),
2606 selection: query,
2607 graphql_client: self.graphql_client.clone(),
2608 }
2609 }
2610 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2616 let mut query = self.selection.select("asTarball");
2617 if let Some(platform_variants) = opts.platform_variants {
2618 query = query.arg("platformVariants", platform_variants);
2619 }
2620 if let Some(forced_compression) = opts.forced_compression {
2621 query = query.arg("forcedCompression", forced_compression);
2622 }
2623 if let Some(media_types) = opts.media_types {
2624 query = query.arg("mediaTypes", media_types);
2625 }
2626 File {
2627 proc: self.proc.clone(),
2628 selection: query,
2629 graphql_client: self.graphql_client.clone(),
2630 }
2631 }
2632 pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
2639 let mut query = self.selection.select("build");
2640 query = query.arg_lazy(
2641 "context",
2642 Box::new(move || {
2643 let context = context.clone();
2644 Box::pin(async move { context.into_id().await.unwrap().quote() })
2645 }),
2646 );
2647 Container {
2648 proc: self.proc.clone(),
2649 selection: query,
2650 graphql_client: self.graphql_client.clone(),
2651 }
2652 }
2653 pub fn build_opts<'a>(
2660 &self,
2661 context: impl IntoID<DirectoryId>,
2662 opts: ContainerBuildOpts<'a>,
2663 ) -> Container {
2664 let mut query = self.selection.select("build");
2665 query = query.arg_lazy(
2666 "context",
2667 Box::new(move || {
2668 let context = context.clone();
2669 Box::pin(async move { context.into_id().await.unwrap().quote() })
2670 }),
2671 );
2672 if let Some(dockerfile) = opts.dockerfile {
2673 query = query.arg("dockerfile", dockerfile);
2674 }
2675 if let Some(target) = opts.target {
2676 query = query.arg("target", target);
2677 }
2678 if let Some(build_args) = opts.build_args {
2679 query = query.arg("buildArgs", build_args);
2680 }
2681 if let Some(secrets) = opts.secrets {
2682 query = query.arg("secrets", secrets);
2683 }
2684 if let Some(no_init) = opts.no_init {
2685 query = query.arg("noInit", no_init);
2686 }
2687 Container {
2688 proc: self.proc.clone(),
2689 selection: query,
2690 graphql_client: self.graphql_client.clone(),
2691 }
2692 }
2693 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2696 let query = self.selection.select("combinedOutput");
2697 query.execute(self.graphql_client.clone()).await
2698 }
2699 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2701 let query = self.selection.select("defaultArgs");
2702 query.execute(self.graphql_client.clone()).await
2703 }
2704 pub fn directory(&self, path: impl Into<String>) -> Directory {
2712 let mut query = self.selection.select("directory");
2713 query = query.arg("path", path.into());
2714 Directory {
2715 proc: self.proc.clone(),
2716 selection: query,
2717 graphql_client: self.graphql_client.clone(),
2718 }
2719 }
2720 pub fn directory_opts(
2728 &self,
2729 path: impl Into<String>,
2730 opts: ContainerDirectoryOpts,
2731 ) -> Directory {
2732 let mut query = self.selection.select("directory");
2733 query = query.arg("path", path.into());
2734 if let Some(expand) = opts.expand {
2735 query = query.arg("expand", expand);
2736 }
2737 Directory {
2738 proc: self.proc.clone(),
2739 selection: query,
2740 graphql_client: self.graphql_client.clone(),
2741 }
2742 }
2743 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2745 let query = self.selection.select("entrypoint");
2746 query.execute(self.graphql_client.clone()).await
2747 }
2748 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2754 let mut query = self.selection.select("envVariable");
2755 query = query.arg("name", name.into());
2756 query.execute(self.graphql_client.clone()).await
2757 }
2758 pub fn env_variables(&self) -> Vec<EnvVariable> {
2760 let query = self.selection.select("envVariables");
2761 vec![EnvVariable {
2762 proc: self.proc.clone(),
2763 selection: query,
2764 graphql_client: self.graphql_client.clone(),
2765 }]
2766 }
2767 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2774 let mut query = self.selection.select("exists");
2775 query = query.arg("path", path.into());
2776 query.execute(self.graphql_client.clone()).await
2777 }
2778 pub async fn exists_opts(
2785 &self,
2786 path: impl Into<String>,
2787 opts: ContainerExistsOpts,
2788 ) -> Result<bool, DaggerError> {
2789 let mut query = self.selection.select("exists");
2790 query = query.arg("path", path.into());
2791 if let Some(expected_type) = opts.expected_type {
2792 query = query.arg("expectedType", expected_type);
2793 }
2794 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2795 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2796 }
2797 query.execute(self.graphql_client.clone()).await
2798 }
2799 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2802 let query = self.selection.select("exitCode");
2803 query.execute(self.graphql_client.clone()).await
2804 }
2805 pub fn experimental_with_all_gp_us(&self) -> Container {
2809 let query = self.selection.select("experimentalWithAllGPUs");
2810 Container {
2811 proc: self.proc.clone(),
2812 selection: query,
2813 graphql_client: self.graphql_client.clone(),
2814 }
2815 }
2816 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2824 let mut query = self.selection.select("experimentalWithGPU");
2825 query = query.arg(
2826 "devices",
2827 devices
2828 .into_iter()
2829 .map(|i| i.into())
2830 .collect::<Vec<String>>(),
2831 );
2832 Container {
2833 proc: self.proc.clone(),
2834 selection: query,
2835 graphql_client: self.graphql_client.clone(),
2836 }
2837 }
2838 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2848 let mut query = self.selection.select("export");
2849 query = query.arg("path", path.into());
2850 query.execute(self.graphql_client.clone()).await
2851 }
2852 pub async fn export_opts(
2862 &self,
2863 path: impl Into<String>,
2864 opts: ContainerExportOpts,
2865 ) -> Result<String, DaggerError> {
2866 let mut query = self.selection.select("export");
2867 query = query.arg("path", path.into());
2868 if let Some(platform_variants) = opts.platform_variants {
2869 query = query.arg("platformVariants", platform_variants);
2870 }
2871 if let Some(forced_compression) = opts.forced_compression {
2872 query = query.arg("forcedCompression", forced_compression);
2873 }
2874 if let Some(media_types) = opts.media_types {
2875 query = query.arg("mediaTypes", media_types);
2876 }
2877 if let Some(expand) = opts.expand {
2878 query = query.arg("expand", expand);
2879 }
2880 query.execute(self.graphql_client.clone()).await
2881 }
2882 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2889 let mut query = self.selection.select("exportImage");
2890 query = query.arg("name", name.into());
2891 query.execute(self.graphql_client.clone()).await
2892 }
2893 pub async fn export_image_opts(
2900 &self,
2901 name: impl Into<String>,
2902 opts: ContainerExportImageOpts,
2903 ) -> Result<Void, DaggerError> {
2904 let mut query = self.selection.select("exportImage");
2905 query = query.arg("name", name.into());
2906 if let Some(platform_variants) = opts.platform_variants {
2907 query = query.arg("platformVariants", platform_variants);
2908 }
2909 if let Some(forced_compression) = opts.forced_compression {
2910 query = query.arg("forcedCompression", forced_compression);
2911 }
2912 if let Some(media_types) = opts.media_types {
2913 query = query.arg("mediaTypes", media_types);
2914 }
2915 query.execute(self.graphql_client.clone()).await
2916 }
2917 pub fn exposed_ports(&self) -> Vec<Port> {
2920 let query = self.selection.select("exposedPorts");
2921 vec![Port {
2922 proc: self.proc.clone(),
2923 selection: query,
2924 graphql_client: self.graphql_client.clone(),
2925 }]
2926 }
2927 pub fn file(&self, path: impl Into<String>) -> File {
2935 let mut query = self.selection.select("file");
2936 query = query.arg("path", path.into());
2937 File {
2938 proc: self.proc.clone(),
2939 selection: query,
2940 graphql_client: self.graphql_client.clone(),
2941 }
2942 }
2943 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2951 let mut query = self.selection.select("file");
2952 query = query.arg("path", path.into());
2953 if let Some(expand) = opts.expand {
2954 query = query.arg("expand", expand);
2955 }
2956 File {
2957 proc: self.proc.clone(),
2958 selection: query,
2959 graphql_client: self.graphql_client.clone(),
2960 }
2961 }
2962 pub fn from(&self, address: impl Into<String>) -> Container {
2968 let mut query = self.selection.select("from");
2969 query = query.arg("address", address.into());
2970 Container {
2971 proc: self.proc.clone(),
2972 selection: query,
2973 graphql_client: self.graphql_client.clone(),
2974 }
2975 }
2976 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2978 let query = self.selection.select("id");
2979 query.execute(self.graphql_client.clone()).await
2980 }
2981 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2983 let query = self.selection.select("imageRef");
2984 query.execute(self.graphql_client.clone()).await
2985 }
2986 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2993 let mut query = self.selection.select("import");
2994 query = query.arg_lazy(
2995 "source",
2996 Box::new(move || {
2997 let source = source.clone();
2998 Box::pin(async move { source.into_id().await.unwrap().quote() })
2999 }),
3000 );
3001 Container {
3002 proc: self.proc.clone(),
3003 selection: query,
3004 graphql_client: self.graphql_client.clone(),
3005 }
3006 }
3007 pub fn import_opts<'a>(
3014 &self,
3015 source: impl IntoID<FileId>,
3016 opts: ContainerImportOpts<'a>,
3017 ) -> Container {
3018 let mut query = self.selection.select("import");
3019 query = query.arg_lazy(
3020 "source",
3021 Box::new(move || {
3022 let source = source.clone();
3023 Box::pin(async move { source.into_id().await.unwrap().quote() })
3024 }),
3025 );
3026 if let Some(tag) = opts.tag {
3027 query = query.arg("tag", tag);
3028 }
3029 Container {
3030 proc: self.proc.clone(),
3031 selection: query,
3032 graphql_client: self.graphql_client.clone(),
3033 }
3034 }
3035 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3041 let mut query = self.selection.select("label");
3042 query = query.arg("name", name.into());
3043 query.execute(self.graphql_client.clone()).await
3044 }
3045 pub fn labels(&self) -> Vec<Label> {
3047 let query = self.selection.select("labels");
3048 vec![Label {
3049 proc: self.proc.clone(),
3050 selection: query,
3051 graphql_client: self.graphql_client.clone(),
3052 }]
3053 }
3054 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3056 let query = self.selection.select("mounts");
3057 query.execute(self.graphql_client.clone()).await
3058 }
3059 pub async fn platform(&self) -> Result<Platform, DaggerError> {
3061 let query = self.selection.select("platform");
3062 query.execute(self.graphql_client.clone()).await
3063 }
3064 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3074 let mut query = self.selection.select("publish");
3075 query = query.arg("address", address.into());
3076 query.execute(self.graphql_client.clone()).await
3077 }
3078 pub async fn publish_opts(
3088 &self,
3089 address: impl Into<String>,
3090 opts: ContainerPublishOpts,
3091 ) -> Result<String, DaggerError> {
3092 let mut query = self.selection.select("publish");
3093 query = query.arg("address", address.into());
3094 if let Some(platform_variants) = opts.platform_variants {
3095 query = query.arg("platformVariants", platform_variants);
3096 }
3097 if let Some(forced_compression) = opts.forced_compression {
3098 query = query.arg("forcedCompression", forced_compression);
3099 }
3100 if let Some(media_types) = opts.media_types {
3101 query = query.arg("mediaTypes", media_types);
3102 }
3103 query.execute(self.graphql_client.clone()).await
3104 }
3105 pub fn rootfs(&self) -> Directory {
3107 let query = self.selection.select("rootfs");
3108 Directory {
3109 proc: self.proc.clone(),
3110 selection: query,
3111 graphql_client: self.graphql_client.clone(),
3112 }
3113 }
3114 pub async fn stderr(&self) -> Result<String, DaggerError> {
3117 let query = self.selection.select("stderr");
3118 query.execute(self.graphql_client.clone()).await
3119 }
3120 pub async fn stdout(&self) -> Result<String, DaggerError> {
3123 let query = self.selection.select("stdout");
3124 query.execute(self.graphql_client.clone()).await
3125 }
3126 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3129 let query = self.selection.select("sync");
3130 query.execute(self.graphql_client.clone()).await
3131 }
3132 pub fn terminal(&self) -> Container {
3138 let query = self.selection.select("terminal");
3139 Container {
3140 proc: self.proc.clone(),
3141 selection: query,
3142 graphql_client: self.graphql_client.clone(),
3143 }
3144 }
3145 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3151 let mut query = self.selection.select("terminal");
3152 if let Some(cmd) = opts.cmd {
3153 query = query.arg("cmd", cmd);
3154 }
3155 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3156 query = query.arg(
3157 "experimentalPrivilegedNesting",
3158 experimental_privileged_nesting,
3159 );
3160 }
3161 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3162 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3163 }
3164 Container {
3165 proc: self.proc.clone(),
3166 selection: query,
3167 graphql_client: self.graphql_client.clone(),
3168 }
3169 }
3170 pub async fn up(&self) -> Result<Void, DaggerError> {
3177 let query = self.selection.select("up");
3178 query.execute(self.graphql_client.clone()).await
3179 }
3180 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3187 let mut query = self.selection.select("up");
3188 if let Some(random) = opts.random {
3189 query = query.arg("random", random);
3190 }
3191 if let Some(ports) = opts.ports {
3192 query = query.arg("ports", ports);
3193 }
3194 if let Some(args) = opts.args {
3195 query = query.arg("args", args);
3196 }
3197 if let Some(use_entrypoint) = opts.use_entrypoint {
3198 query = query.arg("useEntrypoint", use_entrypoint);
3199 }
3200 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3201 query = query.arg(
3202 "experimentalPrivilegedNesting",
3203 experimental_privileged_nesting,
3204 );
3205 }
3206 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3207 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3208 }
3209 if let Some(expand) = opts.expand {
3210 query = query.arg("expand", expand);
3211 }
3212 if let Some(no_init) = opts.no_init {
3213 query = query.arg("noInit", no_init);
3214 }
3215 query.execute(self.graphql_client.clone()).await
3216 }
3217 pub async fn user(&self) -> Result<String, DaggerError> {
3219 let query = self.selection.select("user");
3220 query.execute(self.graphql_client.clone()).await
3221 }
3222 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3229 let mut query = self.selection.select("withAnnotation");
3230 query = query.arg("name", name.into());
3231 query = query.arg("value", value.into());
3232 Container {
3233 proc: self.proc.clone(),
3234 selection: query,
3235 graphql_client: self.graphql_client.clone(),
3236 }
3237 }
3238 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3244 let mut query = self.selection.select("withDefaultArgs");
3245 query = query.arg(
3246 "args",
3247 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3248 );
3249 Container {
3250 proc: self.proc.clone(),
3251 selection: query,
3252 graphql_client: self.graphql_client.clone(),
3253 }
3254 }
3255 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3262 let mut query = self.selection.select("withDefaultTerminalCmd");
3263 query = query.arg(
3264 "args",
3265 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3266 );
3267 Container {
3268 proc: self.proc.clone(),
3269 selection: query,
3270 graphql_client: self.graphql_client.clone(),
3271 }
3272 }
3273 pub fn with_default_terminal_cmd_opts(
3280 &self,
3281 args: Vec<impl Into<String>>,
3282 opts: ContainerWithDefaultTerminalCmdOpts,
3283 ) -> Container {
3284 let mut query = self.selection.select("withDefaultTerminalCmd");
3285 query = query.arg(
3286 "args",
3287 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3288 );
3289 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3290 query = query.arg(
3291 "experimentalPrivilegedNesting",
3292 experimental_privileged_nesting,
3293 );
3294 }
3295 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3296 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3297 }
3298 Container {
3299 proc: self.proc.clone(),
3300 selection: query,
3301 graphql_client: self.graphql_client.clone(),
3302 }
3303 }
3304 pub fn with_directory(
3312 &self,
3313 path: impl Into<String>,
3314 directory: impl IntoID<DirectoryId>,
3315 ) -> Container {
3316 let mut query = self.selection.select("withDirectory");
3317 query = query.arg("path", path.into());
3318 query = query.arg_lazy(
3319 "directory",
3320 Box::new(move || {
3321 let directory = directory.clone();
3322 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3323 }),
3324 );
3325 Container {
3326 proc: self.proc.clone(),
3327 selection: query,
3328 graphql_client: self.graphql_client.clone(),
3329 }
3330 }
3331 pub fn with_directory_opts<'a>(
3339 &self,
3340 path: impl Into<String>,
3341 directory: impl IntoID<DirectoryId>,
3342 opts: ContainerWithDirectoryOpts<'a>,
3343 ) -> Container {
3344 let mut query = self.selection.select("withDirectory");
3345 query = query.arg("path", path.into());
3346 query = query.arg_lazy(
3347 "directory",
3348 Box::new(move || {
3349 let directory = directory.clone();
3350 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3351 }),
3352 );
3353 if let Some(exclude) = opts.exclude {
3354 query = query.arg("exclude", exclude);
3355 }
3356 if let Some(include) = opts.include {
3357 query = query.arg("include", include);
3358 }
3359 if let Some(owner) = opts.owner {
3360 query = query.arg("owner", owner);
3361 }
3362 if let Some(expand) = opts.expand {
3363 query = query.arg("expand", expand);
3364 }
3365 Container {
3366 proc: self.proc.clone(),
3367 selection: query,
3368 graphql_client: self.graphql_client.clone(),
3369 }
3370 }
3371 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3378 let mut query = self.selection.select("withEntrypoint");
3379 query = query.arg(
3380 "args",
3381 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3382 );
3383 Container {
3384 proc: self.proc.clone(),
3385 selection: query,
3386 graphql_client: self.graphql_client.clone(),
3387 }
3388 }
3389 pub fn with_entrypoint_opts(
3396 &self,
3397 args: Vec<impl Into<String>>,
3398 opts: ContainerWithEntrypointOpts,
3399 ) -> Container {
3400 let mut query = self.selection.select("withEntrypoint");
3401 query = query.arg(
3402 "args",
3403 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3404 );
3405 if let Some(keep_default_args) = opts.keep_default_args {
3406 query = query.arg("keepDefaultArgs", keep_default_args);
3407 }
3408 Container {
3409 proc: self.proc.clone(),
3410 selection: query,
3411 graphql_client: self.graphql_client.clone(),
3412 }
3413 }
3414 pub fn with_env_variable(
3422 &self,
3423 name: impl Into<String>,
3424 value: impl Into<String>,
3425 ) -> Container {
3426 let mut query = self.selection.select("withEnvVariable");
3427 query = query.arg("name", name.into());
3428 query = query.arg("value", value.into());
3429 Container {
3430 proc: self.proc.clone(),
3431 selection: query,
3432 graphql_client: self.graphql_client.clone(),
3433 }
3434 }
3435 pub fn with_env_variable_opts(
3443 &self,
3444 name: impl Into<String>,
3445 value: impl Into<String>,
3446 opts: ContainerWithEnvVariableOpts,
3447 ) -> Container {
3448 let mut query = self.selection.select("withEnvVariable");
3449 query = query.arg("name", name.into());
3450 query = query.arg("value", value.into());
3451 if let Some(expand) = opts.expand {
3452 query = query.arg("expand", expand);
3453 }
3454 Container {
3455 proc: self.proc.clone(),
3456 selection: query,
3457 graphql_client: self.graphql_client.clone(),
3458 }
3459 }
3460 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3471 let mut query = self.selection.select("withExec");
3472 query = query.arg(
3473 "args",
3474 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3475 );
3476 Container {
3477 proc: self.proc.clone(),
3478 selection: query,
3479 graphql_client: self.graphql_client.clone(),
3480 }
3481 }
3482 pub fn with_exec_opts<'a>(
3493 &self,
3494 args: Vec<impl Into<String>>,
3495 opts: ContainerWithExecOpts<'a>,
3496 ) -> Container {
3497 let mut query = self.selection.select("withExec");
3498 query = query.arg(
3499 "args",
3500 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3501 );
3502 if let Some(use_entrypoint) = opts.use_entrypoint {
3503 query = query.arg("useEntrypoint", use_entrypoint);
3504 }
3505 if let Some(stdin) = opts.stdin {
3506 query = query.arg("stdin", stdin);
3507 }
3508 if let Some(redirect_stdin) = opts.redirect_stdin {
3509 query = query.arg("redirectStdin", redirect_stdin);
3510 }
3511 if let Some(redirect_stdout) = opts.redirect_stdout {
3512 query = query.arg("redirectStdout", redirect_stdout);
3513 }
3514 if let Some(redirect_stderr) = opts.redirect_stderr {
3515 query = query.arg("redirectStderr", redirect_stderr);
3516 }
3517 if let Some(expect) = opts.expect {
3518 query = query.arg("expect", expect);
3519 }
3520 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3521 query = query.arg(
3522 "experimentalPrivilegedNesting",
3523 experimental_privileged_nesting,
3524 );
3525 }
3526 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3527 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3528 }
3529 if let Some(expand) = opts.expand {
3530 query = query.arg("expand", expand);
3531 }
3532 if let Some(no_init) = opts.no_init {
3533 query = query.arg("noInit", no_init);
3534 }
3535 Container {
3536 proc: self.proc.clone(),
3537 selection: query,
3538 graphql_client: self.graphql_client.clone(),
3539 }
3540 }
3541 pub fn with_exposed_port(&self, port: isize) -> Container {
3551 let mut query = self.selection.select("withExposedPort");
3552 query = query.arg("port", port);
3553 Container {
3554 proc: self.proc.clone(),
3555 selection: query,
3556 graphql_client: self.graphql_client.clone(),
3557 }
3558 }
3559 pub fn with_exposed_port_opts<'a>(
3569 &self,
3570 port: isize,
3571 opts: ContainerWithExposedPortOpts<'a>,
3572 ) -> Container {
3573 let mut query = self.selection.select("withExposedPort");
3574 query = query.arg("port", port);
3575 if let Some(protocol) = opts.protocol {
3576 query = query.arg("protocol", protocol);
3577 }
3578 if let Some(description) = opts.description {
3579 query = query.arg("description", description);
3580 }
3581 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3582 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3583 }
3584 Container {
3585 proc: self.proc.clone(),
3586 selection: query,
3587 graphql_client: self.graphql_client.clone(),
3588 }
3589 }
3590 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3598 let mut query = self.selection.select("withFile");
3599 query = query.arg("path", path.into());
3600 query = query.arg_lazy(
3601 "source",
3602 Box::new(move || {
3603 let source = source.clone();
3604 Box::pin(async move { source.into_id().await.unwrap().quote() })
3605 }),
3606 );
3607 Container {
3608 proc: self.proc.clone(),
3609 selection: query,
3610 graphql_client: self.graphql_client.clone(),
3611 }
3612 }
3613 pub fn with_file_opts<'a>(
3621 &self,
3622 path: impl Into<String>,
3623 source: impl IntoID<FileId>,
3624 opts: ContainerWithFileOpts<'a>,
3625 ) -> Container {
3626 let mut query = self.selection.select("withFile");
3627 query = query.arg("path", path.into());
3628 query = query.arg_lazy(
3629 "source",
3630 Box::new(move || {
3631 let source = source.clone();
3632 Box::pin(async move { source.into_id().await.unwrap().quote() })
3633 }),
3634 );
3635 if let Some(permissions) = opts.permissions {
3636 query = query.arg("permissions", permissions);
3637 }
3638 if let Some(owner) = opts.owner {
3639 query = query.arg("owner", owner);
3640 }
3641 if let Some(expand) = opts.expand {
3642 query = query.arg("expand", expand);
3643 }
3644 Container {
3645 proc: self.proc.clone(),
3646 selection: query,
3647 graphql_client: self.graphql_client.clone(),
3648 }
3649 }
3650 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3658 let mut query = self.selection.select("withFiles");
3659 query = query.arg("path", path.into());
3660 query = query.arg("sources", sources);
3661 Container {
3662 proc: self.proc.clone(),
3663 selection: query,
3664 graphql_client: self.graphql_client.clone(),
3665 }
3666 }
3667 pub fn with_files_opts<'a>(
3675 &self,
3676 path: impl Into<String>,
3677 sources: Vec<FileId>,
3678 opts: ContainerWithFilesOpts<'a>,
3679 ) -> Container {
3680 let mut query = self.selection.select("withFiles");
3681 query = query.arg("path", path.into());
3682 query = query.arg("sources", sources);
3683 if let Some(permissions) = opts.permissions {
3684 query = query.arg("permissions", permissions);
3685 }
3686 if let Some(owner) = opts.owner {
3687 query = query.arg("owner", owner);
3688 }
3689 if let Some(expand) = opts.expand {
3690 query = query.arg("expand", expand);
3691 }
3692 Container {
3693 proc: self.proc.clone(),
3694 selection: query,
3695 graphql_client: self.graphql_client.clone(),
3696 }
3697 }
3698 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3705 let mut query = self.selection.select("withLabel");
3706 query = query.arg("name", name.into());
3707 query = query.arg("value", value.into());
3708 Container {
3709 proc: self.proc.clone(),
3710 selection: query,
3711 graphql_client: self.graphql_client.clone(),
3712 }
3713 }
3714 pub fn with_mounted_cache(
3722 &self,
3723 path: impl Into<String>,
3724 cache: impl IntoID<CacheVolumeId>,
3725 ) -> Container {
3726 let mut query = self.selection.select("withMountedCache");
3727 query = query.arg("path", path.into());
3728 query = query.arg_lazy(
3729 "cache",
3730 Box::new(move || {
3731 let cache = cache.clone();
3732 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3733 }),
3734 );
3735 Container {
3736 proc: self.proc.clone(),
3737 selection: query,
3738 graphql_client: self.graphql_client.clone(),
3739 }
3740 }
3741 pub fn with_mounted_cache_opts<'a>(
3749 &self,
3750 path: impl Into<String>,
3751 cache: impl IntoID<CacheVolumeId>,
3752 opts: ContainerWithMountedCacheOpts<'a>,
3753 ) -> Container {
3754 let mut query = self.selection.select("withMountedCache");
3755 query = query.arg("path", path.into());
3756 query = query.arg_lazy(
3757 "cache",
3758 Box::new(move || {
3759 let cache = cache.clone();
3760 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3761 }),
3762 );
3763 if let Some(source) = opts.source {
3764 query = query.arg("source", source);
3765 }
3766 if let Some(sharing) = opts.sharing {
3767 query = query.arg("sharing", sharing);
3768 }
3769 if let Some(owner) = opts.owner {
3770 query = query.arg("owner", owner);
3771 }
3772 if let Some(expand) = opts.expand {
3773 query = query.arg("expand", expand);
3774 }
3775 Container {
3776 proc: self.proc.clone(),
3777 selection: query,
3778 graphql_client: self.graphql_client.clone(),
3779 }
3780 }
3781 pub fn with_mounted_directory(
3789 &self,
3790 path: impl Into<String>,
3791 source: impl IntoID<DirectoryId>,
3792 ) -> Container {
3793 let mut query = self.selection.select("withMountedDirectory");
3794 query = query.arg("path", path.into());
3795 query = query.arg_lazy(
3796 "source",
3797 Box::new(move || {
3798 let source = source.clone();
3799 Box::pin(async move { source.into_id().await.unwrap().quote() })
3800 }),
3801 );
3802 Container {
3803 proc: self.proc.clone(),
3804 selection: query,
3805 graphql_client: self.graphql_client.clone(),
3806 }
3807 }
3808 pub fn with_mounted_directory_opts<'a>(
3816 &self,
3817 path: impl Into<String>,
3818 source: impl IntoID<DirectoryId>,
3819 opts: ContainerWithMountedDirectoryOpts<'a>,
3820 ) -> Container {
3821 let mut query = self.selection.select("withMountedDirectory");
3822 query = query.arg("path", path.into());
3823 query = query.arg_lazy(
3824 "source",
3825 Box::new(move || {
3826 let source = source.clone();
3827 Box::pin(async move { source.into_id().await.unwrap().quote() })
3828 }),
3829 );
3830 if let Some(owner) = opts.owner {
3831 query = query.arg("owner", owner);
3832 }
3833 if let Some(expand) = opts.expand {
3834 query = query.arg("expand", expand);
3835 }
3836 Container {
3837 proc: self.proc.clone(),
3838 selection: query,
3839 graphql_client: self.graphql_client.clone(),
3840 }
3841 }
3842 pub fn with_mounted_file(
3850 &self,
3851 path: impl Into<String>,
3852 source: impl IntoID<FileId>,
3853 ) -> Container {
3854 let mut query = self.selection.select("withMountedFile");
3855 query = query.arg("path", path.into());
3856 query = query.arg_lazy(
3857 "source",
3858 Box::new(move || {
3859 let source = source.clone();
3860 Box::pin(async move { source.into_id().await.unwrap().quote() })
3861 }),
3862 );
3863 Container {
3864 proc: self.proc.clone(),
3865 selection: query,
3866 graphql_client: self.graphql_client.clone(),
3867 }
3868 }
3869 pub fn with_mounted_file_opts<'a>(
3877 &self,
3878 path: impl Into<String>,
3879 source: impl IntoID<FileId>,
3880 opts: ContainerWithMountedFileOpts<'a>,
3881 ) -> Container {
3882 let mut query = self.selection.select("withMountedFile");
3883 query = query.arg("path", path.into());
3884 query = query.arg_lazy(
3885 "source",
3886 Box::new(move || {
3887 let source = source.clone();
3888 Box::pin(async move { source.into_id().await.unwrap().quote() })
3889 }),
3890 );
3891 if let Some(owner) = opts.owner {
3892 query = query.arg("owner", owner);
3893 }
3894 if let Some(expand) = opts.expand {
3895 query = query.arg("expand", expand);
3896 }
3897 Container {
3898 proc: self.proc.clone(),
3899 selection: query,
3900 graphql_client: self.graphql_client.clone(),
3901 }
3902 }
3903 pub fn with_mounted_secret(
3911 &self,
3912 path: impl Into<String>,
3913 source: impl IntoID<SecretId>,
3914 ) -> Container {
3915 let mut query = self.selection.select("withMountedSecret");
3916 query = query.arg("path", path.into());
3917 query = query.arg_lazy(
3918 "source",
3919 Box::new(move || {
3920 let source = source.clone();
3921 Box::pin(async move { source.into_id().await.unwrap().quote() })
3922 }),
3923 );
3924 Container {
3925 proc: self.proc.clone(),
3926 selection: query,
3927 graphql_client: self.graphql_client.clone(),
3928 }
3929 }
3930 pub fn with_mounted_secret_opts<'a>(
3938 &self,
3939 path: impl Into<String>,
3940 source: impl IntoID<SecretId>,
3941 opts: ContainerWithMountedSecretOpts<'a>,
3942 ) -> Container {
3943 let mut query = self.selection.select("withMountedSecret");
3944 query = query.arg("path", path.into());
3945 query = query.arg_lazy(
3946 "source",
3947 Box::new(move || {
3948 let source = source.clone();
3949 Box::pin(async move { source.into_id().await.unwrap().quote() })
3950 }),
3951 );
3952 if let Some(owner) = opts.owner {
3953 query = query.arg("owner", owner);
3954 }
3955 if let Some(mode) = opts.mode {
3956 query = query.arg("mode", mode);
3957 }
3958 if let Some(expand) = opts.expand {
3959 query = query.arg("expand", expand);
3960 }
3961 Container {
3962 proc: self.proc.clone(),
3963 selection: query,
3964 graphql_client: self.graphql_client.clone(),
3965 }
3966 }
3967 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3974 let mut query = self.selection.select("withMountedTemp");
3975 query = query.arg("path", path.into());
3976 Container {
3977 proc: self.proc.clone(),
3978 selection: query,
3979 graphql_client: self.graphql_client.clone(),
3980 }
3981 }
3982 pub fn with_mounted_temp_opts(
3989 &self,
3990 path: impl Into<String>,
3991 opts: ContainerWithMountedTempOpts,
3992 ) -> Container {
3993 let mut query = self.selection.select("withMountedTemp");
3994 query = query.arg("path", path.into());
3995 if let Some(size) = opts.size {
3996 query = query.arg("size", size);
3997 }
3998 if let Some(expand) = opts.expand {
3999 query = query.arg("expand", expand);
4000 }
4001 Container {
4002 proc: self.proc.clone(),
4003 selection: query,
4004 graphql_client: self.graphql_client.clone(),
4005 }
4006 }
4007 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4015 let mut query = self.selection.select("withNewFile");
4016 query = query.arg("path", path.into());
4017 query = query.arg("contents", contents.into());
4018 Container {
4019 proc: self.proc.clone(),
4020 selection: query,
4021 graphql_client: self.graphql_client.clone(),
4022 }
4023 }
4024 pub fn with_new_file_opts<'a>(
4032 &self,
4033 path: impl Into<String>,
4034 contents: impl Into<String>,
4035 opts: ContainerWithNewFileOpts<'a>,
4036 ) -> Container {
4037 let mut query = self.selection.select("withNewFile");
4038 query = query.arg("path", path.into());
4039 query = query.arg("contents", contents.into());
4040 if let Some(permissions) = opts.permissions {
4041 query = query.arg("permissions", permissions);
4042 }
4043 if let Some(owner) = opts.owner {
4044 query = query.arg("owner", owner);
4045 }
4046 if let Some(expand) = opts.expand {
4047 query = query.arg("expand", expand);
4048 }
4049 Container {
4050 proc: self.proc.clone(),
4051 selection: query,
4052 graphql_client: self.graphql_client.clone(),
4053 }
4054 }
4055 pub fn with_registry_auth(
4063 &self,
4064 address: impl Into<String>,
4065 username: impl Into<String>,
4066 secret: impl IntoID<SecretId>,
4067 ) -> Container {
4068 let mut query = self.selection.select("withRegistryAuth");
4069 query = query.arg("address", address.into());
4070 query = query.arg("username", username.into());
4071 query = query.arg_lazy(
4072 "secret",
4073 Box::new(move || {
4074 let secret = secret.clone();
4075 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4076 }),
4077 );
4078 Container {
4079 proc: self.proc.clone(),
4080 selection: query,
4081 graphql_client: self.graphql_client.clone(),
4082 }
4083 }
4084 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4090 let mut query = self.selection.select("withRootfs");
4091 query = query.arg_lazy(
4092 "directory",
4093 Box::new(move || {
4094 let directory = directory.clone();
4095 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4096 }),
4097 );
4098 Container {
4099 proc: self.proc.clone(),
4100 selection: query,
4101 graphql_client: self.graphql_client.clone(),
4102 }
4103 }
4104 pub fn with_secret_variable(
4111 &self,
4112 name: impl Into<String>,
4113 secret: impl IntoID<SecretId>,
4114 ) -> Container {
4115 let mut query = self.selection.select("withSecretVariable");
4116 query = query.arg("name", name.into());
4117 query = query.arg_lazy(
4118 "secret",
4119 Box::new(move || {
4120 let secret = secret.clone();
4121 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4122 }),
4123 );
4124 Container {
4125 proc: self.proc.clone(),
4126 selection: query,
4127 graphql_client: self.graphql_client.clone(),
4128 }
4129 }
4130 pub fn with_service_binding(
4140 &self,
4141 alias: impl Into<String>,
4142 service: impl IntoID<ServiceId>,
4143 ) -> Container {
4144 let mut query = self.selection.select("withServiceBinding");
4145 query = query.arg("alias", alias.into());
4146 query = query.arg_lazy(
4147 "service",
4148 Box::new(move || {
4149 let service = service.clone();
4150 Box::pin(async move { service.into_id().await.unwrap().quote() })
4151 }),
4152 );
4153 Container {
4154 proc: self.proc.clone(),
4155 selection: query,
4156 graphql_client: self.graphql_client.clone(),
4157 }
4158 }
4159 pub fn with_symlink(
4167 &self,
4168 target: impl Into<String>,
4169 link_name: impl Into<String>,
4170 ) -> Container {
4171 let mut query = self.selection.select("withSymlink");
4172 query = query.arg("target", target.into());
4173 query = query.arg("linkName", link_name.into());
4174 Container {
4175 proc: self.proc.clone(),
4176 selection: query,
4177 graphql_client: self.graphql_client.clone(),
4178 }
4179 }
4180 pub fn with_symlink_opts(
4188 &self,
4189 target: impl Into<String>,
4190 link_name: impl Into<String>,
4191 opts: ContainerWithSymlinkOpts,
4192 ) -> Container {
4193 let mut query = self.selection.select("withSymlink");
4194 query = query.arg("target", target.into());
4195 query = query.arg("linkName", link_name.into());
4196 if let Some(expand) = opts.expand {
4197 query = query.arg("expand", expand);
4198 }
4199 Container {
4200 proc: self.proc.clone(),
4201 selection: query,
4202 graphql_client: self.graphql_client.clone(),
4203 }
4204 }
4205 pub fn with_unix_socket(
4213 &self,
4214 path: impl Into<String>,
4215 source: impl IntoID<SocketId>,
4216 ) -> Container {
4217 let mut query = self.selection.select("withUnixSocket");
4218 query = query.arg("path", path.into());
4219 query = query.arg_lazy(
4220 "source",
4221 Box::new(move || {
4222 let source = source.clone();
4223 Box::pin(async move { source.into_id().await.unwrap().quote() })
4224 }),
4225 );
4226 Container {
4227 proc: self.proc.clone(),
4228 selection: query,
4229 graphql_client: self.graphql_client.clone(),
4230 }
4231 }
4232 pub fn with_unix_socket_opts<'a>(
4240 &self,
4241 path: impl Into<String>,
4242 source: impl IntoID<SocketId>,
4243 opts: ContainerWithUnixSocketOpts<'a>,
4244 ) -> Container {
4245 let mut query = self.selection.select("withUnixSocket");
4246 query = query.arg("path", path.into());
4247 query = query.arg_lazy(
4248 "source",
4249 Box::new(move || {
4250 let source = source.clone();
4251 Box::pin(async move { source.into_id().await.unwrap().quote() })
4252 }),
4253 );
4254 if let Some(owner) = opts.owner {
4255 query = query.arg("owner", owner);
4256 }
4257 if let Some(expand) = opts.expand {
4258 query = query.arg("expand", expand);
4259 }
4260 Container {
4261 proc: self.proc.clone(),
4262 selection: query,
4263 graphql_client: self.graphql_client.clone(),
4264 }
4265 }
4266 pub fn with_user(&self, name: impl Into<String>) -> Container {
4272 let mut query = self.selection.select("withUser");
4273 query = query.arg("name", name.into());
4274 Container {
4275 proc: self.proc.clone(),
4276 selection: query,
4277 graphql_client: self.graphql_client.clone(),
4278 }
4279 }
4280 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4287 let mut query = self.selection.select("withWorkdir");
4288 query = query.arg("path", path.into());
4289 Container {
4290 proc: self.proc.clone(),
4291 selection: query,
4292 graphql_client: self.graphql_client.clone(),
4293 }
4294 }
4295 pub fn with_workdir_opts(
4302 &self,
4303 path: impl Into<String>,
4304 opts: ContainerWithWorkdirOpts,
4305 ) -> Container {
4306 let mut query = self.selection.select("withWorkdir");
4307 query = query.arg("path", path.into());
4308 if let Some(expand) = opts.expand {
4309 query = query.arg("expand", expand);
4310 }
4311 Container {
4312 proc: self.proc.clone(),
4313 selection: query,
4314 graphql_client: self.graphql_client.clone(),
4315 }
4316 }
4317 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4323 let mut query = self.selection.select("withoutAnnotation");
4324 query = query.arg("name", name.into());
4325 Container {
4326 proc: self.proc.clone(),
4327 selection: query,
4328 graphql_client: self.graphql_client.clone(),
4329 }
4330 }
4331 pub fn without_default_args(&self) -> Container {
4333 let query = self.selection.select("withoutDefaultArgs");
4334 Container {
4335 proc: self.proc.clone(),
4336 selection: query,
4337 graphql_client: self.graphql_client.clone(),
4338 }
4339 }
4340 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4347 let mut query = self.selection.select("withoutDirectory");
4348 query = query.arg("path", path.into());
4349 Container {
4350 proc: self.proc.clone(),
4351 selection: query,
4352 graphql_client: self.graphql_client.clone(),
4353 }
4354 }
4355 pub fn without_directory_opts(
4362 &self,
4363 path: impl Into<String>,
4364 opts: ContainerWithoutDirectoryOpts,
4365 ) -> Container {
4366 let mut query = self.selection.select("withoutDirectory");
4367 query = query.arg("path", path.into());
4368 if let Some(expand) = opts.expand {
4369 query = query.arg("expand", expand);
4370 }
4371 Container {
4372 proc: self.proc.clone(),
4373 selection: query,
4374 graphql_client: self.graphql_client.clone(),
4375 }
4376 }
4377 pub fn without_entrypoint(&self) -> Container {
4383 let query = self.selection.select("withoutEntrypoint");
4384 Container {
4385 proc: self.proc.clone(),
4386 selection: query,
4387 graphql_client: self.graphql_client.clone(),
4388 }
4389 }
4390 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4396 let mut query = self.selection.select("withoutEntrypoint");
4397 if let Some(keep_default_args) = opts.keep_default_args {
4398 query = query.arg("keepDefaultArgs", keep_default_args);
4399 }
4400 Container {
4401 proc: self.proc.clone(),
4402 selection: query,
4403 graphql_client: self.graphql_client.clone(),
4404 }
4405 }
4406 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4412 let mut query = self.selection.select("withoutEnvVariable");
4413 query = query.arg("name", name.into());
4414 Container {
4415 proc: self.proc.clone(),
4416 selection: query,
4417 graphql_client: self.graphql_client.clone(),
4418 }
4419 }
4420 pub fn without_exposed_port(&self, port: isize) -> Container {
4427 let mut query = self.selection.select("withoutExposedPort");
4428 query = query.arg("port", port);
4429 Container {
4430 proc: self.proc.clone(),
4431 selection: query,
4432 graphql_client: self.graphql_client.clone(),
4433 }
4434 }
4435 pub fn without_exposed_port_opts(
4442 &self,
4443 port: isize,
4444 opts: ContainerWithoutExposedPortOpts,
4445 ) -> Container {
4446 let mut query = self.selection.select("withoutExposedPort");
4447 query = query.arg("port", port);
4448 if let Some(protocol) = opts.protocol {
4449 query = query.arg("protocol", protocol);
4450 }
4451 Container {
4452 proc: self.proc.clone(),
4453 selection: query,
4454 graphql_client: self.graphql_client.clone(),
4455 }
4456 }
4457 pub fn without_file(&self, path: impl Into<String>) -> Container {
4464 let mut query = self.selection.select("withoutFile");
4465 query = query.arg("path", path.into());
4466 Container {
4467 proc: self.proc.clone(),
4468 selection: query,
4469 graphql_client: self.graphql_client.clone(),
4470 }
4471 }
4472 pub fn without_file_opts(
4479 &self,
4480 path: impl Into<String>,
4481 opts: ContainerWithoutFileOpts,
4482 ) -> Container {
4483 let mut query = self.selection.select("withoutFile");
4484 query = query.arg("path", path.into());
4485 if let Some(expand) = opts.expand {
4486 query = query.arg("expand", expand);
4487 }
4488 Container {
4489 proc: self.proc.clone(),
4490 selection: query,
4491 graphql_client: self.graphql_client.clone(),
4492 }
4493 }
4494 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4501 let mut query = self.selection.select("withoutFiles");
4502 query = query.arg(
4503 "paths",
4504 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4505 );
4506 Container {
4507 proc: self.proc.clone(),
4508 selection: query,
4509 graphql_client: self.graphql_client.clone(),
4510 }
4511 }
4512 pub fn without_files_opts(
4519 &self,
4520 paths: Vec<impl Into<String>>,
4521 opts: ContainerWithoutFilesOpts,
4522 ) -> Container {
4523 let mut query = self.selection.select("withoutFiles");
4524 query = query.arg(
4525 "paths",
4526 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4527 );
4528 if let Some(expand) = opts.expand {
4529 query = query.arg("expand", expand);
4530 }
4531 Container {
4532 proc: self.proc.clone(),
4533 selection: query,
4534 graphql_client: self.graphql_client.clone(),
4535 }
4536 }
4537 pub fn without_label(&self, name: impl Into<String>) -> Container {
4543 let mut query = self.selection.select("withoutLabel");
4544 query = query.arg("name", name.into());
4545 Container {
4546 proc: self.proc.clone(),
4547 selection: query,
4548 graphql_client: self.graphql_client.clone(),
4549 }
4550 }
4551 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4558 let mut query = self.selection.select("withoutMount");
4559 query = query.arg("path", path.into());
4560 Container {
4561 proc: self.proc.clone(),
4562 selection: query,
4563 graphql_client: self.graphql_client.clone(),
4564 }
4565 }
4566 pub fn without_mount_opts(
4573 &self,
4574 path: impl Into<String>,
4575 opts: ContainerWithoutMountOpts,
4576 ) -> Container {
4577 let mut query = self.selection.select("withoutMount");
4578 query = query.arg("path", path.into());
4579 if let Some(expand) = opts.expand {
4580 query = query.arg("expand", expand);
4581 }
4582 Container {
4583 proc: self.proc.clone(),
4584 selection: query,
4585 graphql_client: self.graphql_client.clone(),
4586 }
4587 }
4588 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4596 let mut query = self.selection.select("withoutRegistryAuth");
4597 query = query.arg("address", address.into());
4598 Container {
4599 proc: self.proc.clone(),
4600 selection: query,
4601 graphql_client: self.graphql_client.clone(),
4602 }
4603 }
4604 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4610 let mut query = self.selection.select("withoutSecretVariable");
4611 query = query.arg("name", name.into());
4612 Container {
4613 proc: self.proc.clone(),
4614 selection: query,
4615 graphql_client: self.graphql_client.clone(),
4616 }
4617 }
4618 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4625 let mut query = self.selection.select("withoutUnixSocket");
4626 query = query.arg("path", path.into());
4627 Container {
4628 proc: self.proc.clone(),
4629 selection: query,
4630 graphql_client: self.graphql_client.clone(),
4631 }
4632 }
4633 pub fn without_unix_socket_opts(
4640 &self,
4641 path: impl Into<String>,
4642 opts: ContainerWithoutUnixSocketOpts,
4643 ) -> Container {
4644 let mut query = self.selection.select("withoutUnixSocket");
4645 query = query.arg("path", path.into());
4646 if let Some(expand) = opts.expand {
4647 query = query.arg("expand", expand);
4648 }
4649 Container {
4650 proc: self.proc.clone(),
4651 selection: query,
4652 graphql_client: self.graphql_client.clone(),
4653 }
4654 }
4655 pub fn without_user(&self) -> Container {
4658 let query = self.selection.select("withoutUser");
4659 Container {
4660 proc: self.proc.clone(),
4661 selection: query,
4662 graphql_client: self.graphql_client.clone(),
4663 }
4664 }
4665 pub fn without_workdir(&self) -> Container {
4668 let query = self.selection.select("withoutWorkdir");
4669 Container {
4670 proc: self.proc.clone(),
4671 selection: query,
4672 graphql_client: self.graphql_client.clone(),
4673 }
4674 }
4675 pub async fn workdir(&self) -> Result<String, DaggerError> {
4677 let query = self.selection.select("workdir");
4678 query.execute(self.graphql_client.clone()).await
4679 }
4680}
4681#[derive(Clone)]
4682pub struct CurrentModule {
4683 pub proc: Option<Arc<DaggerSessionProc>>,
4684 pub selection: Selection,
4685 pub graphql_client: DynGraphQLClient,
4686}
4687#[derive(Builder, Debug, PartialEq)]
4688pub struct CurrentModuleWorkdirOpts<'a> {
4689 #[builder(setter(into, strip_option), default)]
4691 pub exclude: Option<Vec<&'a str>>,
4692 #[builder(setter(into, strip_option), default)]
4694 pub include: Option<Vec<&'a str>>,
4695}
4696impl CurrentModule {
4697 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4699 let query = self.selection.select("id");
4700 query.execute(self.graphql_client.clone()).await
4701 }
4702 pub async fn name(&self) -> Result<String, DaggerError> {
4704 let query = self.selection.select("name");
4705 query.execute(self.graphql_client.clone()).await
4706 }
4707 pub fn source(&self) -> Directory {
4709 let query = self.selection.select("source");
4710 Directory {
4711 proc: self.proc.clone(),
4712 selection: query,
4713 graphql_client: self.graphql_client.clone(),
4714 }
4715 }
4716 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4723 let mut query = self.selection.select("workdir");
4724 query = query.arg("path", path.into());
4725 Directory {
4726 proc: self.proc.clone(),
4727 selection: query,
4728 graphql_client: self.graphql_client.clone(),
4729 }
4730 }
4731 pub fn workdir_opts<'a>(
4738 &self,
4739 path: impl Into<String>,
4740 opts: CurrentModuleWorkdirOpts<'a>,
4741 ) -> Directory {
4742 let mut query = self.selection.select("workdir");
4743 query = query.arg("path", path.into());
4744 if let Some(exclude) = opts.exclude {
4745 query = query.arg("exclude", exclude);
4746 }
4747 if let Some(include) = opts.include {
4748 query = query.arg("include", include);
4749 }
4750 Directory {
4751 proc: self.proc.clone(),
4752 selection: query,
4753 graphql_client: self.graphql_client.clone(),
4754 }
4755 }
4756 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4762 let mut query = self.selection.select("workdirFile");
4763 query = query.arg("path", path.into());
4764 File {
4765 proc: self.proc.clone(),
4766 selection: query,
4767 graphql_client: self.graphql_client.clone(),
4768 }
4769 }
4770}
4771#[derive(Clone)]
4772pub struct Directory {
4773 pub proc: Option<Arc<DaggerSessionProc>>,
4774 pub selection: Selection,
4775 pub graphql_client: DynGraphQLClient,
4776}
4777#[derive(Builder, Debug, PartialEq)]
4778pub struct DirectoryAsModuleOpts<'a> {
4779 #[builder(setter(into, strip_option), default)]
4782 pub source_root_path: Option<&'a str>,
4783}
4784#[derive(Builder, Debug, PartialEq)]
4785pub struct DirectoryAsModuleSourceOpts<'a> {
4786 #[builder(setter(into, strip_option), default)]
4789 pub source_root_path: Option<&'a str>,
4790}
4791#[derive(Builder, Debug, PartialEq)]
4792pub struct DirectoryDockerBuildOpts<'a> {
4793 #[builder(setter(into, strip_option), default)]
4795 pub build_args: Option<Vec<BuildArg>>,
4796 #[builder(setter(into, strip_option), default)]
4798 pub dockerfile: Option<&'a str>,
4799 #[builder(setter(into, strip_option), default)]
4802 pub no_init: Option<bool>,
4803 #[builder(setter(into, strip_option), default)]
4805 pub platform: Option<Platform>,
4806 #[builder(setter(into, strip_option), default)]
4809 pub secrets: Option<Vec<SecretId>>,
4810 #[builder(setter(into, strip_option), default)]
4812 pub target: Option<&'a str>,
4813}
4814#[derive(Builder, Debug, PartialEq)]
4815pub struct DirectoryEntriesOpts<'a> {
4816 #[builder(setter(into, strip_option), default)]
4818 pub path: Option<&'a str>,
4819}
4820#[derive(Builder, Debug, PartialEq)]
4821pub struct DirectoryExistsOpts {
4822 #[builder(setter(into, strip_option), default)]
4824 pub do_not_follow_symlinks: Option<bool>,
4825 #[builder(setter(into, strip_option), default)]
4827 pub expected_type: Option<ExistsType>,
4828}
4829#[derive(Builder, Debug, PartialEq)]
4830pub struct DirectoryExportOpts {
4831 #[builder(setter(into, strip_option), default)]
4833 pub wipe: Option<bool>,
4834}
4835#[derive(Builder, Debug, PartialEq)]
4836pub struct DirectoryFilterOpts<'a> {
4837 #[builder(setter(into, strip_option), default)]
4839 pub exclude: Option<Vec<&'a str>>,
4840 #[builder(setter(into, strip_option), default)]
4842 pub include: Option<Vec<&'a str>>,
4843}
4844#[derive(Builder, Debug, PartialEq)]
4845pub struct DirectorySearchOpts<'a> {
4846 #[builder(setter(into, strip_option), default)]
4848 pub dotall: Option<bool>,
4849 #[builder(setter(into, strip_option), default)]
4851 pub files_only: Option<bool>,
4852 #[builder(setter(into, strip_option), default)]
4854 pub globs: Option<Vec<&'a str>>,
4855 #[builder(setter(into, strip_option), default)]
4857 pub insensitive: Option<bool>,
4858 #[builder(setter(into, strip_option), default)]
4860 pub limit: Option<isize>,
4861 #[builder(setter(into, strip_option), default)]
4863 pub literal: Option<bool>,
4864 #[builder(setter(into, strip_option), default)]
4866 pub multiline: Option<bool>,
4867 #[builder(setter(into, strip_option), default)]
4869 pub paths: Option<Vec<&'a str>>,
4870 #[builder(setter(into, strip_option), default)]
4872 pub skip_hidden: Option<bool>,
4873 #[builder(setter(into, strip_option), default)]
4875 pub skip_ignored: Option<bool>,
4876}
4877#[derive(Builder, Debug, PartialEq)]
4878pub struct DirectoryTerminalOpts<'a> {
4879 #[builder(setter(into, strip_option), default)]
4881 pub cmd: Option<Vec<&'a str>>,
4882 #[builder(setter(into, strip_option), default)]
4884 pub container: Option<ContainerId>,
4885 #[builder(setter(into, strip_option), default)]
4887 pub experimental_privileged_nesting: Option<bool>,
4888 #[builder(setter(into, strip_option), default)]
4890 pub insecure_root_capabilities: Option<bool>,
4891}
4892#[derive(Builder, Debug, PartialEq)]
4893pub struct DirectoryWithDirectoryOpts<'a> {
4894 #[builder(setter(into, strip_option), default)]
4896 pub exclude: Option<Vec<&'a str>>,
4897 #[builder(setter(into, strip_option), default)]
4899 pub include: Option<Vec<&'a str>>,
4900 #[builder(setter(into, strip_option), default)]
4904 pub owner: Option<&'a str>,
4905}
4906#[derive(Builder, Debug, PartialEq)]
4907pub struct DirectoryWithFileOpts<'a> {
4908 #[builder(setter(into, strip_option), default)]
4912 pub owner: Option<&'a str>,
4913 #[builder(setter(into, strip_option), default)]
4915 pub permissions: Option<isize>,
4916}
4917#[derive(Builder, Debug, PartialEq)]
4918pub struct DirectoryWithFilesOpts {
4919 #[builder(setter(into, strip_option), default)]
4921 pub permissions: Option<isize>,
4922}
4923#[derive(Builder, Debug, PartialEq)]
4924pub struct DirectoryWithNewDirectoryOpts {
4925 #[builder(setter(into, strip_option), default)]
4927 pub permissions: Option<isize>,
4928}
4929#[derive(Builder, Debug, PartialEq)]
4930pub struct DirectoryWithNewFileOpts {
4931 #[builder(setter(into, strip_option), default)]
4933 pub permissions: Option<isize>,
4934}
4935impl Directory {
4936 pub fn as_git(&self) -> GitRepository {
4938 let query = self.selection.select("asGit");
4939 GitRepository {
4940 proc: self.proc.clone(),
4941 selection: query,
4942 graphql_client: self.graphql_client.clone(),
4943 }
4944 }
4945 pub fn as_module(&self) -> Module {
4951 let query = self.selection.select("asModule");
4952 Module {
4953 proc: self.proc.clone(),
4954 selection: query,
4955 graphql_client: self.graphql_client.clone(),
4956 }
4957 }
4958 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4964 let mut query = self.selection.select("asModule");
4965 if let Some(source_root_path) = opts.source_root_path {
4966 query = query.arg("sourceRootPath", source_root_path);
4967 }
4968 Module {
4969 proc: self.proc.clone(),
4970 selection: query,
4971 graphql_client: self.graphql_client.clone(),
4972 }
4973 }
4974 pub fn as_module_source(&self) -> ModuleSource {
4980 let query = self.selection.select("asModuleSource");
4981 ModuleSource {
4982 proc: self.proc.clone(),
4983 selection: query,
4984 graphql_client: self.graphql_client.clone(),
4985 }
4986 }
4987 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4993 let mut query = self.selection.select("asModuleSource");
4994 if let Some(source_root_path) = opts.source_root_path {
4995 query = query.arg("sourceRootPath", source_root_path);
4996 }
4997 ModuleSource {
4998 proc: self.proc.clone(),
4999 selection: query,
5000 graphql_client: self.graphql_client.clone(),
5001 }
5002 }
5003 pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5010 let mut query = self.selection.select("changes");
5011 query = query.arg_lazy(
5012 "from",
5013 Box::new(move || {
5014 let from = from.clone();
5015 Box::pin(async move { from.into_id().await.unwrap().quote() })
5016 }),
5017 );
5018 Changeset {
5019 proc: self.proc.clone(),
5020 selection: query,
5021 graphql_client: self.graphql_client.clone(),
5022 }
5023 }
5024 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5035 let mut query = self.selection.select("chown");
5036 query = query.arg("path", path.into());
5037 query = query.arg("owner", owner.into());
5038 Directory {
5039 proc: self.proc.clone(),
5040 selection: query,
5041 graphql_client: self.graphql_client.clone(),
5042 }
5043 }
5044 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5050 let mut query = self.selection.select("diff");
5051 query = query.arg_lazy(
5052 "other",
5053 Box::new(move || {
5054 let other = other.clone();
5055 Box::pin(async move { other.into_id().await.unwrap().quote() })
5056 }),
5057 );
5058 Directory {
5059 proc: self.proc.clone(),
5060 selection: query,
5061 graphql_client: self.graphql_client.clone(),
5062 }
5063 }
5064 pub async fn digest(&self) -> Result<String, DaggerError> {
5066 let query = self.selection.select("digest");
5067 query.execute(self.graphql_client.clone()).await
5068 }
5069 pub fn directory(&self, path: impl Into<String>) -> Directory {
5075 let mut query = self.selection.select("directory");
5076 query = query.arg("path", path.into());
5077 Directory {
5078 proc: self.proc.clone(),
5079 selection: query,
5080 graphql_client: self.graphql_client.clone(),
5081 }
5082 }
5083 pub fn docker_build(&self) -> Container {
5089 let query = self.selection.select("dockerBuild");
5090 Container {
5091 proc: self.proc.clone(),
5092 selection: query,
5093 graphql_client: self.graphql_client.clone(),
5094 }
5095 }
5096 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5102 let mut query = self.selection.select("dockerBuild");
5103 if let Some(dockerfile) = opts.dockerfile {
5104 query = query.arg("dockerfile", dockerfile);
5105 }
5106 if let Some(platform) = opts.platform {
5107 query = query.arg("platform", platform);
5108 }
5109 if let Some(build_args) = opts.build_args {
5110 query = query.arg("buildArgs", build_args);
5111 }
5112 if let Some(target) = opts.target {
5113 query = query.arg("target", target);
5114 }
5115 if let Some(secrets) = opts.secrets {
5116 query = query.arg("secrets", secrets);
5117 }
5118 if let Some(no_init) = opts.no_init {
5119 query = query.arg("noInit", no_init);
5120 }
5121 Container {
5122 proc: self.proc.clone(),
5123 selection: query,
5124 graphql_client: self.graphql_client.clone(),
5125 }
5126 }
5127 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5133 let query = self.selection.select("entries");
5134 query.execute(self.graphql_client.clone()).await
5135 }
5136 pub async fn entries_opts<'a>(
5142 &self,
5143 opts: DirectoryEntriesOpts<'a>,
5144 ) -> Result<Vec<String>, DaggerError> {
5145 let mut query = self.selection.select("entries");
5146 if let Some(path) = opts.path {
5147 query = query.arg("path", path);
5148 }
5149 query.execute(self.graphql_client.clone()).await
5150 }
5151 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5158 let mut query = self.selection.select("exists");
5159 query = query.arg("path", path.into());
5160 query.execute(self.graphql_client.clone()).await
5161 }
5162 pub async fn exists_opts(
5169 &self,
5170 path: impl Into<String>,
5171 opts: DirectoryExistsOpts,
5172 ) -> Result<bool, DaggerError> {
5173 let mut query = self.selection.select("exists");
5174 query = query.arg("path", path.into());
5175 if let Some(expected_type) = opts.expected_type {
5176 query = query.arg("expectedType", expected_type);
5177 }
5178 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5179 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5180 }
5181 query.execute(self.graphql_client.clone()).await
5182 }
5183 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5190 let mut query = self.selection.select("export");
5191 query = query.arg("path", path.into());
5192 query.execute(self.graphql_client.clone()).await
5193 }
5194 pub async fn export_opts(
5201 &self,
5202 path: impl Into<String>,
5203 opts: DirectoryExportOpts,
5204 ) -> Result<String, DaggerError> {
5205 let mut query = self.selection.select("export");
5206 query = query.arg("path", path.into());
5207 if let Some(wipe) = opts.wipe {
5208 query = query.arg("wipe", wipe);
5209 }
5210 query.execute(self.graphql_client.clone()).await
5211 }
5212 pub fn file(&self, path: impl Into<String>) -> File {
5218 let mut query = self.selection.select("file");
5219 query = query.arg("path", path.into());
5220 File {
5221 proc: self.proc.clone(),
5222 selection: query,
5223 graphql_client: self.graphql_client.clone(),
5224 }
5225 }
5226 pub fn filter(&self) -> Directory {
5232 let query = self.selection.select("filter");
5233 Directory {
5234 proc: self.proc.clone(),
5235 selection: query,
5236 graphql_client: self.graphql_client.clone(),
5237 }
5238 }
5239 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5245 let mut query = self.selection.select("filter");
5246 if let Some(exclude) = opts.exclude {
5247 query = query.arg("exclude", exclude);
5248 }
5249 if let Some(include) = opts.include {
5250 query = query.arg("include", include);
5251 }
5252 Directory {
5253 proc: self.proc.clone(),
5254 selection: query,
5255 graphql_client: self.graphql_client.clone(),
5256 }
5257 }
5258 pub async fn find_up(
5265 &self,
5266 name: impl Into<String>,
5267 start: impl Into<String>,
5268 ) -> Result<String, DaggerError> {
5269 let mut query = self.selection.select("findUp");
5270 query = query.arg("name", name.into());
5271 query = query.arg("start", start.into());
5272 query.execute(self.graphql_client.clone()).await
5273 }
5274 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5280 let mut query = self.selection.select("glob");
5281 query = query.arg("pattern", pattern.into());
5282 query.execute(self.graphql_client.clone()).await
5283 }
5284 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5286 let query = self.selection.select("id");
5287 query.execute(self.graphql_client.clone()).await
5288 }
5289 pub async fn name(&self) -> Result<String, DaggerError> {
5291 let query = self.selection.select("name");
5292 query.execute(self.graphql_client.clone()).await
5293 }
5294 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5302 let mut query = self.selection.select("search");
5303 query = query.arg("pattern", pattern.into());
5304 vec![SearchResult {
5305 proc: self.proc.clone(),
5306 selection: query,
5307 graphql_client: self.graphql_client.clone(),
5308 }]
5309 }
5310 pub fn search_opts<'a>(
5318 &self,
5319 pattern: impl Into<String>,
5320 opts: DirectorySearchOpts<'a>,
5321 ) -> Vec<SearchResult> {
5322 let mut query = self.selection.select("search");
5323 query = query.arg("pattern", pattern.into());
5324 if let Some(paths) = opts.paths {
5325 query = query.arg("paths", paths);
5326 }
5327 if let Some(globs) = opts.globs {
5328 query = query.arg("globs", globs);
5329 }
5330 if let Some(literal) = opts.literal {
5331 query = query.arg("literal", literal);
5332 }
5333 if let Some(multiline) = opts.multiline {
5334 query = query.arg("multiline", multiline);
5335 }
5336 if let Some(dotall) = opts.dotall {
5337 query = query.arg("dotall", dotall);
5338 }
5339 if let Some(insensitive) = opts.insensitive {
5340 query = query.arg("insensitive", insensitive);
5341 }
5342 if let Some(skip_ignored) = opts.skip_ignored {
5343 query = query.arg("skipIgnored", skip_ignored);
5344 }
5345 if let Some(skip_hidden) = opts.skip_hidden {
5346 query = query.arg("skipHidden", skip_hidden);
5347 }
5348 if let Some(files_only) = opts.files_only {
5349 query = query.arg("filesOnly", files_only);
5350 }
5351 if let Some(limit) = opts.limit {
5352 query = query.arg("limit", limit);
5353 }
5354 vec![SearchResult {
5355 proc: self.proc.clone(),
5356 selection: query,
5357 graphql_client: self.graphql_client.clone(),
5358 }]
5359 }
5360 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5362 let query = self.selection.select("sync");
5363 query.execute(self.graphql_client.clone()).await
5364 }
5365 pub fn terminal(&self) -> Directory {
5371 let query = self.selection.select("terminal");
5372 Directory {
5373 proc: self.proc.clone(),
5374 selection: query,
5375 graphql_client: self.graphql_client.clone(),
5376 }
5377 }
5378 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5384 let mut query = self.selection.select("terminal");
5385 if let Some(container) = opts.container {
5386 query = query.arg("container", container);
5387 }
5388 if let Some(cmd) = opts.cmd {
5389 query = query.arg("cmd", cmd);
5390 }
5391 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5392 query = query.arg(
5393 "experimentalPrivilegedNesting",
5394 experimental_privileged_nesting,
5395 );
5396 }
5397 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5398 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5399 }
5400 Directory {
5401 proc: self.proc.clone(),
5402 selection: query,
5403 graphql_client: self.graphql_client.clone(),
5404 }
5405 }
5406 pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5412 let mut query = self.selection.select("withChanges");
5413 query = query.arg_lazy(
5414 "changes",
5415 Box::new(move || {
5416 let changes = changes.clone();
5417 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5418 }),
5419 );
5420 Directory {
5421 proc: self.proc.clone(),
5422 selection: query,
5423 graphql_client: self.graphql_client.clone(),
5424 }
5425 }
5426 pub fn with_directory(
5434 &self,
5435 path: impl Into<String>,
5436 directory: impl IntoID<DirectoryId>,
5437 ) -> Directory {
5438 let mut query = self.selection.select("withDirectory");
5439 query = query.arg("path", path.into());
5440 query = query.arg_lazy(
5441 "directory",
5442 Box::new(move || {
5443 let directory = directory.clone();
5444 Box::pin(async move { directory.into_id().await.unwrap().quote() })
5445 }),
5446 );
5447 Directory {
5448 proc: self.proc.clone(),
5449 selection: query,
5450 graphql_client: self.graphql_client.clone(),
5451 }
5452 }
5453 pub fn with_directory_opts<'a>(
5461 &self,
5462 path: impl Into<String>,
5463 directory: impl IntoID<DirectoryId>,
5464 opts: DirectoryWithDirectoryOpts<'a>,
5465 ) -> Directory {
5466 let mut query = self.selection.select("withDirectory");
5467 query = query.arg("path", path.into());
5468 query = query.arg_lazy(
5469 "directory",
5470 Box::new(move || {
5471 let directory = directory.clone();
5472 Box::pin(async move { directory.into_id().await.unwrap().quote() })
5473 }),
5474 );
5475 if let Some(exclude) = opts.exclude {
5476 query = query.arg("exclude", exclude);
5477 }
5478 if let Some(include) = opts.include {
5479 query = query.arg("include", include);
5480 }
5481 if let Some(owner) = opts.owner {
5482 query = query.arg("owner", owner);
5483 }
5484 Directory {
5485 proc: self.proc.clone(),
5486 selection: query,
5487 graphql_client: self.graphql_client.clone(),
5488 }
5489 }
5490 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5498 let mut query = self.selection.select("withFile");
5499 query = query.arg("path", path.into());
5500 query = query.arg_lazy(
5501 "source",
5502 Box::new(move || {
5503 let source = source.clone();
5504 Box::pin(async move { source.into_id().await.unwrap().quote() })
5505 }),
5506 );
5507 Directory {
5508 proc: self.proc.clone(),
5509 selection: query,
5510 graphql_client: self.graphql_client.clone(),
5511 }
5512 }
5513 pub fn with_file_opts<'a>(
5521 &self,
5522 path: impl Into<String>,
5523 source: impl IntoID<FileId>,
5524 opts: DirectoryWithFileOpts<'a>,
5525 ) -> Directory {
5526 let mut query = self.selection.select("withFile");
5527 query = query.arg("path", path.into());
5528 query = query.arg_lazy(
5529 "source",
5530 Box::new(move || {
5531 let source = source.clone();
5532 Box::pin(async move { source.into_id().await.unwrap().quote() })
5533 }),
5534 );
5535 if let Some(permissions) = opts.permissions {
5536 query = query.arg("permissions", permissions);
5537 }
5538 if let Some(owner) = opts.owner {
5539 query = query.arg("owner", owner);
5540 }
5541 Directory {
5542 proc: self.proc.clone(),
5543 selection: query,
5544 graphql_client: self.graphql_client.clone(),
5545 }
5546 }
5547 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5555 let mut query = self.selection.select("withFiles");
5556 query = query.arg("path", path.into());
5557 query = query.arg("sources", sources);
5558 Directory {
5559 proc: self.proc.clone(),
5560 selection: query,
5561 graphql_client: self.graphql_client.clone(),
5562 }
5563 }
5564 pub fn with_files_opts(
5572 &self,
5573 path: impl Into<String>,
5574 sources: Vec<FileId>,
5575 opts: DirectoryWithFilesOpts,
5576 ) -> Directory {
5577 let mut query = self.selection.select("withFiles");
5578 query = query.arg("path", path.into());
5579 query = query.arg("sources", sources);
5580 if let Some(permissions) = opts.permissions {
5581 query = query.arg("permissions", permissions);
5582 }
5583 Directory {
5584 proc: self.proc.clone(),
5585 selection: query,
5586 graphql_client: self.graphql_client.clone(),
5587 }
5588 }
5589 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5596 let mut query = self.selection.select("withNewDirectory");
5597 query = query.arg("path", path.into());
5598 Directory {
5599 proc: self.proc.clone(),
5600 selection: query,
5601 graphql_client: self.graphql_client.clone(),
5602 }
5603 }
5604 pub fn with_new_directory_opts(
5611 &self,
5612 path: impl Into<String>,
5613 opts: DirectoryWithNewDirectoryOpts,
5614 ) -> Directory {
5615 let mut query = self.selection.select("withNewDirectory");
5616 query = query.arg("path", path.into());
5617 if let Some(permissions) = opts.permissions {
5618 query = query.arg("permissions", permissions);
5619 }
5620 Directory {
5621 proc: self.proc.clone(),
5622 selection: query,
5623 graphql_client: self.graphql_client.clone(),
5624 }
5625 }
5626 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5634 let mut query = self.selection.select("withNewFile");
5635 query = query.arg("path", path.into());
5636 query = query.arg("contents", contents.into());
5637 Directory {
5638 proc: self.proc.clone(),
5639 selection: query,
5640 graphql_client: self.graphql_client.clone(),
5641 }
5642 }
5643 pub fn with_new_file_opts(
5651 &self,
5652 path: impl Into<String>,
5653 contents: impl Into<String>,
5654 opts: DirectoryWithNewFileOpts,
5655 ) -> Directory {
5656 let mut query = self.selection.select("withNewFile");
5657 query = query.arg("path", path.into());
5658 query = query.arg("contents", contents.into());
5659 if let Some(permissions) = opts.permissions {
5660 query = query.arg("permissions", permissions);
5661 }
5662 Directory {
5663 proc: self.proc.clone(),
5664 selection: query,
5665 graphql_client: self.graphql_client.clone(),
5666 }
5667 }
5668 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5674 let mut query = self.selection.select("withPatch");
5675 query = query.arg("patch", patch.into());
5676 Directory {
5677 proc: self.proc.clone(),
5678 selection: query,
5679 graphql_client: self.graphql_client.clone(),
5680 }
5681 }
5682 pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
5688 let mut query = self.selection.select("withPatchFile");
5689 query = query.arg_lazy(
5690 "patch",
5691 Box::new(move || {
5692 let patch = patch.clone();
5693 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5694 }),
5695 );
5696 Directory {
5697 proc: self.proc.clone(),
5698 selection: query,
5699 graphql_client: self.graphql_client.clone(),
5700 }
5701 }
5702 pub fn with_symlink(
5709 &self,
5710 target: impl Into<String>,
5711 link_name: impl Into<String>,
5712 ) -> Directory {
5713 let mut query = self.selection.select("withSymlink");
5714 query = query.arg("target", target.into());
5715 query = query.arg("linkName", link_name.into());
5716 Directory {
5717 proc: self.proc.clone(),
5718 selection: query,
5719 graphql_client: self.graphql_client.clone(),
5720 }
5721 }
5722 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5730 let mut query = self.selection.select("withTimestamps");
5731 query = query.arg("timestamp", timestamp);
5732 Directory {
5733 proc: self.proc.clone(),
5734 selection: query,
5735 graphql_client: self.graphql_client.clone(),
5736 }
5737 }
5738 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5744 let mut query = self.selection.select("withoutDirectory");
5745 query = query.arg("path", path.into());
5746 Directory {
5747 proc: self.proc.clone(),
5748 selection: query,
5749 graphql_client: self.graphql_client.clone(),
5750 }
5751 }
5752 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5758 let mut query = self.selection.select("withoutFile");
5759 query = query.arg("path", path.into());
5760 Directory {
5761 proc: self.proc.clone(),
5762 selection: query,
5763 graphql_client: self.graphql_client.clone(),
5764 }
5765 }
5766 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5772 let mut query = self.selection.select("withoutFiles");
5773 query = query.arg(
5774 "paths",
5775 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5776 );
5777 Directory {
5778 proc: self.proc.clone(),
5779 selection: query,
5780 graphql_client: self.graphql_client.clone(),
5781 }
5782 }
5783}
5784#[derive(Clone)]
5785pub struct Engine {
5786 pub proc: Option<Arc<DaggerSessionProc>>,
5787 pub selection: Selection,
5788 pub graphql_client: DynGraphQLClient,
5789}
5790impl Engine {
5791 pub async fn id(&self) -> Result<EngineId, DaggerError> {
5793 let query = self.selection.select("id");
5794 query.execute(self.graphql_client.clone()).await
5795 }
5796 pub fn local_cache(&self) -> EngineCache {
5798 let query = self.selection.select("localCache");
5799 EngineCache {
5800 proc: self.proc.clone(),
5801 selection: query,
5802 graphql_client: self.graphql_client.clone(),
5803 }
5804 }
5805}
5806#[derive(Clone)]
5807pub struct EngineCache {
5808 pub proc: Option<Arc<DaggerSessionProc>>,
5809 pub selection: Selection,
5810 pub graphql_client: DynGraphQLClient,
5811}
5812#[derive(Builder, Debug, PartialEq)]
5813pub struct EngineCacheEntrySetOpts<'a> {
5814 #[builder(setter(into, strip_option), default)]
5815 pub key: Option<&'a str>,
5816}
5817#[derive(Builder, Debug, PartialEq)]
5818pub struct EngineCachePruneOpts {
5819 #[builder(setter(into, strip_option), default)]
5821 pub use_default_policy: Option<bool>,
5822}
5823impl EngineCache {
5824 pub fn entry_set(&self) -> EngineCacheEntrySet {
5830 let query = self.selection.select("entrySet");
5831 EngineCacheEntrySet {
5832 proc: self.proc.clone(),
5833 selection: query,
5834 graphql_client: self.graphql_client.clone(),
5835 }
5836 }
5837 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5843 let mut query = self.selection.select("entrySet");
5844 if let Some(key) = opts.key {
5845 query = query.arg("key", key);
5846 }
5847 EngineCacheEntrySet {
5848 proc: self.proc.clone(),
5849 selection: query,
5850 graphql_client: self.graphql_client.clone(),
5851 }
5852 }
5853 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
5855 let query = self.selection.select("id");
5856 query.execute(self.graphql_client.clone()).await
5857 }
5858 pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
5860 let query = self.selection.select("keepBytes");
5861 query.execute(self.graphql_client.clone()).await
5862 }
5863 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5865 let query = self.selection.select("maxUsedSpace");
5866 query.execute(self.graphql_client.clone()).await
5867 }
5868 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5870 let query = self.selection.select("minFreeSpace");
5871 query.execute(self.graphql_client.clone()).await
5872 }
5873 pub async fn prune(&self) -> Result<Void, DaggerError> {
5879 let query = self.selection.select("prune");
5880 query.execute(self.graphql_client.clone()).await
5881 }
5882 pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
5888 let mut query = self.selection.select("prune");
5889 if let Some(use_default_policy) = opts.use_default_policy {
5890 query = query.arg("useDefaultPolicy", use_default_policy);
5891 }
5892 query.execute(self.graphql_client.clone()).await
5893 }
5894 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5896 let query = self.selection.select("reservedSpace");
5897 query.execute(self.graphql_client.clone()).await
5898 }
5899 pub async fn target_space(&self) -> Result<isize, DaggerError> {
5901 let query = self.selection.select("targetSpace");
5902 query.execute(self.graphql_client.clone()).await
5903 }
5904}
5905#[derive(Clone)]
5906pub struct EngineCacheEntry {
5907 pub proc: Option<Arc<DaggerSessionProc>>,
5908 pub selection: Selection,
5909 pub graphql_client: DynGraphQLClient,
5910}
5911impl EngineCacheEntry {
5912 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5914 let query = self.selection.select("activelyUsed");
5915 query.execute(self.graphql_client.clone()).await
5916 }
5917 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5919 let query = self.selection.select("createdTimeUnixNano");
5920 query.execute(self.graphql_client.clone()).await
5921 }
5922 pub async fn description(&self) -> Result<String, DaggerError> {
5924 let query = self.selection.select("description");
5925 query.execute(self.graphql_client.clone()).await
5926 }
5927 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5929 let query = self.selection.select("diskSpaceBytes");
5930 query.execute(self.graphql_client.clone()).await
5931 }
5932 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
5934 let query = self.selection.select("id");
5935 query.execute(self.graphql_client.clone()).await
5936 }
5937 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5939 let query = self.selection.select("mostRecentUseTimeUnixNano");
5940 query.execute(self.graphql_client.clone()).await
5941 }
5942}
5943#[derive(Clone)]
5944pub struct EngineCacheEntrySet {
5945 pub proc: Option<Arc<DaggerSessionProc>>,
5946 pub selection: Selection,
5947 pub graphql_client: DynGraphQLClient,
5948}
5949impl EngineCacheEntrySet {
5950 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5952 let query = self.selection.select("diskSpaceBytes");
5953 query.execute(self.graphql_client.clone()).await
5954 }
5955 pub fn entries(&self) -> Vec<EngineCacheEntry> {
5957 let query = self.selection.select("entries");
5958 vec![EngineCacheEntry {
5959 proc: self.proc.clone(),
5960 selection: query,
5961 graphql_client: self.graphql_client.clone(),
5962 }]
5963 }
5964 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
5966 let query = self.selection.select("entryCount");
5967 query.execute(self.graphql_client.clone()).await
5968 }
5969 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
5971 let query = self.selection.select("id");
5972 query.execute(self.graphql_client.clone()).await
5973 }
5974}
5975#[derive(Clone)]
5976pub struct EnumTypeDef {
5977 pub proc: Option<Arc<DaggerSessionProc>>,
5978 pub selection: Selection,
5979 pub graphql_client: DynGraphQLClient,
5980}
5981impl EnumTypeDef {
5982 pub async fn description(&self) -> Result<String, DaggerError> {
5984 let query = self.selection.select("description");
5985 query.execute(self.graphql_client.clone()).await
5986 }
5987 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
5989 let query = self.selection.select("id");
5990 query.execute(self.graphql_client.clone()).await
5991 }
5992 pub fn members(&self) -> Vec<EnumValueTypeDef> {
5994 let query = self.selection.select("members");
5995 vec![EnumValueTypeDef {
5996 proc: self.proc.clone(),
5997 selection: query,
5998 graphql_client: self.graphql_client.clone(),
5999 }]
6000 }
6001 pub async fn name(&self) -> Result<String, DaggerError> {
6003 let query = self.selection.select("name");
6004 query.execute(self.graphql_client.clone()).await
6005 }
6006 pub fn source_map(&self) -> SourceMap {
6008 let query = self.selection.select("sourceMap");
6009 SourceMap {
6010 proc: self.proc.clone(),
6011 selection: query,
6012 graphql_client: self.graphql_client.clone(),
6013 }
6014 }
6015 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6017 let query = self.selection.select("sourceModuleName");
6018 query.execute(self.graphql_client.clone()).await
6019 }
6020 pub fn values(&self) -> Vec<EnumValueTypeDef> {
6021 let query = self.selection.select("values");
6022 vec![EnumValueTypeDef {
6023 proc: self.proc.clone(),
6024 selection: query,
6025 graphql_client: self.graphql_client.clone(),
6026 }]
6027 }
6028}
6029#[derive(Clone)]
6030pub struct EnumValueTypeDef {
6031 pub proc: Option<Arc<DaggerSessionProc>>,
6032 pub selection: Selection,
6033 pub graphql_client: DynGraphQLClient,
6034}
6035impl EnumValueTypeDef {
6036 pub async fn description(&self) -> Result<String, DaggerError> {
6038 let query = self.selection.select("description");
6039 query.execute(self.graphql_client.clone()).await
6040 }
6041 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6043 let query = self.selection.select("id");
6044 query.execute(self.graphql_client.clone()).await
6045 }
6046 pub async fn name(&self) -> Result<String, DaggerError> {
6048 let query = self.selection.select("name");
6049 query.execute(self.graphql_client.clone()).await
6050 }
6051 pub fn source_map(&self) -> SourceMap {
6053 let query = self.selection.select("sourceMap");
6054 SourceMap {
6055 proc: self.proc.clone(),
6056 selection: query,
6057 graphql_client: self.graphql_client.clone(),
6058 }
6059 }
6060 pub async fn value(&self) -> Result<String, DaggerError> {
6062 let query = self.selection.select("value");
6063 query.execute(self.graphql_client.clone()).await
6064 }
6065}
6066#[derive(Clone)]
6067pub struct Env {
6068 pub proc: Option<Arc<DaggerSessionProc>>,
6069 pub selection: Selection,
6070 pub graphql_client: DynGraphQLClient,
6071}
6072impl Env {
6073 pub async fn id(&self) -> Result<EnvId, DaggerError> {
6075 let query = self.selection.select("id");
6076 query.execute(self.graphql_client.clone()).await
6077 }
6078 pub fn input(&self, name: impl Into<String>) -> Binding {
6080 let mut query = self.selection.select("input");
6081 query = query.arg("name", name.into());
6082 Binding {
6083 proc: self.proc.clone(),
6084 selection: query,
6085 graphql_client: self.graphql_client.clone(),
6086 }
6087 }
6088 pub fn inputs(&self) -> Vec<Binding> {
6090 let query = self.selection.select("inputs");
6091 vec![Binding {
6092 proc: self.proc.clone(),
6093 selection: query,
6094 graphql_client: self.graphql_client.clone(),
6095 }]
6096 }
6097 pub fn output(&self, name: impl Into<String>) -> Binding {
6099 let mut query = self.selection.select("output");
6100 query = query.arg("name", name.into());
6101 Binding {
6102 proc: self.proc.clone(),
6103 selection: query,
6104 graphql_client: self.graphql_client.clone(),
6105 }
6106 }
6107 pub fn outputs(&self) -> Vec<Binding> {
6109 let query = self.selection.select("outputs");
6110 vec![Binding {
6111 proc: self.proc.clone(),
6112 selection: query,
6113 graphql_client: self.graphql_client.clone(),
6114 }]
6115 }
6116 pub fn with_cache_volume_input(
6124 &self,
6125 name: impl Into<String>,
6126 value: impl IntoID<CacheVolumeId>,
6127 description: impl Into<String>,
6128 ) -> Env {
6129 let mut query = self.selection.select("withCacheVolumeInput");
6130 query = query.arg("name", name.into());
6131 query = query.arg_lazy(
6132 "value",
6133 Box::new(move || {
6134 let value = value.clone();
6135 Box::pin(async move { value.into_id().await.unwrap().quote() })
6136 }),
6137 );
6138 query = query.arg("description", description.into());
6139 Env {
6140 proc: self.proc.clone(),
6141 selection: query,
6142 graphql_client: self.graphql_client.clone(),
6143 }
6144 }
6145 pub fn with_cache_volume_output(
6152 &self,
6153 name: impl Into<String>,
6154 description: impl Into<String>,
6155 ) -> Env {
6156 let mut query = self.selection.select("withCacheVolumeOutput");
6157 query = query.arg("name", name.into());
6158 query = query.arg("description", description.into());
6159 Env {
6160 proc: self.proc.clone(),
6161 selection: query,
6162 graphql_client: self.graphql_client.clone(),
6163 }
6164 }
6165 pub fn with_changeset_input(
6173 &self,
6174 name: impl Into<String>,
6175 value: impl IntoID<ChangesetId>,
6176 description: impl Into<String>,
6177 ) -> Env {
6178 let mut query = self.selection.select("withChangesetInput");
6179 query = query.arg("name", name.into());
6180 query = query.arg_lazy(
6181 "value",
6182 Box::new(move || {
6183 let value = value.clone();
6184 Box::pin(async move { value.into_id().await.unwrap().quote() })
6185 }),
6186 );
6187 query = query.arg("description", description.into());
6188 Env {
6189 proc: self.proc.clone(),
6190 selection: query,
6191 graphql_client: self.graphql_client.clone(),
6192 }
6193 }
6194 pub fn with_changeset_output(
6201 &self,
6202 name: impl Into<String>,
6203 description: impl Into<String>,
6204 ) -> Env {
6205 let mut query = self.selection.select("withChangesetOutput");
6206 query = query.arg("name", name.into());
6207 query = query.arg("description", description.into());
6208 Env {
6209 proc: self.proc.clone(),
6210 selection: query,
6211 graphql_client: self.graphql_client.clone(),
6212 }
6213 }
6214 pub fn with_cloud_input(
6222 &self,
6223 name: impl Into<String>,
6224 value: impl IntoID<CloudId>,
6225 description: impl Into<String>,
6226 ) -> Env {
6227 let mut query = self.selection.select("withCloudInput");
6228 query = query.arg("name", name.into());
6229 query = query.arg_lazy(
6230 "value",
6231 Box::new(move || {
6232 let value = value.clone();
6233 Box::pin(async move { value.into_id().await.unwrap().quote() })
6234 }),
6235 );
6236 query = query.arg("description", description.into());
6237 Env {
6238 proc: self.proc.clone(),
6239 selection: query,
6240 graphql_client: self.graphql_client.clone(),
6241 }
6242 }
6243 pub fn with_cloud_output(
6250 &self,
6251 name: impl Into<String>,
6252 description: impl Into<String>,
6253 ) -> Env {
6254 let mut query = self.selection.select("withCloudOutput");
6255 query = query.arg("name", name.into());
6256 query = query.arg("description", description.into());
6257 Env {
6258 proc: self.proc.clone(),
6259 selection: query,
6260 graphql_client: self.graphql_client.clone(),
6261 }
6262 }
6263 pub fn with_container_input(
6271 &self,
6272 name: impl Into<String>,
6273 value: impl IntoID<ContainerId>,
6274 description: impl Into<String>,
6275 ) -> Env {
6276 let mut query = self.selection.select("withContainerInput");
6277 query = query.arg("name", name.into());
6278 query = query.arg_lazy(
6279 "value",
6280 Box::new(move || {
6281 let value = value.clone();
6282 Box::pin(async move { value.into_id().await.unwrap().quote() })
6283 }),
6284 );
6285 query = query.arg("description", description.into());
6286 Env {
6287 proc: self.proc.clone(),
6288 selection: query,
6289 graphql_client: self.graphql_client.clone(),
6290 }
6291 }
6292 pub fn with_container_output(
6299 &self,
6300 name: impl Into<String>,
6301 description: impl Into<String>,
6302 ) -> Env {
6303 let mut query = self.selection.select("withContainerOutput");
6304 query = query.arg("name", name.into());
6305 query = query.arg("description", description.into());
6306 Env {
6307 proc: self.proc.clone(),
6308 selection: query,
6309 graphql_client: self.graphql_client.clone(),
6310 }
6311 }
6312 pub fn with_directory_input(
6320 &self,
6321 name: impl Into<String>,
6322 value: impl IntoID<DirectoryId>,
6323 description: impl Into<String>,
6324 ) -> Env {
6325 let mut query = self.selection.select("withDirectoryInput");
6326 query = query.arg("name", name.into());
6327 query = query.arg_lazy(
6328 "value",
6329 Box::new(move || {
6330 let value = value.clone();
6331 Box::pin(async move { value.into_id().await.unwrap().quote() })
6332 }),
6333 );
6334 query = query.arg("description", description.into());
6335 Env {
6336 proc: self.proc.clone(),
6337 selection: query,
6338 graphql_client: self.graphql_client.clone(),
6339 }
6340 }
6341 pub fn with_directory_output(
6348 &self,
6349 name: impl Into<String>,
6350 description: impl Into<String>,
6351 ) -> Env {
6352 let mut query = self.selection.select("withDirectoryOutput");
6353 query = query.arg("name", name.into());
6354 query = query.arg("description", description.into());
6355 Env {
6356 proc: self.proc.clone(),
6357 selection: query,
6358 graphql_client: self.graphql_client.clone(),
6359 }
6360 }
6361 pub fn with_env_file_input(
6369 &self,
6370 name: impl Into<String>,
6371 value: impl IntoID<EnvFileId>,
6372 description: impl Into<String>,
6373 ) -> Env {
6374 let mut query = self.selection.select("withEnvFileInput");
6375 query = query.arg("name", name.into());
6376 query = query.arg_lazy(
6377 "value",
6378 Box::new(move || {
6379 let value = value.clone();
6380 Box::pin(async move { value.into_id().await.unwrap().quote() })
6381 }),
6382 );
6383 query = query.arg("description", description.into());
6384 Env {
6385 proc: self.proc.clone(),
6386 selection: query,
6387 graphql_client: self.graphql_client.clone(),
6388 }
6389 }
6390 pub fn with_env_file_output(
6397 &self,
6398 name: impl Into<String>,
6399 description: impl Into<String>,
6400 ) -> Env {
6401 let mut query = self.selection.select("withEnvFileOutput");
6402 query = query.arg("name", name.into());
6403 query = query.arg("description", description.into());
6404 Env {
6405 proc: self.proc.clone(),
6406 selection: query,
6407 graphql_client: self.graphql_client.clone(),
6408 }
6409 }
6410 pub fn with_env_input(
6418 &self,
6419 name: impl Into<String>,
6420 value: impl IntoID<EnvId>,
6421 description: impl Into<String>,
6422 ) -> Env {
6423 let mut query = self.selection.select("withEnvInput");
6424 query = query.arg("name", name.into());
6425 query = query.arg_lazy(
6426 "value",
6427 Box::new(move || {
6428 let value = value.clone();
6429 Box::pin(async move { value.into_id().await.unwrap().quote() })
6430 }),
6431 );
6432 query = query.arg("description", description.into());
6433 Env {
6434 proc: self.proc.clone(),
6435 selection: query,
6436 graphql_client: self.graphql_client.clone(),
6437 }
6438 }
6439 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6446 let mut query = self.selection.select("withEnvOutput");
6447 query = query.arg("name", name.into());
6448 query = query.arg("description", description.into());
6449 Env {
6450 proc: self.proc.clone(),
6451 selection: query,
6452 graphql_client: self.graphql_client.clone(),
6453 }
6454 }
6455 pub fn with_file_input(
6463 &self,
6464 name: impl Into<String>,
6465 value: impl IntoID<FileId>,
6466 description: impl Into<String>,
6467 ) -> Env {
6468 let mut query = self.selection.select("withFileInput");
6469 query = query.arg("name", name.into());
6470 query = query.arg_lazy(
6471 "value",
6472 Box::new(move || {
6473 let value = value.clone();
6474 Box::pin(async move { value.into_id().await.unwrap().quote() })
6475 }),
6476 );
6477 query = query.arg("description", description.into());
6478 Env {
6479 proc: self.proc.clone(),
6480 selection: query,
6481 graphql_client: self.graphql_client.clone(),
6482 }
6483 }
6484 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6491 let mut query = self.selection.select("withFileOutput");
6492 query = query.arg("name", name.into());
6493 query = query.arg("description", description.into());
6494 Env {
6495 proc: self.proc.clone(),
6496 selection: query,
6497 graphql_client: self.graphql_client.clone(),
6498 }
6499 }
6500 pub fn with_git_ref_input(
6508 &self,
6509 name: impl Into<String>,
6510 value: impl IntoID<GitRefId>,
6511 description: impl Into<String>,
6512 ) -> Env {
6513 let mut query = self.selection.select("withGitRefInput");
6514 query = query.arg("name", name.into());
6515 query = query.arg_lazy(
6516 "value",
6517 Box::new(move || {
6518 let value = value.clone();
6519 Box::pin(async move { value.into_id().await.unwrap().quote() })
6520 }),
6521 );
6522 query = query.arg("description", description.into());
6523 Env {
6524 proc: self.proc.clone(),
6525 selection: query,
6526 graphql_client: self.graphql_client.clone(),
6527 }
6528 }
6529 pub fn with_git_ref_output(
6536 &self,
6537 name: impl Into<String>,
6538 description: impl Into<String>,
6539 ) -> Env {
6540 let mut query = self.selection.select("withGitRefOutput");
6541 query = query.arg("name", name.into());
6542 query = query.arg("description", description.into());
6543 Env {
6544 proc: self.proc.clone(),
6545 selection: query,
6546 graphql_client: self.graphql_client.clone(),
6547 }
6548 }
6549 pub fn with_git_repository_input(
6557 &self,
6558 name: impl Into<String>,
6559 value: impl IntoID<GitRepositoryId>,
6560 description: impl Into<String>,
6561 ) -> Env {
6562 let mut query = self.selection.select("withGitRepositoryInput");
6563 query = query.arg("name", name.into());
6564 query = query.arg_lazy(
6565 "value",
6566 Box::new(move || {
6567 let value = value.clone();
6568 Box::pin(async move { value.into_id().await.unwrap().quote() })
6569 }),
6570 );
6571 query = query.arg("description", description.into());
6572 Env {
6573 proc: self.proc.clone(),
6574 selection: query,
6575 graphql_client: self.graphql_client.clone(),
6576 }
6577 }
6578 pub fn with_git_repository_output(
6585 &self,
6586 name: impl Into<String>,
6587 description: impl Into<String>,
6588 ) -> Env {
6589 let mut query = self.selection.select("withGitRepositoryOutput");
6590 query = query.arg("name", name.into());
6591 query = query.arg("description", description.into());
6592 Env {
6593 proc: self.proc.clone(),
6594 selection: query,
6595 graphql_client: self.graphql_client.clone(),
6596 }
6597 }
6598 pub fn with_json_value_input(
6606 &self,
6607 name: impl Into<String>,
6608 value: impl IntoID<JsonValueId>,
6609 description: impl Into<String>,
6610 ) -> Env {
6611 let mut query = self.selection.select("withJSONValueInput");
6612 query = query.arg("name", name.into());
6613 query = query.arg_lazy(
6614 "value",
6615 Box::new(move || {
6616 let value = value.clone();
6617 Box::pin(async move { value.into_id().await.unwrap().quote() })
6618 }),
6619 );
6620 query = query.arg("description", description.into());
6621 Env {
6622 proc: self.proc.clone(),
6623 selection: query,
6624 graphql_client: self.graphql_client.clone(),
6625 }
6626 }
6627 pub fn with_json_value_output(
6634 &self,
6635 name: impl Into<String>,
6636 description: impl Into<String>,
6637 ) -> Env {
6638 let mut query = self.selection.select("withJSONValueOutput");
6639 query = query.arg("name", name.into());
6640 query = query.arg("description", description.into());
6641 Env {
6642 proc: self.proc.clone(),
6643 selection: query,
6644 graphql_client: self.graphql_client.clone(),
6645 }
6646 }
6647 pub fn with_llm_input(
6655 &self,
6656 name: impl Into<String>,
6657 value: impl IntoID<Llmid>,
6658 description: impl Into<String>,
6659 ) -> Env {
6660 let mut query = self.selection.select("withLLMInput");
6661 query = query.arg("name", name.into());
6662 query = query.arg_lazy(
6663 "value",
6664 Box::new(move || {
6665 let value = value.clone();
6666 Box::pin(async move { value.into_id().await.unwrap().quote() })
6667 }),
6668 );
6669 query = query.arg("description", description.into());
6670 Env {
6671 proc: self.proc.clone(),
6672 selection: query,
6673 graphql_client: self.graphql_client.clone(),
6674 }
6675 }
6676 pub fn with_llm_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6683 let mut query = self.selection.select("withLLMOutput");
6684 query = query.arg("name", name.into());
6685 query = query.arg("description", description.into());
6686 Env {
6687 proc: self.proc.clone(),
6688 selection: query,
6689 graphql_client: self.graphql_client.clone(),
6690 }
6691 }
6692 pub fn with_module_config_client_input(
6700 &self,
6701 name: impl Into<String>,
6702 value: impl IntoID<ModuleConfigClientId>,
6703 description: impl Into<String>,
6704 ) -> Env {
6705 let mut query = self.selection.select("withModuleConfigClientInput");
6706 query = query.arg("name", name.into());
6707 query = query.arg_lazy(
6708 "value",
6709 Box::new(move || {
6710 let value = value.clone();
6711 Box::pin(async move { value.into_id().await.unwrap().quote() })
6712 }),
6713 );
6714 query = query.arg("description", description.into());
6715 Env {
6716 proc: self.proc.clone(),
6717 selection: query,
6718 graphql_client: self.graphql_client.clone(),
6719 }
6720 }
6721 pub fn with_module_config_client_output(
6728 &self,
6729 name: impl Into<String>,
6730 description: impl Into<String>,
6731 ) -> Env {
6732 let mut query = self.selection.select("withModuleConfigClientOutput");
6733 query = query.arg("name", name.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_module_input(
6749 &self,
6750 name: impl Into<String>,
6751 value: impl IntoID<ModuleId>,
6752 description: impl Into<String>,
6753 ) -> Env {
6754 let mut query = self.selection.select("withModuleInput");
6755 query = query.arg("name", name.into());
6756 query = query.arg_lazy(
6757 "value",
6758 Box::new(move || {
6759 let value = value.clone();
6760 Box::pin(async move { value.into_id().await.unwrap().quote() })
6761 }),
6762 );
6763 query = query.arg("description", description.into());
6764 Env {
6765 proc: self.proc.clone(),
6766 selection: query,
6767 graphql_client: self.graphql_client.clone(),
6768 }
6769 }
6770 pub fn with_module_output(
6777 &self,
6778 name: impl Into<String>,
6779 description: impl Into<String>,
6780 ) -> Env {
6781 let mut query = self.selection.select("withModuleOutput");
6782 query = query.arg("name", name.into());
6783 query = query.arg("description", description.into());
6784 Env {
6785 proc: self.proc.clone(),
6786 selection: query,
6787 graphql_client: self.graphql_client.clone(),
6788 }
6789 }
6790 pub fn with_module_source_input(
6798 &self,
6799 name: impl Into<String>,
6800 value: impl IntoID<ModuleSourceId>,
6801 description: impl Into<String>,
6802 ) -> Env {
6803 let mut query = self.selection.select("withModuleSourceInput");
6804 query = query.arg("name", name.into());
6805 query = query.arg_lazy(
6806 "value",
6807 Box::new(move || {
6808 let value = value.clone();
6809 Box::pin(async move { value.into_id().await.unwrap().quote() })
6810 }),
6811 );
6812 query = query.arg("description", description.into());
6813 Env {
6814 proc: self.proc.clone(),
6815 selection: query,
6816 graphql_client: self.graphql_client.clone(),
6817 }
6818 }
6819 pub fn with_module_source_output(
6826 &self,
6827 name: impl Into<String>,
6828 description: impl Into<String>,
6829 ) -> Env {
6830 let mut query = self.selection.select("withModuleSourceOutput");
6831 query = query.arg("name", name.into());
6832 query = query.arg("description", description.into());
6833 Env {
6834 proc: self.proc.clone(),
6835 selection: query,
6836 graphql_client: self.graphql_client.clone(),
6837 }
6838 }
6839 pub fn with_search_result_input(
6847 &self,
6848 name: impl Into<String>,
6849 value: impl IntoID<SearchResultId>,
6850 description: impl Into<String>,
6851 ) -> Env {
6852 let mut query = self.selection.select("withSearchResultInput");
6853 query = query.arg("name", name.into());
6854 query = query.arg_lazy(
6855 "value",
6856 Box::new(move || {
6857 let value = value.clone();
6858 Box::pin(async move { value.into_id().await.unwrap().quote() })
6859 }),
6860 );
6861 query = query.arg("description", description.into());
6862 Env {
6863 proc: self.proc.clone(),
6864 selection: query,
6865 graphql_client: self.graphql_client.clone(),
6866 }
6867 }
6868 pub fn with_search_result_output(
6875 &self,
6876 name: impl Into<String>,
6877 description: impl Into<String>,
6878 ) -> Env {
6879 let mut query = self.selection.select("withSearchResultOutput");
6880 query = query.arg("name", name.into());
6881 query = query.arg("description", description.into());
6882 Env {
6883 proc: self.proc.clone(),
6884 selection: query,
6885 graphql_client: self.graphql_client.clone(),
6886 }
6887 }
6888 pub fn with_search_submatch_input(
6896 &self,
6897 name: impl Into<String>,
6898 value: impl IntoID<SearchSubmatchId>,
6899 description: impl Into<String>,
6900 ) -> Env {
6901 let mut query = self.selection.select("withSearchSubmatchInput");
6902 query = query.arg("name", name.into());
6903 query = query.arg_lazy(
6904 "value",
6905 Box::new(move || {
6906 let value = value.clone();
6907 Box::pin(async move { value.into_id().await.unwrap().quote() })
6908 }),
6909 );
6910 query = query.arg("description", description.into());
6911 Env {
6912 proc: self.proc.clone(),
6913 selection: query,
6914 graphql_client: self.graphql_client.clone(),
6915 }
6916 }
6917 pub fn with_search_submatch_output(
6924 &self,
6925 name: impl Into<String>,
6926 description: impl Into<String>,
6927 ) -> Env {
6928 let mut query = self.selection.select("withSearchSubmatchOutput");
6929 query = query.arg("name", name.into());
6930 query = query.arg("description", description.into());
6931 Env {
6932 proc: self.proc.clone(),
6933 selection: query,
6934 graphql_client: self.graphql_client.clone(),
6935 }
6936 }
6937 pub fn with_secret_input(
6945 &self,
6946 name: impl Into<String>,
6947 value: impl IntoID<SecretId>,
6948 description: impl Into<String>,
6949 ) -> Env {
6950 let mut query = self.selection.select("withSecretInput");
6951 query = query.arg("name", name.into());
6952 query = query.arg_lazy(
6953 "value",
6954 Box::new(move || {
6955 let value = value.clone();
6956 Box::pin(async move { value.into_id().await.unwrap().quote() })
6957 }),
6958 );
6959 query = query.arg("description", description.into());
6960 Env {
6961 proc: self.proc.clone(),
6962 selection: query,
6963 graphql_client: self.graphql_client.clone(),
6964 }
6965 }
6966 pub fn with_secret_output(
6973 &self,
6974 name: impl Into<String>,
6975 description: impl Into<String>,
6976 ) -> Env {
6977 let mut query = self.selection.select("withSecretOutput");
6978 query = query.arg("name", name.into());
6979 query = query.arg("description", description.into());
6980 Env {
6981 proc: self.proc.clone(),
6982 selection: query,
6983 graphql_client: self.graphql_client.clone(),
6984 }
6985 }
6986 pub fn with_service_input(
6994 &self,
6995 name: impl Into<String>,
6996 value: impl IntoID<ServiceId>,
6997 description: impl Into<String>,
6998 ) -> Env {
6999 let mut query = self.selection.select("withServiceInput");
7000 query = query.arg("name", name.into());
7001 query = query.arg_lazy(
7002 "value",
7003 Box::new(move || {
7004 let value = value.clone();
7005 Box::pin(async move { value.into_id().await.unwrap().quote() })
7006 }),
7007 );
7008 query = query.arg("description", description.into());
7009 Env {
7010 proc: self.proc.clone(),
7011 selection: query,
7012 graphql_client: self.graphql_client.clone(),
7013 }
7014 }
7015 pub fn with_service_output(
7022 &self,
7023 name: impl Into<String>,
7024 description: impl Into<String>,
7025 ) -> Env {
7026 let mut query = self.selection.select("withServiceOutput");
7027 query = query.arg("name", name.into());
7028 query = query.arg("description", description.into());
7029 Env {
7030 proc: self.proc.clone(),
7031 selection: query,
7032 graphql_client: self.graphql_client.clone(),
7033 }
7034 }
7035 pub fn with_socket_input(
7043 &self,
7044 name: impl Into<String>,
7045 value: impl IntoID<SocketId>,
7046 description: impl Into<String>,
7047 ) -> Env {
7048 let mut query = self.selection.select("withSocketInput");
7049 query = query.arg("name", name.into());
7050 query = query.arg_lazy(
7051 "value",
7052 Box::new(move || {
7053 let value = value.clone();
7054 Box::pin(async move { value.into_id().await.unwrap().quote() })
7055 }),
7056 );
7057 query = query.arg("description", description.into());
7058 Env {
7059 proc: self.proc.clone(),
7060 selection: query,
7061 graphql_client: self.graphql_client.clone(),
7062 }
7063 }
7064 pub fn with_socket_output(
7071 &self,
7072 name: impl Into<String>,
7073 description: impl Into<String>,
7074 ) -> Env {
7075 let mut query = self.selection.select("withSocketOutput");
7076 query = query.arg("name", name.into());
7077 query = query.arg("description", description.into());
7078 Env {
7079 proc: self.proc.clone(),
7080 selection: query,
7081 graphql_client: self.graphql_client.clone(),
7082 }
7083 }
7084 pub fn with_string_input(
7092 &self,
7093 name: impl Into<String>,
7094 value: impl Into<String>,
7095 description: impl Into<String>,
7096 ) -> Env {
7097 let mut query = self.selection.select("withStringInput");
7098 query = query.arg("name", name.into());
7099 query = query.arg("value", value.into());
7100 query = query.arg("description", description.into());
7101 Env {
7102 proc: self.proc.clone(),
7103 selection: query,
7104 graphql_client: self.graphql_client.clone(),
7105 }
7106 }
7107 pub fn with_string_output(
7114 &self,
7115 name: impl Into<String>,
7116 description: impl Into<String>,
7117 ) -> Env {
7118 let mut query = self.selection.select("withStringOutput");
7119 query = query.arg("name", name.into());
7120 query = query.arg("description", description.into());
7121 Env {
7122 proc: self.proc.clone(),
7123 selection: query,
7124 graphql_client: self.graphql_client.clone(),
7125 }
7126 }
7127}
7128#[derive(Clone)]
7129pub struct EnvFile {
7130 pub proc: Option<Arc<DaggerSessionProc>>,
7131 pub selection: Selection,
7132 pub graphql_client: DynGraphQLClient,
7133}
7134impl EnvFile {
7135 pub fn as_file(&self) -> File {
7137 let query = self.selection.select("asFile");
7138 File {
7139 proc: self.proc.clone(),
7140 selection: query,
7141 graphql_client: self.graphql_client.clone(),
7142 }
7143 }
7144 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7150 let mut query = self.selection.select("exists");
7151 query = query.arg("name", name.into());
7152 query.execute(self.graphql_client.clone()).await
7153 }
7154 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7160 let mut query = self.selection.select("get");
7161 query = query.arg("name", name.into());
7162 query.execute(self.graphql_client.clone()).await
7163 }
7164 pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7166 let query = self.selection.select("id");
7167 query.execute(self.graphql_client.clone()).await
7168 }
7169 pub fn variables(&self) -> Vec<EnvVariable> {
7171 let query = self.selection.select("variables");
7172 vec![EnvVariable {
7173 proc: self.proc.clone(),
7174 selection: query,
7175 graphql_client: self.graphql_client.clone(),
7176 }]
7177 }
7178 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7185 let mut query = self.selection.select("withVariable");
7186 query = query.arg("name", name.into());
7187 query = query.arg("value", value.into());
7188 EnvFile {
7189 proc: self.proc.clone(),
7190 selection: query,
7191 graphql_client: self.graphql_client.clone(),
7192 }
7193 }
7194 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7200 let mut query = self.selection.select("withoutVariable");
7201 query = query.arg("name", name.into());
7202 EnvFile {
7203 proc: self.proc.clone(),
7204 selection: query,
7205 graphql_client: self.graphql_client.clone(),
7206 }
7207 }
7208}
7209#[derive(Clone)]
7210pub struct EnvVariable {
7211 pub proc: Option<Arc<DaggerSessionProc>>,
7212 pub selection: Selection,
7213 pub graphql_client: DynGraphQLClient,
7214}
7215impl EnvVariable {
7216 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
7218 let query = self.selection.select("id");
7219 query.execute(self.graphql_client.clone()).await
7220 }
7221 pub async fn name(&self) -> Result<String, DaggerError> {
7223 let query = self.selection.select("name");
7224 query.execute(self.graphql_client.clone()).await
7225 }
7226 pub async fn value(&self) -> Result<String, DaggerError> {
7228 let query = self.selection.select("value");
7229 query.execute(self.graphql_client.clone()).await
7230 }
7231}
7232#[derive(Clone)]
7233pub struct Error {
7234 pub proc: Option<Arc<DaggerSessionProc>>,
7235 pub selection: Selection,
7236 pub graphql_client: DynGraphQLClient,
7237}
7238impl Error {
7239 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
7241 let query = self.selection.select("id");
7242 query.execute(self.graphql_client.clone()).await
7243 }
7244 pub async fn message(&self) -> Result<String, DaggerError> {
7246 let query = self.selection.select("message");
7247 query.execute(self.graphql_client.clone()).await
7248 }
7249 pub fn values(&self) -> Vec<ErrorValue> {
7251 let query = self.selection.select("values");
7252 vec![ErrorValue {
7253 proc: self.proc.clone(),
7254 selection: query,
7255 graphql_client: self.graphql_client.clone(),
7256 }]
7257 }
7258 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7265 let mut query = self.selection.select("withValue");
7266 query = query.arg("name", name.into());
7267 query = query.arg("value", value);
7268 Error {
7269 proc: self.proc.clone(),
7270 selection: query,
7271 graphql_client: self.graphql_client.clone(),
7272 }
7273 }
7274}
7275#[derive(Clone)]
7276pub struct ErrorValue {
7277 pub proc: Option<Arc<DaggerSessionProc>>,
7278 pub selection: Selection,
7279 pub graphql_client: DynGraphQLClient,
7280}
7281impl ErrorValue {
7282 pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
7284 let query = self.selection.select("id");
7285 query.execute(self.graphql_client.clone()).await
7286 }
7287 pub async fn name(&self) -> Result<String, DaggerError> {
7289 let query = self.selection.select("name");
7290 query.execute(self.graphql_client.clone()).await
7291 }
7292 pub async fn value(&self) -> Result<Json, DaggerError> {
7294 let query = self.selection.select("value");
7295 query.execute(self.graphql_client.clone()).await
7296 }
7297}
7298#[derive(Clone)]
7299pub struct FieldTypeDef {
7300 pub proc: Option<Arc<DaggerSessionProc>>,
7301 pub selection: Selection,
7302 pub graphql_client: DynGraphQLClient,
7303}
7304impl FieldTypeDef {
7305 pub async fn description(&self) -> Result<String, DaggerError> {
7307 let query = self.selection.select("description");
7308 query.execute(self.graphql_client.clone()).await
7309 }
7310 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
7312 let query = self.selection.select("id");
7313 query.execute(self.graphql_client.clone()).await
7314 }
7315 pub async fn name(&self) -> Result<String, DaggerError> {
7317 let query = self.selection.select("name");
7318 query.execute(self.graphql_client.clone()).await
7319 }
7320 pub fn source_map(&self) -> SourceMap {
7322 let query = self.selection.select("sourceMap");
7323 SourceMap {
7324 proc: self.proc.clone(),
7325 selection: query,
7326 graphql_client: self.graphql_client.clone(),
7327 }
7328 }
7329 pub fn type_def(&self) -> TypeDef {
7331 let query = self.selection.select("typeDef");
7332 TypeDef {
7333 proc: self.proc.clone(),
7334 selection: query,
7335 graphql_client: self.graphql_client.clone(),
7336 }
7337 }
7338}
7339#[derive(Clone)]
7340pub struct File {
7341 pub proc: Option<Arc<DaggerSessionProc>>,
7342 pub selection: Selection,
7343 pub graphql_client: DynGraphQLClient,
7344}
7345#[derive(Builder, Debug, PartialEq)]
7346pub struct FileAsEnvFileOpts {
7347 #[builder(setter(into, strip_option), default)]
7349 pub expand: Option<bool>,
7350}
7351#[derive(Builder, Debug, PartialEq)]
7352pub struct FileContentsOpts {
7353 #[builder(setter(into, strip_option), default)]
7355 pub limit_lines: Option<isize>,
7356 #[builder(setter(into, strip_option), default)]
7358 pub offset_lines: Option<isize>,
7359}
7360#[derive(Builder, Debug, PartialEq)]
7361pub struct FileDigestOpts {
7362 #[builder(setter(into, strip_option), default)]
7364 pub exclude_metadata: Option<bool>,
7365}
7366#[derive(Builder, Debug, PartialEq)]
7367pub struct FileExportOpts {
7368 #[builder(setter(into, strip_option), default)]
7370 pub allow_parent_dir_path: Option<bool>,
7371}
7372#[derive(Builder, Debug, PartialEq)]
7373pub struct FileSearchOpts<'a> {
7374 #[builder(setter(into, strip_option), default)]
7376 pub dotall: Option<bool>,
7377 #[builder(setter(into, strip_option), default)]
7379 pub files_only: Option<bool>,
7380 #[builder(setter(into, strip_option), default)]
7381 pub globs: Option<Vec<&'a str>>,
7382 #[builder(setter(into, strip_option), default)]
7384 pub insensitive: Option<bool>,
7385 #[builder(setter(into, strip_option), default)]
7387 pub limit: Option<isize>,
7388 #[builder(setter(into, strip_option), default)]
7390 pub literal: Option<bool>,
7391 #[builder(setter(into, strip_option), default)]
7393 pub multiline: Option<bool>,
7394 #[builder(setter(into, strip_option), default)]
7395 pub paths: Option<Vec<&'a str>>,
7396 #[builder(setter(into, strip_option), default)]
7398 pub skip_hidden: Option<bool>,
7399 #[builder(setter(into, strip_option), default)]
7401 pub skip_ignored: Option<bool>,
7402}
7403#[derive(Builder, Debug, PartialEq)]
7404pub struct FileWithReplacedOpts {
7405 #[builder(setter(into, strip_option), default)]
7407 pub all: Option<bool>,
7408 #[builder(setter(into, strip_option), default)]
7410 pub first_from: Option<isize>,
7411}
7412impl File {
7413 pub fn as_env_file(&self) -> EnvFile {
7419 let query = self.selection.select("asEnvFile");
7420 EnvFile {
7421 proc: self.proc.clone(),
7422 selection: query,
7423 graphql_client: self.graphql_client.clone(),
7424 }
7425 }
7426 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7432 let mut query = self.selection.select("asEnvFile");
7433 if let Some(expand) = opts.expand {
7434 query = query.arg("expand", expand);
7435 }
7436 EnvFile {
7437 proc: self.proc.clone(),
7438 selection: query,
7439 graphql_client: self.graphql_client.clone(),
7440 }
7441 }
7442 pub fn chown(&self, owner: impl Into<String>) -> File {
7452 let mut query = self.selection.select("chown");
7453 query = query.arg("owner", owner.into());
7454 File {
7455 proc: self.proc.clone(),
7456 selection: query,
7457 graphql_client: self.graphql_client.clone(),
7458 }
7459 }
7460 pub async fn contents(&self) -> Result<String, DaggerError> {
7466 let query = self.selection.select("contents");
7467 query.execute(self.graphql_client.clone()).await
7468 }
7469 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7475 let mut query = self.selection.select("contents");
7476 if let Some(offset_lines) = opts.offset_lines {
7477 query = query.arg("offsetLines", offset_lines);
7478 }
7479 if let Some(limit_lines) = opts.limit_lines {
7480 query = query.arg("limitLines", limit_lines);
7481 }
7482 query.execute(self.graphql_client.clone()).await
7483 }
7484 pub async fn digest(&self) -> Result<String, DaggerError> {
7490 let query = self.selection.select("digest");
7491 query.execute(self.graphql_client.clone()).await
7492 }
7493 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7499 let mut query = self.selection.select("digest");
7500 if let Some(exclude_metadata) = opts.exclude_metadata {
7501 query = query.arg("excludeMetadata", exclude_metadata);
7502 }
7503 query.execute(self.graphql_client.clone()).await
7504 }
7505 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7512 let mut query = self.selection.select("export");
7513 query = query.arg("path", path.into());
7514 query.execute(self.graphql_client.clone()).await
7515 }
7516 pub async fn export_opts(
7523 &self,
7524 path: impl Into<String>,
7525 opts: FileExportOpts,
7526 ) -> Result<String, DaggerError> {
7527 let mut query = self.selection.select("export");
7528 query = query.arg("path", path.into());
7529 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7530 query = query.arg("allowParentDirPath", allow_parent_dir_path);
7531 }
7532 query.execute(self.graphql_client.clone()).await
7533 }
7534 pub async fn id(&self) -> Result<FileId, DaggerError> {
7536 let query = self.selection.select("id");
7537 query.execute(self.graphql_client.clone()).await
7538 }
7539 pub async fn name(&self) -> Result<String, DaggerError> {
7541 let query = self.selection.select("name");
7542 query.execute(self.graphql_client.clone()).await
7543 }
7544 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7552 let mut query = self.selection.select("search");
7553 query = query.arg("pattern", pattern.into());
7554 vec![SearchResult {
7555 proc: self.proc.clone(),
7556 selection: query,
7557 graphql_client: self.graphql_client.clone(),
7558 }]
7559 }
7560 pub fn search_opts<'a>(
7568 &self,
7569 pattern: impl Into<String>,
7570 opts: FileSearchOpts<'a>,
7571 ) -> Vec<SearchResult> {
7572 let mut query = self.selection.select("search");
7573 query = query.arg("pattern", pattern.into());
7574 if let Some(literal) = opts.literal {
7575 query = query.arg("literal", literal);
7576 }
7577 if let Some(multiline) = opts.multiline {
7578 query = query.arg("multiline", multiline);
7579 }
7580 if let Some(dotall) = opts.dotall {
7581 query = query.arg("dotall", dotall);
7582 }
7583 if let Some(insensitive) = opts.insensitive {
7584 query = query.arg("insensitive", insensitive);
7585 }
7586 if let Some(skip_ignored) = opts.skip_ignored {
7587 query = query.arg("skipIgnored", skip_ignored);
7588 }
7589 if let Some(skip_hidden) = opts.skip_hidden {
7590 query = query.arg("skipHidden", skip_hidden);
7591 }
7592 if let Some(files_only) = opts.files_only {
7593 query = query.arg("filesOnly", files_only);
7594 }
7595 if let Some(limit) = opts.limit {
7596 query = query.arg("limit", limit);
7597 }
7598 if let Some(paths) = opts.paths {
7599 query = query.arg("paths", paths);
7600 }
7601 if let Some(globs) = opts.globs {
7602 query = query.arg("globs", globs);
7603 }
7604 vec![SearchResult {
7605 proc: self.proc.clone(),
7606 selection: query,
7607 graphql_client: self.graphql_client.clone(),
7608 }]
7609 }
7610 pub async fn size(&self) -> Result<isize, DaggerError> {
7612 let query = self.selection.select("size");
7613 query.execute(self.graphql_client.clone()).await
7614 }
7615 pub async fn sync(&self) -> Result<FileId, DaggerError> {
7617 let query = self.selection.select("sync");
7618 query.execute(self.graphql_client.clone()).await
7619 }
7620 pub fn with_name(&self, name: impl Into<String>) -> File {
7626 let mut query = self.selection.select("withName");
7627 query = query.arg("name", name.into());
7628 File {
7629 proc: self.proc.clone(),
7630 selection: query,
7631 graphql_client: self.graphql_client.clone(),
7632 }
7633 }
7634 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7646 let mut query = self.selection.select("withReplaced");
7647 query = query.arg("search", search.into());
7648 query = query.arg("replacement", replacement.into());
7649 File {
7650 proc: self.proc.clone(),
7651 selection: query,
7652 graphql_client: self.graphql_client.clone(),
7653 }
7654 }
7655 pub fn with_replaced_opts(
7667 &self,
7668 search: impl Into<String>,
7669 replacement: impl Into<String>,
7670 opts: FileWithReplacedOpts,
7671 ) -> File {
7672 let mut query = self.selection.select("withReplaced");
7673 query = query.arg("search", search.into());
7674 query = query.arg("replacement", replacement.into());
7675 if let Some(all) = opts.all {
7676 query = query.arg("all", all);
7677 }
7678 if let Some(first_from) = opts.first_from {
7679 query = query.arg("firstFrom", first_from);
7680 }
7681 File {
7682 proc: self.proc.clone(),
7683 selection: query,
7684 graphql_client: self.graphql_client.clone(),
7685 }
7686 }
7687 pub fn with_timestamps(&self, timestamp: isize) -> File {
7695 let mut query = self.selection.select("withTimestamps");
7696 query = query.arg("timestamp", timestamp);
7697 File {
7698 proc: self.proc.clone(),
7699 selection: query,
7700 graphql_client: self.graphql_client.clone(),
7701 }
7702 }
7703}
7704#[derive(Clone)]
7705pub struct Function {
7706 pub proc: Option<Arc<DaggerSessionProc>>,
7707 pub selection: Selection,
7708 pub graphql_client: DynGraphQLClient,
7709}
7710#[derive(Builder, Debug, PartialEq)]
7711pub struct FunctionWithArgOpts<'a> {
7712 #[builder(setter(into, strip_option), default)]
7714 pub default_path: Option<&'a str>,
7715 #[builder(setter(into, strip_option), default)]
7717 pub default_value: Option<Json>,
7718 #[builder(setter(into, strip_option), default)]
7720 pub description: Option<&'a str>,
7721 #[builder(setter(into, strip_option), default)]
7723 pub ignore: Option<Vec<&'a str>>,
7724 #[builder(setter(into, strip_option), default)]
7726 pub source_map: Option<SourceMapId>,
7727}
7728impl Function {
7729 pub fn args(&self) -> Vec<FunctionArg> {
7731 let query = self.selection.select("args");
7732 vec![FunctionArg {
7733 proc: self.proc.clone(),
7734 selection: query,
7735 graphql_client: self.graphql_client.clone(),
7736 }]
7737 }
7738 pub async fn description(&self) -> Result<String, DaggerError> {
7740 let query = self.selection.select("description");
7741 query.execute(self.graphql_client.clone()).await
7742 }
7743 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
7745 let query = self.selection.select("id");
7746 query.execute(self.graphql_client.clone()).await
7747 }
7748 pub async fn name(&self) -> Result<String, DaggerError> {
7750 let query = self.selection.select("name");
7751 query.execute(self.graphql_client.clone()).await
7752 }
7753 pub fn return_type(&self) -> TypeDef {
7755 let query = self.selection.select("returnType");
7756 TypeDef {
7757 proc: self.proc.clone(),
7758 selection: query,
7759 graphql_client: self.graphql_client.clone(),
7760 }
7761 }
7762 pub fn source_map(&self) -> SourceMap {
7764 let query = self.selection.select("sourceMap");
7765 SourceMap {
7766 proc: self.proc.clone(),
7767 selection: query,
7768 graphql_client: self.graphql_client.clone(),
7769 }
7770 }
7771 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
7779 let mut query = self.selection.select("withArg");
7780 query = query.arg("name", name.into());
7781 query = query.arg_lazy(
7782 "typeDef",
7783 Box::new(move || {
7784 let type_def = type_def.clone();
7785 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7786 }),
7787 );
7788 Function {
7789 proc: self.proc.clone(),
7790 selection: query,
7791 graphql_client: self.graphql_client.clone(),
7792 }
7793 }
7794 pub fn with_arg_opts<'a>(
7802 &self,
7803 name: impl Into<String>,
7804 type_def: impl IntoID<TypeDefId>,
7805 opts: FunctionWithArgOpts<'a>,
7806 ) -> Function {
7807 let mut query = self.selection.select("withArg");
7808 query = query.arg("name", name.into());
7809 query = query.arg_lazy(
7810 "typeDef",
7811 Box::new(move || {
7812 let type_def = type_def.clone();
7813 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7814 }),
7815 );
7816 if let Some(description) = opts.description {
7817 query = query.arg("description", description);
7818 }
7819 if let Some(default_value) = opts.default_value {
7820 query = query.arg("defaultValue", default_value);
7821 }
7822 if let Some(default_path) = opts.default_path {
7823 query = query.arg("defaultPath", default_path);
7824 }
7825 if let Some(ignore) = opts.ignore {
7826 query = query.arg("ignore", ignore);
7827 }
7828 if let Some(source_map) = opts.source_map {
7829 query = query.arg("sourceMap", source_map);
7830 }
7831 Function {
7832 proc: self.proc.clone(),
7833 selection: query,
7834 graphql_client: self.graphql_client.clone(),
7835 }
7836 }
7837 pub fn with_description(&self, description: impl Into<String>) -> Function {
7843 let mut query = self.selection.select("withDescription");
7844 query = query.arg("description", description.into());
7845 Function {
7846 proc: self.proc.clone(),
7847 selection: query,
7848 graphql_client: self.graphql_client.clone(),
7849 }
7850 }
7851 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
7857 let mut query = self.selection.select("withSourceMap");
7858 query = query.arg_lazy(
7859 "sourceMap",
7860 Box::new(move || {
7861 let source_map = source_map.clone();
7862 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
7863 }),
7864 );
7865 Function {
7866 proc: self.proc.clone(),
7867 selection: query,
7868 graphql_client: self.graphql_client.clone(),
7869 }
7870 }
7871}
7872#[derive(Clone)]
7873pub struct FunctionArg {
7874 pub proc: Option<Arc<DaggerSessionProc>>,
7875 pub selection: Selection,
7876 pub graphql_client: DynGraphQLClient,
7877}
7878impl FunctionArg {
7879 pub async fn default_path(&self) -> Result<String, DaggerError> {
7881 let query = self.selection.select("defaultPath");
7882 query.execute(self.graphql_client.clone()).await
7883 }
7884 pub async fn default_value(&self) -> Result<Json, DaggerError> {
7886 let query = self.selection.select("defaultValue");
7887 query.execute(self.graphql_client.clone()).await
7888 }
7889 pub async fn description(&self) -> Result<String, DaggerError> {
7891 let query = self.selection.select("description");
7892 query.execute(self.graphql_client.clone()).await
7893 }
7894 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
7896 let query = self.selection.select("id");
7897 query.execute(self.graphql_client.clone()).await
7898 }
7899 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
7901 let query = self.selection.select("ignore");
7902 query.execute(self.graphql_client.clone()).await
7903 }
7904 pub async fn name(&self) -> Result<String, DaggerError> {
7906 let query = self.selection.select("name");
7907 query.execute(self.graphql_client.clone()).await
7908 }
7909 pub fn source_map(&self) -> SourceMap {
7911 let query = self.selection.select("sourceMap");
7912 SourceMap {
7913 proc: self.proc.clone(),
7914 selection: query,
7915 graphql_client: self.graphql_client.clone(),
7916 }
7917 }
7918 pub fn type_def(&self) -> TypeDef {
7920 let query = self.selection.select("typeDef");
7921 TypeDef {
7922 proc: self.proc.clone(),
7923 selection: query,
7924 graphql_client: self.graphql_client.clone(),
7925 }
7926 }
7927}
7928#[derive(Clone)]
7929pub struct FunctionCall {
7930 pub proc: Option<Arc<DaggerSessionProc>>,
7931 pub selection: Selection,
7932 pub graphql_client: DynGraphQLClient,
7933}
7934impl FunctionCall {
7935 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
7937 let query = self.selection.select("id");
7938 query.execute(self.graphql_client.clone()).await
7939 }
7940 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
7942 let query = self.selection.select("inputArgs");
7943 vec![FunctionCallArgValue {
7944 proc: self.proc.clone(),
7945 selection: query,
7946 graphql_client: self.graphql_client.clone(),
7947 }]
7948 }
7949 pub async fn name(&self) -> Result<String, DaggerError> {
7951 let query = self.selection.select("name");
7952 query.execute(self.graphql_client.clone()).await
7953 }
7954 pub async fn parent(&self) -> Result<Json, DaggerError> {
7956 let query = self.selection.select("parent");
7957 query.execute(self.graphql_client.clone()).await
7958 }
7959 pub async fn parent_name(&self) -> Result<String, DaggerError> {
7961 let query = self.selection.select("parentName");
7962 query.execute(self.graphql_client.clone()).await
7963 }
7964 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
7970 let mut query = self.selection.select("returnError");
7971 query = query.arg_lazy(
7972 "error",
7973 Box::new(move || {
7974 let error = error.clone();
7975 Box::pin(async move { error.into_id().await.unwrap().quote() })
7976 }),
7977 );
7978 query.execute(self.graphql_client.clone()).await
7979 }
7980 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
7986 let mut query = self.selection.select("returnValue");
7987 query = query.arg("value", value);
7988 query.execute(self.graphql_client.clone()).await
7989 }
7990}
7991#[derive(Clone)]
7992pub struct FunctionCallArgValue {
7993 pub proc: Option<Arc<DaggerSessionProc>>,
7994 pub selection: Selection,
7995 pub graphql_client: DynGraphQLClient,
7996}
7997impl FunctionCallArgValue {
7998 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8000 let query = self.selection.select("id");
8001 query.execute(self.graphql_client.clone()).await
8002 }
8003 pub async fn name(&self) -> Result<String, DaggerError> {
8005 let query = self.selection.select("name");
8006 query.execute(self.graphql_client.clone()).await
8007 }
8008 pub async fn value(&self) -> Result<Json, DaggerError> {
8010 let query = self.selection.select("value");
8011 query.execute(self.graphql_client.clone()).await
8012 }
8013}
8014#[derive(Clone)]
8015pub struct GeneratedCode {
8016 pub proc: Option<Arc<DaggerSessionProc>>,
8017 pub selection: Selection,
8018 pub graphql_client: DynGraphQLClient,
8019}
8020impl GeneratedCode {
8021 pub fn code(&self) -> Directory {
8023 let query = self.selection.select("code");
8024 Directory {
8025 proc: self.proc.clone(),
8026 selection: query,
8027 graphql_client: self.graphql_client.clone(),
8028 }
8029 }
8030 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8032 let query = self.selection.select("id");
8033 query.execute(self.graphql_client.clone()).await
8034 }
8035 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8037 let query = self.selection.select("vcsGeneratedPaths");
8038 query.execute(self.graphql_client.clone()).await
8039 }
8040 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8042 let query = self.selection.select("vcsIgnoredPaths");
8043 query.execute(self.graphql_client.clone()).await
8044 }
8045 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8047 let mut query = self.selection.select("withVCSGeneratedPaths");
8048 query = query.arg(
8049 "paths",
8050 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8051 );
8052 GeneratedCode {
8053 proc: self.proc.clone(),
8054 selection: query,
8055 graphql_client: self.graphql_client.clone(),
8056 }
8057 }
8058 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8060 let mut query = self.selection.select("withVCSIgnoredPaths");
8061 query = query.arg(
8062 "paths",
8063 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8064 );
8065 GeneratedCode {
8066 proc: self.proc.clone(),
8067 selection: query,
8068 graphql_client: self.graphql_client.clone(),
8069 }
8070 }
8071}
8072#[derive(Clone)]
8073pub struct GitRef {
8074 pub proc: Option<Arc<DaggerSessionProc>>,
8075 pub selection: Selection,
8076 pub graphql_client: DynGraphQLClient,
8077}
8078#[derive(Builder, Debug, PartialEq)]
8079pub struct GitRefTreeOpts {
8080 #[builder(setter(into, strip_option), default)]
8082 pub depth: Option<isize>,
8083 #[builder(setter(into, strip_option), default)]
8085 pub discard_git_dir: Option<bool>,
8086}
8087impl GitRef {
8088 pub async fn commit(&self) -> Result<String, DaggerError> {
8090 let query = self.selection.select("commit");
8091 query.execute(self.graphql_client.clone()).await
8092 }
8093 pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
8099 let mut query = self.selection.select("commonAncestor");
8100 query = query.arg_lazy(
8101 "other",
8102 Box::new(move || {
8103 let other = other.clone();
8104 Box::pin(async move { other.into_id().await.unwrap().quote() })
8105 }),
8106 );
8107 GitRef {
8108 proc: self.proc.clone(),
8109 selection: query,
8110 graphql_client: self.graphql_client.clone(),
8111 }
8112 }
8113 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
8115 let query = self.selection.select("id");
8116 query.execute(self.graphql_client.clone()).await
8117 }
8118 pub async fn r#ref(&self) -> Result<String, DaggerError> {
8120 let query = self.selection.select("ref");
8121 query.execute(self.graphql_client.clone()).await
8122 }
8123 pub fn tree(&self) -> Directory {
8129 let query = self.selection.select("tree");
8130 Directory {
8131 proc: self.proc.clone(),
8132 selection: query,
8133 graphql_client: self.graphql_client.clone(),
8134 }
8135 }
8136 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
8142 let mut query = self.selection.select("tree");
8143 if let Some(discard_git_dir) = opts.discard_git_dir {
8144 query = query.arg("discardGitDir", discard_git_dir);
8145 }
8146 if let Some(depth) = opts.depth {
8147 query = query.arg("depth", depth);
8148 }
8149 Directory {
8150 proc: self.proc.clone(),
8151 selection: query,
8152 graphql_client: self.graphql_client.clone(),
8153 }
8154 }
8155}
8156#[derive(Clone)]
8157pub struct GitRepository {
8158 pub proc: Option<Arc<DaggerSessionProc>>,
8159 pub selection: Selection,
8160 pub graphql_client: DynGraphQLClient,
8161}
8162#[derive(Builder, Debug, PartialEq)]
8163pub struct GitRepositoryBranchesOpts<'a> {
8164 #[builder(setter(into, strip_option), default)]
8166 pub patterns: Option<Vec<&'a str>>,
8167}
8168#[derive(Builder, Debug, PartialEq)]
8169pub struct GitRepositoryTagsOpts<'a> {
8170 #[builder(setter(into, strip_option), default)]
8172 pub patterns: Option<Vec<&'a str>>,
8173}
8174impl GitRepository {
8175 pub fn branch(&self, name: impl Into<String>) -> GitRef {
8181 let mut query = self.selection.select("branch");
8182 query = query.arg("name", name.into());
8183 GitRef {
8184 proc: self.proc.clone(),
8185 selection: query,
8186 graphql_client: self.graphql_client.clone(),
8187 }
8188 }
8189 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
8195 let query = self.selection.select("branches");
8196 query.execute(self.graphql_client.clone()).await
8197 }
8198 pub async fn branches_opts<'a>(
8204 &self,
8205 opts: GitRepositoryBranchesOpts<'a>,
8206 ) -> Result<Vec<String>, DaggerError> {
8207 let mut query = self.selection.select("branches");
8208 if let Some(patterns) = opts.patterns {
8209 query = query.arg("patterns", patterns);
8210 }
8211 query.execute(self.graphql_client.clone()).await
8212 }
8213 pub fn commit(&self, id: impl Into<String>) -> GitRef {
8219 let mut query = self.selection.select("commit");
8220 query = query.arg("id", id.into());
8221 GitRef {
8222 proc: self.proc.clone(),
8223 selection: query,
8224 graphql_client: self.graphql_client.clone(),
8225 }
8226 }
8227 pub fn head(&self) -> GitRef {
8229 let query = self.selection.select("head");
8230 GitRef {
8231 proc: self.proc.clone(),
8232 selection: query,
8233 graphql_client: self.graphql_client.clone(),
8234 }
8235 }
8236 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
8238 let query = self.selection.select("id");
8239 query.execute(self.graphql_client.clone()).await
8240 }
8241 pub fn latest_version(&self) -> GitRef {
8243 let query = self.selection.select("latestVersion");
8244 GitRef {
8245 proc: self.proc.clone(),
8246 selection: query,
8247 graphql_client: self.graphql_client.clone(),
8248 }
8249 }
8250 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
8256 let mut query = self.selection.select("ref");
8257 query = query.arg("name", name.into());
8258 GitRef {
8259 proc: self.proc.clone(),
8260 selection: query,
8261 graphql_client: self.graphql_client.clone(),
8262 }
8263 }
8264 pub fn tag(&self, name: impl Into<String>) -> GitRef {
8270 let mut query = self.selection.select("tag");
8271 query = query.arg("name", name.into());
8272 GitRef {
8273 proc: self.proc.clone(),
8274 selection: query,
8275 graphql_client: self.graphql_client.clone(),
8276 }
8277 }
8278 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
8284 let query = self.selection.select("tags");
8285 query.execute(self.graphql_client.clone()).await
8286 }
8287 pub async fn tags_opts<'a>(
8293 &self,
8294 opts: GitRepositoryTagsOpts<'a>,
8295 ) -> Result<Vec<String>, DaggerError> {
8296 let mut query = self.selection.select("tags");
8297 if let Some(patterns) = opts.patterns {
8298 query = query.arg("patterns", patterns);
8299 }
8300 query.execute(self.graphql_client.clone()).await
8301 }
8302 pub async fn url(&self) -> Result<String, DaggerError> {
8304 let query = self.selection.select("url");
8305 query.execute(self.graphql_client.clone()).await
8306 }
8307 pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
8313 let mut query = self.selection.select("withAuthHeader");
8314 query = query.arg_lazy(
8315 "header",
8316 Box::new(move || {
8317 let header = header.clone();
8318 Box::pin(async move { header.into_id().await.unwrap().quote() })
8319 }),
8320 );
8321 GitRepository {
8322 proc: self.proc.clone(),
8323 selection: query,
8324 graphql_client: self.graphql_client.clone(),
8325 }
8326 }
8327 pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
8333 let mut query = self.selection.select("withAuthToken");
8334 query = query.arg_lazy(
8335 "token",
8336 Box::new(move || {
8337 let token = token.clone();
8338 Box::pin(async move { token.into_id().await.unwrap().quote() })
8339 }),
8340 );
8341 GitRepository {
8342 proc: self.proc.clone(),
8343 selection: query,
8344 graphql_client: self.graphql_client.clone(),
8345 }
8346 }
8347}
8348#[derive(Clone)]
8349pub struct Host {
8350 pub proc: Option<Arc<DaggerSessionProc>>,
8351 pub selection: Selection,
8352 pub graphql_client: DynGraphQLClient,
8353}
8354#[derive(Builder, Debug, PartialEq)]
8355pub struct HostDirectoryOpts<'a> {
8356 #[builder(setter(into, strip_option), default)]
8358 pub exclude: Option<Vec<&'a str>>,
8359 #[builder(setter(into, strip_option), default)]
8361 pub gitignore: Option<bool>,
8362 #[builder(setter(into, strip_option), default)]
8364 pub include: Option<Vec<&'a str>>,
8365 #[builder(setter(into, strip_option), default)]
8367 pub no_cache: Option<bool>,
8368}
8369#[derive(Builder, Debug, PartialEq)]
8370pub struct HostFileOpts {
8371 #[builder(setter(into, strip_option), default)]
8373 pub no_cache: Option<bool>,
8374}
8375#[derive(Builder, Debug, PartialEq)]
8376pub struct HostFindUpOpts {
8377 #[builder(setter(into, strip_option), default)]
8378 pub no_cache: Option<bool>,
8379}
8380#[derive(Builder, Debug, PartialEq)]
8381pub struct HostServiceOpts<'a> {
8382 #[builder(setter(into, strip_option), default)]
8384 pub host: Option<&'a str>,
8385}
8386#[derive(Builder, Debug, PartialEq)]
8387pub struct HostTunnelOpts {
8388 #[builder(setter(into, strip_option), default)]
8391 pub native: Option<bool>,
8392 #[builder(setter(into, strip_option), default)]
8397 pub ports: Option<Vec<PortForward>>,
8398}
8399impl Host {
8400 pub fn container_image(&self, name: impl Into<String>) -> Container {
8406 let mut query = self.selection.select("containerImage");
8407 query = query.arg("name", name.into());
8408 Container {
8409 proc: self.proc.clone(),
8410 selection: query,
8411 graphql_client: self.graphql_client.clone(),
8412 }
8413 }
8414 pub fn directory(&self, path: impl Into<String>) -> Directory {
8421 let mut query = self.selection.select("directory");
8422 query = query.arg("path", path.into());
8423 Directory {
8424 proc: self.proc.clone(),
8425 selection: query,
8426 graphql_client: self.graphql_client.clone(),
8427 }
8428 }
8429 pub fn directory_opts<'a>(
8436 &self,
8437 path: impl Into<String>,
8438 opts: HostDirectoryOpts<'a>,
8439 ) -> Directory {
8440 let mut query = self.selection.select("directory");
8441 query = query.arg("path", path.into());
8442 if let Some(exclude) = opts.exclude {
8443 query = query.arg("exclude", exclude);
8444 }
8445 if let Some(include) = opts.include {
8446 query = query.arg("include", include);
8447 }
8448 if let Some(no_cache) = opts.no_cache {
8449 query = query.arg("noCache", no_cache);
8450 }
8451 if let Some(gitignore) = opts.gitignore {
8452 query = query.arg("gitignore", gitignore);
8453 }
8454 Directory {
8455 proc: self.proc.clone(),
8456 selection: query,
8457 graphql_client: self.graphql_client.clone(),
8458 }
8459 }
8460 pub fn file(&self, path: impl Into<String>) -> File {
8467 let mut query = self.selection.select("file");
8468 query = query.arg("path", path.into());
8469 File {
8470 proc: self.proc.clone(),
8471 selection: query,
8472 graphql_client: self.graphql_client.clone(),
8473 }
8474 }
8475 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
8482 let mut query = self.selection.select("file");
8483 query = query.arg("path", path.into());
8484 if let Some(no_cache) = opts.no_cache {
8485 query = query.arg("noCache", no_cache);
8486 }
8487 File {
8488 proc: self.proc.clone(),
8489 selection: query,
8490 graphql_client: self.graphql_client.clone(),
8491 }
8492 }
8493 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8500 let mut query = self.selection.select("findUp");
8501 query = query.arg("name", name.into());
8502 query.execute(self.graphql_client.clone()).await
8503 }
8504 pub async fn find_up_opts(
8511 &self,
8512 name: impl Into<String>,
8513 opts: HostFindUpOpts,
8514 ) -> Result<String, DaggerError> {
8515 let mut query = self.selection.select("findUp");
8516 query = query.arg("name", name.into());
8517 if let Some(no_cache) = opts.no_cache {
8518 query = query.arg("noCache", no_cache);
8519 }
8520 query.execute(self.graphql_client.clone()).await
8521 }
8522 pub async fn id(&self) -> Result<HostId, DaggerError> {
8524 let query = self.selection.select("id");
8525 query.execute(self.graphql_client.clone()).await
8526 }
8527 pub fn service(&self, ports: Vec<PortForward>) -> Service {
8538 let mut query = self.selection.select("service");
8539 query = query.arg("ports", ports);
8540 Service {
8541 proc: self.proc.clone(),
8542 selection: query,
8543 graphql_client: self.graphql_client.clone(),
8544 }
8545 }
8546 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8557 let mut query = self.selection.select("service");
8558 query = query.arg("ports", ports);
8559 if let Some(host) = opts.host {
8560 query = query.arg("host", host);
8561 }
8562 Service {
8563 proc: self.proc.clone(),
8564 selection: query,
8565 graphql_client: self.graphql_client.clone(),
8566 }
8567 }
8568 pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
8576 let mut query = self.selection.select("setSecretFile");
8577 query = query.arg("name", name.into());
8578 query = query.arg("path", path.into());
8579 Secret {
8580 proc: self.proc.clone(),
8581 selection: query,
8582 graphql_client: self.graphql_client.clone(),
8583 }
8584 }
8585 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8592 let mut query = self.selection.select("tunnel");
8593 query = query.arg_lazy(
8594 "service",
8595 Box::new(move || {
8596 let service = service.clone();
8597 Box::pin(async move { service.into_id().await.unwrap().quote() })
8598 }),
8599 );
8600 Service {
8601 proc: self.proc.clone(),
8602 selection: query,
8603 graphql_client: self.graphql_client.clone(),
8604 }
8605 }
8606 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8613 let mut query = self.selection.select("tunnel");
8614 query = query.arg_lazy(
8615 "service",
8616 Box::new(move || {
8617 let service = service.clone();
8618 Box::pin(async move { service.into_id().await.unwrap().quote() })
8619 }),
8620 );
8621 if let Some(native) = opts.native {
8622 query = query.arg("native", native);
8623 }
8624 if let Some(ports) = opts.ports {
8625 query = query.arg("ports", ports);
8626 }
8627 Service {
8628 proc: self.proc.clone(),
8629 selection: query,
8630 graphql_client: self.graphql_client.clone(),
8631 }
8632 }
8633 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
8639 let mut query = self.selection.select("unixSocket");
8640 query = query.arg("path", path.into());
8641 Socket {
8642 proc: self.proc.clone(),
8643 selection: query,
8644 graphql_client: self.graphql_client.clone(),
8645 }
8646 }
8647}
8648#[derive(Clone)]
8649pub struct InputTypeDef {
8650 pub proc: Option<Arc<DaggerSessionProc>>,
8651 pub selection: Selection,
8652 pub graphql_client: DynGraphQLClient,
8653}
8654impl InputTypeDef {
8655 pub fn fields(&self) -> Vec<FieldTypeDef> {
8657 let query = self.selection.select("fields");
8658 vec![FieldTypeDef {
8659 proc: self.proc.clone(),
8660 selection: query,
8661 graphql_client: self.graphql_client.clone(),
8662 }]
8663 }
8664 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
8666 let query = self.selection.select("id");
8667 query.execute(self.graphql_client.clone()).await
8668 }
8669 pub async fn name(&self) -> Result<String, DaggerError> {
8671 let query = self.selection.select("name");
8672 query.execute(self.graphql_client.clone()).await
8673 }
8674}
8675#[derive(Clone)]
8676pub struct InterfaceTypeDef {
8677 pub proc: Option<Arc<DaggerSessionProc>>,
8678 pub selection: Selection,
8679 pub graphql_client: DynGraphQLClient,
8680}
8681impl InterfaceTypeDef {
8682 pub async fn description(&self) -> Result<String, DaggerError> {
8684 let query = self.selection.select("description");
8685 query.execute(self.graphql_client.clone()).await
8686 }
8687 pub fn functions(&self) -> Vec<Function> {
8689 let query = self.selection.select("functions");
8690 vec![Function {
8691 proc: self.proc.clone(),
8692 selection: query,
8693 graphql_client: self.graphql_client.clone(),
8694 }]
8695 }
8696 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
8698 let query = self.selection.select("id");
8699 query.execute(self.graphql_client.clone()).await
8700 }
8701 pub async fn name(&self) -> Result<String, DaggerError> {
8703 let query = self.selection.select("name");
8704 query.execute(self.graphql_client.clone()).await
8705 }
8706 pub fn source_map(&self) -> SourceMap {
8708 let query = self.selection.select("sourceMap");
8709 SourceMap {
8710 proc: self.proc.clone(),
8711 selection: query,
8712 graphql_client: self.graphql_client.clone(),
8713 }
8714 }
8715 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8717 let query = self.selection.select("sourceModuleName");
8718 query.execute(self.graphql_client.clone()).await
8719 }
8720}
8721#[derive(Clone)]
8722pub struct JsonValue {
8723 pub proc: Option<Arc<DaggerSessionProc>>,
8724 pub selection: Selection,
8725 pub graphql_client: DynGraphQLClient,
8726}
8727#[derive(Builder, Debug, PartialEq)]
8728pub struct JsonValueContentsOpts<'a> {
8729 #[builder(setter(into, strip_option), default)]
8731 pub indent: Option<&'a str>,
8732 #[builder(setter(into, strip_option), default)]
8734 pub pretty: Option<bool>,
8735}
8736impl JsonValue {
8737 pub fn as_array(&self) -> Vec<JsonValue> {
8739 let query = self.selection.select("asArray");
8740 vec![JsonValue {
8741 proc: self.proc.clone(),
8742 selection: query,
8743 graphql_client: self.graphql_client.clone(),
8744 }]
8745 }
8746 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
8748 let query = self.selection.select("asBoolean");
8749 query.execute(self.graphql_client.clone()).await
8750 }
8751 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
8753 let query = self.selection.select("asInteger");
8754 query.execute(self.graphql_client.clone()).await
8755 }
8756 pub async fn as_string(&self) -> Result<String, DaggerError> {
8758 let query = self.selection.select("asString");
8759 query.execute(self.graphql_client.clone()).await
8760 }
8761 pub async fn contents(&self) -> Result<Json, DaggerError> {
8767 let query = self.selection.select("contents");
8768 query.execute(self.graphql_client.clone()).await
8769 }
8770 pub async fn contents_opts<'a>(
8776 &self,
8777 opts: JsonValueContentsOpts<'a>,
8778 ) -> Result<Json, DaggerError> {
8779 let mut query = self.selection.select("contents");
8780 if let Some(pretty) = opts.pretty {
8781 query = query.arg("pretty", pretty);
8782 }
8783 if let Some(indent) = opts.indent {
8784 query = query.arg("indent", indent);
8785 }
8786 query.execute(self.graphql_client.clone()).await
8787 }
8788 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
8794 let mut query = self.selection.select("field");
8795 query = query.arg(
8796 "path",
8797 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8798 );
8799 JsonValue {
8800 proc: self.proc.clone(),
8801 selection: query,
8802 graphql_client: self.graphql_client.clone(),
8803 }
8804 }
8805 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
8807 let query = self.selection.select("fields");
8808 query.execute(self.graphql_client.clone()).await
8809 }
8810 pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
8812 let query = self.selection.select("id");
8813 query.execute(self.graphql_client.clone()).await
8814 }
8815 pub fn new_boolean(&self, value: bool) -> JsonValue {
8821 let mut query = self.selection.select("newBoolean");
8822 query = query.arg("value", value);
8823 JsonValue {
8824 proc: self.proc.clone(),
8825 selection: query,
8826 graphql_client: self.graphql_client.clone(),
8827 }
8828 }
8829 pub fn new_integer(&self, value: isize) -> JsonValue {
8835 let mut query = self.selection.select("newInteger");
8836 query = query.arg("value", value);
8837 JsonValue {
8838 proc: self.proc.clone(),
8839 selection: query,
8840 graphql_client: self.graphql_client.clone(),
8841 }
8842 }
8843 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
8849 let mut query = self.selection.select("newString");
8850 query = query.arg("value", value.into());
8851 JsonValue {
8852 proc: self.proc.clone(),
8853 selection: query,
8854 graphql_client: self.graphql_client.clone(),
8855 }
8856 }
8857 pub fn with_contents(&self, contents: Json) -> JsonValue {
8863 let mut query = self.selection.select("withContents");
8864 query = query.arg("contents", contents);
8865 JsonValue {
8866 proc: self.proc.clone(),
8867 selection: query,
8868 graphql_client: self.graphql_client.clone(),
8869 }
8870 }
8871 pub fn with_field(
8878 &self,
8879 path: Vec<impl Into<String>>,
8880 value: impl IntoID<JsonValueId>,
8881 ) -> JsonValue {
8882 let mut query = self.selection.select("withField");
8883 query = query.arg(
8884 "path",
8885 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8886 );
8887 query = query.arg_lazy(
8888 "value",
8889 Box::new(move || {
8890 let value = value.clone();
8891 Box::pin(async move { value.into_id().await.unwrap().quote() })
8892 }),
8893 );
8894 JsonValue {
8895 proc: self.proc.clone(),
8896 selection: query,
8897 graphql_client: self.graphql_client.clone(),
8898 }
8899 }
8900}
8901#[derive(Clone)]
8902pub struct Llm {
8903 pub proc: Option<Arc<DaggerSessionProc>>,
8904 pub selection: Selection,
8905 pub graphql_client: DynGraphQLClient,
8906}
8907impl Llm {
8908 pub fn attempt(&self, number: isize) -> Llm {
8910 let mut query = self.selection.select("attempt");
8911 query = query.arg("number", number);
8912 Llm {
8913 proc: self.proc.clone(),
8914 selection: query,
8915 graphql_client: self.graphql_client.clone(),
8916 }
8917 }
8918 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
8920 let mut query = self.selection.select("bindResult");
8921 query = query.arg("name", name.into());
8922 Binding {
8923 proc: self.proc.clone(),
8924 selection: query,
8925 graphql_client: self.graphql_client.clone(),
8926 }
8927 }
8928 pub fn env(&self) -> Env {
8930 let query = self.selection.select("env");
8931 Env {
8932 proc: self.proc.clone(),
8933 selection: query,
8934 graphql_client: self.graphql_client.clone(),
8935 }
8936 }
8937 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
8939 let query = self.selection.select("history");
8940 query.execute(self.graphql_client.clone()).await
8941 }
8942 pub async fn history_json(&self) -> Result<Json, DaggerError> {
8944 let query = self.selection.select("historyJSON");
8945 query.execute(self.graphql_client.clone()).await
8946 }
8947 pub async fn id(&self) -> Result<Llmid, DaggerError> {
8949 let query = self.selection.select("id");
8950 query.execute(self.graphql_client.clone()).await
8951 }
8952 pub async fn last_reply(&self) -> Result<String, DaggerError> {
8954 let query = self.selection.select("lastReply");
8955 query.execute(self.graphql_client.clone()).await
8956 }
8957 pub fn r#loop(&self) -> Llm {
8959 let query = self.selection.select("loop");
8960 Llm {
8961 proc: self.proc.clone(),
8962 selection: query,
8963 graphql_client: self.graphql_client.clone(),
8964 }
8965 }
8966 pub async fn model(&self) -> Result<String, DaggerError> {
8968 let query = self.selection.select("model");
8969 query.execute(self.graphql_client.clone()).await
8970 }
8971 pub async fn provider(&self) -> Result<String, DaggerError> {
8973 let query = self.selection.select("provider");
8974 query.execute(self.graphql_client.clone()).await
8975 }
8976 pub async fn sync(&self) -> Result<Llmid, DaggerError> {
8978 let query = self.selection.select("sync");
8979 query.execute(self.graphql_client.clone()).await
8980 }
8981 pub fn token_usage(&self) -> LlmTokenUsage {
8983 let query = self.selection.select("tokenUsage");
8984 LlmTokenUsage {
8985 proc: self.proc.clone(),
8986 selection: query,
8987 graphql_client: self.graphql_client.clone(),
8988 }
8989 }
8990 pub async fn tools(&self) -> Result<String, DaggerError> {
8992 let query = self.selection.select("tools");
8993 query.execute(self.graphql_client.clone()).await
8994 }
8995 pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
8997 let mut query = self.selection.select("withEnv");
8998 query = query.arg_lazy(
8999 "env",
9000 Box::new(move || {
9001 let env = env.clone();
9002 Box::pin(async move { env.into_id().await.unwrap().quote() })
9003 }),
9004 );
9005 Llm {
9006 proc: self.proc.clone(),
9007 selection: query,
9008 graphql_client: self.graphql_client.clone(),
9009 }
9010 }
9011 pub fn with_model(&self, model: impl Into<String>) -> Llm {
9017 let mut query = self.selection.select("withModel");
9018 query = query.arg("model", model.into());
9019 Llm {
9020 proc: self.proc.clone(),
9021 selection: query,
9022 graphql_client: self.graphql_client.clone(),
9023 }
9024 }
9025 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9031 let mut query = self.selection.select("withPrompt");
9032 query = query.arg("prompt", prompt.into());
9033 Llm {
9034 proc: self.proc.clone(),
9035 selection: query,
9036 graphql_client: self.graphql_client.clone(),
9037 }
9038 }
9039 pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9045 let mut query = self.selection.select("withPromptFile");
9046 query = query.arg_lazy(
9047 "file",
9048 Box::new(move || {
9049 let file = file.clone();
9050 Box::pin(async move { file.into_id().await.unwrap().quote() })
9051 }),
9052 );
9053 Llm {
9054 proc: self.proc.clone(),
9055 selection: query,
9056 graphql_client: self.graphql_client.clone(),
9057 }
9058 }
9059 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
9065 let mut query = self.selection.select("withSystemPrompt");
9066 query = query.arg("prompt", prompt.into());
9067 Llm {
9068 proc: self.proc.clone(),
9069 selection: query,
9070 graphql_client: self.graphql_client.clone(),
9071 }
9072 }
9073 pub fn without_default_system_prompt(&self) -> Llm {
9075 let query = self.selection.select("withoutDefaultSystemPrompt");
9076 Llm {
9077 proc: self.proc.clone(),
9078 selection: query,
9079 graphql_client: self.graphql_client.clone(),
9080 }
9081 }
9082}
9083#[derive(Clone)]
9084pub struct LlmTokenUsage {
9085 pub proc: Option<Arc<DaggerSessionProc>>,
9086 pub selection: Selection,
9087 pub graphql_client: DynGraphQLClient,
9088}
9089impl LlmTokenUsage {
9090 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
9091 let query = self.selection.select("cachedTokenReads");
9092 query.execute(self.graphql_client.clone()).await
9093 }
9094 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
9095 let query = self.selection.select("cachedTokenWrites");
9096 query.execute(self.graphql_client.clone()).await
9097 }
9098 pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
9100 let query = self.selection.select("id");
9101 query.execute(self.graphql_client.clone()).await
9102 }
9103 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
9104 let query = self.selection.select("inputTokens");
9105 query.execute(self.graphql_client.clone()).await
9106 }
9107 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
9108 let query = self.selection.select("outputTokens");
9109 query.execute(self.graphql_client.clone()).await
9110 }
9111 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
9112 let query = self.selection.select("totalTokens");
9113 query.execute(self.graphql_client.clone()).await
9114 }
9115}
9116#[derive(Clone)]
9117pub struct Label {
9118 pub proc: Option<Arc<DaggerSessionProc>>,
9119 pub selection: Selection,
9120 pub graphql_client: DynGraphQLClient,
9121}
9122impl Label {
9123 pub async fn id(&self) -> Result<LabelId, DaggerError> {
9125 let query = self.selection.select("id");
9126 query.execute(self.graphql_client.clone()).await
9127 }
9128 pub async fn name(&self) -> Result<String, DaggerError> {
9130 let query = self.selection.select("name");
9131 query.execute(self.graphql_client.clone()).await
9132 }
9133 pub async fn value(&self) -> Result<String, DaggerError> {
9135 let query = self.selection.select("value");
9136 query.execute(self.graphql_client.clone()).await
9137 }
9138}
9139#[derive(Clone)]
9140pub struct ListTypeDef {
9141 pub proc: Option<Arc<DaggerSessionProc>>,
9142 pub selection: Selection,
9143 pub graphql_client: DynGraphQLClient,
9144}
9145impl ListTypeDef {
9146 pub fn element_type_def(&self) -> TypeDef {
9148 let query = self.selection.select("elementTypeDef");
9149 TypeDef {
9150 proc: self.proc.clone(),
9151 selection: query,
9152 graphql_client: self.graphql_client.clone(),
9153 }
9154 }
9155 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
9157 let query = self.selection.select("id");
9158 query.execute(self.graphql_client.clone()).await
9159 }
9160}
9161#[derive(Clone)]
9162pub struct Module {
9163 pub proc: Option<Arc<DaggerSessionProc>>,
9164 pub selection: Selection,
9165 pub graphql_client: DynGraphQLClient,
9166}
9167#[derive(Builder, Debug, PartialEq)]
9168pub struct ModuleServeOpts {
9169 #[builder(setter(into, strip_option), default)]
9171 pub include_dependencies: Option<bool>,
9172}
9173impl Module {
9174 pub fn dependencies(&self) -> Vec<Module> {
9176 let query = self.selection.select("dependencies");
9177 vec![Module {
9178 proc: self.proc.clone(),
9179 selection: query,
9180 graphql_client: self.graphql_client.clone(),
9181 }]
9182 }
9183 pub async fn description(&self) -> Result<String, DaggerError> {
9185 let query = self.selection.select("description");
9186 query.execute(self.graphql_client.clone()).await
9187 }
9188 pub fn enums(&self) -> Vec<TypeDef> {
9190 let query = self.selection.select("enums");
9191 vec![TypeDef {
9192 proc: self.proc.clone(),
9193 selection: query,
9194 graphql_client: self.graphql_client.clone(),
9195 }]
9196 }
9197 pub fn generated_context_directory(&self) -> Directory {
9199 let query = self.selection.select("generatedContextDirectory");
9200 Directory {
9201 proc: self.proc.clone(),
9202 selection: query,
9203 graphql_client: self.graphql_client.clone(),
9204 }
9205 }
9206 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
9208 let query = self.selection.select("id");
9209 query.execute(self.graphql_client.clone()).await
9210 }
9211 pub fn interfaces(&self) -> Vec<TypeDef> {
9213 let query = self.selection.select("interfaces");
9214 vec![TypeDef {
9215 proc: self.proc.clone(),
9216 selection: query,
9217 graphql_client: self.graphql_client.clone(),
9218 }]
9219 }
9220 pub async fn name(&self) -> Result<String, DaggerError> {
9222 let query = self.selection.select("name");
9223 query.execute(self.graphql_client.clone()).await
9224 }
9225 pub fn objects(&self) -> Vec<TypeDef> {
9227 let query = self.selection.select("objects");
9228 vec![TypeDef {
9229 proc: self.proc.clone(),
9230 selection: query,
9231 graphql_client: self.graphql_client.clone(),
9232 }]
9233 }
9234 pub fn runtime(&self) -> Container {
9236 let query = self.selection.select("runtime");
9237 Container {
9238 proc: self.proc.clone(),
9239 selection: query,
9240 graphql_client: self.graphql_client.clone(),
9241 }
9242 }
9243 pub fn sdk(&self) -> SdkConfig {
9245 let query = self.selection.select("sdk");
9246 SdkConfig {
9247 proc: self.proc.clone(),
9248 selection: query,
9249 graphql_client: self.graphql_client.clone(),
9250 }
9251 }
9252 pub async fn serve(&self) -> Result<Void, DaggerError> {
9259 let query = self.selection.select("serve");
9260 query.execute(self.graphql_client.clone()).await
9261 }
9262 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
9269 let mut query = self.selection.select("serve");
9270 if let Some(include_dependencies) = opts.include_dependencies {
9271 query = query.arg("includeDependencies", include_dependencies);
9272 }
9273 query.execute(self.graphql_client.clone()).await
9274 }
9275 pub fn source(&self) -> ModuleSource {
9277 let query = self.selection.select("source");
9278 ModuleSource {
9279 proc: self.proc.clone(),
9280 selection: query,
9281 graphql_client: self.graphql_client.clone(),
9282 }
9283 }
9284 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
9286 let query = self.selection.select("sync");
9287 query.execute(self.graphql_client.clone()).await
9288 }
9289 pub fn with_description(&self, description: impl Into<String>) -> Module {
9295 let mut query = self.selection.select("withDescription");
9296 query = query.arg("description", description.into());
9297 Module {
9298 proc: self.proc.clone(),
9299 selection: query,
9300 graphql_client: self.graphql_client.clone(),
9301 }
9302 }
9303 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
9305 let mut query = self.selection.select("withEnum");
9306 query = query.arg_lazy(
9307 "enum",
9308 Box::new(move || {
9309 let r#enum = r#enum.clone();
9310 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
9311 }),
9312 );
9313 Module {
9314 proc: self.proc.clone(),
9315 selection: query,
9316 graphql_client: self.graphql_client.clone(),
9317 }
9318 }
9319 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
9321 let mut query = self.selection.select("withInterface");
9322 query = query.arg_lazy(
9323 "iface",
9324 Box::new(move || {
9325 let iface = iface.clone();
9326 Box::pin(async move { iface.into_id().await.unwrap().quote() })
9327 }),
9328 );
9329 Module {
9330 proc: self.proc.clone(),
9331 selection: query,
9332 graphql_client: self.graphql_client.clone(),
9333 }
9334 }
9335 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
9337 let mut query = self.selection.select("withObject");
9338 query = query.arg_lazy(
9339 "object",
9340 Box::new(move || {
9341 let object = object.clone();
9342 Box::pin(async move { object.into_id().await.unwrap().quote() })
9343 }),
9344 );
9345 Module {
9346 proc: self.proc.clone(),
9347 selection: query,
9348 graphql_client: self.graphql_client.clone(),
9349 }
9350 }
9351}
9352#[derive(Clone)]
9353pub struct ModuleConfigClient {
9354 pub proc: Option<Arc<DaggerSessionProc>>,
9355 pub selection: Selection,
9356 pub graphql_client: DynGraphQLClient,
9357}
9358impl ModuleConfigClient {
9359 pub async fn directory(&self) -> Result<String, DaggerError> {
9361 let query = self.selection.select("directory");
9362 query.execute(self.graphql_client.clone()).await
9363 }
9364 pub async fn generator(&self) -> Result<String, DaggerError> {
9366 let query = self.selection.select("generator");
9367 query.execute(self.graphql_client.clone()).await
9368 }
9369 pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
9371 let query = self.selection.select("id");
9372 query.execute(self.graphql_client.clone()).await
9373 }
9374}
9375#[derive(Clone)]
9376pub struct ModuleSource {
9377 pub proc: Option<Arc<DaggerSessionProc>>,
9378 pub selection: Selection,
9379 pub graphql_client: DynGraphQLClient,
9380}
9381impl ModuleSource {
9382 pub fn as_module(&self) -> Module {
9384 let query = self.selection.select("asModule");
9385 Module {
9386 proc: self.proc.clone(),
9387 selection: query,
9388 graphql_client: self.graphql_client.clone(),
9389 }
9390 }
9391 pub async fn as_string(&self) -> Result<String, DaggerError> {
9393 let query = self.selection.select("asString");
9394 query.execute(self.graphql_client.clone()).await
9395 }
9396 pub fn blueprint(&self) -> ModuleSource {
9398 let query = self.selection.select("blueprint");
9399 ModuleSource {
9400 proc: self.proc.clone(),
9401 selection: query,
9402 graphql_client: self.graphql_client.clone(),
9403 }
9404 }
9405 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
9407 let query = self.selection.select("cloneRef");
9408 query.execute(self.graphql_client.clone()).await
9409 }
9410 pub async fn commit(&self) -> Result<String, DaggerError> {
9412 let query = self.selection.select("commit");
9413 query.execute(self.graphql_client.clone()).await
9414 }
9415 pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
9417 let query = self.selection.select("configClients");
9418 vec![ModuleConfigClient {
9419 proc: self.proc.clone(),
9420 selection: query,
9421 graphql_client: self.graphql_client.clone(),
9422 }]
9423 }
9424 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
9426 let query = self.selection.select("configExists");
9427 query.execute(self.graphql_client.clone()).await
9428 }
9429 pub fn context_directory(&self) -> Directory {
9431 let query = self.selection.select("contextDirectory");
9432 Directory {
9433 proc: self.proc.clone(),
9434 selection: query,
9435 graphql_client: self.graphql_client.clone(),
9436 }
9437 }
9438 pub fn dependencies(&self) -> Vec<ModuleSource> {
9440 let query = self.selection.select("dependencies");
9441 vec![ModuleSource {
9442 proc: self.proc.clone(),
9443 selection: query,
9444 graphql_client: self.graphql_client.clone(),
9445 }]
9446 }
9447 pub async fn digest(&self) -> Result<String, DaggerError> {
9449 let query = self.selection.select("digest");
9450 query.execute(self.graphql_client.clone()).await
9451 }
9452 pub fn directory(&self, path: impl Into<String>) -> Directory {
9458 let mut query = self.selection.select("directory");
9459 query = query.arg("path", path.into());
9460 Directory {
9461 proc: self.proc.clone(),
9462 selection: query,
9463 graphql_client: self.graphql_client.clone(),
9464 }
9465 }
9466 pub async fn engine_version(&self) -> Result<String, DaggerError> {
9468 let query = self.selection.select("engineVersion");
9469 query.execute(self.graphql_client.clone()).await
9470 }
9471 pub fn generated_context_directory(&self) -> Directory {
9473 let query = self.selection.select("generatedContextDirectory");
9474 Directory {
9475 proc: self.proc.clone(),
9476 selection: query,
9477 graphql_client: self.graphql_client.clone(),
9478 }
9479 }
9480 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
9482 let query = self.selection.select("htmlRepoURL");
9483 query.execute(self.graphql_client.clone()).await
9484 }
9485 pub async fn html_url(&self) -> Result<String, DaggerError> {
9487 let query = self.selection.select("htmlURL");
9488 query.execute(self.graphql_client.clone()).await
9489 }
9490 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
9492 let query = self.selection.select("id");
9493 query.execute(self.graphql_client.clone()).await
9494 }
9495 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
9497 let query = self.selection.select("kind");
9498 query.execute(self.graphql_client.clone()).await
9499 }
9500 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
9502 let query = self.selection.select("localContextDirectoryPath");
9503 query.execute(self.graphql_client.clone()).await
9504 }
9505 pub async fn module_name(&self) -> Result<String, DaggerError> {
9507 let query = self.selection.select("moduleName");
9508 query.execute(self.graphql_client.clone()).await
9509 }
9510 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
9512 let query = self.selection.select("moduleOriginalName");
9513 query.execute(self.graphql_client.clone()).await
9514 }
9515 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
9517 let query = self.selection.select("originalSubpath");
9518 query.execute(self.graphql_client.clone()).await
9519 }
9520 pub async fn pin(&self) -> Result<String, DaggerError> {
9522 let query = self.selection.select("pin");
9523 query.execute(self.graphql_client.clone()).await
9524 }
9525 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
9527 let query = self.selection.select("repoRootPath");
9528 query.execute(self.graphql_client.clone()).await
9529 }
9530 pub fn sdk(&self) -> SdkConfig {
9532 let query = self.selection.select("sdk");
9533 SdkConfig {
9534 proc: self.proc.clone(),
9535 selection: query,
9536 graphql_client: self.graphql_client.clone(),
9537 }
9538 }
9539 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9541 let query = self.selection.select("sourceRootSubpath");
9542 query.execute(self.graphql_client.clone()).await
9543 }
9544 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9546 let query = self.selection.select("sourceSubpath");
9547 query.execute(self.graphql_client.clone()).await
9548 }
9549 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9551 let query = self.selection.select("sync");
9552 query.execute(self.graphql_client.clone()).await
9553 }
9554 pub async fn version(&self) -> Result<String, DaggerError> {
9556 let query = self.selection.select("version");
9557 query.execute(self.graphql_client.clone()).await
9558 }
9559 pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9565 let mut query = self.selection.select("withBlueprint");
9566 query = query.arg_lazy(
9567 "blueprint",
9568 Box::new(move || {
9569 let blueprint = blueprint.clone();
9570 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
9571 }),
9572 );
9573 ModuleSource {
9574 proc: self.proc.clone(),
9575 selection: query,
9576 graphql_client: self.graphql_client.clone(),
9577 }
9578 }
9579 pub fn with_client(
9586 &self,
9587 generator: impl Into<String>,
9588 output_dir: impl Into<String>,
9589 ) -> ModuleSource {
9590 let mut query = self.selection.select("withClient");
9591 query = query.arg("generator", generator.into());
9592 query = query.arg("outputDir", output_dir.into());
9593 ModuleSource {
9594 proc: self.proc.clone(),
9595 selection: query,
9596 graphql_client: self.graphql_client.clone(),
9597 }
9598 }
9599 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
9605 let mut query = self.selection.select("withDependencies");
9606 query = query.arg("dependencies", dependencies);
9607 ModuleSource {
9608 proc: self.proc.clone(),
9609 selection: query,
9610 graphql_client: self.graphql_client.clone(),
9611 }
9612 }
9613 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
9619 let mut query = self.selection.select("withEngineVersion");
9620 query = query.arg("version", version.into());
9621 ModuleSource {
9622 proc: self.proc.clone(),
9623 selection: query,
9624 graphql_client: self.graphql_client.clone(),
9625 }
9626 }
9627 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
9633 let mut query = self.selection.select("withIncludes");
9634 query = query.arg(
9635 "patterns",
9636 patterns
9637 .into_iter()
9638 .map(|i| i.into())
9639 .collect::<Vec<String>>(),
9640 );
9641 ModuleSource {
9642 proc: self.proc.clone(),
9643 selection: query,
9644 graphql_client: self.graphql_client.clone(),
9645 }
9646 }
9647 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
9653 let mut query = self.selection.select("withName");
9654 query = query.arg("name", name.into());
9655 ModuleSource {
9656 proc: self.proc.clone(),
9657 selection: query,
9658 graphql_client: self.graphql_client.clone(),
9659 }
9660 }
9661 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
9667 let mut query = self.selection.select("withSDK");
9668 query = query.arg("source", source.into());
9669 ModuleSource {
9670 proc: self.proc.clone(),
9671 selection: query,
9672 graphql_client: self.graphql_client.clone(),
9673 }
9674 }
9675 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
9681 let mut query = self.selection.select("withSourceSubpath");
9682 query = query.arg("path", path.into());
9683 ModuleSource {
9684 proc: self.proc.clone(),
9685 selection: query,
9686 graphql_client: self.graphql_client.clone(),
9687 }
9688 }
9689 pub fn with_update_blueprint(&self) -> ModuleSource {
9691 let query = self.selection.select("withUpdateBlueprint");
9692 ModuleSource {
9693 proc: self.proc.clone(),
9694 selection: query,
9695 graphql_client: self.graphql_client.clone(),
9696 }
9697 }
9698 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9704 let mut query = self.selection.select("withUpdateDependencies");
9705 query = query.arg(
9706 "dependencies",
9707 dependencies
9708 .into_iter()
9709 .map(|i| i.into())
9710 .collect::<Vec<String>>(),
9711 );
9712 ModuleSource {
9713 proc: self.proc.clone(),
9714 selection: query,
9715 graphql_client: self.graphql_client.clone(),
9716 }
9717 }
9718 pub fn without_blueprint(&self) -> ModuleSource {
9720 let query = self.selection.select("withoutBlueprint");
9721 ModuleSource {
9722 proc: self.proc.clone(),
9723 selection: query,
9724 graphql_client: self.graphql_client.clone(),
9725 }
9726 }
9727 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
9733 let mut query = self.selection.select("withoutClient");
9734 query = query.arg("path", path.into());
9735 ModuleSource {
9736 proc: self.proc.clone(),
9737 selection: query,
9738 graphql_client: self.graphql_client.clone(),
9739 }
9740 }
9741 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9747 let mut query = self.selection.select("withoutDependencies");
9748 query = query.arg(
9749 "dependencies",
9750 dependencies
9751 .into_iter()
9752 .map(|i| i.into())
9753 .collect::<Vec<String>>(),
9754 );
9755 ModuleSource {
9756 proc: self.proc.clone(),
9757 selection: query,
9758 graphql_client: self.graphql_client.clone(),
9759 }
9760 }
9761}
9762#[derive(Clone)]
9763pub struct ObjectTypeDef {
9764 pub proc: Option<Arc<DaggerSessionProc>>,
9765 pub selection: Selection,
9766 pub graphql_client: DynGraphQLClient,
9767}
9768impl ObjectTypeDef {
9769 pub fn constructor(&self) -> Function {
9771 let query = self.selection.select("constructor");
9772 Function {
9773 proc: self.proc.clone(),
9774 selection: query,
9775 graphql_client: self.graphql_client.clone(),
9776 }
9777 }
9778 pub async fn description(&self) -> Result<String, DaggerError> {
9780 let query = self.selection.select("description");
9781 query.execute(self.graphql_client.clone()).await
9782 }
9783 pub fn fields(&self) -> Vec<FieldTypeDef> {
9785 let query = self.selection.select("fields");
9786 vec![FieldTypeDef {
9787 proc: self.proc.clone(),
9788 selection: query,
9789 graphql_client: self.graphql_client.clone(),
9790 }]
9791 }
9792 pub fn functions(&self) -> Vec<Function> {
9794 let query = self.selection.select("functions");
9795 vec![Function {
9796 proc: self.proc.clone(),
9797 selection: query,
9798 graphql_client: self.graphql_client.clone(),
9799 }]
9800 }
9801 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
9803 let query = self.selection.select("id");
9804 query.execute(self.graphql_client.clone()).await
9805 }
9806 pub async fn name(&self) -> Result<String, DaggerError> {
9808 let query = self.selection.select("name");
9809 query.execute(self.graphql_client.clone()).await
9810 }
9811 pub fn source_map(&self) -> SourceMap {
9813 let query = self.selection.select("sourceMap");
9814 SourceMap {
9815 proc: self.proc.clone(),
9816 selection: query,
9817 graphql_client: self.graphql_client.clone(),
9818 }
9819 }
9820 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9822 let query = self.selection.select("sourceModuleName");
9823 query.execute(self.graphql_client.clone()).await
9824 }
9825}
9826#[derive(Clone)]
9827pub struct Port {
9828 pub proc: Option<Arc<DaggerSessionProc>>,
9829 pub selection: Selection,
9830 pub graphql_client: DynGraphQLClient,
9831}
9832impl Port {
9833 pub async fn description(&self) -> Result<String, DaggerError> {
9835 let query = self.selection.select("description");
9836 query.execute(self.graphql_client.clone()).await
9837 }
9838 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
9840 let query = self.selection.select("experimentalSkipHealthcheck");
9841 query.execute(self.graphql_client.clone()).await
9842 }
9843 pub async fn id(&self) -> Result<PortId, DaggerError> {
9845 let query = self.selection.select("id");
9846 query.execute(self.graphql_client.clone()).await
9847 }
9848 pub async fn port(&self) -> Result<isize, DaggerError> {
9850 let query = self.selection.select("port");
9851 query.execute(self.graphql_client.clone()).await
9852 }
9853 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
9855 let query = self.selection.select("protocol");
9856 query.execute(self.graphql_client.clone()).await
9857 }
9858}
9859#[derive(Clone)]
9860pub struct Query {
9861 pub proc: Option<Arc<DaggerSessionProc>>,
9862 pub selection: Selection,
9863 pub graphql_client: DynGraphQLClient,
9864}
9865#[derive(Builder, Debug, PartialEq)]
9866pub struct QueryContainerOpts {
9867 #[builder(setter(into, strip_option), default)]
9869 pub platform: Option<Platform>,
9870}
9871#[derive(Builder, Debug, PartialEq)]
9872pub struct QueryEnvOpts {
9873 #[builder(setter(into, strip_option), default)]
9875 pub privileged: Option<bool>,
9876 #[builder(setter(into, strip_option), default)]
9878 pub writable: Option<bool>,
9879}
9880#[derive(Builder, Debug, PartialEq)]
9881pub struct QueryEnvFileOpts {
9882 #[builder(setter(into, strip_option), default)]
9884 pub expand: Option<bool>,
9885}
9886#[derive(Builder, Debug, PartialEq)]
9887pub struct QueryFileOpts {
9888 #[builder(setter(into, strip_option), default)]
9890 pub permissions: Option<isize>,
9891}
9892#[derive(Builder, Debug, PartialEq)]
9893pub struct QueryGitOpts<'a> {
9894 #[builder(setter(into, strip_option), default)]
9896 pub experimental_service_host: Option<ServiceId>,
9897 #[builder(setter(into, strip_option), default)]
9899 pub http_auth_header: Option<SecretId>,
9900 #[builder(setter(into, strip_option), default)]
9902 pub http_auth_token: Option<SecretId>,
9903 #[builder(setter(into, strip_option), default)]
9905 pub http_auth_username: Option<&'a str>,
9906 #[builder(setter(into, strip_option), default)]
9908 pub keep_git_dir: Option<bool>,
9909 #[builder(setter(into, strip_option), default)]
9911 pub ssh_auth_socket: Option<SocketId>,
9912 #[builder(setter(into, strip_option), default)]
9914 pub ssh_known_hosts: Option<&'a str>,
9915}
9916#[derive(Builder, Debug, PartialEq)]
9917pub struct QueryHttpOpts<'a> {
9918 #[builder(setter(into, strip_option), default)]
9920 pub auth_header: Option<SecretId>,
9921 #[builder(setter(into, strip_option), default)]
9923 pub experimental_service_host: Option<ServiceId>,
9924 #[builder(setter(into, strip_option), default)]
9926 pub name: Option<&'a str>,
9927 #[builder(setter(into, strip_option), default)]
9929 pub permissions: Option<isize>,
9930}
9931#[derive(Builder, Debug, PartialEq)]
9932pub struct QueryLlmOpts<'a> {
9933 #[builder(setter(into, strip_option), default)]
9935 pub max_api_calls: Option<isize>,
9936 #[builder(setter(into, strip_option), default)]
9938 pub model: Option<&'a str>,
9939}
9940#[derive(Builder, Debug, PartialEq)]
9941pub struct QueryModuleSourceOpts<'a> {
9942 #[builder(setter(into, strip_option), default)]
9944 pub allow_not_exists: Option<bool>,
9945 #[builder(setter(into, strip_option), default)]
9947 pub disable_find_up: Option<bool>,
9948 #[builder(setter(into, strip_option), default)]
9950 pub ref_pin: Option<&'a str>,
9951 #[builder(setter(into, strip_option), default)]
9953 pub require_kind: Option<ModuleSourceKind>,
9954}
9955#[derive(Builder, Debug, PartialEq)]
9956pub struct QuerySecretOpts<'a> {
9957 #[builder(setter(into, strip_option), default)]
9961 pub cache_key: Option<&'a str>,
9962}
9963impl Query {
9964 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
9970 let mut query = self.selection.select("cacheVolume");
9971 query = query.arg("key", key.into());
9972 CacheVolume {
9973 proc: self.proc.clone(),
9974 selection: query,
9975 graphql_client: self.graphql_client.clone(),
9976 }
9977 }
9978 pub fn cloud(&self) -> Cloud {
9980 let query = self.selection.select("cloud");
9981 Cloud {
9982 proc: self.proc.clone(),
9983 selection: query,
9984 graphql_client: self.graphql_client.clone(),
9985 }
9986 }
9987 pub fn container(&self) -> Container {
9994 let query = self.selection.select("container");
9995 Container {
9996 proc: self.proc.clone(),
9997 selection: query,
9998 graphql_client: self.graphql_client.clone(),
9999 }
10000 }
10001 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10008 let mut query = self.selection.select("container");
10009 if let Some(platform) = opts.platform {
10010 query = query.arg("platform", platform);
10011 }
10012 Container {
10013 proc: self.proc.clone(),
10014 selection: query,
10015 graphql_client: self.graphql_client.clone(),
10016 }
10017 }
10018 pub fn current_function_call(&self) -> FunctionCall {
10021 let query = self.selection.select("currentFunctionCall");
10022 FunctionCall {
10023 proc: self.proc.clone(),
10024 selection: query,
10025 graphql_client: self.graphql_client.clone(),
10026 }
10027 }
10028 pub fn current_module(&self) -> CurrentModule {
10030 let query = self.selection.select("currentModule");
10031 CurrentModule {
10032 proc: self.proc.clone(),
10033 selection: query,
10034 graphql_client: self.graphql_client.clone(),
10035 }
10036 }
10037 pub fn current_type_defs(&self) -> Vec<TypeDef> {
10039 let query = self.selection.select("currentTypeDefs");
10040 vec![TypeDef {
10041 proc: self.proc.clone(),
10042 selection: query,
10043 graphql_client: self.graphql_client.clone(),
10044 }]
10045 }
10046 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
10048 let query = self.selection.select("defaultPlatform");
10049 query.execute(self.graphql_client.clone()).await
10050 }
10051 pub fn directory(&self) -> Directory {
10053 let query = self.selection.select("directory");
10054 Directory {
10055 proc: self.proc.clone(),
10056 selection: query,
10057 graphql_client: self.graphql_client.clone(),
10058 }
10059 }
10060 pub fn engine(&self) -> Engine {
10062 let query = self.selection.select("engine");
10063 Engine {
10064 proc: self.proc.clone(),
10065 selection: query,
10066 graphql_client: self.graphql_client.clone(),
10067 }
10068 }
10069 pub fn env(&self) -> Env {
10075 let query = self.selection.select("env");
10076 Env {
10077 proc: self.proc.clone(),
10078 selection: query,
10079 graphql_client: self.graphql_client.clone(),
10080 }
10081 }
10082 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
10088 let mut query = self.selection.select("env");
10089 if let Some(privileged) = opts.privileged {
10090 query = query.arg("privileged", privileged);
10091 }
10092 if let Some(writable) = opts.writable {
10093 query = query.arg("writable", writable);
10094 }
10095 Env {
10096 proc: self.proc.clone(),
10097 selection: query,
10098 graphql_client: self.graphql_client.clone(),
10099 }
10100 }
10101 pub fn env_file(&self) -> EnvFile {
10107 let query = self.selection.select("envFile");
10108 EnvFile {
10109 proc: self.proc.clone(),
10110 selection: query,
10111 graphql_client: self.graphql_client.clone(),
10112 }
10113 }
10114 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
10120 let mut query = self.selection.select("envFile");
10121 if let Some(expand) = opts.expand {
10122 query = query.arg("expand", expand);
10123 }
10124 EnvFile {
10125 proc: self.proc.clone(),
10126 selection: query,
10127 graphql_client: self.graphql_client.clone(),
10128 }
10129 }
10130 pub fn error(&self, message: impl Into<String>) -> Error {
10136 let mut query = self.selection.select("error");
10137 query = query.arg("message", message.into());
10138 Error {
10139 proc: self.proc.clone(),
10140 selection: query,
10141 graphql_client: self.graphql_client.clone(),
10142 }
10143 }
10144 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
10152 let mut query = self.selection.select("file");
10153 query = query.arg("name", name.into());
10154 query = query.arg("contents", contents.into());
10155 File {
10156 proc: self.proc.clone(),
10157 selection: query,
10158 graphql_client: self.graphql_client.clone(),
10159 }
10160 }
10161 pub fn file_opts(
10169 &self,
10170 name: impl Into<String>,
10171 contents: impl Into<String>,
10172 opts: QueryFileOpts,
10173 ) -> File {
10174 let mut query = self.selection.select("file");
10175 query = query.arg("name", name.into());
10176 query = query.arg("contents", contents.into());
10177 if let Some(permissions) = opts.permissions {
10178 query = query.arg("permissions", permissions);
10179 }
10180 File {
10181 proc: self.proc.clone(),
10182 selection: query,
10183 graphql_client: self.graphql_client.clone(),
10184 }
10185 }
10186 pub fn function(
10193 &self,
10194 name: impl Into<String>,
10195 return_type: impl IntoID<TypeDefId>,
10196 ) -> Function {
10197 let mut query = self.selection.select("function");
10198 query = query.arg("name", name.into());
10199 query = query.arg_lazy(
10200 "returnType",
10201 Box::new(move || {
10202 let return_type = return_type.clone();
10203 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
10204 }),
10205 );
10206 Function {
10207 proc: self.proc.clone(),
10208 selection: query,
10209 graphql_client: self.graphql_client.clone(),
10210 }
10211 }
10212 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
10214 let mut query = self.selection.select("generatedCode");
10215 query = query.arg_lazy(
10216 "code",
10217 Box::new(move || {
10218 let code = code.clone();
10219 Box::pin(async move { code.into_id().await.unwrap().quote() })
10220 }),
10221 );
10222 GeneratedCode {
10223 proc: self.proc.clone(),
10224 selection: query,
10225 graphql_client: self.graphql_client.clone(),
10226 }
10227 }
10228 pub fn git(&self, url: impl Into<String>) -> GitRepository {
10239 let mut query = self.selection.select("git");
10240 query = query.arg("url", url.into());
10241 GitRepository {
10242 proc: self.proc.clone(),
10243 selection: query,
10244 graphql_client: self.graphql_client.clone(),
10245 }
10246 }
10247 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
10258 let mut query = self.selection.select("git");
10259 query = query.arg("url", url.into());
10260 if let Some(keep_git_dir) = opts.keep_git_dir {
10261 query = query.arg("keepGitDir", keep_git_dir);
10262 }
10263 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
10264 query = query.arg("sshKnownHosts", ssh_known_hosts);
10265 }
10266 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
10267 query = query.arg("sshAuthSocket", ssh_auth_socket);
10268 }
10269 if let Some(http_auth_username) = opts.http_auth_username {
10270 query = query.arg("httpAuthUsername", http_auth_username);
10271 }
10272 if let Some(http_auth_token) = opts.http_auth_token {
10273 query = query.arg("httpAuthToken", http_auth_token);
10274 }
10275 if let Some(http_auth_header) = opts.http_auth_header {
10276 query = query.arg("httpAuthHeader", http_auth_header);
10277 }
10278 if let Some(experimental_service_host) = opts.experimental_service_host {
10279 query = query.arg("experimentalServiceHost", experimental_service_host);
10280 }
10281 GitRepository {
10282 proc: self.proc.clone(),
10283 selection: query,
10284 graphql_client: self.graphql_client.clone(),
10285 }
10286 }
10287 pub fn host(&self) -> Host {
10289 let query = self.selection.select("host");
10290 Host {
10291 proc: self.proc.clone(),
10292 selection: query,
10293 graphql_client: self.graphql_client.clone(),
10294 }
10295 }
10296 pub fn http(&self, url: impl Into<String>) -> File {
10303 let mut query = self.selection.select("http");
10304 query = query.arg("url", url.into());
10305 File {
10306 proc: self.proc.clone(),
10307 selection: query,
10308 graphql_client: self.graphql_client.clone(),
10309 }
10310 }
10311 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
10318 let mut query = self.selection.select("http");
10319 query = query.arg("url", url.into());
10320 if let Some(name) = opts.name {
10321 query = query.arg("name", name);
10322 }
10323 if let Some(permissions) = opts.permissions {
10324 query = query.arg("permissions", permissions);
10325 }
10326 if let Some(auth_header) = opts.auth_header {
10327 query = query.arg("authHeader", auth_header);
10328 }
10329 if let Some(experimental_service_host) = opts.experimental_service_host {
10330 query = query.arg("experimentalServiceHost", experimental_service_host);
10331 }
10332 File {
10333 proc: self.proc.clone(),
10334 selection: query,
10335 graphql_client: self.graphql_client.clone(),
10336 }
10337 }
10338 pub fn json(&self) -> JsonValue {
10340 let query = self.selection.select("json");
10341 JsonValue {
10342 proc: self.proc.clone(),
10343 selection: query,
10344 graphql_client: self.graphql_client.clone(),
10345 }
10346 }
10347 pub fn llm(&self) -> Llm {
10353 let query = self.selection.select("llm");
10354 Llm {
10355 proc: self.proc.clone(),
10356 selection: query,
10357 graphql_client: self.graphql_client.clone(),
10358 }
10359 }
10360 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
10366 let mut query = self.selection.select("llm");
10367 if let Some(model) = opts.model {
10368 query = query.arg("model", model);
10369 }
10370 if let Some(max_api_calls) = opts.max_api_calls {
10371 query = query.arg("maxAPICalls", max_api_calls);
10372 }
10373 Llm {
10374 proc: self.proc.clone(),
10375 selection: query,
10376 graphql_client: self.graphql_client.clone(),
10377 }
10378 }
10379 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
10381 let mut query = self.selection.select("loadBindingFromID");
10382 query = query.arg_lazy(
10383 "id",
10384 Box::new(move || {
10385 let id = id.clone();
10386 Box::pin(async move { id.into_id().await.unwrap().quote() })
10387 }),
10388 );
10389 Binding {
10390 proc: self.proc.clone(),
10391 selection: query,
10392 graphql_client: self.graphql_client.clone(),
10393 }
10394 }
10395 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
10397 let mut query = self.selection.select("loadCacheVolumeFromID");
10398 query = query.arg_lazy(
10399 "id",
10400 Box::new(move || {
10401 let id = id.clone();
10402 Box::pin(async move { id.into_id().await.unwrap().quote() })
10403 }),
10404 );
10405 CacheVolume {
10406 proc: self.proc.clone(),
10407 selection: query,
10408 graphql_client: self.graphql_client.clone(),
10409 }
10410 }
10411 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
10413 let mut query = self.selection.select("loadChangesetFromID");
10414 query = query.arg_lazy(
10415 "id",
10416 Box::new(move || {
10417 let id = id.clone();
10418 Box::pin(async move { id.into_id().await.unwrap().quote() })
10419 }),
10420 );
10421 Changeset {
10422 proc: self.proc.clone(),
10423 selection: query,
10424 graphql_client: self.graphql_client.clone(),
10425 }
10426 }
10427 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
10429 let mut query = self.selection.select("loadCloudFromID");
10430 query = query.arg_lazy(
10431 "id",
10432 Box::new(move || {
10433 let id = id.clone();
10434 Box::pin(async move { id.into_id().await.unwrap().quote() })
10435 }),
10436 );
10437 Cloud {
10438 proc: self.proc.clone(),
10439 selection: query,
10440 graphql_client: self.graphql_client.clone(),
10441 }
10442 }
10443 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
10445 let mut query = self.selection.select("loadContainerFromID");
10446 query = query.arg_lazy(
10447 "id",
10448 Box::new(move || {
10449 let id = id.clone();
10450 Box::pin(async move { id.into_id().await.unwrap().quote() })
10451 }),
10452 );
10453 Container {
10454 proc: self.proc.clone(),
10455 selection: query,
10456 graphql_client: self.graphql_client.clone(),
10457 }
10458 }
10459 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
10461 let mut query = self.selection.select("loadCurrentModuleFromID");
10462 query = query.arg_lazy(
10463 "id",
10464 Box::new(move || {
10465 let id = id.clone();
10466 Box::pin(async move { id.into_id().await.unwrap().quote() })
10467 }),
10468 );
10469 CurrentModule {
10470 proc: self.proc.clone(),
10471 selection: query,
10472 graphql_client: self.graphql_client.clone(),
10473 }
10474 }
10475 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
10477 let mut query = self.selection.select("loadDirectoryFromID");
10478 query = query.arg_lazy(
10479 "id",
10480 Box::new(move || {
10481 let id = id.clone();
10482 Box::pin(async move { id.into_id().await.unwrap().quote() })
10483 }),
10484 );
10485 Directory {
10486 proc: self.proc.clone(),
10487 selection: query,
10488 graphql_client: self.graphql_client.clone(),
10489 }
10490 }
10491 pub fn load_engine_cache_entry_from_id(
10493 &self,
10494 id: impl IntoID<EngineCacheEntryId>,
10495 ) -> EngineCacheEntry {
10496 let mut query = self.selection.select("loadEngineCacheEntryFromID");
10497 query = query.arg_lazy(
10498 "id",
10499 Box::new(move || {
10500 let id = id.clone();
10501 Box::pin(async move { id.into_id().await.unwrap().quote() })
10502 }),
10503 );
10504 EngineCacheEntry {
10505 proc: self.proc.clone(),
10506 selection: query,
10507 graphql_client: self.graphql_client.clone(),
10508 }
10509 }
10510 pub fn load_engine_cache_entry_set_from_id(
10512 &self,
10513 id: impl IntoID<EngineCacheEntrySetId>,
10514 ) -> EngineCacheEntrySet {
10515 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
10516 query = query.arg_lazy(
10517 "id",
10518 Box::new(move || {
10519 let id = id.clone();
10520 Box::pin(async move { id.into_id().await.unwrap().quote() })
10521 }),
10522 );
10523 EngineCacheEntrySet {
10524 proc: self.proc.clone(),
10525 selection: query,
10526 graphql_client: self.graphql_client.clone(),
10527 }
10528 }
10529 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
10531 let mut query = self.selection.select("loadEngineCacheFromID");
10532 query = query.arg_lazy(
10533 "id",
10534 Box::new(move || {
10535 let id = id.clone();
10536 Box::pin(async move { id.into_id().await.unwrap().quote() })
10537 }),
10538 );
10539 EngineCache {
10540 proc: self.proc.clone(),
10541 selection: query,
10542 graphql_client: self.graphql_client.clone(),
10543 }
10544 }
10545 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
10547 let mut query = self.selection.select("loadEngineFromID");
10548 query = query.arg_lazy(
10549 "id",
10550 Box::new(move || {
10551 let id = id.clone();
10552 Box::pin(async move { id.into_id().await.unwrap().quote() })
10553 }),
10554 );
10555 Engine {
10556 proc: self.proc.clone(),
10557 selection: query,
10558 graphql_client: self.graphql_client.clone(),
10559 }
10560 }
10561 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
10563 let mut query = self.selection.select("loadEnumTypeDefFromID");
10564 query = query.arg_lazy(
10565 "id",
10566 Box::new(move || {
10567 let id = id.clone();
10568 Box::pin(async move { id.into_id().await.unwrap().quote() })
10569 }),
10570 );
10571 EnumTypeDef {
10572 proc: self.proc.clone(),
10573 selection: query,
10574 graphql_client: self.graphql_client.clone(),
10575 }
10576 }
10577 pub fn load_enum_value_type_def_from_id(
10579 &self,
10580 id: impl IntoID<EnumValueTypeDefId>,
10581 ) -> EnumValueTypeDef {
10582 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
10583 query = query.arg_lazy(
10584 "id",
10585 Box::new(move || {
10586 let id = id.clone();
10587 Box::pin(async move { id.into_id().await.unwrap().quote() })
10588 }),
10589 );
10590 EnumValueTypeDef {
10591 proc: self.proc.clone(),
10592 selection: query,
10593 graphql_client: self.graphql_client.clone(),
10594 }
10595 }
10596 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
10598 let mut query = self.selection.select("loadEnvFileFromID");
10599 query = query.arg_lazy(
10600 "id",
10601 Box::new(move || {
10602 let id = id.clone();
10603 Box::pin(async move { id.into_id().await.unwrap().quote() })
10604 }),
10605 );
10606 EnvFile {
10607 proc: self.proc.clone(),
10608 selection: query,
10609 graphql_client: self.graphql_client.clone(),
10610 }
10611 }
10612 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
10614 let mut query = self.selection.select("loadEnvFromID");
10615 query = query.arg_lazy(
10616 "id",
10617 Box::new(move || {
10618 let id = id.clone();
10619 Box::pin(async move { id.into_id().await.unwrap().quote() })
10620 }),
10621 );
10622 Env {
10623 proc: self.proc.clone(),
10624 selection: query,
10625 graphql_client: self.graphql_client.clone(),
10626 }
10627 }
10628 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
10630 let mut query = self.selection.select("loadEnvVariableFromID");
10631 query = query.arg_lazy(
10632 "id",
10633 Box::new(move || {
10634 let id = id.clone();
10635 Box::pin(async move { id.into_id().await.unwrap().quote() })
10636 }),
10637 );
10638 EnvVariable {
10639 proc: self.proc.clone(),
10640 selection: query,
10641 graphql_client: self.graphql_client.clone(),
10642 }
10643 }
10644 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
10646 let mut query = self.selection.select("loadErrorFromID");
10647 query = query.arg_lazy(
10648 "id",
10649 Box::new(move || {
10650 let id = id.clone();
10651 Box::pin(async move { id.into_id().await.unwrap().quote() })
10652 }),
10653 );
10654 Error {
10655 proc: self.proc.clone(),
10656 selection: query,
10657 graphql_client: self.graphql_client.clone(),
10658 }
10659 }
10660 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
10662 let mut query = self.selection.select("loadErrorValueFromID");
10663 query = query.arg_lazy(
10664 "id",
10665 Box::new(move || {
10666 let id = id.clone();
10667 Box::pin(async move { id.into_id().await.unwrap().quote() })
10668 }),
10669 );
10670 ErrorValue {
10671 proc: self.proc.clone(),
10672 selection: query,
10673 graphql_client: self.graphql_client.clone(),
10674 }
10675 }
10676 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
10678 let mut query = self.selection.select("loadFieldTypeDefFromID");
10679 query = query.arg_lazy(
10680 "id",
10681 Box::new(move || {
10682 let id = id.clone();
10683 Box::pin(async move { id.into_id().await.unwrap().quote() })
10684 }),
10685 );
10686 FieldTypeDef {
10687 proc: self.proc.clone(),
10688 selection: query,
10689 graphql_client: self.graphql_client.clone(),
10690 }
10691 }
10692 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
10694 let mut query = self.selection.select("loadFileFromID");
10695 query = query.arg_lazy(
10696 "id",
10697 Box::new(move || {
10698 let id = id.clone();
10699 Box::pin(async move { id.into_id().await.unwrap().quote() })
10700 }),
10701 );
10702 File {
10703 proc: self.proc.clone(),
10704 selection: query,
10705 graphql_client: self.graphql_client.clone(),
10706 }
10707 }
10708 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
10710 let mut query = self.selection.select("loadFunctionArgFromID");
10711 query = query.arg_lazy(
10712 "id",
10713 Box::new(move || {
10714 let id = id.clone();
10715 Box::pin(async move { id.into_id().await.unwrap().quote() })
10716 }),
10717 );
10718 FunctionArg {
10719 proc: self.proc.clone(),
10720 selection: query,
10721 graphql_client: self.graphql_client.clone(),
10722 }
10723 }
10724 pub fn load_function_call_arg_value_from_id(
10726 &self,
10727 id: impl IntoID<FunctionCallArgValueId>,
10728 ) -> FunctionCallArgValue {
10729 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
10730 query = query.arg_lazy(
10731 "id",
10732 Box::new(move || {
10733 let id = id.clone();
10734 Box::pin(async move { id.into_id().await.unwrap().quote() })
10735 }),
10736 );
10737 FunctionCallArgValue {
10738 proc: self.proc.clone(),
10739 selection: query,
10740 graphql_client: self.graphql_client.clone(),
10741 }
10742 }
10743 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
10745 let mut query = self.selection.select("loadFunctionCallFromID");
10746 query = query.arg_lazy(
10747 "id",
10748 Box::new(move || {
10749 let id = id.clone();
10750 Box::pin(async move { id.into_id().await.unwrap().quote() })
10751 }),
10752 );
10753 FunctionCall {
10754 proc: self.proc.clone(),
10755 selection: query,
10756 graphql_client: self.graphql_client.clone(),
10757 }
10758 }
10759 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
10761 let mut query = self.selection.select("loadFunctionFromID");
10762 query = query.arg_lazy(
10763 "id",
10764 Box::new(move || {
10765 let id = id.clone();
10766 Box::pin(async move { id.into_id().await.unwrap().quote() })
10767 }),
10768 );
10769 Function {
10770 proc: self.proc.clone(),
10771 selection: query,
10772 graphql_client: self.graphql_client.clone(),
10773 }
10774 }
10775 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
10777 let mut query = self.selection.select("loadGeneratedCodeFromID");
10778 query = query.arg_lazy(
10779 "id",
10780 Box::new(move || {
10781 let id = id.clone();
10782 Box::pin(async move { id.into_id().await.unwrap().quote() })
10783 }),
10784 );
10785 GeneratedCode {
10786 proc: self.proc.clone(),
10787 selection: query,
10788 graphql_client: self.graphql_client.clone(),
10789 }
10790 }
10791 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
10793 let mut query = self.selection.select("loadGitRefFromID");
10794 query = query.arg_lazy(
10795 "id",
10796 Box::new(move || {
10797 let id = id.clone();
10798 Box::pin(async move { id.into_id().await.unwrap().quote() })
10799 }),
10800 );
10801 GitRef {
10802 proc: self.proc.clone(),
10803 selection: query,
10804 graphql_client: self.graphql_client.clone(),
10805 }
10806 }
10807 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
10809 let mut query = self.selection.select("loadGitRepositoryFromID");
10810 query = query.arg_lazy(
10811 "id",
10812 Box::new(move || {
10813 let id = id.clone();
10814 Box::pin(async move { id.into_id().await.unwrap().quote() })
10815 }),
10816 );
10817 GitRepository {
10818 proc: self.proc.clone(),
10819 selection: query,
10820 graphql_client: self.graphql_client.clone(),
10821 }
10822 }
10823 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
10825 let mut query = self.selection.select("loadHostFromID");
10826 query = query.arg_lazy(
10827 "id",
10828 Box::new(move || {
10829 let id = id.clone();
10830 Box::pin(async move { id.into_id().await.unwrap().quote() })
10831 }),
10832 );
10833 Host {
10834 proc: self.proc.clone(),
10835 selection: query,
10836 graphql_client: self.graphql_client.clone(),
10837 }
10838 }
10839 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
10841 let mut query = self.selection.select("loadInputTypeDefFromID");
10842 query = query.arg_lazy(
10843 "id",
10844 Box::new(move || {
10845 let id = id.clone();
10846 Box::pin(async move { id.into_id().await.unwrap().quote() })
10847 }),
10848 );
10849 InputTypeDef {
10850 proc: self.proc.clone(),
10851 selection: query,
10852 graphql_client: self.graphql_client.clone(),
10853 }
10854 }
10855 pub fn load_interface_type_def_from_id(
10857 &self,
10858 id: impl IntoID<InterfaceTypeDefId>,
10859 ) -> InterfaceTypeDef {
10860 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
10861 query = query.arg_lazy(
10862 "id",
10863 Box::new(move || {
10864 let id = id.clone();
10865 Box::pin(async move { id.into_id().await.unwrap().quote() })
10866 }),
10867 );
10868 InterfaceTypeDef {
10869 proc: self.proc.clone(),
10870 selection: query,
10871 graphql_client: self.graphql_client.clone(),
10872 }
10873 }
10874 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
10876 let mut query = self.selection.select("loadJSONValueFromID");
10877 query = query.arg_lazy(
10878 "id",
10879 Box::new(move || {
10880 let id = id.clone();
10881 Box::pin(async move { id.into_id().await.unwrap().quote() })
10882 }),
10883 );
10884 JsonValue {
10885 proc: self.proc.clone(),
10886 selection: query,
10887 graphql_client: self.graphql_client.clone(),
10888 }
10889 }
10890 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
10892 let mut query = self.selection.select("loadLLMFromID");
10893 query = query.arg_lazy(
10894 "id",
10895 Box::new(move || {
10896 let id = id.clone();
10897 Box::pin(async move { id.into_id().await.unwrap().quote() })
10898 }),
10899 );
10900 Llm {
10901 proc: self.proc.clone(),
10902 selection: query,
10903 graphql_client: self.graphql_client.clone(),
10904 }
10905 }
10906 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
10908 let mut query = self.selection.select("loadLLMTokenUsageFromID");
10909 query = query.arg_lazy(
10910 "id",
10911 Box::new(move || {
10912 let id = id.clone();
10913 Box::pin(async move { id.into_id().await.unwrap().quote() })
10914 }),
10915 );
10916 LlmTokenUsage {
10917 proc: self.proc.clone(),
10918 selection: query,
10919 graphql_client: self.graphql_client.clone(),
10920 }
10921 }
10922 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
10924 let mut query = self.selection.select("loadLabelFromID");
10925 query = query.arg_lazy(
10926 "id",
10927 Box::new(move || {
10928 let id = id.clone();
10929 Box::pin(async move { id.into_id().await.unwrap().quote() })
10930 }),
10931 );
10932 Label {
10933 proc: self.proc.clone(),
10934 selection: query,
10935 graphql_client: self.graphql_client.clone(),
10936 }
10937 }
10938 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
10940 let mut query = self.selection.select("loadListTypeDefFromID");
10941 query = query.arg_lazy(
10942 "id",
10943 Box::new(move || {
10944 let id = id.clone();
10945 Box::pin(async move { id.into_id().await.unwrap().quote() })
10946 }),
10947 );
10948 ListTypeDef {
10949 proc: self.proc.clone(),
10950 selection: query,
10951 graphql_client: self.graphql_client.clone(),
10952 }
10953 }
10954 pub fn load_module_config_client_from_id(
10956 &self,
10957 id: impl IntoID<ModuleConfigClientId>,
10958 ) -> ModuleConfigClient {
10959 let mut query = self.selection.select("loadModuleConfigClientFromID");
10960 query = query.arg_lazy(
10961 "id",
10962 Box::new(move || {
10963 let id = id.clone();
10964 Box::pin(async move { id.into_id().await.unwrap().quote() })
10965 }),
10966 );
10967 ModuleConfigClient {
10968 proc: self.proc.clone(),
10969 selection: query,
10970 graphql_client: self.graphql_client.clone(),
10971 }
10972 }
10973 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
10975 let mut query = self.selection.select("loadModuleFromID");
10976 query = query.arg_lazy(
10977 "id",
10978 Box::new(move || {
10979 let id = id.clone();
10980 Box::pin(async move { id.into_id().await.unwrap().quote() })
10981 }),
10982 );
10983 Module {
10984 proc: self.proc.clone(),
10985 selection: query,
10986 graphql_client: self.graphql_client.clone(),
10987 }
10988 }
10989 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
10991 let mut query = self.selection.select("loadModuleSourceFromID");
10992 query = query.arg_lazy(
10993 "id",
10994 Box::new(move || {
10995 let id = id.clone();
10996 Box::pin(async move { id.into_id().await.unwrap().quote() })
10997 }),
10998 );
10999 ModuleSource {
11000 proc: self.proc.clone(),
11001 selection: query,
11002 graphql_client: self.graphql_client.clone(),
11003 }
11004 }
11005 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
11007 let mut query = self.selection.select("loadObjectTypeDefFromID");
11008 query = query.arg_lazy(
11009 "id",
11010 Box::new(move || {
11011 let id = id.clone();
11012 Box::pin(async move { id.into_id().await.unwrap().quote() })
11013 }),
11014 );
11015 ObjectTypeDef {
11016 proc: self.proc.clone(),
11017 selection: query,
11018 graphql_client: self.graphql_client.clone(),
11019 }
11020 }
11021 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
11023 let mut query = self.selection.select("loadPortFromID");
11024 query = query.arg_lazy(
11025 "id",
11026 Box::new(move || {
11027 let id = id.clone();
11028 Box::pin(async move { id.into_id().await.unwrap().quote() })
11029 }),
11030 );
11031 Port {
11032 proc: self.proc.clone(),
11033 selection: query,
11034 graphql_client: self.graphql_client.clone(),
11035 }
11036 }
11037 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
11039 let mut query = self.selection.select("loadSDKConfigFromID");
11040 query = query.arg_lazy(
11041 "id",
11042 Box::new(move || {
11043 let id = id.clone();
11044 Box::pin(async move { id.into_id().await.unwrap().quote() })
11045 }),
11046 );
11047 SdkConfig {
11048 proc: self.proc.clone(),
11049 selection: query,
11050 graphql_client: self.graphql_client.clone(),
11051 }
11052 }
11053 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
11055 let mut query = self.selection.select("loadScalarTypeDefFromID");
11056 query = query.arg_lazy(
11057 "id",
11058 Box::new(move || {
11059 let id = id.clone();
11060 Box::pin(async move { id.into_id().await.unwrap().quote() })
11061 }),
11062 );
11063 ScalarTypeDef {
11064 proc: self.proc.clone(),
11065 selection: query,
11066 graphql_client: self.graphql_client.clone(),
11067 }
11068 }
11069 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
11071 let mut query = self.selection.select("loadSearchResultFromID");
11072 query = query.arg_lazy(
11073 "id",
11074 Box::new(move || {
11075 let id = id.clone();
11076 Box::pin(async move { id.into_id().await.unwrap().quote() })
11077 }),
11078 );
11079 SearchResult {
11080 proc: self.proc.clone(),
11081 selection: query,
11082 graphql_client: self.graphql_client.clone(),
11083 }
11084 }
11085 pub fn load_search_submatch_from_id(
11087 &self,
11088 id: impl IntoID<SearchSubmatchId>,
11089 ) -> SearchSubmatch {
11090 let mut query = self.selection.select("loadSearchSubmatchFromID");
11091 query = query.arg_lazy(
11092 "id",
11093 Box::new(move || {
11094 let id = id.clone();
11095 Box::pin(async move { id.into_id().await.unwrap().quote() })
11096 }),
11097 );
11098 SearchSubmatch {
11099 proc: self.proc.clone(),
11100 selection: query,
11101 graphql_client: self.graphql_client.clone(),
11102 }
11103 }
11104 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
11106 let mut query = self.selection.select("loadSecretFromID");
11107 query = query.arg_lazy(
11108 "id",
11109 Box::new(move || {
11110 let id = id.clone();
11111 Box::pin(async move { id.into_id().await.unwrap().quote() })
11112 }),
11113 );
11114 Secret {
11115 proc: self.proc.clone(),
11116 selection: query,
11117 graphql_client: self.graphql_client.clone(),
11118 }
11119 }
11120 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
11122 let mut query = self.selection.select("loadServiceFromID");
11123 query = query.arg_lazy(
11124 "id",
11125 Box::new(move || {
11126 let id = id.clone();
11127 Box::pin(async move { id.into_id().await.unwrap().quote() })
11128 }),
11129 );
11130 Service {
11131 proc: self.proc.clone(),
11132 selection: query,
11133 graphql_client: self.graphql_client.clone(),
11134 }
11135 }
11136 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
11138 let mut query = self.selection.select("loadSocketFromID");
11139 query = query.arg_lazy(
11140 "id",
11141 Box::new(move || {
11142 let id = id.clone();
11143 Box::pin(async move { id.into_id().await.unwrap().quote() })
11144 }),
11145 );
11146 Socket {
11147 proc: self.proc.clone(),
11148 selection: query,
11149 graphql_client: self.graphql_client.clone(),
11150 }
11151 }
11152 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
11154 let mut query = self.selection.select("loadSourceMapFromID");
11155 query = query.arg_lazy(
11156 "id",
11157 Box::new(move || {
11158 let id = id.clone();
11159 Box::pin(async move { id.into_id().await.unwrap().quote() })
11160 }),
11161 );
11162 SourceMap {
11163 proc: self.proc.clone(),
11164 selection: query,
11165 graphql_client: self.graphql_client.clone(),
11166 }
11167 }
11168 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
11170 let mut query = self.selection.select("loadTerminalFromID");
11171 query = query.arg_lazy(
11172 "id",
11173 Box::new(move || {
11174 let id = id.clone();
11175 Box::pin(async move { id.into_id().await.unwrap().quote() })
11176 }),
11177 );
11178 Terminal {
11179 proc: self.proc.clone(),
11180 selection: query,
11181 graphql_client: self.graphql_client.clone(),
11182 }
11183 }
11184 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
11186 let mut query = self.selection.select("loadTypeDefFromID");
11187 query = query.arg_lazy(
11188 "id",
11189 Box::new(move || {
11190 let id = id.clone();
11191 Box::pin(async move { id.into_id().await.unwrap().quote() })
11192 }),
11193 );
11194 TypeDef {
11195 proc: self.proc.clone(),
11196 selection: query,
11197 graphql_client: self.graphql_client.clone(),
11198 }
11199 }
11200 pub fn module(&self) -> Module {
11202 let query = self.selection.select("module");
11203 Module {
11204 proc: self.proc.clone(),
11205 selection: query,
11206 graphql_client: self.graphql_client.clone(),
11207 }
11208 }
11209 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
11216 let mut query = self.selection.select("moduleSource");
11217 query = query.arg("refString", ref_string.into());
11218 ModuleSource {
11219 proc: self.proc.clone(),
11220 selection: query,
11221 graphql_client: self.graphql_client.clone(),
11222 }
11223 }
11224 pub fn module_source_opts<'a>(
11231 &self,
11232 ref_string: impl Into<String>,
11233 opts: QueryModuleSourceOpts<'a>,
11234 ) -> ModuleSource {
11235 let mut query = self.selection.select("moduleSource");
11236 query = query.arg("refString", ref_string.into());
11237 if let Some(ref_pin) = opts.ref_pin {
11238 query = query.arg("refPin", ref_pin);
11239 }
11240 if let Some(disable_find_up) = opts.disable_find_up {
11241 query = query.arg("disableFindUp", disable_find_up);
11242 }
11243 if let Some(allow_not_exists) = opts.allow_not_exists {
11244 query = query.arg("allowNotExists", allow_not_exists);
11245 }
11246 if let Some(require_kind) = opts.require_kind {
11247 query = query.arg("requireKind", require_kind);
11248 }
11249 ModuleSource {
11250 proc: self.proc.clone(),
11251 selection: query,
11252 graphql_client: self.graphql_client.clone(),
11253 }
11254 }
11255 pub fn secret(&self, uri: impl Into<String>) -> Secret {
11262 let mut query = self.selection.select("secret");
11263 query = query.arg("uri", uri.into());
11264 Secret {
11265 proc: self.proc.clone(),
11266 selection: query,
11267 graphql_client: self.graphql_client.clone(),
11268 }
11269 }
11270 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
11277 let mut query = self.selection.select("secret");
11278 query = query.arg("uri", uri.into());
11279 if let Some(cache_key) = opts.cache_key {
11280 query = query.arg("cacheKey", cache_key);
11281 }
11282 Secret {
11283 proc: self.proc.clone(),
11284 selection: query,
11285 graphql_client: self.graphql_client.clone(),
11286 }
11287 }
11288 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
11296 let mut query = self.selection.select("setSecret");
11297 query = query.arg("name", name.into());
11298 query = query.arg("plaintext", plaintext.into());
11299 Secret {
11300 proc: self.proc.clone(),
11301 selection: query,
11302 graphql_client: self.graphql_client.clone(),
11303 }
11304 }
11305 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
11313 let mut query = self.selection.select("sourceMap");
11314 query = query.arg("filename", filename.into());
11315 query = query.arg("line", line);
11316 query = query.arg("column", column);
11317 SourceMap {
11318 proc: self.proc.clone(),
11319 selection: query,
11320 graphql_client: self.graphql_client.clone(),
11321 }
11322 }
11323 pub fn type_def(&self) -> TypeDef {
11325 let query = self.selection.select("typeDef");
11326 TypeDef {
11327 proc: self.proc.clone(),
11328 selection: query,
11329 graphql_client: self.graphql_client.clone(),
11330 }
11331 }
11332 pub async fn version(&self) -> Result<String, DaggerError> {
11334 let query = self.selection.select("version");
11335 query.execute(self.graphql_client.clone()).await
11336 }
11337}
11338#[derive(Clone)]
11339pub struct SdkConfig {
11340 pub proc: Option<Arc<DaggerSessionProc>>,
11341 pub selection: Selection,
11342 pub graphql_client: DynGraphQLClient,
11343}
11344impl SdkConfig {
11345 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
11347 let query = self.selection.select("id");
11348 query.execute(self.graphql_client.clone()).await
11349 }
11350 pub async fn source(&self) -> Result<String, DaggerError> {
11352 let query = self.selection.select("source");
11353 query.execute(self.graphql_client.clone()).await
11354 }
11355}
11356#[derive(Clone)]
11357pub struct ScalarTypeDef {
11358 pub proc: Option<Arc<DaggerSessionProc>>,
11359 pub selection: Selection,
11360 pub graphql_client: DynGraphQLClient,
11361}
11362impl ScalarTypeDef {
11363 pub async fn description(&self) -> Result<String, DaggerError> {
11365 let query = self.selection.select("description");
11366 query.execute(self.graphql_client.clone()).await
11367 }
11368 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
11370 let query = self.selection.select("id");
11371 query.execute(self.graphql_client.clone()).await
11372 }
11373 pub async fn name(&self) -> Result<String, DaggerError> {
11375 let query = self.selection.select("name");
11376 query.execute(self.graphql_client.clone()).await
11377 }
11378 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11380 let query = self.selection.select("sourceModuleName");
11381 query.execute(self.graphql_client.clone()).await
11382 }
11383}
11384#[derive(Clone)]
11385pub struct SearchResult {
11386 pub proc: Option<Arc<DaggerSessionProc>>,
11387 pub selection: Selection,
11388 pub graphql_client: DynGraphQLClient,
11389}
11390impl SearchResult {
11391 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
11393 let query = self.selection.select("absoluteOffset");
11394 query.execute(self.graphql_client.clone()).await
11395 }
11396 pub async fn file_path(&self) -> Result<String, DaggerError> {
11398 let query = self.selection.select("filePath");
11399 query.execute(self.graphql_client.clone()).await
11400 }
11401 pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
11403 let query = self.selection.select("id");
11404 query.execute(self.graphql_client.clone()).await
11405 }
11406 pub async fn line_number(&self) -> Result<isize, DaggerError> {
11408 let query = self.selection.select("lineNumber");
11409 query.execute(self.graphql_client.clone()).await
11410 }
11411 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
11413 let query = self.selection.select("matchedLines");
11414 query.execute(self.graphql_client.clone()).await
11415 }
11416 pub fn submatches(&self) -> Vec<SearchSubmatch> {
11418 let query = self.selection.select("submatches");
11419 vec![SearchSubmatch {
11420 proc: self.proc.clone(),
11421 selection: query,
11422 graphql_client: self.graphql_client.clone(),
11423 }]
11424 }
11425}
11426#[derive(Clone)]
11427pub struct SearchSubmatch {
11428 pub proc: Option<Arc<DaggerSessionProc>>,
11429 pub selection: Selection,
11430 pub graphql_client: DynGraphQLClient,
11431}
11432impl SearchSubmatch {
11433 pub async fn end(&self) -> Result<isize, DaggerError> {
11435 let query = self.selection.select("end");
11436 query.execute(self.graphql_client.clone()).await
11437 }
11438 pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
11440 let query = self.selection.select("id");
11441 query.execute(self.graphql_client.clone()).await
11442 }
11443 pub async fn start(&self) -> Result<isize, DaggerError> {
11445 let query = self.selection.select("start");
11446 query.execute(self.graphql_client.clone()).await
11447 }
11448 pub async fn text(&self) -> Result<String, DaggerError> {
11450 let query = self.selection.select("text");
11451 query.execute(self.graphql_client.clone()).await
11452 }
11453}
11454#[derive(Clone)]
11455pub struct Secret {
11456 pub proc: Option<Arc<DaggerSessionProc>>,
11457 pub selection: Selection,
11458 pub graphql_client: DynGraphQLClient,
11459}
11460impl Secret {
11461 pub async fn id(&self) -> Result<SecretId, DaggerError> {
11463 let query = self.selection.select("id");
11464 query.execute(self.graphql_client.clone()).await
11465 }
11466 pub async fn name(&self) -> Result<String, DaggerError> {
11468 let query = self.selection.select("name");
11469 query.execute(self.graphql_client.clone()).await
11470 }
11471 pub async fn plaintext(&self) -> Result<String, DaggerError> {
11473 let query = self.selection.select("plaintext");
11474 query.execute(self.graphql_client.clone()).await
11475 }
11476 pub async fn uri(&self) -> Result<String, DaggerError> {
11478 let query = self.selection.select("uri");
11479 query.execute(self.graphql_client.clone()).await
11480 }
11481}
11482#[derive(Clone)]
11483pub struct Service {
11484 pub proc: Option<Arc<DaggerSessionProc>>,
11485 pub selection: Selection,
11486 pub graphql_client: DynGraphQLClient,
11487}
11488#[derive(Builder, Debug, PartialEq)]
11489pub struct ServiceEndpointOpts<'a> {
11490 #[builder(setter(into, strip_option), default)]
11492 pub port: Option<isize>,
11493 #[builder(setter(into, strip_option), default)]
11495 pub scheme: Option<&'a str>,
11496}
11497#[derive(Builder, Debug, PartialEq)]
11498pub struct ServiceStopOpts {
11499 #[builder(setter(into, strip_option), default)]
11501 pub kill: Option<bool>,
11502}
11503#[derive(Builder, Debug, PartialEq)]
11504pub struct ServiceTerminalOpts<'a> {
11505 #[builder(setter(into, strip_option), default)]
11506 pub cmd: Option<Vec<&'a str>>,
11507}
11508#[derive(Builder, Debug, PartialEq)]
11509pub struct ServiceUpOpts {
11510 #[builder(setter(into, strip_option), default)]
11513 pub ports: Option<Vec<PortForward>>,
11514 #[builder(setter(into, strip_option), default)]
11516 pub random: Option<bool>,
11517}
11518impl Service {
11519 pub async fn endpoint(&self) -> Result<String, DaggerError> {
11527 let query = self.selection.select("endpoint");
11528 query.execute(self.graphql_client.clone()).await
11529 }
11530 pub async fn endpoint_opts<'a>(
11538 &self,
11539 opts: ServiceEndpointOpts<'a>,
11540 ) -> Result<String, DaggerError> {
11541 let mut query = self.selection.select("endpoint");
11542 if let Some(port) = opts.port {
11543 query = query.arg("port", port);
11544 }
11545 if let Some(scheme) = opts.scheme {
11546 query = query.arg("scheme", scheme);
11547 }
11548 query.execute(self.graphql_client.clone()).await
11549 }
11550 pub async fn hostname(&self) -> Result<String, DaggerError> {
11552 let query = self.selection.select("hostname");
11553 query.execute(self.graphql_client.clone()).await
11554 }
11555 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
11557 let query = self.selection.select("id");
11558 query.execute(self.graphql_client.clone()).await
11559 }
11560 pub fn ports(&self) -> Vec<Port> {
11562 let query = self.selection.select("ports");
11563 vec![Port {
11564 proc: self.proc.clone(),
11565 selection: query,
11566 graphql_client: self.graphql_client.clone(),
11567 }]
11568 }
11569 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
11572 let query = self.selection.select("start");
11573 query.execute(self.graphql_client.clone()).await
11574 }
11575 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
11581 let query = self.selection.select("stop");
11582 query.execute(self.graphql_client.clone()).await
11583 }
11584 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
11590 let mut query = self.selection.select("stop");
11591 if let Some(kill) = opts.kill {
11592 query = query.arg("kill", kill);
11593 }
11594 query.execute(self.graphql_client.clone()).await
11595 }
11596 pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
11598 let query = self.selection.select("sync");
11599 query.execute(self.graphql_client.clone()).await
11600 }
11601 pub fn terminal(&self) -> Service {
11606 let query = self.selection.select("terminal");
11607 Service {
11608 proc: self.proc.clone(),
11609 selection: query,
11610 graphql_client: self.graphql_client.clone(),
11611 }
11612 }
11613 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
11618 let mut query = self.selection.select("terminal");
11619 if let Some(cmd) = opts.cmd {
11620 query = query.arg("cmd", cmd);
11621 }
11622 Service {
11623 proc: self.proc.clone(),
11624 selection: query,
11625 graphql_client: self.graphql_client.clone(),
11626 }
11627 }
11628 pub async fn up(&self) -> Result<Void, DaggerError> {
11634 let query = self.selection.select("up");
11635 query.execute(self.graphql_client.clone()).await
11636 }
11637 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
11643 let mut query = self.selection.select("up");
11644 if let Some(ports) = opts.ports {
11645 query = query.arg("ports", ports);
11646 }
11647 if let Some(random) = opts.random {
11648 query = query.arg("random", random);
11649 }
11650 query.execute(self.graphql_client.clone()).await
11651 }
11652 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
11658 let mut query = self.selection.select("withHostname");
11659 query = query.arg("hostname", hostname.into());
11660 Service {
11661 proc: self.proc.clone(),
11662 selection: query,
11663 graphql_client: self.graphql_client.clone(),
11664 }
11665 }
11666}
11667#[derive(Clone)]
11668pub struct Socket {
11669 pub proc: Option<Arc<DaggerSessionProc>>,
11670 pub selection: Selection,
11671 pub graphql_client: DynGraphQLClient,
11672}
11673impl Socket {
11674 pub async fn id(&self) -> Result<SocketId, DaggerError> {
11676 let query = self.selection.select("id");
11677 query.execute(self.graphql_client.clone()).await
11678 }
11679}
11680#[derive(Clone)]
11681pub struct SourceMap {
11682 pub proc: Option<Arc<DaggerSessionProc>>,
11683 pub selection: Selection,
11684 pub graphql_client: DynGraphQLClient,
11685}
11686impl SourceMap {
11687 pub async fn column(&self) -> Result<isize, DaggerError> {
11689 let query = self.selection.select("column");
11690 query.execute(self.graphql_client.clone()).await
11691 }
11692 pub async fn filename(&self) -> Result<String, DaggerError> {
11694 let query = self.selection.select("filename");
11695 query.execute(self.graphql_client.clone()).await
11696 }
11697 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
11699 let query = self.selection.select("id");
11700 query.execute(self.graphql_client.clone()).await
11701 }
11702 pub async fn line(&self) -> Result<isize, DaggerError> {
11704 let query = self.selection.select("line");
11705 query.execute(self.graphql_client.clone()).await
11706 }
11707 pub async fn module(&self) -> Result<String, DaggerError> {
11709 let query = self.selection.select("module");
11710 query.execute(self.graphql_client.clone()).await
11711 }
11712 pub async fn url(&self) -> Result<String, DaggerError> {
11714 let query = self.selection.select("url");
11715 query.execute(self.graphql_client.clone()).await
11716 }
11717}
11718#[derive(Clone)]
11719pub struct Terminal {
11720 pub proc: Option<Arc<DaggerSessionProc>>,
11721 pub selection: Selection,
11722 pub graphql_client: DynGraphQLClient,
11723}
11724impl Terminal {
11725 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
11727 let query = self.selection.select("id");
11728 query.execute(self.graphql_client.clone()).await
11729 }
11730 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
11733 let query = self.selection.select("sync");
11734 query.execute(self.graphql_client.clone()).await
11735 }
11736}
11737#[derive(Clone)]
11738pub struct TypeDef {
11739 pub proc: Option<Arc<DaggerSessionProc>>,
11740 pub selection: Selection,
11741 pub graphql_client: DynGraphQLClient,
11742}
11743#[derive(Builder, Debug, PartialEq)]
11744pub struct TypeDefWithEnumOpts<'a> {
11745 #[builder(setter(into, strip_option), default)]
11747 pub description: Option<&'a str>,
11748 #[builder(setter(into, strip_option), default)]
11750 pub source_map: Option<SourceMapId>,
11751}
11752#[derive(Builder, Debug, PartialEq)]
11753pub struct TypeDefWithEnumMemberOpts<'a> {
11754 #[builder(setter(into, strip_option), default)]
11756 pub description: Option<&'a str>,
11757 #[builder(setter(into, strip_option), default)]
11759 pub source_map: Option<SourceMapId>,
11760 #[builder(setter(into, strip_option), default)]
11762 pub value: Option<&'a str>,
11763}
11764#[derive(Builder, Debug, PartialEq)]
11765pub struct TypeDefWithEnumValueOpts<'a> {
11766 #[builder(setter(into, strip_option), default)]
11768 pub description: Option<&'a str>,
11769 #[builder(setter(into, strip_option), default)]
11771 pub source_map: Option<SourceMapId>,
11772}
11773#[derive(Builder, Debug, PartialEq)]
11774pub struct TypeDefWithFieldOpts<'a> {
11775 #[builder(setter(into, strip_option), default)]
11777 pub description: Option<&'a str>,
11778 #[builder(setter(into, strip_option), default)]
11780 pub source_map: Option<SourceMapId>,
11781}
11782#[derive(Builder, Debug, PartialEq)]
11783pub struct TypeDefWithInterfaceOpts<'a> {
11784 #[builder(setter(into, strip_option), default)]
11785 pub description: Option<&'a str>,
11786 #[builder(setter(into, strip_option), default)]
11787 pub source_map: Option<SourceMapId>,
11788}
11789#[derive(Builder, Debug, PartialEq)]
11790pub struct TypeDefWithObjectOpts<'a> {
11791 #[builder(setter(into, strip_option), default)]
11792 pub description: Option<&'a str>,
11793 #[builder(setter(into, strip_option), default)]
11794 pub source_map: Option<SourceMapId>,
11795}
11796#[derive(Builder, Debug, PartialEq)]
11797pub struct TypeDefWithScalarOpts<'a> {
11798 #[builder(setter(into, strip_option), default)]
11799 pub description: Option<&'a str>,
11800}
11801impl TypeDef {
11802 pub fn as_enum(&self) -> EnumTypeDef {
11804 let query = self.selection.select("asEnum");
11805 EnumTypeDef {
11806 proc: self.proc.clone(),
11807 selection: query,
11808 graphql_client: self.graphql_client.clone(),
11809 }
11810 }
11811 pub fn as_input(&self) -> InputTypeDef {
11813 let query = self.selection.select("asInput");
11814 InputTypeDef {
11815 proc: self.proc.clone(),
11816 selection: query,
11817 graphql_client: self.graphql_client.clone(),
11818 }
11819 }
11820 pub fn as_interface(&self) -> InterfaceTypeDef {
11822 let query = self.selection.select("asInterface");
11823 InterfaceTypeDef {
11824 proc: self.proc.clone(),
11825 selection: query,
11826 graphql_client: self.graphql_client.clone(),
11827 }
11828 }
11829 pub fn as_list(&self) -> ListTypeDef {
11831 let query = self.selection.select("asList");
11832 ListTypeDef {
11833 proc: self.proc.clone(),
11834 selection: query,
11835 graphql_client: self.graphql_client.clone(),
11836 }
11837 }
11838 pub fn as_object(&self) -> ObjectTypeDef {
11840 let query = self.selection.select("asObject");
11841 ObjectTypeDef {
11842 proc: self.proc.clone(),
11843 selection: query,
11844 graphql_client: self.graphql_client.clone(),
11845 }
11846 }
11847 pub fn as_scalar(&self) -> ScalarTypeDef {
11849 let query = self.selection.select("asScalar");
11850 ScalarTypeDef {
11851 proc: self.proc.clone(),
11852 selection: query,
11853 graphql_client: self.graphql_client.clone(),
11854 }
11855 }
11856 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
11858 let query = self.selection.select("id");
11859 query.execute(self.graphql_client.clone()).await
11860 }
11861 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
11863 let query = self.selection.select("kind");
11864 query.execute(self.graphql_client.clone()).await
11865 }
11866 pub async fn optional(&self) -> Result<bool, DaggerError> {
11868 let query = self.selection.select("optional");
11869 query.execute(self.graphql_client.clone()).await
11870 }
11871 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
11873 let mut query = self.selection.select("withConstructor");
11874 query = query.arg_lazy(
11875 "function",
11876 Box::new(move || {
11877 let function = function.clone();
11878 Box::pin(async move { function.into_id().await.unwrap().quote() })
11879 }),
11880 );
11881 TypeDef {
11882 proc: self.proc.clone(),
11883 selection: query,
11884 graphql_client: self.graphql_client.clone(),
11885 }
11886 }
11887 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
11895 let mut query = self.selection.select("withEnum");
11896 query = query.arg("name", name.into());
11897 TypeDef {
11898 proc: self.proc.clone(),
11899 selection: query,
11900 graphql_client: self.graphql_client.clone(),
11901 }
11902 }
11903 pub fn with_enum_opts<'a>(
11911 &self,
11912 name: impl Into<String>,
11913 opts: TypeDefWithEnumOpts<'a>,
11914 ) -> TypeDef {
11915 let mut query = self.selection.select("withEnum");
11916 query = query.arg("name", name.into());
11917 if let Some(description) = opts.description {
11918 query = query.arg("description", description);
11919 }
11920 if let Some(source_map) = opts.source_map {
11921 query = query.arg("sourceMap", source_map);
11922 }
11923 TypeDef {
11924 proc: self.proc.clone(),
11925 selection: query,
11926 graphql_client: self.graphql_client.clone(),
11927 }
11928 }
11929 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
11936 let mut query = self.selection.select("withEnumMember");
11937 query = query.arg("name", name.into());
11938 TypeDef {
11939 proc: self.proc.clone(),
11940 selection: query,
11941 graphql_client: self.graphql_client.clone(),
11942 }
11943 }
11944 pub fn with_enum_member_opts<'a>(
11951 &self,
11952 name: impl Into<String>,
11953 opts: TypeDefWithEnumMemberOpts<'a>,
11954 ) -> TypeDef {
11955 let mut query = self.selection.select("withEnumMember");
11956 query = query.arg("name", name.into());
11957 if let Some(value) = opts.value {
11958 query = query.arg("value", value);
11959 }
11960 if let Some(description) = opts.description {
11961 query = query.arg("description", description);
11962 }
11963 if let Some(source_map) = opts.source_map {
11964 query = query.arg("sourceMap", source_map);
11965 }
11966 TypeDef {
11967 proc: self.proc.clone(),
11968 selection: query,
11969 graphql_client: self.graphql_client.clone(),
11970 }
11971 }
11972 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
11979 let mut query = self.selection.select("withEnumValue");
11980 query = query.arg("value", value.into());
11981 TypeDef {
11982 proc: self.proc.clone(),
11983 selection: query,
11984 graphql_client: self.graphql_client.clone(),
11985 }
11986 }
11987 pub fn with_enum_value_opts<'a>(
11994 &self,
11995 value: impl Into<String>,
11996 opts: TypeDefWithEnumValueOpts<'a>,
11997 ) -> TypeDef {
11998 let mut query = self.selection.select("withEnumValue");
11999 query = query.arg("value", value.into());
12000 if let Some(description) = opts.description {
12001 query = query.arg("description", description);
12002 }
12003 if let Some(source_map) = opts.source_map {
12004 query = query.arg("sourceMap", source_map);
12005 }
12006 TypeDef {
12007 proc: self.proc.clone(),
12008 selection: query,
12009 graphql_client: self.graphql_client.clone(),
12010 }
12011 }
12012 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
12020 let mut query = self.selection.select("withField");
12021 query = query.arg("name", name.into());
12022 query = query.arg_lazy(
12023 "typeDef",
12024 Box::new(move || {
12025 let type_def = type_def.clone();
12026 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12027 }),
12028 );
12029 TypeDef {
12030 proc: self.proc.clone(),
12031 selection: query,
12032 graphql_client: self.graphql_client.clone(),
12033 }
12034 }
12035 pub fn with_field_opts<'a>(
12043 &self,
12044 name: impl Into<String>,
12045 type_def: impl IntoID<TypeDefId>,
12046 opts: TypeDefWithFieldOpts<'a>,
12047 ) -> TypeDef {
12048 let mut query = self.selection.select("withField");
12049 query = query.arg("name", name.into());
12050 query = query.arg_lazy(
12051 "typeDef",
12052 Box::new(move || {
12053 let type_def = type_def.clone();
12054 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12055 }),
12056 );
12057 if let Some(description) = opts.description {
12058 query = query.arg("description", description);
12059 }
12060 if let Some(source_map) = opts.source_map {
12061 query = query.arg("sourceMap", source_map);
12062 }
12063 TypeDef {
12064 proc: self.proc.clone(),
12065 selection: query,
12066 graphql_client: self.graphql_client.clone(),
12067 }
12068 }
12069 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12071 let mut query = self.selection.select("withFunction");
12072 query = query.arg_lazy(
12073 "function",
12074 Box::new(move || {
12075 let function = function.clone();
12076 Box::pin(async move { function.into_id().await.unwrap().quote() })
12077 }),
12078 );
12079 TypeDef {
12080 proc: self.proc.clone(),
12081 selection: query,
12082 graphql_client: self.graphql_client.clone(),
12083 }
12084 }
12085 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
12091 let mut query = self.selection.select("withInterface");
12092 query = query.arg("name", name.into());
12093 TypeDef {
12094 proc: self.proc.clone(),
12095 selection: query,
12096 graphql_client: self.graphql_client.clone(),
12097 }
12098 }
12099 pub fn with_interface_opts<'a>(
12105 &self,
12106 name: impl Into<String>,
12107 opts: TypeDefWithInterfaceOpts<'a>,
12108 ) -> TypeDef {
12109 let mut query = self.selection.select("withInterface");
12110 query = query.arg("name", name.into());
12111 if let Some(description) = opts.description {
12112 query = query.arg("description", description);
12113 }
12114 if let Some(source_map) = opts.source_map {
12115 query = query.arg("sourceMap", source_map);
12116 }
12117 TypeDef {
12118 proc: self.proc.clone(),
12119 selection: query,
12120 graphql_client: self.graphql_client.clone(),
12121 }
12122 }
12123 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
12125 let mut query = self.selection.select("withKind");
12126 query = query.arg("kind", kind);
12127 TypeDef {
12128 proc: self.proc.clone(),
12129 selection: query,
12130 graphql_client: self.graphql_client.clone(),
12131 }
12132 }
12133 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
12135 let mut query = self.selection.select("withListOf");
12136 query = query.arg_lazy(
12137 "elementType",
12138 Box::new(move || {
12139 let element_type = element_type.clone();
12140 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
12141 }),
12142 );
12143 TypeDef {
12144 proc: self.proc.clone(),
12145 selection: query,
12146 graphql_client: self.graphql_client.clone(),
12147 }
12148 }
12149 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
12156 let mut query = self.selection.select("withObject");
12157 query = query.arg("name", name.into());
12158 TypeDef {
12159 proc: self.proc.clone(),
12160 selection: query,
12161 graphql_client: self.graphql_client.clone(),
12162 }
12163 }
12164 pub fn with_object_opts<'a>(
12171 &self,
12172 name: impl Into<String>,
12173 opts: TypeDefWithObjectOpts<'a>,
12174 ) -> TypeDef {
12175 let mut query = self.selection.select("withObject");
12176 query = query.arg("name", name.into());
12177 if let Some(description) = opts.description {
12178 query = query.arg("description", description);
12179 }
12180 if let Some(source_map) = opts.source_map {
12181 query = query.arg("sourceMap", source_map);
12182 }
12183 TypeDef {
12184 proc: self.proc.clone(),
12185 selection: query,
12186 graphql_client: self.graphql_client.clone(),
12187 }
12188 }
12189 pub fn with_optional(&self, optional: bool) -> TypeDef {
12191 let mut query = self.selection.select("withOptional");
12192 query = query.arg("optional", optional);
12193 TypeDef {
12194 proc: self.proc.clone(),
12195 selection: query,
12196 graphql_client: self.graphql_client.clone(),
12197 }
12198 }
12199 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
12205 let mut query = self.selection.select("withScalar");
12206 query = query.arg("name", name.into());
12207 TypeDef {
12208 proc: self.proc.clone(),
12209 selection: query,
12210 graphql_client: self.graphql_client.clone(),
12211 }
12212 }
12213 pub fn with_scalar_opts<'a>(
12219 &self,
12220 name: impl Into<String>,
12221 opts: TypeDefWithScalarOpts<'a>,
12222 ) -> TypeDef {
12223 let mut query = self.selection.select("withScalar");
12224 query = query.arg("name", name.into());
12225 if let Some(description) = opts.description {
12226 query = query.arg("description", description);
12227 }
12228 TypeDef {
12229 proc: self.proc.clone(),
12230 selection: query,
12231 graphql_client: self.graphql_client.clone(),
12232 }
12233 }
12234}
12235#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12236pub enum CacheSharingMode {
12237 #[serde(rename = "LOCKED")]
12238 Locked,
12239 #[serde(rename = "PRIVATE")]
12240 Private,
12241 #[serde(rename = "SHARED")]
12242 Shared,
12243}
12244#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12245pub enum ExistsType {
12246 #[serde(rename = "DIRECTORY_TYPE")]
12247 DirectoryType,
12248 #[serde(rename = "REGULAR_TYPE")]
12249 RegularType,
12250 #[serde(rename = "SYMLINK_TYPE")]
12251 SymlinkType,
12252}
12253#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12254pub enum ImageLayerCompression {
12255 #[serde(rename = "EStarGZ")]
12256 EStarGz,
12257 #[serde(rename = "ESTARGZ")]
12258 Estargz,
12259 #[serde(rename = "Gzip")]
12260 Gzip,
12261 #[serde(rename = "Uncompressed")]
12262 Uncompressed,
12263 #[serde(rename = "Zstd")]
12264 Zstd,
12265}
12266#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12267pub enum ImageMediaTypes {
12268 #[serde(rename = "DOCKER")]
12269 Docker,
12270 #[serde(rename = "DockerMediaTypes")]
12271 DockerMediaTypes,
12272 #[serde(rename = "OCI")]
12273 Oci,
12274 #[serde(rename = "OCIMediaTypes")]
12275 OciMediaTypes,
12276}
12277#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12278pub enum ModuleSourceKind {
12279 #[serde(rename = "DIR")]
12280 Dir,
12281 #[serde(rename = "DIR_SOURCE")]
12282 DirSource,
12283 #[serde(rename = "GIT")]
12284 Git,
12285 #[serde(rename = "GIT_SOURCE")]
12286 GitSource,
12287 #[serde(rename = "LOCAL")]
12288 Local,
12289 #[serde(rename = "LOCAL_SOURCE")]
12290 LocalSource,
12291}
12292#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12293pub enum NetworkProtocol {
12294 #[serde(rename = "TCP")]
12295 Tcp,
12296 #[serde(rename = "UDP")]
12297 Udp,
12298}
12299#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12300pub enum ReturnType {
12301 #[serde(rename = "ANY")]
12302 Any,
12303 #[serde(rename = "FAILURE")]
12304 Failure,
12305 #[serde(rename = "SUCCESS")]
12306 Success,
12307}
12308#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12309pub enum TypeDefKind {
12310 #[serde(rename = "BOOLEAN")]
12311 Boolean,
12312 #[serde(rename = "BOOLEAN_KIND")]
12313 BooleanKind,
12314 #[serde(rename = "ENUM")]
12315 Enum,
12316 #[serde(rename = "ENUM_KIND")]
12317 EnumKind,
12318 #[serde(rename = "FLOAT")]
12319 Float,
12320 #[serde(rename = "FLOAT_KIND")]
12321 FloatKind,
12322 #[serde(rename = "INPUT")]
12323 Input,
12324 #[serde(rename = "INPUT_KIND")]
12325 InputKind,
12326 #[serde(rename = "INTEGER")]
12327 Integer,
12328 #[serde(rename = "INTEGER_KIND")]
12329 IntegerKind,
12330 #[serde(rename = "INTERFACE")]
12331 Interface,
12332 #[serde(rename = "INTERFACE_KIND")]
12333 InterfaceKind,
12334 #[serde(rename = "LIST")]
12335 List,
12336 #[serde(rename = "LIST_KIND")]
12337 ListKind,
12338 #[serde(rename = "OBJECT")]
12339 Object,
12340 #[serde(rename = "OBJECT_KIND")]
12341 ObjectKind,
12342 #[serde(rename = "SCALAR")]
12343 Scalar,
12344 #[serde(rename = "SCALAR_KIND")]
12345 ScalarKind,
12346 #[serde(rename = "STRING")]
12347 String,
12348 #[serde(rename = "STRING_KIND")]
12349 StringKind,
12350 #[serde(rename = "VOID")]
12351 Void,
12352 #[serde(rename = "VOID_KIND")]
12353 VoidKind,
12354}