1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct AddressId(pub String);
14impl From<&str> for AddressId {
15 fn from(value: &str) -> Self {
16 Self(value.to_string())
17 }
18}
19impl From<String> for AddressId {
20 fn from(value: String) -> Self {
21 Self(value)
22 }
23}
24impl IntoID<AddressId> for Address {
25 fn into_id(
26 self,
27 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
28 {
29 Box::pin(async move { self.id().await })
30 }
31}
32impl IntoID<AddressId> for AddressId {
33 fn into_id(
34 self,
35 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
36 {
37 Box::pin(async move { Ok::<AddressId, DaggerError>(self) })
38 }
39}
40impl AddressId {
41 fn quote(&self) -> String {
42 format!("\"{}\"", self.0.clone())
43 }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct BindingId(pub String);
47impl From<&str> for BindingId {
48 fn from(value: &str) -> Self {
49 Self(value.to_string())
50 }
51}
52impl From<String> for BindingId {
53 fn from(value: String) -> Self {
54 Self(value)
55 }
56}
57impl IntoID<BindingId> for Binding {
58 fn into_id(
59 self,
60 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
61 {
62 Box::pin(async move { self.id().await })
63 }
64}
65impl IntoID<BindingId> for BindingId {
66 fn into_id(
67 self,
68 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
69 {
70 Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
71 }
72}
73impl BindingId {
74 fn quote(&self) -> String {
75 format!("\"{}\"", self.0.clone())
76 }
77}
78#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
79pub struct CacheVolumeId(pub String);
80impl From<&str> for CacheVolumeId {
81 fn from(value: &str) -> Self {
82 Self(value.to_string())
83 }
84}
85impl From<String> for CacheVolumeId {
86 fn from(value: String) -> Self {
87 Self(value)
88 }
89}
90impl IntoID<CacheVolumeId> for CacheVolume {
91 fn into_id(
92 self,
93 ) -> std::pin::Pin<
94 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
95 > {
96 Box::pin(async move { self.id().await })
97 }
98}
99impl IntoID<CacheVolumeId> for CacheVolumeId {
100 fn into_id(
101 self,
102 ) -> std::pin::Pin<
103 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
104 > {
105 Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
106 }
107}
108impl CacheVolumeId {
109 fn quote(&self) -> String {
110 format!("\"{}\"", self.0.clone())
111 }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ChangesetId(pub String);
115impl From<&str> for ChangesetId {
116 fn from(value: &str) -> Self {
117 Self(value.to_string())
118 }
119}
120impl From<String> for ChangesetId {
121 fn from(value: String) -> Self {
122 Self(value)
123 }
124}
125impl IntoID<ChangesetId> for Changeset {
126 fn into_id(
127 self,
128 ) -> std::pin::Pin<
129 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
130 > {
131 Box::pin(async move { self.id().await })
132 }
133}
134impl IntoID<ChangesetId> for ChangesetId {
135 fn into_id(
136 self,
137 ) -> std::pin::Pin<
138 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
139 > {
140 Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
141 }
142}
143impl ChangesetId {
144 fn quote(&self) -> String {
145 format!("\"{}\"", self.0.clone())
146 }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CheckGroupId(pub String);
150impl From<&str> for CheckGroupId {
151 fn from(value: &str) -> Self {
152 Self(value.to_string())
153 }
154}
155impl From<String> for CheckGroupId {
156 fn from(value: String) -> Self {
157 Self(value)
158 }
159}
160impl IntoID<CheckGroupId> for CheckGroup {
161 fn into_id(
162 self,
163 ) -> std::pin::Pin<
164 Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
165 > {
166 Box::pin(async move { self.id().await })
167 }
168}
169impl IntoID<CheckGroupId> for CheckGroupId {
170 fn into_id(
171 self,
172 ) -> std::pin::Pin<
173 Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
174 > {
175 Box::pin(async move { Ok::<CheckGroupId, DaggerError>(self) })
176 }
177}
178impl CheckGroupId {
179 fn quote(&self) -> String {
180 format!("\"{}\"", self.0.clone())
181 }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct CheckId(pub String);
185impl From<&str> for CheckId {
186 fn from(value: &str) -> Self {
187 Self(value.to_string())
188 }
189}
190impl From<String> for CheckId {
191 fn from(value: String) -> Self {
192 Self(value)
193 }
194}
195impl IntoID<CheckId> for Check {
196 fn into_id(
197 self,
198 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
199 {
200 Box::pin(async move { self.id().await })
201 }
202}
203impl IntoID<CheckId> for CheckId {
204 fn into_id(
205 self,
206 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
207 {
208 Box::pin(async move { Ok::<CheckId, DaggerError>(self) })
209 }
210}
211impl CheckId {
212 fn quote(&self) -> String {
213 format!("\"{}\"", self.0.clone())
214 }
215}
216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
217pub struct ClientFilesyncMirrorId(pub String);
218impl From<&str> for ClientFilesyncMirrorId {
219 fn from(value: &str) -> Self {
220 Self(value.to_string())
221 }
222}
223impl From<String> for ClientFilesyncMirrorId {
224 fn from(value: String) -> Self {
225 Self(value)
226 }
227}
228impl IntoID<ClientFilesyncMirrorId> for ClientFilesyncMirror {
229 fn into_id(
230 self,
231 ) -> std::pin::Pin<
232 Box<dyn core::future::Future<Output = Result<ClientFilesyncMirrorId, DaggerError>> + Send>,
233 > {
234 Box::pin(async move { self.id().await })
235 }
236}
237impl IntoID<ClientFilesyncMirrorId> for ClientFilesyncMirrorId {
238 fn into_id(
239 self,
240 ) -> std::pin::Pin<
241 Box<dyn core::future::Future<Output = Result<ClientFilesyncMirrorId, DaggerError>> + Send>,
242 > {
243 Box::pin(async move { Ok::<ClientFilesyncMirrorId, DaggerError>(self) })
244 }
245}
246impl ClientFilesyncMirrorId {
247 fn quote(&self) -> String {
248 format!("\"{}\"", self.0.clone())
249 }
250}
251#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
252pub struct CloudId(pub String);
253impl From<&str> for CloudId {
254 fn from(value: &str) -> Self {
255 Self(value.to_string())
256 }
257}
258impl From<String> for CloudId {
259 fn from(value: String) -> Self {
260 Self(value)
261 }
262}
263impl IntoID<CloudId> for Cloud {
264 fn into_id(
265 self,
266 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
267 {
268 Box::pin(async move { self.id().await })
269 }
270}
271impl IntoID<CloudId> for CloudId {
272 fn into_id(
273 self,
274 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
275 {
276 Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
277 }
278}
279impl CloudId {
280 fn quote(&self) -> String {
281 format!("\"{}\"", self.0.clone())
282 }
283}
284#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
285pub struct ContainerId(pub String);
286impl From<&str> for ContainerId {
287 fn from(value: &str) -> Self {
288 Self(value.to_string())
289 }
290}
291impl From<String> for ContainerId {
292 fn from(value: String) -> Self {
293 Self(value)
294 }
295}
296impl IntoID<ContainerId> for Container {
297 fn into_id(
298 self,
299 ) -> std::pin::Pin<
300 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
301 > {
302 Box::pin(async move { self.id().await })
303 }
304}
305impl IntoID<ContainerId> for ContainerId {
306 fn into_id(
307 self,
308 ) -> std::pin::Pin<
309 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
310 > {
311 Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
312 }
313}
314impl ContainerId {
315 fn quote(&self) -> String {
316 format!("\"{}\"", self.0.clone())
317 }
318}
319#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
320pub struct CurrentModuleId(pub String);
321impl From<&str> for CurrentModuleId {
322 fn from(value: &str) -> Self {
323 Self(value.to_string())
324 }
325}
326impl From<String> for CurrentModuleId {
327 fn from(value: String) -> Self {
328 Self(value)
329 }
330}
331impl IntoID<CurrentModuleId> for CurrentModule {
332 fn into_id(
333 self,
334 ) -> std::pin::Pin<
335 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
336 > {
337 Box::pin(async move { self.id().await })
338 }
339}
340impl IntoID<CurrentModuleId> for CurrentModuleId {
341 fn into_id(
342 self,
343 ) -> std::pin::Pin<
344 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
345 > {
346 Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
347 }
348}
349impl CurrentModuleId {
350 fn quote(&self) -> String {
351 format!("\"{}\"", self.0.clone())
352 }
353}
354#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
355pub struct DiffStatId(pub String);
356impl From<&str> for DiffStatId {
357 fn from(value: &str) -> Self {
358 Self(value.to_string())
359 }
360}
361impl From<String> for DiffStatId {
362 fn from(value: String) -> Self {
363 Self(value)
364 }
365}
366impl IntoID<DiffStatId> for DiffStat {
367 fn into_id(
368 self,
369 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
370 {
371 Box::pin(async move { self.id().await })
372 }
373}
374impl IntoID<DiffStatId> for DiffStatId {
375 fn into_id(
376 self,
377 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
378 {
379 Box::pin(async move { Ok::<DiffStatId, DaggerError>(self) })
380 }
381}
382impl DiffStatId {
383 fn quote(&self) -> String {
384 format!("\"{}\"", self.0.clone())
385 }
386}
387#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
388pub struct DirectoryId(pub String);
389impl From<&str> for DirectoryId {
390 fn from(value: &str) -> Self {
391 Self(value.to_string())
392 }
393}
394impl From<String> for DirectoryId {
395 fn from(value: String) -> Self {
396 Self(value)
397 }
398}
399impl IntoID<DirectoryId> for Directory {
400 fn into_id(
401 self,
402 ) -> std::pin::Pin<
403 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
404 > {
405 Box::pin(async move { self.id().await })
406 }
407}
408impl IntoID<DirectoryId> for DirectoryId {
409 fn into_id(
410 self,
411 ) -> std::pin::Pin<
412 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
413 > {
414 Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
415 }
416}
417impl DirectoryId {
418 fn quote(&self) -> String {
419 format!("\"{}\"", self.0.clone())
420 }
421}
422#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
423pub struct EngineCacheEntryId(pub String);
424impl From<&str> for EngineCacheEntryId {
425 fn from(value: &str) -> Self {
426 Self(value.to_string())
427 }
428}
429impl From<String> for EngineCacheEntryId {
430 fn from(value: String) -> Self {
431 Self(value)
432 }
433}
434impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
435 fn into_id(
436 self,
437 ) -> std::pin::Pin<
438 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
439 > {
440 Box::pin(async move { self.id().await })
441 }
442}
443impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
444 fn into_id(
445 self,
446 ) -> std::pin::Pin<
447 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
448 > {
449 Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
450 }
451}
452impl EngineCacheEntryId {
453 fn quote(&self) -> String {
454 format!("\"{}\"", self.0.clone())
455 }
456}
457#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
458pub struct EngineCacheEntrySetId(pub String);
459impl From<&str> for EngineCacheEntrySetId {
460 fn from(value: &str) -> Self {
461 Self(value.to_string())
462 }
463}
464impl From<String> for EngineCacheEntrySetId {
465 fn from(value: String) -> Self {
466 Self(value)
467 }
468}
469impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
470 fn into_id(
471 self,
472 ) -> std::pin::Pin<
473 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
474 > {
475 Box::pin(async move { self.id().await })
476 }
477}
478impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
479 fn into_id(
480 self,
481 ) -> std::pin::Pin<
482 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
483 > {
484 Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
485 }
486}
487impl EngineCacheEntrySetId {
488 fn quote(&self) -> String {
489 format!("\"{}\"", self.0.clone())
490 }
491}
492#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
493pub struct EngineCacheId(pub String);
494impl From<&str> for EngineCacheId {
495 fn from(value: &str) -> Self {
496 Self(value.to_string())
497 }
498}
499impl From<String> for EngineCacheId {
500 fn from(value: String) -> Self {
501 Self(value)
502 }
503}
504impl IntoID<EngineCacheId> for EngineCache {
505 fn into_id(
506 self,
507 ) -> std::pin::Pin<
508 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
509 > {
510 Box::pin(async move { self.id().await })
511 }
512}
513impl IntoID<EngineCacheId> for EngineCacheId {
514 fn into_id(
515 self,
516 ) -> std::pin::Pin<
517 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
518 > {
519 Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
520 }
521}
522impl EngineCacheId {
523 fn quote(&self) -> String {
524 format!("\"{}\"", self.0.clone())
525 }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EngineId(pub String);
529impl From<&str> for EngineId {
530 fn from(value: &str) -> Self {
531 Self(value.to_string())
532 }
533}
534impl From<String> for EngineId {
535 fn from(value: String) -> Self {
536 Self(value)
537 }
538}
539impl IntoID<EngineId> for Engine {
540 fn into_id(
541 self,
542 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
543 {
544 Box::pin(async move { self.id().await })
545 }
546}
547impl IntoID<EngineId> for EngineId {
548 fn into_id(
549 self,
550 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
551 {
552 Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
553 }
554}
555impl EngineId {
556 fn quote(&self) -> String {
557 format!("\"{}\"", self.0.clone())
558 }
559}
560#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
561pub struct EnumTypeDefId(pub String);
562impl From<&str> for EnumTypeDefId {
563 fn from(value: &str) -> Self {
564 Self(value.to_string())
565 }
566}
567impl From<String> for EnumTypeDefId {
568 fn from(value: String) -> Self {
569 Self(value)
570 }
571}
572impl IntoID<EnumTypeDefId> for EnumTypeDef {
573 fn into_id(
574 self,
575 ) -> std::pin::Pin<
576 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
577 > {
578 Box::pin(async move { self.id().await })
579 }
580}
581impl IntoID<EnumTypeDefId> for EnumTypeDefId {
582 fn into_id(
583 self,
584 ) -> std::pin::Pin<
585 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
586 > {
587 Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
588 }
589}
590impl EnumTypeDefId {
591 fn quote(&self) -> String {
592 format!("\"{}\"", self.0.clone())
593 }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct EnumValueTypeDefId(pub String);
597impl From<&str> for EnumValueTypeDefId {
598 fn from(value: &str) -> Self {
599 Self(value.to_string())
600 }
601}
602impl From<String> for EnumValueTypeDefId {
603 fn from(value: String) -> Self {
604 Self(value)
605 }
606}
607impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
608 fn into_id(
609 self,
610 ) -> std::pin::Pin<
611 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
612 > {
613 Box::pin(async move { self.id().await })
614 }
615}
616impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
617 fn into_id(
618 self,
619 ) -> std::pin::Pin<
620 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
621 > {
622 Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
623 }
624}
625impl EnumValueTypeDefId {
626 fn quote(&self) -> String {
627 format!("\"{}\"", self.0.clone())
628 }
629}
630#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
631pub struct EnvFileId(pub String);
632impl From<&str> for EnvFileId {
633 fn from(value: &str) -> Self {
634 Self(value.to_string())
635 }
636}
637impl From<String> for EnvFileId {
638 fn from(value: String) -> Self {
639 Self(value)
640 }
641}
642impl IntoID<EnvFileId> for EnvFile {
643 fn into_id(
644 self,
645 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
646 {
647 Box::pin(async move { self.id().await })
648 }
649}
650impl IntoID<EnvFileId> for EnvFileId {
651 fn into_id(
652 self,
653 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
654 {
655 Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
656 }
657}
658impl EnvFileId {
659 fn quote(&self) -> String {
660 format!("\"{}\"", self.0.clone())
661 }
662}
663#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
664pub struct EnvId(pub String);
665impl From<&str> for EnvId {
666 fn from(value: &str) -> Self {
667 Self(value.to_string())
668 }
669}
670impl From<String> for EnvId {
671 fn from(value: String) -> Self {
672 Self(value)
673 }
674}
675impl IntoID<EnvId> for Env {
676 fn into_id(
677 self,
678 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
679 {
680 Box::pin(async move { self.id().await })
681 }
682}
683impl IntoID<EnvId> for EnvId {
684 fn into_id(
685 self,
686 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
687 {
688 Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
689 }
690}
691impl EnvId {
692 fn quote(&self) -> String {
693 format!("\"{}\"", self.0.clone())
694 }
695}
696#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
697pub struct EnvVariableId(pub String);
698impl From<&str> for EnvVariableId {
699 fn from(value: &str) -> Self {
700 Self(value.to_string())
701 }
702}
703impl From<String> for EnvVariableId {
704 fn from(value: String) -> Self {
705 Self(value)
706 }
707}
708impl IntoID<EnvVariableId> for EnvVariable {
709 fn into_id(
710 self,
711 ) -> std::pin::Pin<
712 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
713 > {
714 Box::pin(async move { self.id().await })
715 }
716}
717impl IntoID<EnvVariableId> for EnvVariableId {
718 fn into_id(
719 self,
720 ) -> std::pin::Pin<
721 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
722 > {
723 Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
724 }
725}
726impl EnvVariableId {
727 fn quote(&self) -> String {
728 format!("\"{}\"", self.0.clone())
729 }
730}
731#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
732pub struct ErrorId(pub String);
733impl From<&str> for ErrorId {
734 fn from(value: &str) -> Self {
735 Self(value.to_string())
736 }
737}
738impl From<String> for ErrorId {
739 fn from(value: String) -> Self {
740 Self(value)
741 }
742}
743impl IntoID<ErrorId> for Error {
744 fn into_id(
745 self,
746 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
747 {
748 Box::pin(async move { self.id().await })
749 }
750}
751impl IntoID<ErrorId> for ErrorId {
752 fn into_id(
753 self,
754 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
755 {
756 Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
757 }
758}
759impl ErrorId {
760 fn quote(&self) -> String {
761 format!("\"{}\"", self.0.clone())
762 }
763}
764#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
765pub struct ErrorValueId(pub String);
766impl From<&str> for ErrorValueId {
767 fn from(value: &str) -> Self {
768 Self(value.to_string())
769 }
770}
771impl From<String> for ErrorValueId {
772 fn from(value: String) -> Self {
773 Self(value)
774 }
775}
776impl IntoID<ErrorValueId> for ErrorValue {
777 fn into_id(
778 self,
779 ) -> std::pin::Pin<
780 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
781 > {
782 Box::pin(async move { self.id().await })
783 }
784}
785impl IntoID<ErrorValueId> for ErrorValueId {
786 fn into_id(
787 self,
788 ) -> std::pin::Pin<
789 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
790 > {
791 Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
792 }
793}
794impl ErrorValueId {
795 fn quote(&self) -> String {
796 format!("\"{}\"", self.0.clone())
797 }
798}
799#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
800pub struct FieldTypeDefId(pub String);
801impl From<&str> for FieldTypeDefId {
802 fn from(value: &str) -> Self {
803 Self(value.to_string())
804 }
805}
806impl From<String> for FieldTypeDefId {
807 fn from(value: String) -> Self {
808 Self(value)
809 }
810}
811impl IntoID<FieldTypeDefId> for FieldTypeDef {
812 fn into_id(
813 self,
814 ) -> std::pin::Pin<
815 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
816 > {
817 Box::pin(async move { self.id().await })
818 }
819}
820impl IntoID<FieldTypeDefId> for FieldTypeDefId {
821 fn into_id(
822 self,
823 ) -> std::pin::Pin<
824 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
825 > {
826 Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
827 }
828}
829impl FieldTypeDefId {
830 fn quote(&self) -> String {
831 format!("\"{}\"", self.0.clone())
832 }
833}
834#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
835pub struct FileId(pub String);
836impl From<&str> for FileId {
837 fn from(value: &str) -> Self {
838 Self(value.to_string())
839 }
840}
841impl From<String> for FileId {
842 fn from(value: String) -> Self {
843 Self(value)
844 }
845}
846impl IntoID<FileId> for File {
847 fn into_id(
848 self,
849 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
850 {
851 Box::pin(async move { self.id().await })
852 }
853}
854impl IntoID<FileId> for FileId {
855 fn into_id(
856 self,
857 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
858 {
859 Box::pin(async move { Ok::<FileId, DaggerError>(self) })
860 }
861}
862impl FileId {
863 fn quote(&self) -> String {
864 format!("\"{}\"", self.0.clone())
865 }
866}
867#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
868pub struct FunctionArgId(pub String);
869impl From<&str> for FunctionArgId {
870 fn from(value: &str) -> Self {
871 Self(value.to_string())
872 }
873}
874impl From<String> for FunctionArgId {
875 fn from(value: String) -> Self {
876 Self(value)
877 }
878}
879impl IntoID<FunctionArgId> for FunctionArg {
880 fn into_id(
881 self,
882 ) -> std::pin::Pin<
883 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
884 > {
885 Box::pin(async move { self.id().await })
886 }
887}
888impl IntoID<FunctionArgId> for FunctionArgId {
889 fn into_id(
890 self,
891 ) -> std::pin::Pin<
892 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
893 > {
894 Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
895 }
896}
897impl FunctionArgId {
898 fn quote(&self) -> String {
899 format!("\"{}\"", self.0.clone())
900 }
901}
902#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
903pub struct FunctionCallArgValueId(pub String);
904impl From<&str> for FunctionCallArgValueId {
905 fn from(value: &str) -> Self {
906 Self(value.to_string())
907 }
908}
909impl From<String> for FunctionCallArgValueId {
910 fn from(value: String) -> Self {
911 Self(value)
912 }
913}
914impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
915 fn into_id(
916 self,
917 ) -> std::pin::Pin<
918 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
919 > {
920 Box::pin(async move { self.id().await })
921 }
922}
923impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
924 fn into_id(
925 self,
926 ) -> std::pin::Pin<
927 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
928 > {
929 Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
930 }
931}
932impl FunctionCallArgValueId {
933 fn quote(&self) -> String {
934 format!("\"{}\"", self.0.clone())
935 }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct FunctionCallId(pub String);
939impl From<&str> for FunctionCallId {
940 fn from(value: &str) -> Self {
941 Self(value.to_string())
942 }
943}
944impl From<String> for FunctionCallId {
945 fn from(value: String) -> Self {
946 Self(value)
947 }
948}
949impl IntoID<FunctionCallId> for FunctionCall {
950 fn into_id(
951 self,
952 ) -> std::pin::Pin<
953 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
954 > {
955 Box::pin(async move { self.id().await })
956 }
957}
958impl IntoID<FunctionCallId> for FunctionCallId {
959 fn into_id(
960 self,
961 ) -> std::pin::Pin<
962 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
963 > {
964 Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
965 }
966}
967impl FunctionCallId {
968 fn quote(&self) -> String {
969 format!("\"{}\"", self.0.clone())
970 }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct FunctionId(pub String);
974impl From<&str> for FunctionId {
975 fn from(value: &str) -> Self {
976 Self(value.to_string())
977 }
978}
979impl From<String> for FunctionId {
980 fn from(value: String) -> Self {
981 Self(value)
982 }
983}
984impl IntoID<FunctionId> for Function {
985 fn into_id(
986 self,
987 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
988 {
989 Box::pin(async move { self.id().await })
990 }
991}
992impl IntoID<FunctionId> for FunctionId {
993 fn into_id(
994 self,
995 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
996 {
997 Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
998 }
999}
1000impl FunctionId {
1001 fn quote(&self) -> String {
1002 format!("\"{}\"", self.0.clone())
1003 }
1004}
1005#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1006pub struct GeneratedCodeId(pub String);
1007impl From<&str> for GeneratedCodeId {
1008 fn from(value: &str) -> Self {
1009 Self(value.to_string())
1010 }
1011}
1012impl From<String> for GeneratedCodeId {
1013 fn from(value: String) -> Self {
1014 Self(value)
1015 }
1016}
1017impl IntoID<GeneratedCodeId> for GeneratedCode {
1018 fn into_id(
1019 self,
1020 ) -> std::pin::Pin<
1021 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
1022 > {
1023 Box::pin(async move { self.id().await })
1024 }
1025}
1026impl IntoID<GeneratedCodeId> for GeneratedCodeId {
1027 fn into_id(
1028 self,
1029 ) -> std::pin::Pin<
1030 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
1031 > {
1032 Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
1033 }
1034}
1035impl GeneratedCodeId {
1036 fn quote(&self) -> String {
1037 format!("\"{}\"", self.0.clone())
1038 }
1039}
1040#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1041pub struct GeneratorGroupId(pub String);
1042impl From<&str> for GeneratorGroupId {
1043 fn from(value: &str) -> Self {
1044 Self(value.to_string())
1045 }
1046}
1047impl From<String> for GeneratorGroupId {
1048 fn from(value: String) -> Self {
1049 Self(value)
1050 }
1051}
1052impl IntoID<GeneratorGroupId> for GeneratorGroup {
1053 fn into_id(
1054 self,
1055 ) -> std::pin::Pin<
1056 Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
1057 > {
1058 Box::pin(async move { self.id().await })
1059 }
1060}
1061impl IntoID<GeneratorGroupId> for GeneratorGroupId {
1062 fn into_id(
1063 self,
1064 ) -> std::pin::Pin<
1065 Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
1066 > {
1067 Box::pin(async move { Ok::<GeneratorGroupId, DaggerError>(self) })
1068 }
1069}
1070impl GeneratorGroupId {
1071 fn quote(&self) -> String {
1072 format!("\"{}\"", self.0.clone())
1073 }
1074}
1075#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1076pub struct GeneratorId(pub String);
1077impl From<&str> for GeneratorId {
1078 fn from(value: &str) -> Self {
1079 Self(value.to_string())
1080 }
1081}
1082impl From<String> for GeneratorId {
1083 fn from(value: String) -> Self {
1084 Self(value)
1085 }
1086}
1087impl IntoID<GeneratorId> for Generator {
1088 fn into_id(
1089 self,
1090 ) -> std::pin::Pin<
1091 Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1092 > {
1093 Box::pin(async move { self.id().await })
1094 }
1095}
1096impl IntoID<GeneratorId> for GeneratorId {
1097 fn into_id(
1098 self,
1099 ) -> std::pin::Pin<
1100 Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1101 > {
1102 Box::pin(async move { Ok::<GeneratorId, DaggerError>(self) })
1103 }
1104}
1105impl GeneratorId {
1106 fn quote(&self) -> String {
1107 format!("\"{}\"", self.0.clone())
1108 }
1109}
1110#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1111pub struct GitRefId(pub String);
1112impl From<&str> for GitRefId {
1113 fn from(value: &str) -> Self {
1114 Self(value.to_string())
1115 }
1116}
1117impl From<String> for GitRefId {
1118 fn from(value: String) -> Self {
1119 Self(value)
1120 }
1121}
1122impl IntoID<GitRefId> for GitRef {
1123 fn into_id(
1124 self,
1125 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1126 {
1127 Box::pin(async move { self.id().await })
1128 }
1129}
1130impl IntoID<GitRefId> for GitRefId {
1131 fn into_id(
1132 self,
1133 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1134 {
1135 Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
1136 }
1137}
1138impl GitRefId {
1139 fn quote(&self) -> String {
1140 format!("\"{}\"", self.0.clone())
1141 }
1142}
1143#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1144pub struct GitRepositoryId(pub String);
1145impl From<&str> for GitRepositoryId {
1146 fn from(value: &str) -> Self {
1147 Self(value.to_string())
1148 }
1149}
1150impl From<String> for GitRepositoryId {
1151 fn from(value: String) -> Self {
1152 Self(value)
1153 }
1154}
1155impl IntoID<GitRepositoryId> for GitRepository {
1156 fn into_id(
1157 self,
1158 ) -> std::pin::Pin<
1159 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1160 > {
1161 Box::pin(async move { self.id().await })
1162 }
1163}
1164impl IntoID<GitRepositoryId> for GitRepositoryId {
1165 fn into_id(
1166 self,
1167 ) -> std::pin::Pin<
1168 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1169 > {
1170 Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
1171 }
1172}
1173impl GitRepositoryId {
1174 fn quote(&self) -> String {
1175 format!("\"{}\"", self.0.clone())
1176 }
1177}
1178#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1179pub struct HttpStateId(pub String);
1180impl From<&str> for HttpStateId {
1181 fn from(value: &str) -> Self {
1182 Self(value.to_string())
1183 }
1184}
1185impl From<String> for HttpStateId {
1186 fn from(value: String) -> Self {
1187 Self(value)
1188 }
1189}
1190impl IntoID<HttpStateId> for HttpState {
1191 fn into_id(
1192 self,
1193 ) -> std::pin::Pin<
1194 Box<dyn core::future::Future<Output = Result<HttpStateId, DaggerError>> + Send>,
1195 > {
1196 Box::pin(async move { self.id().await })
1197 }
1198}
1199impl IntoID<HttpStateId> for HttpStateId {
1200 fn into_id(
1201 self,
1202 ) -> std::pin::Pin<
1203 Box<dyn core::future::Future<Output = Result<HttpStateId, DaggerError>> + Send>,
1204 > {
1205 Box::pin(async move { Ok::<HttpStateId, DaggerError>(self) })
1206 }
1207}
1208impl HttpStateId {
1209 fn quote(&self) -> String {
1210 format!("\"{}\"", self.0.clone())
1211 }
1212}
1213#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1214pub struct HealthcheckConfigId(pub String);
1215impl From<&str> for HealthcheckConfigId {
1216 fn from(value: &str) -> Self {
1217 Self(value.to_string())
1218 }
1219}
1220impl From<String> for HealthcheckConfigId {
1221 fn from(value: String) -> Self {
1222 Self(value)
1223 }
1224}
1225impl IntoID<HealthcheckConfigId> for HealthcheckConfig {
1226 fn into_id(
1227 self,
1228 ) -> std::pin::Pin<
1229 Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1230 > {
1231 Box::pin(async move { self.id().await })
1232 }
1233}
1234impl IntoID<HealthcheckConfigId> for HealthcheckConfigId {
1235 fn into_id(
1236 self,
1237 ) -> std::pin::Pin<
1238 Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1239 > {
1240 Box::pin(async move { Ok::<HealthcheckConfigId, DaggerError>(self) })
1241 }
1242}
1243impl HealthcheckConfigId {
1244 fn quote(&self) -> String {
1245 format!("\"{}\"", self.0.clone())
1246 }
1247}
1248#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1249pub struct HostId(pub String);
1250impl From<&str> for HostId {
1251 fn from(value: &str) -> Self {
1252 Self(value.to_string())
1253 }
1254}
1255impl From<String> for HostId {
1256 fn from(value: String) -> Self {
1257 Self(value)
1258 }
1259}
1260impl IntoID<HostId> for Host {
1261 fn into_id(
1262 self,
1263 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1264 {
1265 Box::pin(async move { self.id().await })
1266 }
1267}
1268impl IntoID<HostId> for HostId {
1269 fn into_id(
1270 self,
1271 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1272 {
1273 Box::pin(async move { Ok::<HostId, DaggerError>(self) })
1274 }
1275}
1276impl HostId {
1277 fn quote(&self) -> String {
1278 format!("\"{}\"", self.0.clone())
1279 }
1280}
1281#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1282pub struct InputTypeDefId(pub String);
1283impl From<&str> for InputTypeDefId {
1284 fn from(value: &str) -> Self {
1285 Self(value.to_string())
1286 }
1287}
1288impl From<String> for InputTypeDefId {
1289 fn from(value: String) -> Self {
1290 Self(value)
1291 }
1292}
1293impl IntoID<InputTypeDefId> for InputTypeDef {
1294 fn into_id(
1295 self,
1296 ) -> std::pin::Pin<
1297 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1298 > {
1299 Box::pin(async move { self.id().await })
1300 }
1301}
1302impl IntoID<InputTypeDefId> for InputTypeDefId {
1303 fn into_id(
1304 self,
1305 ) -> std::pin::Pin<
1306 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1307 > {
1308 Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1309 }
1310}
1311impl InputTypeDefId {
1312 fn quote(&self) -> String {
1313 format!("\"{}\"", self.0.clone())
1314 }
1315}
1316#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1317pub struct InterfaceTypeDefId(pub String);
1318impl From<&str> for InterfaceTypeDefId {
1319 fn from(value: &str) -> Self {
1320 Self(value.to_string())
1321 }
1322}
1323impl From<String> for InterfaceTypeDefId {
1324 fn from(value: String) -> Self {
1325 Self(value)
1326 }
1327}
1328impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1329 fn into_id(
1330 self,
1331 ) -> std::pin::Pin<
1332 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1333 > {
1334 Box::pin(async move { self.id().await })
1335 }
1336}
1337impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1338 fn into_id(
1339 self,
1340 ) -> std::pin::Pin<
1341 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1342 > {
1343 Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1344 }
1345}
1346impl InterfaceTypeDefId {
1347 fn quote(&self) -> String {
1348 format!("\"{}\"", self.0.clone())
1349 }
1350}
1351#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1352pub struct Json(pub String);
1353impl From<&str> for Json {
1354 fn from(value: &str) -> Self {
1355 Self(value.to_string())
1356 }
1357}
1358impl From<String> for Json {
1359 fn from(value: String) -> Self {
1360 Self(value)
1361 }
1362}
1363impl Json {
1364 fn quote(&self) -> String {
1365 format!("\"{}\"", self.0.clone())
1366 }
1367}
1368#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1369pub struct JsonValueId(pub String);
1370impl From<&str> for JsonValueId {
1371 fn from(value: &str) -> Self {
1372 Self(value.to_string())
1373 }
1374}
1375impl From<String> for JsonValueId {
1376 fn from(value: String) -> Self {
1377 Self(value)
1378 }
1379}
1380impl IntoID<JsonValueId> for JsonValue {
1381 fn into_id(
1382 self,
1383 ) -> std::pin::Pin<
1384 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1385 > {
1386 Box::pin(async move { self.id().await })
1387 }
1388}
1389impl IntoID<JsonValueId> for JsonValueId {
1390 fn into_id(
1391 self,
1392 ) -> std::pin::Pin<
1393 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1394 > {
1395 Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1396 }
1397}
1398impl JsonValueId {
1399 fn quote(&self) -> String {
1400 format!("\"{}\"", self.0.clone())
1401 }
1402}
1403#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1404pub struct Llmid(pub String);
1405impl From<&str> for Llmid {
1406 fn from(value: &str) -> Self {
1407 Self(value.to_string())
1408 }
1409}
1410impl From<String> for Llmid {
1411 fn from(value: String) -> Self {
1412 Self(value)
1413 }
1414}
1415impl IntoID<Llmid> for Llm {
1416 fn into_id(
1417 self,
1418 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1419 {
1420 Box::pin(async move { self.id().await })
1421 }
1422}
1423impl IntoID<Llmid> for Llmid {
1424 fn into_id(
1425 self,
1426 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1427 {
1428 Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1429 }
1430}
1431impl Llmid {
1432 fn quote(&self) -> String {
1433 format!("\"{}\"", self.0.clone())
1434 }
1435}
1436#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1437pub struct LlmTokenUsageId(pub String);
1438impl From<&str> for LlmTokenUsageId {
1439 fn from(value: &str) -> Self {
1440 Self(value.to_string())
1441 }
1442}
1443impl From<String> for LlmTokenUsageId {
1444 fn from(value: String) -> Self {
1445 Self(value)
1446 }
1447}
1448impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1449 fn into_id(
1450 self,
1451 ) -> std::pin::Pin<
1452 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1453 > {
1454 Box::pin(async move { self.id().await })
1455 }
1456}
1457impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1458 fn into_id(
1459 self,
1460 ) -> std::pin::Pin<
1461 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1462 > {
1463 Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1464 }
1465}
1466impl LlmTokenUsageId {
1467 fn quote(&self) -> String {
1468 format!("\"{}\"", self.0.clone())
1469 }
1470}
1471#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1472pub struct LabelId(pub String);
1473impl From<&str> for LabelId {
1474 fn from(value: &str) -> Self {
1475 Self(value.to_string())
1476 }
1477}
1478impl From<String> for LabelId {
1479 fn from(value: String) -> Self {
1480 Self(value)
1481 }
1482}
1483impl IntoID<LabelId> for Label {
1484 fn into_id(
1485 self,
1486 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1487 {
1488 Box::pin(async move { self.id().await })
1489 }
1490}
1491impl IntoID<LabelId> for LabelId {
1492 fn into_id(
1493 self,
1494 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1495 {
1496 Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1497 }
1498}
1499impl LabelId {
1500 fn quote(&self) -> String {
1501 format!("\"{}\"", self.0.clone())
1502 }
1503}
1504#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1505pub struct ListTypeDefId(pub String);
1506impl From<&str> for ListTypeDefId {
1507 fn from(value: &str) -> Self {
1508 Self(value.to_string())
1509 }
1510}
1511impl From<String> for ListTypeDefId {
1512 fn from(value: String) -> Self {
1513 Self(value)
1514 }
1515}
1516impl IntoID<ListTypeDefId> for ListTypeDef {
1517 fn into_id(
1518 self,
1519 ) -> std::pin::Pin<
1520 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1521 > {
1522 Box::pin(async move { self.id().await })
1523 }
1524}
1525impl IntoID<ListTypeDefId> for ListTypeDefId {
1526 fn into_id(
1527 self,
1528 ) -> std::pin::Pin<
1529 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1530 > {
1531 Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1532 }
1533}
1534impl ListTypeDefId {
1535 fn quote(&self) -> String {
1536 format!("\"{}\"", self.0.clone())
1537 }
1538}
1539#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1540pub struct ModuleConfigClientId(pub String);
1541impl From<&str> for ModuleConfigClientId {
1542 fn from(value: &str) -> Self {
1543 Self(value.to_string())
1544 }
1545}
1546impl From<String> for ModuleConfigClientId {
1547 fn from(value: String) -> Self {
1548 Self(value)
1549 }
1550}
1551impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1552 fn into_id(
1553 self,
1554 ) -> std::pin::Pin<
1555 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1556 > {
1557 Box::pin(async move { self.id().await })
1558 }
1559}
1560impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1561 fn into_id(
1562 self,
1563 ) -> std::pin::Pin<
1564 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1565 > {
1566 Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1567 }
1568}
1569impl ModuleConfigClientId {
1570 fn quote(&self) -> String {
1571 format!("\"{}\"", self.0.clone())
1572 }
1573}
1574#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1575pub struct ModuleId(pub String);
1576impl From<&str> for ModuleId {
1577 fn from(value: &str) -> Self {
1578 Self(value.to_string())
1579 }
1580}
1581impl From<String> for ModuleId {
1582 fn from(value: String) -> Self {
1583 Self(value)
1584 }
1585}
1586impl IntoID<ModuleId> for Module {
1587 fn into_id(
1588 self,
1589 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1590 {
1591 Box::pin(async move { self.id().await })
1592 }
1593}
1594impl IntoID<ModuleId> for ModuleId {
1595 fn into_id(
1596 self,
1597 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1598 {
1599 Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1600 }
1601}
1602impl ModuleId {
1603 fn quote(&self) -> String {
1604 format!("\"{}\"", self.0.clone())
1605 }
1606}
1607#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1608pub struct ModuleSourceId(pub String);
1609impl From<&str> for ModuleSourceId {
1610 fn from(value: &str) -> Self {
1611 Self(value.to_string())
1612 }
1613}
1614impl From<String> for ModuleSourceId {
1615 fn from(value: String) -> Self {
1616 Self(value)
1617 }
1618}
1619impl IntoID<ModuleSourceId> for ModuleSource {
1620 fn into_id(
1621 self,
1622 ) -> std::pin::Pin<
1623 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1624 > {
1625 Box::pin(async move { self.id().await })
1626 }
1627}
1628impl IntoID<ModuleSourceId> for ModuleSourceId {
1629 fn into_id(
1630 self,
1631 ) -> std::pin::Pin<
1632 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1633 > {
1634 Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1635 }
1636}
1637impl ModuleSourceId {
1638 fn quote(&self) -> String {
1639 format!("\"{}\"", self.0.clone())
1640 }
1641}
1642#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1643pub struct ObjectTypeDefId(pub String);
1644impl From<&str> for ObjectTypeDefId {
1645 fn from(value: &str) -> Self {
1646 Self(value.to_string())
1647 }
1648}
1649impl From<String> for ObjectTypeDefId {
1650 fn from(value: String) -> Self {
1651 Self(value)
1652 }
1653}
1654impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1655 fn into_id(
1656 self,
1657 ) -> std::pin::Pin<
1658 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1659 > {
1660 Box::pin(async move { self.id().await })
1661 }
1662}
1663impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1664 fn into_id(
1665 self,
1666 ) -> std::pin::Pin<
1667 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1668 > {
1669 Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1670 }
1671}
1672impl ObjectTypeDefId {
1673 fn quote(&self) -> String {
1674 format!("\"{}\"", self.0.clone())
1675 }
1676}
1677#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1678pub struct Platform(pub String);
1679impl From<&str> for Platform {
1680 fn from(value: &str) -> Self {
1681 Self(value.to_string())
1682 }
1683}
1684impl From<String> for Platform {
1685 fn from(value: String) -> Self {
1686 Self(value)
1687 }
1688}
1689impl Platform {
1690 fn quote(&self) -> String {
1691 format!("\"{}\"", self.0.clone())
1692 }
1693}
1694#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1695pub struct PortId(pub String);
1696impl From<&str> for PortId {
1697 fn from(value: &str) -> Self {
1698 Self(value.to_string())
1699 }
1700}
1701impl From<String> for PortId {
1702 fn from(value: String) -> Self {
1703 Self(value)
1704 }
1705}
1706impl IntoID<PortId> for Port {
1707 fn into_id(
1708 self,
1709 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1710 {
1711 Box::pin(async move { self.id().await })
1712 }
1713}
1714impl IntoID<PortId> for PortId {
1715 fn into_id(
1716 self,
1717 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1718 {
1719 Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1720 }
1721}
1722impl PortId {
1723 fn quote(&self) -> String {
1724 format!("\"{}\"", self.0.clone())
1725 }
1726}
1727#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1728pub struct QueryId(pub String);
1729impl From<&str> for QueryId {
1730 fn from(value: &str) -> Self {
1731 Self(value.to_string())
1732 }
1733}
1734impl From<String> for QueryId {
1735 fn from(value: String) -> Self {
1736 Self(value)
1737 }
1738}
1739impl IntoID<QueryId> for Query {
1740 fn into_id(
1741 self,
1742 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
1743 {
1744 Box::pin(async move { self.id().await })
1745 }
1746}
1747impl IntoID<QueryId> for QueryId {
1748 fn into_id(
1749 self,
1750 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
1751 {
1752 Box::pin(async move { Ok::<QueryId, DaggerError>(self) })
1753 }
1754}
1755impl QueryId {
1756 fn quote(&self) -> String {
1757 format!("\"{}\"", self.0.clone())
1758 }
1759}
1760#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1761pub struct RemoteGitMirrorId(pub String);
1762impl From<&str> for RemoteGitMirrorId {
1763 fn from(value: &str) -> Self {
1764 Self(value.to_string())
1765 }
1766}
1767impl From<String> for RemoteGitMirrorId {
1768 fn from(value: String) -> Self {
1769 Self(value)
1770 }
1771}
1772impl IntoID<RemoteGitMirrorId> for RemoteGitMirror {
1773 fn into_id(
1774 self,
1775 ) -> std::pin::Pin<
1776 Box<dyn core::future::Future<Output = Result<RemoteGitMirrorId, DaggerError>> + Send>,
1777 > {
1778 Box::pin(async move { self.id().await })
1779 }
1780}
1781impl IntoID<RemoteGitMirrorId> for RemoteGitMirrorId {
1782 fn into_id(
1783 self,
1784 ) -> std::pin::Pin<
1785 Box<dyn core::future::Future<Output = Result<RemoteGitMirrorId, DaggerError>> + Send>,
1786 > {
1787 Box::pin(async move { Ok::<RemoteGitMirrorId, DaggerError>(self) })
1788 }
1789}
1790impl RemoteGitMirrorId {
1791 fn quote(&self) -> String {
1792 format!("\"{}\"", self.0.clone())
1793 }
1794}
1795#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1796pub struct SdkConfigId(pub String);
1797impl From<&str> for SdkConfigId {
1798 fn from(value: &str) -> Self {
1799 Self(value.to_string())
1800 }
1801}
1802impl From<String> for SdkConfigId {
1803 fn from(value: String) -> Self {
1804 Self(value)
1805 }
1806}
1807impl IntoID<SdkConfigId> for SdkConfig {
1808 fn into_id(
1809 self,
1810 ) -> std::pin::Pin<
1811 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1812 > {
1813 Box::pin(async move { self.id().await })
1814 }
1815}
1816impl IntoID<SdkConfigId> for SdkConfigId {
1817 fn into_id(
1818 self,
1819 ) -> std::pin::Pin<
1820 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1821 > {
1822 Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1823 }
1824}
1825impl SdkConfigId {
1826 fn quote(&self) -> String {
1827 format!("\"{}\"", self.0.clone())
1828 }
1829}
1830#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1831pub struct ScalarTypeDefId(pub String);
1832impl From<&str> for ScalarTypeDefId {
1833 fn from(value: &str) -> Self {
1834 Self(value.to_string())
1835 }
1836}
1837impl From<String> for ScalarTypeDefId {
1838 fn from(value: String) -> Self {
1839 Self(value)
1840 }
1841}
1842impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1843 fn into_id(
1844 self,
1845 ) -> std::pin::Pin<
1846 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1847 > {
1848 Box::pin(async move { self.id().await })
1849 }
1850}
1851impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1852 fn into_id(
1853 self,
1854 ) -> std::pin::Pin<
1855 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1856 > {
1857 Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1858 }
1859}
1860impl ScalarTypeDefId {
1861 fn quote(&self) -> String {
1862 format!("\"{}\"", self.0.clone())
1863 }
1864}
1865#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1866pub struct SearchResultId(pub String);
1867impl From<&str> for SearchResultId {
1868 fn from(value: &str) -> Self {
1869 Self(value.to_string())
1870 }
1871}
1872impl From<String> for SearchResultId {
1873 fn from(value: String) -> Self {
1874 Self(value)
1875 }
1876}
1877impl IntoID<SearchResultId> for SearchResult {
1878 fn into_id(
1879 self,
1880 ) -> std::pin::Pin<
1881 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1882 > {
1883 Box::pin(async move { self.id().await })
1884 }
1885}
1886impl IntoID<SearchResultId> for SearchResultId {
1887 fn into_id(
1888 self,
1889 ) -> std::pin::Pin<
1890 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1891 > {
1892 Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1893 }
1894}
1895impl SearchResultId {
1896 fn quote(&self) -> String {
1897 format!("\"{}\"", self.0.clone())
1898 }
1899}
1900#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1901pub struct SearchSubmatchId(pub String);
1902impl From<&str> for SearchSubmatchId {
1903 fn from(value: &str) -> Self {
1904 Self(value.to_string())
1905 }
1906}
1907impl From<String> for SearchSubmatchId {
1908 fn from(value: String) -> Self {
1909 Self(value)
1910 }
1911}
1912impl IntoID<SearchSubmatchId> for SearchSubmatch {
1913 fn into_id(
1914 self,
1915 ) -> std::pin::Pin<
1916 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1917 > {
1918 Box::pin(async move { self.id().await })
1919 }
1920}
1921impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1922 fn into_id(
1923 self,
1924 ) -> std::pin::Pin<
1925 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1926 > {
1927 Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1928 }
1929}
1930impl SearchSubmatchId {
1931 fn quote(&self) -> String {
1932 format!("\"{}\"", self.0.clone())
1933 }
1934}
1935#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1936pub struct SecretId(pub String);
1937impl From<&str> for SecretId {
1938 fn from(value: &str) -> Self {
1939 Self(value.to_string())
1940 }
1941}
1942impl From<String> for SecretId {
1943 fn from(value: String) -> Self {
1944 Self(value)
1945 }
1946}
1947impl IntoID<SecretId> for Secret {
1948 fn into_id(
1949 self,
1950 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1951 {
1952 Box::pin(async move { self.id().await })
1953 }
1954}
1955impl IntoID<SecretId> for SecretId {
1956 fn into_id(
1957 self,
1958 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1959 {
1960 Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1961 }
1962}
1963impl SecretId {
1964 fn quote(&self) -> String {
1965 format!("\"{}\"", self.0.clone())
1966 }
1967}
1968#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1969pub struct ServiceId(pub String);
1970impl From<&str> for ServiceId {
1971 fn from(value: &str) -> Self {
1972 Self(value.to_string())
1973 }
1974}
1975impl From<String> for ServiceId {
1976 fn from(value: String) -> Self {
1977 Self(value)
1978 }
1979}
1980impl IntoID<ServiceId> for Service {
1981 fn into_id(
1982 self,
1983 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1984 {
1985 Box::pin(async move { self.id().await })
1986 }
1987}
1988impl IntoID<ServiceId> for ServiceId {
1989 fn into_id(
1990 self,
1991 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1992 {
1993 Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1994 }
1995}
1996impl ServiceId {
1997 fn quote(&self) -> String {
1998 format!("\"{}\"", self.0.clone())
1999 }
2000}
2001#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2002pub struct SocketId(pub String);
2003impl From<&str> for SocketId {
2004 fn from(value: &str) -> Self {
2005 Self(value.to_string())
2006 }
2007}
2008impl From<String> for SocketId {
2009 fn from(value: String) -> Self {
2010 Self(value)
2011 }
2012}
2013impl IntoID<SocketId> for Socket {
2014 fn into_id(
2015 self,
2016 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
2017 {
2018 Box::pin(async move { self.id().await })
2019 }
2020}
2021impl IntoID<SocketId> for SocketId {
2022 fn into_id(
2023 self,
2024 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
2025 {
2026 Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
2027 }
2028}
2029impl SocketId {
2030 fn quote(&self) -> String {
2031 format!("\"{}\"", self.0.clone())
2032 }
2033}
2034#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2035pub struct SourceMapId(pub String);
2036impl From<&str> for SourceMapId {
2037 fn from(value: &str) -> Self {
2038 Self(value.to_string())
2039 }
2040}
2041impl From<String> for SourceMapId {
2042 fn from(value: String) -> Self {
2043 Self(value)
2044 }
2045}
2046impl IntoID<SourceMapId> for SourceMap {
2047 fn into_id(
2048 self,
2049 ) -> std::pin::Pin<
2050 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
2051 > {
2052 Box::pin(async move { self.id().await })
2053 }
2054}
2055impl IntoID<SourceMapId> for SourceMapId {
2056 fn into_id(
2057 self,
2058 ) -> std::pin::Pin<
2059 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
2060 > {
2061 Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
2062 }
2063}
2064impl SourceMapId {
2065 fn quote(&self) -> String {
2066 format!("\"{}\"", self.0.clone())
2067 }
2068}
2069#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2070pub struct StatId(pub String);
2071impl From<&str> for StatId {
2072 fn from(value: &str) -> Self {
2073 Self(value.to_string())
2074 }
2075}
2076impl From<String> for StatId {
2077 fn from(value: String) -> Self {
2078 Self(value)
2079 }
2080}
2081impl IntoID<StatId> for Stat {
2082 fn into_id(
2083 self,
2084 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
2085 {
2086 Box::pin(async move { self.id().await })
2087 }
2088}
2089impl IntoID<StatId> for StatId {
2090 fn into_id(
2091 self,
2092 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
2093 {
2094 Box::pin(async move { Ok::<StatId, DaggerError>(self) })
2095 }
2096}
2097impl StatId {
2098 fn quote(&self) -> String {
2099 format!("\"{}\"", self.0.clone())
2100 }
2101}
2102#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2103pub struct TerminalId(pub String);
2104impl From<&str> for TerminalId {
2105 fn from(value: &str) -> Self {
2106 Self(value.to_string())
2107 }
2108}
2109impl From<String> for TerminalId {
2110 fn from(value: String) -> Self {
2111 Self(value)
2112 }
2113}
2114impl IntoID<TerminalId> for Terminal {
2115 fn into_id(
2116 self,
2117 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
2118 {
2119 Box::pin(async move { self.id().await })
2120 }
2121}
2122impl IntoID<TerminalId> for TerminalId {
2123 fn into_id(
2124 self,
2125 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
2126 {
2127 Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
2128 }
2129}
2130impl TerminalId {
2131 fn quote(&self) -> String {
2132 format!("\"{}\"", self.0.clone())
2133 }
2134}
2135#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2136pub struct TypeDefId(pub String);
2137impl From<&str> for TypeDefId {
2138 fn from(value: &str) -> Self {
2139 Self(value.to_string())
2140 }
2141}
2142impl From<String> for TypeDefId {
2143 fn from(value: String) -> Self {
2144 Self(value)
2145 }
2146}
2147impl IntoID<TypeDefId> for TypeDef {
2148 fn into_id(
2149 self,
2150 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
2151 {
2152 Box::pin(async move { self.id().await })
2153 }
2154}
2155impl IntoID<TypeDefId> for TypeDefId {
2156 fn into_id(
2157 self,
2158 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
2159 {
2160 Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
2161 }
2162}
2163impl TypeDefId {
2164 fn quote(&self) -> String {
2165 format!("\"{}\"", self.0.clone())
2166 }
2167}
2168#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2169pub struct UpGroupId(pub String);
2170impl From<&str> for UpGroupId {
2171 fn from(value: &str) -> Self {
2172 Self(value.to_string())
2173 }
2174}
2175impl From<String> for UpGroupId {
2176 fn from(value: String) -> Self {
2177 Self(value)
2178 }
2179}
2180impl IntoID<UpGroupId> for UpGroup {
2181 fn into_id(
2182 self,
2183 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
2184 {
2185 Box::pin(async move { self.id().await })
2186 }
2187}
2188impl IntoID<UpGroupId> for UpGroupId {
2189 fn into_id(
2190 self,
2191 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
2192 {
2193 Box::pin(async move { Ok::<UpGroupId, DaggerError>(self) })
2194 }
2195}
2196impl UpGroupId {
2197 fn quote(&self) -> String {
2198 format!("\"{}\"", self.0.clone())
2199 }
2200}
2201#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2202pub struct UpId(pub String);
2203impl From<&str> for UpId {
2204 fn from(value: &str) -> Self {
2205 Self(value.to_string())
2206 }
2207}
2208impl From<String> for UpId {
2209 fn from(value: String) -> Self {
2210 Self(value)
2211 }
2212}
2213impl IntoID<UpId> for Up {
2214 fn into_id(
2215 self,
2216 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
2217 {
2218 Box::pin(async move { self.id().await })
2219 }
2220}
2221impl IntoID<UpId> for UpId {
2222 fn into_id(
2223 self,
2224 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
2225 {
2226 Box::pin(async move { Ok::<UpId, DaggerError>(self) })
2227 }
2228}
2229impl UpId {
2230 fn quote(&self) -> String {
2231 format!("\"{}\"", self.0.clone())
2232 }
2233}
2234#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2235pub struct Void(pub String);
2236impl From<&str> for Void {
2237 fn from(value: &str) -> Self {
2238 Self(value.to_string())
2239 }
2240}
2241impl From<String> for Void {
2242 fn from(value: String) -> Self {
2243 Self(value)
2244 }
2245}
2246impl Void {
2247 fn quote(&self) -> String {
2248 format!("\"{}\"", self.0.clone())
2249 }
2250}
2251#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2252pub struct WorkspaceId(pub String);
2253impl From<&str> for WorkspaceId {
2254 fn from(value: &str) -> Self {
2255 Self(value.to_string())
2256 }
2257}
2258impl From<String> for WorkspaceId {
2259 fn from(value: String) -> Self {
2260 Self(value)
2261 }
2262}
2263impl IntoID<WorkspaceId> for Workspace {
2264 fn into_id(
2265 self,
2266 ) -> std::pin::Pin<
2267 Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2268 > {
2269 Box::pin(async move { self.id().await })
2270 }
2271}
2272impl IntoID<WorkspaceId> for WorkspaceId {
2273 fn into_id(
2274 self,
2275 ) -> std::pin::Pin<
2276 Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2277 > {
2278 Box::pin(async move { Ok::<WorkspaceId, DaggerError>(self) })
2279 }
2280}
2281impl WorkspaceId {
2282 fn quote(&self) -> String {
2283 format!("\"{}\"", self.0.clone())
2284 }
2285}
2286#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2287pub struct BuildArg {
2288 pub name: String,
2289 pub value: String,
2290}
2291#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2292pub struct PipelineLabel {
2293 pub name: String,
2294 pub value: String,
2295}
2296#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2297pub struct PortForward {
2298 pub backend: isize,
2299 pub frontend: isize,
2300 pub protocol: NetworkProtocol,
2301}
2302#[derive(Clone)]
2303pub struct Address {
2304 pub proc: Option<Arc<DaggerSessionProc>>,
2305 pub selection: Selection,
2306 pub graphql_client: DynGraphQLClient,
2307}
2308#[derive(Builder, Debug, PartialEq)]
2309pub struct AddressDirectoryOpts<'a> {
2310 #[builder(setter(into, strip_option), default)]
2311 pub exclude: Option<Vec<&'a str>>,
2312 #[builder(setter(into, strip_option), default)]
2313 pub gitignore: Option<bool>,
2314 #[builder(setter(into, strip_option), default)]
2315 pub include: Option<Vec<&'a str>>,
2316 #[builder(setter(into, strip_option), default)]
2317 pub no_cache: Option<bool>,
2318}
2319#[derive(Builder, Debug, PartialEq)]
2320pub struct AddressFileOpts<'a> {
2321 #[builder(setter(into, strip_option), default)]
2322 pub exclude: Option<Vec<&'a str>>,
2323 #[builder(setter(into, strip_option), default)]
2324 pub gitignore: Option<bool>,
2325 #[builder(setter(into, strip_option), default)]
2326 pub include: Option<Vec<&'a str>>,
2327 #[builder(setter(into, strip_option), default)]
2328 pub no_cache: Option<bool>,
2329}
2330impl Address {
2331 pub fn container(&self) -> Container {
2333 let query = self.selection.select("container");
2334 Container {
2335 proc: self.proc.clone(),
2336 selection: query,
2337 graphql_client: self.graphql_client.clone(),
2338 }
2339 }
2340 pub fn directory(&self) -> Directory {
2346 let query = self.selection.select("directory");
2347 Directory {
2348 proc: self.proc.clone(),
2349 selection: query,
2350 graphql_client: self.graphql_client.clone(),
2351 }
2352 }
2353 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
2359 let mut query = self.selection.select("directory");
2360 if let Some(exclude) = opts.exclude {
2361 query = query.arg("exclude", exclude);
2362 }
2363 if let Some(include) = opts.include {
2364 query = query.arg("include", include);
2365 }
2366 if let Some(gitignore) = opts.gitignore {
2367 query = query.arg("gitignore", gitignore);
2368 }
2369 if let Some(no_cache) = opts.no_cache {
2370 query = query.arg("noCache", no_cache);
2371 }
2372 Directory {
2373 proc: self.proc.clone(),
2374 selection: query,
2375 graphql_client: self.graphql_client.clone(),
2376 }
2377 }
2378 pub fn file(&self) -> File {
2384 let query = self.selection.select("file");
2385 File {
2386 proc: self.proc.clone(),
2387 selection: query,
2388 graphql_client: self.graphql_client.clone(),
2389 }
2390 }
2391 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
2397 let mut query = self.selection.select("file");
2398 if let Some(exclude) = opts.exclude {
2399 query = query.arg("exclude", exclude);
2400 }
2401 if let Some(include) = opts.include {
2402 query = query.arg("include", include);
2403 }
2404 if let Some(gitignore) = opts.gitignore {
2405 query = query.arg("gitignore", gitignore);
2406 }
2407 if let Some(no_cache) = opts.no_cache {
2408 query = query.arg("noCache", no_cache);
2409 }
2410 File {
2411 proc: self.proc.clone(),
2412 selection: query,
2413 graphql_client: self.graphql_client.clone(),
2414 }
2415 }
2416 pub fn git_ref(&self) -> GitRef {
2418 let query = self.selection.select("gitRef");
2419 GitRef {
2420 proc: self.proc.clone(),
2421 selection: query,
2422 graphql_client: self.graphql_client.clone(),
2423 }
2424 }
2425 pub fn git_repository(&self) -> GitRepository {
2427 let query = self.selection.select("gitRepository");
2428 GitRepository {
2429 proc: self.proc.clone(),
2430 selection: query,
2431 graphql_client: self.graphql_client.clone(),
2432 }
2433 }
2434 pub async fn id(&self) -> Result<AddressId, DaggerError> {
2436 let query = self.selection.select("id");
2437 query.execute(self.graphql_client.clone()).await
2438 }
2439 pub fn secret(&self) -> Secret {
2441 let query = self.selection.select("secret");
2442 Secret {
2443 proc: self.proc.clone(),
2444 selection: query,
2445 graphql_client: self.graphql_client.clone(),
2446 }
2447 }
2448 pub fn service(&self) -> Service {
2450 let query = self.selection.select("service");
2451 Service {
2452 proc: self.proc.clone(),
2453 selection: query,
2454 graphql_client: self.graphql_client.clone(),
2455 }
2456 }
2457 pub fn socket(&self) -> Socket {
2459 let query = self.selection.select("socket");
2460 Socket {
2461 proc: self.proc.clone(),
2462 selection: query,
2463 graphql_client: self.graphql_client.clone(),
2464 }
2465 }
2466 pub async fn value(&self) -> Result<String, DaggerError> {
2468 let query = self.selection.select("value");
2469 query.execute(self.graphql_client.clone()).await
2470 }
2471}
2472#[derive(Clone)]
2473pub struct Binding {
2474 pub proc: Option<Arc<DaggerSessionProc>>,
2475 pub selection: Selection,
2476 pub graphql_client: DynGraphQLClient,
2477}
2478impl Binding {
2479 pub fn as_address(&self) -> Address {
2481 let query = self.selection.select("asAddress");
2482 Address {
2483 proc: self.proc.clone(),
2484 selection: query,
2485 graphql_client: self.graphql_client.clone(),
2486 }
2487 }
2488 pub fn as_cache_volume(&self) -> CacheVolume {
2490 let query = self.selection.select("asCacheVolume");
2491 CacheVolume {
2492 proc: self.proc.clone(),
2493 selection: query,
2494 graphql_client: self.graphql_client.clone(),
2495 }
2496 }
2497 pub fn as_changeset(&self) -> Changeset {
2499 let query = self.selection.select("asChangeset");
2500 Changeset {
2501 proc: self.proc.clone(),
2502 selection: query,
2503 graphql_client: self.graphql_client.clone(),
2504 }
2505 }
2506 pub fn as_check(&self) -> Check {
2508 let query = self.selection.select("asCheck");
2509 Check {
2510 proc: self.proc.clone(),
2511 selection: query,
2512 graphql_client: self.graphql_client.clone(),
2513 }
2514 }
2515 pub fn as_check_group(&self) -> CheckGroup {
2517 let query = self.selection.select("asCheckGroup");
2518 CheckGroup {
2519 proc: self.proc.clone(),
2520 selection: query,
2521 graphql_client: self.graphql_client.clone(),
2522 }
2523 }
2524 pub fn as_cloud(&self) -> Cloud {
2526 let query = self.selection.select("asCloud");
2527 Cloud {
2528 proc: self.proc.clone(),
2529 selection: query,
2530 graphql_client: self.graphql_client.clone(),
2531 }
2532 }
2533 pub fn as_container(&self) -> Container {
2535 let query = self.selection.select("asContainer");
2536 Container {
2537 proc: self.proc.clone(),
2538 selection: query,
2539 graphql_client: self.graphql_client.clone(),
2540 }
2541 }
2542 pub fn as_diff_stat(&self) -> DiffStat {
2544 let query = self.selection.select("asDiffStat");
2545 DiffStat {
2546 proc: self.proc.clone(),
2547 selection: query,
2548 graphql_client: self.graphql_client.clone(),
2549 }
2550 }
2551 pub fn as_directory(&self) -> Directory {
2553 let query = self.selection.select("asDirectory");
2554 Directory {
2555 proc: self.proc.clone(),
2556 selection: query,
2557 graphql_client: self.graphql_client.clone(),
2558 }
2559 }
2560 pub fn as_env(&self) -> Env {
2562 let query = self.selection.select("asEnv");
2563 Env {
2564 proc: self.proc.clone(),
2565 selection: query,
2566 graphql_client: self.graphql_client.clone(),
2567 }
2568 }
2569 pub fn as_env_file(&self) -> EnvFile {
2571 let query = self.selection.select("asEnvFile");
2572 EnvFile {
2573 proc: self.proc.clone(),
2574 selection: query,
2575 graphql_client: self.graphql_client.clone(),
2576 }
2577 }
2578 pub fn as_file(&self) -> File {
2580 let query = self.selection.select("asFile");
2581 File {
2582 proc: self.proc.clone(),
2583 selection: query,
2584 graphql_client: self.graphql_client.clone(),
2585 }
2586 }
2587 pub fn as_generator(&self) -> Generator {
2589 let query = self.selection.select("asGenerator");
2590 Generator {
2591 proc: self.proc.clone(),
2592 selection: query,
2593 graphql_client: self.graphql_client.clone(),
2594 }
2595 }
2596 pub fn as_generator_group(&self) -> GeneratorGroup {
2598 let query = self.selection.select("asGeneratorGroup");
2599 GeneratorGroup {
2600 proc: self.proc.clone(),
2601 selection: query,
2602 graphql_client: self.graphql_client.clone(),
2603 }
2604 }
2605 pub fn as_git_ref(&self) -> GitRef {
2607 let query = self.selection.select("asGitRef");
2608 GitRef {
2609 proc: self.proc.clone(),
2610 selection: query,
2611 graphql_client: self.graphql_client.clone(),
2612 }
2613 }
2614 pub fn as_git_repository(&self) -> GitRepository {
2616 let query = self.selection.select("asGitRepository");
2617 GitRepository {
2618 proc: self.proc.clone(),
2619 selection: query,
2620 graphql_client: self.graphql_client.clone(),
2621 }
2622 }
2623 pub fn as_http_state(&self) -> HttpState {
2625 let query = self.selection.select("asHTTPState");
2626 HttpState {
2627 proc: self.proc.clone(),
2628 selection: query,
2629 graphql_client: self.graphql_client.clone(),
2630 }
2631 }
2632 pub fn as_json_value(&self) -> JsonValue {
2634 let query = self.selection.select("asJSONValue");
2635 JsonValue {
2636 proc: self.proc.clone(),
2637 selection: query,
2638 graphql_client: self.graphql_client.clone(),
2639 }
2640 }
2641 pub fn as_module(&self) -> Module {
2643 let query = self.selection.select("asModule");
2644 Module {
2645 proc: self.proc.clone(),
2646 selection: query,
2647 graphql_client: self.graphql_client.clone(),
2648 }
2649 }
2650 pub fn as_module_config_client(&self) -> ModuleConfigClient {
2652 let query = self.selection.select("asModuleConfigClient");
2653 ModuleConfigClient {
2654 proc: self.proc.clone(),
2655 selection: query,
2656 graphql_client: self.graphql_client.clone(),
2657 }
2658 }
2659 pub fn as_module_source(&self) -> ModuleSource {
2661 let query = self.selection.select("asModuleSource");
2662 ModuleSource {
2663 proc: self.proc.clone(),
2664 selection: query,
2665 graphql_client: self.graphql_client.clone(),
2666 }
2667 }
2668 pub fn as_search_result(&self) -> SearchResult {
2670 let query = self.selection.select("asSearchResult");
2671 SearchResult {
2672 proc: self.proc.clone(),
2673 selection: query,
2674 graphql_client: self.graphql_client.clone(),
2675 }
2676 }
2677 pub fn as_search_submatch(&self) -> SearchSubmatch {
2679 let query = self.selection.select("asSearchSubmatch");
2680 SearchSubmatch {
2681 proc: self.proc.clone(),
2682 selection: query,
2683 graphql_client: self.graphql_client.clone(),
2684 }
2685 }
2686 pub fn as_secret(&self) -> Secret {
2688 let query = self.selection.select("asSecret");
2689 Secret {
2690 proc: self.proc.clone(),
2691 selection: query,
2692 graphql_client: self.graphql_client.clone(),
2693 }
2694 }
2695 pub fn as_service(&self) -> Service {
2697 let query = self.selection.select("asService");
2698 Service {
2699 proc: self.proc.clone(),
2700 selection: query,
2701 graphql_client: self.graphql_client.clone(),
2702 }
2703 }
2704 pub fn as_socket(&self) -> Socket {
2706 let query = self.selection.select("asSocket");
2707 Socket {
2708 proc: self.proc.clone(),
2709 selection: query,
2710 graphql_client: self.graphql_client.clone(),
2711 }
2712 }
2713 pub fn as_stat(&self) -> Stat {
2715 let query = self.selection.select("asStat");
2716 Stat {
2717 proc: self.proc.clone(),
2718 selection: query,
2719 graphql_client: self.graphql_client.clone(),
2720 }
2721 }
2722 pub async fn as_string(&self) -> Result<String, DaggerError> {
2724 let query = self.selection.select("asString");
2725 query.execute(self.graphql_client.clone()).await
2726 }
2727 pub fn as_up(&self) -> Up {
2729 let query = self.selection.select("asUp");
2730 Up {
2731 proc: self.proc.clone(),
2732 selection: query,
2733 graphql_client: self.graphql_client.clone(),
2734 }
2735 }
2736 pub fn as_up_group(&self) -> UpGroup {
2738 let query = self.selection.select("asUpGroup");
2739 UpGroup {
2740 proc: self.proc.clone(),
2741 selection: query,
2742 graphql_client: self.graphql_client.clone(),
2743 }
2744 }
2745 pub fn as_workspace(&self) -> Workspace {
2747 let query = self.selection.select("asWorkspace");
2748 Workspace {
2749 proc: self.proc.clone(),
2750 selection: query,
2751 graphql_client: self.graphql_client.clone(),
2752 }
2753 }
2754 pub async fn digest(&self) -> Result<String, DaggerError> {
2756 let query = self.selection.select("digest");
2757 query.execute(self.graphql_client.clone()).await
2758 }
2759 pub async fn id(&self) -> Result<BindingId, DaggerError> {
2761 let query = self.selection.select("id");
2762 query.execute(self.graphql_client.clone()).await
2763 }
2764 pub async fn is_null(&self) -> Result<bool, DaggerError> {
2766 let query = self.selection.select("isNull");
2767 query.execute(self.graphql_client.clone()).await
2768 }
2769 pub async fn name(&self) -> Result<String, DaggerError> {
2771 let query = self.selection.select("name");
2772 query.execute(self.graphql_client.clone()).await
2773 }
2774 pub async fn type_name(&self) -> Result<String, DaggerError> {
2776 let query = self.selection.select("typeName");
2777 query.execute(self.graphql_client.clone()).await
2778 }
2779}
2780#[derive(Clone)]
2781pub struct CacheVolume {
2782 pub proc: Option<Arc<DaggerSessionProc>>,
2783 pub selection: Selection,
2784 pub graphql_client: DynGraphQLClient,
2785}
2786impl CacheVolume {
2787 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2789 let query = self.selection.select("id");
2790 query.execute(self.graphql_client.clone()).await
2791 }
2792}
2793#[derive(Clone)]
2794pub struct Changeset {
2795 pub proc: Option<Arc<DaggerSessionProc>>,
2796 pub selection: Selection,
2797 pub graphql_client: DynGraphQLClient,
2798}
2799#[derive(Builder, Debug, PartialEq)]
2800pub struct ChangesetWithChangesetOpts {
2801 #[builder(setter(into, strip_option), default)]
2803 pub on_conflict: Option<ChangesetMergeConflict>,
2804}
2805#[derive(Builder, Debug, PartialEq)]
2806pub struct ChangesetWithChangesetsOpts {
2807 #[builder(setter(into, strip_option), default)]
2809 pub on_conflict: Option<ChangesetsMergeConflict>,
2810}
2811impl Changeset {
2812 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2814 let query = self.selection.select("addedPaths");
2815 query.execute(self.graphql_client.clone()).await
2816 }
2817 pub fn after(&self) -> Directory {
2819 let query = self.selection.select("after");
2820 Directory {
2821 proc: self.proc.clone(),
2822 selection: query,
2823 graphql_client: self.graphql_client.clone(),
2824 }
2825 }
2826 pub fn as_patch(&self) -> File {
2828 let query = self.selection.select("asPatch");
2829 File {
2830 proc: self.proc.clone(),
2831 selection: query,
2832 graphql_client: self.graphql_client.clone(),
2833 }
2834 }
2835 pub fn before(&self) -> Directory {
2837 let query = self.selection.select("before");
2838 Directory {
2839 proc: self.proc.clone(),
2840 selection: query,
2841 graphql_client: self.graphql_client.clone(),
2842 }
2843 }
2844 pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
2846 let query = self.selection.select("diffStats");
2847 let query = query.select("id");
2848 let ids: Vec<DiffStatId> = query.execute(self.graphql_client.clone()).await?;
2849 let root = Query {
2850 proc: self.proc.clone(),
2851 selection: crate::querybuilder::query(),
2852 graphql_client: self.graphql_client.clone(),
2853 };
2854 Ok(ids
2855 .into_iter()
2856 .map(|id| root.load_diff_stat_from_id(id))
2857 .collect())
2858 }
2859 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2865 let mut query = self.selection.select("export");
2866 query = query.arg("path", path.into());
2867 query.execute(self.graphql_client.clone()).await
2868 }
2869 pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2871 let query = self.selection.select("id");
2872 query.execute(self.graphql_client.clone()).await
2873 }
2874 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2876 let query = self.selection.select("isEmpty");
2877 query.execute(self.graphql_client.clone()).await
2878 }
2879 pub fn layer(&self) -> Directory {
2881 let query = self.selection.select("layer");
2882 Directory {
2883 proc: self.proc.clone(),
2884 selection: query,
2885 graphql_client: self.graphql_client.clone(),
2886 }
2887 }
2888 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2890 let query = self.selection.select("modifiedPaths");
2891 query.execute(self.graphql_client.clone()).await
2892 }
2893 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2895 let query = self.selection.select("removedPaths");
2896 query.execute(self.graphql_client.clone()).await
2897 }
2898 pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2900 let query = self.selection.select("sync");
2901 query.execute(self.graphql_client.clone()).await
2902 }
2903 pub fn with_changeset(&self, changes: impl IntoID<ChangesetId>) -> Changeset {
2911 let mut query = self.selection.select("withChangeset");
2912 query = query.arg_lazy(
2913 "changes",
2914 Box::new(move || {
2915 let changes = changes.clone();
2916 Box::pin(async move { changes.into_id().await.unwrap().quote() })
2917 }),
2918 );
2919 Changeset {
2920 proc: self.proc.clone(),
2921 selection: query,
2922 graphql_client: self.graphql_client.clone(),
2923 }
2924 }
2925 pub fn with_changeset_opts(
2933 &self,
2934 changes: impl IntoID<ChangesetId>,
2935 opts: ChangesetWithChangesetOpts,
2936 ) -> Changeset {
2937 let mut query = self.selection.select("withChangeset");
2938 query = query.arg_lazy(
2939 "changes",
2940 Box::new(move || {
2941 let changes = changes.clone();
2942 Box::pin(async move { changes.into_id().await.unwrap().quote() })
2943 }),
2944 );
2945 if let Some(on_conflict) = opts.on_conflict {
2946 query = query.arg("onConflict", on_conflict);
2947 }
2948 Changeset {
2949 proc: self.proc.clone(),
2950 selection: query,
2951 graphql_client: self.graphql_client.clone(),
2952 }
2953 }
2954 pub fn with_changesets(&self, changes: Vec<ChangesetId>) -> Changeset {
2963 let mut query = self.selection.select("withChangesets");
2964 query = query.arg("changes", changes);
2965 Changeset {
2966 proc: self.proc.clone(),
2967 selection: query,
2968 graphql_client: self.graphql_client.clone(),
2969 }
2970 }
2971 pub fn with_changesets_opts(
2980 &self,
2981 changes: Vec<ChangesetId>,
2982 opts: ChangesetWithChangesetsOpts,
2983 ) -> Changeset {
2984 let mut query = self.selection.select("withChangesets");
2985 query = query.arg("changes", changes);
2986 if let Some(on_conflict) = opts.on_conflict {
2987 query = query.arg("onConflict", on_conflict);
2988 }
2989 Changeset {
2990 proc: self.proc.clone(),
2991 selection: query,
2992 graphql_client: self.graphql_client.clone(),
2993 }
2994 }
2995}
2996#[derive(Clone)]
2997pub struct Check {
2998 pub proc: Option<Arc<DaggerSessionProc>>,
2999 pub selection: Selection,
3000 pub graphql_client: DynGraphQLClient,
3001}
3002impl Check {
3003 pub async fn check_type(&self) -> Result<String, DaggerError> {
3005 let query = self.selection.select("checkType");
3006 query.execute(self.graphql_client.clone()).await
3007 }
3008 pub async fn completed(&self) -> Result<bool, DaggerError> {
3010 let query = self.selection.select("completed");
3011 query.execute(self.graphql_client.clone()).await
3012 }
3013 pub async fn description(&self) -> Result<String, DaggerError> {
3015 let query = self.selection.select("description");
3016 query.execute(self.graphql_client.clone()).await
3017 }
3018 pub fn error(&self) -> Error {
3020 let query = self.selection.select("error");
3021 Error {
3022 proc: self.proc.clone(),
3023 selection: query,
3024 graphql_client: self.graphql_client.clone(),
3025 }
3026 }
3027 pub async fn id(&self) -> Result<CheckId, DaggerError> {
3029 let query = self.selection.select("id");
3030 query.execute(self.graphql_client.clone()).await
3031 }
3032 pub async fn name(&self) -> Result<String, DaggerError> {
3034 let query = self.selection.select("name");
3035 query.execute(self.graphql_client.clone()).await
3036 }
3037 pub fn original_module(&self) -> Module {
3039 let query = self.selection.select("originalModule");
3040 Module {
3041 proc: self.proc.clone(),
3042 selection: query,
3043 graphql_client: self.graphql_client.clone(),
3044 }
3045 }
3046 pub async fn passed(&self) -> Result<bool, DaggerError> {
3048 let query = self.selection.select("passed");
3049 query.execute(self.graphql_client.clone()).await
3050 }
3051 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
3053 let query = self.selection.select("path");
3054 query.execute(self.graphql_client.clone()).await
3055 }
3056 pub async fn result_emoji(&self) -> Result<String, DaggerError> {
3058 let query = self.selection.select("resultEmoji");
3059 query.execute(self.graphql_client.clone()).await
3060 }
3061 pub fn run(&self) -> Check {
3063 let query = self.selection.select("run");
3064 Check {
3065 proc: self.proc.clone(),
3066 selection: query,
3067 graphql_client: self.graphql_client.clone(),
3068 }
3069 }
3070}
3071#[derive(Clone)]
3072pub struct CheckGroup {
3073 pub proc: Option<Arc<DaggerSessionProc>>,
3074 pub selection: Selection,
3075 pub graphql_client: DynGraphQLClient,
3076}
3077#[derive(Builder, Debug, PartialEq)]
3078pub struct CheckGroupRunOpts {
3079 #[builder(setter(into, strip_option), default)]
3081 pub fail_fast: Option<bool>,
3082}
3083impl CheckGroup {
3084 pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
3086 let query = self.selection.select("id");
3087 query.execute(self.graphql_client.clone()).await
3088 }
3089 pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
3091 let query = self.selection.select("list");
3092 let query = query.select("id");
3093 let ids: Vec<CheckId> = query.execute(self.graphql_client.clone()).await?;
3094 let root = Query {
3095 proc: self.proc.clone(),
3096 selection: crate::querybuilder::query(),
3097 graphql_client: self.graphql_client.clone(),
3098 };
3099 Ok(ids
3100 .into_iter()
3101 .map(|id| root.load_check_from_id(id))
3102 .collect())
3103 }
3104 pub fn report(&self) -> File {
3106 let query = self.selection.select("report");
3107 File {
3108 proc: self.proc.clone(),
3109 selection: query,
3110 graphql_client: self.graphql_client.clone(),
3111 }
3112 }
3113 pub fn run(&self) -> CheckGroup {
3119 let query = self.selection.select("run");
3120 CheckGroup {
3121 proc: self.proc.clone(),
3122 selection: query,
3123 graphql_client: self.graphql_client.clone(),
3124 }
3125 }
3126 pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
3132 let mut query = self.selection.select("run");
3133 if let Some(fail_fast) = opts.fail_fast {
3134 query = query.arg("failFast", fail_fast);
3135 }
3136 CheckGroup {
3137 proc: self.proc.clone(),
3138 selection: query,
3139 graphql_client: self.graphql_client.clone(),
3140 }
3141 }
3142}
3143#[derive(Clone)]
3144pub struct ClientFilesyncMirror {
3145 pub proc: Option<Arc<DaggerSessionProc>>,
3146 pub selection: Selection,
3147 pub graphql_client: DynGraphQLClient,
3148}
3149impl ClientFilesyncMirror {
3150 pub async fn id(&self) -> Result<ClientFilesyncMirrorId, DaggerError> {
3152 let query = self.selection.select("id");
3153 query.execute(self.graphql_client.clone()).await
3154 }
3155}
3156#[derive(Clone)]
3157pub struct Cloud {
3158 pub proc: Option<Arc<DaggerSessionProc>>,
3159 pub selection: Selection,
3160 pub graphql_client: DynGraphQLClient,
3161}
3162impl Cloud {
3163 pub async fn id(&self) -> Result<CloudId, DaggerError> {
3165 let query = self.selection.select("id");
3166 query.execute(self.graphql_client.clone()).await
3167 }
3168 pub async fn trace_url(&self) -> Result<String, DaggerError> {
3170 let query = self.selection.select("traceURL");
3171 query.execute(self.graphql_client.clone()).await
3172 }
3173}
3174#[derive(Clone)]
3175pub struct Container {
3176 pub proc: Option<Arc<DaggerSessionProc>>,
3177 pub selection: Selection,
3178 pub graphql_client: DynGraphQLClient,
3179}
3180#[derive(Builder, Debug, PartialEq)]
3181pub struct ContainerAsServiceOpts<'a> {
3182 #[builder(setter(into, strip_option), default)]
3185 pub args: Option<Vec<&'a str>>,
3186 #[builder(setter(into, strip_option), default)]
3188 pub expand: Option<bool>,
3189 #[builder(setter(into, strip_option), default)]
3191 pub experimental_privileged_nesting: Option<bool>,
3192 #[builder(setter(into, strip_option), default)]
3194 pub insecure_root_capabilities: Option<bool>,
3195 #[builder(setter(into, strip_option), default)]
3198 pub no_init: Option<bool>,
3199 #[builder(setter(into, strip_option), default)]
3201 pub use_entrypoint: Option<bool>,
3202}
3203#[derive(Builder, Debug, PartialEq)]
3204pub struct ContainerAsTarballOpts {
3205 #[builder(setter(into, strip_option), default)]
3208 pub forced_compression: Option<ImageLayerCompression>,
3209 #[builder(setter(into, strip_option), default)]
3212 pub media_types: Option<ImageMediaTypes>,
3213 #[builder(setter(into, strip_option), default)]
3216 pub platform_variants: Option<Vec<ContainerId>>,
3217}
3218#[derive(Builder, Debug, PartialEq)]
3219pub struct ContainerDirectoryOpts {
3220 #[builder(setter(into, strip_option), default)]
3222 pub expand: Option<bool>,
3223}
3224#[derive(Builder, Debug, PartialEq)]
3225pub struct ContainerExistsOpts {
3226 #[builder(setter(into, strip_option), default)]
3228 pub do_not_follow_symlinks: Option<bool>,
3229 #[builder(setter(into, strip_option), default)]
3231 pub expected_type: Option<ExistsType>,
3232}
3233#[derive(Builder, Debug, PartialEq)]
3234pub struct ContainerExportOpts {
3235 #[builder(setter(into, strip_option), default)]
3237 pub expand: Option<bool>,
3238 #[builder(setter(into, strip_option), default)]
3241 pub forced_compression: Option<ImageLayerCompression>,
3242 #[builder(setter(into, strip_option), default)]
3245 pub media_types: Option<ImageMediaTypes>,
3246 #[builder(setter(into, strip_option), default)]
3249 pub platform_variants: Option<Vec<ContainerId>>,
3250}
3251#[derive(Builder, Debug, PartialEq)]
3252pub struct ContainerExportImageOpts {
3253 #[builder(setter(into, strip_option), default)]
3256 pub forced_compression: Option<ImageLayerCompression>,
3257 #[builder(setter(into, strip_option), default)]
3260 pub media_types: Option<ImageMediaTypes>,
3261 #[builder(setter(into, strip_option), default)]
3264 pub platform_variants: Option<Vec<ContainerId>>,
3265}
3266#[derive(Builder, Debug, PartialEq)]
3267pub struct ContainerFileOpts {
3268 #[builder(setter(into, strip_option), default)]
3270 pub expand: Option<bool>,
3271}
3272#[derive(Builder, Debug, PartialEq)]
3273pub struct ContainerImportOpts<'a> {
3274 #[builder(setter(into, strip_option), default)]
3276 pub tag: Option<&'a str>,
3277}
3278#[derive(Builder, Debug, PartialEq)]
3279pub struct ContainerPublishOpts {
3280 #[builder(setter(into, strip_option), default)]
3283 pub forced_compression: Option<ImageLayerCompression>,
3284 #[builder(setter(into, strip_option), default)]
3287 pub media_types: Option<ImageMediaTypes>,
3288 #[builder(setter(into, strip_option), default)]
3291 pub platform_variants: Option<Vec<ContainerId>>,
3292}
3293#[derive(Builder, Debug, PartialEq)]
3294pub struct ContainerStatOpts {
3295 #[builder(setter(into, strip_option), default)]
3297 pub do_not_follow_symlinks: Option<bool>,
3298}
3299#[derive(Builder, Debug, PartialEq)]
3300pub struct ContainerTerminalOpts<'a> {
3301 #[builder(setter(into, strip_option), default)]
3303 pub cmd: Option<Vec<&'a str>>,
3304 #[builder(setter(into, strip_option), default)]
3306 pub experimental_privileged_nesting: Option<bool>,
3307 #[builder(setter(into, strip_option), default)]
3309 pub insecure_root_capabilities: Option<bool>,
3310}
3311#[derive(Builder, Debug, PartialEq)]
3312pub struct ContainerUpOpts<'a> {
3313 #[builder(setter(into, strip_option), default)]
3316 pub args: Option<Vec<&'a str>>,
3317 #[builder(setter(into, strip_option), default)]
3319 pub expand: Option<bool>,
3320 #[builder(setter(into, strip_option), default)]
3322 pub experimental_privileged_nesting: Option<bool>,
3323 #[builder(setter(into, strip_option), default)]
3325 pub insecure_root_capabilities: Option<bool>,
3326 #[builder(setter(into, strip_option), default)]
3329 pub no_init: Option<bool>,
3330 #[builder(setter(into, strip_option), default)]
3333 pub ports: Option<Vec<PortForward>>,
3334 #[builder(setter(into, strip_option), default)]
3336 pub random: Option<bool>,
3337 #[builder(setter(into, strip_option), default)]
3339 pub use_entrypoint: Option<bool>,
3340}
3341#[derive(Builder, Debug, PartialEq)]
3342pub struct ContainerWithDefaultTerminalCmdOpts {
3343 #[builder(setter(into, strip_option), default)]
3345 pub experimental_privileged_nesting: Option<bool>,
3346 #[builder(setter(into, strip_option), default)]
3348 pub insecure_root_capabilities: Option<bool>,
3349}
3350#[derive(Builder, Debug, PartialEq)]
3351pub struct ContainerWithDirectoryOpts<'a> {
3352 #[builder(setter(into, strip_option), default)]
3354 pub exclude: Option<Vec<&'a str>>,
3355 #[builder(setter(into, strip_option), default)]
3357 pub expand: Option<bool>,
3358 #[builder(setter(into, strip_option), default)]
3360 pub gitignore: Option<bool>,
3361 #[builder(setter(into, strip_option), default)]
3363 pub include: Option<Vec<&'a str>>,
3364 #[builder(setter(into, strip_option), default)]
3368 pub owner: Option<&'a str>,
3369 #[builder(setter(into, strip_option), default)]
3370 pub permissions: Option<isize>,
3371}
3372#[derive(Builder, Debug, PartialEq)]
3373pub struct ContainerWithDockerHealthcheckOpts<'a> {
3374 #[builder(setter(into, strip_option), default)]
3376 pub interval: Option<&'a str>,
3377 #[builder(setter(into, strip_option), default)]
3379 pub retries: Option<isize>,
3380 #[builder(setter(into, strip_option), default)]
3382 pub shell: Option<bool>,
3383 #[builder(setter(into, strip_option), default)]
3385 pub start_interval: Option<&'a str>,
3386 #[builder(setter(into, strip_option), default)]
3388 pub start_period: Option<&'a str>,
3389 #[builder(setter(into, strip_option), default)]
3391 pub timeout: Option<&'a str>,
3392}
3393#[derive(Builder, Debug, PartialEq)]
3394pub struct ContainerWithEntrypointOpts {
3395 #[builder(setter(into, strip_option), default)]
3397 pub keep_default_args: Option<bool>,
3398}
3399#[derive(Builder, Debug, PartialEq)]
3400pub struct ContainerWithEnvVariableOpts {
3401 #[builder(setter(into, strip_option), default)]
3403 pub expand: Option<bool>,
3404}
3405#[derive(Builder, Debug, PartialEq)]
3406pub struct ContainerWithExecOpts<'a> {
3407 #[builder(setter(into, strip_option), default)]
3409 pub expand: Option<bool>,
3410 #[builder(setter(into, strip_option), default)]
3412 pub expect: Option<ReturnType>,
3413 #[builder(setter(into, strip_option), default)]
3415 pub experimental_privileged_nesting: Option<bool>,
3416 #[builder(setter(into, strip_option), default)]
3419 pub insecure_root_capabilities: Option<bool>,
3420 #[builder(setter(into, strip_option), default)]
3423 pub no_init: Option<bool>,
3424 #[builder(setter(into, strip_option), default)]
3426 pub redirect_stderr: Option<&'a str>,
3427 #[builder(setter(into, strip_option), default)]
3429 pub redirect_stdin: Option<&'a str>,
3430 #[builder(setter(into, strip_option), default)]
3432 pub redirect_stdout: Option<&'a str>,
3433 #[builder(setter(into, strip_option), default)]
3435 pub stdin: Option<&'a str>,
3436 #[builder(setter(into, strip_option), default)]
3438 pub use_entrypoint: Option<bool>,
3439}
3440#[derive(Builder, Debug, PartialEq)]
3441pub struct ContainerWithExposedPortOpts<'a> {
3442 #[builder(setter(into, strip_option), default)]
3444 pub description: Option<&'a str>,
3445 #[builder(setter(into, strip_option), default)]
3447 pub experimental_skip_healthcheck: Option<bool>,
3448 #[builder(setter(into, strip_option), default)]
3450 pub protocol: Option<NetworkProtocol>,
3451}
3452#[derive(Builder, Debug, PartialEq)]
3453pub struct ContainerWithFileOpts<'a> {
3454 #[builder(setter(into, strip_option), default)]
3456 pub expand: Option<bool>,
3457 #[builder(setter(into, strip_option), default)]
3461 pub owner: Option<&'a str>,
3462 #[builder(setter(into, strip_option), default)]
3464 pub permissions: Option<isize>,
3465}
3466#[derive(Builder, Debug, PartialEq)]
3467pub struct ContainerWithFilesOpts<'a> {
3468 #[builder(setter(into, strip_option), default)]
3470 pub expand: Option<bool>,
3471 #[builder(setter(into, strip_option), default)]
3475 pub owner: Option<&'a str>,
3476 #[builder(setter(into, strip_option), default)]
3478 pub permissions: Option<isize>,
3479}
3480#[derive(Builder, Debug, PartialEq)]
3481pub struct ContainerWithMountedCacheOpts<'a> {
3482 #[builder(setter(into, strip_option), default)]
3484 pub expand: Option<bool>,
3485 #[builder(setter(into, strip_option), default)]
3490 pub owner: Option<&'a str>,
3491 #[builder(setter(into, strip_option), default)]
3493 pub sharing: Option<CacheSharingMode>,
3494 #[builder(setter(into, strip_option), default)]
3496 pub source: Option<DirectoryId>,
3497}
3498#[derive(Builder, Debug, PartialEq)]
3499pub struct ContainerWithMountedDirectoryOpts<'a> {
3500 #[builder(setter(into, strip_option), default)]
3502 pub expand: Option<bool>,
3503 #[builder(setter(into, strip_option), default)]
3507 pub owner: Option<&'a str>,
3508 #[builder(setter(into, strip_option), default)]
3510 pub read_only: Option<bool>,
3511}
3512#[derive(Builder, Debug, PartialEq)]
3513pub struct ContainerWithMountedFileOpts<'a> {
3514 #[builder(setter(into, strip_option), default)]
3516 pub expand: Option<bool>,
3517 #[builder(setter(into, strip_option), default)]
3521 pub owner: Option<&'a str>,
3522}
3523#[derive(Builder, Debug, PartialEq)]
3524pub struct ContainerWithMountedSecretOpts<'a> {
3525 #[builder(setter(into, strip_option), default)]
3527 pub expand: Option<bool>,
3528 #[builder(setter(into, strip_option), default)]
3531 pub mode: Option<isize>,
3532 #[builder(setter(into, strip_option), default)]
3536 pub owner: Option<&'a str>,
3537}
3538#[derive(Builder, Debug, PartialEq)]
3539pub struct ContainerWithMountedTempOpts {
3540 #[builder(setter(into, strip_option), default)]
3542 pub expand: Option<bool>,
3543 #[builder(setter(into, strip_option), default)]
3545 pub size: Option<isize>,
3546}
3547#[derive(Builder, Debug, PartialEq)]
3548pub struct ContainerWithNewFileOpts<'a> {
3549 #[builder(setter(into, strip_option), default)]
3551 pub expand: Option<bool>,
3552 #[builder(setter(into, strip_option), default)]
3556 pub owner: Option<&'a str>,
3557 #[builder(setter(into, strip_option), default)]
3559 pub permissions: Option<isize>,
3560}
3561#[derive(Builder, Debug, PartialEq)]
3562pub struct ContainerWithSymlinkOpts {
3563 #[builder(setter(into, strip_option), default)]
3565 pub expand: Option<bool>,
3566}
3567#[derive(Builder, Debug, PartialEq)]
3568pub struct ContainerWithUnixSocketOpts<'a> {
3569 #[builder(setter(into, strip_option), default)]
3571 pub expand: Option<bool>,
3572 #[builder(setter(into, strip_option), default)]
3576 pub owner: Option<&'a str>,
3577}
3578#[derive(Builder, Debug, PartialEq)]
3579pub struct ContainerWithWorkdirOpts {
3580 #[builder(setter(into, strip_option), default)]
3582 pub expand: Option<bool>,
3583}
3584#[derive(Builder, Debug, PartialEq)]
3585pub struct ContainerWithoutDirectoryOpts {
3586 #[builder(setter(into, strip_option), default)]
3588 pub expand: Option<bool>,
3589}
3590#[derive(Builder, Debug, PartialEq)]
3591pub struct ContainerWithoutEntrypointOpts {
3592 #[builder(setter(into, strip_option), default)]
3594 pub keep_default_args: Option<bool>,
3595}
3596#[derive(Builder, Debug, PartialEq)]
3597pub struct ContainerWithoutExposedPortOpts {
3598 #[builder(setter(into, strip_option), default)]
3600 pub protocol: Option<NetworkProtocol>,
3601}
3602#[derive(Builder, Debug, PartialEq)]
3603pub struct ContainerWithoutFileOpts {
3604 #[builder(setter(into, strip_option), default)]
3606 pub expand: Option<bool>,
3607}
3608#[derive(Builder, Debug, PartialEq)]
3609pub struct ContainerWithoutFilesOpts {
3610 #[builder(setter(into, strip_option), default)]
3612 pub expand: Option<bool>,
3613}
3614#[derive(Builder, Debug, PartialEq)]
3615pub struct ContainerWithoutMountOpts {
3616 #[builder(setter(into, strip_option), default)]
3618 pub expand: Option<bool>,
3619}
3620#[derive(Builder, Debug, PartialEq)]
3621pub struct ContainerWithoutUnixSocketOpts {
3622 #[builder(setter(into, strip_option), default)]
3624 pub expand: Option<bool>,
3625}
3626impl Container {
3627 pub fn as_service(&self) -> Service {
3634 let query = self.selection.select("asService");
3635 Service {
3636 proc: self.proc.clone(),
3637 selection: query,
3638 graphql_client: self.graphql_client.clone(),
3639 }
3640 }
3641 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
3648 let mut query = self.selection.select("asService");
3649 if let Some(args) = opts.args {
3650 query = query.arg("args", args);
3651 }
3652 if let Some(use_entrypoint) = opts.use_entrypoint {
3653 query = query.arg("useEntrypoint", use_entrypoint);
3654 }
3655 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3656 query = query.arg(
3657 "experimentalPrivilegedNesting",
3658 experimental_privileged_nesting,
3659 );
3660 }
3661 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3662 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3663 }
3664 if let Some(expand) = opts.expand {
3665 query = query.arg("expand", expand);
3666 }
3667 if let Some(no_init) = opts.no_init {
3668 query = query.arg("noInit", no_init);
3669 }
3670 Service {
3671 proc: self.proc.clone(),
3672 selection: query,
3673 graphql_client: self.graphql_client.clone(),
3674 }
3675 }
3676 pub fn as_tarball(&self) -> File {
3682 let query = self.selection.select("asTarball");
3683 File {
3684 proc: self.proc.clone(),
3685 selection: query,
3686 graphql_client: self.graphql_client.clone(),
3687 }
3688 }
3689 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
3695 let mut query = self.selection.select("asTarball");
3696 if let Some(platform_variants) = opts.platform_variants {
3697 query = query.arg("platformVariants", platform_variants);
3698 }
3699 if let Some(forced_compression) = opts.forced_compression {
3700 query = query.arg("forcedCompression", forced_compression);
3701 }
3702 if let Some(media_types) = opts.media_types {
3703 query = query.arg("mediaTypes", media_types);
3704 }
3705 File {
3706 proc: self.proc.clone(),
3707 selection: query,
3708 graphql_client: self.graphql_client.clone(),
3709 }
3710 }
3711 pub async fn combined_output(&self) -> Result<String, DaggerError> {
3714 let query = self.selection.select("combinedOutput");
3715 query.execute(self.graphql_client.clone()).await
3716 }
3717 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
3719 let query = self.selection.select("defaultArgs");
3720 query.execute(self.graphql_client.clone()).await
3721 }
3722 pub fn directory(&self, path: impl Into<String>) -> Directory {
3730 let mut query = self.selection.select("directory");
3731 query = query.arg("path", path.into());
3732 Directory {
3733 proc: self.proc.clone(),
3734 selection: query,
3735 graphql_client: self.graphql_client.clone(),
3736 }
3737 }
3738 pub fn directory_opts(
3746 &self,
3747 path: impl Into<String>,
3748 opts: ContainerDirectoryOpts,
3749 ) -> Directory {
3750 let mut query = self.selection.select("directory");
3751 query = query.arg("path", path.into());
3752 if let Some(expand) = opts.expand {
3753 query = query.arg("expand", expand);
3754 }
3755 Directory {
3756 proc: self.proc.clone(),
3757 selection: query,
3758 graphql_client: self.graphql_client.clone(),
3759 }
3760 }
3761 pub fn docker_healthcheck(&self) -> HealthcheckConfig {
3763 let query = self.selection.select("dockerHealthcheck");
3764 HealthcheckConfig {
3765 proc: self.proc.clone(),
3766 selection: query,
3767 graphql_client: self.graphql_client.clone(),
3768 }
3769 }
3770 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
3772 let query = self.selection.select("entrypoint");
3773 query.execute(self.graphql_client.clone()).await
3774 }
3775 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3781 let mut query = self.selection.select("envVariable");
3782 query = query.arg("name", name.into());
3783 query.execute(self.graphql_client.clone()).await
3784 }
3785 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
3787 let query = self.selection.select("envVariables");
3788 let query = query.select("id");
3789 let ids: Vec<EnvVariableId> = query.execute(self.graphql_client.clone()).await?;
3790 let root = Query {
3791 proc: self.proc.clone(),
3792 selection: crate::querybuilder::query(),
3793 graphql_client: self.graphql_client.clone(),
3794 };
3795 Ok(ids
3796 .into_iter()
3797 .map(|id| root.load_env_variable_from_id(id))
3798 .collect())
3799 }
3800 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
3807 let mut query = self.selection.select("exists");
3808 query = query.arg("path", path.into());
3809 query.execute(self.graphql_client.clone()).await
3810 }
3811 pub async fn exists_opts(
3818 &self,
3819 path: impl Into<String>,
3820 opts: ContainerExistsOpts,
3821 ) -> Result<bool, DaggerError> {
3822 let mut query = self.selection.select("exists");
3823 query = query.arg("path", path.into());
3824 if let Some(expected_type) = opts.expected_type {
3825 query = query.arg("expectedType", expected_type);
3826 }
3827 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3828 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3829 }
3830 query.execute(self.graphql_client.clone()).await
3831 }
3832 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
3835 let query = self.selection.select("exitCode");
3836 query.execute(self.graphql_client.clone()).await
3837 }
3838 pub fn experimental_with_all_gp_us(&self) -> Container {
3842 let query = self.selection.select("experimentalWithAllGPUs");
3843 Container {
3844 proc: self.proc.clone(),
3845 selection: query,
3846 graphql_client: self.graphql_client.clone(),
3847 }
3848 }
3849 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
3857 let mut query = self.selection.select("experimentalWithGPU");
3858 query = query.arg(
3859 "devices",
3860 devices
3861 .into_iter()
3862 .map(|i| i.into())
3863 .collect::<Vec<String>>(),
3864 );
3865 Container {
3866 proc: self.proc.clone(),
3867 selection: query,
3868 graphql_client: self.graphql_client.clone(),
3869 }
3870 }
3871 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
3881 let mut query = self.selection.select("export");
3882 query = query.arg("path", path.into());
3883 query.execute(self.graphql_client.clone()).await
3884 }
3885 pub async fn export_opts(
3895 &self,
3896 path: impl Into<String>,
3897 opts: ContainerExportOpts,
3898 ) -> Result<String, DaggerError> {
3899 let mut query = self.selection.select("export");
3900 query = query.arg("path", path.into());
3901 if let Some(platform_variants) = opts.platform_variants {
3902 query = query.arg("platformVariants", platform_variants);
3903 }
3904 if let Some(forced_compression) = opts.forced_compression {
3905 query = query.arg("forcedCompression", forced_compression);
3906 }
3907 if let Some(media_types) = opts.media_types {
3908 query = query.arg("mediaTypes", media_types);
3909 }
3910 if let Some(expand) = opts.expand {
3911 query = query.arg("expand", expand);
3912 }
3913 query.execute(self.graphql_client.clone()).await
3914 }
3915 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3922 let mut query = self.selection.select("exportImage");
3923 query = query.arg("name", name.into());
3924 query.execute(self.graphql_client.clone()).await
3925 }
3926 pub async fn export_image_opts(
3933 &self,
3934 name: impl Into<String>,
3935 opts: ContainerExportImageOpts,
3936 ) -> Result<Void, DaggerError> {
3937 let mut query = self.selection.select("exportImage");
3938 query = query.arg("name", name.into());
3939 if let Some(platform_variants) = opts.platform_variants {
3940 query = query.arg("platformVariants", platform_variants);
3941 }
3942 if let Some(forced_compression) = opts.forced_compression {
3943 query = query.arg("forcedCompression", forced_compression);
3944 }
3945 if let Some(media_types) = opts.media_types {
3946 query = query.arg("mediaTypes", media_types);
3947 }
3948 query.execute(self.graphql_client.clone()).await
3949 }
3950 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
3953 let query = self.selection.select("exposedPorts");
3954 let query = query.select("id");
3955 let ids: Vec<PortId> = query.execute(self.graphql_client.clone()).await?;
3956 let root = Query {
3957 proc: self.proc.clone(),
3958 selection: crate::querybuilder::query(),
3959 graphql_client: self.graphql_client.clone(),
3960 };
3961 Ok(ids
3962 .into_iter()
3963 .map(|id| root.load_port_from_id(id))
3964 .collect())
3965 }
3966 pub fn file(&self, path: impl Into<String>) -> File {
3974 let mut query = self.selection.select("file");
3975 query = query.arg("path", path.into());
3976 File {
3977 proc: self.proc.clone(),
3978 selection: query,
3979 graphql_client: self.graphql_client.clone(),
3980 }
3981 }
3982 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3990 let mut query = self.selection.select("file");
3991 query = query.arg("path", path.into());
3992 if let Some(expand) = opts.expand {
3993 query = query.arg("expand", expand);
3994 }
3995 File {
3996 proc: self.proc.clone(),
3997 selection: query,
3998 graphql_client: self.graphql_client.clone(),
3999 }
4000 }
4001 pub fn from(&self, address: impl Into<String>) -> Container {
4007 let mut query = self.selection.select("from");
4008 query = query.arg("address", address.into());
4009 Container {
4010 proc: self.proc.clone(),
4011 selection: query,
4012 graphql_client: self.graphql_client.clone(),
4013 }
4014 }
4015 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
4017 let query = self.selection.select("id");
4018 query.execute(self.graphql_client.clone()).await
4019 }
4020 pub async fn image_ref(&self) -> Result<String, DaggerError> {
4022 let query = self.selection.select("imageRef");
4023 query.execute(self.graphql_client.clone()).await
4024 }
4025 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
4032 let mut query = self.selection.select("import");
4033 query = query.arg_lazy(
4034 "source",
4035 Box::new(move || {
4036 let source = source.clone();
4037 Box::pin(async move { source.into_id().await.unwrap().quote() })
4038 }),
4039 );
4040 Container {
4041 proc: self.proc.clone(),
4042 selection: query,
4043 graphql_client: self.graphql_client.clone(),
4044 }
4045 }
4046 pub fn import_opts<'a>(
4053 &self,
4054 source: impl IntoID<FileId>,
4055 opts: ContainerImportOpts<'a>,
4056 ) -> Container {
4057 let mut query = self.selection.select("import");
4058 query = query.arg_lazy(
4059 "source",
4060 Box::new(move || {
4061 let source = source.clone();
4062 Box::pin(async move { source.into_id().await.unwrap().quote() })
4063 }),
4064 );
4065 if let Some(tag) = opts.tag {
4066 query = query.arg("tag", tag);
4067 }
4068 Container {
4069 proc: self.proc.clone(),
4070 selection: query,
4071 graphql_client: self.graphql_client.clone(),
4072 }
4073 }
4074 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
4080 let mut query = self.selection.select("label");
4081 query = query.arg("name", name.into());
4082 query.execute(self.graphql_client.clone()).await
4083 }
4084 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
4086 let query = self.selection.select("labels");
4087 let query = query.select("id");
4088 let ids: Vec<LabelId> = query.execute(self.graphql_client.clone()).await?;
4089 let root = Query {
4090 proc: self.proc.clone(),
4091 selection: crate::querybuilder::query(),
4092 graphql_client: self.graphql_client.clone(),
4093 };
4094 Ok(ids
4095 .into_iter()
4096 .map(|id| root.load_label_from_id(id))
4097 .collect())
4098 }
4099 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
4101 let query = self.selection.select("mounts");
4102 query.execute(self.graphql_client.clone()).await
4103 }
4104 pub async fn platform(&self) -> Result<Platform, DaggerError> {
4106 let query = self.selection.select("platform");
4107 query.execute(self.graphql_client.clone()).await
4108 }
4109 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
4119 let mut query = self.selection.select("publish");
4120 query = query.arg("address", address.into());
4121 query.execute(self.graphql_client.clone()).await
4122 }
4123 pub async fn publish_opts(
4133 &self,
4134 address: impl Into<String>,
4135 opts: ContainerPublishOpts,
4136 ) -> Result<String, DaggerError> {
4137 let mut query = self.selection.select("publish");
4138 query = query.arg("address", address.into());
4139 if let Some(platform_variants) = opts.platform_variants {
4140 query = query.arg("platformVariants", platform_variants);
4141 }
4142 if let Some(forced_compression) = opts.forced_compression {
4143 query = query.arg("forcedCompression", forced_compression);
4144 }
4145 if let Some(media_types) = opts.media_types {
4146 query = query.arg("mediaTypes", media_types);
4147 }
4148 query.execute(self.graphql_client.clone()).await
4149 }
4150 pub fn rootfs(&self) -> Directory {
4152 let query = self.selection.select("rootfs");
4153 Directory {
4154 proc: self.proc.clone(),
4155 selection: query,
4156 graphql_client: self.graphql_client.clone(),
4157 }
4158 }
4159 pub fn stat(&self, path: impl Into<String>) -> Stat {
4166 let mut query = self.selection.select("stat");
4167 query = query.arg("path", path.into());
4168 Stat {
4169 proc: self.proc.clone(),
4170 selection: query,
4171 graphql_client: self.graphql_client.clone(),
4172 }
4173 }
4174 pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
4181 let mut query = self.selection.select("stat");
4182 query = query.arg("path", path.into());
4183 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4184 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4185 }
4186 Stat {
4187 proc: self.proc.clone(),
4188 selection: query,
4189 graphql_client: self.graphql_client.clone(),
4190 }
4191 }
4192 pub async fn stderr(&self) -> Result<String, DaggerError> {
4195 let query = self.selection.select("stderr");
4196 query.execute(self.graphql_client.clone()).await
4197 }
4198 pub async fn stdout(&self) -> Result<String, DaggerError> {
4201 let query = self.selection.select("stdout");
4202 query.execute(self.graphql_client.clone()).await
4203 }
4204 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
4207 let query = self.selection.select("sync");
4208 query.execute(self.graphql_client.clone()).await
4209 }
4210 pub fn terminal(&self) -> Container {
4216 let query = self.selection.select("terminal");
4217 Container {
4218 proc: self.proc.clone(),
4219 selection: query,
4220 graphql_client: self.graphql_client.clone(),
4221 }
4222 }
4223 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
4229 let mut query = self.selection.select("terminal");
4230 if let Some(cmd) = opts.cmd {
4231 query = query.arg("cmd", cmd);
4232 }
4233 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4234 query = query.arg(
4235 "experimentalPrivilegedNesting",
4236 experimental_privileged_nesting,
4237 );
4238 }
4239 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4240 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4241 }
4242 Container {
4243 proc: self.proc.clone(),
4244 selection: query,
4245 graphql_client: self.graphql_client.clone(),
4246 }
4247 }
4248 pub async fn up(&self) -> Result<Void, DaggerError> {
4255 let query = self.selection.select("up");
4256 query.execute(self.graphql_client.clone()).await
4257 }
4258 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
4265 let mut query = self.selection.select("up");
4266 if let Some(random) = opts.random {
4267 query = query.arg("random", random);
4268 }
4269 if let Some(ports) = opts.ports {
4270 query = query.arg("ports", ports);
4271 }
4272 if let Some(args) = opts.args {
4273 query = query.arg("args", args);
4274 }
4275 if let Some(use_entrypoint) = opts.use_entrypoint {
4276 query = query.arg("useEntrypoint", use_entrypoint);
4277 }
4278 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4279 query = query.arg(
4280 "experimentalPrivilegedNesting",
4281 experimental_privileged_nesting,
4282 );
4283 }
4284 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4285 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4286 }
4287 if let Some(expand) = opts.expand {
4288 query = query.arg("expand", expand);
4289 }
4290 if let Some(no_init) = opts.no_init {
4291 query = query.arg("noInit", no_init);
4292 }
4293 query.execute(self.graphql_client.clone()).await
4294 }
4295 pub async fn user(&self) -> Result<String, DaggerError> {
4297 let query = self.selection.select("user");
4298 query.execute(self.graphql_client.clone()).await
4299 }
4300 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4307 let mut query = self.selection.select("withAnnotation");
4308 query = query.arg("name", name.into());
4309 query = query.arg("value", value.into());
4310 Container {
4311 proc: self.proc.clone(),
4312 selection: query,
4313 graphql_client: self.graphql_client.clone(),
4314 }
4315 }
4316 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4322 let mut query = self.selection.select("withDefaultArgs");
4323 query = query.arg(
4324 "args",
4325 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4326 );
4327 Container {
4328 proc: self.proc.clone(),
4329 selection: query,
4330 graphql_client: self.graphql_client.clone(),
4331 }
4332 }
4333 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
4340 let mut query = self.selection.select("withDefaultTerminalCmd");
4341 query = query.arg(
4342 "args",
4343 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4344 );
4345 Container {
4346 proc: self.proc.clone(),
4347 selection: query,
4348 graphql_client: self.graphql_client.clone(),
4349 }
4350 }
4351 pub fn with_default_terminal_cmd_opts(
4358 &self,
4359 args: Vec<impl Into<String>>,
4360 opts: ContainerWithDefaultTerminalCmdOpts,
4361 ) -> Container {
4362 let mut query = self.selection.select("withDefaultTerminalCmd");
4363 query = query.arg(
4364 "args",
4365 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4366 );
4367 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4368 query = query.arg(
4369 "experimentalPrivilegedNesting",
4370 experimental_privileged_nesting,
4371 );
4372 }
4373 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4374 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4375 }
4376 Container {
4377 proc: self.proc.clone(),
4378 selection: query,
4379 graphql_client: self.graphql_client.clone(),
4380 }
4381 }
4382 pub fn with_directory(
4390 &self,
4391 path: impl Into<String>,
4392 source: impl IntoID<DirectoryId>,
4393 ) -> Container {
4394 let mut query = self.selection.select("withDirectory");
4395 query = query.arg("path", path.into());
4396 query = query.arg_lazy(
4397 "source",
4398 Box::new(move || {
4399 let source = source.clone();
4400 Box::pin(async move { source.into_id().await.unwrap().quote() })
4401 }),
4402 );
4403 Container {
4404 proc: self.proc.clone(),
4405 selection: query,
4406 graphql_client: self.graphql_client.clone(),
4407 }
4408 }
4409 pub fn with_directory_opts<'a>(
4417 &self,
4418 path: impl Into<String>,
4419 source: impl IntoID<DirectoryId>,
4420 opts: ContainerWithDirectoryOpts<'a>,
4421 ) -> Container {
4422 let mut query = self.selection.select("withDirectory");
4423 query = query.arg("path", path.into());
4424 query = query.arg_lazy(
4425 "source",
4426 Box::new(move || {
4427 let source = source.clone();
4428 Box::pin(async move { source.into_id().await.unwrap().quote() })
4429 }),
4430 );
4431 if let Some(exclude) = opts.exclude {
4432 query = query.arg("exclude", exclude);
4433 }
4434 if let Some(include) = opts.include {
4435 query = query.arg("include", include);
4436 }
4437 if let Some(gitignore) = opts.gitignore {
4438 query = query.arg("gitignore", gitignore);
4439 }
4440 if let Some(owner) = opts.owner {
4441 query = query.arg("owner", owner);
4442 }
4443 if let Some(expand) = opts.expand {
4444 query = query.arg("expand", expand);
4445 }
4446 if let Some(permissions) = opts.permissions {
4447 query = query.arg("permissions", permissions);
4448 }
4449 Container {
4450 proc: self.proc.clone(),
4451 selection: query,
4452 graphql_client: self.graphql_client.clone(),
4453 }
4454 }
4455 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4462 let mut query = self.selection.select("withDockerHealthcheck");
4463 query = query.arg(
4464 "args",
4465 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4466 );
4467 Container {
4468 proc: self.proc.clone(),
4469 selection: query,
4470 graphql_client: self.graphql_client.clone(),
4471 }
4472 }
4473 pub fn with_docker_healthcheck_opts<'a>(
4480 &self,
4481 args: Vec<impl Into<String>>,
4482 opts: ContainerWithDockerHealthcheckOpts<'a>,
4483 ) -> Container {
4484 let mut query = self.selection.select("withDockerHealthcheck");
4485 query = query.arg(
4486 "args",
4487 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4488 );
4489 if let Some(shell) = opts.shell {
4490 query = query.arg("shell", shell);
4491 }
4492 if let Some(interval) = opts.interval {
4493 query = query.arg("interval", interval);
4494 }
4495 if let Some(timeout) = opts.timeout {
4496 query = query.arg("timeout", timeout);
4497 }
4498 if let Some(start_period) = opts.start_period {
4499 query = query.arg("startPeriod", start_period);
4500 }
4501 if let Some(start_interval) = opts.start_interval {
4502 query = query.arg("startInterval", start_interval);
4503 }
4504 if let Some(retries) = opts.retries {
4505 query = query.arg("retries", retries);
4506 }
4507 Container {
4508 proc: self.proc.clone(),
4509 selection: query,
4510 graphql_client: self.graphql_client.clone(),
4511 }
4512 }
4513 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4520 let mut query = self.selection.select("withEntrypoint");
4521 query = query.arg(
4522 "args",
4523 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4524 );
4525 Container {
4526 proc: self.proc.clone(),
4527 selection: query,
4528 graphql_client: self.graphql_client.clone(),
4529 }
4530 }
4531 pub fn with_entrypoint_opts(
4538 &self,
4539 args: Vec<impl Into<String>>,
4540 opts: ContainerWithEntrypointOpts,
4541 ) -> Container {
4542 let mut query = self.selection.select("withEntrypoint");
4543 query = query.arg(
4544 "args",
4545 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4546 );
4547 if let Some(keep_default_args) = opts.keep_default_args {
4548 query = query.arg("keepDefaultArgs", keep_default_args);
4549 }
4550 Container {
4551 proc: self.proc.clone(),
4552 selection: query,
4553 graphql_client: self.graphql_client.clone(),
4554 }
4555 }
4556 pub fn with_env_file_variables(&self, source: impl IntoID<EnvFileId>) -> Container {
4562 let mut query = self.selection.select("withEnvFileVariables");
4563 query = query.arg_lazy(
4564 "source",
4565 Box::new(move || {
4566 let source = source.clone();
4567 Box::pin(async move { source.into_id().await.unwrap().quote() })
4568 }),
4569 );
4570 Container {
4571 proc: self.proc.clone(),
4572 selection: query,
4573 graphql_client: self.graphql_client.clone(),
4574 }
4575 }
4576 pub fn with_env_variable(
4584 &self,
4585 name: impl Into<String>,
4586 value: impl Into<String>,
4587 ) -> Container {
4588 let mut query = self.selection.select("withEnvVariable");
4589 query = query.arg("name", name.into());
4590 query = query.arg("value", value.into());
4591 Container {
4592 proc: self.proc.clone(),
4593 selection: query,
4594 graphql_client: self.graphql_client.clone(),
4595 }
4596 }
4597 pub fn with_env_variable_opts(
4605 &self,
4606 name: impl Into<String>,
4607 value: impl Into<String>,
4608 opts: ContainerWithEnvVariableOpts,
4609 ) -> Container {
4610 let mut query = self.selection.select("withEnvVariable");
4611 query = query.arg("name", name.into());
4612 query = query.arg("value", value.into());
4613 if let Some(expand) = opts.expand {
4614 query = query.arg("expand", expand);
4615 }
4616 Container {
4617 proc: self.proc.clone(),
4618 selection: query,
4619 graphql_client: self.graphql_client.clone(),
4620 }
4621 }
4622 pub fn with_error(&self, err: impl Into<String>) -> Container {
4628 let mut query = self.selection.select("withError");
4629 query = query.arg("err", err.into());
4630 Container {
4631 proc: self.proc.clone(),
4632 selection: query,
4633 graphql_client: self.graphql_client.clone(),
4634 }
4635 }
4636 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
4647 let mut query = self.selection.select("withExec");
4648 query = query.arg(
4649 "args",
4650 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4651 );
4652 Container {
4653 proc: self.proc.clone(),
4654 selection: query,
4655 graphql_client: self.graphql_client.clone(),
4656 }
4657 }
4658 pub fn with_exec_opts<'a>(
4669 &self,
4670 args: Vec<impl Into<String>>,
4671 opts: ContainerWithExecOpts<'a>,
4672 ) -> Container {
4673 let mut query = self.selection.select("withExec");
4674 query = query.arg(
4675 "args",
4676 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4677 );
4678 if let Some(use_entrypoint) = opts.use_entrypoint {
4679 query = query.arg("useEntrypoint", use_entrypoint);
4680 }
4681 if let Some(stdin) = opts.stdin {
4682 query = query.arg("stdin", stdin);
4683 }
4684 if let Some(redirect_stdin) = opts.redirect_stdin {
4685 query = query.arg("redirectStdin", redirect_stdin);
4686 }
4687 if let Some(redirect_stdout) = opts.redirect_stdout {
4688 query = query.arg("redirectStdout", redirect_stdout);
4689 }
4690 if let Some(redirect_stderr) = opts.redirect_stderr {
4691 query = query.arg("redirectStderr", redirect_stderr);
4692 }
4693 if let Some(expect) = opts.expect {
4694 query = query.arg("expect", expect);
4695 }
4696 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4697 query = query.arg(
4698 "experimentalPrivilegedNesting",
4699 experimental_privileged_nesting,
4700 );
4701 }
4702 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4703 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4704 }
4705 if let Some(expand) = opts.expand {
4706 query = query.arg("expand", expand);
4707 }
4708 if let Some(no_init) = opts.no_init {
4709 query = query.arg("noInit", no_init);
4710 }
4711 Container {
4712 proc: self.proc.clone(),
4713 selection: query,
4714 graphql_client: self.graphql_client.clone(),
4715 }
4716 }
4717 pub fn with_exposed_port(&self, port: isize) -> Container {
4727 let mut query = self.selection.select("withExposedPort");
4728 query = query.arg("port", port);
4729 Container {
4730 proc: self.proc.clone(),
4731 selection: query,
4732 graphql_client: self.graphql_client.clone(),
4733 }
4734 }
4735 pub fn with_exposed_port_opts<'a>(
4745 &self,
4746 port: isize,
4747 opts: ContainerWithExposedPortOpts<'a>,
4748 ) -> Container {
4749 let mut query = self.selection.select("withExposedPort");
4750 query = query.arg("port", port);
4751 if let Some(protocol) = opts.protocol {
4752 query = query.arg("protocol", protocol);
4753 }
4754 if let Some(description) = opts.description {
4755 query = query.arg("description", description);
4756 }
4757 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
4758 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
4759 }
4760 Container {
4761 proc: self.proc.clone(),
4762 selection: query,
4763 graphql_client: self.graphql_client.clone(),
4764 }
4765 }
4766 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
4774 let mut query = self.selection.select("withFile");
4775 query = query.arg("path", path.into());
4776 query = query.arg_lazy(
4777 "source",
4778 Box::new(move || {
4779 let source = source.clone();
4780 Box::pin(async move { source.into_id().await.unwrap().quote() })
4781 }),
4782 );
4783 Container {
4784 proc: self.proc.clone(),
4785 selection: query,
4786 graphql_client: self.graphql_client.clone(),
4787 }
4788 }
4789 pub fn with_file_opts<'a>(
4797 &self,
4798 path: impl Into<String>,
4799 source: impl IntoID<FileId>,
4800 opts: ContainerWithFileOpts<'a>,
4801 ) -> Container {
4802 let mut query = self.selection.select("withFile");
4803 query = query.arg("path", path.into());
4804 query = query.arg_lazy(
4805 "source",
4806 Box::new(move || {
4807 let source = source.clone();
4808 Box::pin(async move { source.into_id().await.unwrap().quote() })
4809 }),
4810 );
4811 if let Some(permissions) = opts.permissions {
4812 query = query.arg("permissions", permissions);
4813 }
4814 if let Some(owner) = opts.owner {
4815 query = query.arg("owner", owner);
4816 }
4817 if let Some(expand) = opts.expand {
4818 query = query.arg("expand", expand);
4819 }
4820 Container {
4821 proc: self.proc.clone(),
4822 selection: query,
4823 graphql_client: self.graphql_client.clone(),
4824 }
4825 }
4826 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
4834 let mut query = self.selection.select("withFiles");
4835 query = query.arg("path", path.into());
4836 query = query.arg("sources", sources);
4837 Container {
4838 proc: self.proc.clone(),
4839 selection: query,
4840 graphql_client: self.graphql_client.clone(),
4841 }
4842 }
4843 pub fn with_files_opts<'a>(
4851 &self,
4852 path: impl Into<String>,
4853 sources: Vec<FileId>,
4854 opts: ContainerWithFilesOpts<'a>,
4855 ) -> Container {
4856 let mut query = self.selection.select("withFiles");
4857 query = query.arg("path", path.into());
4858 query = query.arg("sources", sources);
4859 if let Some(permissions) = opts.permissions {
4860 query = query.arg("permissions", permissions);
4861 }
4862 if let Some(owner) = opts.owner {
4863 query = query.arg("owner", owner);
4864 }
4865 if let Some(expand) = opts.expand {
4866 query = query.arg("expand", expand);
4867 }
4868 Container {
4869 proc: self.proc.clone(),
4870 selection: query,
4871 graphql_client: self.graphql_client.clone(),
4872 }
4873 }
4874 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4881 let mut query = self.selection.select("withLabel");
4882 query = query.arg("name", name.into());
4883 query = query.arg("value", value.into());
4884 Container {
4885 proc: self.proc.clone(),
4886 selection: query,
4887 graphql_client: self.graphql_client.clone(),
4888 }
4889 }
4890 pub fn with_mounted_cache(
4898 &self,
4899 path: impl Into<String>,
4900 cache: impl IntoID<CacheVolumeId>,
4901 ) -> Container {
4902 let mut query = self.selection.select("withMountedCache");
4903 query = query.arg("path", path.into());
4904 query = query.arg_lazy(
4905 "cache",
4906 Box::new(move || {
4907 let cache = cache.clone();
4908 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4909 }),
4910 );
4911 Container {
4912 proc: self.proc.clone(),
4913 selection: query,
4914 graphql_client: self.graphql_client.clone(),
4915 }
4916 }
4917 pub fn with_mounted_cache_opts<'a>(
4925 &self,
4926 path: impl Into<String>,
4927 cache: impl IntoID<CacheVolumeId>,
4928 opts: ContainerWithMountedCacheOpts<'a>,
4929 ) -> Container {
4930 let mut query = self.selection.select("withMountedCache");
4931 query = query.arg("path", path.into());
4932 query = query.arg_lazy(
4933 "cache",
4934 Box::new(move || {
4935 let cache = cache.clone();
4936 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4937 }),
4938 );
4939 if let Some(source) = opts.source {
4940 query = query.arg("source", source);
4941 }
4942 if let Some(sharing) = opts.sharing {
4943 query = query.arg("sharing", sharing);
4944 }
4945 if let Some(owner) = opts.owner {
4946 query = query.arg("owner", owner);
4947 }
4948 if let Some(expand) = opts.expand {
4949 query = query.arg("expand", expand);
4950 }
4951 Container {
4952 proc: self.proc.clone(),
4953 selection: query,
4954 graphql_client: self.graphql_client.clone(),
4955 }
4956 }
4957 pub fn with_mounted_directory(
4965 &self,
4966 path: impl Into<String>,
4967 source: impl IntoID<DirectoryId>,
4968 ) -> Container {
4969 let mut query = self.selection.select("withMountedDirectory");
4970 query = query.arg("path", path.into());
4971 query = query.arg_lazy(
4972 "source",
4973 Box::new(move || {
4974 let source = source.clone();
4975 Box::pin(async move { source.into_id().await.unwrap().quote() })
4976 }),
4977 );
4978 Container {
4979 proc: self.proc.clone(),
4980 selection: query,
4981 graphql_client: self.graphql_client.clone(),
4982 }
4983 }
4984 pub fn with_mounted_directory_opts<'a>(
4992 &self,
4993 path: impl Into<String>,
4994 source: impl IntoID<DirectoryId>,
4995 opts: ContainerWithMountedDirectoryOpts<'a>,
4996 ) -> Container {
4997 let mut query = self.selection.select("withMountedDirectory");
4998 query = query.arg("path", path.into());
4999 query = query.arg_lazy(
5000 "source",
5001 Box::new(move || {
5002 let source = source.clone();
5003 Box::pin(async move { source.into_id().await.unwrap().quote() })
5004 }),
5005 );
5006 if let Some(owner) = opts.owner {
5007 query = query.arg("owner", owner);
5008 }
5009 if let Some(read_only) = opts.read_only {
5010 query = query.arg("readOnly", read_only);
5011 }
5012 if let Some(expand) = opts.expand {
5013 query = query.arg("expand", expand);
5014 }
5015 Container {
5016 proc: self.proc.clone(),
5017 selection: query,
5018 graphql_client: self.graphql_client.clone(),
5019 }
5020 }
5021 pub fn with_mounted_file(
5029 &self,
5030 path: impl Into<String>,
5031 source: impl IntoID<FileId>,
5032 ) -> Container {
5033 let mut query = self.selection.select("withMountedFile");
5034 query = query.arg("path", path.into());
5035 query = query.arg_lazy(
5036 "source",
5037 Box::new(move || {
5038 let source = source.clone();
5039 Box::pin(async move { source.into_id().await.unwrap().quote() })
5040 }),
5041 );
5042 Container {
5043 proc: self.proc.clone(),
5044 selection: query,
5045 graphql_client: self.graphql_client.clone(),
5046 }
5047 }
5048 pub fn with_mounted_file_opts<'a>(
5056 &self,
5057 path: impl Into<String>,
5058 source: impl IntoID<FileId>,
5059 opts: ContainerWithMountedFileOpts<'a>,
5060 ) -> Container {
5061 let mut query = self.selection.select("withMountedFile");
5062 query = query.arg("path", path.into());
5063 query = query.arg_lazy(
5064 "source",
5065 Box::new(move || {
5066 let source = source.clone();
5067 Box::pin(async move { source.into_id().await.unwrap().quote() })
5068 }),
5069 );
5070 if let Some(owner) = opts.owner {
5071 query = query.arg("owner", owner);
5072 }
5073 if let Some(expand) = opts.expand {
5074 query = query.arg("expand", expand);
5075 }
5076 Container {
5077 proc: self.proc.clone(),
5078 selection: query,
5079 graphql_client: self.graphql_client.clone(),
5080 }
5081 }
5082 pub fn with_mounted_secret(
5090 &self,
5091 path: impl Into<String>,
5092 source: impl IntoID<SecretId>,
5093 ) -> Container {
5094 let mut query = self.selection.select("withMountedSecret");
5095 query = query.arg("path", path.into());
5096 query = query.arg_lazy(
5097 "source",
5098 Box::new(move || {
5099 let source = source.clone();
5100 Box::pin(async move { source.into_id().await.unwrap().quote() })
5101 }),
5102 );
5103 Container {
5104 proc: self.proc.clone(),
5105 selection: query,
5106 graphql_client: self.graphql_client.clone(),
5107 }
5108 }
5109 pub fn with_mounted_secret_opts<'a>(
5117 &self,
5118 path: impl Into<String>,
5119 source: impl IntoID<SecretId>,
5120 opts: ContainerWithMountedSecretOpts<'a>,
5121 ) -> Container {
5122 let mut query = self.selection.select("withMountedSecret");
5123 query = query.arg("path", path.into());
5124 query = query.arg_lazy(
5125 "source",
5126 Box::new(move || {
5127 let source = source.clone();
5128 Box::pin(async move { source.into_id().await.unwrap().quote() })
5129 }),
5130 );
5131 if let Some(owner) = opts.owner {
5132 query = query.arg("owner", owner);
5133 }
5134 if let Some(mode) = opts.mode {
5135 query = query.arg("mode", mode);
5136 }
5137 if let Some(expand) = opts.expand {
5138 query = query.arg("expand", expand);
5139 }
5140 Container {
5141 proc: self.proc.clone(),
5142 selection: query,
5143 graphql_client: self.graphql_client.clone(),
5144 }
5145 }
5146 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
5153 let mut query = self.selection.select("withMountedTemp");
5154 query = query.arg("path", path.into());
5155 Container {
5156 proc: self.proc.clone(),
5157 selection: query,
5158 graphql_client: self.graphql_client.clone(),
5159 }
5160 }
5161 pub fn with_mounted_temp_opts(
5168 &self,
5169 path: impl Into<String>,
5170 opts: ContainerWithMountedTempOpts,
5171 ) -> Container {
5172 let mut query = self.selection.select("withMountedTemp");
5173 query = query.arg("path", path.into());
5174 if let Some(size) = opts.size {
5175 query = query.arg("size", size);
5176 }
5177 if let Some(expand) = opts.expand {
5178 query = query.arg("expand", expand);
5179 }
5180 Container {
5181 proc: self.proc.clone(),
5182 selection: query,
5183 graphql_client: self.graphql_client.clone(),
5184 }
5185 }
5186 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
5194 let mut query = self.selection.select("withNewFile");
5195 query = query.arg("path", path.into());
5196 query = query.arg("contents", contents.into());
5197 Container {
5198 proc: self.proc.clone(),
5199 selection: query,
5200 graphql_client: self.graphql_client.clone(),
5201 }
5202 }
5203 pub fn with_new_file_opts<'a>(
5211 &self,
5212 path: impl Into<String>,
5213 contents: impl Into<String>,
5214 opts: ContainerWithNewFileOpts<'a>,
5215 ) -> Container {
5216 let mut query = self.selection.select("withNewFile");
5217 query = query.arg("path", path.into());
5218 query = query.arg("contents", contents.into());
5219 if let Some(permissions) = opts.permissions {
5220 query = query.arg("permissions", permissions);
5221 }
5222 if let Some(owner) = opts.owner {
5223 query = query.arg("owner", owner);
5224 }
5225 if let Some(expand) = opts.expand {
5226 query = query.arg("expand", expand);
5227 }
5228 Container {
5229 proc: self.proc.clone(),
5230 selection: query,
5231 graphql_client: self.graphql_client.clone(),
5232 }
5233 }
5234 pub fn with_registry_auth(
5242 &self,
5243 address: impl Into<String>,
5244 username: impl Into<String>,
5245 secret: impl IntoID<SecretId>,
5246 ) -> Container {
5247 let mut query = self.selection.select("withRegistryAuth");
5248 query = query.arg("address", address.into());
5249 query = query.arg("username", username.into());
5250 query = query.arg_lazy(
5251 "secret",
5252 Box::new(move || {
5253 let secret = secret.clone();
5254 Box::pin(async move { secret.into_id().await.unwrap().quote() })
5255 }),
5256 );
5257 Container {
5258 proc: self.proc.clone(),
5259 selection: query,
5260 graphql_client: self.graphql_client.clone(),
5261 }
5262 }
5263 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
5269 let mut query = self.selection.select("withRootfs");
5270 query = query.arg_lazy(
5271 "directory",
5272 Box::new(move || {
5273 let directory = directory.clone();
5274 Box::pin(async move { directory.into_id().await.unwrap().quote() })
5275 }),
5276 );
5277 Container {
5278 proc: self.proc.clone(),
5279 selection: query,
5280 graphql_client: self.graphql_client.clone(),
5281 }
5282 }
5283 pub fn with_secret_variable(
5290 &self,
5291 name: impl Into<String>,
5292 secret: impl IntoID<SecretId>,
5293 ) -> Container {
5294 let mut query = self.selection.select("withSecretVariable");
5295 query = query.arg("name", name.into());
5296 query = query.arg_lazy(
5297 "secret",
5298 Box::new(move || {
5299 let secret = secret.clone();
5300 Box::pin(async move { secret.into_id().await.unwrap().quote() })
5301 }),
5302 );
5303 Container {
5304 proc: self.proc.clone(),
5305 selection: query,
5306 graphql_client: self.graphql_client.clone(),
5307 }
5308 }
5309 pub fn with_service_binding(
5319 &self,
5320 alias: impl Into<String>,
5321 service: impl IntoID<ServiceId>,
5322 ) -> Container {
5323 let mut query = self.selection.select("withServiceBinding");
5324 query = query.arg("alias", alias.into());
5325 query = query.arg_lazy(
5326 "service",
5327 Box::new(move || {
5328 let service = service.clone();
5329 Box::pin(async move { service.into_id().await.unwrap().quote() })
5330 }),
5331 );
5332 Container {
5333 proc: self.proc.clone(),
5334 selection: query,
5335 graphql_client: self.graphql_client.clone(),
5336 }
5337 }
5338 pub fn with_symlink(
5346 &self,
5347 target: impl Into<String>,
5348 link_name: impl Into<String>,
5349 ) -> Container {
5350 let mut query = self.selection.select("withSymlink");
5351 query = query.arg("target", target.into());
5352 query = query.arg("linkName", link_name.into());
5353 Container {
5354 proc: self.proc.clone(),
5355 selection: query,
5356 graphql_client: self.graphql_client.clone(),
5357 }
5358 }
5359 pub fn with_symlink_opts(
5367 &self,
5368 target: impl Into<String>,
5369 link_name: impl Into<String>,
5370 opts: ContainerWithSymlinkOpts,
5371 ) -> Container {
5372 let mut query = self.selection.select("withSymlink");
5373 query = query.arg("target", target.into());
5374 query = query.arg("linkName", link_name.into());
5375 if let Some(expand) = opts.expand {
5376 query = query.arg("expand", expand);
5377 }
5378 Container {
5379 proc: self.proc.clone(),
5380 selection: query,
5381 graphql_client: self.graphql_client.clone(),
5382 }
5383 }
5384 pub fn with_unix_socket(
5392 &self,
5393 path: impl Into<String>,
5394 source: impl IntoID<SocketId>,
5395 ) -> Container {
5396 let mut query = self.selection.select("withUnixSocket");
5397 query = query.arg("path", path.into());
5398 query = query.arg_lazy(
5399 "source",
5400 Box::new(move || {
5401 let source = source.clone();
5402 Box::pin(async move { source.into_id().await.unwrap().quote() })
5403 }),
5404 );
5405 Container {
5406 proc: self.proc.clone(),
5407 selection: query,
5408 graphql_client: self.graphql_client.clone(),
5409 }
5410 }
5411 pub fn with_unix_socket_opts<'a>(
5419 &self,
5420 path: impl Into<String>,
5421 source: impl IntoID<SocketId>,
5422 opts: ContainerWithUnixSocketOpts<'a>,
5423 ) -> Container {
5424 let mut query = self.selection.select("withUnixSocket");
5425 query = query.arg("path", path.into());
5426 query = query.arg_lazy(
5427 "source",
5428 Box::new(move || {
5429 let source = source.clone();
5430 Box::pin(async move { source.into_id().await.unwrap().quote() })
5431 }),
5432 );
5433 if let Some(owner) = opts.owner {
5434 query = query.arg("owner", owner);
5435 }
5436 if let Some(expand) = opts.expand {
5437 query = query.arg("expand", expand);
5438 }
5439 Container {
5440 proc: self.proc.clone(),
5441 selection: query,
5442 graphql_client: self.graphql_client.clone(),
5443 }
5444 }
5445 pub fn with_user(&self, name: impl Into<String>) -> Container {
5451 let mut query = self.selection.select("withUser");
5452 query = query.arg("name", name.into());
5453 Container {
5454 proc: self.proc.clone(),
5455 selection: query,
5456 graphql_client: self.graphql_client.clone(),
5457 }
5458 }
5459 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
5466 let mut query = self.selection.select("withWorkdir");
5467 query = query.arg("path", path.into());
5468 Container {
5469 proc: self.proc.clone(),
5470 selection: query,
5471 graphql_client: self.graphql_client.clone(),
5472 }
5473 }
5474 pub fn with_workdir_opts(
5481 &self,
5482 path: impl Into<String>,
5483 opts: ContainerWithWorkdirOpts,
5484 ) -> Container {
5485 let mut query = self.selection.select("withWorkdir");
5486 query = query.arg("path", path.into());
5487 if let Some(expand) = opts.expand {
5488 query = query.arg("expand", expand);
5489 }
5490 Container {
5491 proc: self.proc.clone(),
5492 selection: query,
5493 graphql_client: self.graphql_client.clone(),
5494 }
5495 }
5496 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5502 let mut query = self.selection.select("withoutAnnotation");
5503 query = query.arg("name", name.into());
5504 Container {
5505 proc: self.proc.clone(),
5506 selection: query,
5507 graphql_client: self.graphql_client.clone(),
5508 }
5509 }
5510 pub fn without_default_args(&self) -> Container {
5512 let query = self.selection.select("withoutDefaultArgs");
5513 Container {
5514 proc: self.proc.clone(),
5515 selection: query,
5516 graphql_client: self.graphql_client.clone(),
5517 }
5518 }
5519 pub fn without_directory(&self, path: impl Into<String>) -> Container {
5526 let mut query = self.selection.select("withoutDirectory");
5527 query = query.arg("path", path.into());
5528 Container {
5529 proc: self.proc.clone(),
5530 selection: query,
5531 graphql_client: self.graphql_client.clone(),
5532 }
5533 }
5534 pub fn without_directory_opts(
5541 &self,
5542 path: impl Into<String>,
5543 opts: ContainerWithoutDirectoryOpts,
5544 ) -> Container {
5545 let mut query = self.selection.select("withoutDirectory");
5546 query = query.arg("path", path.into());
5547 if let Some(expand) = opts.expand {
5548 query = query.arg("expand", expand);
5549 }
5550 Container {
5551 proc: self.proc.clone(),
5552 selection: query,
5553 graphql_client: self.graphql_client.clone(),
5554 }
5555 }
5556 pub fn without_docker_healthcheck(&self) -> Container {
5558 let query = self.selection.select("withoutDockerHealthcheck");
5559 Container {
5560 proc: self.proc.clone(),
5561 selection: query,
5562 graphql_client: self.graphql_client.clone(),
5563 }
5564 }
5565 pub fn without_entrypoint(&self) -> Container {
5571 let query = self.selection.select("withoutEntrypoint");
5572 Container {
5573 proc: self.proc.clone(),
5574 selection: query,
5575 graphql_client: self.graphql_client.clone(),
5576 }
5577 }
5578 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
5584 let mut query = self.selection.select("withoutEntrypoint");
5585 if let Some(keep_default_args) = opts.keep_default_args {
5586 query = query.arg("keepDefaultArgs", keep_default_args);
5587 }
5588 Container {
5589 proc: self.proc.clone(),
5590 selection: query,
5591 graphql_client: self.graphql_client.clone(),
5592 }
5593 }
5594 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
5600 let mut query = self.selection.select("withoutEnvVariable");
5601 query = query.arg("name", name.into());
5602 Container {
5603 proc: self.proc.clone(),
5604 selection: query,
5605 graphql_client: self.graphql_client.clone(),
5606 }
5607 }
5608 pub fn without_exposed_port(&self, port: isize) -> Container {
5615 let mut query = self.selection.select("withoutExposedPort");
5616 query = query.arg("port", port);
5617 Container {
5618 proc: self.proc.clone(),
5619 selection: query,
5620 graphql_client: self.graphql_client.clone(),
5621 }
5622 }
5623 pub fn without_exposed_port_opts(
5630 &self,
5631 port: isize,
5632 opts: ContainerWithoutExposedPortOpts,
5633 ) -> Container {
5634 let mut query = self.selection.select("withoutExposedPort");
5635 query = query.arg("port", port);
5636 if let Some(protocol) = opts.protocol {
5637 query = query.arg("protocol", protocol);
5638 }
5639 Container {
5640 proc: self.proc.clone(),
5641 selection: query,
5642 graphql_client: self.graphql_client.clone(),
5643 }
5644 }
5645 pub fn without_file(&self, path: impl Into<String>) -> Container {
5652 let mut query = self.selection.select("withoutFile");
5653 query = query.arg("path", path.into());
5654 Container {
5655 proc: self.proc.clone(),
5656 selection: query,
5657 graphql_client: self.graphql_client.clone(),
5658 }
5659 }
5660 pub fn without_file_opts(
5667 &self,
5668 path: impl Into<String>,
5669 opts: ContainerWithoutFileOpts,
5670 ) -> Container {
5671 let mut query = self.selection.select("withoutFile");
5672 query = query.arg("path", path.into());
5673 if let Some(expand) = opts.expand {
5674 query = query.arg("expand", expand);
5675 }
5676 Container {
5677 proc: self.proc.clone(),
5678 selection: query,
5679 graphql_client: self.graphql_client.clone(),
5680 }
5681 }
5682 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
5689 let mut query = self.selection.select("withoutFiles");
5690 query = query.arg(
5691 "paths",
5692 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5693 );
5694 Container {
5695 proc: self.proc.clone(),
5696 selection: query,
5697 graphql_client: self.graphql_client.clone(),
5698 }
5699 }
5700 pub fn without_files_opts(
5707 &self,
5708 paths: Vec<impl Into<String>>,
5709 opts: ContainerWithoutFilesOpts,
5710 ) -> Container {
5711 let mut query = self.selection.select("withoutFiles");
5712 query = query.arg(
5713 "paths",
5714 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5715 );
5716 if let Some(expand) = opts.expand {
5717 query = query.arg("expand", expand);
5718 }
5719 Container {
5720 proc: self.proc.clone(),
5721 selection: query,
5722 graphql_client: self.graphql_client.clone(),
5723 }
5724 }
5725 pub fn without_label(&self, name: impl Into<String>) -> Container {
5731 let mut query = self.selection.select("withoutLabel");
5732 query = query.arg("name", name.into());
5733 Container {
5734 proc: self.proc.clone(),
5735 selection: query,
5736 graphql_client: self.graphql_client.clone(),
5737 }
5738 }
5739 pub fn without_mount(&self, path: impl Into<String>) -> Container {
5746 let mut query = self.selection.select("withoutMount");
5747 query = query.arg("path", path.into());
5748 Container {
5749 proc: self.proc.clone(),
5750 selection: query,
5751 graphql_client: self.graphql_client.clone(),
5752 }
5753 }
5754 pub fn without_mount_opts(
5761 &self,
5762 path: impl Into<String>,
5763 opts: ContainerWithoutMountOpts,
5764 ) -> Container {
5765 let mut query = self.selection.select("withoutMount");
5766 query = query.arg("path", path.into());
5767 if let Some(expand) = opts.expand {
5768 query = query.arg("expand", expand);
5769 }
5770 Container {
5771 proc: self.proc.clone(),
5772 selection: query,
5773 graphql_client: self.graphql_client.clone(),
5774 }
5775 }
5776 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5784 let mut query = self.selection.select("withoutRegistryAuth");
5785 query = query.arg("address", address.into());
5786 Container {
5787 proc: self.proc.clone(),
5788 selection: query,
5789 graphql_client: self.graphql_client.clone(),
5790 }
5791 }
5792 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
5798 let mut query = self.selection.select("withoutSecretVariable");
5799 query = query.arg("name", name.into());
5800 Container {
5801 proc: self.proc.clone(),
5802 selection: query,
5803 graphql_client: self.graphql_client.clone(),
5804 }
5805 }
5806 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
5813 let mut query = self.selection.select("withoutUnixSocket");
5814 query = query.arg("path", path.into());
5815 Container {
5816 proc: self.proc.clone(),
5817 selection: query,
5818 graphql_client: self.graphql_client.clone(),
5819 }
5820 }
5821 pub fn without_unix_socket_opts(
5828 &self,
5829 path: impl Into<String>,
5830 opts: ContainerWithoutUnixSocketOpts,
5831 ) -> Container {
5832 let mut query = self.selection.select("withoutUnixSocket");
5833 query = query.arg("path", path.into());
5834 if let Some(expand) = opts.expand {
5835 query = query.arg("expand", expand);
5836 }
5837 Container {
5838 proc: self.proc.clone(),
5839 selection: query,
5840 graphql_client: self.graphql_client.clone(),
5841 }
5842 }
5843 pub fn without_user(&self) -> Container {
5846 let query = self.selection.select("withoutUser");
5847 Container {
5848 proc: self.proc.clone(),
5849 selection: query,
5850 graphql_client: self.graphql_client.clone(),
5851 }
5852 }
5853 pub fn without_workdir(&self) -> Container {
5856 let query = self.selection.select("withoutWorkdir");
5857 Container {
5858 proc: self.proc.clone(),
5859 selection: query,
5860 graphql_client: self.graphql_client.clone(),
5861 }
5862 }
5863 pub async fn workdir(&self) -> Result<String, DaggerError> {
5865 let query = self.selection.select("workdir");
5866 query.execute(self.graphql_client.clone()).await
5867 }
5868}
5869#[derive(Clone)]
5870pub struct CurrentModule {
5871 pub proc: Option<Arc<DaggerSessionProc>>,
5872 pub selection: Selection,
5873 pub graphql_client: DynGraphQLClient,
5874}
5875#[derive(Builder, Debug, PartialEq)]
5876pub struct CurrentModuleGeneratorsOpts<'a> {
5877 #[builder(setter(into, strip_option), default)]
5879 pub include: Option<Vec<&'a str>>,
5880}
5881#[derive(Builder, Debug, PartialEq)]
5882pub struct CurrentModuleWorkdirOpts<'a> {
5883 #[builder(setter(into, strip_option), default)]
5885 pub exclude: Option<Vec<&'a str>>,
5886 #[builder(setter(into, strip_option), default)]
5888 pub gitignore: Option<bool>,
5889 #[builder(setter(into, strip_option), default)]
5891 pub include: Option<Vec<&'a str>>,
5892}
5893impl CurrentModule {
5894 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
5896 let query = self.selection.select("dependencies");
5897 let query = query.select("id");
5898 let ids: Vec<ModuleId> = query.execute(self.graphql_client.clone()).await?;
5899 let root = Query {
5900 proc: self.proc.clone(),
5901 selection: crate::querybuilder::query(),
5902 graphql_client: self.graphql_client.clone(),
5903 };
5904 Ok(ids
5905 .into_iter()
5906 .map(|id| root.load_module_from_id(id))
5907 .collect())
5908 }
5909 pub fn generated_context_directory(&self) -> Directory {
5911 let query = self.selection.select("generatedContextDirectory");
5912 Directory {
5913 proc: self.proc.clone(),
5914 selection: query,
5915 graphql_client: self.graphql_client.clone(),
5916 }
5917 }
5918 pub fn generators(&self) -> GeneratorGroup {
5924 let query = self.selection.select("generators");
5925 GeneratorGroup {
5926 proc: self.proc.clone(),
5927 selection: query,
5928 graphql_client: self.graphql_client.clone(),
5929 }
5930 }
5931 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
5937 let mut query = self.selection.select("generators");
5938 if let Some(include) = opts.include {
5939 query = query.arg("include", include);
5940 }
5941 GeneratorGroup {
5942 proc: self.proc.clone(),
5943 selection: query,
5944 graphql_client: self.graphql_client.clone(),
5945 }
5946 }
5947 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
5949 let query = self.selection.select("id");
5950 query.execute(self.graphql_client.clone()).await
5951 }
5952 pub async fn name(&self) -> Result<String, DaggerError> {
5954 let query = self.selection.select("name");
5955 query.execute(self.graphql_client.clone()).await
5956 }
5957 pub fn source(&self) -> Directory {
5959 let query = self.selection.select("source");
5960 Directory {
5961 proc: self.proc.clone(),
5962 selection: query,
5963 graphql_client: self.graphql_client.clone(),
5964 }
5965 }
5966 pub fn workdir(&self, path: impl Into<String>) -> Directory {
5973 let mut query = self.selection.select("workdir");
5974 query = query.arg("path", path.into());
5975 Directory {
5976 proc: self.proc.clone(),
5977 selection: query,
5978 graphql_client: self.graphql_client.clone(),
5979 }
5980 }
5981 pub fn workdir_opts<'a>(
5988 &self,
5989 path: impl Into<String>,
5990 opts: CurrentModuleWorkdirOpts<'a>,
5991 ) -> Directory {
5992 let mut query = self.selection.select("workdir");
5993 query = query.arg("path", path.into());
5994 if let Some(exclude) = opts.exclude {
5995 query = query.arg("exclude", exclude);
5996 }
5997 if let Some(include) = opts.include {
5998 query = query.arg("include", include);
5999 }
6000 if let Some(gitignore) = opts.gitignore {
6001 query = query.arg("gitignore", gitignore);
6002 }
6003 Directory {
6004 proc: self.proc.clone(),
6005 selection: query,
6006 graphql_client: self.graphql_client.clone(),
6007 }
6008 }
6009 pub fn workdir_file(&self, path: impl Into<String>) -> File {
6015 let mut query = self.selection.select("workdirFile");
6016 query = query.arg("path", path.into());
6017 File {
6018 proc: self.proc.clone(),
6019 selection: query,
6020 graphql_client: self.graphql_client.clone(),
6021 }
6022 }
6023}
6024#[derive(Clone)]
6025pub struct DiffStat {
6026 pub proc: Option<Arc<DaggerSessionProc>>,
6027 pub selection: Selection,
6028 pub graphql_client: DynGraphQLClient,
6029}
6030impl DiffStat {
6031 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6033 let query = self.selection.select("addedLines");
6034 query.execute(self.graphql_client.clone()).await
6035 }
6036 pub async fn id(&self) -> Result<DiffStatId, DaggerError> {
6038 let query = self.selection.select("id");
6039 query.execute(self.graphql_client.clone()).await
6040 }
6041 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6043 let query = self.selection.select("kind");
6044 query.execute(self.graphql_client.clone()).await
6045 }
6046 pub async fn old_path(&self) -> Result<String, DaggerError> {
6048 let query = self.selection.select("oldPath");
6049 query.execute(self.graphql_client.clone()).await
6050 }
6051 pub async fn path(&self) -> Result<String, DaggerError> {
6053 let query = self.selection.select("path");
6054 query.execute(self.graphql_client.clone()).await
6055 }
6056 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6058 let query = self.selection.select("removedLines");
6059 query.execute(self.graphql_client.clone()).await
6060 }
6061}
6062#[derive(Clone)]
6063pub struct Directory {
6064 pub proc: Option<Arc<DaggerSessionProc>>,
6065 pub selection: Selection,
6066 pub graphql_client: DynGraphQLClient,
6067}
6068#[derive(Builder, Debug, PartialEq)]
6069pub struct DirectoryAsModuleOpts<'a> {
6070 #[builder(setter(into, strip_option), default)]
6073 pub source_root_path: Option<&'a str>,
6074}
6075#[derive(Builder, Debug, PartialEq)]
6076pub struct DirectoryAsModuleSourceOpts<'a> {
6077 #[builder(setter(into, strip_option), default)]
6080 pub source_root_path: Option<&'a str>,
6081}
6082#[derive(Builder, Debug, PartialEq)]
6083pub struct DirectoryDockerBuildOpts<'a> {
6084 #[builder(setter(into, strip_option), default)]
6086 pub build_args: Option<Vec<BuildArg>>,
6087 #[builder(setter(into, strip_option), default)]
6089 pub dockerfile: Option<&'a str>,
6090 #[builder(setter(into, strip_option), default)]
6093 pub no_init: Option<bool>,
6094 #[builder(setter(into, strip_option), default)]
6096 pub platform: Option<Platform>,
6097 #[builder(setter(into, strip_option), default)]
6100 pub secrets: Option<Vec<SecretId>>,
6101 #[builder(setter(into, strip_option), default)]
6105 pub ssh: Option<SocketId>,
6106 #[builder(setter(into, strip_option), default)]
6108 pub target: Option<&'a str>,
6109}
6110#[derive(Builder, Debug, PartialEq)]
6111pub struct DirectoryEntriesOpts<'a> {
6112 #[builder(setter(into, strip_option), default)]
6114 pub path: Option<&'a str>,
6115}
6116#[derive(Builder, Debug, PartialEq)]
6117pub struct DirectoryExistsOpts {
6118 #[builder(setter(into, strip_option), default)]
6120 pub do_not_follow_symlinks: Option<bool>,
6121 #[builder(setter(into, strip_option), default)]
6123 pub expected_type: Option<ExistsType>,
6124}
6125#[derive(Builder, Debug, PartialEq)]
6126pub struct DirectoryExportOpts {
6127 #[builder(setter(into, strip_option), default)]
6129 pub wipe: Option<bool>,
6130}
6131#[derive(Builder, Debug, PartialEq)]
6132pub struct DirectoryFilterOpts<'a> {
6133 #[builder(setter(into, strip_option), default)]
6135 pub exclude: Option<Vec<&'a str>>,
6136 #[builder(setter(into, strip_option), default)]
6138 pub gitignore: Option<bool>,
6139 #[builder(setter(into, strip_option), default)]
6141 pub include: Option<Vec<&'a str>>,
6142}
6143#[derive(Builder, Debug, PartialEq)]
6144pub struct DirectorySearchOpts<'a> {
6145 #[builder(setter(into, strip_option), default)]
6147 pub dotall: Option<bool>,
6148 #[builder(setter(into, strip_option), default)]
6150 pub files_only: Option<bool>,
6151 #[builder(setter(into, strip_option), default)]
6153 pub globs: Option<Vec<&'a str>>,
6154 #[builder(setter(into, strip_option), default)]
6156 pub insensitive: Option<bool>,
6157 #[builder(setter(into, strip_option), default)]
6159 pub limit: Option<isize>,
6160 #[builder(setter(into, strip_option), default)]
6162 pub literal: Option<bool>,
6163 #[builder(setter(into, strip_option), default)]
6165 pub multiline: Option<bool>,
6166 #[builder(setter(into, strip_option), default)]
6168 pub paths: Option<Vec<&'a str>>,
6169 #[builder(setter(into, strip_option), default)]
6171 pub skip_hidden: Option<bool>,
6172 #[builder(setter(into, strip_option), default)]
6174 pub skip_ignored: Option<bool>,
6175}
6176#[derive(Builder, Debug, PartialEq)]
6177pub struct DirectoryStatOpts {
6178 #[builder(setter(into, strip_option), default)]
6180 pub do_not_follow_symlinks: Option<bool>,
6181}
6182#[derive(Builder, Debug, PartialEq)]
6183pub struct DirectoryTerminalOpts<'a> {
6184 #[builder(setter(into, strip_option), default)]
6186 pub cmd: Option<Vec<&'a str>>,
6187 #[builder(setter(into, strip_option), default)]
6189 pub container: Option<ContainerId>,
6190 #[builder(setter(into, strip_option), default)]
6192 pub experimental_privileged_nesting: Option<bool>,
6193 #[builder(setter(into, strip_option), default)]
6195 pub insecure_root_capabilities: Option<bool>,
6196}
6197#[derive(Builder, Debug, PartialEq)]
6198pub struct DirectoryWithDirectoryOpts<'a> {
6199 #[builder(setter(into, strip_option), default)]
6201 pub exclude: Option<Vec<&'a str>>,
6202 #[builder(setter(into, strip_option), default)]
6204 pub gitignore: Option<bool>,
6205 #[builder(setter(into, strip_option), default)]
6207 pub include: Option<Vec<&'a str>>,
6208 #[builder(setter(into, strip_option), default)]
6212 pub owner: Option<&'a str>,
6213 #[builder(setter(into, strip_option), default)]
6215 pub permissions: Option<isize>,
6216}
6217#[derive(Builder, Debug, PartialEq)]
6218pub struct DirectoryWithFileOpts<'a> {
6219 #[builder(setter(into, strip_option), default)]
6223 pub owner: Option<&'a str>,
6224 #[builder(setter(into, strip_option), default)]
6226 pub permissions: Option<isize>,
6227}
6228#[derive(Builder, Debug, PartialEq)]
6229pub struct DirectoryWithFilesOpts {
6230 #[builder(setter(into, strip_option), default)]
6232 pub permissions: Option<isize>,
6233}
6234#[derive(Builder, Debug, PartialEq)]
6235pub struct DirectoryWithNewDirectoryOpts {
6236 #[builder(setter(into, strip_option), default)]
6238 pub permissions: Option<isize>,
6239}
6240#[derive(Builder, Debug, PartialEq)]
6241pub struct DirectoryWithNewFileOpts {
6242 #[builder(setter(into, strip_option), default)]
6244 pub permissions: Option<isize>,
6245}
6246impl Directory {
6247 pub fn as_git(&self) -> GitRepository {
6249 let query = self.selection.select("asGit");
6250 GitRepository {
6251 proc: self.proc.clone(),
6252 selection: query,
6253 graphql_client: self.graphql_client.clone(),
6254 }
6255 }
6256 pub fn as_module(&self) -> Module {
6262 let query = self.selection.select("asModule");
6263 Module {
6264 proc: self.proc.clone(),
6265 selection: query,
6266 graphql_client: self.graphql_client.clone(),
6267 }
6268 }
6269 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
6275 let mut query = self.selection.select("asModule");
6276 if let Some(source_root_path) = opts.source_root_path {
6277 query = query.arg("sourceRootPath", source_root_path);
6278 }
6279 Module {
6280 proc: self.proc.clone(),
6281 selection: query,
6282 graphql_client: self.graphql_client.clone(),
6283 }
6284 }
6285 pub fn as_module_source(&self) -> ModuleSource {
6291 let query = self.selection.select("asModuleSource");
6292 ModuleSource {
6293 proc: self.proc.clone(),
6294 selection: query,
6295 graphql_client: self.graphql_client.clone(),
6296 }
6297 }
6298 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
6304 let mut query = self.selection.select("asModuleSource");
6305 if let Some(source_root_path) = opts.source_root_path {
6306 query = query.arg("sourceRootPath", source_root_path);
6307 }
6308 ModuleSource {
6309 proc: self.proc.clone(),
6310 selection: query,
6311 graphql_client: self.graphql_client.clone(),
6312 }
6313 }
6314 pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
6321 let mut query = self.selection.select("changes");
6322 query = query.arg_lazy(
6323 "from",
6324 Box::new(move || {
6325 let from = from.clone();
6326 Box::pin(async move { from.into_id().await.unwrap().quote() })
6327 }),
6328 );
6329 Changeset {
6330 proc: self.proc.clone(),
6331 selection: query,
6332 graphql_client: self.graphql_client.clone(),
6333 }
6334 }
6335 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
6346 let mut query = self.selection.select("chown");
6347 query = query.arg("path", path.into());
6348 query = query.arg("owner", owner.into());
6349 Directory {
6350 proc: self.proc.clone(),
6351 selection: query,
6352 graphql_client: self.graphql_client.clone(),
6353 }
6354 }
6355 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
6361 let mut query = self.selection.select("diff");
6362 query = query.arg_lazy(
6363 "other",
6364 Box::new(move || {
6365 let other = other.clone();
6366 Box::pin(async move { other.into_id().await.unwrap().quote() })
6367 }),
6368 );
6369 Directory {
6370 proc: self.proc.clone(),
6371 selection: query,
6372 graphql_client: self.graphql_client.clone(),
6373 }
6374 }
6375 pub async fn digest(&self) -> Result<String, DaggerError> {
6377 let query = self.selection.select("digest");
6378 query.execute(self.graphql_client.clone()).await
6379 }
6380 pub fn directory(&self, path: impl Into<String>) -> Directory {
6386 let mut query = self.selection.select("directory");
6387 query = query.arg("path", path.into());
6388 Directory {
6389 proc: self.proc.clone(),
6390 selection: query,
6391 graphql_client: self.graphql_client.clone(),
6392 }
6393 }
6394 pub fn docker_build(&self) -> Container {
6400 let query = self.selection.select("dockerBuild");
6401 Container {
6402 proc: self.proc.clone(),
6403 selection: query,
6404 graphql_client: self.graphql_client.clone(),
6405 }
6406 }
6407 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
6413 let mut query = self.selection.select("dockerBuild");
6414 if let Some(dockerfile) = opts.dockerfile {
6415 query = query.arg("dockerfile", dockerfile);
6416 }
6417 if let Some(platform) = opts.platform {
6418 query = query.arg("platform", platform);
6419 }
6420 if let Some(build_args) = opts.build_args {
6421 query = query.arg("buildArgs", build_args);
6422 }
6423 if let Some(target) = opts.target {
6424 query = query.arg("target", target);
6425 }
6426 if let Some(secrets) = opts.secrets {
6427 query = query.arg("secrets", secrets);
6428 }
6429 if let Some(no_init) = opts.no_init {
6430 query = query.arg("noInit", no_init);
6431 }
6432 if let Some(ssh) = opts.ssh {
6433 query = query.arg("ssh", ssh);
6434 }
6435 Container {
6436 proc: self.proc.clone(),
6437 selection: query,
6438 graphql_client: self.graphql_client.clone(),
6439 }
6440 }
6441 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6447 let query = self.selection.select("entries");
6448 query.execute(self.graphql_client.clone()).await
6449 }
6450 pub async fn entries_opts<'a>(
6456 &self,
6457 opts: DirectoryEntriesOpts<'a>,
6458 ) -> Result<Vec<String>, DaggerError> {
6459 let mut query = self.selection.select("entries");
6460 if let Some(path) = opts.path {
6461 query = query.arg("path", path);
6462 }
6463 query.execute(self.graphql_client.clone()).await
6464 }
6465 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
6472 let mut query = self.selection.select("exists");
6473 query = query.arg("path", path.into());
6474 query.execute(self.graphql_client.clone()).await
6475 }
6476 pub async fn exists_opts(
6483 &self,
6484 path: impl Into<String>,
6485 opts: DirectoryExistsOpts,
6486 ) -> Result<bool, DaggerError> {
6487 let mut query = self.selection.select("exists");
6488 query = query.arg("path", path.into());
6489 if let Some(expected_type) = opts.expected_type {
6490 query = query.arg("expectedType", expected_type);
6491 }
6492 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6493 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6494 }
6495 query.execute(self.graphql_client.clone()).await
6496 }
6497 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
6504 let mut query = self.selection.select("export");
6505 query = query.arg("path", path.into());
6506 query.execute(self.graphql_client.clone()).await
6507 }
6508 pub async fn export_opts(
6515 &self,
6516 path: impl Into<String>,
6517 opts: DirectoryExportOpts,
6518 ) -> Result<String, DaggerError> {
6519 let mut query = self.selection.select("export");
6520 query = query.arg("path", path.into());
6521 if let Some(wipe) = opts.wipe {
6522 query = query.arg("wipe", wipe);
6523 }
6524 query.execute(self.graphql_client.clone()).await
6525 }
6526 pub fn file(&self, path: impl Into<String>) -> File {
6532 let mut query = self.selection.select("file");
6533 query = query.arg("path", path.into());
6534 File {
6535 proc: self.proc.clone(),
6536 selection: query,
6537 graphql_client: self.graphql_client.clone(),
6538 }
6539 }
6540 pub fn filter(&self) -> Directory {
6546 let query = self.selection.select("filter");
6547 Directory {
6548 proc: self.proc.clone(),
6549 selection: query,
6550 graphql_client: self.graphql_client.clone(),
6551 }
6552 }
6553 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
6559 let mut query = self.selection.select("filter");
6560 if let Some(exclude) = opts.exclude {
6561 query = query.arg("exclude", exclude);
6562 }
6563 if let Some(include) = opts.include {
6564 query = query.arg("include", include);
6565 }
6566 if let Some(gitignore) = opts.gitignore {
6567 query = query.arg("gitignore", gitignore);
6568 }
6569 Directory {
6570 proc: self.proc.clone(),
6571 selection: query,
6572 graphql_client: self.graphql_client.clone(),
6573 }
6574 }
6575 pub async fn find_up(
6582 &self,
6583 name: impl Into<String>,
6584 start: impl Into<String>,
6585 ) -> Result<String, DaggerError> {
6586 let mut query = self.selection.select("findUp");
6587 query = query.arg("name", name.into());
6588 query = query.arg("start", start.into());
6589 query.execute(self.graphql_client.clone()).await
6590 }
6591 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6597 let mut query = self.selection.select("glob");
6598 query = query.arg("pattern", pattern.into());
6599 query.execute(self.graphql_client.clone()).await
6600 }
6601 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
6603 let query = self.selection.select("id");
6604 query.execute(self.graphql_client.clone()).await
6605 }
6606 pub async fn name(&self) -> Result<String, DaggerError> {
6608 let query = self.selection.select("name");
6609 query.execute(self.graphql_client.clone()).await
6610 }
6611 pub async fn search(
6619 &self,
6620 pattern: impl Into<String>,
6621 ) -> Result<Vec<SearchResult>, DaggerError> {
6622 let mut query = self.selection.select("search");
6623 query = query.arg("pattern", pattern.into());
6624 let query = query.select("id");
6625 let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
6626 let root = Query {
6627 proc: self.proc.clone(),
6628 selection: crate::querybuilder::query(),
6629 graphql_client: self.graphql_client.clone(),
6630 };
6631 Ok(ids
6632 .into_iter()
6633 .map(|id| root.load_search_result_from_id(id))
6634 .collect())
6635 }
6636 pub async fn search_opts<'a>(
6644 &self,
6645 pattern: impl Into<String>,
6646 opts: DirectorySearchOpts<'a>,
6647 ) -> Result<Vec<SearchResult>, DaggerError> {
6648 let mut query = self.selection.select("search");
6649 query = query.arg("pattern", pattern.into());
6650 if let Some(paths) = opts.paths {
6651 query = query.arg("paths", paths);
6652 }
6653 if let Some(globs) = opts.globs {
6654 query = query.arg("globs", globs);
6655 }
6656 if let Some(literal) = opts.literal {
6657 query = query.arg("literal", literal);
6658 }
6659 if let Some(multiline) = opts.multiline {
6660 query = query.arg("multiline", multiline);
6661 }
6662 if let Some(dotall) = opts.dotall {
6663 query = query.arg("dotall", dotall);
6664 }
6665 if let Some(insensitive) = opts.insensitive {
6666 query = query.arg("insensitive", insensitive);
6667 }
6668 if let Some(skip_ignored) = opts.skip_ignored {
6669 query = query.arg("skipIgnored", skip_ignored);
6670 }
6671 if let Some(skip_hidden) = opts.skip_hidden {
6672 query = query.arg("skipHidden", skip_hidden);
6673 }
6674 if let Some(files_only) = opts.files_only {
6675 query = query.arg("filesOnly", files_only);
6676 }
6677 if let Some(limit) = opts.limit {
6678 query = query.arg("limit", limit);
6679 }
6680 let query = query.select("id");
6681 let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
6682 let root = Query {
6683 proc: self.proc.clone(),
6684 selection: crate::querybuilder::query(),
6685 graphql_client: self.graphql_client.clone(),
6686 };
6687 Ok(ids
6688 .into_iter()
6689 .map(|id| root.load_search_result_from_id(id))
6690 .collect())
6691 }
6692 pub fn stat(&self, path: impl Into<String>) -> Stat {
6699 let mut query = self.selection.select("stat");
6700 query = query.arg("path", path.into());
6701 Stat {
6702 proc: self.proc.clone(),
6703 selection: query,
6704 graphql_client: self.graphql_client.clone(),
6705 }
6706 }
6707 pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
6714 let mut query = self.selection.select("stat");
6715 query = query.arg("path", path.into());
6716 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6717 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6718 }
6719 Stat {
6720 proc: self.proc.clone(),
6721 selection: query,
6722 graphql_client: self.graphql_client.clone(),
6723 }
6724 }
6725 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
6727 let query = self.selection.select("sync");
6728 query.execute(self.graphql_client.clone()).await
6729 }
6730 pub fn terminal(&self) -> Directory {
6736 let query = self.selection.select("terminal");
6737 Directory {
6738 proc: self.proc.clone(),
6739 selection: query,
6740 graphql_client: self.graphql_client.clone(),
6741 }
6742 }
6743 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
6749 let mut query = self.selection.select("terminal");
6750 if let Some(container) = opts.container {
6751 query = query.arg("container", container);
6752 }
6753 if let Some(cmd) = opts.cmd {
6754 query = query.arg("cmd", cmd);
6755 }
6756 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6757 query = query.arg(
6758 "experimentalPrivilegedNesting",
6759 experimental_privileged_nesting,
6760 );
6761 }
6762 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6763 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6764 }
6765 Directory {
6766 proc: self.proc.clone(),
6767 selection: query,
6768 graphql_client: self.graphql_client.clone(),
6769 }
6770 }
6771 pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
6777 let mut query = self.selection.select("withChanges");
6778 query = query.arg_lazy(
6779 "changes",
6780 Box::new(move || {
6781 let changes = changes.clone();
6782 Box::pin(async move { changes.into_id().await.unwrap().quote() })
6783 }),
6784 );
6785 Directory {
6786 proc: self.proc.clone(),
6787 selection: query,
6788 graphql_client: self.graphql_client.clone(),
6789 }
6790 }
6791 pub fn with_directory(
6799 &self,
6800 path: impl Into<String>,
6801 source: impl IntoID<DirectoryId>,
6802 ) -> Directory {
6803 let mut query = self.selection.select("withDirectory");
6804 query = query.arg("path", path.into());
6805 query = query.arg_lazy(
6806 "source",
6807 Box::new(move || {
6808 let source = source.clone();
6809 Box::pin(async move { source.into_id().await.unwrap().quote() })
6810 }),
6811 );
6812 Directory {
6813 proc: self.proc.clone(),
6814 selection: query,
6815 graphql_client: self.graphql_client.clone(),
6816 }
6817 }
6818 pub fn with_directory_opts<'a>(
6826 &self,
6827 path: impl Into<String>,
6828 source: impl IntoID<DirectoryId>,
6829 opts: DirectoryWithDirectoryOpts<'a>,
6830 ) -> Directory {
6831 let mut query = self.selection.select("withDirectory");
6832 query = query.arg("path", path.into());
6833 query = query.arg_lazy(
6834 "source",
6835 Box::new(move || {
6836 let source = source.clone();
6837 Box::pin(async move { source.into_id().await.unwrap().quote() })
6838 }),
6839 );
6840 if let Some(exclude) = opts.exclude {
6841 query = query.arg("exclude", exclude);
6842 }
6843 if let Some(include) = opts.include {
6844 query = query.arg("include", include);
6845 }
6846 if let Some(gitignore) = opts.gitignore {
6847 query = query.arg("gitignore", gitignore);
6848 }
6849 if let Some(owner) = opts.owner {
6850 query = query.arg("owner", owner);
6851 }
6852 if let Some(permissions) = opts.permissions {
6853 query = query.arg("permissions", permissions);
6854 }
6855 Directory {
6856 proc: self.proc.clone(),
6857 selection: query,
6858 graphql_client: self.graphql_client.clone(),
6859 }
6860 }
6861 pub fn with_error(&self, err: impl Into<String>) -> Directory {
6867 let mut query = self.selection.select("withError");
6868 query = query.arg("err", err.into());
6869 Directory {
6870 proc: self.proc.clone(),
6871 selection: query,
6872 graphql_client: self.graphql_client.clone(),
6873 }
6874 }
6875 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
6883 let mut query = self.selection.select("withFile");
6884 query = query.arg("path", path.into());
6885 query = query.arg_lazy(
6886 "source",
6887 Box::new(move || {
6888 let source = source.clone();
6889 Box::pin(async move { source.into_id().await.unwrap().quote() })
6890 }),
6891 );
6892 Directory {
6893 proc: self.proc.clone(),
6894 selection: query,
6895 graphql_client: self.graphql_client.clone(),
6896 }
6897 }
6898 pub fn with_file_opts<'a>(
6906 &self,
6907 path: impl Into<String>,
6908 source: impl IntoID<FileId>,
6909 opts: DirectoryWithFileOpts<'a>,
6910 ) -> Directory {
6911 let mut query = self.selection.select("withFile");
6912 query = query.arg("path", path.into());
6913 query = query.arg_lazy(
6914 "source",
6915 Box::new(move || {
6916 let source = source.clone();
6917 Box::pin(async move { source.into_id().await.unwrap().quote() })
6918 }),
6919 );
6920 if let Some(permissions) = opts.permissions {
6921 query = query.arg("permissions", permissions);
6922 }
6923 if let Some(owner) = opts.owner {
6924 query = query.arg("owner", owner);
6925 }
6926 Directory {
6927 proc: self.proc.clone(),
6928 selection: query,
6929 graphql_client: self.graphql_client.clone(),
6930 }
6931 }
6932 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
6940 let mut query = self.selection.select("withFiles");
6941 query = query.arg("path", path.into());
6942 query = query.arg("sources", sources);
6943 Directory {
6944 proc: self.proc.clone(),
6945 selection: query,
6946 graphql_client: self.graphql_client.clone(),
6947 }
6948 }
6949 pub fn with_files_opts(
6957 &self,
6958 path: impl Into<String>,
6959 sources: Vec<FileId>,
6960 opts: DirectoryWithFilesOpts,
6961 ) -> Directory {
6962 let mut query = self.selection.select("withFiles");
6963 query = query.arg("path", path.into());
6964 query = query.arg("sources", sources);
6965 if let Some(permissions) = opts.permissions {
6966 query = query.arg("permissions", permissions);
6967 }
6968 Directory {
6969 proc: self.proc.clone(),
6970 selection: query,
6971 graphql_client: self.graphql_client.clone(),
6972 }
6973 }
6974 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6981 let mut query = self.selection.select("withNewDirectory");
6982 query = query.arg("path", path.into());
6983 Directory {
6984 proc: self.proc.clone(),
6985 selection: query,
6986 graphql_client: self.graphql_client.clone(),
6987 }
6988 }
6989 pub fn with_new_directory_opts(
6996 &self,
6997 path: impl Into<String>,
6998 opts: DirectoryWithNewDirectoryOpts,
6999 ) -> Directory {
7000 let mut query = self.selection.select("withNewDirectory");
7001 query = query.arg("path", path.into());
7002 if let Some(permissions) = opts.permissions {
7003 query = query.arg("permissions", permissions);
7004 }
7005 Directory {
7006 proc: self.proc.clone(),
7007 selection: query,
7008 graphql_client: self.graphql_client.clone(),
7009 }
7010 }
7011 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7019 let mut query = self.selection.select("withNewFile");
7020 query = query.arg("path", path.into());
7021 query = query.arg("contents", contents.into());
7022 Directory {
7023 proc: self.proc.clone(),
7024 selection: query,
7025 graphql_client: self.graphql_client.clone(),
7026 }
7027 }
7028 pub fn with_new_file_opts(
7036 &self,
7037 path: impl Into<String>,
7038 contents: impl Into<String>,
7039 opts: DirectoryWithNewFileOpts,
7040 ) -> Directory {
7041 let mut query = self.selection.select("withNewFile");
7042 query = query.arg("path", path.into());
7043 query = query.arg("contents", contents.into());
7044 if let Some(permissions) = opts.permissions {
7045 query = query.arg("permissions", permissions);
7046 }
7047 Directory {
7048 proc: self.proc.clone(),
7049 selection: query,
7050 graphql_client: self.graphql_client.clone(),
7051 }
7052 }
7053 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
7059 let mut query = self.selection.select("withPatch");
7060 query = query.arg("patch", patch.into());
7061 Directory {
7062 proc: self.proc.clone(),
7063 selection: query,
7064 graphql_client: self.graphql_client.clone(),
7065 }
7066 }
7067 pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
7073 let mut query = self.selection.select("withPatchFile");
7074 query = query.arg_lazy(
7075 "patch",
7076 Box::new(move || {
7077 let patch = patch.clone();
7078 Box::pin(async move { patch.into_id().await.unwrap().quote() })
7079 }),
7080 );
7081 Directory {
7082 proc: self.proc.clone(),
7083 selection: query,
7084 graphql_client: self.graphql_client.clone(),
7085 }
7086 }
7087 pub fn with_symlink(
7094 &self,
7095 target: impl Into<String>,
7096 link_name: impl Into<String>,
7097 ) -> Directory {
7098 let mut query = self.selection.select("withSymlink");
7099 query = query.arg("target", target.into());
7100 query = query.arg("linkName", link_name.into());
7101 Directory {
7102 proc: self.proc.clone(),
7103 selection: query,
7104 graphql_client: self.graphql_client.clone(),
7105 }
7106 }
7107 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7115 let mut query = self.selection.select("withTimestamps");
7116 query = query.arg("timestamp", timestamp);
7117 Directory {
7118 proc: self.proc.clone(),
7119 selection: query,
7120 graphql_client: self.graphql_client.clone(),
7121 }
7122 }
7123 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7129 let mut query = self.selection.select("withoutDirectory");
7130 query = query.arg("path", path.into());
7131 Directory {
7132 proc: self.proc.clone(),
7133 selection: query,
7134 graphql_client: self.graphql_client.clone(),
7135 }
7136 }
7137 pub fn without_file(&self, path: impl Into<String>) -> Directory {
7143 let mut query = self.selection.select("withoutFile");
7144 query = query.arg("path", path.into());
7145 Directory {
7146 proc: self.proc.clone(),
7147 selection: query,
7148 graphql_client: self.graphql_client.clone(),
7149 }
7150 }
7151 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7157 let mut query = self.selection.select("withoutFiles");
7158 query = query.arg(
7159 "paths",
7160 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7161 );
7162 Directory {
7163 proc: self.proc.clone(),
7164 selection: query,
7165 graphql_client: self.graphql_client.clone(),
7166 }
7167 }
7168}
7169#[derive(Clone)]
7170pub struct Engine {
7171 pub proc: Option<Arc<DaggerSessionProc>>,
7172 pub selection: Selection,
7173 pub graphql_client: DynGraphQLClient,
7174}
7175impl Engine {
7176 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7178 let query = self.selection.select("clients");
7179 query.execute(self.graphql_client.clone()).await
7180 }
7181 pub async fn id(&self) -> Result<EngineId, DaggerError> {
7183 let query = self.selection.select("id");
7184 query.execute(self.graphql_client.clone()).await
7185 }
7186 pub fn local_cache(&self) -> EngineCache {
7188 let query = self.selection.select("localCache");
7189 EngineCache {
7190 proc: self.proc.clone(),
7191 selection: query,
7192 graphql_client: self.graphql_client.clone(),
7193 }
7194 }
7195 pub async fn name(&self) -> Result<String, DaggerError> {
7197 let query = self.selection.select("name");
7198 query.execute(self.graphql_client.clone()).await
7199 }
7200}
7201#[derive(Clone)]
7202pub struct EngineCache {
7203 pub proc: Option<Arc<DaggerSessionProc>>,
7204 pub selection: Selection,
7205 pub graphql_client: DynGraphQLClient,
7206}
7207#[derive(Builder, Debug, PartialEq)]
7208pub struct EngineCacheEntrySetOpts<'a> {
7209 #[builder(setter(into, strip_option), default)]
7210 pub key: Option<&'a str>,
7211}
7212#[derive(Builder, Debug, PartialEq)]
7213pub struct EngineCachePruneOpts<'a> {
7214 #[builder(setter(into, strip_option), default)]
7216 pub max_used_space: Option<&'a str>,
7217 #[builder(setter(into, strip_option), default)]
7219 pub min_free_space: Option<&'a str>,
7220 #[builder(setter(into, strip_option), default)]
7222 pub reserved_space: Option<&'a str>,
7223 #[builder(setter(into, strip_option), default)]
7225 pub target_space: Option<&'a str>,
7226 #[builder(setter(into, strip_option), default)]
7228 pub use_default_policy: Option<bool>,
7229}
7230impl EngineCache {
7231 pub fn entry_set(&self) -> EngineCacheEntrySet {
7237 let query = self.selection.select("entrySet");
7238 EngineCacheEntrySet {
7239 proc: self.proc.clone(),
7240 selection: query,
7241 graphql_client: self.graphql_client.clone(),
7242 }
7243 }
7244 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
7250 let mut query = self.selection.select("entrySet");
7251 if let Some(key) = opts.key {
7252 query = query.arg("key", key);
7253 }
7254 EngineCacheEntrySet {
7255 proc: self.proc.clone(),
7256 selection: query,
7257 graphql_client: self.graphql_client.clone(),
7258 }
7259 }
7260 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
7262 let query = self.selection.select("id");
7263 query.execute(self.graphql_client.clone()).await
7264 }
7265 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
7267 let query = self.selection.select("maxUsedSpace");
7268 query.execute(self.graphql_client.clone()).await
7269 }
7270 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
7272 let query = self.selection.select("minFreeSpace");
7273 query.execute(self.graphql_client.clone()).await
7274 }
7275 pub async fn prune(&self) -> Result<Void, DaggerError> {
7281 let query = self.selection.select("prune");
7282 query.execute(self.graphql_client.clone()).await
7283 }
7284 pub async fn prune_opts<'a>(
7290 &self,
7291 opts: EngineCachePruneOpts<'a>,
7292 ) -> Result<Void, DaggerError> {
7293 let mut query = self.selection.select("prune");
7294 if let Some(use_default_policy) = opts.use_default_policy {
7295 query = query.arg("useDefaultPolicy", use_default_policy);
7296 }
7297 if let Some(max_used_space) = opts.max_used_space {
7298 query = query.arg("maxUsedSpace", max_used_space);
7299 }
7300 if let Some(reserved_space) = opts.reserved_space {
7301 query = query.arg("reservedSpace", reserved_space);
7302 }
7303 if let Some(min_free_space) = opts.min_free_space {
7304 query = query.arg("minFreeSpace", min_free_space);
7305 }
7306 if let Some(target_space) = opts.target_space {
7307 query = query.arg("targetSpace", target_space);
7308 }
7309 query.execute(self.graphql_client.clone()).await
7310 }
7311 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
7313 let query = self.selection.select("reservedSpace");
7314 query.execute(self.graphql_client.clone()).await
7315 }
7316 pub async fn target_space(&self) -> Result<isize, DaggerError> {
7318 let query = self.selection.select("targetSpace");
7319 query.execute(self.graphql_client.clone()).await
7320 }
7321}
7322#[derive(Clone)]
7323pub struct EngineCacheEntry {
7324 pub proc: Option<Arc<DaggerSessionProc>>,
7325 pub selection: Selection,
7326 pub graphql_client: DynGraphQLClient,
7327}
7328impl EngineCacheEntry {
7329 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
7331 let query = self.selection.select("activelyUsed");
7332 query.execute(self.graphql_client.clone()).await
7333 }
7334 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
7336 let query = self.selection.select("createdTimeUnixNano");
7337 query.execute(self.graphql_client.clone()).await
7338 }
7339 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
7341 let query = self.selection.select("dagqlCall");
7342 query.execute(self.graphql_client.clone()).await
7343 }
7344 pub async fn description(&self) -> Result<String, DaggerError> {
7346 let query = self.selection.select("description");
7347 query.execute(self.graphql_client.clone()).await
7348 }
7349 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
7351 let query = self.selection.select("diskSpaceBytes");
7352 query.execute(self.graphql_client.clone()).await
7353 }
7354 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
7356 let query = self.selection.select("id");
7357 query.execute(self.graphql_client.clone()).await
7358 }
7359 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
7361 let query = self.selection.select("mostRecentUseTimeUnixNano");
7362 query.execute(self.graphql_client.clone()).await
7363 }
7364 pub async fn record_type(&self) -> Result<String, DaggerError> {
7366 let query = self.selection.select("recordType");
7367 query.execute(self.graphql_client.clone()).await
7368 }
7369 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
7371 let query = self.selection.select("recordTypes");
7372 query.execute(self.graphql_client.clone()).await
7373 }
7374}
7375#[derive(Clone)]
7376pub struct EngineCacheEntrySet {
7377 pub proc: Option<Arc<DaggerSessionProc>>,
7378 pub selection: Selection,
7379 pub graphql_client: DynGraphQLClient,
7380}
7381impl EngineCacheEntrySet {
7382 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
7384 let query = self.selection.select("diskSpaceBytes");
7385 query.execute(self.graphql_client.clone()).await
7386 }
7387 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
7389 let query = self.selection.select("entries");
7390 let query = query.select("id");
7391 let ids: Vec<EngineCacheEntryId> = query.execute(self.graphql_client.clone()).await?;
7392 let root = Query {
7393 proc: self.proc.clone(),
7394 selection: crate::querybuilder::query(),
7395 graphql_client: self.graphql_client.clone(),
7396 };
7397 Ok(ids
7398 .into_iter()
7399 .map(|id| root.load_engine_cache_entry_from_id(id))
7400 .collect())
7401 }
7402 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
7404 let query = self.selection.select("entryCount");
7405 query.execute(self.graphql_client.clone()).await
7406 }
7407 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
7409 let query = self.selection.select("id");
7410 query.execute(self.graphql_client.clone()).await
7411 }
7412}
7413#[derive(Clone)]
7414pub struct EnumTypeDef {
7415 pub proc: Option<Arc<DaggerSessionProc>>,
7416 pub selection: Selection,
7417 pub graphql_client: DynGraphQLClient,
7418}
7419impl EnumTypeDef {
7420 pub async fn description(&self) -> Result<String, DaggerError> {
7422 let query = self.selection.select("description");
7423 query.execute(self.graphql_client.clone()).await
7424 }
7425 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
7427 let query = self.selection.select("id");
7428 query.execute(self.graphql_client.clone()).await
7429 }
7430 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
7432 let query = self.selection.select("members");
7433 let query = query.select("id");
7434 let ids: Vec<EnumValueTypeDefId> = query.execute(self.graphql_client.clone()).await?;
7435 let root = Query {
7436 proc: self.proc.clone(),
7437 selection: crate::querybuilder::query(),
7438 graphql_client: self.graphql_client.clone(),
7439 };
7440 Ok(ids
7441 .into_iter()
7442 .map(|id| root.load_enum_value_type_def_from_id(id))
7443 .collect())
7444 }
7445 pub async fn name(&self) -> Result<String, DaggerError> {
7447 let query = self.selection.select("name");
7448 query.execute(self.graphql_client.clone()).await
7449 }
7450 pub fn source_map(&self) -> SourceMap {
7452 let query = self.selection.select("sourceMap");
7453 SourceMap {
7454 proc: self.proc.clone(),
7455 selection: query,
7456 graphql_client: self.graphql_client.clone(),
7457 }
7458 }
7459 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7461 let query = self.selection.select("sourceModuleName");
7462 query.execute(self.graphql_client.clone()).await
7463 }
7464 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
7466 let query = self.selection.select("values");
7467 let query = query.select("id");
7468 let ids: Vec<EnumValueTypeDefId> = query.execute(self.graphql_client.clone()).await?;
7469 let root = Query {
7470 proc: self.proc.clone(),
7471 selection: crate::querybuilder::query(),
7472 graphql_client: self.graphql_client.clone(),
7473 };
7474 Ok(ids
7475 .into_iter()
7476 .map(|id| root.load_enum_value_type_def_from_id(id))
7477 .collect())
7478 }
7479}
7480#[derive(Clone)]
7481pub struct EnumValueTypeDef {
7482 pub proc: Option<Arc<DaggerSessionProc>>,
7483 pub selection: Selection,
7484 pub graphql_client: DynGraphQLClient,
7485}
7486impl EnumValueTypeDef {
7487 pub async fn deprecated(&self) -> Result<String, DaggerError> {
7489 let query = self.selection.select("deprecated");
7490 query.execute(self.graphql_client.clone()).await
7491 }
7492 pub async fn description(&self) -> Result<String, DaggerError> {
7494 let query = self.selection.select("description");
7495 query.execute(self.graphql_client.clone()).await
7496 }
7497 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
7499 let query = self.selection.select("id");
7500 query.execute(self.graphql_client.clone()).await
7501 }
7502 pub async fn name(&self) -> Result<String, DaggerError> {
7504 let query = self.selection.select("name");
7505 query.execute(self.graphql_client.clone()).await
7506 }
7507 pub fn source_map(&self) -> SourceMap {
7509 let query = self.selection.select("sourceMap");
7510 SourceMap {
7511 proc: self.proc.clone(),
7512 selection: query,
7513 graphql_client: self.graphql_client.clone(),
7514 }
7515 }
7516 pub async fn value(&self) -> Result<String, DaggerError> {
7518 let query = self.selection.select("value");
7519 query.execute(self.graphql_client.clone()).await
7520 }
7521}
7522#[derive(Clone)]
7523pub struct Env {
7524 pub proc: Option<Arc<DaggerSessionProc>>,
7525 pub selection: Selection,
7526 pub graphql_client: DynGraphQLClient,
7527}
7528#[derive(Builder, Debug, PartialEq)]
7529pub struct EnvChecksOpts<'a> {
7530 #[builder(setter(into, strip_option), default)]
7532 pub include: Option<Vec<&'a str>>,
7533 #[builder(setter(into, strip_option), default)]
7535 pub no_generate: Option<bool>,
7536}
7537#[derive(Builder, Debug, PartialEq)]
7538pub struct EnvServicesOpts<'a> {
7539 #[builder(setter(into, strip_option), default)]
7541 pub include: Option<Vec<&'a str>>,
7542}
7543impl Env {
7544 pub fn check(&self, name: impl Into<String>) -> Check {
7550 let mut query = self.selection.select("check");
7551 query = query.arg("name", name.into());
7552 Check {
7553 proc: self.proc.clone(),
7554 selection: query,
7555 graphql_client: self.graphql_client.clone(),
7556 }
7557 }
7558 pub fn checks(&self) -> CheckGroup {
7564 let query = self.selection.select("checks");
7565 CheckGroup {
7566 proc: self.proc.clone(),
7567 selection: query,
7568 graphql_client: self.graphql_client.clone(),
7569 }
7570 }
7571 pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
7577 let mut query = self.selection.select("checks");
7578 if let Some(include) = opts.include {
7579 query = query.arg("include", include);
7580 }
7581 if let Some(no_generate) = opts.no_generate {
7582 query = query.arg("noGenerate", no_generate);
7583 }
7584 CheckGroup {
7585 proc: self.proc.clone(),
7586 selection: query,
7587 graphql_client: self.graphql_client.clone(),
7588 }
7589 }
7590 pub async fn id(&self) -> Result<EnvId, DaggerError> {
7592 let query = self.selection.select("id");
7593 query.execute(self.graphql_client.clone()).await
7594 }
7595 pub fn input(&self, name: impl Into<String>) -> Binding {
7597 let mut query = self.selection.select("input");
7598 query = query.arg("name", name.into());
7599 Binding {
7600 proc: self.proc.clone(),
7601 selection: query,
7602 graphql_client: self.graphql_client.clone(),
7603 }
7604 }
7605 pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
7607 let query = self.selection.select("inputs");
7608 let query = query.select("id");
7609 let ids: Vec<BindingId> = query.execute(self.graphql_client.clone()).await?;
7610 let root = Query {
7611 proc: self.proc.clone(),
7612 selection: crate::querybuilder::query(),
7613 graphql_client: self.graphql_client.clone(),
7614 };
7615 Ok(ids
7616 .into_iter()
7617 .map(|id| root.load_binding_from_id(id))
7618 .collect())
7619 }
7620 pub fn output(&self, name: impl Into<String>) -> Binding {
7622 let mut query = self.selection.select("output");
7623 query = query.arg("name", name.into());
7624 Binding {
7625 proc: self.proc.clone(),
7626 selection: query,
7627 graphql_client: self.graphql_client.clone(),
7628 }
7629 }
7630 pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
7632 let query = self.selection.select("outputs");
7633 let query = query.select("id");
7634 let ids: Vec<BindingId> = query.execute(self.graphql_client.clone()).await?;
7635 let root = Query {
7636 proc: self.proc.clone(),
7637 selection: crate::querybuilder::query(),
7638 graphql_client: self.graphql_client.clone(),
7639 };
7640 Ok(ids
7641 .into_iter()
7642 .map(|id| root.load_binding_from_id(id))
7643 .collect())
7644 }
7645 pub fn services(&self) -> UpGroup {
7651 let query = self.selection.select("services");
7652 UpGroup {
7653 proc: self.proc.clone(),
7654 selection: query,
7655 graphql_client: self.graphql_client.clone(),
7656 }
7657 }
7658 pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
7664 let mut query = self.selection.select("services");
7665 if let Some(include) = opts.include {
7666 query = query.arg("include", include);
7667 }
7668 UpGroup {
7669 proc: self.proc.clone(),
7670 selection: query,
7671 graphql_client: self.graphql_client.clone(),
7672 }
7673 }
7674 pub fn with_address_input(
7682 &self,
7683 name: impl Into<String>,
7684 value: impl IntoID<AddressId>,
7685 description: impl Into<String>,
7686 ) -> Env {
7687 let mut query = self.selection.select("withAddressInput");
7688 query = query.arg("name", name.into());
7689 query = query.arg_lazy(
7690 "value",
7691 Box::new(move || {
7692 let value = value.clone();
7693 Box::pin(async move { value.into_id().await.unwrap().quote() })
7694 }),
7695 );
7696 query = query.arg("description", description.into());
7697 Env {
7698 proc: self.proc.clone(),
7699 selection: query,
7700 graphql_client: self.graphql_client.clone(),
7701 }
7702 }
7703 pub fn with_address_output(
7710 &self,
7711 name: impl Into<String>,
7712 description: impl Into<String>,
7713 ) -> Env {
7714 let mut query = self.selection.select("withAddressOutput");
7715 query = query.arg("name", name.into());
7716 query = query.arg("description", description.into());
7717 Env {
7718 proc: self.proc.clone(),
7719 selection: query,
7720 graphql_client: self.graphql_client.clone(),
7721 }
7722 }
7723 pub fn with_cache_volume_input(
7731 &self,
7732 name: impl Into<String>,
7733 value: impl IntoID<CacheVolumeId>,
7734 description: impl Into<String>,
7735 ) -> Env {
7736 let mut query = self.selection.select("withCacheVolumeInput");
7737 query = query.arg("name", name.into());
7738 query = query.arg_lazy(
7739 "value",
7740 Box::new(move || {
7741 let value = value.clone();
7742 Box::pin(async move { value.into_id().await.unwrap().quote() })
7743 }),
7744 );
7745 query = query.arg("description", description.into());
7746 Env {
7747 proc: self.proc.clone(),
7748 selection: query,
7749 graphql_client: self.graphql_client.clone(),
7750 }
7751 }
7752 pub fn with_cache_volume_output(
7759 &self,
7760 name: impl Into<String>,
7761 description: impl Into<String>,
7762 ) -> Env {
7763 let mut query = self.selection.select("withCacheVolumeOutput");
7764 query = query.arg("name", name.into());
7765 query = query.arg("description", description.into());
7766 Env {
7767 proc: self.proc.clone(),
7768 selection: query,
7769 graphql_client: self.graphql_client.clone(),
7770 }
7771 }
7772 pub fn with_changeset_input(
7780 &self,
7781 name: impl Into<String>,
7782 value: impl IntoID<ChangesetId>,
7783 description: impl Into<String>,
7784 ) -> Env {
7785 let mut query = self.selection.select("withChangesetInput");
7786 query = query.arg("name", name.into());
7787 query = query.arg_lazy(
7788 "value",
7789 Box::new(move || {
7790 let value = value.clone();
7791 Box::pin(async move { value.into_id().await.unwrap().quote() })
7792 }),
7793 );
7794 query = query.arg("description", description.into());
7795 Env {
7796 proc: self.proc.clone(),
7797 selection: query,
7798 graphql_client: self.graphql_client.clone(),
7799 }
7800 }
7801 pub fn with_changeset_output(
7808 &self,
7809 name: impl Into<String>,
7810 description: impl Into<String>,
7811 ) -> Env {
7812 let mut query = self.selection.select("withChangesetOutput");
7813 query = query.arg("name", name.into());
7814 query = query.arg("description", description.into());
7815 Env {
7816 proc: self.proc.clone(),
7817 selection: query,
7818 graphql_client: self.graphql_client.clone(),
7819 }
7820 }
7821 pub fn with_check_group_input(
7829 &self,
7830 name: impl Into<String>,
7831 value: impl IntoID<CheckGroupId>,
7832 description: impl Into<String>,
7833 ) -> Env {
7834 let mut query = self.selection.select("withCheckGroupInput");
7835 query = query.arg("name", name.into());
7836 query = query.arg_lazy(
7837 "value",
7838 Box::new(move || {
7839 let value = value.clone();
7840 Box::pin(async move { value.into_id().await.unwrap().quote() })
7841 }),
7842 );
7843 query = query.arg("description", description.into());
7844 Env {
7845 proc: self.proc.clone(),
7846 selection: query,
7847 graphql_client: self.graphql_client.clone(),
7848 }
7849 }
7850 pub fn with_check_group_output(
7857 &self,
7858 name: impl Into<String>,
7859 description: impl Into<String>,
7860 ) -> Env {
7861 let mut query = self.selection.select("withCheckGroupOutput");
7862 query = query.arg("name", name.into());
7863 query = query.arg("description", description.into());
7864 Env {
7865 proc: self.proc.clone(),
7866 selection: query,
7867 graphql_client: self.graphql_client.clone(),
7868 }
7869 }
7870 pub fn with_check_input(
7878 &self,
7879 name: impl Into<String>,
7880 value: impl IntoID<CheckId>,
7881 description: impl Into<String>,
7882 ) -> Env {
7883 let mut query = self.selection.select("withCheckInput");
7884 query = query.arg("name", name.into());
7885 query = query.arg_lazy(
7886 "value",
7887 Box::new(move || {
7888 let value = value.clone();
7889 Box::pin(async move { value.into_id().await.unwrap().quote() })
7890 }),
7891 );
7892 query = query.arg("description", description.into());
7893 Env {
7894 proc: self.proc.clone(),
7895 selection: query,
7896 graphql_client: self.graphql_client.clone(),
7897 }
7898 }
7899 pub fn with_check_output(
7906 &self,
7907 name: impl Into<String>,
7908 description: impl Into<String>,
7909 ) -> Env {
7910 let mut query = self.selection.select("withCheckOutput");
7911 query = query.arg("name", name.into());
7912 query = query.arg("description", description.into());
7913 Env {
7914 proc: self.proc.clone(),
7915 selection: query,
7916 graphql_client: self.graphql_client.clone(),
7917 }
7918 }
7919 pub fn with_cloud_input(
7927 &self,
7928 name: impl Into<String>,
7929 value: impl IntoID<CloudId>,
7930 description: impl Into<String>,
7931 ) -> Env {
7932 let mut query = self.selection.select("withCloudInput");
7933 query = query.arg("name", name.into());
7934 query = query.arg_lazy(
7935 "value",
7936 Box::new(move || {
7937 let value = value.clone();
7938 Box::pin(async move { value.into_id().await.unwrap().quote() })
7939 }),
7940 );
7941 query = query.arg("description", description.into());
7942 Env {
7943 proc: self.proc.clone(),
7944 selection: query,
7945 graphql_client: self.graphql_client.clone(),
7946 }
7947 }
7948 pub fn with_cloud_output(
7955 &self,
7956 name: impl Into<String>,
7957 description: impl Into<String>,
7958 ) -> Env {
7959 let mut query = self.selection.select("withCloudOutput");
7960 query = query.arg("name", name.into());
7961 query = query.arg("description", description.into());
7962 Env {
7963 proc: self.proc.clone(),
7964 selection: query,
7965 graphql_client: self.graphql_client.clone(),
7966 }
7967 }
7968 pub fn with_container_input(
7976 &self,
7977 name: impl Into<String>,
7978 value: impl IntoID<ContainerId>,
7979 description: impl Into<String>,
7980 ) -> Env {
7981 let mut query = self.selection.select("withContainerInput");
7982 query = query.arg("name", name.into());
7983 query = query.arg_lazy(
7984 "value",
7985 Box::new(move || {
7986 let value = value.clone();
7987 Box::pin(async move { value.into_id().await.unwrap().quote() })
7988 }),
7989 );
7990 query = query.arg("description", description.into());
7991 Env {
7992 proc: self.proc.clone(),
7993 selection: query,
7994 graphql_client: self.graphql_client.clone(),
7995 }
7996 }
7997 pub fn with_container_output(
8004 &self,
8005 name: impl Into<String>,
8006 description: impl Into<String>,
8007 ) -> Env {
8008 let mut query = self.selection.select("withContainerOutput");
8009 query = query.arg("name", name.into());
8010 query = query.arg("description", description.into());
8011 Env {
8012 proc: self.proc.clone(),
8013 selection: query,
8014 graphql_client: self.graphql_client.clone(),
8015 }
8016 }
8017 pub fn with_current_module(&self) -> Env {
8020 let query = self.selection.select("withCurrentModule");
8021 Env {
8022 proc: self.proc.clone(),
8023 selection: query,
8024 graphql_client: self.graphql_client.clone(),
8025 }
8026 }
8027 pub fn with_diff_stat_input(
8035 &self,
8036 name: impl Into<String>,
8037 value: impl IntoID<DiffStatId>,
8038 description: impl Into<String>,
8039 ) -> Env {
8040 let mut query = self.selection.select("withDiffStatInput");
8041 query = query.arg("name", name.into());
8042 query = query.arg_lazy(
8043 "value",
8044 Box::new(move || {
8045 let value = value.clone();
8046 Box::pin(async move { value.into_id().await.unwrap().quote() })
8047 }),
8048 );
8049 query = query.arg("description", description.into());
8050 Env {
8051 proc: self.proc.clone(),
8052 selection: query,
8053 graphql_client: self.graphql_client.clone(),
8054 }
8055 }
8056 pub fn with_diff_stat_output(
8063 &self,
8064 name: impl Into<String>,
8065 description: impl Into<String>,
8066 ) -> Env {
8067 let mut query = self.selection.select("withDiffStatOutput");
8068 query = query.arg("name", name.into());
8069 query = query.arg("description", description.into());
8070 Env {
8071 proc: self.proc.clone(),
8072 selection: query,
8073 graphql_client: self.graphql_client.clone(),
8074 }
8075 }
8076 pub fn with_directory_input(
8084 &self,
8085 name: impl Into<String>,
8086 value: impl IntoID<DirectoryId>,
8087 description: impl Into<String>,
8088 ) -> Env {
8089 let mut query = self.selection.select("withDirectoryInput");
8090 query = query.arg("name", name.into());
8091 query = query.arg_lazy(
8092 "value",
8093 Box::new(move || {
8094 let value = value.clone();
8095 Box::pin(async move { value.into_id().await.unwrap().quote() })
8096 }),
8097 );
8098 query = query.arg("description", description.into());
8099 Env {
8100 proc: self.proc.clone(),
8101 selection: query,
8102 graphql_client: self.graphql_client.clone(),
8103 }
8104 }
8105 pub fn with_directory_output(
8112 &self,
8113 name: impl Into<String>,
8114 description: impl Into<String>,
8115 ) -> Env {
8116 let mut query = self.selection.select("withDirectoryOutput");
8117 query = query.arg("name", name.into());
8118 query = query.arg("description", description.into());
8119 Env {
8120 proc: self.proc.clone(),
8121 selection: query,
8122 graphql_client: self.graphql_client.clone(),
8123 }
8124 }
8125 pub fn with_env_file_input(
8133 &self,
8134 name: impl Into<String>,
8135 value: impl IntoID<EnvFileId>,
8136 description: impl Into<String>,
8137 ) -> Env {
8138 let mut query = self.selection.select("withEnvFileInput");
8139 query = query.arg("name", name.into());
8140 query = query.arg_lazy(
8141 "value",
8142 Box::new(move || {
8143 let value = value.clone();
8144 Box::pin(async move { value.into_id().await.unwrap().quote() })
8145 }),
8146 );
8147 query = query.arg("description", description.into());
8148 Env {
8149 proc: self.proc.clone(),
8150 selection: query,
8151 graphql_client: self.graphql_client.clone(),
8152 }
8153 }
8154 pub fn with_env_file_output(
8161 &self,
8162 name: impl Into<String>,
8163 description: impl Into<String>,
8164 ) -> Env {
8165 let mut query = self.selection.select("withEnvFileOutput");
8166 query = query.arg("name", name.into());
8167 query = query.arg("description", description.into());
8168 Env {
8169 proc: self.proc.clone(),
8170 selection: query,
8171 graphql_client: self.graphql_client.clone(),
8172 }
8173 }
8174 pub fn with_env_input(
8182 &self,
8183 name: impl Into<String>,
8184 value: impl IntoID<EnvId>,
8185 description: impl Into<String>,
8186 ) -> Env {
8187 let mut query = self.selection.select("withEnvInput");
8188 query = query.arg("name", name.into());
8189 query = query.arg_lazy(
8190 "value",
8191 Box::new(move || {
8192 let value = value.clone();
8193 Box::pin(async move { value.into_id().await.unwrap().quote() })
8194 }),
8195 );
8196 query = query.arg("description", description.into());
8197 Env {
8198 proc: self.proc.clone(),
8199 selection: query,
8200 graphql_client: self.graphql_client.clone(),
8201 }
8202 }
8203 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8210 let mut query = self.selection.select("withEnvOutput");
8211 query = query.arg("name", name.into());
8212 query = query.arg("description", description.into());
8213 Env {
8214 proc: self.proc.clone(),
8215 selection: query,
8216 graphql_client: self.graphql_client.clone(),
8217 }
8218 }
8219 pub fn with_file_input(
8227 &self,
8228 name: impl Into<String>,
8229 value: impl IntoID<FileId>,
8230 description: impl Into<String>,
8231 ) -> Env {
8232 let mut query = self.selection.select("withFileInput");
8233 query = query.arg("name", name.into());
8234 query = query.arg_lazy(
8235 "value",
8236 Box::new(move || {
8237 let value = value.clone();
8238 Box::pin(async move { value.into_id().await.unwrap().quote() })
8239 }),
8240 );
8241 query = query.arg("description", description.into());
8242 Env {
8243 proc: self.proc.clone(),
8244 selection: query,
8245 graphql_client: self.graphql_client.clone(),
8246 }
8247 }
8248 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8255 let mut query = self.selection.select("withFileOutput");
8256 query = query.arg("name", name.into());
8257 query = query.arg("description", description.into());
8258 Env {
8259 proc: self.proc.clone(),
8260 selection: query,
8261 graphql_client: self.graphql_client.clone(),
8262 }
8263 }
8264 pub fn with_generator_group_input(
8272 &self,
8273 name: impl Into<String>,
8274 value: impl IntoID<GeneratorGroupId>,
8275 description: impl Into<String>,
8276 ) -> Env {
8277 let mut query = self.selection.select("withGeneratorGroupInput");
8278 query = query.arg("name", name.into());
8279 query = query.arg_lazy(
8280 "value",
8281 Box::new(move || {
8282 let value = value.clone();
8283 Box::pin(async move { value.into_id().await.unwrap().quote() })
8284 }),
8285 );
8286 query = query.arg("description", description.into());
8287 Env {
8288 proc: self.proc.clone(),
8289 selection: query,
8290 graphql_client: self.graphql_client.clone(),
8291 }
8292 }
8293 pub fn with_generator_group_output(
8300 &self,
8301 name: impl Into<String>,
8302 description: impl Into<String>,
8303 ) -> Env {
8304 let mut query = self.selection.select("withGeneratorGroupOutput");
8305 query = query.arg("name", name.into());
8306 query = query.arg("description", description.into());
8307 Env {
8308 proc: self.proc.clone(),
8309 selection: query,
8310 graphql_client: self.graphql_client.clone(),
8311 }
8312 }
8313 pub fn with_generator_input(
8321 &self,
8322 name: impl Into<String>,
8323 value: impl IntoID<GeneratorId>,
8324 description: impl Into<String>,
8325 ) -> Env {
8326 let mut query = self.selection.select("withGeneratorInput");
8327 query = query.arg("name", name.into());
8328 query = query.arg_lazy(
8329 "value",
8330 Box::new(move || {
8331 let value = value.clone();
8332 Box::pin(async move { value.into_id().await.unwrap().quote() })
8333 }),
8334 );
8335 query = query.arg("description", description.into());
8336 Env {
8337 proc: self.proc.clone(),
8338 selection: query,
8339 graphql_client: self.graphql_client.clone(),
8340 }
8341 }
8342 pub fn with_generator_output(
8349 &self,
8350 name: impl Into<String>,
8351 description: impl Into<String>,
8352 ) -> Env {
8353 let mut query = self.selection.select("withGeneratorOutput");
8354 query = query.arg("name", name.into());
8355 query = query.arg("description", description.into());
8356 Env {
8357 proc: self.proc.clone(),
8358 selection: query,
8359 graphql_client: self.graphql_client.clone(),
8360 }
8361 }
8362 pub fn with_git_ref_input(
8370 &self,
8371 name: impl Into<String>,
8372 value: impl IntoID<GitRefId>,
8373 description: impl Into<String>,
8374 ) -> Env {
8375 let mut query = self.selection.select("withGitRefInput");
8376 query = query.arg("name", name.into());
8377 query = query.arg_lazy(
8378 "value",
8379 Box::new(move || {
8380 let value = value.clone();
8381 Box::pin(async move { value.into_id().await.unwrap().quote() })
8382 }),
8383 );
8384 query = query.arg("description", description.into());
8385 Env {
8386 proc: self.proc.clone(),
8387 selection: query,
8388 graphql_client: self.graphql_client.clone(),
8389 }
8390 }
8391 pub fn with_git_ref_output(
8398 &self,
8399 name: impl Into<String>,
8400 description: impl Into<String>,
8401 ) -> Env {
8402 let mut query = self.selection.select("withGitRefOutput");
8403 query = query.arg("name", name.into());
8404 query = query.arg("description", description.into());
8405 Env {
8406 proc: self.proc.clone(),
8407 selection: query,
8408 graphql_client: self.graphql_client.clone(),
8409 }
8410 }
8411 pub fn with_git_repository_input(
8419 &self,
8420 name: impl Into<String>,
8421 value: impl IntoID<GitRepositoryId>,
8422 description: impl Into<String>,
8423 ) -> Env {
8424 let mut query = self.selection.select("withGitRepositoryInput");
8425 query = query.arg("name", name.into());
8426 query = query.arg_lazy(
8427 "value",
8428 Box::new(move || {
8429 let value = value.clone();
8430 Box::pin(async move { value.into_id().await.unwrap().quote() })
8431 }),
8432 );
8433 query = query.arg("description", description.into());
8434 Env {
8435 proc: self.proc.clone(),
8436 selection: query,
8437 graphql_client: self.graphql_client.clone(),
8438 }
8439 }
8440 pub fn with_git_repository_output(
8447 &self,
8448 name: impl Into<String>,
8449 description: impl Into<String>,
8450 ) -> Env {
8451 let mut query = self.selection.select("withGitRepositoryOutput");
8452 query = query.arg("name", name.into());
8453 query = query.arg("description", description.into());
8454 Env {
8455 proc: self.proc.clone(),
8456 selection: query,
8457 graphql_client: self.graphql_client.clone(),
8458 }
8459 }
8460 pub fn with_http_state_input(
8468 &self,
8469 name: impl Into<String>,
8470 value: impl IntoID<HttpStateId>,
8471 description: impl Into<String>,
8472 ) -> Env {
8473 let mut query = self.selection.select("withHTTPStateInput");
8474 query = query.arg("name", name.into());
8475 query = query.arg_lazy(
8476 "value",
8477 Box::new(move || {
8478 let value = value.clone();
8479 Box::pin(async move { value.into_id().await.unwrap().quote() })
8480 }),
8481 );
8482 query = query.arg("description", description.into());
8483 Env {
8484 proc: self.proc.clone(),
8485 selection: query,
8486 graphql_client: self.graphql_client.clone(),
8487 }
8488 }
8489 pub fn with_http_state_output(
8496 &self,
8497 name: impl Into<String>,
8498 description: impl Into<String>,
8499 ) -> Env {
8500 let mut query = self.selection.select("withHTTPStateOutput");
8501 query = query.arg("name", name.into());
8502 query = query.arg("description", description.into());
8503 Env {
8504 proc: self.proc.clone(),
8505 selection: query,
8506 graphql_client: self.graphql_client.clone(),
8507 }
8508 }
8509 pub fn with_json_value_input(
8517 &self,
8518 name: impl Into<String>,
8519 value: impl IntoID<JsonValueId>,
8520 description: impl Into<String>,
8521 ) -> Env {
8522 let mut query = self.selection.select("withJSONValueInput");
8523 query = query.arg("name", name.into());
8524 query = query.arg_lazy(
8525 "value",
8526 Box::new(move || {
8527 let value = value.clone();
8528 Box::pin(async move { value.into_id().await.unwrap().quote() })
8529 }),
8530 );
8531 query = query.arg("description", description.into());
8532 Env {
8533 proc: self.proc.clone(),
8534 selection: query,
8535 graphql_client: self.graphql_client.clone(),
8536 }
8537 }
8538 pub fn with_json_value_output(
8545 &self,
8546 name: impl Into<String>,
8547 description: impl Into<String>,
8548 ) -> Env {
8549 let mut query = self.selection.select("withJSONValueOutput");
8550 query = query.arg("name", name.into());
8551 query = query.arg("description", description.into());
8552 Env {
8553 proc: self.proc.clone(),
8554 selection: query,
8555 graphql_client: self.graphql_client.clone(),
8556 }
8557 }
8558 pub fn with_main_module(&self, module: impl IntoID<ModuleId>) -> Env {
8561 let mut query = self.selection.select("withMainModule");
8562 query = query.arg_lazy(
8563 "module",
8564 Box::new(move || {
8565 let module = module.clone();
8566 Box::pin(async move { module.into_id().await.unwrap().quote() })
8567 }),
8568 );
8569 Env {
8570 proc: self.proc.clone(),
8571 selection: query,
8572 graphql_client: self.graphql_client.clone(),
8573 }
8574 }
8575 pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
8578 let mut query = self.selection.select("withModule");
8579 query = query.arg_lazy(
8580 "module",
8581 Box::new(move || {
8582 let module = module.clone();
8583 Box::pin(async move { module.into_id().await.unwrap().quote() })
8584 }),
8585 );
8586 Env {
8587 proc: self.proc.clone(),
8588 selection: query,
8589 graphql_client: self.graphql_client.clone(),
8590 }
8591 }
8592 pub fn with_module_config_client_input(
8600 &self,
8601 name: impl Into<String>,
8602 value: impl IntoID<ModuleConfigClientId>,
8603 description: impl Into<String>,
8604 ) -> Env {
8605 let mut query = self.selection.select("withModuleConfigClientInput");
8606 query = query.arg("name", name.into());
8607 query = query.arg_lazy(
8608 "value",
8609 Box::new(move || {
8610 let value = value.clone();
8611 Box::pin(async move { value.into_id().await.unwrap().quote() })
8612 }),
8613 );
8614 query = query.arg("description", description.into());
8615 Env {
8616 proc: self.proc.clone(),
8617 selection: query,
8618 graphql_client: self.graphql_client.clone(),
8619 }
8620 }
8621 pub fn with_module_config_client_output(
8628 &self,
8629 name: impl Into<String>,
8630 description: impl Into<String>,
8631 ) -> Env {
8632 let mut query = self.selection.select("withModuleConfigClientOutput");
8633 query = query.arg("name", name.into());
8634 query = query.arg("description", description.into());
8635 Env {
8636 proc: self.proc.clone(),
8637 selection: query,
8638 graphql_client: self.graphql_client.clone(),
8639 }
8640 }
8641 pub fn with_module_input(
8649 &self,
8650 name: impl Into<String>,
8651 value: impl IntoID<ModuleId>,
8652 description: impl Into<String>,
8653 ) -> Env {
8654 let mut query = self.selection.select("withModuleInput");
8655 query = query.arg("name", name.into());
8656 query = query.arg_lazy(
8657 "value",
8658 Box::new(move || {
8659 let value = value.clone();
8660 Box::pin(async move { value.into_id().await.unwrap().quote() })
8661 }),
8662 );
8663 query = query.arg("description", description.into());
8664 Env {
8665 proc: self.proc.clone(),
8666 selection: query,
8667 graphql_client: self.graphql_client.clone(),
8668 }
8669 }
8670 pub fn with_module_output(
8677 &self,
8678 name: impl Into<String>,
8679 description: impl Into<String>,
8680 ) -> Env {
8681 let mut query = self.selection.select("withModuleOutput");
8682 query = query.arg("name", name.into());
8683 query = query.arg("description", description.into());
8684 Env {
8685 proc: self.proc.clone(),
8686 selection: query,
8687 graphql_client: self.graphql_client.clone(),
8688 }
8689 }
8690 pub fn with_module_source_input(
8698 &self,
8699 name: impl Into<String>,
8700 value: impl IntoID<ModuleSourceId>,
8701 description: impl Into<String>,
8702 ) -> Env {
8703 let mut query = self.selection.select("withModuleSourceInput");
8704 query = query.arg("name", name.into());
8705 query = query.arg_lazy(
8706 "value",
8707 Box::new(move || {
8708 let value = value.clone();
8709 Box::pin(async move { value.into_id().await.unwrap().quote() })
8710 }),
8711 );
8712 query = query.arg("description", description.into());
8713 Env {
8714 proc: self.proc.clone(),
8715 selection: query,
8716 graphql_client: self.graphql_client.clone(),
8717 }
8718 }
8719 pub fn with_module_source_output(
8726 &self,
8727 name: impl Into<String>,
8728 description: impl Into<String>,
8729 ) -> Env {
8730 let mut query = self.selection.select("withModuleSourceOutput");
8731 query = query.arg("name", name.into());
8732 query = query.arg("description", description.into());
8733 Env {
8734 proc: self.proc.clone(),
8735 selection: query,
8736 graphql_client: self.graphql_client.clone(),
8737 }
8738 }
8739 pub fn with_search_result_input(
8747 &self,
8748 name: impl Into<String>,
8749 value: impl IntoID<SearchResultId>,
8750 description: impl Into<String>,
8751 ) -> Env {
8752 let mut query = self.selection.select("withSearchResultInput");
8753 query = query.arg("name", name.into());
8754 query = query.arg_lazy(
8755 "value",
8756 Box::new(move || {
8757 let value = value.clone();
8758 Box::pin(async move { value.into_id().await.unwrap().quote() })
8759 }),
8760 );
8761 query = query.arg("description", description.into());
8762 Env {
8763 proc: self.proc.clone(),
8764 selection: query,
8765 graphql_client: self.graphql_client.clone(),
8766 }
8767 }
8768 pub fn with_search_result_output(
8775 &self,
8776 name: impl Into<String>,
8777 description: impl Into<String>,
8778 ) -> Env {
8779 let mut query = self.selection.select("withSearchResultOutput");
8780 query = query.arg("name", name.into());
8781 query = query.arg("description", description.into());
8782 Env {
8783 proc: self.proc.clone(),
8784 selection: query,
8785 graphql_client: self.graphql_client.clone(),
8786 }
8787 }
8788 pub fn with_search_submatch_input(
8796 &self,
8797 name: impl Into<String>,
8798 value: impl IntoID<SearchSubmatchId>,
8799 description: impl Into<String>,
8800 ) -> Env {
8801 let mut query = self.selection.select("withSearchSubmatchInput");
8802 query = query.arg("name", name.into());
8803 query = query.arg_lazy(
8804 "value",
8805 Box::new(move || {
8806 let value = value.clone();
8807 Box::pin(async move { value.into_id().await.unwrap().quote() })
8808 }),
8809 );
8810 query = query.arg("description", description.into());
8811 Env {
8812 proc: self.proc.clone(),
8813 selection: query,
8814 graphql_client: self.graphql_client.clone(),
8815 }
8816 }
8817 pub fn with_search_submatch_output(
8824 &self,
8825 name: impl Into<String>,
8826 description: impl Into<String>,
8827 ) -> Env {
8828 let mut query = self.selection.select("withSearchSubmatchOutput");
8829 query = query.arg("name", name.into());
8830 query = query.arg("description", description.into());
8831 Env {
8832 proc: self.proc.clone(),
8833 selection: query,
8834 graphql_client: self.graphql_client.clone(),
8835 }
8836 }
8837 pub fn with_secret_input(
8845 &self,
8846 name: impl Into<String>,
8847 value: impl IntoID<SecretId>,
8848 description: impl Into<String>,
8849 ) -> Env {
8850 let mut query = self.selection.select("withSecretInput");
8851 query = query.arg("name", name.into());
8852 query = query.arg_lazy(
8853 "value",
8854 Box::new(move || {
8855 let value = value.clone();
8856 Box::pin(async move { value.into_id().await.unwrap().quote() })
8857 }),
8858 );
8859 query = query.arg("description", description.into());
8860 Env {
8861 proc: self.proc.clone(),
8862 selection: query,
8863 graphql_client: self.graphql_client.clone(),
8864 }
8865 }
8866 pub fn with_secret_output(
8873 &self,
8874 name: impl Into<String>,
8875 description: impl Into<String>,
8876 ) -> Env {
8877 let mut query = self.selection.select("withSecretOutput");
8878 query = query.arg("name", name.into());
8879 query = query.arg("description", description.into());
8880 Env {
8881 proc: self.proc.clone(),
8882 selection: query,
8883 graphql_client: self.graphql_client.clone(),
8884 }
8885 }
8886 pub fn with_service_input(
8894 &self,
8895 name: impl Into<String>,
8896 value: impl IntoID<ServiceId>,
8897 description: impl Into<String>,
8898 ) -> Env {
8899 let mut query = self.selection.select("withServiceInput");
8900 query = query.arg("name", name.into());
8901 query = query.arg_lazy(
8902 "value",
8903 Box::new(move || {
8904 let value = value.clone();
8905 Box::pin(async move { value.into_id().await.unwrap().quote() })
8906 }),
8907 );
8908 query = query.arg("description", description.into());
8909 Env {
8910 proc: self.proc.clone(),
8911 selection: query,
8912 graphql_client: self.graphql_client.clone(),
8913 }
8914 }
8915 pub fn with_service_output(
8922 &self,
8923 name: impl Into<String>,
8924 description: impl Into<String>,
8925 ) -> Env {
8926 let mut query = self.selection.select("withServiceOutput");
8927 query = query.arg("name", name.into());
8928 query = query.arg("description", description.into());
8929 Env {
8930 proc: self.proc.clone(),
8931 selection: query,
8932 graphql_client: self.graphql_client.clone(),
8933 }
8934 }
8935 pub fn with_socket_input(
8943 &self,
8944 name: impl Into<String>,
8945 value: impl IntoID<SocketId>,
8946 description: impl Into<String>,
8947 ) -> Env {
8948 let mut query = self.selection.select("withSocketInput");
8949 query = query.arg("name", name.into());
8950 query = query.arg_lazy(
8951 "value",
8952 Box::new(move || {
8953 let value = value.clone();
8954 Box::pin(async move { value.into_id().await.unwrap().quote() })
8955 }),
8956 );
8957 query = query.arg("description", description.into());
8958 Env {
8959 proc: self.proc.clone(),
8960 selection: query,
8961 graphql_client: self.graphql_client.clone(),
8962 }
8963 }
8964 pub fn with_socket_output(
8971 &self,
8972 name: impl Into<String>,
8973 description: impl Into<String>,
8974 ) -> Env {
8975 let mut query = self.selection.select("withSocketOutput");
8976 query = query.arg("name", name.into());
8977 query = query.arg("description", description.into());
8978 Env {
8979 proc: self.proc.clone(),
8980 selection: query,
8981 graphql_client: self.graphql_client.clone(),
8982 }
8983 }
8984 pub fn with_stat_input(
8992 &self,
8993 name: impl Into<String>,
8994 value: impl IntoID<StatId>,
8995 description: impl Into<String>,
8996 ) -> Env {
8997 let mut query = self.selection.select("withStatInput");
8998 query = query.arg("name", name.into());
8999 query = query.arg_lazy(
9000 "value",
9001 Box::new(move || {
9002 let value = value.clone();
9003 Box::pin(async move { value.into_id().await.unwrap().quote() })
9004 }),
9005 );
9006 query = query.arg("description", description.into());
9007 Env {
9008 proc: self.proc.clone(),
9009 selection: query,
9010 graphql_client: self.graphql_client.clone(),
9011 }
9012 }
9013 pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
9020 let mut query = self.selection.select("withStatOutput");
9021 query = query.arg("name", name.into());
9022 query = query.arg("description", description.into());
9023 Env {
9024 proc: self.proc.clone(),
9025 selection: query,
9026 graphql_client: self.graphql_client.clone(),
9027 }
9028 }
9029 pub fn with_string_input(
9037 &self,
9038 name: impl Into<String>,
9039 value: impl Into<String>,
9040 description: impl Into<String>,
9041 ) -> Env {
9042 let mut query = self.selection.select("withStringInput");
9043 query = query.arg("name", name.into());
9044 query = query.arg("value", value.into());
9045 query = query.arg("description", description.into());
9046 Env {
9047 proc: self.proc.clone(),
9048 selection: query,
9049 graphql_client: self.graphql_client.clone(),
9050 }
9051 }
9052 pub fn with_string_output(
9059 &self,
9060 name: impl Into<String>,
9061 description: impl Into<String>,
9062 ) -> Env {
9063 let mut query = self.selection.select("withStringOutput");
9064 query = query.arg("name", name.into());
9065 query = query.arg("description", description.into());
9066 Env {
9067 proc: self.proc.clone(),
9068 selection: query,
9069 graphql_client: self.graphql_client.clone(),
9070 }
9071 }
9072 pub fn with_up_group_input(
9080 &self,
9081 name: impl Into<String>,
9082 value: impl IntoID<UpGroupId>,
9083 description: impl Into<String>,
9084 ) -> Env {
9085 let mut query = self.selection.select("withUpGroupInput");
9086 query = query.arg("name", name.into());
9087 query = query.arg_lazy(
9088 "value",
9089 Box::new(move || {
9090 let value = value.clone();
9091 Box::pin(async move { value.into_id().await.unwrap().quote() })
9092 }),
9093 );
9094 query = query.arg("description", description.into());
9095 Env {
9096 proc: self.proc.clone(),
9097 selection: query,
9098 graphql_client: self.graphql_client.clone(),
9099 }
9100 }
9101 pub fn with_up_group_output(
9108 &self,
9109 name: impl Into<String>,
9110 description: impl Into<String>,
9111 ) -> Env {
9112 let mut query = self.selection.select("withUpGroupOutput");
9113 query = query.arg("name", name.into());
9114 query = query.arg("description", description.into());
9115 Env {
9116 proc: self.proc.clone(),
9117 selection: query,
9118 graphql_client: self.graphql_client.clone(),
9119 }
9120 }
9121 pub fn with_up_input(
9129 &self,
9130 name: impl Into<String>,
9131 value: impl IntoID<UpId>,
9132 description: impl Into<String>,
9133 ) -> Env {
9134 let mut query = self.selection.select("withUpInput");
9135 query = query.arg("name", name.into());
9136 query = query.arg_lazy(
9137 "value",
9138 Box::new(move || {
9139 let value = value.clone();
9140 Box::pin(async move { value.into_id().await.unwrap().quote() })
9141 }),
9142 );
9143 query = query.arg("description", description.into());
9144 Env {
9145 proc: self.proc.clone(),
9146 selection: query,
9147 graphql_client: self.graphql_client.clone(),
9148 }
9149 }
9150 pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
9157 let mut query = self.selection.select("withUpOutput");
9158 query = query.arg("name", name.into());
9159 query = query.arg("description", description.into());
9160 Env {
9161 proc: self.proc.clone(),
9162 selection: query,
9163 graphql_client: self.graphql_client.clone(),
9164 }
9165 }
9166 pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
9172 let mut query = self.selection.select("withWorkspace");
9173 query = query.arg_lazy(
9174 "workspace",
9175 Box::new(move || {
9176 let workspace = workspace.clone();
9177 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
9178 }),
9179 );
9180 Env {
9181 proc: self.proc.clone(),
9182 selection: query,
9183 graphql_client: self.graphql_client.clone(),
9184 }
9185 }
9186 pub fn with_workspace_input(
9194 &self,
9195 name: impl Into<String>,
9196 value: impl IntoID<WorkspaceId>,
9197 description: impl Into<String>,
9198 ) -> Env {
9199 let mut query = self.selection.select("withWorkspaceInput");
9200 query = query.arg("name", name.into());
9201 query = query.arg_lazy(
9202 "value",
9203 Box::new(move || {
9204 let value = value.clone();
9205 Box::pin(async move { value.into_id().await.unwrap().quote() })
9206 }),
9207 );
9208 query = query.arg("description", description.into());
9209 Env {
9210 proc: self.proc.clone(),
9211 selection: query,
9212 graphql_client: self.graphql_client.clone(),
9213 }
9214 }
9215 pub fn with_workspace_output(
9222 &self,
9223 name: impl Into<String>,
9224 description: impl Into<String>,
9225 ) -> Env {
9226 let mut query = self.selection.select("withWorkspaceOutput");
9227 query = query.arg("name", name.into());
9228 query = query.arg("description", description.into());
9229 Env {
9230 proc: self.proc.clone(),
9231 selection: query,
9232 graphql_client: self.graphql_client.clone(),
9233 }
9234 }
9235 pub fn without_outputs(&self) -> Env {
9237 let query = self.selection.select("withoutOutputs");
9238 Env {
9239 proc: self.proc.clone(),
9240 selection: query,
9241 graphql_client: self.graphql_client.clone(),
9242 }
9243 }
9244 pub fn workspace(&self) -> Directory {
9245 let query = self.selection.select("workspace");
9246 Directory {
9247 proc: self.proc.clone(),
9248 selection: query,
9249 graphql_client: self.graphql_client.clone(),
9250 }
9251 }
9252}
9253#[derive(Clone)]
9254pub struct EnvFile {
9255 pub proc: Option<Arc<DaggerSessionProc>>,
9256 pub selection: Selection,
9257 pub graphql_client: DynGraphQLClient,
9258}
9259#[derive(Builder, Debug, PartialEq)]
9260pub struct EnvFileGetOpts {
9261 #[builder(setter(into, strip_option), default)]
9263 pub raw: Option<bool>,
9264}
9265#[derive(Builder, Debug, PartialEq)]
9266pub struct EnvFileVariablesOpts {
9267 #[builder(setter(into, strip_option), default)]
9269 pub raw: Option<bool>,
9270}
9271impl EnvFile {
9272 pub fn as_file(&self) -> File {
9274 let query = self.selection.select("asFile");
9275 File {
9276 proc: self.proc.clone(),
9277 selection: query,
9278 graphql_client: self.graphql_client.clone(),
9279 }
9280 }
9281 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
9287 let mut query = self.selection.select("exists");
9288 query = query.arg("name", name.into());
9289 query.execute(self.graphql_client.clone()).await
9290 }
9291 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
9298 let mut query = self.selection.select("get");
9299 query = query.arg("name", name.into());
9300 query.execute(self.graphql_client.clone()).await
9301 }
9302 pub async fn get_opts(
9309 &self,
9310 name: impl Into<String>,
9311 opts: EnvFileGetOpts,
9312 ) -> Result<String, DaggerError> {
9313 let mut query = self.selection.select("get");
9314 query = query.arg("name", name.into());
9315 if let Some(raw) = opts.raw {
9316 query = query.arg("raw", raw);
9317 }
9318 query.execute(self.graphql_client.clone()).await
9319 }
9320 pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
9322 let query = self.selection.select("id");
9323 query.execute(self.graphql_client.clone()).await
9324 }
9325 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
9331 let mut query = self.selection.select("namespace");
9332 query = query.arg("prefix", prefix.into());
9333 EnvFile {
9334 proc: self.proc.clone(),
9335 selection: query,
9336 graphql_client: self.graphql_client.clone(),
9337 }
9338 }
9339 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
9345 let query = self.selection.select("variables");
9346 let query = query.select("id");
9347 let ids: Vec<EnvVariableId> = query.execute(self.graphql_client.clone()).await?;
9348 let root = Query {
9349 proc: self.proc.clone(),
9350 selection: crate::querybuilder::query(),
9351 graphql_client: self.graphql_client.clone(),
9352 };
9353 Ok(ids
9354 .into_iter()
9355 .map(|id| root.load_env_variable_from_id(id))
9356 .collect())
9357 }
9358 pub async fn variables_opts(
9364 &self,
9365 opts: EnvFileVariablesOpts,
9366 ) -> Result<Vec<EnvVariable>, DaggerError> {
9367 let mut query = self.selection.select("variables");
9368 if let Some(raw) = opts.raw {
9369 query = query.arg("raw", raw);
9370 }
9371 let query = query.select("id");
9372 let ids: Vec<EnvVariableId> = query.execute(self.graphql_client.clone()).await?;
9373 let root = Query {
9374 proc: self.proc.clone(),
9375 selection: crate::querybuilder::query(),
9376 graphql_client: self.graphql_client.clone(),
9377 };
9378 Ok(ids
9379 .into_iter()
9380 .map(|id| root.load_env_variable_from_id(id))
9381 .collect())
9382 }
9383 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
9390 let mut query = self.selection.select("withVariable");
9391 query = query.arg("name", name.into());
9392 query = query.arg("value", value.into());
9393 EnvFile {
9394 proc: self.proc.clone(),
9395 selection: query,
9396 graphql_client: self.graphql_client.clone(),
9397 }
9398 }
9399 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
9405 let mut query = self.selection.select("withoutVariable");
9406 query = query.arg("name", name.into());
9407 EnvFile {
9408 proc: self.proc.clone(),
9409 selection: query,
9410 graphql_client: self.graphql_client.clone(),
9411 }
9412 }
9413}
9414#[derive(Clone)]
9415pub struct EnvVariable {
9416 pub proc: Option<Arc<DaggerSessionProc>>,
9417 pub selection: Selection,
9418 pub graphql_client: DynGraphQLClient,
9419}
9420impl EnvVariable {
9421 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
9423 let query = self.selection.select("id");
9424 query.execute(self.graphql_client.clone()).await
9425 }
9426 pub async fn name(&self) -> Result<String, DaggerError> {
9428 let query = self.selection.select("name");
9429 query.execute(self.graphql_client.clone()).await
9430 }
9431 pub async fn value(&self) -> Result<String, DaggerError> {
9433 let query = self.selection.select("value");
9434 query.execute(self.graphql_client.clone()).await
9435 }
9436}
9437#[derive(Clone)]
9438pub struct Error {
9439 pub proc: Option<Arc<DaggerSessionProc>>,
9440 pub selection: Selection,
9441 pub graphql_client: DynGraphQLClient,
9442}
9443impl Error {
9444 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
9446 let query = self.selection.select("id");
9447 query.execute(self.graphql_client.clone()).await
9448 }
9449 pub async fn message(&self) -> Result<String, DaggerError> {
9451 let query = self.selection.select("message");
9452 query.execute(self.graphql_client.clone()).await
9453 }
9454 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
9456 let query = self.selection.select("values");
9457 let query = query.select("id");
9458 let ids: Vec<ErrorValueId> = query.execute(self.graphql_client.clone()).await?;
9459 let root = Query {
9460 proc: self.proc.clone(),
9461 selection: crate::querybuilder::query(),
9462 graphql_client: self.graphql_client.clone(),
9463 };
9464 Ok(ids
9465 .into_iter()
9466 .map(|id| root.load_error_value_from_id(id))
9467 .collect())
9468 }
9469 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
9476 let mut query = self.selection.select("withValue");
9477 query = query.arg("name", name.into());
9478 query = query.arg("value", value);
9479 Error {
9480 proc: self.proc.clone(),
9481 selection: query,
9482 graphql_client: self.graphql_client.clone(),
9483 }
9484 }
9485}
9486#[derive(Clone)]
9487pub struct ErrorValue {
9488 pub proc: Option<Arc<DaggerSessionProc>>,
9489 pub selection: Selection,
9490 pub graphql_client: DynGraphQLClient,
9491}
9492impl ErrorValue {
9493 pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
9495 let query = self.selection.select("id");
9496 query.execute(self.graphql_client.clone()).await
9497 }
9498 pub async fn name(&self) -> Result<String, DaggerError> {
9500 let query = self.selection.select("name");
9501 query.execute(self.graphql_client.clone()).await
9502 }
9503 pub async fn value(&self) -> Result<Json, DaggerError> {
9505 let query = self.selection.select("value");
9506 query.execute(self.graphql_client.clone()).await
9507 }
9508}
9509#[derive(Clone)]
9510pub struct FieldTypeDef {
9511 pub proc: Option<Arc<DaggerSessionProc>>,
9512 pub selection: Selection,
9513 pub graphql_client: DynGraphQLClient,
9514}
9515impl FieldTypeDef {
9516 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9518 let query = self.selection.select("deprecated");
9519 query.execute(self.graphql_client.clone()).await
9520 }
9521 pub async fn description(&self) -> Result<String, DaggerError> {
9523 let query = self.selection.select("description");
9524 query.execute(self.graphql_client.clone()).await
9525 }
9526 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
9528 let query = self.selection.select("id");
9529 query.execute(self.graphql_client.clone()).await
9530 }
9531 pub async fn name(&self) -> Result<String, DaggerError> {
9533 let query = self.selection.select("name");
9534 query.execute(self.graphql_client.clone()).await
9535 }
9536 pub fn source_map(&self) -> SourceMap {
9538 let query = self.selection.select("sourceMap");
9539 SourceMap {
9540 proc: self.proc.clone(),
9541 selection: query,
9542 graphql_client: self.graphql_client.clone(),
9543 }
9544 }
9545 pub fn type_def(&self) -> TypeDef {
9547 let query = self.selection.select("typeDef");
9548 TypeDef {
9549 proc: self.proc.clone(),
9550 selection: query,
9551 graphql_client: self.graphql_client.clone(),
9552 }
9553 }
9554}
9555#[derive(Clone)]
9556pub struct File {
9557 pub proc: Option<Arc<DaggerSessionProc>>,
9558 pub selection: Selection,
9559 pub graphql_client: DynGraphQLClient,
9560}
9561#[derive(Builder, Debug, PartialEq)]
9562pub struct FileAsEnvFileOpts {
9563 #[builder(setter(into, strip_option), default)]
9565 pub expand: Option<bool>,
9566}
9567#[derive(Builder, Debug, PartialEq)]
9568pub struct FileContentsOpts {
9569 #[builder(setter(into, strip_option), default)]
9571 pub limit_lines: Option<isize>,
9572 #[builder(setter(into, strip_option), default)]
9574 pub offset_lines: Option<isize>,
9575}
9576#[derive(Builder, Debug, PartialEq)]
9577pub struct FileDigestOpts {
9578 #[builder(setter(into, strip_option), default)]
9580 pub exclude_metadata: Option<bool>,
9581}
9582#[derive(Builder, Debug, PartialEq)]
9583pub struct FileExportOpts {
9584 #[builder(setter(into, strip_option), default)]
9586 pub allow_parent_dir_path: Option<bool>,
9587}
9588#[derive(Builder, Debug, PartialEq)]
9589pub struct FileSearchOpts<'a> {
9590 #[builder(setter(into, strip_option), default)]
9592 pub dotall: Option<bool>,
9593 #[builder(setter(into, strip_option), default)]
9595 pub files_only: Option<bool>,
9596 #[builder(setter(into, strip_option), default)]
9597 pub globs: Option<Vec<&'a str>>,
9598 #[builder(setter(into, strip_option), default)]
9600 pub insensitive: Option<bool>,
9601 #[builder(setter(into, strip_option), default)]
9603 pub limit: Option<isize>,
9604 #[builder(setter(into, strip_option), default)]
9606 pub literal: Option<bool>,
9607 #[builder(setter(into, strip_option), default)]
9609 pub multiline: Option<bool>,
9610 #[builder(setter(into, strip_option), default)]
9611 pub paths: Option<Vec<&'a str>>,
9612 #[builder(setter(into, strip_option), default)]
9614 pub skip_hidden: Option<bool>,
9615 #[builder(setter(into, strip_option), default)]
9617 pub skip_ignored: Option<bool>,
9618}
9619#[derive(Builder, Debug, PartialEq)]
9620pub struct FileWithReplacedOpts {
9621 #[builder(setter(into, strip_option), default)]
9623 pub all: Option<bool>,
9624 #[builder(setter(into, strip_option), default)]
9626 pub first_from: Option<isize>,
9627}
9628impl File {
9629 pub fn as_env_file(&self) -> EnvFile {
9635 let query = self.selection.select("asEnvFile");
9636 EnvFile {
9637 proc: self.proc.clone(),
9638 selection: query,
9639 graphql_client: self.graphql_client.clone(),
9640 }
9641 }
9642 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9648 let mut query = self.selection.select("asEnvFile");
9649 if let Some(expand) = opts.expand {
9650 query = query.arg("expand", expand);
9651 }
9652 EnvFile {
9653 proc: self.proc.clone(),
9654 selection: query,
9655 graphql_client: self.graphql_client.clone(),
9656 }
9657 }
9658 pub fn as_json(&self) -> JsonValue {
9660 let query = self.selection.select("asJSON");
9661 JsonValue {
9662 proc: self.proc.clone(),
9663 selection: query,
9664 graphql_client: self.graphql_client.clone(),
9665 }
9666 }
9667 pub fn chown(&self, owner: impl Into<String>) -> File {
9677 let mut query = self.selection.select("chown");
9678 query = query.arg("owner", owner.into());
9679 File {
9680 proc: self.proc.clone(),
9681 selection: query,
9682 graphql_client: self.graphql_client.clone(),
9683 }
9684 }
9685 pub async fn contents(&self) -> Result<String, DaggerError> {
9691 let query = self.selection.select("contents");
9692 query.execute(self.graphql_client.clone()).await
9693 }
9694 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9700 let mut query = self.selection.select("contents");
9701 if let Some(offset_lines) = opts.offset_lines {
9702 query = query.arg("offsetLines", offset_lines);
9703 }
9704 if let Some(limit_lines) = opts.limit_lines {
9705 query = query.arg("limitLines", limit_lines);
9706 }
9707 query.execute(self.graphql_client.clone()).await
9708 }
9709 pub async fn digest(&self) -> Result<String, DaggerError> {
9715 let query = self.selection.select("digest");
9716 query.execute(self.graphql_client.clone()).await
9717 }
9718 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9724 let mut query = self.selection.select("digest");
9725 if let Some(exclude_metadata) = opts.exclude_metadata {
9726 query = query.arg("excludeMetadata", exclude_metadata);
9727 }
9728 query.execute(self.graphql_client.clone()).await
9729 }
9730 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9737 let mut query = self.selection.select("export");
9738 query = query.arg("path", path.into());
9739 query.execute(self.graphql_client.clone()).await
9740 }
9741 pub async fn export_opts(
9748 &self,
9749 path: impl Into<String>,
9750 opts: FileExportOpts,
9751 ) -> Result<String, DaggerError> {
9752 let mut query = self.selection.select("export");
9753 query = query.arg("path", path.into());
9754 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9755 query = query.arg("allowParentDirPath", allow_parent_dir_path);
9756 }
9757 query.execute(self.graphql_client.clone()).await
9758 }
9759 pub async fn id(&self) -> Result<FileId, DaggerError> {
9761 let query = self.selection.select("id");
9762 query.execute(self.graphql_client.clone()).await
9763 }
9764 pub async fn name(&self) -> Result<String, DaggerError> {
9766 let query = self.selection.select("name");
9767 query.execute(self.graphql_client.clone()).await
9768 }
9769 pub async fn search(
9777 &self,
9778 pattern: impl Into<String>,
9779 ) -> Result<Vec<SearchResult>, DaggerError> {
9780 let mut query = self.selection.select("search");
9781 query = query.arg("pattern", pattern.into());
9782 let query = query.select("id");
9783 let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
9784 let root = Query {
9785 proc: self.proc.clone(),
9786 selection: crate::querybuilder::query(),
9787 graphql_client: self.graphql_client.clone(),
9788 };
9789 Ok(ids
9790 .into_iter()
9791 .map(|id| root.load_search_result_from_id(id))
9792 .collect())
9793 }
9794 pub async fn search_opts<'a>(
9802 &self,
9803 pattern: impl Into<String>,
9804 opts: FileSearchOpts<'a>,
9805 ) -> Result<Vec<SearchResult>, DaggerError> {
9806 let mut query = self.selection.select("search");
9807 query = query.arg("pattern", pattern.into());
9808 if let Some(literal) = opts.literal {
9809 query = query.arg("literal", literal);
9810 }
9811 if let Some(multiline) = opts.multiline {
9812 query = query.arg("multiline", multiline);
9813 }
9814 if let Some(dotall) = opts.dotall {
9815 query = query.arg("dotall", dotall);
9816 }
9817 if let Some(insensitive) = opts.insensitive {
9818 query = query.arg("insensitive", insensitive);
9819 }
9820 if let Some(skip_ignored) = opts.skip_ignored {
9821 query = query.arg("skipIgnored", skip_ignored);
9822 }
9823 if let Some(skip_hidden) = opts.skip_hidden {
9824 query = query.arg("skipHidden", skip_hidden);
9825 }
9826 if let Some(files_only) = opts.files_only {
9827 query = query.arg("filesOnly", files_only);
9828 }
9829 if let Some(limit) = opts.limit {
9830 query = query.arg("limit", limit);
9831 }
9832 if let Some(paths) = opts.paths {
9833 query = query.arg("paths", paths);
9834 }
9835 if let Some(globs) = opts.globs {
9836 query = query.arg("globs", globs);
9837 }
9838 let query = query.select("id");
9839 let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
9840 let root = Query {
9841 proc: self.proc.clone(),
9842 selection: crate::querybuilder::query(),
9843 graphql_client: self.graphql_client.clone(),
9844 };
9845 Ok(ids
9846 .into_iter()
9847 .map(|id| root.load_search_result_from_id(id))
9848 .collect())
9849 }
9850 pub async fn size(&self) -> Result<isize, DaggerError> {
9852 let query = self.selection.select("size");
9853 query.execute(self.graphql_client.clone()).await
9854 }
9855 pub fn stat(&self) -> Stat {
9857 let query = self.selection.select("stat");
9858 Stat {
9859 proc: self.proc.clone(),
9860 selection: query,
9861 graphql_client: self.graphql_client.clone(),
9862 }
9863 }
9864 pub async fn sync(&self) -> Result<FileId, DaggerError> {
9866 let query = self.selection.select("sync");
9867 query.execute(self.graphql_client.clone()).await
9868 }
9869 pub fn with_name(&self, name: impl Into<String>) -> File {
9875 let mut query = self.selection.select("withName");
9876 query = query.arg("name", name.into());
9877 File {
9878 proc: self.proc.clone(),
9879 selection: query,
9880 graphql_client: self.graphql_client.clone(),
9881 }
9882 }
9883 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9895 let mut query = self.selection.select("withReplaced");
9896 query = query.arg("search", search.into());
9897 query = query.arg("replacement", replacement.into());
9898 File {
9899 proc: self.proc.clone(),
9900 selection: query,
9901 graphql_client: self.graphql_client.clone(),
9902 }
9903 }
9904 pub fn with_replaced_opts(
9916 &self,
9917 search: impl Into<String>,
9918 replacement: impl Into<String>,
9919 opts: FileWithReplacedOpts,
9920 ) -> File {
9921 let mut query = self.selection.select("withReplaced");
9922 query = query.arg("search", search.into());
9923 query = query.arg("replacement", replacement.into());
9924 if let Some(all) = opts.all {
9925 query = query.arg("all", all);
9926 }
9927 if let Some(first_from) = opts.first_from {
9928 query = query.arg("firstFrom", first_from);
9929 }
9930 File {
9931 proc: self.proc.clone(),
9932 selection: query,
9933 graphql_client: self.graphql_client.clone(),
9934 }
9935 }
9936 pub fn with_timestamps(&self, timestamp: isize) -> File {
9944 let mut query = self.selection.select("withTimestamps");
9945 query = query.arg("timestamp", timestamp);
9946 File {
9947 proc: self.proc.clone(),
9948 selection: query,
9949 graphql_client: self.graphql_client.clone(),
9950 }
9951 }
9952}
9953#[derive(Clone)]
9954pub struct Function {
9955 pub proc: Option<Arc<DaggerSessionProc>>,
9956 pub selection: Selection,
9957 pub graphql_client: DynGraphQLClient,
9958}
9959#[derive(Builder, Debug, PartialEq)]
9960pub struct FunctionWithArgOpts<'a> {
9961 #[builder(setter(into, strip_option), default)]
9962 pub default_address: Option<&'a str>,
9963 #[builder(setter(into, strip_option), default)]
9965 pub default_path: Option<&'a str>,
9966 #[builder(setter(into, strip_option), default)]
9968 pub default_value: Option<Json>,
9969 #[builder(setter(into, strip_option), default)]
9971 pub deprecated: Option<&'a str>,
9972 #[builder(setter(into, strip_option), default)]
9974 pub description: Option<&'a str>,
9975 #[builder(setter(into, strip_option), default)]
9977 pub ignore: Option<Vec<&'a str>>,
9978 #[builder(setter(into, strip_option), default)]
9980 pub source_map: Option<SourceMapId>,
9981}
9982#[derive(Builder, Debug, PartialEq)]
9983pub struct FunctionWithCachePolicyOpts<'a> {
9984 #[builder(setter(into, strip_option), default)]
9986 pub time_to_live: Option<&'a str>,
9987}
9988#[derive(Builder, Debug, PartialEq)]
9989pub struct FunctionWithDeprecatedOpts<'a> {
9990 #[builder(setter(into, strip_option), default)]
9992 pub reason: Option<&'a str>,
9993}
9994impl Function {
9995 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9997 let query = self.selection.select("args");
9998 let query = query.select("id");
9999 let ids: Vec<FunctionArgId> = query.execute(self.graphql_client.clone()).await?;
10000 let root = Query {
10001 proc: self.proc.clone(),
10002 selection: crate::querybuilder::query(),
10003 graphql_client: self.graphql_client.clone(),
10004 };
10005 Ok(ids
10006 .into_iter()
10007 .map(|id| root.load_function_arg_from_id(id))
10008 .collect())
10009 }
10010 pub async fn deprecated(&self) -> Result<String, DaggerError> {
10012 let query = self.selection.select("deprecated");
10013 query.execute(self.graphql_client.clone()).await
10014 }
10015 pub async fn description(&self) -> Result<String, DaggerError> {
10017 let query = self.selection.select("description");
10018 query.execute(self.graphql_client.clone()).await
10019 }
10020 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
10022 let query = self.selection.select("id");
10023 query.execute(self.graphql_client.clone()).await
10024 }
10025 pub async fn name(&self) -> Result<String, DaggerError> {
10027 let query = self.selection.select("name");
10028 query.execute(self.graphql_client.clone()).await
10029 }
10030 pub fn return_type(&self) -> TypeDef {
10032 let query = self.selection.select("returnType");
10033 TypeDef {
10034 proc: self.proc.clone(),
10035 selection: query,
10036 graphql_client: self.graphql_client.clone(),
10037 }
10038 }
10039 pub fn source_map(&self) -> SourceMap {
10041 let query = self.selection.select("sourceMap");
10042 SourceMap {
10043 proc: self.proc.clone(),
10044 selection: query,
10045 graphql_client: self.graphql_client.clone(),
10046 }
10047 }
10048 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10050 let query = self.selection.select("sourceModuleName");
10051 query.execute(self.graphql_client.clone()).await
10052 }
10053 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
10061 let mut query = self.selection.select("withArg");
10062 query = query.arg("name", name.into());
10063 query = query.arg_lazy(
10064 "typeDef",
10065 Box::new(move || {
10066 let type_def = type_def.clone();
10067 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10068 }),
10069 );
10070 Function {
10071 proc: self.proc.clone(),
10072 selection: query,
10073 graphql_client: self.graphql_client.clone(),
10074 }
10075 }
10076 pub fn with_arg_opts<'a>(
10084 &self,
10085 name: impl Into<String>,
10086 type_def: impl IntoID<TypeDefId>,
10087 opts: FunctionWithArgOpts<'a>,
10088 ) -> Function {
10089 let mut query = self.selection.select("withArg");
10090 query = query.arg("name", name.into());
10091 query = query.arg_lazy(
10092 "typeDef",
10093 Box::new(move || {
10094 let type_def = type_def.clone();
10095 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10096 }),
10097 );
10098 if let Some(description) = opts.description {
10099 query = query.arg("description", description);
10100 }
10101 if let Some(default_value) = opts.default_value {
10102 query = query.arg("defaultValue", default_value);
10103 }
10104 if let Some(default_path) = opts.default_path {
10105 query = query.arg("defaultPath", default_path);
10106 }
10107 if let Some(ignore) = opts.ignore {
10108 query = query.arg("ignore", ignore);
10109 }
10110 if let Some(source_map) = opts.source_map {
10111 query = query.arg("sourceMap", source_map);
10112 }
10113 if let Some(deprecated) = opts.deprecated {
10114 query = query.arg("deprecated", deprecated);
10115 }
10116 if let Some(default_address) = opts.default_address {
10117 query = query.arg("defaultAddress", default_address);
10118 }
10119 Function {
10120 proc: self.proc.clone(),
10121 selection: query,
10122 graphql_client: self.graphql_client.clone(),
10123 }
10124 }
10125 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
10132 let mut query = self.selection.select("withCachePolicy");
10133 query = query.arg("policy", policy);
10134 Function {
10135 proc: self.proc.clone(),
10136 selection: query,
10137 graphql_client: self.graphql_client.clone(),
10138 }
10139 }
10140 pub fn with_cache_policy_opts<'a>(
10147 &self,
10148 policy: FunctionCachePolicy,
10149 opts: FunctionWithCachePolicyOpts<'a>,
10150 ) -> Function {
10151 let mut query = self.selection.select("withCachePolicy");
10152 query = query.arg("policy", policy);
10153 if let Some(time_to_live) = opts.time_to_live {
10154 query = query.arg("timeToLive", time_to_live);
10155 }
10156 Function {
10157 proc: self.proc.clone(),
10158 selection: query,
10159 graphql_client: self.graphql_client.clone(),
10160 }
10161 }
10162 pub fn with_check(&self) -> Function {
10164 let query = self.selection.select("withCheck");
10165 Function {
10166 proc: self.proc.clone(),
10167 selection: query,
10168 graphql_client: self.graphql_client.clone(),
10169 }
10170 }
10171 pub fn with_deprecated(&self) -> Function {
10177 let query = self.selection.select("withDeprecated");
10178 Function {
10179 proc: self.proc.clone(),
10180 selection: query,
10181 graphql_client: self.graphql_client.clone(),
10182 }
10183 }
10184 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
10190 let mut query = self.selection.select("withDeprecated");
10191 if let Some(reason) = opts.reason {
10192 query = query.arg("reason", reason);
10193 }
10194 Function {
10195 proc: self.proc.clone(),
10196 selection: query,
10197 graphql_client: self.graphql_client.clone(),
10198 }
10199 }
10200 pub fn with_description(&self, description: impl Into<String>) -> Function {
10206 let mut query = self.selection.select("withDescription");
10207 query = query.arg("description", description.into());
10208 Function {
10209 proc: self.proc.clone(),
10210 selection: query,
10211 graphql_client: self.graphql_client.clone(),
10212 }
10213 }
10214 pub fn with_generator(&self) -> Function {
10216 let query = self.selection.select("withGenerator");
10217 Function {
10218 proc: self.proc.clone(),
10219 selection: query,
10220 graphql_client: self.graphql_client.clone(),
10221 }
10222 }
10223 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
10229 let mut query = self.selection.select("withSourceMap");
10230 query = query.arg_lazy(
10231 "sourceMap",
10232 Box::new(move || {
10233 let source_map = source_map.clone();
10234 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
10235 }),
10236 );
10237 Function {
10238 proc: self.proc.clone(),
10239 selection: query,
10240 graphql_client: self.graphql_client.clone(),
10241 }
10242 }
10243 pub fn with_up(&self) -> Function {
10245 let query = self.selection.select("withUp");
10246 Function {
10247 proc: self.proc.clone(),
10248 selection: query,
10249 graphql_client: self.graphql_client.clone(),
10250 }
10251 }
10252}
10253#[derive(Clone)]
10254pub struct FunctionArg {
10255 pub proc: Option<Arc<DaggerSessionProc>>,
10256 pub selection: Selection,
10257 pub graphql_client: DynGraphQLClient,
10258}
10259impl FunctionArg {
10260 pub async fn default_address(&self) -> Result<String, DaggerError> {
10262 let query = self.selection.select("defaultAddress");
10263 query.execute(self.graphql_client.clone()).await
10264 }
10265 pub async fn default_path(&self) -> Result<String, DaggerError> {
10267 let query = self.selection.select("defaultPath");
10268 query.execute(self.graphql_client.clone()).await
10269 }
10270 pub async fn default_value(&self) -> Result<Json, DaggerError> {
10272 let query = self.selection.select("defaultValue");
10273 query.execute(self.graphql_client.clone()).await
10274 }
10275 pub async fn deprecated(&self) -> Result<String, DaggerError> {
10277 let query = self.selection.select("deprecated");
10278 query.execute(self.graphql_client.clone()).await
10279 }
10280 pub async fn description(&self) -> Result<String, DaggerError> {
10282 let query = self.selection.select("description");
10283 query.execute(self.graphql_client.clone()).await
10284 }
10285 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
10287 let query = self.selection.select("id");
10288 query.execute(self.graphql_client.clone()).await
10289 }
10290 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
10292 let query = self.selection.select("ignore");
10293 query.execute(self.graphql_client.clone()).await
10294 }
10295 pub async fn name(&self) -> Result<String, DaggerError> {
10297 let query = self.selection.select("name");
10298 query.execute(self.graphql_client.clone()).await
10299 }
10300 pub fn source_map(&self) -> SourceMap {
10302 let query = self.selection.select("sourceMap");
10303 SourceMap {
10304 proc: self.proc.clone(),
10305 selection: query,
10306 graphql_client: self.graphql_client.clone(),
10307 }
10308 }
10309 pub fn type_def(&self) -> TypeDef {
10311 let query = self.selection.select("typeDef");
10312 TypeDef {
10313 proc: self.proc.clone(),
10314 selection: query,
10315 graphql_client: self.graphql_client.clone(),
10316 }
10317 }
10318}
10319#[derive(Clone)]
10320pub struct FunctionCall {
10321 pub proc: Option<Arc<DaggerSessionProc>>,
10322 pub selection: Selection,
10323 pub graphql_client: DynGraphQLClient,
10324}
10325impl FunctionCall {
10326 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
10328 let query = self.selection.select("id");
10329 query.execute(self.graphql_client.clone()).await
10330 }
10331 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
10333 let query = self.selection.select("inputArgs");
10334 let query = query.select("id");
10335 let ids: Vec<FunctionCallArgValueId> = query.execute(self.graphql_client.clone()).await?;
10336 let root = Query {
10337 proc: self.proc.clone(),
10338 selection: crate::querybuilder::query(),
10339 graphql_client: self.graphql_client.clone(),
10340 };
10341 Ok(ids
10342 .into_iter()
10343 .map(|id| root.load_function_call_arg_value_from_id(id))
10344 .collect())
10345 }
10346 pub async fn name(&self) -> Result<String, DaggerError> {
10348 let query = self.selection.select("name");
10349 query.execute(self.graphql_client.clone()).await
10350 }
10351 pub async fn parent(&self) -> Result<Json, DaggerError> {
10353 let query = self.selection.select("parent");
10354 query.execute(self.graphql_client.clone()).await
10355 }
10356 pub async fn parent_name(&self) -> Result<String, DaggerError> {
10358 let query = self.selection.select("parentName");
10359 query.execute(self.graphql_client.clone()).await
10360 }
10361 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
10367 let mut query = self.selection.select("returnError");
10368 query = query.arg_lazy(
10369 "error",
10370 Box::new(move || {
10371 let error = error.clone();
10372 Box::pin(async move { error.into_id().await.unwrap().quote() })
10373 }),
10374 );
10375 query.execute(self.graphql_client.clone()).await
10376 }
10377 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
10383 let mut query = self.selection.select("returnValue");
10384 query = query.arg("value", value);
10385 query.execute(self.graphql_client.clone()).await
10386 }
10387}
10388#[derive(Clone)]
10389pub struct FunctionCallArgValue {
10390 pub proc: Option<Arc<DaggerSessionProc>>,
10391 pub selection: Selection,
10392 pub graphql_client: DynGraphQLClient,
10393}
10394impl FunctionCallArgValue {
10395 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
10397 let query = self.selection.select("id");
10398 query.execute(self.graphql_client.clone()).await
10399 }
10400 pub async fn name(&self) -> Result<String, DaggerError> {
10402 let query = self.selection.select("name");
10403 query.execute(self.graphql_client.clone()).await
10404 }
10405 pub async fn value(&self) -> Result<Json, DaggerError> {
10407 let query = self.selection.select("value");
10408 query.execute(self.graphql_client.clone()).await
10409 }
10410}
10411#[derive(Clone)]
10412pub struct GeneratedCode {
10413 pub proc: Option<Arc<DaggerSessionProc>>,
10414 pub selection: Selection,
10415 pub graphql_client: DynGraphQLClient,
10416}
10417impl GeneratedCode {
10418 pub fn code(&self) -> Directory {
10420 let query = self.selection.select("code");
10421 Directory {
10422 proc: self.proc.clone(),
10423 selection: query,
10424 graphql_client: self.graphql_client.clone(),
10425 }
10426 }
10427 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
10429 let query = self.selection.select("id");
10430 query.execute(self.graphql_client.clone()).await
10431 }
10432 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10434 let query = self.selection.select("vcsGeneratedPaths");
10435 query.execute(self.graphql_client.clone()).await
10436 }
10437 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10439 let query = self.selection.select("vcsIgnoredPaths");
10440 query.execute(self.graphql_client.clone()).await
10441 }
10442 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10444 let mut query = self.selection.select("withVCSGeneratedPaths");
10445 query = query.arg(
10446 "paths",
10447 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10448 );
10449 GeneratedCode {
10450 proc: self.proc.clone(),
10451 selection: query,
10452 graphql_client: self.graphql_client.clone(),
10453 }
10454 }
10455 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10457 let mut query = self.selection.select("withVCSIgnoredPaths");
10458 query = query.arg(
10459 "paths",
10460 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10461 );
10462 GeneratedCode {
10463 proc: self.proc.clone(),
10464 selection: query,
10465 graphql_client: self.graphql_client.clone(),
10466 }
10467 }
10468}
10469#[derive(Clone)]
10470pub struct Generator {
10471 pub proc: Option<Arc<DaggerSessionProc>>,
10472 pub selection: Selection,
10473 pub graphql_client: DynGraphQLClient,
10474}
10475impl Generator {
10476 pub fn changes(&self) -> Changeset {
10478 let query = self.selection.select("changes");
10479 Changeset {
10480 proc: self.proc.clone(),
10481 selection: query,
10482 graphql_client: self.graphql_client.clone(),
10483 }
10484 }
10485 pub async fn completed(&self) -> Result<bool, DaggerError> {
10487 let query = self.selection.select("completed");
10488 query.execute(self.graphql_client.clone()).await
10489 }
10490 pub async fn description(&self) -> Result<String, DaggerError> {
10492 let query = self.selection.select("description");
10493 query.execute(self.graphql_client.clone()).await
10494 }
10495 pub async fn id(&self) -> Result<GeneratorId, DaggerError> {
10497 let query = self.selection.select("id");
10498 query.execute(self.graphql_client.clone()).await
10499 }
10500 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
10502 let query = self.selection.select("isEmpty");
10503 query.execute(self.graphql_client.clone()).await
10504 }
10505 pub async fn name(&self) -> Result<String, DaggerError> {
10507 let query = self.selection.select("name");
10508 query.execute(self.graphql_client.clone()).await
10509 }
10510 pub fn original_module(&self) -> Module {
10512 let query = self.selection.select("originalModule");
10513 Module {
10514 proc: self.proc.clone(),
10515 selection: query,
10516 graphql_client: self.graphql_client.clone(),
10517 }
10518 }
10519 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
10521 let query = self.selection.select("path");
10522 query.execute(self.graphql_client.clone()).await
10523 }
10524 pub fn run(&self) -> Generator {
10526 let query = self.selection.select("run");
10527 Generator {
10528 proc: self.proc.clone(),
10529 selection: query,
10530 graphql_client: self.graphql_client.clone(),
10531 }
10532 }
10533}
10534#[derive(Clone)]
10535pub struct GeneratorGroup {
10536 pub proc: Option<Arc<DaggerSessionProc>>,
10537 pub selection: Selection,
10538 pub graphql_client: DynGraphQLClient,
10539}
10540#[derive(Builder, Debug, PartialEq)]
10541pub struct GeneratorGroupChangesOpts {
10542 #[builder(setter(into, strip_option), default)]
10544 pub on_conflict: Option<ChangesetsMergeConflict>,
10545}
10546impl GeneratorGroup {
10547 pub fn changes(&self) -> Changeset {
10555 let query = self.selection.select("changes");
10556 Changeset {
10557 proc: self.proc.clone(),
10558 selection: query,
10559 graphql_client: self.graphql_client.clone(),
10560 }
10561 }
10562 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
10570 let mut query = self.selection.select("changes");
10571 if let Some(on_conflict) = opts.on_conflict {
10572 query = query.arg("onConflict", on_conflict);
10573 }
10574 Changeset {
10575 proc: self.proc.clone(),
10576 selection: query,
10577 graphql_client: self.graphql_client.clone(),
10578 }
10579 }
10580 pub async fn id(&self) -> Result<GeneratorGroupId, DaggerError> {
10582 let query = self.selection.select("id");
10583 query.execute(self.graphql_client.clone()).await
10584 }
10585 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
10587 let query = self.selection.select("isEmpty");
10588 query.execute(self.graphql_client.clone()).await
10589 }
10590 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
10592 let query = self.selection.select("list");
10593 let query = query.select("id");
10594 let ids: Vec<GeneratorId> = query.execute(self.graphql_client.clone()).await?;
10595 let root = Query {
10596 proc: self.proc.clone(),
10597 selection: crate::querybuilder::query(),
10598 graphql_client: self.graphql_client.clone(),
10599 };
10600 Ok(ids
10601 .into_iter()
10602 .map(|id| root.load_generator_from_id(id))
10603 .collect())
10604 }
10605 pub fn run(&self) -> GeneratorGroup {
10607 let query = self.selection.select("run");
10608 GeneratorGroup {
10609 proc: self.proc.clone(),
10610 selection: query,
10611 graphql_client: self.graphql_client.clone(),
10612 }
10613 }
10614}
10615#[derive(Clone)]
10616pub struct GitRef {
10617 pub proc: Option<Arc<DaggerSessionProc>>,
10618 pub selection: Selection,
10619 pub graphql_client: DynGraphQLClient,
10620}
10621#[derive(Builder, Debug, PartialEq)]
10622pub struct GitRefTreeOpts {
10623 #[builder(setter(into, strip_option), default)]
10625 pub depth: Option<isize>,
10626 #[builder(setter(into, strip_option), default)]
10628 pub discard_git_dir: Option<bool>,
10629 #[builder(setter(into, strip_option), default)]
10631 pub include_tags: Option<bool>,
10632}
10633impl GitRef {
10634 pub async fn commit(&self) -> Result<String, DaggerError> {
10636 let query = self.selection.select("commit");
10637 query.execute(self.graphql_client.clone()).await
10638 }
10639 pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
10645 let mut query = self.selection.select("commonAncestor");
10646 query = query.arg_lazy(
10647 "other",
10648 Box::new(move || {
10649 let other = other.clone();
10650 Box::pin(async move { other.into_id().await.unwrap().quote() })
10651 }),
10652 );
10653 GitRef {
10654 proc: self.proc.clone(),
10655 selection: query,
10656 graphql_client: self.graphql_client.clone(),
10657 }
10658 }
10659 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
10661 let query = self.selection.select("id");
10662 query.execute(self.graphql_client.clone()).await
10663 }
10664 pub async fn r#ref(&self) -> Result<String, DaggerError> {
10666 let query = self.selection.select("ref");
10667 query.execute(self.graphql_client.clone()).await
10668 }
10669 pub fn tree(&self) -> Directory {
10675 let query = self.selection.select("tree");
10676 Directory {
10677 proc: self.proc.clone(),
10678 selection: query,
10679 graphql_client: self.graphql_client.clone(),
10680 }
10681 }
10682 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10688 let mut query = self.selection.select("tree");
10689 if let Some(discard_git_dir) = opts.discard_git_dir {
10690 query = query.arg("discardGitDir", discard_git_dir);
10691 }
10692 if let Some(depth) = opts.depth {
10693 query = query.arg("depth", depth);
10694 }
10695 if let Some(include_tags) = opts.include_tags {
10696 query = query.arg("includeTags", include_tags);
10697 }
10698 Directory {
10699 proc: self.proc.clone(),
10700 selection: query,
10701 graphql_client: self.graphql_client.clone(),
10702 }
10703 }
10704}
10705#[derive(Clone)]
10706pub struct GitRepository {
10707 pub proc: Option<Arc<DaggerSessionProc>>,
10708 pub selection: Selection,
10709 pub graphql_client: DynGraphQLClient,
10710}
10711#[derive(Builder, Debug, PartialEq)]
10712pub struct GitRepositoryBranchesOpts<'a> {
10713 #[builder(setter(into, strip_option), default)]
10715 pub patterns: Option<Vec<&'a str>>,
10716}
10717#[derive(Builder, Debug, PartialEq)]
10718pub struct GitRepositoryTagsOpts<'a> {
10719 #[builder(setter(into, strip_option), default)]
10721 pub patterns: Option<Vec<&'a str>>,
10722}
10723impl GitRepository {
10724 pub fn branch(&self, name: impl Into<String>) -> GitRef {
10730 let mut query = self.selection.select("branch");
10731 query = query.arg("name", name.into());
10732 GitRef {
10733 proc: self.proc.clone(),
10734 selection: query,
10735 graphql_client: self.graphql_client.clone(),
10736 }
10737 }
10738 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10744 let query = self.selection.select("branches");
10745 query.execute(self.graphql_client.clone()).await
10746 }
10747 pub async fn branches_opts<'a>(
10753 &self,
10754 opts: GitRepositoryBranchesOpts<'a>,
10755 ) -> Result<Vec<String>, DaggerError> {
10756 let mut query = self.selection.select("branches");
10757 if let Some(patterns) = opts.patterns {
10758 query = query.arg("patterns", patterns);
10759 }
10760 query.execute(self.graphql_client.clone()).await
10761 }
10762 pub fn commit(&self, id: impl Into<String>) -> GitRef {
10768 let mut query = self.selection.select("commit");
10769 query = query.arg("id", id.into());
10770 GitRef {
10771 proc: self.proc.clone(),
10772 selection: query,
10773 graphql_client: self.graphql_client.clone(),
10774 }
10775 }
10776 pub fn head(&self) -> GitRef {
10778 let query = self.selection.select("head");
10779 GitRef {
10780 proc: self.proc.clone(),
10781 selection: query,
10782 graphql_client: self.graphql_client.clone(),
10783 }
10784 }
10785 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
10787 let query = self.selection.select("id");
10788 query.execute(self.graphql_client.clone()).await
10789 }
10790 pub fn latest_version(&self) -> GitRef {
10792 let query = self.selection.select("latestVersion");
10793 GitRef {
10794 proc: self.proc.clone(),
10795 selection: query,
10796 graphql_client: self.graphql_client.clone(),
10797 }
10798 }
10799 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10805 let mut query = self.selection.select("ref");
10806 query = query.arg("name", name.into());
10807 GitRef {
10808 proc: self.proc.clone(),
10809 selection: query,
10810 graphql_client: self.graphql_client.clone(),
10811 }
10812 }
10813 pub fn tag(&self, name: impl Into<String>) -> GitRef {
10819 let mut query = self.selection.select("tag");
10820 query = query.arg("name", name.into());
10821 GitRef {
10822 proc: self.proc.clone(),
10823 selection: query,
10824 graphql_client: self.graphql_client.clone(),
10825 }
10826 }
10827 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10833 let query = self.selection.select("tags");
10834 query.execute(self.graphql_client.clone()).await
10835 }
10836 pub async fn tags_opts<'a>(
10842 &self,
10843 opts: GitRepositoryTagsOpts<'a>,
10844 ) -> Result<Vec<String>, DaggerError> {
10845 let mut query = self.selection.select("tags");
10846 if let Some(patterns) = opts.patterns {
10847 query = query.arg("patterns", patterns);
10848 }
10849 query.execute(self.graphql_client.clone()).await
10850 }
10851 pub fn uncommitted(&self) -> Changeset {
10853 let query = self.selection.select("uncommitted");
10854 Changeset {
10855 proc: self.proc.clone(),
10856 selection: query,
10857 graphql_client: self.graphql_client.clone(),
10858 }
10859 }
10860 pub async fn url(&self) -> Result<String, DaggerError> {
10862 let query = self.selection.select("url");
10863 query.execute(self.graphql_client.clone()).await
10864 }
10865}
10866#[derive(Clone)]
10867pub struct HttpState {
10868 pub proc: Option<Arc<DaggerSessionProc>>,
10869 pub selection: Selection,
10870 pub graphql_client: DynGraphQLClient,
10871}
10872impl HttpState {
10873 pub async fn id(&self) -> Result<HttpStateId, DaggerError> {
10875 let query = self.selection.select("id");
10876 query.execute(self.graphql_client.clone()).await
10877 }
10878}
10879#[derive(Clone)]
10880pub struct HealthcheckConfig {
10881 pub proc: Option<Arc<DaggerSessionProc>>,
10882 pub selection: Selection,
10883 pub graphql_client: DynGraphQLClient,
10884}
10885impl HealthcheckConfig {
10886 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10888 let query = self.selection.select("args");
10889 query.execute(self.graphql_client.clone()).await
10890 }
10891 pub async fn id(&self) -> Result<HealthcheckConfigId, DaggerError> {
10893 let query = self.selection.select("id");
10894 query.execute(self.graphql_client.clone()).await
10895 }
10896 pub async fn interval(&self) -> Result<String, DaggerError> {
10898 let query = self.selection.select("interval");
10899 query.execute(self.graphql_client.clone()).await
10900 }
10901 pub async fn retries(&self) -> Result<isize, DaggerError> {
10903 let query = self.selection.select("retries");
10904 query.execute(self.graphql_client.clone()).await
10905 }
10906 pub async fn shell(&self) -> Result<bool, DaggerError> {
10908 let query = self.selection.select("shell");
10909 query.execute(self.graphql_client.clone()).await
10910 }
10911 pub async fn start_interval(&self) -> Result<String, DaggerError> {
10913 let query = self.selection.select("startInterval");
10914 query.execute(self.graphql_client.clone()).await
10915 }
10916 pub async fn start_period(&self) -> Result<String, DaggerError> {
10918 let query = self.selection.select("startPeriod");
10919 query.execute(self.graphql_client.clone()).await
10920 }
10921 pub async fn timeout(&self) -> Result<String, DaggerError> {
10923 let query = self.selection.select("timeout");
10924 query.execute(self.graphql_client.clone()).await
10925 }
10926}
10927#[derive(Clone)]
10928pub struct Host {
10929 pub proc: Option<Arc<DaggerSessionProc>>,
10930 pub selection: Selection,
10931 pub graphql_client: DynGraphQLClient,
10932}
10933#[derive(Builder, Debug, PartialEq)]
10934pub struct HostDirectoryOpts<'a> {
10935 #[builder(setter(into, strip_option), default)]
10937 pub exclude: Option<Vec<&'a str>>,
10938 #[builder(setter(into, strip_option), default)]
10940 pub gitignore: Option<bool>,
10941 #[builder(setter(into, strip_option), default)]
10943 pub include: Option<Vec<&'a str>>,
10944 #[builder(setter(into, strip_option), default)]
10946 pub no_cache: Option<bool>,
10947}
10948#[derive(Builder, Debug, PartialEq)]
10949pub struct HostFileOpts {
10950 #[builder(setter(into, strip_option), default)]
10952 pub no_cache: Option<bool>,
10953}
10954#[derive(Builder, Debug, PartialEq)]
10955pub struct HostFindUpOpts {
10956 #[builder(setter(into, strip_option), default)]
10957 pub no_cache: Option<bool>,
10958}
10959#[derive(Builder, Debug, PartialEq)]
10960pub struct HostServiceOpts<'a> {
10961 #[builder(setter(into, strip_option), default)]
10963 pub host: Option<&'a str>,
10964}
10965#[derive(Builder, Debug, PartialEq)]
10966pub struct HostTunnelOpts {
10967 #[builder(setter(into, strip_option), default)]
10970 pub native: Option<bool>,
10971 #[builder(setter(into, strip_option), default)]
10976 pub ports: Option<Vec<PortForward>>,
10977}
10978impl Host {
10979 pub fn container_image(&self, name: impl Into<String>) -> Container {
10985 let mut query = self.selection.select("containerImage");
10986 query = query.arg("name", name.into());
10987 Container {
10988 proc: self.proc.clone(),
10989 selection: query,
10990 graphql_client: self.graphql_client.clone(),
10991 }
10992 }
10993 pub fn directory(&self, path: impl Into<String>) -> Directory {
11000 let mut query = self.selection.select("directory");
11001 query = query.arg("path", path.into());
11002 Directory {
11003 proc: self.proc.clone(),
11004 selection: query,
11005 graphql_client: self.graphql_client.clone(),
11006 }
11007 }
11008 pub fn directory_opts<'a>(
11015 &self,
11016 path: impl Into<String>,
11017 opts: HostDirectoryOpts<'a>,
11018 ) -> Directory {
11019 let mut query = self.selection.select("directory");
11020 query = query.arg("path", path.into());
11021 if let Some(exclude) = opts.exclude {
11022 query = query.arg("exclude", exclude);
11023 }
11024 if let Some(include) = opts.include {
11025 query = query.arg("include", include);
11026 }
11027 if let Some(no_cache) = opts.no_cache {
11028 query = query.arg("noCache", no_cache);
11029 }
11030 if let Some(gitignore) = opts.gitignore {
11031 query = query.arg("gitignore", gitignore);
11032 }
11033 Directory {
11034 proc: self.proc.clone(),
11035 selection: query,
11036 graphql_client: self.graphql_client.clone(),
11037 }
11038 }
11039 pub fn file(&self, path: impl Into<String>) -> File {
11046 let mut query = self.selection.select("file");
11047 query = query.arg("path", path.into());
11048 File {
11049 proc: self.proc.clone(),
11050 selection: query,
11051 graphql_client: self.graphql_client.clone(),
11052 }
11053 }
11054 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
11061 let mut query = self.selection.select("file");
11062 query = query.arg("path", path.into());
11063 if let Some(no_cache) = opts.no_cache {
11064 query = query.arg("noCache", no_cache);
11065 }
11066 File {
11067 proc: self.proc.clone(),
11068 selection: query,
11069 graphql_client: self.graphql_client.clone(),
11070 }
11071 }
11072 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
11079 let mut query = self.selection.select("findUp");
11080 query = query.arg("name", name.into());
11081 query.execute(self.graphql_client.clone()).await
11082 }
11083 pub async fn find_up_opts(
11090 &self,
11091 name: impl Into<String>,
11092 opts: HostFindUpOpts,
11093 ) -> Result<String, DaggerError> {
11094 let mut query = self.selection.select("findUp");
11095 query = query.arg("name", name.into());
11096 if let Some(no_cache) = opts.no_cache {
11097 query = query.arg("noCache", no_cache);
11098 }
11099 query.execute(self.graphql_client.clone()).await
11100 }
11101 pub async fn id(&self) -> Result<HostId, DaggerError> {
11103 let query = self.selection.select("id");
11104 query.execute(self.graphql_client.clone()).await
11105 }
11106 pub fn service(&self, ports: Vec<PortForward>) -> Service {
11117 let mut query = self.selection.select("service");
11118 query = query.arg("ports", ports);
11119 Service {
11120 proc: self.proc.clone(),
11121 selection: query,
11122 graphql_client: self.graphql_client.clone(),
11123 }
11124 }
11125 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
11136 let mut query = self.selection.select("service");
11137 query = query.arg("ports", ports);
11138 if let Some(host) = opts.host {
11139 query = query.arg("host", host);
11140 }
11141 Service {
11142 proc: self.proc.clone(),
11143 selection: query,
11144 graphql_client: self.graphql_client.clone(),
11145 }
11146 }
11147 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
11154 let mut query = self.selection.select("tunnel");
11155 query = query.arg_lazy(
11156 "service",
11157 Box::new(move || {
11158 let service = service.clone();
11159 Box::pin(async move { service.into_id().await.unwrap().quote() })
11160 }),
11161 );
11162 Service {
11163 proc: self.proc.clone(),
11164 selection: query,
11165 graphql_client: self.graphql_client.clone(),
11166 }
11167 }
11168 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
11175 let mut query = self.selection.select("tunnel");
11176 query = query.arg_lazy(
11177 "service",
11178 Box::new(move || {
11179 let service = service.clone();
11180 Box::pin(async move { service.into_id().await.unwrap().quote() })
11181 }),
11182 );
11183 if let Some(native) = opts.native {
11184 query = query.arg("native", native);
11185 }
11186 if let Some(ports) = opts.ports {
11187 query = query.arg("ports", ports);
11188 }
11189 Service {
11190 proc: self.proc.clone(),
11191 selection: query,
11192 graphql_client: self.graphql_client.clone(),
11193 }
11194 }
11195 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
11201 let mut query = self.selection.select("unixSocket");
11202 query = query.arg("path", path.into());
11203 Socket {
11204 proc: self.proc.clone(),
11205 selection: query,
11206 graphql_client: self.graphql_client.clone(),
11207 }
11208 }
11209}
11210#[derive(Clone)]
11211pub struct InputTypeDef {
11212 pub proc: Option<Arc<DaggerSessionProc>>,
11213 pub selection: Selection,
11214 pub graphql_client: DynGraphQLClient,
11215}
11216impl InputTypeDef {
11217 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
11219 let query = self.selection.select("fields");
11220 let query = query.select("id");
11221 let ids: Vec<FieldTypeDefId> = query.execute(self.graphql_client.clone()).await?;
11222 let root = Query {
11223 proc: self.proc.clone(),
11224 selection: crate::querybuilder::query(),
11225 graphql_client: self.graphql_client.clone(),
11226 };
11227 Ok(ids
11228 .into_iter()
11229 .map(|id| root.load_field_type_def_from_id(id))
11230 .collect())
11231 }
11232 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
11234 let query = self.selection.select("id");
11235 query.execute(self.graphql_client.clone()).await
11236 }
11237 pub async fn name(&self) -> Result<String, DaggerError> {
11239 let query = self.selection.select("name");
11240 query.execute(self.graphql_client.clone()).await
11241 }
11242}
11243#[derive(Clone)]
11244pub struct InterfaceTypeDef {
11245 pub proc: Option<Arc<DaggerSessionProc>>,
11246 pub selection: Selection,
11247 pub graphql_client: DynGraphQLClient,
11248}
11249impl InterfaceTypeDef {
11250 pub async fn description(&self) -> Result<String, DaggerError> {
11252 let query = self.selection.select("description");
11253 query.execute(self.graphql_client.clone()).await
11254 }
11255 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
11257 let query = self.selection.select("functions");
11258 let query = query.select("id");
11259 let ids: Vec<FunctionId> = query.execute(self.graphql_client.clone()).await?;
11260 let root = Query {
11261 proc: self.proc.clone(),
11262 selection: crate::querybuilder::query(),
11263 graphql_client: self.graphql_client.clone(),
11264 };
11265 Ok(ids
11266 .into_iter()
11267 .map(|id| root.load_function_from_id(id))
11268 .collect())
11269 }
11270 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
11272 let query = self.selection.select("id");
11273 query.execute(self.graphql_client.clone()).await
11274 }
11275 pub async fn name(&self) -> Result<String, DaggerError> {
11277 let query = self.selection.select("name");
11278 query.execute(self.graphql_client.clone()).await
11279 }
11280 pub fn source_map(&self) -> SourceMap {
11282 let query = self.selection.select("sourceMap");
11283 SourceMap {
11284 proc: self.proc.clone(),
11285 selection: query,
11286 graphql_client: self.graphql_client.clone(),
11287 }
11288 }
11289 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11291 let query = self.selection.select("sourceModuleName");
11292 query.execute(self.graphql_client.clone()).await
11293 }
11294}
11295#[derive(Clone)]
11296pub struct JsonValue {
11297 pub proc: Option<Arc<DaggerSessionProc>>,
11298 pub selection: Selection,
11299 pub graphql_client: DynGraphQLClient,
11300}
11301#[derive(Builder, Debug, PartialEq)]
11302pub struct JsonValueContentsOpts<'a> {
11303 #[builder(setter(into, strip_option), default)]
11305 pub indent: Option<&'a str>,
11306 #[builder(setter(into, strip_option), default)]
11308 pub pretty: Option<bool>,
11309}
11310impl JsonValue {
11311 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
11313 let query = self.selection.select("asArray");
11314 let query = query.select("id");
11315 let ids: Vec<JsonValueId> = query.execute(self.graphql_client.clone()).await?;
11316 let root = Query {
11317 proc: self.proc.clone(),
11318 selection: crate::querybuilder::query(),
11319 graphql_client: self.graphql_client.clone(),
11320 };
11321 Ok(ids
11322 .into_iter()
11323 .map(|id| root.load_json_value_from_id(id))
11324 .collect())
11325 }
11326 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
11328 let query = self.selection.select("asBoolean");
11329 query.execute(self.graphql_client.clone()).await
11330 }
11331 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
11333 let query = self.selection.select("asInteger");
11334 query.execute(self.graphql_client.clone()).await
11335 }
11336 pub async fn as_string(&self) -> Result<String, DaggerError> {
11338 let query = self.selection.select("asString");
11339 query.execute(self.graphql_client.clone()).await
11340 }
11341 pub async fn contents(&self) -> Result<Json, DaggerError> {
11347 let query = self.selection.select("contents");
11348 query.execute(self.graphql_client.clone()).await
11349 }
11350 pub async fn contents_opts<'a>(
11356 &self,
11357 opts: JsonValueContentsOpts<'a>,
11358 ) -> Result<Json, DaggerError> {
11359 let mut query = self.selection.select("contents");
11360 if let Some(pretty) = opts.pretty {
11361 query = query.arg("pretty", pretty);
11362 }
11363 if let Some(indent) = opts.indent {
11364 query = query.arg("indent", indent);
11365 }
11366 query.execute(self.graphql_client.clone()).await
11367 }
11368 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
11374 let mut query = self.selection.select("field");
11375 query = query.arg(
11376 "path",
11377 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11378 );
11379 JsonValue {
11380 proc: self.proc.clone(),
11381 selection: query,
11382 graphql_client: self.graphql_client.clone(),
11383 }
11384 }
11385 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
11387 let query = self.selection.select("fields");
11388 query.execute(self.graphql_client.clone()).await
11389 }
11390 pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
11392 let query = self.selection.select("id");
11393 query.execute(self.graphql_client.clone()).await
11394 }
11395 pub fn new_boolean(&self, value: bool) -> JsonValue {
11401 let mut query = self.selection.select("newBoolean");
11402 query = query.arg("value", value);
11403 JsonValue {
11404 proc: self.proc.clone(),
11405 selection: query,
11406 graphql_client: self.graphql_client.clone(),
11407 }
11408 }
11409 pub fn new_integer(&self, value: isize) -> JsonValue {
11415 let mut query = self.selection.select("newInteger");
11416 query = query.arg("value", value);
11417 JsonValue {
11418 proc: self.proc.clone(),
11419 selection: query,
11420 graphql_client: self.graphql_client.clone(),
11421 }
11422 }
11423 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
11429 let mut query = self.selection.select("newString");
11430 query = query.arg("value", value.into());
11431 JsonValue {
11432 proc: self.proc.clone(),
11433 selection: query,
11434 graphql_client: self.graphql_client.clone(),
11435 }
11436 }
11437 pub fn with_contents(&self, contents: Json) -> JsonValue {
11443 let mut query = self.selection.select("withContents");
11444 query = query.arg("contents", contents);
11445 JsonValue {
11446 proc: self.proc.clone(),
11447 selection: query,
11448 graphql_client: self.graphql_client.clone(),
11449 }
11450 }
11451 pub fn with_field(
11458 &self,
11459 path: Vec<impl Into<String>>,
11460 value: impl IntoID<JsonValueId>,
11461 ) -> JsonValue {
11462 let mut query = self.selection.select("withField");
11463 query = query.arg(
11464 "path",
11465 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11466 );
11467 query = query.arg_lazy(
11468 "value",
11469 Box::new(move || {
11470 let value = value.clone();
11471 Box::pin(async move { value.into_id().await.unwrap().quote() })
11472 }),
11473 );
11474 JsonValue {
11475 proc: self.proc.clone(),
11476 selection: query,
11477 graphql_client: self.graphql_client.clone(),
11478 }
11479 }
11480}
11481#[derive(Clone)]
11482pub struct Llm {
11483 pub proc: Option<Arc<DaggerSessionProc>>,
11484 pub selection: Selection,
11485 pub graphql_client: DynGraphQLClient,
11486}
11487impl Llm {
11488 pub fn attempt(&self, number: isize) -> Llm {
11490 let mut query = self.selection.select("attempt");
11491 query = query.arg("number", number);
11492 Llm {
11493 proc: self.proc.clone(),
11494 selection: query,
11495 graphql_client: self.graphql_client.clone(),
11496 }
11497 }
11498 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
11500 let mut query = self.selection.select("bindResult");
11501 query = query.arg("name", name.into());
11502 Binding {
11503 proc: self.proc.clone(),
11504 selection: query,
11505 graphql_client: self.graphql_client.clone(),
11506 }
11507 }
11508 pub fn env(&self) -> Env {
11510 let query = self.selection.select("env");
11511 Env {
11512 proc: self.proc.clone(),
11513 selection: query,
11514 graphql_client: self.graphql_client.clone(),
11515 }
11516 }
11517 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
11519 let query = self.selection.select("hasPrompt");
11520 query.execute(self.graphql_client.clone()).await
11521 }
11522 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
11524 let query = self.selection.select("history");
11525 query.execute(self.graphql_client.clone()).await
11526 }
11527 pub async fn history_json(&self) -> Result<Json, DaggerError> {
11529 let query = self.selection.select("historyJSON");
11530 query.execute(self.graphql_client.clone()).await
11531 }
11532 pub async fn id(&self) -> Result<Llmid, DaggerError> {
11534 let query = self.selection.select("id");
11535 query.execute(self.graphql_client.clone()).await
11536 }
11537 pub async fn last_reply(&self) -> Result<String, DaggerError> {
11539 let query = self.selection.select("lastReply");
11540 query.execute(self.graphql_client.clone()).await
11541 }
11542 pub fn r#loop(&self) -> Llm {
11544 let query = self.selection.select("loop");
11545 Llm {
11546 proc: self.proc.clone(),
11547 selection: query,
11548 graphql_client: self.graphql_client.clone(),
11549 }
11550 }
11551 pub async fn model(&self) -> Result<String, DaggerError> {
11553 let query = self.selection.select("model");
11554 query.execute(self.graphql_client.clone()).await
11555 }
11556 pub async fn provider(&self) -> Result<String, DaggerError> {
11558 let query = self.selection.select("provider");
11559 query.execute(self.graphql_client.clone()).await
11560 }
11561 pub async fn step(&self) -> Result<Llmid, DaggerError> {
11563 let query = self.selection.select("step");
11564 query.execute(self.graphql_client.clone()).await
11565 }
11566 pub async fn sync(&self) -> Result<Llmid, DaggerError> {
11568 let query = self.selection.select("sync");
11569 query.execute(self.graphql_client.clone()).await
11570 }
11571 pub fn token_usage(&self) -> LlmTokenUsage {
11573 let query = self.selection.select("tokenUsage");
11574 LlmTokenUsage {
11575 proc: self.proc.clone(),
11576 selection: query,
11577 graphql_client: self.graphql_client.clone(),
11578 }
11579 }
11580 pub async fn tools(&self) -> Result<String, DaggerError> {
11582 let query = self.selection.select("tools");
11583 query.execute(self.graphql_client.clone()).await
11584 }
11585 pub fn with_blocked_function(
11594 &self,
11595 type_name: impl Into<String>,
11596 function: impl Into<String>,
11597 ) -> Llm {
11598 let mut query = self.selection.select("withBlockedFunction");
11599 query = query.arg("typeName", type_name.into());
11600 query = query.arg("function", function.into());
11601 Llm {
11602 proc: self.proc.clone(),
11603 selection: query,
11604 graphql_client: self.graphql_client.clone(),
11605 }
11606 }
11607 pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
11609 let mut query = self.selection.select("withEnv");
11610 query = query.arg_lazy(
11611 "env",
11612 Box::new(move || {
11613 let env = env.clone();
11614 Box::pin(async move { env.into_id().await.unwrap().quote() })
11615 }),
11616 );
11617 Llm {
11618 proc: self.proc.clone(),
11619 selection: query,
11620 graphql_client: self.graphql_client.clone(),
11621 }
11622 }
11623 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
11630 let mut query = self.selection.select("withMCPServer");
11631 query = query.arg("name", name.into());
11632 query = query.arg_lazy(
11633 "service",
11634 Box::new(move || {
11635 let service = service.clone();
11636 Box::pin(async move { service.into_id().await.unwrap().quote() })
11637 }),
11638 );
11639 Llm {
11640 proc: self.proc.clone(),
11641 selection: query,
11642 graphql_client: self.graphql_client.clone(),
11643 }
11644 }
11645 pub fn with_model(&self, model: impl Into<String>) -> Llm {
11651 let mut query = self.selection.select("withModel");
11652 query = query.arg("model", model.into());
11653 Llm {
11654 proc: self.proc.clone(),
11655 selection: query,
11656 graphql_client: self.graphql_client.clone(),
11657 }
11658 }
11659 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11665 let mut query = self.selection.select("withPrompt");
11666 query = query.arg("prompt", prompt.into());
11667 Llm {
11668 proc: self.proc.clone(),
11669 selection: query,
11670 graphql_client: self.graphql_client.clone(),
11671 }
11672 }
11673 pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
11679 let mut query = self.selection.select("withPromptFile");
11680 query = query.arg_lazy(
11681 "file",
11682 Box::new(move || {
11683 let file = file.clone();
11684 Box::pin(async move { file.into_id().await.unwrap().quote() })
11685 }),
11686 );
11687 Llm {
11688 proc: self.proc.clone(),
11689 selection: query,
11690 graphql_client: self.graphql_client.clone(),
11691 }
11692 }
11693 pub fn with_static_tools(&self) -> Llm {
11695 let query = self.selection.select("withStaticTools");
11696 Llm {
11697 proc: self.proc.clone(),
11698 selection: query,
11699 graphql_client: self.graphql_client.clone(),
11700 }
11701 }
11702 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11708 let mut query = self.selection.select("withSystemPrompt");
11709 query = query.arg("prompt", prompt.into());
11710 Llm {
11711 proc: self.proc.clone(),
11712 selection: query,
11713 graphql_client: self.graphql_client.clone(),
11714 }
11715 }
11716 pub fn without_default_system_prompt(&self) -> Llm {
11718 let query = self.selection.select("withoutDefaultSystemPrompt");
11719 Llm {
11720 proc: self.proc.clone(),
11721 selection: query,
11722 graphql_client: self.graphql_client.clone(),
11723 }
11724 }
11725 pub fn without_message_history(&self) -> Llm {
11727 let query = self.selection.select("withoutMessageHistory");
11728 Llm {
11729 proc: self.proc.clone(),
11730 selection: query,
11731 graphql_client: self.graphql_client.clone(),
11732 }
11733 }
11734 pub fn without_system_prompts(&self) -> Llm {
11736 let query = self.selection.select("withoutSystemPrompts");
11737 Llm {
11738 proc: self.proc.clone(),
11739 selection: query,
11740 graphql_client: self.graphql_client.clone(),
11741 }
11742 }
11743}
11744#[derive(Clone)]
11745pub struct LlmTokenUsage {
11746 pub proc: Option<Arc<DaggerSessionProc>>,
11747 pub selection: Selection,
11748 pub graphql_client: DynGraphQLClient,
11749}
11750impl LlmTokenUsage {
11751 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11752 let query = self.selection.select("cachedTokenReads");
11753 query.execute(self.graphql_client.clone()).await
11754 }
11755 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11756 let query = self.selection.select("cachedTokenWrites");
11757 query.execute(self.graphql_client.clone()).await
11758 }
11759 pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
11761 let query = self.selection.select("id");
11762 query.execute(self.graphql_client.clone()).await
11763 }
11764 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11765 let query = self.selection.select("inputTokens");
11766 query.execute(self.graphql_client.clone()).await
11767 }
11768 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11769 let query = self.selection.select("outputTokens");
11770 query.execute(self.graphql_client.clone()).await
11771 }
11772 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11773 let query = self.selection.select("totalTokens");
11774 query.execute(self.graphql_client.clone()).await
11775 }
11776}
11777#[derive(Clone)]
11778pub struct Label {
11779 pub proc: Option<Arc<DaggerSessionProc>>,
11780 pub selection: Selection,
11781 pub graphql_client: DynGraphQLClient,
11782}
11783impl Label {
11784 pub async fn id(&self) -> Result<LabelId, DaggerError> {
11786 let query = self.selection.select("id");
11787 query.execute(self.graphql_client.clone()).await
11788 }
11789 pub async fn name(&self) -> Result<String, DaggerError> {
11791 let query = self.selection.select("name");
11792 query.execute(self.graphql_client.clone()).await
11793 }
11794 pub async fn value(&self) -> Result<String, DaggerError> {
11796 let query = self.selection.select("value");
11797 query.execute(self.graphql_client.clone()).await
11798 }
11799}
11800#[derive(Clone)]
11801pub struct ListTypeDef {
11802 pub proc: Option<Arc<DaggerSessionProc>>,
11803 pub selection: Selection,
11804 pub graphql_client: DynGraphQLClient,
11805}
11806impl ListTypeDef {
11807 pub fn element_type_def(&self) -> TypeDef {
11809 let query = self.selection.select("elementTypeDef");
11810 TypeDef {
11811 proc: self.proc.clone(),
11812 selection: query,
11813 graphql_client: self.graphql_client.clone(),
11814 }
11815 }
11816 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
11818 let query = self.selection.select("id");
11819 query.execute(self.graphql_client.clone()).await
11820 }
11821}
11822#[derive(Clone)]
11823pub struct Module {
11824 pub proc: Option<Arc<DaggerSessionProc>>,
11825 pub selection: Selection,
11826 pub graphql_client: DynGraphQLClient,
11827}
11828#[derive(Builder, Debug, PartialEq)]
11829pub struct ModuleChecksOpts<'a> {
11830 #[builder(setter(into, strip_option), default)]
11832 pub include: Option<Vec<&'a str>>,
11833 #[builder(setter(into, strip_option), default)]
11835 pub no_generate: Option<bool>,
11836}
11837#[derive(Builder, Debug, PartialEq)]
11838pub struct ModuleGeneratorsOpts<'a> {
11839 #[builder(setter(into, strip_option), default)]
11841 pub include: Option<Vec<&'a str>>,
11842}
11843#[derive(Builder, Debug, PartialEq)]
11844pub struct ModuleServeOpts {
11845 #[builder(setter(into, strip_option), default)]
11847 pub entrypoint: Option<bool>,
11848 #[builder(setter(into, strip_option), default)]
11850 pub include_dependencies: Option<bool>,
11851}
11852#[derive(Builder, Debug, PartialEq)]
11853pub struct ModuleServicesOpts<'a> {
11854 #[builder(setter(into, strip_option), default)]
11856 pub include: Option<Vec<&'a str>>,
11857}
11858impl Module {
11859 pub fn check(&self, name: impl Into<String>) -> Check {
11865 let mut query = self.selection.select("check");
11866 query = query.arg("name", name.into());
11867 Check {
11868 proc: self.proc.clone(),
11869 selection: query,
11870 graphql_client: self.graphql_client.clone(),
11871 }
11872 }
11873 pub fn checks(&self) -> CheckGroup {
11879 let query = self.selection.select("checks");
11880 CheckGroup {
11881 proc: self.proc.clone(),
11882 selection: query,
11883 graphql_client: self.graphql_client.clone(),
11884 }
11885 }
11886 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11892 let mut query = self.selection.select("checks");
11893 if let Some(include) = opts.include {
11894 query = query.arg("include", include);
11895 }
11896 if let Some(no_generate) = opts.no_generate {
11897 query = query.arg("noGenerate", no_generate);
11898 }
11899 CheckGroup {
11900 proc: self.proc.clone(),
11901 selection: query,
11902 graphql_client: self.graphql_client.clone(),
11903 }
11904 }
11905 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11907 let query = self.selection.select("dependencies");
11908 let query = query.select("id");
11909 let ids: Vec<ModuleId> = query.execute(self.graphql_client.clone()).await?;
11910 let root = Query {
11911 proc: self.proc.clone(),
11912 selection: crate::querybuilder::query(),
11913 graphql_client: self.graphql_client.clone(),
11914 };
11915 Ok(ids
11916 .into_iter()
11917 .map(|id| root.load_module_from_id(id))
11918 .collect())
11919 }
11920 pub async fn description(&self) -> Result<String, DaggerError> {
11922 let query = self.selection.select("description");
11923 query.execute(self.graphql_client.clone()).await
11924 }
11925 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11927 let query = self.selection.select("enums");
11928 let query = query.select("id");
11929 let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
11930 let root = Query {
11931 proc: self.proc.clone(),
11932 selection: crate::querybuilder::query(),
11933 graphql_client: self.graphql_client.clone(),
11934 };
11935 Ok(ids
11936 .into_iter()
11937 .map(|id| root.load_type_def_from_id(id))
11938 .collect())
11939 }
11940 pub fn generated_context_directory(&self) -> Directory {
11942 let query = self.selection.select("generatedContextDirectory");
11943 Directory {
11944 proc: self.proc.clone(),
11945 selection: query,
11946 graphql_client: self.graphql_client.clone(),
11947 }
11948 }
11949 pub fn generator(&self, name: impl Into<String>) -> Generator {
11955 let mut query = self.selection.select("generator");
11956 query = query.arg("name", name.into());
11957 Generator {
11958 proc: self.proc.clone(),
11959 selection: query,
11960 graphql_client: self.graphql_client.clone(),
11961 }
11962 }
11963 pub fn generators(&self) -> GeneratorGroup {
11969 let query = self.selection.select("generators");
11970 GeneratorGroup {
11971 proc: self.proc.clone(),
11972 selection: query,
11973 graphql_client: self.graphql_client.clone(),
11974 }
11975 }
11976 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11982 let mut query = self.selection.select("generators");
11983 if let Some(include) = opts.include {
11984 query = query.arg("include", include);
11985 }
11986 GeneratorGroup {
11987 proc: self.proc.clone(),
11988 selection: query,
11989 graphql_client: self.graphql_client.clone(),
11990 }
11991 }
11992 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
11994 let query = self.selection.select("id");
11995 query.execute(self.graphql_client.clone()).await
11996 }
11997 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11999 let query = self.selection.select("interfaces");
12000 let query = query.select("id");
12001 let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
12002 let root = Query {
12003 proc: self.proc.clone(),
12004 selection: crate::querybuilder::query(),
12005 graphql_client: self.graphql_client.clone(),
12006 };
12007 Ok(ids
12008 .into_iter()
12009 .map(|id| root.load_type_def_from_id(id))
12010 .collect())
12011 }
12012 pub fn introspection_schema_json(&self) -> File {
12016 let query = self.selection.select("introspectionSchemaJSON");
12017 File {
12018 proc: self.proc.clone(),
12019 selection: query,
12020 graphql_client: self.graphql_client.clone(),
12021 }
12022 }
12023 pub async fn name(&self) -> Result<String, DaggerError> {
12025 let query = self.selection.select("name");
12026 query.execute(self.graphql_client.clone()).await
12027 }
12028 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
12030 let query = self.selection.select("objects");
12031 let query = query.select("id");
12032 let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
12033 let root = Query {
12034 proc: self.proc.clone(),
12035 selection: crate::querybuilder::query(),
12036 graphql_client: self.graphql_client.clone(),
12037 };
12038 Ok(ids
12039 .into_iter()
12040 .map(|id| root.load_type_def_from_id(id))
12041 .collect())
12042 }
12043 pub fn runtime(&self) -> Container {
12045 let query = self.selection.select("runtime");
12046 Container {
12047 proc: self.proc.clone(),
12048 selection: query,
12049 graphql_client: self.graphql_client.clone(),
12050 }
12051 }
12052 pub fn sdk(&self) -> SdkConfig {
12054 let query = self.selection.select("sdk");
12055 SdkConfig {
12056 proc: self.proc.clone(),
12057 selection: query,
12058 graphql_client: self.graphql_client.clone(),
12059 }
12060 }
12061 pub async fn serve(&self) -> Result<Void, DaggerError> {
12068 let query = self.selection.select("serve");
12069 query.execute(self.graphql_client.clone()).await
12070 }
12071 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
12078 let mut query = self.selection.select("serve");
12079 if let Some(include_dependencies) = opts.include_dependencies {
12080 query = query.arg("includeDependencies", include_dependencies);
12081 }
12082 if let Some(entrypoint) = opts.entrypoint {
12083 query = query.arg("entrypoint", entrypoint);
12084 }
12085 query.execute(self.graphql_client.clone()).await
12086 }
12087 pub fn services(&self) -> UpGroup {
12093 let query = self.selection.select("services");
12094 UpGroup {
12095 proc: self.proc.clone(),
12096 selection: query,
12097 graphql_client: self.graphql_client.clone(),
12098 }
12099 }
12100 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
12106 let mut query = self.selection.select("services");
12107 if let Some(include) = opts.include {
12108 query = query.arg("include", include);
12109 }
12110 UpGroup {
12111 proc: self.proc.clone(),
12112 selection: query,
12113 graphql_client: self.graphql_client.clone(),
12114 }
12115 }
12116 pub fn source(&self) -> ModuleSource {
12118 let query = self.selection.select("source");
12119 ModuleSource {
12120 proc: self.proc.clone(),
12121 selection: query,
12122 graphql_client: self.graphql_client.clone(),
12123 }
12124 }
12125 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
12127 let query = self.selection.select("sync");
12128 query.execute(self.graphql_client.clone()).await
12129 }
12130 pub fn user_defaults(&self) -> EnvFile {
12132 let query = self.selection.select("userDefaults");
12133 EnvFile {
12134 proc: self.proc.clone(),
12135 selection: query,
12136 graphql_client: self.graphql_client.clone(),
12137 }
12138 }
12139 pub fn with_description(&self, description: impl Into<String>) -> Module {
12145 let mut query = self.selection.select("withDescription");
12146 query = query.arg("description", description.into());
12147 Module {
12148 proc: self.proc.clone(),
12149 selection: query,
12150 graphql_client: self.graphql_client.clone(),
12151 }
12152 }
12153 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
12155 let mut query = self.selection.select("withEnum");
12156 query = query.arg_lazy(
12157 "enum",
12158 Box::new(move || {
12159 let r#enum = r#enum.clone();
12160 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
12161 }),
12162 );
12163 Module {
12164 proc: self.proc.clone(),
12165 selection: query,
12166 graphql_client: self.graphql_client.clone(),
12167 }
12168 }
12169 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
12171 let mut query = self.selection.select("withInterface");
12172 query = query.arg_lazy(
12173 "iface",
12174 Box::new(move || {
12175 let iface = iface.clone();
12176 Box::pin(async move { iface.into_id().await.unwrap().quote() })
12177 }),
12178 );
12179 Module {
12180 proc: self.proc.clone(),
12181 selection: query,
12182 graphql_client: self.graphql_client.clone(),
12183 }
12184 }
12185 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
12187 let mut query = self.selection.select("withObject");
12188 query = query.arg_lazy(
12189 "object",
12190 Box::new(move || {
12191 let object = object.clone();
12192 Box::pin(async move { object.into_id().await.unwrap().quote() })
12193 }),
12194 );
12195 Module {
12196 proc: self.proc.clone(),
12197 selection: query,
12198 graphql_client: self.graphql_client.clone(),
12199 }
12200 }
12201}
12202#[derive(Clone)]
12203pub struct ModuleConfigClient {
12204 pub proc: Option<Arc<DaggerSessionProc>>,
12205 pub selection: Selection,
12206 pub graphql_client: DynGraphQLClient,
12207}
12208impl ModuleConfigClient {
12209 pub async fn directory(&self) -> Result<String, DaggerError> {
12211 let query = self.selection.select("directory");
12212 query.execute(self.graphql_client.clone()).await
12213 }
12214 pub async fn generator(&self) -> Result<String, DaggerError> {
12216 let query = self.selection.select("generator");
12217 query.execute(self.graphql_client.clone()).await
12218 }
12219 pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
12221 let query = self.selection.select("id");
12222 query.execute(self.graphql_client.clone()).await
12223 }
12224}
12225#[derive(Clone)]
12226pub struct ModuleSource {
12227 pub proc: Option<Arc<DaggerSessionProc>>,
12228 pub selection: Selection,
12229 pub graphql_client: DynGraphQLClient,
12230}
12231impl ModuleSource {
12232 pub fn as_module(&self) -> Module {
12234 let query = self.selection.select("asModule");
12235 Module {
12236 proc: self.proc.clone(),
12237 selection: query,
12238 graphql_client: self.graphql_client.clone(),
12239 }
12240 }
12241 pub async fn as_string(&self) -> Result<String, DaggerError> {
12243 let query = self.selection.select("asString");
12244 query.execute(self.graphql_client.clone()).await
12245 }
12246 pub fn blueprint(&self) -> ModuleSource {
12248 let query = self.selection.select("blueprint");
12249 ModuleSource {
12250 proc: self.proc.clone(),
12251 selection: query,
12252 graphql_client: self.graphql_client.clone(),
12253 }
12254 }
12255 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
12257 let query = self.selection.select("cloneRef");
12258 query.execute(self.graphql_client.clone()).await
12259 }
12260 pub async fn commit(&self) -> Result<String, DaggerError> {
12262 let query = self.selection.select("commit");
12263 query.execute(self.graphql_client.clone()).await
12264 }
12265 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
12267 let query = self.selection.select("configClients");
12268 let query = query.select("id");
12269 let ids: Vec<ModuleConfigClientId> = query.execute(self.graphql_client.clone()).await?;
12270 let root = Query {
12271 proc: self.proc.clone(),
12272 selection: crate::querybuilder::query(),
12273 graphql_client: self.graphql_client.clone(),
12274 };
12275 Ok(ids
12276 .into_iter()
12277 .map(|id| root.load_module_config_client_from_id(id))
12278 .collect())
12279 }
12280 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
12282 let query = self.selection.select("configExists");
12283 query.execute(self.graphql_client.clone()).await
12284 }
12285 pub fn context_directory(&self) -> Directory {
12287 let query = self.selection.select("contextDirectory");
12288 Directory {
12289 proc: self.proc.clone(),
12290 selection: query,
12291 graphql_client: self.graphql_client.clone(),
12292 }
12293 }
12294 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12296 let query = self.selection.select("dependencies");
12297 let query = query.select("id");
12298 let ids: Vec<ModuleSourceId> = query.execute(self.graphql_client.clone()).await?;
12299 let root = Query {
12300 proc: self.proc.clone(),
12301 selection: crate::querybuilder::query(),
12302 graphql_client: self.graphql_client.clone(),
12303 };
12304 Ok(ids
12305 .into_iter()
12306 .map(|id| root.load_module_source_from_id(id))
12307 .collect())
12308 }
12309 pub async fn digest(&self) -> Result<String, DaggerError> {
12311 let query = self.selection.select("digest");
12312 query.execute(self.graphql_client.clone()).await
12313 }
12314 pub fn directory(&self, path: impl Into<String>) -> Directory {
12320 let mut query = self.selection.select("directory");
12321 query = query.arg("path", path.into());
12322 Directory {
12323 proc: self.proc.clone(),
12324 selection: query,
12325 graphql_client: self.graphql_client.clone(),
12326 }
12327 }
12328 pub async fn engine_version(&self) -> Result<String, DaggerError> {
12330 let query = self.selection.select("engineVersion");
12331 query.execute(self.graphql_client.clone()).await
12332 }
12333 pub fn generated_context_changeset(&self) -> Changeset {
12335 let query = self.selection.select("generatedContextChangeset");
12336 Changeset {
12337 proc: self.proc.clone(),
12338 selection: query,
12339 graphql_client: self.graphql_client.clone(),
12340 }
12341 }
12342 pub fn generated_context_directory(&self) -> Directory {
12344 let query = self.selection.select("generatedContextDirectory");
12345 Directory {
12346 proc: self.proc.clone(),
12347 selection: query,
12348 graphql_client: self.graphql_client.clone(),
12349 }
12350 }
12351 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12353 let query = self.selection.select("htmlRepoURL");
12354 query.execute(self.graphql_client.clone()).await
12355 }
12356 pub async fn html_url(&self) -> Result<String, DaggerError> {
12358 let query = self.selection.select("htmlURL");
12359 query.execute(self.graphql_client.clone()).await
12360 }
12361 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
12363 let query = self.selection.select("id");
12364 query.execute(self.graphql_client.clone()).await
12365 }
12366 pub fn introspection_schema_json(&self) -> File {
12370 let query = self.selection.select("introspectionSchemaJSON");
12371 File {
12372 proc: self.proc.clone(),
12373 selection: query,
12374 graphql_client: self.graphql_client.clone(),
12375 }
12376 }
12377 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12379 let query = self.selection.select("kind");
12380 query.execute(self.graphql_client.clone()).await
12381 }
12382 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12384 let query = self.selection.select("localContextDirectoryPath");
12385 query.execute(self.graphql_client.clone()).await
12386 }
12387 pub async fn module_name(&self) -> Result<String, DaggerError> {
12389 let query = self.selection.select("moduleName");
12390 query.execute(self.graphql_client.clone()).await
12391 }
12392 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12394 let query = self.selection.select("moduleOriginalName");
12395 query.execute(self.graphql_client.clone()).await
12396 }
12397 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12399 let query = self.selection.select("originalSubpath");
12400 query.execute(self.graphql_client.clone()).await
12401 }
12402 pub async fn pin(&self) -> Result<String, DaggerError> {
12404 let query = self.selection.select("pin");
12405 query.execute(self.graphql_client.clone()).await
12406 }
12407 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12409 let query = self.selection.select("repoRootPath");
12410 query.execute(self.graphql_client.clone()).await
12411 }
12412 pub fn sdk(&self) -> SdkConfig {
12414 let query = self.selection.select("sdk");
12415 SdkConfig {
12416 proc: self.proc.clone(),
12417 selection: query,
12418 graphql_client: self.graphql_client.clone(),
12419 }
12420 }
12421 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12423 let query = self.selection.select("sourceRootSubpath");
12424 query.execute(self.graphql_client.clone()).await
12425 }
12426 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12428 let query = self.selection.select("sourceSubpath");
12429 query.execute(self.graphql_client.clone()).await
12430 }
12431 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
12433 let query = self.selection.select("sync");
12434 query.execute(self.graphql_client.clone()).await
12435 }
12436 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12438 let query = self.selection.select("toolchains");
12439 let query = query.select("id");
12440 let ids: Vec<ModuleSourceId> = query.execute(self.graphql_client.clone()).await?;
12441 let root = Query {
12442 proc: self.proc.clone(),
12443 selection: crate::querybuilder::query(),
12444 graphql_client: self.graphql_client.clone(),
12445 };
12446 Ok(ids
12447 .into_iter()
12448 .map(|id| root.load_module_source_from_id(id))
12449 .collect())
12450 }
12451 pub fn user_defaults(&self) -> EnvFile {
12453 let query = self.selection.select("userDefaults");
12454 EnvFile {
12455 proc: self.proc.clone(),
12456 selection: query,
12457 graphql_client: self.graphql_client.clone(),
12458 }
12459 }
12460 pub async fn version(&self) -> Result<String, DaggerError> {
12462 let query = self.selection.select("version");
12463 query.execute(self.graphql_client.clone()).await
12464 }
12465 pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
12471 let mut query = self.selection.select("withBlueprint");
12472 query = query.arg_lazy(
12473 "blueprint",
12474 Box::new(move || {
12475 let blueprint = blueprint.clone();
12476 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12477 }),
12478 );
12479 ModuleSource {
12480 proc: self.proc.clone(),
12481 selection: query,
12482 graphql_client: self.graphql_client.clone(),
12483 }
12484 }
12485 pub fn with_client(
12492 &self,
12493 generator: impl Into<String>,
12494 output_dir: impl Into<String>,
12495 ) -> ModuleSource {
12496 let mut query = self.selection.select("withClient");
12497 query = query.arg("generator", generator.into());
12498 query = query.arg("outputDir", output_dir.into());
12499 ModuleSource {
12500 proc: self.proc.clone(),
12501 selection: query,
12502 graphql_client: self.graphql_client.clone(),
12503 }
12504 }
12505 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
12511 let mut query = self.selection.select("withDependencies");
12512 query = query.arg("dependencies", dependencies);
12513 ModuleSource {
12514 proc: self.proc.clone(),
12515 selection: query,
12516 graphql_client: self.graphql_client.clone(),
12517 }
12518 }
12519 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12525 let mut query = self.selection.select("withEngineVersion");
12526 query = query.arg("version", version.into());
12527 ModuleSource {
12528 proc: self.proc.clone(),
12529 selection: query,
12530 graphql_client: self.graphql_client.clone(),
12531 }
12532 }
12533 pub fn with_experimental_features(
12539 &self,
12540 features: Vec<ModuleSourceExperimentalFeature>,
12541 ) -> ModuleSource {
12542 let mut query = self.selection.select("withExperimentalFeatures");
12543 query = query.arg("features", features);
12544 ModuleSource {
12545 proc: self.proc.clone(),
12546 selection: query,
12547 graphql_client: self.graphql_client.clone(),
12548 }
12549 }
12550 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12556 let mut query = self.selection.select("withIncludes");
12557 query = query.arg(
12558 "patterns",
12559 patterns
12560 .into_iter()
12561 .map(|i| i.into())
12562 .collect::<Vec<String>>(),
12563 );
12564 ModuleSource {
12565 proc: self.proc.clone(),
12566 selection: query,
12567 graphql_client: self.graphql_client.clone(),
12568 }
12569 }
12570 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12576 let mut query = self.selection.select("withName");
12577 query = query.arg("name", name.into());
12578 ModuleSource {
12579 proc: self.proc.clone(),
12580 selection: query,
12581 graphql_client: self.graphql_client.clone(),
12582 }
12583 }
12584 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12590 let mut query = self.selection.select("withSDK");
12591 query = query.arg("source", source.into());
12592 ModuleSource {
12593 proc: self.proc.clone(),
12594 selection: query,
12595 graphql_client: self.graphql_client.clone(),
12596 }
12597 }
12598 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12604 let mut query = self.selection.select("withSourceSubpath");
12605 query = query.arg("path", path.into());
12606 ModuleSource {
12607 proc: self.proc.clone(),
12608 selection: query,
12609 graphql_client: self.graphql_client.clone(),
12610 }
12611 }
12612 pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
12618 let mut query = self.selection.select("withToolchains");
12619 query = query.arg("toolchains", toolchains);
12620 ModuleSource {
12621 proc: self.proc.clone(),
12622 selection: query,
12623 graphql_client: self.graphql_client.clone(),
12624 }
12625 }
12626 pub fn with_update_blueprint(&self) -> ModuleSource {
12628 let query = self.selection.select("withUpdateBlueprint");
12629 ModuleSource {
12630 proc: self.proc.clone(),
12631 selection: query,
12632 graphql_client: self.graphql_client.clone(),
12633 }
12634 }
12635 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12641 let mut query = self.selection.select("withUpdateDependencies");
12642 query = query.arg(
12643 "dependencies",
12644 dependencies
12645 .into_iter()
12646 .map(|i| i.into())
12647 .collect::<Vec<String>>(),
12648 );
12649 ModuleSource {
12650 proc: self.proc.clone(),
12651 selection: query,
12652 graphql_client: self.graphql_client.clone(),
12653 }
12654 }
12655 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12661 let mut query = self.selection.select("withUpdateToolchains");
12662 query = query.arg(
12663 "toolchains",
12664 toolchains
12665 .into_iter()
12666 .map(|i| i.into())
12667 .collect::<Vec<String>>(),
12668 );
12669 ModuleSource {
12670 proc: self.proc.clone(),
12671 selection: query,
12672 graphql_client: self.graphql_client.clone(),
12673 }
12674 }
12675 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12681 let mut query = self.selection.select("withUpdatedClients");
12682 query = query.arg(
12683 "clients",
12684 clients
12685 .into_iter()
12686 .map(|i| i.into())
12687 .collect::<Vec<String>>(),
12688 );
12689 ModuleSource {
12690 proc: self.proc.clone(),
12691 selection: query,
12692 graphql_client: self.graphql_client.clone(),
12693 }
12694 }
12695 pub fn without_blueprint(&self) -> ModuleSource {
12697 let query = self.selection.select("withoutBlueprint");
12698 ModuleSource {
12699 proc: self.proc.clone(),
12700 selection: query,
12701 graphql_client: self.graphql_client.clone(),
12702 }
12703 }
12704 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12710 let mut query = self.selection.select("withoutClient");
12711 query = query.arg("path", path.into());
12712 ModuleSource {
12713 proc: self.proc.clone(),
12714 selection: query,
12715 graphql_client: self.graphql_client.clone(),
12716 }
12717 }
12718 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12724 let mut query = self.selection.select("withoutDependencies");
12725 query = query.arg(
12726 "dependencies",
12727 dependencies
12728 .into_iter()
12729 .map(|i| i.into())
12730 .collect::<Vec<String>>(),
12731 );
12732 ModuleSource {
12733 proc: self.proc.clone(),
12734 selection: query,
12735 graphql_client: self.graphql_client.clone(),
12736 }
12737 }
12738 pub fn without_experimental_features(
12744 &self,
12745 features: Vec<ModuleSourceExperimentalFeature>,
12746 ) -> ModuleSource {
12747 let mut query = self.selection.select("withoutExperimentalFeatures");
12748 query = query.arg("features", features);
12749 ModuleSource {
12750 proc: self.proc.clone(),
12751 selection: query,
12752 graphql_client: self.graphql_client.clone(),
12753 }
12754 }
12755 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12761 let mut query = self.selection.select("withoutToolchains");
12762 query = query.arg(
12763 "toolchains",
12764 toolchains
12765 .into_iter()
12766 .map(|i| i.into())
12767 .collect::<Vec<String>>(),
12768 );
12769 ModuleSource {
12770 proc: self.proc.clone(),
12771 selection: query,
12772 graphql_client: self.graphql_client.clone(),
12773 }
12774 }
12775}
12776#[derive(Clone)]
12777pub struct ObjectTypeDef {
12778 pub proc: Option<Arc<DaggerSessionProc>>,
12779 pub selection: Selection,
12780 pub graphql_client: DynGraphQLClient,
12781}
12782impl ObjectTypeDef {
12783 pub fn constructor(&self) -> Function {
12785 let query = self.selection.select("constructor");
12786 Function {
12787 proc: self.proc.clone(),
12788 selection: query,
12789 graphql_client: self.graphql_client.clone(),
12790 }
12791 }
12792 pub async fn deprecated(&self) -> Result<String, DaggerError> {
12794 let query = self.selection.select("deprecated");
12795 query.execute(self.graphql_client.clone()).await
12796 }
12797 pub async fn description(&self) -> Result<String, DaggerError> {
12799 let query = self.selection.select("description");
12800 query.execute(self.graphql_client.clone()).await
12801 }
12802 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12804 let query = self.selection.select("fields");
12805 let query = query.select("id");
12806 let ids: Vec<FieldTypeDefId> = query.execute(self.graphql_client.clone()).await?;
12807 let root = Query {
12808 proc: self.proc.clone(),
12809 selection: crate::querybuilder::query(),
12810 graphql_client: self.graphql_client.clone(),
12811 };
12812 Ok(ids
12813 .into_iter()
12814 .map(|id| root.load_field_type_def_from_id(id))
12815 .collect())
12816 }
12817 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12819 let query = self.selection.select("functions");
12820 let query = query.select("id");
12821 let ids: Vec<FunctionId> = query.execute(self.graphql_client.clone()).await?;
12822 let root = Query {
12823 proc: self.proc.clone(),
12824 selection: crate::querybuilder::query(),
12825 graphql_client: self.graphql_client.clone(),
12826 };
12827 Ok(ids
12828 .into_iter()
12829 .map(|id| root.load_function_from_id(id))
12830 .collect())
12831 }
12832 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
12834 let query = self.selection.select("id");
12835 query.execute(self.graphql_client.clone()).await
12836 }
12837 pub async fn name(&self) -> Result<String, DaggerError> {
12839 let query = self.selection.select("name");
12840 query.execute(self.graphql_client.clone()).await
12841 }
12842 pub fn source_map(&self) -> SourceMap {
12844 let query = self.selection.select("sourceMap");
12845 SourceMap {
12846 proc: self.proc.clone(),
12847 selection: query,
12848 graphql_client: self.graphql_client.clone(),
12849 }
12850 }
12851 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12853 let query = self.selection.select("sourceModuleName");
12854 query.execute(self.graphql_client.clone()).await
12855 }
12856}
12857#[derive(Clone)]
12858pub struct Port {
12859 pub proc: Option<Arc<DaggerSessionProc>>,
12860 pub selection: Selection,
12861 pub graphql_client: DynGraphQLClient,
12862}
12863impl Port {
12864 pub async fn description(&self) -> Result<String, DaggerError> {
12866 let query = self.selection.select("description");
12867 query.execute(self.graphql_client.clone()).await
12868 }
12869 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12871 let query = self.selection.select("experimentalSkipHealthcheck");
12872 query.execute(self.graphql_client.clone()).await
12873 }
12874 pub async fn id(&self) -> Result<PortId, DaggerError> {
12876 let query = self.selection.select("id");
12877 query.execute(self.graphql_client.clone()).await
12878 }
12879 pub async fn port(&self) -> Result<isize, DaggerError> {
12881 let query = self.selection.select("port");
12882 query.execute(self.graphql_client.clone()).await
12883 }
12884 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12886 let query = self.selection.select("protocol");
12887 query.execute(self.graphql_client.clone()).await
12888 }
12889}
12890#[derive(Clone)]
12891pub struct Query {
12892 pub proc: Option<Arc<DaggerSessionProc>>,
12893 pub selection: Selection,
12894 pub graphql_client: DynGraphQLClient,
12895}
12896#[derive(Builder, Debug, PartialEq)]
12897pub struct QueryCacheVolumeOpts<'a> {
12898 #[builder(setter(into, strip_option), default)]
12902 pub owner: Option<&'a str>,
12903 #[builder(setter(into, strip_option), default)]
12905 pub sharing: Option<CacheSharingMode>,
12906 #[builder(setter(into, strip_option), default)]
12908 pub source: Option<DirectoryId>,
12909}
12910#[derive(Builder, Debug, PartialEq)]
12911pub struct QueryContainerOpts {
12912 #[builder(setter(into, strip_option), default)]
12914 pub platform: Option<Platform>,
12915}
12916#[derive(Builder, Debug, PartialEq)]
12917pub struct QueryCurrentTypeDefsOpts {
12918 #[builder(setter(into, strip_option), default)]
12921 pub hide_core: Option<bool>,
12922 #[builder(setter(into, strip_option), default)]
12924 pub return_all_types: Option<bool>,
12925}
12926#[derive(Builder, Debug, PartialEq)]
12927pub struct QueryEnvOpts {
12928 #[builder(setter(into, strip_option), default)]
12930 pub privileged: Option<bool>,
12931 #[builder(setter(into, strip_option), default)]
12933 pub writable: Option<bool>,
12934}
12935#[derive(Builder, Debug, PartialEq)]
12936pub struct QueryEnvFileOpts {
12937 #[builder(setter(into, strip_option), default)]
12939 pub expand: Option<bool>,
12940}
12941#[derive(Builder, Debug, PartialEq)]
12942pub struct QueryFileOpts {
12943 #[builder(setter(into, strip_option), default)]
12945 pub permissions: Option<isize>,
12946}
12947#[derive(Builder, Debug, PartialEq)]
12948pub struct QueryGitOpts<'a> {
12949 #[builder(setter(into, strip_option), default)]
12951 pub experimental_service_host: Option<ServiceId>,
12952 #[builder(setter(into, strip_option), default)]
12954 pub http_auth_header: Option<SecretId>,
12955 #[builder(setter(into, strip_option), default)]
12957 pub http_auth_token: Option<SecretId>,
12958 #[builder(setter(into, strip_option), default)]
12960 pub http_auth_username: Option<&'a str>,
12961 #[builder(setter(into, strip_option), default)]
12963 pub keep_git_dir: Option<bool>,
12964 #[builder(setter(into, strip_option), default)]
12966 pub ssh_auth_socket: Option<SocketId>,
12967 #[builder(setter(into, strip_option), default)]
12969 pub ssh_known_hosts: Option<&'a str>,
12970}
12971#[derive(Builder, Debug, PartialEq)]
12972pub struct QueryHttpOpts<'a> {
12973 #[builder(setter(into, strip_option), default)]
12975 pub auth_header: Option<SecretId>,
12976 #[builder(setter(into, strip_option), default)]
12978 pub checksum: Option<&'a str>,
12979 #[builder(setter(into, strip_option), default)]
12981 pub experimental_service_host: Option<ServiceId>,
12982 #[builder(setter(into, strip_option), default)]
12984 pub name: Option<&'a str>,
12985 #[builder(setter(into, strip_option), default)]
12987 pub permissions: Option<isize>,
12988}
12989#[derive(Builder, Debug, PartialEq)]
12990pub struct QueryLlmOpts<'a> {
12991 #[builder(setter(into, strip_option), default)]
12993 pub max_api_calls: Option<isize>,
12994 #[builder(setter(into, strip_option), default)]
12996 pub model: Option<&'a str>,
12997}
12998#[derive(Builder, Debug, PartialEq)]
12999pub struct QueryModuleSourceOpts<'a> {
13000 #[builder(setter(into, strip_option), default)]
13002 pub allow_not_exists: Option<bool>,
13003 #[builder(setter(into, strip_option), default)]
13005 pub disable_find_up: Option<bool>,
13006 #[builder(setter(into, strip_option), default)]
13008 pub ref_pin: Option<&'a str>,
13009 #[builder(setter(into, strip_option), default)]
13011 pub require_kind: Option<ModuleSourceKind>,
13012}
13013#[derive(Builder, Debug, PartialEq)]
13014pub struct QuerySecretOpts<'a> {
13015 #[builder(setter(into, strip_option), default)]
13019 pub cache_key: Option<&'a str>,
13020}
13021impl Query {
13022 pub fn address(&self, value: impl Into<String>) -> Address {
13024 let mut query = self.selection.select("address");
13025 query = query.arg("value", value.into());
13026 Address {
13027 proc: self.proc.clone(),
13028 selection: query,
13029 graphql_client: self.graphql_client.clone(),
13030 }
13031 }
13032 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
13039 let mut query = self.selection.select("cacheVolume");
13040 query = query.arg("key", key.into());
13041 CacheVolume {
13042 proc: self.proc.clone(),
13043 selection: query,
13044 graphql_client: self.graphql_client.clone(),
13045 }
13046 }
13047 pub fn cache_volume_opts<'a>(
13054 &self,
13055 key: impl Into<String>,
13056 opts: QueryCacheVolumeOpts<'a>,
13057 ) -> CacheVolume {
13058 let mut query = self.selection.select("cacheVolume");
13059 query = query.arg("key", key.into());
13060 if let Some(source) = opts.source {
13061 query = query.arg("source", source);
13062 }
13063 if let Some(sharing) = opts.sharing {
13064 query = query.arg("sharing", sharing);
13065 }
13066 if let Some(owner) = opts.owner {
13067 query = query.arg("owner", owner);
13068 }
13069 CacheVolume {
13070 proc: self.proc.clone(),
13071 selection: query,
13072 graphql_client: self.graphql_client.clone(),
13073 }
13074 }
13075 pub fn changeset(&self) -> Changeset {
13077 let query = self.selection.select("changeset");
13078 Changeset {
13079 proc: self.proc.clone(),
13080 selection: query,
13081 graphql_client: self.graphql_client.clone(),
13082 }
13083 }
13084 pub fn cloud(&self) -> Cloud {
13086 let query = self.selection.select("cloud");
13087 Cloud {
13088 proc: self.proc.clone(),
13089 selection: query,
13090 graphql_client: self.graphql_client.clone(),
13091 }
13092 }
13093 pub fn container(&self) -> Container {
13100 let query = self.selection.select("container");
13101 Container {
13102 proc: self.proc.clone(),
13103 selection: query,
13104 graphql_client: self.graphql_client.clone(),
13105 }
13106 }
13107 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
13114 let mut query = self.selection.select("container");
13115 if let Some(platform) = opts.platform {
13116 query = query.arg("platform", platform);
13117 }
13118 Container {
13119 proc: self.proc.clone(),
13120 selection: query,
13121 graphql_client: self.graphql_client.clone(),
13122 }
13123 }
13124 pub fn current_env(&self) -> Env {
13128 let query = self.selection.select("currentEnv");
13129 Env {
13130 proc: self.proc.clone(),
13131 selection: query,
13132 graphql_client: self.graphql_client.clone(),
13133 }
13134 }
13135 pub fn current_function_call(&self) -> FunctionCall {
13138 let query = self.selection.select("currentFunctionCall");
13139 FunctionCall {
13140 proc: self.proc.clone(),
13141 selection: query,
13142 graphql_client: self.graphql_client.clone(),
13143 }
13144 }
13145 pub fn current_module(&self) -> CurrentModule {
13147 let query = self.selection.select("currentModule");
13148 CurrentModule {
13149 proc: self.proc.clone(),
13150 selection: query,
13151 graphql_client: self.graphql_client.clone(),
13152 }
13153 }
13154 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
13160 let query = self.selection.select("currentTypeDefs");
13161 let query = query.select("id");
13162 let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
13163 let root = Query {
13164 proc: self.proc.clone(),
13165 selection: crate::querybuilder::query(),
13166 graphql_client: self.graphql_client.clone(),
13167 };
13168 Ok(ids
13169 .into_iter()
13170 .map(|id| root.load_type_def_from_id(id))
13171 .collect())
13172 }
13173 pub async fn current_type_defs_opts(
13179 &self,
13180 opts: QueryCurrentTypeDefsOpts,
13181 ) -> Result<Vec<TypeDef>, DaggerError> {
13182 let mut query = self.selection.select("currentTypeDefs");
13183 if let Some(return_all_types) = opts.return_all_types {
13184 query = query.arg("returnAllTypes", return_all_types);
13185 }
13186 if let Some(hide_core) = opts.hide_core {
13187 query = query.arg("hideCore", hide_core);
13188 }
13189 let query = query.select("id");
13190 let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
13191 let root = Query {
13192 proc: self.proc.clone(),
13193 selection: crate::querybuilder::query(),
13194 graphql_client: self.graphql_client.clone(),
13195 };
13196 Ok(ids
13197 .into_iter()
13198 .map(|id| root.load_type_def_from_id(id))
13199 .collect())
13200 }
13201 pub fn current_workspace(&self) -> Workspace {
13203 let query = self.selection.select("currentWorkspace");
13204 Workspace {
13205 proc: self.proc.clone(),
13206 selection: query,
13207 graphql_client: self.graphql_client.clone(),
13208 }
13209 }
13210 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13212 let query = self.selection.select("defaultPlatform");
13213 query.execute(self.graphql_client.clone()).await
13214 }
13215 pub fn directory(&self) -> Directory {
13217 let query = self.selection.select("directory");
13218 Directory {
13219 proc: self.proc.clone(),
13220 selection: query,
13221 graphql_client: self.graphql_client.clone(),
13222 }
13223 }
13224 pub fn engine(&self) -> Engine {
13226 let query = self.selection.select("engine");
13227 Engine {
13228 proc: self.proc.clone(),
13229 selection: query,
13230 graphql_client: self.graphql_client.clone(),
13231 }
13232 }
13233 pub fn env(&self) -> Env {
13239 let query = self.selection.select("env");
13240 Env {
13241 proc: self.proc.clone(),
13242 selection: query,
13243 graphql_client: self.graphql_client.clone(),
13244 }
13245 }
13246 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13252 let mut query = self.selection.select("env");
13253 if let Some(privileged) = opts.privileged {
13254 query = query.arg("privileged", privileged);
13255 }
13256 if let Some(writable) = opts.writable {
13257 query = query.arg("writable", writable);
13258 }
13259 Env {
13260 proc: self.proc.clone(),
13261 selection: query,
13262 graphql_client: self.graphql_client.clone(),
13263 }
13264 }
13265 pub fn env_file(&self) -> EnvFile {
13271 let query = self.selection.select("envFile");
13272 EnvFile {
13273 proc: self.proc.clone(),
13274 selection: query,
13275 graphql_client: self.graphql_client.clone(),
13276 }
13277 }
13278 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13284 let mut query = self.selection.select("envFile");
13285 if let Some(expand) = opts.expand {
13286 query = query.arg("expand", expand);
13287 }
13288 EnvFile {
13289 proc: self.proc.clone(),
13290 selection: query,
13291 graphql_client: self.graphql_client.clone(),
13292 }
13293 }
13294 pub fn error(&self, message: impl Into<String>) -> Error {
13300 let mut query = self.selection.select("error");
13301 query = query.arg("message", message.into());
13302 Error {
13303 proc: self.proc.clone(),
13304 selection: query,
13305 graphql_client: self.graphql_client.clone(),
13306 }
13307 }
13308 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13316 let mut query = self.selection.select("file");
13317 query = query.arg("name", name.into());
13318 query = query.arg("contents", contents.into());
13319 File {
13320 proc: self.proc.clone(),
13321 selection: query,
13322 graphql_client: self.graphql_client.clone(),
13323 }
13324 }
13325 pub fn file_opts(
13333 &self,
13334 name: impl Into<String>,
13335 contents: impl Into<String>,
13336 opts: QueryFileOpts,
13337 ) -> File {
13338 let mut query = self.selection.select("file");
13339 query = query.arg("name", name.into());
13340 query = query.arg("contents", contents.into());
13341 if let Some(permissions) = opts.permissions {
13342 query = query.arg("permissions", permissions);
13343 }
13344 File {
13345 proc: self.proc.clone(),
13346 selection: query,
13347 graphql_client: self.graphql_client.clone(),
13348 }
13349 }
13350 pub fn function(
13357 &self,
13358 name: impl Into<String>,
13359 return_type: impl IntoID<TypeDefId>,
13360 ) -> Function {
13361 let mut query = self.selection.select("function");
13362 query = query.arg("name", name.into());
13363 query = query.arg_lazy(
13364 "returnType",
13365 Box::new(move || {
13366 let return_type = return_type.clone();
13367 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13368 }),
13369 );
13370 Function {
13371 proc: self.proc.clone(),
13372 selection: query,
13373 graphql_client: self.graphql_client.clone(),
13374 }
13375 }
13376 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
13378 let mut query = self.selection.select("generatedCode");
13379 query = query.arg_lazy(
13380 "code",
13381 Box::new(move || {
13382 let code = code.clone();
13383 Box::pin(async move { code.into_id().await.unwrap().quote() })
13384 }),
13385 );
13386 GeneratedCode {
13387 proc: self.proc.clone(),
13388 selection: query,
13389 graphql_client: self.graphql_client.clone(),
13390 }
13391 }
13392 pub fn git(&self, url: impl Into<String>) -> GitRepository {
13403 let mut query = self.selection.select("git");
13404 query = query.arg("url", url.into());
13405 GitRepository {
13406 proc: self.proc.clone(),
13407 selection: query,
13408 graphql_client: self.graphql_client.clone(),
13409 }
13410 }
13411 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13422 let mut query = self.selection.select("git");
13423 query = query.arg("url", url.into());
13424 if let Some(keep_git_dir) = opts.keep_git_dir {
13425 query = query.arg("keepGitDir", keep_git_dir);
13426 }
13427 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13428 query = query.arg("sshKnownHosts", ssh_known_hosts);
13429 }
13430 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13431 query = query.arg("sshAuthSocket", ssh_auth_socket);
13432 }
13433 if let Some(http_auth_username) = opts.http_auth_username {
13434 query = query.arg("httpAuthUsername", http_auth_username);
13435 }
13436 if let Some(http_auth_token) = opts.http_auth_token {
13437 query = query.arg("httpAuthToken", http_auth_token);
13438 }
13439 if let Some(http_auth_header) = opts.http_auth_header {
13440 query = query.arg("httpAuthHeader", http_auth_header);
13441 }
13442 if let Some(experimental_service_host) = opts.experimental_service_host {
13443 query = query.arg("experimentalServiceHost", experimental_service_host);
13444 }
13445 GitRepository {
13446 proc: self.proc.clone(),
13447 selection: query,
13448 graphql_client: self.graphql_client.clone(),
13449 }
13450 }
13451 pub fn host(&self) -> Host {
13453 let query = self.selection.select("host");
13454 Host {
13455 proc: self.proc.clone(),
13456 selection: query,
13457 graphql_client: self.graphql_client.clone(),
13458 }
13459 }
13460 pub fn http(&self, url: impl Into<String>) -> File {
13467 let mut query = self.selection.select("http");
13468 query = query.arg("url", url.into());
13469 File {
13470 proc: self.proc.clone(),
13471 selection: query,
13472 graphql_client: self.graphql_client.clone(),
13473 }
13474 }
13475 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13482 let mut query = self.selection.select("http");
13483 query = query.arg("url", url.into());
13484 if let Some(name) = opts.name {
13485 query = query.arg("name", name);
13486 }
13487 if let Some(permissions) = opts.permissions {
13488 query = query.arg("permissions", permissions);
13489 }
13490 if let Some(checksum) = opts.checksum {
13491 query = query.arg("checksum", checksum);
13492 }
13493 if let Some(auth_header) = opts.auth_header {
13494 query = query.arg("authHeader", auth_header);
13495 }
13496 if let Some(experimental_service_host) = opts.experimental_service_host {
13497 query = query.arg("experimentalServiceHost", experimental_service_host);
13498 }
13499 File {
13500 proc: self.proc.clone(),
13501 selection: query,
13502 graphql_client: self.graphql_client.clone(),
13503 }
13504 }
13505 pub async fn id(&self) -> Result<QueryId, DaggerError> {
13507 let query = self.selection.select("id");
13508 query.execute(self.graphql_client.clone()).await
13509 }
13510 pub fn json(&self) -> JsonValue {
13512 let query = self.selection.select("json");
13513 JsonValue {
13514 proc: self.proc.clone(),
13515 selection: query,
13516 graphql_client: self.graphql_client.clone(),
13517 }
13518 }
13519 pub fn llm(&self) -> Llm {
13525 let query = self.selection.select("llm");
13526 Llm {
13527 proc: self.proc.clone(),
13528 selection: query,
13529 graphql_client: self.graphql_client.clone(),
13530 }
13531 }
13532 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13538 let mut query = self.selection.select("llm");
13539 if let Some(model) = opts.model {
13540 query = query.arg("model", model);
13541 }
13542 if let Some(max_api_calls) = opts.max_api_calls {
13543 query = query.arg("maxAPICalls", max_api_calls);
13544 }
13545 Llm {
13546 proc: self.proc.clone(),
13547 selection: query,
13548 graphql_client: self.graphql_client.clone(),
13549 }
13550 }
13551 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13553 let mut query = self.selection.select("loadAddressFromID");
13554 query = query.arg_lazy(
13555 "id",
13556 Box::new(move || {
13557 let id = id.clone();
13558 Box::pin(async move { id.into_id().await.unwrap().quote() })
13559 }),
13560 );
13561 Address {
13562 proc: self.proc.clone(),
13563 selection: query,
13564 graphql_client: self.graphql_client.clone(),
13565 }
13566 }
13567 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13569 let mut query = self.selection.select("loadBindingFromID");
13570 query = query.arg_lazy(
13571 "id",
13572 Box::new(move || {
13573 let id = id.clone();
13574 Box::pin(async move { id.into_id().await.unwrap().quote() })
13575 }),
13576 );
13577 Binding {
13578 proc: self.proc.clone(),
13579 selection: query,
13580 graphql_client: self.graphql_client.clone(),
13581 }
13582 }
13583 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13585 let mut query = self.selection.select("loadCacheVolumeFromID");
13586 query = query.arg_lazy(
13587 "id",
13588 Box::new(move || {
13589 let id = id.clone();
13590 Box::pin(async move { id.into_id().await.unwrap().quote() })
13591 }),
13592 );
13593 CacheVolume {
13594 proc: self.proc.clone(),
13595 selection: query,
13596 graphql_client: self.graphql_client.clone(),
13597 }
13598 }
13599 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13601 let mut query = self.selection.select("loadChangesetFromID");
13602 query = query.arg_lazy(
13603 "id",
13604 Box::new(move || {
13605 let id = id.clone();
13606 Box::pin(async move { id.into_id().await.unwrap().quote() })
13607 }),
13608 );
13609 Changeset {
13610 proc: self.proc.clone(),
13611 selection: query,
13612 graphql_client: self.graphql_client.clone(),
13613 }
13614 }
13615 pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13617 let mut query = self.selection.select("loadCheckFromID");
13618 query = query.arg_lazy(
13619 "id",
13620 Box::new(move || {
13621 let id = id.clone();
13622 Box::pin(async move { id.into_id().await.unwrap().quote() })
13623 }),
13624 );
13625 Check {
13626 proc: self.proc.clone(),
13627 selection: query,
13628 graphql_client: self.graphql_client.clone(),
13629 }
13630 }
13631 pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13633 let mut query = self.selection.select("loadCheckGroupFromID");
13634 query = query.arg_lazy(
13635 "id",
13636 Box::new(move || {
13637 let id = id.clone();
13638 Box::pin(async move { id.into_id().await.unwrap().quote() })
13639 }),
13640 );
13641 CheckGroup {
13642 proc: self.proc.clone(),
13643 selection: query,
13644 graphql_client: self.graphql_client.clone(),
13645 }
13646 }
13647 pub fn load_client_filesync_mirror_from_id(
13649 &self,
13650 id: impl IntoID<ClientFilesyncMirrorId>,
13651 ) -> ClientFilesyncMirror {
13652 let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13653 query = query.arg_lazy(
13654 "id",
13655 Box::new(move || {
13656 let id = id.clone();
13657 Box::pin(async move { id.into_id().await.unwrap().quote() })
13658 }),
13659 );
13660 ClientFilesyncMirror {
13661 proc: self.proc.clone(),
13662 selection: query,
13663 graphql_client: self.graphql_client.clone(),
13664 }
13665 }
13666 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13668 let mut query = self.selection.select("loadCloudFromID");
13669 query = query.arg_lazy(
13670 "id",
13671 Box::new(move || {
13672 let id = id.clone();
13673 Box::pin(async move { id.into_id().await.unwrap().quote() })
13674 }),
13675 );
13676 Cloud {
13677 proc: self.proc.clone(),
13678 selection: query,
13679 graphql_client: self.graphql_client.clone(),
13680 }
13681 }
13682 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13684 let mut query = self.selection.select("loadContainerFromID");
13685 query = query.arg_lazy(
13686 "id",
13687 Box::new(move || {
13688 let id = id.clone();
13689 Box::pin(async move { id.into_id().await.unwrap().quote() })
13690 }),
13691 );
13692 Container {
13693 proc: self.proc.clone(),
13694 selection: query,
13695 graphql_client: self.graphql_client.clone(),
13696 }
13697 }
13698 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13700 let mut query = self.selection.select("loadCurrentModuleFromID");
13701 query = query.arg_lazy(
13702 "id",
13703 Box::new(move || {
13704 let id = id.clone();
13705 Box::pin(async move { id.into_id().await.unwrap().quote() })
13706 }),
13707 );
13708 CurrentModule {
13709 proc: self.proc.clone(),
13710 selection: query,
13711 graphql_client: self.graphql_client.clone(),
13712 }
13713 }
13714 pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13716 let mut query = self.selection.select("loadDiffStatFromID");
13717 query = query.arg_lazy(
13718 "id",
13719 Box::new(move || {
13720 let id = id.clone();
13721 Box::pin(async move { id.into_id().await.unwrap().quote() })
13722 }),
13723 );
13724 DiffStat {
13725 proc: self.proc.clone(),
13726 selection: query,
13727 graphql_client: self.graphql_client.clone(),
13728 }
13729 }
13730 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13732 let mut query = self.selection.select("loadDirectoryFromID");
13733 query = query.arg_lazy(
13734 "id",
13735 Box::new(move || {
13736 let id = id.clone();
13737 Box::pin(async move { id.into_id().await.unwrap().quote() })
13738 }),
13739 );
13740 Directory {
13741 proc: self.proc.clone(),
13742 selection: query,
13743 graphql_client: self.graphql_client.clone(),
13744 }
13745 }
13746 pub fn load_engine_cache_entry_from_id(
13748 &self,
13749 id: impl IntoID<EngineCacheEntryId>,
13750 ) -> EngineCacheEntry {
13751 let mut query = self.selection.select("loadEngineCacheEntryFromID");
13752 query = query.arg_lazy(
13753 "id",
13754 Box::new(move || {
13755 let id = id.clone();
13756 Box::pin(async move { id.into_id().await.unwrap().quote() })
13757 }),
13758 );
13759 EngineCacheEntry {
13760 proc: self.proc.clone(),
13761 selection: query,
13762 graphql_client: self.graphql_client.clone(),
13763 }
13764 }
13765 pub fn load_engine_cache_entry_set_from_id(
13767 &self,
13768 id: impl IntoID<EngineCacheEntrySetId>,
13769 ) -> EngineCacheEntrySet {
13770 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13771 query = query.arg_lazy(
13772 "id",
13773 Box::new(move || {
13774 let id = id.clone();
13775 Box::pin(async move { id.into_id().await.unwrap().quote() })
13776 }),
13777 );
13778 EngineCacheEntrySet {
13779 proc: self.proc.clone(),
13780 selection: query,
13781 graphql_client: self.graphql_client.clone(),
13782 }
13783 }
13784 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13786 let mut query = self.selection.select("loadEngineCacheFromID");
13787 query = query.arg_lazy(
13788 "id",
13789 Box::new(move || {
13790 let id = id.clone();
13791 Box::pin(async move { id.into_id().await.unwrap().quote() })
13792 }),
13793 );
13794 EngineCache {
13795 proc: self.proc.clone(),
13796 selection: query,
13797 graphql_client: self.graphql_client.clone(),
13798 }
13799 }
13800 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13802 let mut query = self.selection.select("loadEngineFromID");
13803 query = query.arg_lazy(
13804 "id",
13805 Box::new(move || {
13806 let id = id.clone();
13807 Box::pin(async move { id.into_id().await.unwrap().quote() })
13808 }),
13809 );
13810 Engine {
13811 proc: self.proc.clone(),
13812 selection: query,
13813 graphql_client: self.graphql_client.clone(),
13814 }
13815 }
13816 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13818 let mut query = self.selection.select("loadEnumTypeDefFromID");
13819 query = query.arg_lazy(
13820 "id",
13821 Box::new(move || {
13822 let id = id.clone();
13823 Box::pin(async move { id.into_id().await.unwrap().quote() })
13824 }),
13825 );
13826 EnumTypeDef {
13827 proc: self.proc.clone(),
13828 selection: query,
13829 graphql_client: self.graphql_client.clone(),
13830 }
13831 }
13832 pub fn load_enum_value_type_def_from_id(
13834 &self,
13835 id: impl IntoID<EnumValueTypeDefId>,
13836 ) -> EnumValueTypeDef {
13837 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13838 query = query.arg_lazy(
13839 "id",
13840 Box::new(move || {
13841 let id = id.clone();
13842 Box::pin(async move { id.into_id().await.unwrap().quote() })
13843 }),
13844 );
13845 EnumValueTypeDef {
13846 proc: self.proc.clone(),
13847 selection: query,
13848 graphql_client: self.graphql_client.clone(),
13849 }
13850 }
13851 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13853 let mut query = self.selection.select("loadEnvFileFromID");
13854 query = query.arg_lazy(
13855 "id",
13856 Box::new(move || {
13857 let id = id.clone();
13858 Box::pin(async move { id.into_id().await.unwrap().quote() })
13859 }),
13860 );
13861 EnvFile {
13862 proc: self.proc.clone(),
13863 selection: query,
13864 graphql_client: self.graphql_client.clone(),
13865 }
13866 }
13867 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13869 let mut query = self.selection.select("loadEnvFromID");
13870 query = query.arg_lazy(
13871 "id",
13872 Box::new(move || {
13873 let id = id.clone();
13874 Box::pin(async move { id.into_id().await.unwrap().quote() })
13875 }),
13876 );
13877 Env {
13878 proc: self.proc.clone(),
13879 selection: query,
13880 graphql_client: self.graphql_client.clone(),
13881 }
13882 }
13883 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13885 let mut query = self.selection.select("loadEnvVariableFromID");
13886 query = query.arg_lazy(
13887 "id",
13888 Box::new(move || {
13889 let id = id.clone();
13890 Box::pin(async move { id.into_id().await.unwrap().quote() })
13891 }),
13892 );
13893 EnvVariable {
13894 proc: self.proc.clone(),
13895 selection: query,
13896 graphql_client: self.graphql_client.clone(),
13897 }
13898 }
13899 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13901 let mut query = self.selection.select("loadErrorFromID");
13902 query = query.arg_lazy(
13903 "id",
13904 Box::new(move || {
13905 let id = id.clone();
13906 Box::pin(async move { id.into_id().await.unwrap().quote() })
13907 }),
13908 );
13909 Error {
13910 proc: self.proc.clone(),
13911 selection: query,
13912 graphql_client: self.graphql_client.clone(),
13913 }
13914 }
13915 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13917 let mut query = self.selection.select("loadErrorValueFromID");
13918 query = query.arg_lazy(
13919 "id",
13920 Box::new(move || {
13921 let id = id.clone();
13922 Box::pin(async move { id.into_id().await.unwrap().quote() })
13923 }),
13924 );
13925 ErrorValue {
13926 proc: self.proc.clone(),
13927 selection: query,
13928 graphql_client: self.graphql_client.clone(),
13929 }
13930 }
13931 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13933 let mut query = self.selection.select("loadFieldTypeDefFromID");
13934 query = query.arg_lazy(
13935 "id",
13936 Box::new(move || {
13937 let id = id.clone();
13938 Box::pin(async move { id.into_id().await.unwrap().quote() })
13939 }),
13940 );
13941 FieldTypeDef {
13942 proc: self.proc.clone(),
13943 selection: query,
13944 graphql_client: self.graphql_client.clone(),
13945 }
13946 }
13947 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13949 let mut query = self.selection.select("loadFileFromID");
13950 query = query.arg_lazy(
13951 "id",
13952 Box::new(move || {
13953 let id = id.clone();
13954 Box::pin(async move { id.into_id().await.unwrap().quote() })
13955 }),
13956 );
13957 File {
13958 proc: self.proc.clone(),
13959 selection: query,
13960 graphql_client: self.graphql_client.clone(),
13961 }
13962 }
13963 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13965 let mut query = self.selection.select("loadFunctionArgFromID");
13966 query = query.arg_lazy(
13967 "id",
13968 Box::new(move || {
13969 let id = id.clone();
13970 Box::pin(async move { id.into_id().await.unwrap().quote() })
13971 }),
13972 );
13973 FunctionArg {
13974 proc: self.proc.clone(),
13975 selection: query,
13976 graphql_client: self.graphql_client.clone(),
13977 }
13978 }
13979 pub fn load_function_call_arg_value_from_id(
13981 &self,
13982 id: impl IntoID<FunctionCallArgValueId>,
13983 ) -> FunctionCallArgValue {
13984 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13985 query = query.arg_lazy(
13986 "id",
13987 Box::new(move || {
13988 let id = id.clone();
13989 Box::pin(async move { id.into_id().await.unwrap().quote() })
13990 }),
13991 );
13992 FunctionCallArgValue {
13993 proc: self.proc.clone(),
13994 selection: query,
13995 graphql_client: self.graphql_client.clone(),
13996 }
13997 }
13998 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
14000 let mut query = self.selection.select("loadFunctionCallFromID");
14001 query = query.arg_lazy(
14002 "id",
14003 Box::new(move || {
14004 let id = id.clone();
14005 Box::pin(async move { id.into_id().await.unwrap().quote() })
14006 }),
14007 );
14008 FunctionCall {
14009 proc: self.proc.clone(),
14010 selection: query,
14011 graphql_client: self.graphql_client.clone(),
14012 }
14013 }
14014 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
14016 let mut query = self.selection.select("loadFunctionFromID");
14017 query = query.arg_lazy(
14018 "id",
14019 Box::new(move || {
14020 let id = id.clone();
14021 Box::pin(async move { id.into_id().await.unwrap().quote() })
14022 }),
14023 );
14024 Function {
14025 proc: self.proc.clone(),
14026 selection: query,
14027 graphql_client: self.graphql_client.clone(),
14028 }
14029 }
14030 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
14032 let mut query = self.selection.select("loadGeneratedCodeFromID");
14033 query = query.arg_lazy(
14034 "id",
14035 Box::new(move || {
14036 let id = id.clone();
14037 Box::pin(async move { id.into_id().await.unwrap().quote() })
14038 }),
14039 );
14040 GeneratedCode {
14041 proc: self.proc.clone(),
14042 selection: query,
14043 graphql_client: self.graphql_client.clone(),
14044 }
14045 }
14046 pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
14048 let mut query = self.selection.select("loadGeneratorFromID");
14049 query = query.arg_lazy(
14050 "id",
14051 Box::new(move || {
14052 let id = id.clone();
14053 Box::pin(async move { id.into_id().await.unwrap().quote() })
14054 }),
14055 );
14056 Generator {
14057 proc: self.proc.clone(),
14058 selection: query,
14059 graphql_client: self.graphql_client.clone(),
14060 }
14061 }
14062 pub fn load_generator_group_from_id(
14064 &self,
14065 id: impl IntoID<GeneratorGroupId>,
14066 ) -> GeneratorGroup {
14067 let mut query = self.selection.select("loadGeneratorGroupFromID");
14068 query = query.arg_lazy(
14069 "id",
14070 Box::new(move || {
14071 let id = id.clone();
14072 Box::pin(async move { id.into_id().await.unwrap().quote() })
14073 }),
14074 );
14075 GeneratorGroup {
14076 proc: self.proc.clone(),
14077 selection: query,
14078 graphql_client: self.graphql_client.clone(),
14079 }
14080 }
14081 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
14083 let mut query = self.selection.select("loadGitRefFromID");
14084 query = query.arg_lazy(
14085 "id",
14086 Box::new(move || {
14087 let id = id.clone();
14088 Box::pin(async move { id.into_id().await.unwrap().quote() })
14089 }),
14090 );
14091 GitRef {
14092 proc: self.proc.clone(),
14093 selection: query,
14094 graphql_client: self.graphql_client.clone(),
14095 }
14096 }
14097 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
14099 let mut query = self.selection.select("loadGitRepositoryFromID");
14100 query = query.arg_lazy(
14101 "id",
14102 Box::new(move || {
14103 let id = id.clone();
14104 Box::pin(async move { id.into_id().await.unwrap().quote() })
14105 }),
14106 );
14107 GitRepository {
14108 proc: self.proc.clone(),
14109 selection: query,
14110 graphql_client: self.graphql_client.clone(),
14111 }
14112 }
14113 pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
14115 let mut query = self.selection.select("loadHTTPStateFromID");
14116 query = query.arg_lazy(
14117 "id",
14118 Box::new(move || {
14119 let id = id.clone();
14120 Box::pin(async move { id.into_id().await.unwrap().quote() })
14121 }),
14122 );
14123 HttpState {
14124 proc: self.proc.clone(),
14125 selection: query,
14126 graphql_client: self.graphql_client.clone(),
14127 }
14128 }
14129 pub fn load_healthcheck_config_from_id(
14131 &self,
14132 id: impl IntoID<HealthcheckConfigId>,
14133 ) -> HealthcheckConfig {
14134 let mut query = self.selection.select("loadHealthcheckConfigFromID");
14135 query = query.arg_lazy(
14136 "id",
14137 Box::new(move || {
14138 let id = id.clone();
14139 Box::pin(async move { id.into_id().await.unwrap().quote() })
14140 }),
14141 );
14142 HealthcheckConfig {
14143 proc: self.proc.clone(),
14144 selection: query,
14145 graphql_client: self.graphql_client.clone(),
14146 }
14147 }
14148 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
14150 let mut query = self.selection.select("loadHostFromID");
14151 query = query.arg_lazy(
14152 "id",
14153 Box::new(move || {
14154 let id = id.clone();
14155 Box::pin(async move { id.into_id().await.unwrap().quote() })
14156 }),
14157 );
14158 Host {
14159 proc: self.proc.clone(),
14160 selection: query,
14161 graphql_client: self.graphql_client.clone(),
14162 }
14163 }
14164 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14166 let mut query = self.selection.select("loadInputTypeDefFromID");
14167 query = query.arg_lazy(
14168 "id",
14169 Box::new(move || {
14170 let id = id.clone();
14171 Box::pin(async move { id.into_id().await.unwrap().quote() })
14172 }),
14173 );
14174 InputTypeDef {
14175 proc: self.proc.clone(),
14176 selection: query,
14177 graphql_client: self.graphql_client.clone(),
14178 }
14179 }
14180 pub fn load_interface_type_def_from_id(
14182 &self,
14183 id: impl IntoID<InterfaceTypeDefId>,
14184 ) -> InterfaceTypeDef {
14185 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14186 query = query.arg_lazy(
14187 "id",
14188 Box::new(move || {
14189 let id = id.clone();
14190 Box::pin(async move { id.into_id().await.unwrap().quote() })
14191 }),
14192 );
14193 InterfaceTypeDef {
14194 proc: self.proc.clone(),
14195 selection: query,
14196 graphql_client: self.graphql_client.clone(),
14197 }
14198 }
14199 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14201 let mut query = self.selection.select("loadJSONValueFromID");
14202 query = query.arg_lazy(
14203 "id",
14204 Box::new(move || {
14205 let id = id.clone();
14206 Box::pin(async move { id.into_id().await.unwrap().quote() })
14207 }),
14208 );
14209 JsonValue {
14210 proc: self.proc.clone(),
14211 selection: query,
14212 graphql_client: self.graphql_client.clone(),
14213 }
14214 }
14215 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14217 let mut query = self.selection.select("loadLLMFromID");
14218 query = query.arg_lazy(
14219 "id",
14220 Box::new(move || {
14221 let id = id.clone();
14222 Box::pin(async move { id.into_id().await.unwrap().quote() })
14223 }),
14224 );
14225 Llm {
14226 proc: self.proc.clone(),
14227 selection: query,
14228 graphql_client: self.graphql_client.clone(),
14229 }
14230 }
14231 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14233 let mut query = self.selection.select("loadLLMTokenUsageFromID");
14234 query = query.arg_lazy(
14235 "id",
14236 Box::new(move || {
14237 let id = id.clone();
14238 Box::pin(async move { id.into_id().await.unwrap().quote() })
14239 }),
14240 );
14241 LlmTokenUsage {
14242 proc: self.proc.clone(),
14243 selection: query,
14244 graphql_client: self.graphql_client.clone(),
14245 }
14246 }
14247 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14249 let mut query = self.selection.select("loadLabelFromID");
14250 query = query.arg_lazy(
14251 "id",
14252 Box::new(move || {
14253 let id = id.clone();
14254 Box::pin(async move { id.into_id().await.unwrap().quote() })
14255 }),
14256 );
14257 Label {
14258 proc: self.proc.clone(),
14259 selection: query,
14260 graphql_client: self.graphql_client.clone(),
14261 }
14262 }
14263 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14265 let mut query = self.selection.select("loadListTypeDefFromID");
14266 query = query.arg_lazy(
14267 "id",
14268 Box::new(move || {
14269 let id = id.clone();
14270 Box::pin(async move { id.into_id().await.unwrap().quote() })
14271 }),
14272 );
14273 ListTypeDef {
14274 proc: self.proc.clone(),
14275 selection: query,
14276 graphql_client: self.graphql_client.clone(),
14277 }
14278 }
14279 pub fn load_module_config_client_from_id(
14281 &self,
14282 id: impl IntoID<ModuleConfigClientId>,
14283 ) -> ModuleConfigClient {
14284 let mut query = self.selection.select("loadModuleConfigClientFromID");
14285 query = query.arg_lazy(
14286 "id",
14287 Box::new(move || {
14288 let id = id.clone();
14289 Box::pin(async move { id.into_id().await.unwrap().quote() })
14290 }),
14291 );
14292 ModuleConfigClient {
14293 proc: self.proc.clone(),
14294 selection: query,
14295 graphql_client: self.graphql_client.clone(),
14296 }
14297 }
14298 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14300 let mut query = self.selection.select("loadModuleFromID");
14301 query = query.arg_lazy(
14302 "id",
14303 Box::new(move || {
14304 let id = id.clone();
14305 Box::pin(async move { id.into_id().await.unwrap().quote() })
14306 }),
14307 );
14308 Module {
14309 proc: self.proc.clone(),
14310 selection: query,
14311 graphql_client: self.graphql_client.clone(),
14312 }
14313 }
14314 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14316 let mut query = self.selection.select("loadModuleSourceFromID");
14317 query = query.arg_lazy(
14318 "id",
14319 Box::new(move || {
14320 let id = id.clone();
14321 Box::pin(async move { id.into_id().await.unwrap().quote() })
14322 }),
14323 );
14324 ModuleSource {
14325 proc: self.proc.clone(),
14326 selection: query,
14327 graphql_client: self.graphql_client.clone(),
14328 }
14329 }
14330 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14332 let mut query = self.selection.select("loadObjectTypeDefFromID");
14333 query = query.arg_lazy(
14334 "id",
14335 Box::new(move || {
14336 let id = id.clone();
14337 Box::pin(async move { id.into_id().await.unwrap().quote() })
14338 }),
14339 );
14340 ObjectTypeDef {
14341 proc: self.proc.clone(),
14342 selection: query,
14343 graphql_client: self.graphql_client.clone(),
14344 }
14345 }
14346 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14348 let mut query = self.selection.select("loadPortFromID");
14349 query = query.arg_lazy(
14350 "id",
14351 Box::new(move || {
14352 let id = id.clone();
14353 Box::pin(async move { id.into_id().await.unwrap().quote() })
14354 }),
14355 );
14356 Port {
14357 proc: self.proc.clone(),
14358 selection: query,
14359 graphql_client: self.graphql_client.clone(),
14360 }
14361 }
14362 pub fn load_query_from_id(&self, id: impl IntoID<QueryId>) -> Query {
14364 let mut query = self.selection.select("loadQueryFromID");
14365 query = query.arg_lazy(
14366 "id",
14367 Box::new(move || {
14368 let id = id.clone();
14369 Box::pin(async move { id.into_id().await.unwrap().quote() })
14370 }),
14371 );
14372 Query {
14373 proc: self.proc.clone(),
14374 selection: query,
14375 graphql_client: self.graphql_client.clone(),
14376 }
14377 }
14378 pub fn load_remote_git_mirror_from_id(
14380 &self,
14381 id: impl IntoID<RemoteGitMirrorId>,
14382 ) -> RemoteGitMirror {
14383 let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14384 query = query.arg_lazy(
14385 "id",
14386 Box::new(move || {
14387 let id = id.clone();
14388 Box::pin(async move { id.into_id().await.unwrap().quote() })
14389 }),
14390 );
14391 RemoteGitMirror {
14392 proc: self.proc.clone(),
14393 selection: query,
14394 graphql_client: self.graphql_client.clone(),
14395 }
14396 }
14397 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14399 let mut query = self.selection.select("loadSDKConfigFromID");
14400 query = query.arg_lazy(
14401 "id",
14402 Box::new(move || {
14403 let id = id.clone();
14404 Box::pin(async move { id.into_id().await.unwrap().quote() })
14405 }),
14406 );
14407 SdkConfig {
14408 proc: self.proc.clone(),
14409 selection: query,
14410 graphql_client: self.graphql_client.clone(),
14411 }
14412 }
14413 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14415 let mut query = self.selection.select("loadScalarTypeDefFromID");
14416 query = query.arg_lazy(
14417 "id",
14418 Box::new(move || {
14419 let id = id.clone();
14420 Box::pin(async move { id.into_id().await.unwrap().quote() })
14421 }),
14422 );
14423 ScalarTypeDef {
14424 proc: self.proc.clone(),
14425 selection: query,
14426 graphql_client: self.graphql_client.clone(),
14427 }
14428 }
14429 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14431 let mut query = self.selection.select("loadSearchResultFromID");
14432 query = query.arg_lazy(
14433 "id",
14434 Box::new(move || {
14435 let id = id.clone();
14436 Box::pin(async move { id.into_id().await.unwrap().quote() })
14437 }),
14438 );
14439 SearchResult {
14440 proc: self.proc.clone(),
14441 selection: query,
14442 graphql_client: self.graphql_client.clone(),
14443 }
14444 }
14445 pub fn load_search_submatch_from_id(
14447 &self,
14448 id: impl IntoID<SearchSubmatchId>,
14449 ) -> SearchSubmatch {
14450 let mut query = self.selection.select("loadSearchSubmatchFromID");
14451 query = query.arg_lazy(
14452 "id",
14453 Box::new(move || {
14454 let id = id.clone();
14455 Box::pin(async move { id.into_id().await.unwrap().quote() })
14456 }),
14457 );
14458 SearchSubmatch {
14459 proc: self.proc.clone(),
14460 selection: query,
14461 graphql_client: self.graphql_client.clone(),
14462 }
14463 }
14464 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14466 let mut query = self.selection.select("loadSecretFromID");
14467 query = query.arg_lazy(
14468 "id",
14469 Box::new(move || {
14470 let id = id.clone();
14471 Box::pin(async move { id.into_id().await.unwrap().quote() })
14472 }),
14473 );
14474 Secret {
14475 proc: self.proc.clone(),
14476 selection: query,
14477 graphql_client: self.graphql_client.clone(),
14478 }
14479 }
14480 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14482 let mut query = self.selection.select("loadServiceFromID");
14483 query = query.arg_lazy(
14484 "id",
14485 Box::new(move || {
14486 let id = id.clone();
14487 Box::pin(async move { id.into_id().await.unwrap().quote() })
14488 }),
14489 );
14490 Service {
14491 proc: self.proc.clone(),
14492 selection: query,
14493 graphql_client: self.graphql_client.clone(),
14494 }
14495 }
14496 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14498 let mut query = self.selection.select("loadSocketFromID");
14499 query = query.arg_lazy(
14500 "id",
14501 Box::new(move || {
14502 let id = id.clone();
14503 Box::pin(async move { id.into_id().await.unwrap().quote() })
14504 }),
14505 );
14506 Socket {
14507 proc: self.proc.clone(),
14508 selection: query,
14509 graphql_client: self.graphql_client.clone(),
14510 }
14511 }
14512 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14514 let mut query = self.selection.select("loadSourceMapFromID");
14515 query = query.arg_lazy(
14516 "id",
14517 Box::new(move || {
14518 let id = id.clone();
14519 Box::pin(async move { id.into_id().await.unwrap().quote() })
14520 }),
14521 );
14522 SourceMap {
14523 proc: self.proc.clone(),
14524 selection: query,
14525 graphql_client: self.graphql_client.clone(),
14526 }
14527 }
14528 pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14530 let mut query = self.selection.select("loadStatFromID");
14531 query = query.arg_lazy(
14532 "id",
14533 Box::new(move || {
14534 let id = id.clone();
14535 Box::pin(async move { id.into_id().await.unwrap().quote() })
14536 }),
14537 );
14538 Stat {
14539 proc: self.proc.clone(),
14540 selection: query,
14541 graphql_client: self.graphql_client.clone(),
14542 }
14543 }
14544 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14546 let mut query = self.selection.select("loadTerminalFromID");
14547 query = query.arg_lazy(
14548 "id",
14549 Box::new(move || {
14550 let id = id.clone();
14551 Box::pin(async move { id.into_id().await.unwrap().quote() })
14552 }),
14553 );
14554 Terminal {
14555 proc: self.proc.clone(),
14556 selection: query,
14557 graphql_client: self.graphql_client.clone(),
14558 }
14559 }
14560 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14562 let mut query = self.selection.select("loadTypeDefFromID");
14563 query = query.arg_lazy(
14564 "id",
14565 Box::new(move || {
14566 let id = id.clone();
14567 Box::pin(async move { id.into_id().await.unwrap().quote() })
14568 }),
14569 );
14570 TypeDef {
14571 proc: self.proc.clone(),
14572 selection: query,
14573 graphql_client: self.graphql_client.clone(),
14574 }
14575 }
14576 pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14578 let mut query = self.selection.select("loadUpFromID");
14579 query = query.arg_lazy(
14580 "id",
14581 Box::new(move || {
14582 let id = id.clone();
14583 Box::pin(async move { id.into_id().await.unwrap().quote() })
14584 }),
14585 );
14586 Up {
14587 proc: self.proc.clone(),
14588 selection: query,
14589 graphql_client: self.graphql_client.clone(),
14590 }
14591 }
14592 pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14594 let mut query = self.selection.select("loadUpGroupFromID");
14595 query = query.arg_lazy(
14596 "id",
14597 Box::new(move || {
14598 let id = id.clone();
14599 Box::pin(async move { id.into_id().await.unwrap().quote() })
14600 }),
14601 );
14602 UpGroup {
14603 proc: self.proc.clone(),
14604 selection: query,
14605 graphql_client: self.graphql_client.clone(),
14606 }
14607 }
14608 pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14610 let mut query = self.selection.select("loadWorkspaceFromID");
14611 query = query.arg_lazy(
14612 "id",
14613 Box::new(move || {
14614 let id = id.clone();
14615 Box::pin(async move { id.into_id().await.unwrap().quote() })
14616 }),
14617 );
14618 Workspace {
14619 proc: self.proc.clone(),
14620 selection: query,
14621 graphql_client: self.graphql_client.clone(),
14622 }
14623 }
14624 pub fn module(&self) -> Module {
14626 let query = self.selection.select("module");
14627 Module {
14628 proc: self.proc.clone(),
14629 selection: query,
14630 graphql_client: self.graphql_client.clone(),
14631 }
14632 }
14633 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14640 let mut query = self.selection.select("moduleSource");
14641 query = query.arg("refString", ref_string.into());
14642 ModuleSource {
14643 proc: self.proc.clone(),
14644 selection: query,
14645 graphql_client: self.graphql_client.clone(),
14646 }
14647 }
14648 pub fn module_source_opts<'a>(
14655 &self,
14656 ref_string: impl Into<String>,
14657 opts: QueryModuleSourceOpts<'a>,
14658 ) -> ModuleSource {
14659 let mut query = self.selection.select("moduleSource");
14660 query = query.arg("refString", ref_string.into());
14661 if let Some(ref_pin) = opts.ref_pin {
14662 query = query.arg("refPin", ref_pin);
14663 }
14664 if let Some(disable_find_up) = opts.disable_find_up {
14665 query = query.arg("disableFindUp", disable_find_up);
14666 }
14667 if let Some(allow_not_exists) = opts.allow_not_exists {
14668 query = query.arg("allowNotExists", allow_not_exists);
14669 }
14670 if let Some(require_kind) = opts.require_kind {
14671 query = query.arg("requireKind", require_kind);
14672 }
14673 ModuleSource {
14674 proc: self.proc.clone(),
14675 selection: query,
14676 graphql_client: self.graphql_client.clone(),
14677 }
14678 }
14679 pub fn secret(&self, uri: impl Into<String>) -> Secret {
14686 let mut query = self.selection.select("secret");
14687 query = query.arg("uri", uri.into());
14688 Secret {
14689 proc: self.proc.clone(),
14690 selection: query,
14691 graphql_client: self.graphql_client.clone(),
14692 }
14693 }
14694 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14701 let mut query = self.selection.select("secret");
14702 query = query.arg("uri", uri.into());
14703 if let Some(cache_key) = opts.cache_key {
14704 query = query.arg("cacheKey", cache_key);
14705 }
14706 Secret {
14707 proc: self.proc.clone(),
14708 selection: query,
14709 graphql_client: self.graphql_client.clone(),
14710 }
14711 }
14712 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14720 let mut query = self.selection.select("setSecret");
14721 query = query.arg("name", name.into());
14722 query = query.arg("plaintext", plaintext.into());
14723 Secret {
14724 proc: self.proc.clone(),
14725 selection: query,
14726 graphql_client: self.graphql_client.clone(),
14727 }
14728 }
14729 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14737 let mut query = self.selection.select("sourceMap");
14738 query = query.arg("filename", filename.into());
14739 query = query.arg("line", line);
14740 query = query.arg("column", column);
14741 SourceMap {
14742 proc: self.proc.clone(),
14743 selection: query,
14744 graphql_client: self.graphql_client.clone(),
14745 }
14746 }
14747 pub fn type_def(&self) -> TypeDef {
14749 let query = self.selection.select("typeDef");
14750 TypeDef {
14751 proc: self.proc.clone(),
14752 selection: query,
14753 graphql_client: self.graphql_client.clone(),
14754 }
14755 }
14756 pub async fn version(&self) -> Result<String, DaggerError> {
14758 let query = self.selection.select("version");
14759 query.execute(self.graphql_client.clone()).await
14760 }
14761}
14762#[derive(Clone)]
14763pub struct RemoteGitMirror {
14764 pub proc: Option<Arc<DaggerSessionProc>>,
14765 pub selection: Selection,
14766 pub graphql_client: DynGraphQLClient,
14767}
14768impl RemoteGitMirror {
14769 pub async fn id(&self) -> Result<RemoteGitMirrorId, DaggerError> {
14771 let query = self.selection.select("id");
14772 query.execute(self.graphql_client.clone()).await
14773 }
14774}
14775#[derive(Clone)]
14776pub struct SdkConfig {
14777 pub proc: Option<Arc<DaggerSessionProc>>,
14778 pub selection: Selection,
14779 pub graphql_client: DynGraphQLClient,
14780}
14781impl SdkConfig {
14782 pub async fn debug(&self) -> Result<bool, DaggerError> {
14784 let query = self.selection.select("debug");
14785 query.execute(self.graphql_client.clone()).await
14786 }
14787 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
14789 let query = self.selection.select("id");
14790 query.execute(self.graphql_client.clone()).await
14791 }
14792 pub async fn source(&self) -> Result<String, DaggerError> {
14794 let query = self.selection.select("source");
14795 query.execute(self.graphql_client.clone()).await
14796 }
14797}
14798#[derive(Clone)]
14799pub struct ScalarTypeDef {
14800 pub proc: Option<Arc<DaggerSessionProc>>,
14801 pub selection: Selection,
14802 pub graphql_client: DynGraphQLClient,
14803}
14804impl ScalarTypeDef {
14805 pub async fn description(&self) -> Result<String, DaggerError> {
14807 let query = self.selection.select("description");
14808 query.execute(self.graphql_client.clone()).await
14809 }
14810 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
14812 let query = self.selection.select("id");
14813 query.execute(self.graphql_client.clone()).await
14814 }
14815 pub async fn name(&self) -> Result<String, DaggerError> {
14817 let query = self.selection.select("name");
14818 query.execute(self.graphql_client.clone()).await
14819 }
14820 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14822 let query = self.selection.select("sourceModuleName");
14823 query.execute(self.graphql_client.clone()).await
14824 }
14825}
14826#[derive(Clone)]
14827pub struct SearchResult {
14828 pub proc: Option<Arc<DaggerSessionProc>>,
14829 pub selection: Selection,
14830 pub graphql_client: DynGraphQLClient,
14831}
14832impl SearchResult {
14833 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14835 let query = self.selection.select("absoluteOffset");
14836 query.execute(self.graphql_client.clone()).await
14837 }
14838 pub async fn file_path(&self) -> Result<String, DaggerError> {
14840 let query = self.selection.select("filePath");
14841 query.execute(self.graphql_client.clone()).await
14842 }
14843 pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
14845 let query = self.selection.select("id");
14846 query.execute(self.graphql_client.clone()).await
14847 }
14848 pub async fn line_number(&self) -> Result<isize, DaggerError> {
14850 let query = self.selection.select("lineNumber");
14851 query.execute(self.graphql_client.clone()).await
14852 }
14853 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14855 let query = self.selection.select("matchedLines");
14856 query.execute(self.graphql_client.clone()).await
14857 }
14858 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14860 let query = self.selection.select("submatches");
14861 let query = query.select("id");
14862 let ids: Vec<SearchSubmatchId> = query.execute(self.graphql_client.clone()).await?;
14863 let root = Query {
14864 proc: self.proc.clone(),
14865 selection: crate::querybuilder::query(),
14866 graphql_client: self.graphql_client.clone(),
14867 };
14868 Ok(ids
14869 .into_iter()
14870 .map(|id| root.load_search_submatch_from_id(id))
14871 .collect())
14872 }
14873}
14874#[derive(Clone)]
14875pub struct SearchSubmatch {
14876 pub proc: Option<Arc<DaggerSessionProc>>,
14877 pub selection: Selection,
14878 pub graphql_client: DynGraphQLClient,
14879}
14880impl SearchSubmatch {
14881 pub async fn end(&self) -> Result<isize, DaggerError> {
14883 let query = self.selection.select("end");
14884 query.execute(self.graphql_client.clone()).await
14885 }
14886 pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
14888 let query = self.selection.select("id");
14889 query.execute(self.graphql_client.clone()).await
14890 }
14891 pub async fn start(&self) -> Result<isize, DaggerError> {
14893 let query = self.selection.select("start");
14894 query.execute(self.graphql_client.clone()).await
14895 }
14896 pub async fn text(&self) -> Result<String, DaggerError> {
14898 let query = self.selection.select("text");
14899 query.execute(self.graphql_client.clone()).await
14900 }
14901}
14902#[derive(Clone)]
14903pub struct Secret {
14904 pub proc: Option<Arc<DaggerSessionProc>>,
14905 pub selection: Selection,
14906 pub graphql_client: DynGraphQLClient,
14907}
14908impl Secret {
14909 pub async fn id(&self) -> Result<SecretId, DaggerError> {
14911 let query = self.selection.select("id");
14912 query.execute(self.graphql_client.clone()).await
14913 }
14914 pub async fn name(&self) -> Result<String, DaggerError> {
14916 let query = self.selection.select("name");
14917 query.execute(self.graphql_client.clone()).await
14918 }
14919 pub async fn plaintext(&self) -> Result<String, DaggerError> {
14921 let query = self.selection.select("plaintext");
14922 query.execute(self.graphql_client.clone()).await
14923 }
14924 pub async fn uri(&self) -> Result<String, DaggerError> {
14926 let query = self.selection.select("uri");
14927 query.execute(self.graphql_client.clone()).await
14928 }
14929}
14930#[derive(Clone)]
14931pub struct Service {
14932 pub proc: Option<Arc<DaggerSessionProc>>,
14933 pub selection: Selection,
14934 pub graphql_client: DynGraphQLClient,
14935}
14936#[derive(Builder, Debug, PartialEq)]
14937pub struct ServiceEndpointOpts<'a> {
14938 #[builder(setter(into, strip_option), default)]
14940 pub port: Option<isize>,
14941 #[builder(setter(into, strip_option), default)]
14943 pub scheme: Option<&'a str>,
14944}
14945#[derive(Builder, Debug, PartialEq)]
14946pub struct ServiceStopOpts {
14947 #[builder(setter(into, strip_option), default)]
14949 pub kill: Option<bool>,
14950}
14951#[derive(Builder, Debug, PartialEq)]
14952pub struct ServiceTerminalOpts<'a> {
14953 #[builder(setter(into, strip_option), default)]
14954 pub cmd: Option<Vec<&'a str>>,
14955}
14956#[derive(Builder, Debug, PartialEq)]
14957pub struct ServiceUpOpts {
14958 #[builder(setter(into, strip_option), default)]
14961 pub ports: Option<Vec<PortForward>>,
14962 #[builder(setter(into, strip_option), default)]
14964 pub random: Option<bool>,
14965}
14966impl Service {
14967 pub async fn endpoint(&self) -> Result<String, DaggerError> {
14975 let query = self.selection.select("endpoint");
14976 query.execute(self.graphql_client.clone()).await
14977 }
14978 pub async fn endpoint_opts<'a>(
14986 &self,
14987 opts: ServiceEndpointOpts<'a>,
14988 ) -> Result<String, DaggerError> {
14989 let mut query = self.selection.select("endpoint");
14990 if let Some(port) = opts.port {
14991 query = query.arg("port", port);
14992 }
14993 if let Some(scheme) = opts.scheme {
14994 query = query.arg("scheme", scheme);
14995 }
14996 query.execute(self.graphql_client.clone()).await
14997 }
14998 pub async fn hostname(&self) -> Result<String, DaggerError> {
15000 let query = self.selection.select("hostname");
15001 query.execute(self.graphql_client.clone()).await
15002 }
15003 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
15005 let query = self.selection.select("id");
15006 query.execute(self.graphql_client.clone()).await
15007 }
15008 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15010 let query = self.selection.select("ports");
15011 let query = query.select("id");
15012 let ids: Vec<PortId> = query.execute(self.graphql_client.clone()).await?;
15013 let root = Query {
15014 proc: self.proc.clone(),
15015 selection: crate::querybuilder::query(),
15016 graphql_client: self.graphql_client.clone(),
15017 };
15018 Ok(ids
15019 .into_iter()
15020 .map(|id| root.load_port_from_id(id))
15021 .collect())
15022 }
15023 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
15026 let query = self.selection.select("start");
15027 query.execute(self.graphql_client.clone()).await
15028 }
15029 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
15035 let query = self.selection.select("stop");
15036 query.execute(self.graphql_client.clone()).await
15037 }
15038 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
15044 let mut query = self.selection.select("stop");
15045 if let Some(kill) = opts.kill {
15046 query = query.arg("kill", kill);
15047 }
15048 query.execute(self.graphql_client.clone()).await
15049 }
15050 pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
15052 let query = self.selection.select("sync");
15053 query.execute(self.graphql_client.clone()).await
15054 }
15055 pub fn terminal(&self) -> Service {
15060 let query = self.selection.select("terminal");
15061 Service {
15062 proc: self.proc.clone(),
15063 selection: query,
15064 graphql_client: self.graphql_client.clone(),
15065 }
15066 }
15067 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15072 let mut query = self.selection.select("terminal");
15073 if let Some(cmd) = opts.cmd {
15074 query = query.arg("cmd", cmd);
15075 }
15076 Service {
15077 proc: self.proc.clone(),
15078 selection: query,
15079 graphql_client: self.graphql_client.clone(),
15080 }
15081 }
15082 pub async fn up(&self) -> Result<Void, DaggerError> {
15088 let query = self.selection.select("up");
15089 query.execute(self.graphql_client.clone()).await
15090 }
15091 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15097 let mut query = self.selection.select("up");
15098 if let Some(ports) = opts.ports {
15099 query = query.arg("ports", ports);
15100 }
15101 if let Some(random) = opts.random {
15102 query = query.arg("random", random);
15103 }
15104 query.execute(self.graphql_client.clone()).await
15105 }
15106 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15112 let mut query = self.selection.select("withHostname");
15113 query = query.arg("hostname", hostname.into());
15114 Service {
15115 proc: self.proc.clone(),
15116 selection: query,
15117 graphql_client: self.graphql_client.clone(),
15118 }
15119 }
15120}
15121#[derive(Clone)]
15122pub struct Socket {
15123 pub proc: Option<Arc<DaggerSessionProc>>,
15124 pub selection: Selection,
15125 pub graphql_client: DynGraphQLClient,
15126}
15127impl Socket {
15128 pub async fn id(&self) -> Result<SocketId, DaggerError> {
15130 let query = self.selection.select("id");
15131 query.execute(self.graphql_client.clone()).await
15132 }
15133}
15134#[derive(Clone)]
15135pub struct SourceMap {
15136 pub proc: Option<Arc<DaggerSessionProc>>,
15137 pub selection: Selection,
15138 pub graphql_client: DynGraphQLClient,
15139}
15140impl SourceMap {
15141 pub async fn column(&self) -> Result<isize, DaggerError> {
15143 let query = self.selection.select("column");
15144 query.execute(self.graphql_client.clone()).await
15145 }
15146 pub async fn filename(&self) -> Result<String, DaggerError> {
15148 let query = self.selection.select("filename");
15149 query.execute(self.graphql_client.clone()).await
15150 }
15151 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
15153 let query = self.selection.select("id");
15154 query.execute(self.graphql_client.clone()).await
15155 }
15156 pub async fn line(&self) -> Result<isize, DaggerError> {
15158 let query = self.selection.select("line");
15159 query.execute(self.graphql_client.clone()).await
15160 }
15161 pub async fn module(&self) -> Result<String, DaggerError> {
15163 let query = self.selection.select("module");
15164 query.execute(self.graphql_client.clone()).await
15165 }
15166 pub async fn url(&self) -> Result<String, DaggerError> {
15168 let query = self.selection.select("url");
15169 query.execute(self.graphql_client.clone()).await
15170 }
15171}
15172#[derive(Clone)]
15173pub struct Stat {
15174 pub proc: Option<Arc<DaggerSessionProc>>,
15175 pub selection: Selection,
15176 pub graphql_client: DynGraphQLClient,
15177}
15178impl Stat {
15179 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15181 let query = self.selection.select("fileType");
15182 query.execute(self.graphql_client.clone()).await
15183 }
15184 pub async fn id(&self) -> Result<StatId, DaggerError> {
15186 let query = self.selection.select("id");
15187 query.execute(self.graphql_client.clone()).await
15188 }
15189 pub async fn name(&self) -> Result<String, DaggerError> {
15191 let query = self.selection.select("name");
15192 query.execute(self.graphql_client.clone()).await
15193 }
15194 pub async fn permissions(&self) -> Result<isize, DaggerError> {
15196 let query = self.selection.select("permissions");
15197 query.execute(self.graphql_client.clone()).await
15198 }
15199 pub async fn size(&self) -> Result<isize, DaggerError> {
15201 let query = self.selection.select("size");
15202 query.execute(self.graphql_client.clone()).await
15203 }
15204}
15205#[derive(Clone)]
15206pub struct Terminal {
15207 pub proc: Option<Arc<DaggerSessionProc>>,
15208 pub selection: Selection,
15209 pub graphql_client: DynGraphQLClient,
15210}
15211impl Terminal {
15212 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
15214 let query = self.selection.select("id");
15215 query.execute(self.graphql_client.clone()).await
15216 }
15217 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
15220 let query = self.selection.select("sync");
15221 query.execute(self.graphql_client.clone()).await
15222 }
15223}
15224#[derive(Clone)]
15225pub struct TypeDef {
15226 pub proc: Option<Arc<DaggerSessionProc>>,
15227 pub selection: Selection,
15228 pub graphql_client: DynGraphQLClient,
15229}
15230#[derive(Builder, Debug, PartialEq)]
15231pub struct TypeDefWithEnumOpts<'a> {
15232 #[builder(setter(into, strip_option), default)]
15234 pub description: Option<&'a str>,
15235 #[builder(setter(into, strip_option), default)]
15237 pub source_map: Option<SourceMapId>,
15238}
15239#[derive(Builder, Debug, PartialEq)]
15240pub struct TypeDefWithEnumMemberOpts<'a> {
15241 #[builder(setter(into, strip_option), default)]
15243 pub deprecated: Option<&'a str>,
15244 #[builder(setter(into, strip_option), default)]
15246 pub description: Option<&'a str>,
15247 #[builder(setter(into, strip_option), default)]
15249 pub source_map: Option<SourceMapId>,
15250 #[builder(setter(into, strip_option), default)]
15252 pub value: Option<&'a str>,
15253}
15254#[derive(Builder, Debug, PartialEq)]
15255pub struct TypeDefWithEnumValueOpts<'a> {
15256 #[builder(setter(into, strip_option), default)]
15258 pub deprecated: Option<&'a str>,
15259 #[builder(setter(into, strip_option), default)]
15261 pub description: Option<&'a str>,
15262 #[builder(setter(into, strip_option), default)]
15264 pub source_map: Option<SourceMapId>,
15265}
15266#[derive(Builder, Debug, PartialEq)]
15267pub struct TypeDefWithFieldOpts<'a> {
15268 #[builder(setter(into, strip_option), default)]
15270 pub deprecated: Option<&'a str>,
15271 #[builder(setter(into, strip_option), default)]
15273 pub description: Option<&'a str>,
15274 #[builder(setter(into, strip_option), default)]
15276 pub source_map: Option<SourceMapId>,
15277}
15278#[derive(Builder, Debug, PartialEq)]
15279pub struct TypeDefWithInterfaceOpts<'a> {
15280 #[builder(setter(into, strip_option), default)]
15281 pub description: Option<&'a str>,
15282 #[builder(setter(into, strip_option), default)]
15283 pub source_map: Option<SourceMapId>,
15284}
15285#[derive(Builder, Debug, PartialEq)]
15286pub struct TypeDefWithObjectOpts<'a> {
15287 #[builder(setter(into, strip_option), default)]
15288 pub deprecated: Option<&'a str>,
15289 #[builder(setter(into, strip_option), default)]
15290 pub description: Option<&'a str>,
15291 #[builder(setter(into, strip_option), default)]
15292 pub source_map: Option<SourceMapId>,
15293}
15294#[derive(Builder, Debug, PartialEq)]
15295pub struct TypeDefWithScalarOpts<'a> {
15296 #[builder(setter(into, strip_option), default)]
15297 pub description: Option<&'a str>,
15298}
15299impl TypeDef {
15300 pub fn as_enum(&self) -> EnumTypeDef {
15302 let query = self.selection.select("asEnum");
15303 EnumTypeDef {
15304 proc: self.proc.clone(),
15305 selection: query,
15306 graphql_client: self.graphql_client.clone(),
15307 }
15308 }
15309 pub fn as_input(&self) -> InputTypeDef {
15311 let query = self.selection.select("asInput");
15312 InputTypeDef {
15313 proc: self.proc.clone(),
15314 selection: query,
15315 graphql_client: self.graphql_client.clone(),
15316 }
15317 }
15318 pub fn as_interface(&self) -> InterfaceTypeDef {
15320 let query = self.selection.select("asInterface");
15321 InterfaceTypeDef {
15322 proc: self.proc.clone(),
15323 selection: query,
15324 graphql_client: self.graphql_client.clone(),
15325 }
15326 }
15327 pub fn as_list(&self) -> ListTypeDef {
15329 let query = self.selection.select("asList");
15330 ListTypeDef {
15331 proc: self.proc.clone(),
15332 selection: query,
15333 graphql_client: self.graphql_client.clone(),
15334 }
15335 }
15336 pub fn as_object(&self) -> ObjectTypeDef {
15338 let query = self.selection.select("asObject");
15339 ObjectTypeDef {
15340 proc: self.proc.clone(),
15341 selection: query,
15342 graphql_client: self.graphql_client.clone(),
15343 }
15344 }
15345 pub fn as_scalar(&self) -> ScalarTypeDef {
15347 let query = self.selection.select("asScalar");
15348 ScalarTypeDef {
15349 proc: self.proc.clone(),
15350 selection: query,
15351 graphql_client: self.graphql_client.clone(),
15352 }
15353 }
15354 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
15356 let query = self.selection.select("id");
15357 query.execute(self.graphql_client.clone()).await
15358 }
15359 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15361 let query = self.selection.select("kind");
15362 query.execute(self.graphql_client.clone()).await
15363 }
15364 pub async fn name(&self) -> Result<String, DaggerError> {
15366 let query = self.selection.select("name");
15367 query.execute(self.graphql_client.clone()).await
15368 }
15369 pub async fn optional(&self) -> Result<bool, DaggerError> {
15371 let query = self.selection.select("optional");
15372 query.execute(self.graphql_client.clone()).await
15373 }
15374 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
15376 let mut query = self.selection.select("withConstructor");
15377 query = query.arg_lazy(
15378 "function",
15379 Box::new(move || {
15380 let function = function.clone();
15381 Box::pin(async move { function.into_id().await.unwrap().quote() })
15382 }),
15383 );
15384 TypeDef {
15385 proc: self.proc.clone(),
15386 selection: query,
15387 graphql_client: self.graphql_client.clone(),
15388 }
15389 }
15390 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15398 let mut query = self.selection.select("withEnum");
15399 query = query.arg("name", name.into());
15400 TypeDef {
15401 proc: self.proc.clone(),
15402 selection: query,
15403 graphql_client: self.graphql_client.clone(),
15404 }
15405 }
15406 pub fn with_enum_opts<'a>(
15414 &self,
15415 name: impl Into<String>,
15416 opts: TypeDefWithEnumOpts<'a>,
15417 ) -> TypeDef {
15418 let mut query = self.selection.select("withEnum");
15419 query = query.arg("name", name.into());
15420 if let Some(description) = opts.description {
15421 query = query.arg("description", description);
15422 }
15423 if let Some(source_map) = opts.source_map {
15424 query = query.arg("sourceMap", source_map);
15425 }
15426 TypeDef {
15427 proc: self.proc.clone(),
15428 selection: query,
15429 graphql_client: self.graphql_client.clone(),
15430 }
15431 }
15432 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15439 let mut query = self.selection.select("withEnumMember");
15440 query = query.arg("name", name.into());
15441 TypeDef {
15442 proc: self.proc.clone(),
15443 selection: query,
15444 graphql_client: self.graphql_client.clone(),
15445 }
15446 }
15447 pub fn with_enum_member_opts<'a>(
15454 &self,
15455 name: impl Into<String>,
15456 opts: TypeDefWithEnumMemberOpts<'a>,
15457 ) -> TypeDef {
15458 let mut query = self.selection.select("withEnumMember");
15459 query = query.arg("name", name.into());
15460 if let Some(value) = opts.value {
15461 query = query.arg("value", value);
15462 }
15463 if let Some(description) = opts.description {
15464 query = query.arg("description", description);
15465 }
15466 if let Some(source_map) = opts.source_map {
15467 query = query.arg("sourceMap", source_map);
15468 }
15469 if let Some(deprecated) = opts.deprecated {
15470 query = query.arg("deprecated", deprecated);
15471 }
15472 TypeDef {
15473 proc: self.proc.clone(),
15474 selection: query,
15475 graphql_client: self.graphql_client.clone(),
15476 }
15477 }
15478 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15485 let mut query = self.selection.select("withEnumValue");
15486 query = query.arg("value", value.into());
15487 TypeDef {
15488 proc: self.proc.clone(),
15489 selection: query,
15490 graphql_client: self.graphql_client.clone(),
15491 }
15492 }
15493 pub fn with_enum_value_opts<'a>(
15500 &self,
15501 value: impl Into<String>,
15502 opts: TypeDefWithEnumValueOpts<'a>,
15503 ) -> TypeDef {
15504 let mut query = self.selection.select("withEnumValue");
15505 query = query.arg("value", value.into());
15506 if let Some(description) = opts.description {
15507 query = query.arg("description", description);
15508 }
15509 if let Some(source_map) = opts.source_map {
15510 query = query.arg("sourceMap", source_map);
15511 }
15512 if let Some(deprecated) = opts.deprecated {
15513 query = query.arg("deprecated", deprecated);
15514 }
15515 TypeDef {
15516 proc: self.proc.clone(),
15517 selection: query,
15518 graphql_client: self.graphql_client.clone(),
15519 }
15520 }
15521 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
15529 let mut query = self.selection.select("withField");
15530 query = query.arg("name", name.into());
15531 query = query.arg_lazy(
15532 "typeDef",
15533 Box::new(move || {
15534 let type_def = type_def.clone();
15535 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15536 }),
15537 );
15538 TypeDef {
15539 proc: self.proc.clone(),
15540 selection: query,
15541 graphql_client: self.graphql_client.clone(),
15542 }
15543 }
15544 pub fn with_field_opts<'a>(
15552 &self,
15553 name: impl Into<String>,
15554 type_def: impl IntoID<TypeDefId>,
15555 opts: TypeDefWithFieldOpts<'a>,
15556 ) -> TypeDef {
15557 let mut query = self.selection.select("withField");
15558 query = query.arg("name", name.into());
15559 query = query.arg_lazy(
15560 "typeDef",
15561 Box::new(move || {
15562 let type_def = type_def.clone();
15563 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15564 }),
15565 );
15566 if let Some(description) = opts.description {
15567 query = query.arg("description", description);
15568 }
15569 if let Some(source_map) = opts.source_map {
15570 query = query.arg("sourceMap", source_map);
15571 }
15572 if let Some(deprecated) = opts.deprecated {
15573 query = query.arg("deprecated", deprecated);
15574 }
15575 TypeDef {
15576 proc: self.proc.clone(),
15577 selection: query,
15578 graphql_client: self.graphql_client.clone(),
15579 }
15580 }
15581 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
15583 let mut query = self.selection.select("withFunction");
15584 query = query.arg_lazy(
15585 "function",
15586 Box::new(move || {
15587 let function = function.clone();
15588 Box::pin(async move { function.into_id().await.unwrap().quote() })
15589 }),
15590 );
15591 TypeDef {
15592 proc: self.proc.clone(),
15593 selection: query,
15594 graphql_client: self.graphql_client.clone(),
15595 }
15596 }
15597 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15603 let mut query = self.selection.select("withInterface");
15604 query = query.arg("name", name.into());
15605 TypeDef {
15606 proc: self.proc.clone(),
15607 selection: query,
15608 graphql_client: self.graphql_client.clone(),
15609 }
15610 }
15611 pub fn with_interface_opts<'a>(
15617 &self,
15618 name: impl Into<String>,
15619 opts: TypeDefWithInterfaceOpts<'a>,
15620 ) -> TypeDef {
15621 let mut query = self.selection.select("withInterface");
15622 query = query.arg("name", name.into());
15623 if let Some(description) = opts.description {
15624 query = query.arg("description", description);
15625 }
15626 if let Some(source_map) = opts.source_map {
15627 query = query.arg("sourceMap", source_map);
15628 }
15629 TypeDef {
15630 proc: self.proc.clone(),
15631 selection: query,
15632 graphql_client: self.graphql_client.clone(),
15633 }
15634 }
15635 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15637 let mut query = self.selection.select("withKind");
15638 query = query.arg("kind", kind);
15639 TypeDef {
15640 proc: self.proc.clone(),
15641 selection: query,
15642 graphql_client: self.graphql_client.clone(),
15643 }
15644 }
15645 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
15647 let mut query = self.selection.select("withListOf");
15648 query = query.arg_lazy(
15649 "elementType",
15650 Box::new(move || {
15651 let element_type = element_type.clone();
15652 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15653 }),
15654 );
15655 TypeDef {
15656 proc: self.proc.clone(),
15657 selection: query,
15658 graphql_client: self.graphql_client.clone(),
15659 }
15660 }
15661 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15668 let mut query = self.selection.select("withObject");
15669 query = query.arg("name", name.into());
15670 TypeDef {
15671 proc: self.proc.clone(),
15672 selection: query,
15673 graphql_client: self.graphql_client.clone(),
15674 }
15675 }
15676 pub fn with_object_opts<'a>(
15683 &self,
15684 name: impl Into<String>,
15685 opts: TypeDefWithObjectOpts<'a>,
15686 ) -> TypeDef {
15687 let mut query = self.selection.select("withObject");
15688 query = query.arg("name", name.into());
15689 if let Some(description) = opts.description {
15690 query = query.arg("description", description);
15691 }
15692 if let Some(source_map) = opts.source_map {
15693 query = query.arg("sourceMap", source_map);
15694 }
15695 if let Some(deprecated) = opts.deprecated {
15696 query = query.arg("deprecated", deprecated);
15697 }
15698 TypeDef {
15699 proc: self.proc.clone(),
15700 selection: query,
15701 graphql_client: self.graphql_client.clone(),
15702 }
15703 }
15704 pub fn with_optional(&self, optional: bool) -> TypeDef {
15706 let mut query = self.selection.select("withOptional");
15707 query = query.arg("optional", optional);
15708 TypeDef {
15709 proc: self.proc.clone(),
15710 selection: query,
15711 graphql_client: self.graphql_client.clone(),
15712 }
15713 }
15714 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
15720 let mut query = self.selection.select("withScalar");
15721 query = query.arg("name", name.into());
15722 TypeDef {
15723 proc: self.proc.clone(),
15724 selection: query,
15725 graphql_client: self.graphql_client.clone(),
15726 }
15727 }
15728 pub fn with_scalar_opts<'a>(
15734 &self,
15735 name: impl Into<String>,
15736 opts: TypeDefWithScalarOpts<'a>,
15737 ) -> TypeDef {
15738 let mut query = self.selection.select("withScalar");
15739 query = query.arg("name", name.into());
15740 if let Some(description) = opts.description {
15741 query = query.arg("description", description);
15742 }
15743 TypeDef {
15744 proc: self.proc.clone(),
15745 selection: query,
15746 graphql_client: self.graphql_client.clone(),
15747 }
15748 }
15749}
15750#[derive(Clone)]
15751pub struct Up {
15752 pub proc: Option<Arc<DaggerSessionProc>>,
15753 pub selection: Selection,
15754 pub graphql_client: DynGraphQLClient,
15755}
15756impl Up {
15757 pub async fn description(&self) -> Result<String, DaggerError> {
15759 let query = self.selection.select("description");
15760 query.execute(self.graphql_client.clone()).await
15761 }
15762 pub async fn id(&self) -> Result<UpId, DaggerError> {
15764 let query = self.selection.select("id");
15765 query.execute(self.graphql_client.clone()).await
15766 }
15767 pub async fn name(&self) -> Result<String, DaggerError> {
15769 let query = self.selection.select("name");
15770 query.execute(self.graphql_client.clone()).await
15771 }
15772 pub fn original_module(&self) -> Module {
15774 let query = self.selection.select("originalModule");
15775 Module {
15776 proc: self.proc.clone(),
15777 selection: query,
15778 graphql_client: self.graphql_client.clone(),
15779 }
15780 }
15781 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
15783 let query = self.selection.select("path");
15784 query.execute(self.graphql_client.clone()).await
15785 }
15786 pub fn run(&self) -> Up {
15788 let query = self.selection.select("run");
15789 Up {
15790 proc: self.proc.clone(),
15791 selection: query,
15792 graphql_client: self.graphql_client.clone(),
15793 }
15794 }
15795}
15796#[derive(Clone)]
15797pub struct UpGroup {
15798 pub proc: Option<Arc<DaggerSessionProc>>,
15799 pub selection: Selection,
15800 pub graphql_client: DynGraphQLClient,
15801}
15802impl UpGroup {
15803 pub async fn id(&self) -> Result<UpGroupId, DaggerError> {
15805 let query = self.selection.select("id");
15806 query.execute(self.graphql_client.clone()).await
15807 }
15808 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
15810 let query = self.selection.select("list");
15811 let query = query.select("id");
15812 let ids: Vec<UpId> = query.execute(self.graphql_client.clone()).await?;
15813 let root = Query {
15814 proc: self.proc.clone(),
15815 selection: crate::querybuilder::query(),
15816 graphql_client: self.graphql_client.clone(),
15817 };
15818 Ok(ids.into_iter().map(|id| root.load_up_from_id(id)).collect())
15819 }
15820 pub fn run(&self) -> UpGroup {
15822 let query = self.selection.select("run");
15823 UpGroup {
15824 proc: self.proc.clone(),
15825 selection: query,
15826 graphql_client: self.graphql_client.clone(),
15827 }
15828 }
15829}
15830#[derive(Clone)]
15831pub struct Workspace {
15832 pub proc: Option<Arc<DaggerSessionProc>>,
15833 pub selection: Selection,
15834 pub graphql_client: DynGraphQLClient,
15835}
15836#[derive(Builder, Debug, PartialEq)]
15837pub struct WorkspaceChecksOpts<'a> {
15838 #[builder(setter(into, strip_option), default)]
15840 pub include: Option<Vec<&'a str>>,
15841 #[builder(setter(into, strip_option), default)]
15843 pub no_generate: Option<bool>,
15844}
15845#[derive(Builder, Debug, PartialEq)]
15846pub struct WorkspaceDirectoryOpts<'a> {
15847 #[builder(setter(into, strip_option), default)]
15849 pub exclude: Option<Vec<&'a str>>,
15850 #[builder(setter(into, strip_option), default)]
15852 pub gitignore: Option<bool>,
15853 #[builder(setter(into, strip_option), default)]
15855 pub include: Option<Vec<&'a str>>,
15856}
15857#[derive(Builder, Debug, PartialEq)]
15858pub struct WorkspaceFindUpOpts<'a> {
15859 #[builder(setter(into, strip_option), default)]
15861 pub from: Option<&'a str>,
15862}
15863#[derive(Builder, Debug, PartialEq)]
15864pub struct WorkspaceGeneratorsOpts<'a> {
15865 #[builder(setter(into, strip_option), default)]
15867 pub include: Option<Vec<&'a str>>,
15868}
15869#[derive(Builder, Debug, PartialEq)]
15870pub struct WorkspaceServicesOpts<'a> {
15871 #[builder(setter(into, strip_option), default)]
15873 pub include: Option<Vec<&'a str>>,
15874}
15875impl Workspace {
15876 pub async fn address(&self) -> Result<String, DaggerError> {
15878 let query = self.selection.select("address");
15879 query.execute(self.graphql_client.clone()).await
15880 }
15881 pub fn checks(&self) -> CheckGroup {
15887 let query = self.selection.select("checks");
15888 CheckGroup {
15889 proc: self.proc.clone(),
15890 selection: query,
15891 graphql_client: self.graphql_client.clone(),
15892 }
15893 }
15894 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
15900 let mut query = self.selection.select("checks");
15901 if let Some(include) = opts.include {
15902 query = query.arg("include", include);
15903 }
15904 if let Some(no_generate) = opts.no_generate {
15905 query = query.arg("noGenerate", no_generate);
15906 }
15907 CheckGroup {
15908 proc: self.proc.clone(),
15909 selection: query,
15910 graphql_client: self.graphql_client.clone(),
15911 }
15912 }
15913 pub async fn client_id(&self) -> Result<String, DaggerError> {
15915 let query = self.selection.select("clientId");
15916 query.execute(self.graphql_client.clone()).await
15917 }
15918 pub async fn config_path(&self) -> Result<String, DaggerError> {
15920 let query = self.selection.select("configPath");
15921 query.execute(self.graphql_client.clone()).await
15922 }
15923 pub fn directory(&self, path: impl Into<String>) -> Directory {
15931 let mut query = self.selection.select("directory");
15932 query = query.arg("path", path.into());
15933 Directory {
15934 proc: self.proc.clone(),
15935 selection: query,
15936 graphql_client: self.graphql_client.clone(),
15937 }
15938 }
15939 pub fn directory_opts<'a>(
15947 &self,
15948 path: impl Into<String>,
15949 opts: WorkspaceDirectoryOpts<'a>,
15950 ) -> Directory {
15951 let mut query = self.selection.select("directory");
15952 query = query.arg("path", path.into());
15953 if let Some(exclude) = opts.exclude {
15954 query = query.arg("exclude", exclude);
15955 }
15956 if let Some(include) = opts.include {
15957 query = query.arg("include", include);
15958 }
15959 if let Some(gitignore) = opts.gitignore {
15960 query = query.arg("gitignore", gitignore);
15961 }
15962 Directory {
15963 proc: self.proc.clone(),
15964 selection: query,
15965 graphql_client: self.graphql_client.clone(),
15966 }
15967 }
15968 pub fn file(&self, path: impl Into<String>) -> File {
15975 let mut query = self.selection.select("file");
15976 query = query.arg("path", path.into());
15977 File {
15978 proc: self.proc.clone(),
15979 selection: query,
15980 graphql_client: self.graphql_client.clone(),
15981 }
15982 }
15983 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
15993 let mut query = self.selection.select("findUp");
15994 query = query.arg("name", name.into());
15995 query.execute(self.graphql_client.clone()).await
15996 }
15997 pub async fn find_up_opts<'a>(
16007 &self,
16008 name: impl Into<String>,
16009 opts: WorkspaceFindUpOpts<'a>,
16010 ) -> Result<String, DaggerError> {
16011 let mut query = self.selection.select("findUp");
16012 query = query.arg("name", name.into());
16013 if let Some(from) = opts.from {
16014 query = query.arg("from", from);
16015 }
16016 query.execute(self.graphql_client.clone()).await
16017 }
16018 pub fn generators(&self) -> GeneratorGroup {
16024 let query = self.selection.select("generators");
16025 GeneratorGroup {
16026 proc: self.proc.clone(),
16027 selection: query,
16028 graphql_client: self.graphql_client.clone(),
16029 }
16030 }
16031 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16037 let mut query = self.selection.select("generators");
16038 if let Some(include) = opts.include {
16039 query = query.arg("include", include);
16040 }
16041 GeneratorGroup {
16042 proc: self.proc.clone(),
16043 selection: query,
16044 graphql_client: self.graphql_client.clone(),
16045 }
16046 }
16047 pub async fn has_config(&self) -> Result<bool, DaggerError> {
16049 let query = self.selection.select("hasConfig");
16050 query.execute(self.graphql_client.clone()).await
16051 }
16052 pub async fn id(&self) -> Result<WorkspaceId, DaggerError> {
16054 let query = self.selection.select("id");
16055 query.execute(self.graphql_client.clone()).await
16056 }
16057 pub async fn initialized(&self) -> Result<bool, DaggerError> {
16059 let query = self.selection.select("initialized");
16060 query.execute(self.graphql_client.clone()).await
16061 }
16062 pub async fn path(&self) -> Result<String, DaggerError> {
16064 let query = self.selection.select("path");
16065 query.execute(self.graphql_client.clone()).await
16066 }
16067 pub fn services(&self) -> UpGroup {
16073 let query = self.selection.select("services");
16074 UpGroup {
16075 proc: self.proc.clone(),
16076 selection: query,
16077 graphql_client: self.graphql_client.clone(),
16078 }
16079 }
16080 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16086 let mut query = self.selection.select("services");
16087 if let Some(include) = opts.include {
16088 query = query.arg("include", include);
16089 }
16090 UpGroup {
16091 proc: self.proc.clone(),
16092 selection: query,
16093 graphql_client: self.graphql_client.clone(),
16094 }
16095 }
16096 pub fn update(&self) -> Changeset {
16099 let query = self.selection.select("update");
16100 Changeset {
16101 proc: self.proc.clone(),
16102 selection: query,
16103 graphql_client: self.graphql_client.clone(),
16104 }
16105 }
16106}
16107#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16108pub enum CacheSharingMode {
16109 #[serde(rename = "LOCKED")]
16110 Locked,
16111 #[serde(rename = "PRIVATE")]
16112 Private,
16113 #[serde(rename = "SHARED")]
16114 Shared,
16115}
16116#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16117pub enum ChangesetMergeConflict {
16118 #[serde(rename = "FAIL")]
16119 Fail,
16120 #[serde(rename = "FAIL_EARLY")]
16121 FailEarly,
16122 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16123 LeaveConflictMarkers,
16124 #[serde(rename = "PREFER_OURS")]
16125 PreferOurs,
16126 #[serde(rename = "PREFER_THEIRS")]
16127 PreferTheirs,
16128}
16129#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16130pub enum ChangesetsMergeConflict {
16131 #[serde(rename = "FAIL")]
16132 Fail,
16133 #[serde(rename = "FAIL_EARLY")]
16134 FailEarly,
16135}
16136#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16137pub enum DiffStatKind {
16138 #[serde(rename = "ADDED")]
16139 Added,
16140 #[serde(rename = "MODIFIED")]
16141 Modified,
16142 #[serde(rename = "REMOVED")]
16143 Removed,
16144 #[serde(rename = "RENAMED")]
16145 Renamed,
16146}
16147#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16148pub enum ExistsType {
16149 #[serde(rename = "DIRECTORY_TYPE")]
16150 DirectoryType,
16151 #[serde(rename = "REGULAR_TYPE")]
16152 RegularType,
16153 #[serde(rename = "SYMLINK_TYPE")]
16154 SymlinkType,
16155}
16156#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16157pub enum FileType {
16158 #[serde(rename = "DIRECTORY")]
16159 Directory,
16160 #[serde(rename = "DIRECTORY_TYPE")]
16161 DirectoryType,
16162 #[serde(rename = "REGULAR")]
16163 Regular,
16164 #[serde(rename = "REGULAR_TYPE")]
16165 RegularType,
16166 #[serde(rename = "SYMLINK")]
16167 Symlink,
16168 #[serde(rename = "SYMLINK_TYPE")]
16169 SymlinkType,
16170 #[serde(rename = "UNKNOWN")]
16171 Unknown,
16172}
16173#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16174pub enum FunctionCachePolicy {
16175 #[serde(rename = "Default")]
16176 Default,
16177 #[serde(rename = "Never")]
16178 Never,
16179 #[serde(rename = "PerSession")]
16180 PerSession,
16181}
16182#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16183pub enum ImageLayerCompression {
16184 #[serde(rename = "EStarGZ")]
16185 EStarGz,
16186 #[serde(rename = "ESTARGZ")]
16187 Estargz,
16188 #[serde(rename = "Gzip")]
16189 Gzip,
16190 #[serde(rename = "Uncompressed")]
16191 Uncompressed,
16192 #[serde(rename = "Zstd")]
16193 Zstd,
16194}
16195#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16196pub enum ImageMediaTypes {
16197 #[serde(rename = "DOCKER")]
16198 Docker,
16199 #[serde(rename = "DockerMediaTypes")]
16200 DockerMediaTypes,
16201 #[serde(rename = "OCI")]
16202 Oci,
16203 #[serde(rename = "OCIMediaTypes")]
16204 OciMediaTypes,
16205}
16206#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16207pub enum ModuleSourceExperimentalFeature {
16208 #[serde(rename = "SELF_CALLS")]
16209 SelfCalls,
16210}
16211#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16212pub enum ModuleSourceKind {
16213 #[serde(rename = "DIR")]
16214 Dir,
16215 #[serde(rename = "DIR_SOURCE")]
16216 DirSource,
16217 #[serde(rename = "GIT")]
16218 Git,
16219 #[serde(rename = "GIT_SOURCE")]
16220 GitSource,
16221 #[serde(rename = "LOCAL")]
16222 Local,
16223 #[serde(rename = "LOCAL_SOURCE")]
16224 LocalSource,
16225}
16226#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16227pub enum NetworkProtocol {
16228 #[serde(rename = "TCP")]
16229 Tcp,
16230 #[serde(rename = "UDP")]
16231 Udp,
16232}
16233#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16234pub enum ReturnType {
16235 #[serde(rename = "ANY")]
16236 Any,
16237 #[serde(rename = "FAILURE")]
16238 Failure,
16239 #[serde(rename = "SUCCESS")]
16240 Success,
16241}
16242#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16243pub enum TypeDefKind {
16244 #[serde(rename = "BOOLEAN")]
16245 Boolean,
16246 #[serde(rename = "BOOLEAN_KIND")]
16247 BooleanKind,
16248 #[serde(rename = "ENUM")]
16249 Enum,
16250 #[serde(rename = "ENUM_KIND")]
16251 EnumKind,
16252 #[serde(rename = "FLOAT")]
16253 Float,
16254 #[serde(rename = "FLOAT_KIND")]
16255 FloatKind,
16256 #[serde(rename = "INPUT")]
16257 Input,
16258 #[serde(rename = "INPUT_KIND")]
16259 InputKind,
16260 #[serde(rename = "INTEGER")]
16261 Integer,
16262 #[serde(rename = "INTEGER_KIND")]
16263 IntegerKind,
16264 #[serde(rename = "INTERFACE")]
16265 Interface,
16266 #[serde(rename = "INTERFACE_KIND")]
16267 InterfaceKind,
16268 #[serde(rename = "LIST")]
16269 List,
16270 #[serde(rename = "LIST_KIND")]
16271 ListKind,
16272 #[serde(rename = "OBJECT")]
16273 Object,
16274 #[serde(rename = "OBJECT_KIND")]
16275 ObjectKind,
16276 #[serde(rename = "SCALAR")]
16277 Scalar,
16278 #[serde(rename = "SCALAR_KIND")]
16279 ScalarKind,
16280 #[serde(rename = "STRING")]
16281 String,
16282 #[serde(rename = "STRING_KIND")]
16283 StringKind,
16284 #[serde(rename = "VOID")]
16285 Void,
16286 #[serde(rename = "VOID_KIND")]
16287 VoidKind,
16288}