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::loadable::Loadable;
8use crate::querybuilder::Selection;
9use derive_builder::Builder;
10use serde::{Deserialize, Serialize};
11use std::sync::Arc;
12
13#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
14pub struct Bytes(pub String);
15impl From<&str> for Bytes {
16 fn from(value: &str) -> Self {
17 Self(value.to_string())
18 }
19}
20impl From<String> for Bytes {
21 fn from(value: String) -> Self {
22 Self(value)
23 }
24}
25impl Bytes {
26 fn quote(&self) -> String {
27 format!("\"{}\"", self.0.clone())
28 }
29}
30#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
31pub struct Id(pub String);
32impl From<&str> for Id {
33 fn from(value: &str) -> Self {
34 Self(value.to_string())
35 }
36}
37impl From<String> for Id {
38 fn from(value: String) -> Self {
39 Self(value)
40 }
41}
42impl IntoID<Id> for Id {
43 fn into_id(
44 self,
45 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
46 Box::pin(async move { Ok::<Id, DaggerError>(self) })
47 }
48}
49impl Id {
50 fn quote(&self) -> String {
51 format!("\"{}\"", self.0.clone())
52 }
53}
54#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
55pub struct Json(pub String);
56impl From<&str> for Json {
57 fn from(value: &str) -> Self {
58 Self(value.to_string())
59 }
60}
61impl From<String> for Json {
62 fn from(value: String) -> Self {
63 Self(value)
64 }
65}
66impl Json {
67 fn quote(&self) -> String {
68 format!("\"{}\"", self.0.clone())
69 }
70}
71#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
72pub struct Platform(pub String);
73impl From<&str> for Platform {
74 fn from(value: &str) -> Self {
75 Self(value.to_string())
76 }
77}
78impl From<String> for Platform {
79 fn from(value: String) -> Self {
80 Self(value)
81 }
82}
83impl Platform {
84 fn quote(&self) -> String {
85 format!("\"{}\"", self.0.clone())
86 }
87}
88#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
89pub struct Void(pub String);
90impl From<&str> for Void {
91 fn from(value: &str) -> Self {
92 Self(value.to_string())
93 }
94}
95impl From<String> for Void {
96 fn from(value: String) -> Self {
97 Self(value)
98 }
99}
100impl Void {
101 fn quote(&self) -> String {
102 format!("\"{}\"", self.0.clone())
103 }
104}
105#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
106pub struct BuildArg {
107 pub name: String,
108 pub value: String,
109}
110#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
111pub struct LlmContentBlockInput {
112 pub arguments: Json,
113 pub call_id: String,
114 pub errored: bool,
115 pub kind: LlmContentBlockKind,
116 pub signature: String,
117 pub text: String,
118 pub tool_name: String,
119}
120#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
121pub struct PipelineLabel {
122 pub name: String,
123 pub value: String,
124}
125#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
126pub struct PortForward {
127 pub backend: isize,
128 pub frontend: isize,
129 pub protocol: NetworkProtocol,
130}
131pub trait Exportable {
134 fn export(
135 &self,
136 path: impl Into<String>,
137 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
138 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
139}
140#[derive(Clone)]
141pub struct ExportableClient {
142 pub proc: Option<Arc<DaggerSessionProc>>,
143 pub selection: Selection,
144 pub graphql_client: DynGraphQLClient,
145}
146impl IntoID<Id> for ExportableClient {
147 fn into_id(
148 self,
149 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
150 Box::pin(async move { self.id().await })
151 }
152}
153impl ExportableClient {
154 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
155 let mut query = self.selection.select("export");
156 query = query.arg("path", path.into());
157 query.execute(self.graphql_client.clone()).await
158 }
159 pub async fn id(&self) -> Result<Id, DaggerError> {
160 let query = self.selection.select("id");
161 query.execute(self.graphql_client.clone()).await
162 }
163}
164impl Loadable for ExportableClient {
165 fn graphql_type() -> &'static str {
166 "Exportable"
167 }
168 fn from_query(
169 proc: Option<Arc<DaggerSessionProc>>,
170 selection: Selection,
171 graphql_client: DynGraphQLClient,
172 ) -> Self {
173 Self {
174 proc,
175 selection,
176 graphql_client,
177 }
178 }
179}
180impl Exportable for ExportableClient {
181 fn export(
182 &self,
183 path: impl Into<String>,
184 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
185 let mut query = self.selection.select("export");
186 query = query.arg("path", path.into());
187 let graphql_client = self.graphql_client.clone();
188 async move { query.execute(graphql_client).await }
189 }
190 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
191 let query = self.selection.select("id");
192 let graphql_client = self.graphql_client.clone();
193 async move { query.execute(graphql_client).await }
194 }
195}
196pub trait Node {
198 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
199}
200#[derive(Clone)]
201pub struct NodeClient {
202 pub proc: Option<Arc<DaggerSessionProc>>,
203 pub selection: Selection,
204 pub graphql_client: DynGraphQLClient,
205}
206impl IntoID<Id> for NodeClient {
207 fn into_id(
208 self,
209 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
210 Box::pin(async move { self.id().await })
211 }
212}
213impl NodeClient {
214 pub async fn id(&self) -> Result<Id, DaggerError> {
215 let query = self.selection.select("id");
216 query.execute(self.graphql_client.clone()).await
217 }
218}
219impl Loadable for NodeClient {
220 fn graphql_type() -> &'static str {
221 "Node"
222 }
223 fn from_query(
224 proc: Option<Arc<DaggerSessionProc>>,
225 selection: Selection,
226 graphql_client: DynGraphQLClient,
227 ) -> Self {
228 Self {
229 proc,
230 selection,
231 graphql_client,
232 }
233 }
234}
235impl Node for NodeClient {
236 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
237 let query = self.selection.select("id");
238 let graphql_client = self.graphql_client.clone();
239 async move { query.execute(graphql_client).await }
240 }
241}
242pub trait Syncer {
245 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
246 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
247}
248#[derive(Clone)]
249pub struct SyncerClient {
250 pub proc: Option<Arc<DaggerSessionProc>>,
251 pub selection: Selection,
252 pub graphql_client: DynGraphQLClient,
253}
254impl IntoID<Id> for SyncerClient {
255 fn into_id(
256 self,
257 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
258 Box::pin(async move { self.id().await })
259 }
260}
261impl SyncerClient {
262 pub async fn id(&self) -> Result<Id, DaggerError> {
263 let query = self.selection.select("id");
264 query.execute(self.graphql_client.clone()).await
265 }
266 pub async fn sync(&self) -> Result<Id, DaggerError> {
267 let query = self.selection.select("sync");
268 query.execute(self.graphql_client.clone()).await
269 }
270}
271impl Loadable for SyncerClient {
272 fn graphql_type() -> &'static str {
273 "Syncer"
274 }
275 fn from_query(
276 proc: Option<Arc<DaggerSessionProc>>,
277 selection: Selection,
278 graphql_client: DynGraphQLClient,
279 ) -> Self {
280 Self {
281 proc,
282 selection,
283 graphql_client,
284 }
285 }
286}
287impl Syncer for SyncerClient {
288 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
289 let query = self.selection.select("id");
290 let graphql_client = self.graphql_client.clone();
291 async move { query.execute(graphql_client).await }
292 }
293 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
294 let query = self.selection.select("sync");
295 let graphql_client = self.graphql_client.clone();
296 async move { query.execute(graphql_client).await }
297 }
298}
299#[derive(Clone)]
300pub struct Address {
301 pub proc: Option<Arc<DaggerSessionProc>>,
302 pub selection: Selection,
303 pub graphql_client: DynGraphQLClient,
304}
305#[derive(Builder, Debug, PartialEq)]
306pub struct AddressDirectoryOpts<'a> {
307 #[builder(setter(into, strip_option), default)]
308 pub exclude: Option<Vec<&'a str>>,
309 #[builder(setter(into, strip_option), default)]
310 pub gitignore: Option<bool>,
311 #[builder(setter(into, strip_option), default)]
312 pub include: Option<Vec<&'a str>>,
313 #[builder(setter(into, strip_option), default)]
314 pub no_cache: Option<bool>,
315}
316#[derive(Builder, Debug, PartialEq)]
317pub struct AddressFileOpts<'a> {
318 #[builder(setter(into, strip_option), default)]
319 pub exclude: Option<Vec<&'a str>>,
320 #[builder(setter(into, strip_option), default)]
321 pub gitignore: Option<bool>,
322 #[builder(setter(into, strip_option), default)]
323 pub include: Option<Vec<&'a str>>,
324 #[builder(setter(into, strip_option), default)]
325 pub no_cache: Option<bool>,
326}
327impl IntoID<Id> for Address {
328 fn into_id(
329 self,
330 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
331 Box::pin(async move { self.id().await })
332 }
333}
334impl Loadable for Address {
335 fn graphql_type() -> &'static str {
336 "Address"
337 }
338 fn from_query(
339 proc: Option<Arc<DaggerSessionProc>>,
340 selection: Selection,
341 graphql_client: DynGraphQLClient,
342 ) -> Self {
343 Self {
344 proc,
345 selection,
346 graphql_client,
347 }
348 }
349}
350impl Address {
351 pub fn container(&self) -> Container {
353 let query = self.selection.select("container");
354 Container {
355 proc: self.proc.clone(),
356 selection: query,
357 graphql_client: self.graphql_client.clone(),
358 }
359 }
360 pub fn directory(&self) -> Directory {
366 let query = self.selection.select("directory");
367 Directory {
368 proc: self.proc.clone(),
369 selection: query,
370 graphql_client: self.graphql_client.clone(),
371 }
372 }
373 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
379 let mut query = self.selection.select("directory");
380 if let Some(exclude) = opts.exclude {
381 query = query.arg("exclude", exclude);
382 }
383 if let Some(include) = opts.include {
384 query = query.arg("include", include);
385 }
386 if let Some(gitignore) = opts.gitignore {
387 query = query.arg("gitignore", gitignore);
388 }
389 if let Some(no_cache) = opts.no_cache {
390 query = query.arg("noCache", no_cache);
391 }
392 Directory {
393 proc: self.proc.clone(),
394 selection: query,
395 graphql_client: self.graphql_client.clone(),
396 }
397 }
398 pub fn file(&self) -> File {
404 let query = self.selection.select("file");
405 File {
406 proc: self.proc.clone(),
407 selection: query,
408 graphql_client: self.graphql_client.clone(),
409 }
410 }
411 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
417 let mut query = self.selection.select("file");
418 if let Some(exclude) = opts.exclude {
419 query = query.arg("exclude", exclude);
420 }
421 if let Some(include) = opts.include {
422 query = query.arg("include", include);
423 }
424 if let Some(gitignore) = opts.gitignore {
425 query = query.arg("gitignore", gitignore);
426 }
427 if let Some(no_cache) = opts.no_cache {
428 query = query.arg("noCache", no_cache);
429 }
430 File {
431 proc: self.proc.clone(),
432 selection: query,
433 graphql_client: self.graphql_client.clone(),
434 }
435 }
436 pub fn git_ref(&self) -> GitRef {
438 let query = self.selection.select("gitRef");
439 GitRef {
440 proc: self.proc.clone(),
441 selection: query,
442 graphql_client: self.graphql_client.clone(),
443 }
444 }
445 pub fn git_repository(&self) -> GitRepository {
447 let query = self.selection.select("gitRepository");
448 GitRepository {
449 proc: self.proc.clone(),
450 selection: query,
451 graphql_client: self.graphql_client.clone(),
452 }
453 }
454 pub async fn id(&self) -> Result<Id, DaggerError> {
456 let query = self.selection.select("id");
457 query.execute(self.graphql_client.clone()).await
458 }
459 pub fn secret(&self) -> Secret {
461 let query = self.selection.select("secret");
462 Secret {
463 proc: self.proc.clone(),
464 selection: query,
465 graphql_client: self.graphql_client.clone(),
466 }
467 }
468 pub fn service(&self) -> Service {
470 let query = self.selection.select("service");
471 Service {
472 proc: self.proc.clone(),
473 selection: query,
474 graphql_client: self.graphql_client.clone(),
475 }
476 }
477 pub fn socket(&self) -> Socket {
479 let query = self.selection.select("socket");
480 Socket {
481 proc: self.proc.clone(),
482 selection: query,
483 graphql_client: self.graphql_client.clone(),
484 }
485 }
486 pub async fn value(&self) -> Result<String, DaggerError> {
488 let query = self.selection.select("value");
489 query.execute(self.graphql_client.clone()).await
490 }
491 pub fn volume(&self) -> Volume {
493 let query = self.selection.select("volume");
494 Volume {
495 proc: self.proc.clone(),
496 selection: query,
497 graphql_client: self.graphql_client.clone(),
498 }
499 }
500 pub fn workspace(&self) -> Workspace {
502 let query = self.selection.select("workspace");
503 Workspace {
504 proc: self.proc.clone(),
505 selection: query,
506 graphql_client: self.graphql_client.clone(),
507 }
508 }
509}
510impl Node for Address {
511 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
512 let query = self.selection.select("id");
513 let graphql_client = self.graphql_client.clone();
514 async move { query.execute(graphql_client).await }
515 }
516}
517#[derive(Clone)]
518pub struct Agent {
519 pub proc: Option<Arc<DaggerSessionProc>>,
520 pub selection: Selection,
521 pub graphql_client: DynGraphQLClient,
522}
523impl IntoID<Id> for Agent {
524 fn into_id(
525 self,
526 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
527 Box::pin(async move { self.id().await })
528 }
529}
530impl Loadable for Agent {
531 fn graphql_type() -> &'static str {
532 "Agent"
533 }
534 fn from_query(
535 proc: Option<Arc<DaggerSessionProc>>,
536 selection: Selection,
537 graphql_client: DynGraphQLClient,
538 ) -> Self {
539 Self {
540 proc,
541 selection,
542 graphql_client,
543 }
544 }
545}
546impl Agent {
547 pub async fn description(&self) -> Result<String, DaggerError> {
549 let query = self.selection.select("description");
550 query.execute(self.graphql_client.clone()).await
551 }
552 pub async fn id(&self) -> Result<Id, DaggerError> {
554 let query = self.selection.select("id");
555 query.execute(self.graphql_client.clone()).await
556 }
557 pub async fn name(&self) -> Result<String, DaggerError> {
559 let query = self.selection.select("name");
560 query.execute(self.graphql_client.clone()).await
561 }
562 pub fn original_module(&self) -> Module {
564 let query = self.selection.select("originalModule");
565 Module {
566 proc: self.proc.clone(),
567 selection: query,
568 graphql_client: self.graphql_client.clone(),
569 }
570 }
571 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
573 let query = self.selection.select("path");
574 query.execute(self.graphql_client.clone()).await
575 }
576}
577impl Node for Agent {
578 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
579 let query = self.selection.select("id");
580 let graphql_client = self.graphql_client.clone();
581 async move { query.execute(graphql_client).await }
582 }
583}
584#[derive(Clone)]
585pub struct AgentGroup {
586 pub proc: Option<Arc<DaggerSessionProc>>,
587 pub selection: Selection,
588 pub graphql_client: DynGraphQLClient,
589}
590#[derive(Builder, Debug, PartialEq)]
591pub struct AgentGroupComposeOpts {
592 #[builder(setter(into, strip_option), default)]
594 pub base: Option<Id>,
595}
596impl IntoID<Id> for AgentGroup {
597 fn into_id(
598 self,
599 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
600 Box::pin(async move { self.id().await })
601 }
602}
603impl Loadable for AgentGroup {
604 fn graphql_type() -> &'static str {
605 "AgentGroup"
606 }
607 fn from_query(
608 proc: Option<Arc<DaggerSessionProc>>,
609 selection: Selection,
610 graphql_client: DynGraphQLClient,
611 ) -> Self {
612 Self {
613 proc,
614 selection,
615 graphql_client,
616 }
617 }
618}
619impl AgentGroup {
620 pub fn compose(&self) -> Llm {
626 let query = self.selection.select("compose");
627 Llm {
628 proc: self.proc.clone(),
629 selection: query,
630 graphql_client: self.graphql_client.clone(),
631 }
632 }
633 pub fn compose_opts(&self, opts: AgentGroupComposeOpts) -> Llm {
639 let mut query = self.selection.select("compose");
640 if let Some(base) = opts.base {
641 query = query.arg("base", base);
642 }
643 Llm {
644 proc: self.proc.clone(),
645 selection: query,
646 graphql_client: self.graphql_client.clone(),
647 }
648 }
649 pub async fn id(&self) -> Result<Id, DaggerError> {
651 let query = self.selection.select("id");
652 query.execute(self.graphql_client.clone()).await
653 }
654 pub async fn list(&self) -> Result<Vec<Agent>, DaggerError> {
656 let query = self.selection.select("list");
657 let query = query.select("id");
658 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
659 Ok(ids
660 .into_iter()
661 .map(|id| Agent {
662 proc: self.proc.clone(),
663 selection: crate::querybuilder::query()
664 .select("node")
665 .arg("id", &id.0)
666 .inline_fragment("Agent"),
667 graphql_client: self.graphql_client.clone(),
668 })
669 .collect())
670 }
671}
672impl Node for AgentGroup {
673 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
674 let query = self.selection.select("id");
675 let graphql_client = self.graphql_client.clone();
676 async move { query.execute(graphql_client).await }
677 }
678}
679#[derive(Clone)]
680pub struct CacheVolume {
681 pub proc: Option<Arc<DaggerSessionProc>>,
682 pub selection: Selection,
683 pub graphql_client: DynGraphQLClient,
684}
685impl IntoID<Id> for CacheVolume {
686 fn into_id(
687 self,
688 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
689 Box::pin(async move { self.id().await })
690 }
691}
692impl Loadable for CacheVolume {
693 fn graphql_type() -> &'static str {
694 "CacheVolume"
695 }
696 fn from_query(
697 proc: Option<Arc<DaggerSessionProc>>,
698 selection: Selection,
699 graphql_client: DynGraphQLClient,
700 ) -> Self {
701 Self {
702 proc,
703 selection,
704 graphql_client,
705 }
706 }
707}
708impl CacheVolume {
709 pub async fn id(&self) -> Result<Id, DaggerError> {
711 let query = self.selection.select("id");
712 query.execute(self.graphql_client.clone()).await
713 }
714}
715impl Node for CacheVolume {
716 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
717 let query = self.selection.select("id");
718 let graphql_client = self.graphql_client.clone();
719 async move { query.execute(graphql_client).await }
720 }
721}
722#[derive(Clone)]
723pub struct Changeset {
724 pub proc: Option<Arc<DaggerSessionProc>>,
725 pub selection: Selection,
726 pub graphql_client: DynGraphQLClient,
727}
728#[derive(Builder, Debug, PartialEq)]
729pub struct ChangesetWithChangesetOpts {
730 #[builder(setter(into, strip_option), default)]
732 pub on_conflict: Option<ChangesetMergeConflict>,
733}
734#[derive(Builder, Debug, PartialEq)]
735pub struct ChangesetWithChangesetsOpts {
736 #[builder(setter(into, strip_option), default)]
738 pub on_conflict: Option<ChangesetsMergeConflict>,
739}
740impl IntoID<Id> for Changeset {
741 fn into_id(
742 self,
743 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
744 Box::pin(async move { self.id().await })
745 }
746}
747impl Loadable for Changeset {
748 fn graphql_type() -> &'static str {
749 "Changeset"
750 }
751 fn from_query(
752 proc: Option<Arc<DaggerSessionProc>>,
753 selection: Selection,
754 graphql_client: DynGraphQLClient,
755 ) -> Self {
756 Self {
757 proc,
758 selection,
759 graphql_client,
760 }
761 }
762}
763impl Changeset {
764 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
766 let query = self.selection.select("addedPaths");
767 query.execute(self.graphql_client.clone()).await
768 }
769 pub fn after(&self) -> Directory {
771 let query = self.selection.select("after");
772 Directory {
773 proc: self.proc.clone(),
774 selection: query,
775 graphql_client: self.graphql_client.clone(),
776 }
777 }
778 pub fn as_patch(&self) -> File {
780 let query = self.selection.select("asPatch");
781 File {
782 proc: self.proc.clone(),
783 selection: query,
784 graphql_client: self.graphql_client.clone(),
785 }
786 }
787 pub fn before(&self) -> Directory {
789 let query = self.selection.select("before");
790 Directory {
791 proc: self.proc.clone(),
792 selection: query,
793 graphql_client: self.graphql_client.clone(),
794 }
795 }
796 pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
798 let query = self.selection.select("diffStats");
799 let query = query.select("id");
800 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
801 Ok(ids
802 .into_iter()
803 .map(|id| DiffStat {
804 proc: self.proc.clone(),
805 selection: crate::querybuilder::query()
806 .select("node")
807 .arg("id", &id.0)
808 .inline_fragment("DiffStat"),
809 graphql_client: self.graphql_client.clone(),
810 })
811 .collect())
812 }
813 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
819 let mut query = self.selection.select("export");
820 query = query.arg("path", path.into());
821 query.execute(self.graphql_client.clone()).await
822 }
823 pub async fn id(&self) -> Result<Id, DaggerError> {
825 let query = self.selection.select("id");
826 query.execute(self.graphql_client.clone()).await
827 }
828 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
830 let query = self.selection.select("isEmpty");
831 query.execute(self.graphql_client.clone()).await
832 }
833 pub fn layer(&self) -> Directory {
835 let query = self.selection.select("layer");
836 Directory {
837 proc: self.proc.clone(),
838 selection: query,
839 graphql_client: self.graphql_client.clone(),
840 }
841 }
842 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
844 let query = self.selection.select("modifiedPaths");
845 query.execute(self.graphql_client.clone()).await
846 }
847 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
849 let query = self.selection.select("removedPaths");
850 query.execute(self.graphql_client.clone()).await
851 }
852 pub async fn sync(&self) -> Result<Changeset, DaggerError> {
854 let query = self.selection.select("sync");
855 let id: Id = query.execute(self.graphql_client.clone()).await?;
856 Ok(Changeset {
857 proc: self.proc.clone(),
858 selection: query
859 .root()
860 .select("node")
861 .arg("id", &id.0)
862 .inline_fragment("Changeset"),
863 graphql_client: self.graphql_client.clone(),
864 })
865 }
866 pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
874 let mut query = self.selection.select("withChangeset");
875 query = query.arg_lazy(
876 "changes",
877 Box::new(move || {
878 let changes = changes.clone();
879 Box::pin(async move { changes.into_id().await.unwrap().quote() })
880 }),
881 );
882 Changeset {
883 proc: self.proc.clone(),
884 selection: query,
885 graphql_client: self.graphql_client.clone(),
886 }
887 }
888 pub fn with_changeset_opts(
896 &self,
897 changes: impl IntoID<Id>,
898 opts: ChangesetWithChangesetOpts,
899 ) -> Changeset {
900 let mut query = self.selection.select("withChangeset");
901 query = query.arg_lazy(
902 "changes",
903 Box::new(move || {
904 let changes = changes.clone();
905 Box::pin(async move { changes.into_id().await.unwrap().quote() })
906 }),
907 );
908 if let Some(on_conflict) = opts.on_conflict {
909 query = query.arg("onConflict", on_conflict);
910 }
911 Changeset {
912 proc: self.proc.clone(),
913 selection: query,
914 graphql_client: self.graphql_client.clone(),
915 }
916 }
917 pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
926 let mut query = self.selection.select("withChangesets");
927 query = query.arg("changes", changes);
928 Changeset {
929 proc: self.proc.clone(),
930 selection: query,
931 graphql_client: self.graphql_client.clone(),
932 }
933 }
934 pub fn with_changesets_opts(
943 &self,
944 changes: Vec<Id>,
945 opts: ChangesetWithChangesetsOpts,
946 ) -> Changeset {
947 let mut query = self.selection.select("withChangesets");
948 query = query.arg("changes", changes);
949 if let Some(on_conflict) = opts.on_conflict {
950 query = query.arg("onConflict", on_conflict);
951 }
952 Changeset {
953 proc: self.proc.clone(),
954 selection: query,
955 graphql_client: self.graphql_client.clone(),
956 }
957 }
958}
959impl Exportable for Changeset {
960 fn export(
961 &self,
962 path: impl Into<String>,
963 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
964 let mut query = self.selection.select("export");
965 query = query.arg("path", path.into());
966 let graphql_client = self.graphql_client.clone();
967 async move { query.execute(graphql_client).await }
968 }
969 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
970 let query = self.selection.select("id");
971 let graphql_client = self.graphql_client.clone();
972 async move { query.execute(graphql_client).await }
973 }
974}
975impl Node for Changeset {
976 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
977 let query = self.selection.select("id");
978 let graphql_client = self.graphql_client.clone();
979 async move { query.execute(graphql_client).await }
980 }
981}
982impl Syncer for Changeset {
983 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
984 let query = self.selection.select("id");
985 let graphql_client = self.graphql_client.clone();
986 async move { query.execute(graphql_client).await }
987 }
988 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
989 let query = self.selection.select("sync");
990 let graphql_client = self.graphql_client.clone();
991 async move { query.execute(graphql_client).await }
992 }
993}
994#[derive(Clone)]
995pub struct Check {
996 pub proc: Option<Arc<DaggerSessionProc>>,
997 pub selection: Selection,
998 pub graphql_client: DynGraphQLClient,
999}
1000impl IntoID<Id> for Check {
1001 fn into_id(
1002 self,
1003 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1004 Box::pin(async move { self.id().await })
1005 }
1006}
1007impl Loadable for Check {
1008 fn graphql_type() -> &'static str {
1009 "Check"
1010 }
1011 fn from_query(
1012 proc: Option<Arc<DaggerSessionProc>>,
1013 selection: Selection,
1014 graphql_client: DynGraphQLClient,
1015 ) -> Self {
1016 Self {
1017 proc,
1018 selection,
1019 graphql_client,
1020 }
1021 }
1022}
1023impl Check {
1024 pub async fn check_type(&self) -> Result<String, DaggerError> {
1026 let query = self.selection.select("checkType");
1027 query.execute(self.graphql_client.clone()).await
1028 }
1029 pub async fn completed(&self) -> Result<bool, DaggerError> {
1031 let query = self.selection.select("completed");
1032 query.execute(self.graphql_client.clone()).await
1033 }
1034 pub async fn description(&self) -> Result<String, DaggerError> {
1036 let query = self.selection.select("description");
1037 query.execute(self.graphql_client.clone()).await
1038 }
1039 pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1041 let query = self.selection.select("error");
1042 let query = query.select("id");
1043 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1044 Ok(id.map(|id| Error {
1045 proc: self.proc.clone(),
1046 selection: query
1047 .root()
1048 .select("node")
1049 .arg("id", &id.0)
1050 .inline_fragment("Error"),
1051 graphql_client: self.graphql_client.clone(),
1052 }))
1053 }
1054 pub async fn id(&self) -> Result<Id, DaggerError> {
1056 let query = self.selection.select("id");
1057 query.execute(self.graphql_client.clone()).await
1058 }
1059 pub async fn name(&self) -> Result<String, DaggerError> {
1061 let query = self.selection.select("name");
1062 query.execute(self.graphql_client.clone()).await
1063 }
1064 pub fn original_module(&self) -> Module {
1066 let query = self.selection.select("originalModule");
1067 Module {
1068 proc: self.proc.clone(),
1069 selection: query,
1070 graphql_client: self.graphql_client.clone(),
1071 }
1072 }
1073 pub async fn passed(&self) -> Result<bool, DaggerError> {
1075 let query = self.selection.select("passed");
1076 query.execute(self.graphql_client.clone()).await
1077 }
1078 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1080 let query = self.selection.select("path");
1081 query.execute(self.graphql_client.clone()).await
1082 }
1083 pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1085 let query = self.selection.select("resultEmoji");
1086 query.execute(self.graphql_client.clone()).await
1087 }
1088 pub fn run(&self) -> Check {
1090 let query = self.selection.select("run");
1091 Check {
1092 proc: self.proc.clone(),
1093 selection: query,
1094 graphql_client: self.graphql_client.clone(),
1095 }
1096 }
1097}
1098impl Node for Check {
1099 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1100 let query = self.selection.select("id");
1101 let graphql_client = self.graphql_client.clone();
1102 async move { query.execute(graphql_client).await }
1103 }
1104}
1105#[derive(Clone)]
1106pub struct CheckGroup {
1107 pub proc: Option<Arc<DaggerSessionProc>>,
1108 pub selection: Selection,
1109 pub graphql_client: DynGraphQLClient,
1110}
1111#[derive(Builder, Debug, PartialEq)]
1112pub struct CheckGroupRunOpts {
1113 #[builder(setter(into, strip_option), default)]
1115 pub fail_fast: Option<bool>,
1116}
1117impl IntoID<Id> for CheckGroup {
1118 fn into_id(
1119 self,
1120 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1121 Box::pin(async move { self.id().await })
1122 }
1123}
1124impl Loadable for CheckGroup {
1125 fn graphql_type() -> &'static str {
1126 "CheckGroup"
1127 }
1128 fn from_query(
1129 proc: Option<Arc<DaggerSessionProc>>,
1130 selection: Selection,
1131 graphql_client: DynGraphQLClient,
1132 ) -> Self {
1133 Self {
1134 proc,
1135 selection,
1136 graphql_client,
1137 }
1138 }
1139}
1140impl CheckGroup {
1141 pub async fn id(&self) -> Result<Id, DaggerError> {
1143 let query = self.selection.select("id");
1144 query.execute(self.graphql_client.clone()).await
1145 }
1146 pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1148 let query = self.selection.select("list");
1149 let query = query.select("id");
1150 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1151 Ok(ids
1152 .into_iter()
1153 .map(|id| Check {
1154 proc: self.proc.clone(),
1155 selection: crate::querybuilder::query()
1156 .select("node")
1157 .arg("id", &id.0)
1158 .inline_fragment("Check"),
1159 graphql_client: self.graphql_client.clone(),
1160 })
1161 .collect())
1162 }
1163 pub fn report(&self) -> File {
1165 let query = self.selection.select("report");
1166 File {
1167 proc: self.proc.clone(),
1168 selection: query,
1169 graphql_client: self.graphql_client.clone(),
1170 }
1171 }
1172 pub fn run(&self) -> CheckGroup {
1178 let query = self.selection.select("run");
1179 CheckGroup {
1180 proc: self.proc.clone(),
1181 selection: query,
1182 graphql_client: self.graphql_client.clone(),
1183 }
1184 }
1185 pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1191 let mut query = self.selection.select("run");
1192 if let Some(fail_fast) = opts.fail_fast {
1193 query = query.arg("failFast", fail_fast);
1194 }
1195 CheckGroup {
1196 proc: self.proc.clone(),
1197 selection: query,
1198 graphql_client: self.graphql_client.clone(),
1199 }
1200 }
1201}
1202impl Node for CheckGroup {
1203 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1204 let query = self.selection.select("id");
1205 let graphql_client = self.graphql_client.clone();
1206 async move { query.execute(graphql_client).await }
1207 }
1208}
1209#[derive(Clone)]
1210pub struct ClientFilesyncMirror {
1211 pub proc: Option<Arc<DaggerSessionProc>>,
1212 pub selection: Selection,
1213 pub graphql_client: DynGraphQLClient,
1214}
1215impl IntoID<Id> for ClientFilesyncMirror {
1216 fn into_id(
1217 self,
1218 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1219 Box::pin(async move { self.id().await })
1220 }
1221}
1222impl Loadable for ClientFilesyncMirror {
1223 fn graphql_type() -> &'static str {
1224 "ClientFilesyncMirror"
1225 }
1226 fn from_query(
1227 proc: Option<Arc<DaggerSessionProc>>,
1228 selection: Selection,
1229 graphql_client: DynGraphQLClient,
1230 ) -> Self {
1231 Self {
1232 proc,
1233 selection,
1234 graphql_client,
1235 }
1236 }
1237}
1238impl ClientFilesyncMirror {
1239 pub async fn id(&self) -> Result<Id, DaggerError> {
1241 let query = self.selection.select("id");
1242 query.execute(self.graphql_client.clone()).await
1243 }
1244}
1245impl Node for ClientFilesyncMirror {
1246 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1247 let query = self.selection.select("id");
1248 let graphql_client = self.graphql_client.clone();
1249 async move { query.execute(graphql_client).await }
1250 }
1251}
1252#[derive(Clone)]
1253pub struct Cloud {
1254 pub proc: Option<Arc<DaggerSessionProc>>,
1255 pub selection: Selection,
1256 pub graphql_client: DynGraphQLClient,
1257}
1258impl IntoID<Id> for Cloud {
1259 fn into_id(
1260 self,
1261 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1262 Box::pin(async move { self.id().await })
1263 }
1264}
1265impl Loadable for Cloud {
1266 fn graphql_type() -> &'static str {
1267 "Cloud"
1268 }
1269 fn from_query(
1270 proc: Option<Arc<DaggerSessionProc>>,
1271 selection: Selection,
1272 graphql_client: DynGraphQLClient,
1273 ) -> Self {
1274 Self {
1275 proc,
1276 selection,
1277 graphql_client,
1278 }
1279 }
1280}
1281impl Cloud {
1282 pub async fn id(&self) -> Result<Id, DaggerError> {
1284 let query = self.selection.select("id");
1285 query.execute(self.graphql_client.clone()).await
1286 }
1287 pub async fn trace_url(&self) -> Result<String, DaggerError> {
1289 let query = self.selection.select("traceURL");
1290 query.execute(self.graphql_client.clone()).await
1291 }
1292}
1293impl Node for Cloud {
1294 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1295 let query = self.selection.select("id");
1296 let graphql_client = self.graphql_client.clone();
1297 async move { query.execute(graphql_client).await }
1298 }
1299}
1300#[derive(Clone)]
1301pub struct Container {
1302 pub proc: Option<Arc<DaggerSessionProc>>,
1303 pub selection: Selection,
1304 pub graphql_client: DynGraphQLClient,
1305}
1306#[derive(Builder, Debug, PartialEq)]
1307pub struct ContainerAsServiceOpts<'a> {
1308 #[builder(setter(into, strip_option), default)]
1311 pub args: Option<Vec<&'a str>>,
1312 #[builder(setter(into, strip_option), default)]
1314 pub expand: Option<bool>,
1315 #[builder(setter(into, strip_option), default)]
1317 pub experimental_privileged_nesting: Option<bool>,
1318 #[builder(setter(into, strip_option), default)]
1320 pub insecure_root_capabilities: Option<bool>,
1321 #[builder(setter(into, strip_option), default)]
1324 pub no_init: Option<bool>,
1325 #[builder(setter(into, strip_option), default)]
1327 pub use_entrypoint: Option<bool>,
1328}
1329#[derive(Builder, Debug, PartialEq)]
1330pub struct ContainerAsTarballOpts {
1331 #[builder(setter(into, strip_option), default)]
1334 pub forced_compression: Option<ImageLayerCompression>,
1335 #[builder(setter(into, strip_option), default)]
1338 pub media_types: Option<ImageMediaTypes>,
1339 #[builder(setter(into, strip_option), default)]
1342 pub platform_variants: Option<Vec<Id>>,
1343}
1344#[derive(Builder, Debug, PartialEq)]
1345pub struct ContainerDirectoryOpts {
1346 #[builder(setter(into, strip_option), default)]
1348 pub expand: Option<bool>,
1349}
1350#[derive(Builder, Debug, PartialEq)]
1351pub struct ContainerExistsOpts {
1352 #[builder(setter(into, strip_option), default)]
1354 pub do_not_follow_symlinks: Option<bool>,
1355 #[builder(setter(into, strip_option), default)]
1357 pub expand: Option<bool>,
1358 #[builder(setter(into, strip_option), default)]
1360 pub expected_type: Option<ExistsType>,
1361}
1362#[derive(Builder, Debug, PartialEq)]
1363pub struct ContainerExportOpts {
1364 #[builder(setter(into, strip_option), default)]
1366 pub expand: Option<bool>,
1367 #[builder(setter(into, strip_option), default)]
1370 pub forced_compression: Option<ImageLayerCompression>,
1371 #[builder(setter(into, strip_option), default)]
1374 pub media_types: Option<ImageMediaTypes>,
1375 #[builder(setter(into, strip_option), default)]
1378 pub platform_variants: Option<Vec<Id>>,
1379}
1380#[derive(Builder, Debug, PartialEq)]
1381pub struct ContainerExportImageOpts {
1382 #[builder(setter(into, strip_option), default)]
1385 pub forced_compression: Option<ImageLayerCompression>,
1386 #[builder(setter(into, strip_option), default)]
1389 pub media_types: Option<ImageMediaTypes>,
1390 #[builder(setter(into, strip_option), default)]
1393 pub platform_variants: Option<Vec<Id>>,
1394}
1395#[derive(Builder, Debug, PartialEq)]
1396pub struct ContainerFileOpts {
1397 #[builder(setter(into, strip_option), default)]
1399 pub expand: Option<bool>,
1400}
1401#[derive(Builder, Debug, PartialEq)]
1402pub struct ContainerFromOpts<'a> {
1403 #[builder(setter(into, strip_option), default)]
1405 pub insecure_skip_tls_verify: Option<bool>,
1406 #[builder(setter(into, strip_option), default)]
1409 pub protocol: Option<RegistryProtocol>,
1410 #[builder(setter(into, strip_option), default)]
1413 pub registry_service: Option<Id>,
1414 #[builder(setter(into, strip_option), default)]
1416 pub version: Option<&'a str>,
1417}
1418#[derive(Builder, Debug, PartialEq)]
1419pub struct ContainerImportOpts<'a> {
1420 #[builder(setter(into, strip_option), default)]
1422 pub tag: Option<&'a str>,
1423}
1424#[derive(Builder, Debug, PartialEq)]
1425pub struct ContainerLayerOpts {
1426 #[builder(setter(into, strip_option), default)]
1429 pub forced_compression: Option<ImageLayerCompression>,
1430 #[builder(setter(into, strip_option), default)]
1432 pub media_types: Option<ImageMediaTypes>,
1433}
1434#[derive(Builder, Debug, PartialEq)]
1435pub struct ContainerManifestOpts {
1436 #[builder(setter(into, strip_option), default)]
1439 pub forced_compression: Option<ImageLayerCompression>,
1440 #[builder(setter(into, strip_option), default)]
1442 pub media_types: Option<ImageMediaTypes>,
1443}
1444#[derive(Builder, Debug, PartialEq)]
1445pub struct ContainerPublishOpts {
1446 #[builder(setter(into, strip_option), default)]
1449 pub forced_compression: Option<ImageLayerCompression>,
1450 #[builder(setter(into, strip_option), default)]
1452 pub insecure_skip_tls_verify: Option<bool>,
1453 #[builder(setter(into, strip_option), default)]
1456 pub media_types: Option<ImageMediaTypes>,
1457 #[builder(setter(into, strip_option), default)]
1460 pub platform_variants: Option<Vec<Id>>,
1461 #[builder(setter(into, strip_option), default)]
1464 pub protocol: Option<RegistryProtocol>,
1465 #[builder(setter(into, strip_option), default)]
1468 pub registry_service: Option<Id>,
1469}
1470#[derive(Builder, Debug, PartialEq)]
1471pub struct ContainerStatOpts {
1472 #[builder(setter(into, strip_option), default)]
1474 pub do_not_follow_symlinks: Option<bool>,
1475}
1476#[derive(Builder, Debug, PartialEq)]
1477pub struct ContainerTerminalOpts<'a> {
1478 #[builder(setter(into, strip_option), default)]
1480 pub cmd: Option<Vec<&'a str>>,
1481 #[builder(setter(into, strip_option), default)]
1483 pub experimental_privileged_nesting: Option<bool>,
1484 #[builder(setter(into, strip_option), default)]
1486 pub insecure_root_capabilities: Option<bool>,
1487}
1488#[derive(Builder, Debug, PartialEq)]
1489pub struct ContainerUpOpts<'a> {
1490 #[builder(setter(into, strip_option), default)]
1493 pub args: Option<Vec<&'a str>>,
1494 #[builder(setter(into, strip_option), default)]
1496 pub expand: Option<bool>,
1497 #[builder(setter(into, strip_option), default)]
1499 pub experimental_privileged_nesting: Option<bool>,
1500 #[builder(setter(into, strip_option), default)]
1502 pub insecure_root_capabilities: Option<bool>,
1503 #[builder(setter(into, strip_option), default)]
1506 pub no_init: Option<bool>,
1507 #[builder(setter(into, strip_option), default)]
1510 pub ports: Option<Vec<PortForward>>,
1511 #[builder(setter(into, strip_option), default)]
1513 pub random: Option<bool>,
1514 #[builder(setter(into, strip_option), default)]
1516 pub use_entrypoint: Option<bool>,
1517}
1518#[derive(Builder, Debug, PartialEq)]
1519pub struct ContainerWithDefaultTerminalCmdOpts {
1520 #[builder(setter(into, strip_option), default)]
1522 pub experimental_privileged_nesting: Option<bool>,
1523 #[builder(setter(into, strip_option), default)]
1525 pub insecure_root_capabilities: Option<bool>,
1526}
1527#[derive(Builder, Debug, PartialEq)]
1528pub struct ContainerWithDirectoryOpts<'a> {
1529 #[builder(setter(into, strip_option), default)]
1531 pub exclude: Option<Vec<&'a str>>,
1532 #[builder(setter(into, strip_option), default)]
1534 pub expand: Option<bool>,
1535 #[builder(setter(into, strip_option), default)]
1537 pub gitignore: Option<bool>,
1538 #[builder(setter(into, strip_option), default)]
1540 pub include: Option<Vec<&'a str>>,
1541 #[builder(setter(into, strip_option), default)]
1543 pub inherit_owner: Option<bool>,
1544 #[builder(setter(into, strip_option), default)]
1548 pub owner: Option<&'a str>,
1549 #[builder(setter(into, strip_option), default)]
1550 pub permissions: Option<isize>,
1551}
1552#[derive(Builder, Debug, PartialEq)]
1553pub struct ContainerWithDockerHealthcheckOpts<'a> {
1554 #[builder(setter(into, strip_option), default)]
1556 pub interval: Option<&'a str>,
1557 #[builder(setter(into, strip_option), default)]
1559 pub retries: Option<isize>,
1560 #[builder(setter(into, strip_option), default)]
1562 pub shell: Option<bool>,
1563 #[builder(setter(into, strip_option), default)]
1565 pub start_interval: Option<&'a str>,
1566 #[builder(setter(into, strip_option), default)]
1568 pub start_period: Option<&'a str>,
1569 #[builder(setter(into, strip_option), default)]
1571 pub timeout: Option<&'a str>,
1572}
1573#[derive(Builder, Debug, PartialEq)]
1574pub struct ContainerWithEntrypointOpts {
1575 #[builder(setter(into, strip_option), default)]
1577 pub keep_default_args: Option<bool>,
1578}
1579#[derive(Builder, Debug, PartialEq)]
1580pub struct ContainerWithEnvVariableOpts {
1581 #[builder(setter(into, strip_option), default)]
1583 pub expand: Option<bool>,
1584}
1585#[derive(Builder, Debug, PartialEq)]
1586pub struct ContainerWithExecOpts<'a> {
1587 #[builder(setter(into, strip_option), default)]
1589 pub expand: Option<bool>,
1590 #[builder(setter(into, strip_option), default)]
1592 pub expect: Option<ReturnType>,
1593 #[builder(setter(into, strip_option), default)]
1595 pub experimental_privileged_nesting: Option<bool>,
1596 #[builder(setter(into, strip_option), default)]
1599 pub insecure_root_capabilities: Option<bool>,
1600 #[builder(setter(into, strip_option), default)]
1603 pub no_init: Option<bool>,
1604 #[builder(setter(into, strip_option), default)]
1606 pub redirect_stderr: Option<&'a str>,
1607 #[builder(setter(into, strip_option), default)]
1609 pub redirect_stdin: Option<&'a str>,
1610 #[builder(setter(into, strip_option), default)]
1612 pub redirect_stdout: Option<&'a str>,
1613 #[builder(setter(into, strip_option), default)]
1615 pub stdin: Option<&'a str>,
1616 #[builder(setter(into, strip_option), default)]
1618 pub use_entrypoint: Option<bool>,
1619}
1620#[derive(Builder, Debug, PartialEq)]
1621pub struct ContainerWithExposedPortOpts<'a> {
1622 #[builder(setter(into, strip_option), default)]
1624 pub description: Option<&'a str>,
1625 #[builder(setter(into, strip_option), default)]
1627 pub experimental_skip_healthcheck: Option<bool>,
1628 #[builder(setter(into, strip_option), default)]
1630 pub protocol: Option<NetworkProtocol>,
1631}
1632#[derive(Builder, Debug, PartialEq)]
1633pub struct ContainerWithFileOpts<'a> {
1634 #[builder(setter(into, strip_option), default)]
1636 pub expand: Option<bool>,
1637 #[builder(setter(into, strip_option), default)]
1639 pub inherit_owner: Option<bool>,
1640 #[builder(setter(into, strip_option), default)]
1644 pub owner: Option<&'a str>,
1645 #[builder(setter(into, strip_option), default)]
1647 pub permissions: Option<isize>,
1648}
1649#[derive(Builder, Debug, PartialEq)]
1650pub struct ContainerWithFilesOpts<'a> {
1651 #[builder(setter(into, strip_option), default)]
1653 pub expand: Option<bool>,
1654 #[builder(setter(into, strip_option), default)]
1656 pub inherit_owner: Option<bool>,
1657 #[builder(setter(into, strip_option), default)]
1661 pub owner: Option<&'a str>,
1662 #[builder(setter(into, strip_option), default)]
1664 pub permissions: Option<isize>,
1665}
1666#[derive(Builder, Debug, PartialEq)]
1667pub struct ContainerWithMountedCacheOpts<'a> {
1668 #[builder(setter(into, strip_option), default)]
1670 pub expand: Option<bool>,
1671 #[builder(setter(into, strip_option), default)]
1673 pub inherit_owner: Option<bool>,
1674 #[builder(setter(into, strip_option), default)]
1679 pub owner: Option<&'a str>,
1680 #[builder(setter(into, strip_option), default)]
1682 pub sharing: Option<CacheSharingMode>,
1683 #[builder(setter(into, strip_option), default)]
1685 pub source: Option<Id>,
1686}
1687#[derive(Builder, Debug, PartialEq)]
1688pub struct ContainerWithMountedDirectoryOpts<'a> {
1689 #[builder(setter(into, strip_option), default)]
1691 pub expand: Option<bool>,
1692 #[builder(setter(into, strip_option), default)]
1694 pub inherit_owner: Option<bool>,
1695 #[builder(setter(into, strip_option), default)]
1699 pub owner: Option<&'a str>,
1700 #[builder(setter(into, strip_option), default)]
1702 pub read_only: Option<bool>,
1703}
1704#[derive(Builder, Debug, PartialEq)]
1705pub struct ContainerWithMountedFileOpts<'a> {
1706 #[builder(setter(into, strip_option), default)]
1708 pub expand: Option<bool>,
1709 #[builder(setter(into, strip_option), default)]
1711 pub inherit_owner: Option<bool>,
1712 #[builder(setter(into, strip_option), default)]
1716 pub owner: Option<&'a str>,
1717}
1718#[derive(Builder, Debug, PartialEq)]
1719pub struct ContainerWithMountedSecretOpts<'a> {
1720 #[builder(setter(into, strip_option), default)]
1722 pub expand: Option<bool>,
1723 #[builder(setter(into, strip_option), default)]
1725 pub inherit_owner: Option<bool>,
1726 #[builder(setter(into, strip_option), default)]
1729 pub mode: Option<isize>,
1730 #[builder(setter(into, strip_option), default)]
1734 pub owner: Option<&'a str>,
1735}
1736#[derive(Builder, Debug, PartialEq)]
1737pub struct ContainerWithMountedTempOpts {
1738 #[builder(setter(into, strip_option), default)]
1740 pub expand: Option<bool>,
1741 #[builder(setter(into, strip_option), default)]
1743 pub size: Option<isize>,
1744}
1745#[derive(Builder, Debug, PartialEq)]
1746pub struct ContainerWithMountedVolumeOpts {
1747 #[builder(setter(into, strip_option), default)]
1749 pub expand: Option<bool>,
1750 #[builder(setter(into, strip_option), default)]
1752 pub read_only: Option<bool>,
1753}
1754#[derive(Builder, Debug, PartialEq)]
1755pub struct ContainerWithNewFileOpts<'a> {
1756 #[builder(setter(into, strip_option), default)]
1758 pub expand: Option<bool>,
1759 #[builder(setter(into, strip_option), default)]
1761 pub inherit_owner: Option<bool>,
1762 #[builder(setter(into, strip_option), default)]
1766 pub owner: Option<&'a str>,
1767 #[builder(setter(into, strip_option), default)]
1769 pub permissions: Option<isize>,
1770}
1771#[derive(Builder, Debug, PartialEq)]
1772pub struct ContainerWithSymlinkOpts {
1773 #[builder(setter(into, strip_option), default)]
1775 pub expand: Option<bool>,
1776}
1777#[derive(Builder, Debug, PartialEq)]
1778pub struct ContainerWithUnixSocketOpts<'a> {
1779 #[builder(setter(into, strip_option), default)]
1781 pub expand: Option<bool>,
1782 #[builder(setter(into, strip_option), default)]
1784 pub inherit_owner: Option<bool>,
1785 #[builder(setter(into, strip_option), default)]
1789 pub owner: Option<&'a str>,
1790}
1791#[derive(Builder, Debug, PartialEq)]
1792pub struct ContainerWithWorkdirOpts {
1793 #[builder(setter(into, strip_option), default)]
1795 pub expand: Option<bool>,
1796}
1797#[derive(Builder, Debug, PartialEq)]
1798pub struct ContainerWithoutDirectoryOpts {
1799 #[builder(setter(into, strip_option), default)]
1801 pub expand: Option<bool>,
1802}
1803#[derive(Builder, Debug, PartialEq)]
1804pub struct ContainerWithoutEntrypointOpts {
1805 #[builder(setter(into, strip_option), default)]
1807 pub keep_default_args: Option<bool>,
1808}
1809#[derive(Builder, Debug, PartialEq)]
1810pub struct ContainerWithoutExposedPortOpts {
1811 #[builder(setter(into, strip_option), default)]
1813 pub protocol: Option<NetworkProtocol>,
1814}
1815#[derive(Builder, Debug, PartialEq)]
1816pub struct ContainerWithoutFileOpts {
1817 #[builder(setter(into, strip_option), default)]
1819 pub expand: Option<bool>,
1820}
1821#[derive(Builder, Debug, PartialEq)]
1822pub struct ContainerWithoutFilesOpts {
1823 #[builder(setter(into, strip_option), default)]
1825 pub expand: Option<bool>,
1826}
1827#[derive(Builder, Debug, PartialEq)]
1828pub struct ContainerWithoutMountOpts {
1829 #[builder(setter(into, strip_option), default)]
1831 pub expand: Option<bool>,
1832}
1833#[derive(Builder, Debug, PartialEq)]
1834pub struct ContainerWithoutUnixSocketOpts {
1835 #[builder(setter(into, strip_option), default)]
1837 pub expand: Option<bool>,
1838}
1839impl IntoID<Id> for Container {
1840 fn into_id(
1841 self,
1842 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1843 Box::pin(async move { self.id().await })
1844 }
1845}
1846impl Loadable for Container {
1847 fn graphql_type() -> &'static str {
1848 "Container"
1849 }
1850 fn from_query(
1851 proc: Option<Arc<DaggerSessionProc>>,
1852 selection: Selection,
1853 graphql_client: DynGraphQLClient,
1854 ) -> Self {
1855 Self {
1856 proc,
1857 selection,
1858 graphql_client,
1859 }
1860 }
1861}
1862impl Container {
1863 pub fn as_service(&self) -> Service {
1870 let query = self.selection.select("asService");
1871 Service {
1872 proc: self.proc.clone(),
1873 selection: query,
1874 graphql_client: self.graphql_client.clone(),
1875 }
1876 }
1877 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1884 let mut query = self.selection.select("asService");
1885 if let Some(args) = opts.args {
1886 query = query.arg("args", args);
1887 }
1888 if let Some(use_entrypoint) = opts.use_entrypoint {
1889 query = query.arg("useEntrypoint", use_entrypoint);
1890 }
1891 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1892 query = query.arg(
1893 "experimentalPrivilegedNesting",
1894 experimental_privileged_nesting,
1895 );
1896 }
1897 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
1898 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
1899 }
1900 if let Some(expand) = opts.expand {
1901 query = query.arg("expand", expand);
1902 }
1903 if let Some(no_init) = opts.no_init {
1904 query = query.arg("noInit", no_init);
1905 }
1906 Service {
1907 proc: self.proc.clone(),
1908 selection: query,
1909 graphql_client: self.graphql_client.clone(),
1910 }
1911 }
1912 pub fn as_tarball(&self) -> File {
1918 let query = self.selection.select("asTarball");
1919 File {
1920 proc: self.proc.clone(),
1921 selection: query,
1922 graphql_client: self.graphql_client.clone(),
1923 }
1924 }
1925 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
1931 let mut query = self.selection.select("asTarball");
1932 if let Some(platform_variants) = opts.platform_variants {
1933 query = query.arg("platformVariants", platform_variants);
1934 }
1935 if let Some(forced_compression) = opts.forced_compression {
1936 query = query.arg("forcedCompression", forced_compression);
1937 }
1938 if let Some(media_types) = opts.media_types {
1939 query = query.arg("mediaTypes", media_types);
1940 }
1941 File {
1942 proc: self.proc.clone(),
1943 selection: query,
1944 graphql_client: self.graphql_client.clone(),
1945 }
1946 }
1947 pub async fn combined_output(&self) -> Result<String, DaggerError> {
1950 let query = self.selection.select("combinedOutput");
1951 query.execute(self.graphql_client.clone()).await
1952 }
1953 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
1955 let query = self.selection.select("defaultArgs");
1956 query.execute(self.graphql_client.clone()).await
1957 }
1958 pub fn directory(&self, path: impl Into<String>) -> Directory {
1966 let mut query = self.selection.select("directory");
1967 query = query.arg("path", path.into());
1968 Directory {
1969 proc: self.proc.clone(),
1970 selection: query,
1971 graphql_client: self.graphql_client.clone(),
1972 }
1973 }
1974 pub fn directory_opts(
1982 &self,
1983 path: impl Into<String>,
1984 opts: ContainerDirectoryOpts,
1985 ) -> Directory {
1986 let mut query = self.selection.select("directory");
1987 query = query.arg("path", path.into());
1988 if let Some(expand) = opts.expand {
1989 query = query.arg("expand", expand);
1990 }
1991 Directory {
1992 proc: self.proc.clone(),
1993 selection: query,
1994 graphql_client: self.graphql_client.clone(),
1995 }
1996 }
1997 pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
1999 let query = self.selection.select("dockerHealthcheck");
2000 let query = query.select("id");
2001 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2002 Ok(id.map(|id| HealthcheckConfig {
2003 proc: self.proc.clone(),
2004 selection: query
2005 .root()
2006 .select("node")
2007 .arg("id", &id.0)
2008 .inline_fragment("HealthcheckConfig"),
2009 graphql_client: self.graphql_client.clone(),
2010 }))
2011 }
2012 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2014 let query = self.selection.select("entrypoint");
2015 query.execute(self.graphql_client.clone()).await
2016 }
2017 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2023 let mut query = self.selection.select("envVariable");
2024 query = query.arg("name", name.into());
2025 query.execute(self.graphql_client.clone()).await
2026 }
2027 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2029 let query = self.selection.select("envVariables");
2030 let query = query.select("id");
2031 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2032 Ok(ids
2033 .into_iter()
2034 .map(|id| EnvVariable {
2035 proc: self.proc.clone(),
2036 selection: crate::querybuilder::query()
2037 .select("node")
2038 .arg("id", &id.0)
2039 .inline_fragment("EnvVariable"),
2040 graphql_client: self.graphql_client.clone(),
2041 })
2042 .collect())
2043 }
2044 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2051 let mut query = self.selection.select("exists");
2052 query = query.arg("path", path.into());
2053 query.execute(self.graphql_client.clone()).await
2054 }
2055 pub async fn exists_opts(
2062 &self,
2063 path: impl Into<String>,
2064 opts: ContainerExistsOpts,
2065 ) -> Result<bool, DaggerError> {
2066 let mut query = self.selection.select("exists");
2067 query = query.arg("path", path.into());
2068 if let Some(expected_type) = opts.expected_type {
2069 query = query.arg("expectedType", expected_type);
2070 }
2071 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2072 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2073 }
2074 if let Some(expand) = opts.expand {
2075 query = query.arg("expand", expand);
2076 }
2077 query.execute(self.graphql_client.clone()).await
2078 }
2079 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2082 let query = self.selection.select("exitCode");
2083 query.execute(self.graphql_client.clone()).await
2084 }
2085 pub fn experimental_with_all_gp_us(&self) -> Container {
2089 let query = self.selection.select("experimentalWithAllGPUs");
2090 Container {
2091 proc: self.proc.clone(),
2092 selection: query,
2093 graphql_client: self.graphql_client.clone(),
2094 }
2095 }
2096 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2104 let mut query = self.selection.select("experimentalWithGPU");
2105 query = query.arg(
2106 "devices",
2107 devices
2108 .into_iter()
2109 .map(|i| i.into())
2110 .collect::<Vec<String>>(),
2111 );
2112 Container {
2113 proc: self.proc.clone(),
2114 selection: query,
2115 graphql_client: self.graphql_client.clone(),
2116 }
2117 }
2118 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2128 let mut query = self.selection.select("export");
2129 query = query.arg("path", path.into());
2130 query.execute(self.graphql_client.clone()).await
2131 }
2132 pub async fn export_opts(
2142 &self,
2143 path: impl Into<String>,
2144 opts: ContainerExportOpts,
2145 ) -> Result<String, DaggerError> {
2146 let mut query = self.selection.select("export");
2147 query = query.arg("path", path.into());
2148 if let Some(platform_variants) = opts.platform_variants {
2149 query = query.arg("platformVariants", platform_variants);
2150 }
2151 if let Some(forced_compression) = opts.forced_compression {
2152 query = query.arg("forcedCompression", forced_compression);
2153 }
2154 if let Some(media_types) = opts.media_types {
2155 query = query.arg("mediaTypes", media_types);
2156 }
2157 if let Some(expand) = opts.expand {
2158 query = query.arg("expand", expand);
2159 }
2160 query.execute(self.graphql_client.clone()).await
2161 }
2162 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2169 let mut query = self.selection.select("exportImage");
2170 query = query.arg("name", name.into());
2171 query.execute(self.graphql_client.clone()).await
2172 }
2173 pub async fn export_image_opts(
2180 &self,
2181 name: impl Into<String>,
2182 opts: ContainerExportImageOpts,
2183 ) -> Result<Void, DaggerError> {
2184 let mut query = self.selection.select("exportImage");
2185 query = query.arg("name", name.into());
2186 if let Some(platform_variants) = opts.platform_variants {
2187 query = query.arg("platformVariants", platform_variants);
2188 }
2189 if let Some(forced_compression) = opts.forced_compression {
2190 query = query.arg("forcedCompression", forced_compression);
2191 }
2192 if let Some(media_types) = opts.media_types {
2193 query = query.arg("mediaTypes", media_types);
2194 }
2195 query.execute(self.graphql_client.clone()).await
2196 }
2197 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2200 let query = self.selection.select("exposedPorts");
2201 let query = query.select("id");
2202 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2203 Ok(ids
2204 .into_iter()
2205 .map(|id| Port {
2206 proc: self.proc.clone(),
2207 selection: crate::querybuilder::query()
2208 .select("node")
2209 .arg("id", &id.0)
2210 .inline_fragment("Port"),
2211 graphql_client: self.graphql_client.clone(),
2212 })
2213 .collect())
2214 }
2215 pub fn file(&self, path: impl Into<String>) -> File {
2223 let mut query = self.selection.select("file");
2224 query = query.arg("path", path.into());
2225 File {
2226 proc: self.proc.clone(),
2227 selection: query,
2228 graphql_client: self.graphql_client.clone(),
2229 }
2230 }
2231 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2239 let mut query = self.selection.select("file");
2240 query = query.arg("path", path.into());
2241 if let Some(expand) = opts.expand {
2242 query = query.arg("expand", expand);
2243 }
2244 File {
2245 proc: self.proc.clone(),
2246 selection: query,
2247 graphql_client: self.graphql_client.clone(),
2248 }
2249 }
2250 pub fn from(&self, address: impl Into<String>) -> Container {
2259 let mut query = self.selection.select("from");
2260 query = query.arg("address", address.into());
2261 Container {
2262 proc: self.proc.clone(),
2263 selection: query,
2264 graphql_client: self.graphql_client.clone(),
2265 }
2266 }
2267 pub fn from_opts<'a>(
2276 &self,
2277 address: impl Into<String>,
2278 opts: ContainerFromOpts<'a>,
2279 ) -> Container {
2280 let mut query = self.selection.select("from");
2281 query = query.arg("address", address.into());
2282 if let Some(version) = opts.version {
2283 query = query.arg("version", version);
2284 }
2285 if let Some(registry_service) = opts.registry_service {
2286 query = query.arg("registryService", registry_service);
2287 }
2288 if let Some(protocol) = opts.protocol {
2289 query = query.arg("protocol", protocol);
2290 }
2291 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
2292 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
2293 }
2294 Container {
2295 proc: self.proc.clone(),
2296 selection: query,
2297 graphql_client: self.graphql_client.clone(),
2298 }
2299 }
2300 pub async fn id(&self) -> Result<Id, DaggerError> {
2302 let query = self.selection.select("id");
2303 query.execute(self.graphql_client.clone()).await
2304 }
2305 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2307 let query = self.selection.select("imageRef");
2308 query.execute(self.graphql_client.clone()).await
2309 }
2310 pub fn import(&self, source: impl IntoID<Id>) -> Container {
2317 let mut query = self.selection.select("import");
2318 query = query.arg_lazy(
2319 "source",
2320 Box::new(move || {
2321 let source = source.clone();
2322 Box::pin(async move { source.into_id().await.unwrap().quote() })
2323 }),
2324 );
2325 Container {
2326 proc: self.proc.clone(),
2327 selection: query,
2328 graphql_client: self.graphql_client.clone(),
2329 }
2330 }
2331 pub fn import_opts<'a>(
2338 &self,
2339 source: impl IntoID<Id>,
2340 opts: ContainerImportOpts<'a>,
2341 ) -> Container {
2342 let mut query = self.selection.select("import");
2343 query = query.arg_lazy(
2344 "source",
2345 Box::new(move || {
2346 let source = source.clone();
2347 Box::pin(async move { source.into_id().await.unwrap().quote() })
2348 }),
2349 );
2350 if let Some(tag) = opts.tag {
2351 query = query.arg("tag", tag);
2352 }
2353 Container {
2354 proc: self.proc.clone(),
2355 selection: query,
2356 graphql_client: self.graphql_client.clone(),
2357 }
2358 }
2359 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2365 let mut query = self.selection.select("label");
2366 query = query.arg("name", name.into());
2367 query.execute(self.graphql_client.clone()).await
2368 }
2369 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2371 let query = self.selection.select("labels");
2372 let query = query.select("id");
2373 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2374 Ok(ids
2375 .into_iter()
2376 .map(|id| Label {
2377 proc: self.proc.clone(),
2378 selection: crate::querybuilder::query()
2379 .select("node")
2380 .arg("id", &id.0)
2381 .inline_fragment("Label"),
2382 graphql_client: self.graphql_client.clone(),
2383 })
2384 .collect())
2385 }
2386 pub fn layer(&self, id: impl Into<String>) -> File {
2393 let mut query = self.selection.select("layer");
2394 query = query.arg("id", id.into());
2395 File {
2396 proc: self.proc.clone(),
2397 selection: query,
2398 graphql_client: self.graphql_client.clone(),
2399 }
2400 }
2401 pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
2408 let mut query = self.selection.select("layer");
2409 query = query.arg("id", id.into());
2410 if let Some(forced_compression) = opts.forced_compression {
2411 query = query.arg("forcedCompression", forced_compression);
2412 }
2413 if let Some(media_types) = opts.media_types {
2414 query = query.arg("mediaTypes", media_types);
2415 }
2416 File {
2417 proc: self.proc.clone(),
2418 selection: query,
2419 graphql_client: self.graphql_client.clone(),
2420 }
2421 }
2422 pub fn manifest(&self) -> File {
2428 let query = self.selection.select("manifest");
2429 File {
2430 proc: self.proc.clone(),
2431 selection: query,
2432 graphql_client: self.graphql_client.clone(),
2433 }
2434 }
2435 pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
2441 let mut query = self.selection.select("manifest");
2442 if let Some(forced_compression) = opts.forced_compression {
2443 query = query.arg("forcedCompression", forced_compression);
2444 }
2445 if let Some(media_types) = opts.media_types {
2446 query = query.arg("mediaTypes", media_types);
2447 }
2448 File {
2449 proc: self.proc.clone(),
2450 selection: query,
2451 graphql_client: self.graphql_client.clone(),
2452 }
2453 }
2454 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2456 let query = self.selection.select("mounts");
2457 query.execute(self.graphql_client.clone()).await
2458 }
2459 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2461 let query = self.selection.select("platform");
2462 query.execute(self.graphql_client.clone()).await
2463 }
2464 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2474 let mut query = self.selection.select("publish");
2475 query = query.arg("address", address.into());
2476 query.execute(self.graphql_client.clone()).await
2477 }
2478 pub async fn publish_opts(
2488 &self,
2489 address: impl Into<String>,
2490 opts: ContainerPublishOpts,
2491 ) -> Result<String, DaggerError> {
2492 let mut query = self.selection.select("publish");
2493 query = query.arg("address", address.into());
2494 if let Some(platform_variants) = opts.platform_variants {
2495 query = query.arg("platformVariants", platform_variants);
2496 }
2497 if let Some(forced_compression) = opts.forced_compression {
2498 query = query.arg("forcedCompression", forced_compression);
2499 }
2500 if let Some(media_types) = opts.media_types {
2501 query = query.arg("mediaTypes", media_types);
2502 }
2503 if let Some(registry_service) = opts.registry_service {
2504 query = query.arg("registryService", registry_service);
2505 }
2506 if let Some(protocol) = opts.protocol {
2507 query = query.arg("protocol", protocol);
2508 }
2509 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
2510 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
2511 }
2512 query.execute(self.graphql_client.clone()).await
2513 }
2514 pub fn rootfs(&self) -> Directory {
2516 let query = self.selection.select("rootfs");
2517 Directory {
2518 proc: self.proc.clone(),
2519 selection: query,
2520 graphql_client: self.graphql_client.clone(),
2521 }
2522 }
2523 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
2530 let mut query = self.selection.select("stat");
2531 query = query.arg("path", path.into());
2532 let query = query.select("id");
2533 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2534 Ok(id.map(|id| Stat {
2535 proc: self.proc.clone(),
2536 selection: query
2537 .root()
2538 .select("node")
2539 .arg("id", &id.0)
2540 .inline_fragment("Stat"),
2541 graphql_client: self.graphql_client.clone(),
2542 }))
2543 }
2544 pub async fn stat_opts(
2551 &self,
2552 path: impl Into<String>,
2553 opts: ContainerStatOpts,
2554 ) -> Result<Option<Stat>, DaggerError> {
2555 let mut query = self.selection.select("stat");
2556 query = query.arg("path", path.into());
2557 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2558 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2559 }
2560 let query = query.select("id");
2561 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2562 Ok(id.map(|id| Stat {
2563 proc: self.proc.clone(),
2564 selection: query
2565 .root()
2566 .select("node")
2567 .arg("id", &id.0)
2568 .inline_fragment("Stat"),
2569 graphql_client: self.graphql_client.clone(),
2570 }))
2571 }
2572 pub async fn stderr(&self) -> Result<String, DaggerError> {
2575 let query = self.selection.select("stderr");
2576 query.execute(self.graphql_client.clone()).await
2577 }
2578 pub async fn stdout(&self) -> Result<String, DaggerError> {
2581 let query = self.selection.select("stdout");
2582 query.execute(self.graphql_client.clone()).await
2583 }
2584 pub async fn sync(&self) -> Result<Container, DaggerError> {
2587 let query = self.selection.select("sync");
2588 let id: Id = query.execute(self.graphql_client.clone()).await?;
2589 Ok(Container {
2590 proc: self.proc.clone(),
2591 selection: query
2592 .root()
2593 .select("node")
2594 .arg("id", &id.0)
2595 .inline_fragment("Container"),
2596 graphql_client: self.graphql_client.clone(),
2597 })
2598 }
2599 pub fn terminal(&self) -> Container {
2605 let query = self.selection.select("terminal");
2606 Container {
2607 proc: self.proc.clone(),
2608 selection: query,
2609 graphql_client: self.graphql_client.clone(),
2610 }
2611 }
2612 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2618 let mut query = self.selection.select("terminal");
2619 if let Some(cmd) = opts.cmd {
2620 query = query.arg("cmd", cmd);
2621 }
2622 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2623 query = query.arg(
2624 "experimentalPrivilegedNesting",
2625 experimental_privileged_nesting,
2626 );
2627 }
2628 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2629 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2630 }
2631 Container {
2632 proc: self.proc.clone(),
2633 selection: query,
2634 graphql_client: self.graphql_client.clone(),
2635 }
2636 }
2637 pub async fn up(&self) -> Result<Void, DaggerError> {
2644 let query = self.selection.select("up");
2645 query.execute(self.graphql_client.clone()).await
2646 }
2647 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2654 let mut query = self.selection.select("up");
2655 if let Some(random) = opts.random {
2656 query = query.arg("random", random);
2657 }
2658 if let Some(ports) = opts.ports {
2659 query = query.arg("ports", ports);
2660 }
2661 if let Some(args) = opts.args {
2662 query = query.arg("args", args);
2663 }
2664 if let Some(use_entrypoint) = opts.use_entrypoint {
2665 query = query.arg("useEntrypoint", use_entrypoint);
2666 }
2667 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2668 query = query.arg(
2669 "experimentalPrivilegedNesting",
2670 experimental_privileged_nesting,
2671 );
2672 }
2673 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2674 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2675 }
2676 if let Some(expand) = opts.expand {
2677 query = query.arg("expand", expand);
2678 }
2679 if let Some(no_init) = opts.no_init {
2680 query = query.arg("noInit", no_init);
2681 }
2682 query.execute(self.graphql_client.clone()).await
2683 }
2684 pub async fn user(&self) -> Result<String, DaggerError> {
2686 let query = self.selection.select("user");
2687 query.execute(self.graphql_client.clone()).await
2688 }
2689 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2696 let mut query = self.selection.select("withAnnotation");
2697 query = query.arg("name", name.into());
2698 query = query.arg("value", value.into());
2699 Container {
2700 proc: self.proc.clone(),
2701 selection: query,
2702 graphql_client: self.graphql_client.clone(),
2703 }
2704 }
2705 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2711 let mut query = self.selection.select("withDefaultArgs");
2712 query = query.arg(
2713 "args",
2714 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2715 );
2716 Container {
2717 proc: self.proc.clone(),
2718 selection: query,
2719 graphql_client: self.graphql_client.clone(),
2720 }
2721 }
2722 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2729 let mut query = self.selection.select("withDefaultTerminalCmd");
2730 query = query.arg(
2731 "args",
2732 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2733 );
2734 Container {
2735 proc: self.proc.clone(),
2736 selection: query,
2737 graphql_client: self.graphql_client.clone(),
2738 }
2739 }
2740 pub fn with_default_terminal_cmd_opts(
2747 &self,
2748 args: Vec<impl Into<String>>,
2749 opts: ContainerWithDefaultTerminalCmdOpts,
2750 ) -> Container {
2751 let mut query = self.selection.select("withDefaultTerminalCmd");
2752 query = query.arg(
2753 "args",
2754 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2755 );
2756 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2757 query = query.arg(
2758 "experimentalPrivilegedNesting",
2759 experimental_privileged_nesting,
2760 );
2761 }
2762 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2763 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2764 }
2765 Container {
2766 proc: self.proc.clone(),
2767 selection: query,
2768 graphql_client: self.graphql_client.clone(),
2769 }
2770 }
2771 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2779 let mut query = self.selection.select("withDirectory");
2780 query = query.arg("path", path.into());
2781 query = query.arg_lazy(
2782 "source",
2783 Box::new(move || {
2784 let source = source.clone();
2785 Box::pin(async move { source.into_id().await.unwrap().quote() })
2786 }),
2787 );
2788 Container {
2789 proc: self.proc.clone(),
2790 selection: query,
2791 graphql_client: self.graphql_client.clone(),
2792 }
2793 }
2794 pub fn with_directory_opts<'a>(
2802 &self,
2803 path: impl Into<String>,
2804 source: impl IntoID<Id>,
2805 opts: ContainerWithDirectoryOpts<'a>,
2806 ) -> Container {
2807 let mut query = self.selection.select("withDirectory");
2808 query = query.arg("path", path.into());
2809 query = query.arg_lazy(
2810 "source",
2811 Box::new(move || {
2812 let source = source.clone();
2813 Box::pin(async move { source.into_id().await.unwrap().quote() })
2814 }),
2815 );
2816 if let Some(exclude) = opts.exclude {
2817 query = query.arg("exclude", exclude);
2818 }
2819 if let Some(include) = opts.include {
2820 query = query.arg("include", include);
2821 }
2822 if let Some(gitignore) = opts.gitignore {
2823 query = query.arg("gitignore", gitignore);
2824 }
2825 if let Some(owner) = opts.owner {
2826 query = query.arg("owner", owner);
2827 }
2828 if let Some(inherit_owner) = opts.inherit_owner {
2829 query = query.arg("inheritOwner", inherit_owner);
2830 }
2831 if let Some(expand) = opts.expand {
2832 query = query.arg("expand", expand);
2833 }
2834 if let Some(permissions) = opts.permissions {
2835 query = query.arg("permissions", permissions);
2836 }
2837 Container {
2838 proc: self.proc.clone(),
2839 selection: query,
2840 graphql_client: self.graphql_client.clone(),
2841 }
2842 }
2843 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2850 let mut query = self.selection.select("withDockerHealthcheck");
2851 query = query.arg(
2852 "args",
2853 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2854 );
2855 Container {
2856 proc: self.proc.clone(),
2857 selection: query,
2858 graphql_client: self.graphql_client.clone(),
2859 }
2860 }
2861 pub fn with_docker_healthcheck_opts<'a>(
2868 &self,
2869 args: Vec<impl Into<String>>,
2870 opts: ContainerWithDockerHealthcheckOpts<'a>,
2871 ) -> Container {
2872 let mut query = self.selection.select("withDockerHealthcheck");
2873 query = query.arg(
2874 "args",
2875 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2876 );
2877 if let Some(shell) = opts.shell {
2878 query = query.arg("shell", shell);
2879 }
2880 if let Some(interval) = opts.interval {
2881 query = query.arg("interval", interval);
2882 }
2883 if let Some(timeout) = opts.timeout {
2884 query = query.arg("timeout", timeout);
2885 }
2886 if let Some(start_period) = opts.start_period {
2887 query = query.arg("startPeriod", start_period);
2888 }
2889 if let Some(start_interval) = opts.start_interval {
2890 query = query.arg("startInterval", start_interval);
2891 }
2892 if let Some(retries) = opts.retries {
2893 query = query.arg("retries", retries);
2894 }
2895 Container {
2896 proc: self.proc.clone(),
2897 selection: query,
2898 graphql_client: self.graphql_client.clone(),
2899 }
2900 }
2901 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2908 let mut query = self.selection.select("withEntrypoint");
2909 query = query.arg(
2910 "args",
2911 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2912 );
2913 Container {
2914 proc: self.proc.clone(),
2915 selection: query,
2916 graphql_client: self.graphql_client.clone(),
2917 }
2918 }
2919 pub fn with_entrypoint_opts(
2926 &self,
2927 args: Vec<impl Into<String>>,
2928 opts: ContainerWithEntrypointOpts,
2929 ) -> Container {
2930 let mut query = self.selection.select("withEntrypoint");
2931 query = query.arg(
2932 "args",
2933 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2934 );
2935 if let Some(keep_default_args) = opts.keep_default_args {
2936 query = query.arg("keepDefaultArgs", keep_default_args);
2937 }
2938 Container {
2939 proc: self.proc.clone(),
2940 selection: query,
2941 graphql_client: self.graphql_client.clone(),
2942 }
2943 }
2944 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2950 let mut query = self.selection.select("withEnvFileVariables");
2951 query = query.arg_lazy(
2952 "source",
2953 Box::new(move || {
2954 let source = source.clone();
2955 Box::pin(async move { source.into_id().await.unwrap().quote() })
2956 }),
2957 );
2958 Container {
2959 proc: self.proc.clone(),
2960 selection: query,
2961 graphql_client: self.graphql_client.clone(),
2962 }
2963 }
2964 pub fn with_env_variable(
2972 &self,
2973 name: impl Into<String>,
2974 value: impl Into<String>,
2975 ) -> Container {
2976 let mut query = self.selection.select("withEnvVariable");
2977 query = query.arg("name", name.into());
2978 query = query.arg("value", value.into());
2979 Container {
2980 proc: self.proc.clone(),
2981 selection: query,
2982 graphql_client: self.graphql_client.clone(),
2983 }
2984 }
2985 pub fn with_env_variable_opts(
2993 &self,
2994 name: impl Into<String>,
2995 value: impl Into<String>,
2996 opts: ContainerWithEnvVariableOpts,
2997 ) -> Container {
2998 let mut query = self.selection.select("withEnvVariable");
2999 query = query.arg("name", name.into());
3000 query = query.arg("value", value.into());
3001 if let Some(expand) = opts.expand {
3002 query = query.arg("expand", expand);
3003 }
3004 Container {
3005 proc: self.proc.clone(),
3006 selection: query,
3007 graphql_client: self.graphql_client.clone(),
3008 }
3009 }
3010 pub fn with_error(&self, err: impl Into<String>) -> Container {
3016 let mut query = self.selection.select("withError");
3017 query = query.arg("err", err.into());
3018 Container {
3019 proc: self.proc.clone(),
3020 selection: query,
3021 graphql_client: self.graphql_client.clone(),
3022 }
3023 }
3024 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3035 let mut query = self.selection.select("withExec");
3036 query = query.arg(
3037 "args",
3038 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3039 );
3040 Container {
3041 proc: self.proc.clone(),
3042 selection: query,
3043 graphql_client: self.graphql_client.clone(),
3044 }
3045 }
3046 pub fn with_exec_opts<'a>(
3057 &self,
3058 args: Vec<impl Into<String>>,
3059 opts: ContainerWithExecOpts<'a>,
3060 ) -> Container {
3061 let mut query = self.selection.select("withExec");
3062 query = query.arg(
3063 "args",
3064 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3065 );
3066 if let Some(use_entrypoint) = opts.use_entrypoint {
3067 query = query.arg("useEntrypoint", use_entrypoint);
3068 }
3069 if let Some(stdin) = opts.stdin {
3070 query = query.arg("stdin", stdin);
3071 }
3072 if let Some(redirect_stdin) = opts.redirect_stdin {
3073 query = query.arg("redirectStdin", redirect_stdin);
3074 }
3075 if let Some(redirect_stdout) = opts.redirect_stdout {
3076 query = query.arg("redirectStdout", redirect_stdout);
3077 }
3078 if let Some(redirect_stderr) = opts.redirect_stderr {
3079 query = query.arg("redirectStderr", redirect_stderr);
3080 }
3081 if let Some(expect) = opts.expect {
3082 query = query.arg("expect", expect);
3083 }
3084 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3085 query = query.arg(
3086 "experimentalPrivilegedNesting",
3087 experimental_privileged_nesting,
3088 );
3089 }
3090 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3091 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3092 }
3093 if let Some(expand) = opts.expand {
3094 query = query.arg("expand", expand);
3095 }
3096 if let Some(no_init) = opts.no_init {
3097 query = query.arg("noInit", no_init);
3098 }
3099 Container {
3100 proc: self.proc.clone(),
3101 selection: query,
3102 graphql_client: self.graphql_client.clone(),
3103 }
3104 }
3105 pub fn with_exposed_port(&self, port: isize) -> Container {
3115 let mut query = self.selection.select("withExposedPort");
3116 query = query.arg("port", port);
3117 Container {
3118 proc: self.proc.clone(),
3119 selection: query,
3120 graphql_client: self.graphql_client.clone(),
3121 }
3122 }
3123 pub fn with_exposed_port_opts<'a>(
3133 &self,
3134 port: isize,
3135 opts: ContainerWithExposedPortOpts<'a>,
3136 ) -> Container {
3137 let mut query = self.selection.select("withExposedPort");
3138 query = query.arg("port", port);
3139 if let Some(protocol) = opts.protocol {
3140 query = query.arg("protocol", protocol);
3141 }
3142 if let Some(description) = opts.description {
3143 query = query.arg("description", description);
3144 }
3145 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3146 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3147 }
3148 Container {
3149 proc: self.proc.clone(),
3150 selection: query,
3151 graphql_client: self.graphql_client.clone(),
3152 }
3153 }
3154 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3162 let mut query = self.selection.select("withFile");
3163 query = query.arg("path", path.into());
3164 query = query.arg_lazy(
3165 "source",
3166 Box::new(move || {
3167 let source = source.clone();
3168 Box::pin(async move { source.into_id().await.unwrap().quote() })
3169 }),
3170 );
3171 Container {
3172 proc: self.proc.clone(),
3173 selection: query,
3174 graphql_client: self.graphql_client.clone(),
3175 }
3176 }
3177 pub fn with_file_opts<'a>(
3185 &self,
3186 path: impl Into<String>,
3187 source: impl IntoID<Id>,
3188 opts: ContainerWithFileOpts<'a>,
3189 ) -> Container {
3190 let mut query = self.selection.select("withFile");
3191 query = query.arg("path", path.into());
3192 query = query.arg_lazy(
3193 "source",
3194 Box::new(move || {
3195 let source = source.clone();
3196 Box::pin(async move { source.into_id().await.unwrap().quote() })
3197 }),
3198 );
3199 if let Some(permissions) = opts.permissions {
3200 query = query.arg("permissions", permissions);
3201 }
3202 if let Some(owner) = opts.owner {
3203 query = query.arg("owner", owner);
3204 }
3205 if let Some(inherit_owner) = opts.inherit_owner {
3206 query = query.arg("inheritOwner", inherit_owner);
3207 }
3208 if let Some(expand) = opts.expand {
3209 query = query.arg("expand", expand);
3210 }
3211 Container {
3212 proc: self.proc.clone(),
3213 selection: query,
3214 graphql_client: self.graphql_client.clone(),
3215 }
3216 }
3217 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3225 let mut query = self.selection.select("withFiles");
3226 query = query.arg("path", path.into());
3227 query = query.arg("sources", sources);
3228 Container {
3229 proc: self.proc.clone(),
3230 selection: query,
3231 graphql_client: self.graphql_client.clone(),
3232 }
3233 }
3234 pub fn with_files_opts<'a>(
3242 &self,
3243 path: impl Into<String>,
3244 sources: Vec<Id>,
3245 opts: ContainerWithFilesOpts<'a>,
3246 ) -> Container {
3247 let mut query = self.selection.select("withFiles");
3248 query = query.arg("path", path.into());
3249 query = query.arg("sources", sources);
3250 if let Some(permissions) = opts.permissions {
3251 query = query.arg("permissions", permissions);
3252 }
3253 if let Some(owner) = opts.owner {
3254 query = query.arg("owner", owner);
3255 }
3256 if let Some(inherit_owner) = opts.inherit_owner {
3257 query = query.arg("inheritOwner", inherit_owner);
3258 }
3259 if let Some(expand) = opts.expand {
3260 query = query.arg("expand", expand);
3261 }
3262 Container {
3263 proc: self.proc.clone(),
3264 selection: query,
3265 graphql_client: self.graphql_client.clone(),
3266 }
3267 }
3268 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3275 let mut query = self.selection.select("withLabel");
3276 query = query.arg("name", name.into());
3277 query = query.arg("value", value.into());
3278 Container {
3279 proc: self.proc.clone(),
3280 selection: query,
3281 graphql_client: self.graphql_client.clone(),
3282 }
3283 }
3284 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3292 let mut query = self.selection.select("withMountedCache");
3293 query = query.arg("path", path.into());
3294 query = query.arg_lazy(
3295 "cache",
3296 Box::new(move || {
3297 let cache = cache.clone();
3298 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3299 }),
3300 );
3301 Container {
3302 proc: self.proc.clone(),
3303 selection: query,
3304 graphql_client: self.graphql_client.clone(),
3305 }
3306 }
3307 pub fn with_mounted_cache_opts<'a>(
3315 &self,
3316 path: impl Into<String>,
3317 cache: impl IntoID<Id>,
3318 opts: ContainerWithMountedCacheOpts<'a>,
3319 ) -> Container {
3320 let mut query = self.selection.select("withMountedCache");
3321 query = query.arg("path", path.into());
3322 query = query.arg_lazy(
3323 "cache",
3324 Box::new(move || {
3325 let cache = cache.clone();
3326 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3327 }),
3328 );
3329 if let Some(source) = opts.source {
3330 query = query.arg("source", source);
3331 }
3332 if let Some(sharing) = opts.sharing {
3333 query = query.arg("sharing", sharing);
3334 }
3335 if let Some(owner) = opts.owner {
3336 query = query.arg("owner", owner);
3337 }
3338 if let Some(inherit_owner) = opts.inherit_owner {
3339 query = query.arg("inheritOwner", inherit_owner);
3340 }
3341 if let Some(expand) = opts.expand {
3342 query = query.arg("expand", expand);
3343 }
3344 Container {
3345 proc: self.proc.clone(),
3346 selection: query,
3347 graphql_client: self.graphql_client.clone(),
3348 }
3349 }
3350 pub fn with_mounted_directory(
3358 &self,
3359 path: impl Into<String>,
3360 source: impl IntoID<Id>,
3361 ) -> Container {
3362 let mut query = self.selection.select("withMountedDirectory");
3363 query = query.arg("path", path.into());
3364 query = query.arg_lazy(
3365 "source",
3366 Box::new(move || {
3367 let source = source.clone();
3368 Box::pin(async move { source.into_id().await.unwrap().quote() })
3369 }),
3370 );
3371 Container {
3372 proc: self.proc.clone(),
3373 selection: query,
3374 graphql_client: self.graphql_client.clone(),
3375 }
3376 }
3377 pub fn with_mounted_directory_opts<'a>(
3385 &self,
3386 path: impl Into<String>,
3387 source: impl IntoID<Id>,
3388 opts: ContainerWithMountedDirectoryOpts<'a>,
3389 ) -> Container {
3390 let mut query = self.selection.select("withMountedDirectory");
3391 query = query.arg("path", path.into());
3392 query = query.arg_lazy(
3393 "source",
3394 Box::new(move || {
3395 let source = source.clone();
3396 Box::pin(async move { source.into_id().await.unwrap().quote() })
3397 }),
3398 );
3399 if let Some(owner) = opts.owner {
3400 query = query.arg("owner", owner);
3401 }
3402 if let Some(inherit_owner) = opts.inherit_owner {
3403 query = query.arg("inheritOwner", inherit_owner);
3404 }
3405 if let Some(read_only) = opts.read_only {
3406 query = query.arg("readOnly", read_only);
3407 }
3408 if let Some(expand) = opts.expand {
3409 query = query.arg("expand", expand);
3410 }
3411 Container {
3412 proc: self.proc.clone(),
3413 selection: query,
3414 graphql_client: self.graphql_client.clone(),
3415 }
3416 }
3417 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3425 let mut query = self.selection.select("withMountedFile");
3426 query = query.arg("path", path.into());
3427 query = query.arg_lazy(
3428 "source",
3429 Box::new(move || {
3430 let source = source.clone();
3431 Box::pin(async move { source.into_id().await.unwrap().quote() })
3432 }),
3433 );
3434 Container {
3435 proc: self.proc.clone(),
3436 selection: query,
3437 graphql_client: self.graphql_client.clone(),
3438 }
3439 }
3440 pub fn with_mounted_file_opts<'a>(
3448 &self,
3449 path: impl Into<String>,
3450 source: impl IntoID<Id>,
3451 opts: ContainerWithMountedFileOpts<'a>,
3452 ) -> Container {
3453 let mut query = self.selection.select("withMountedFile");
3454 query = query.arg("path", path.into());
3455 query = query.arg_lazy(
3456 "source",
3457 Box::new(move || {
3458 let source = source.clone();
3459 Box::pin(async move { source.into_id().await.unwrap().quote() })
3460 }),
3461 );
3462 if let Some(owner) = opts.owner {
3463 query = query.arg("owner", owner);
3464 }
3465 if let Some(inherit_owner) = opts.inherit_owner {
3466 query = query.arg("inheritOwner", inherit_owner);
3467 }
3468 if let Some(expand) = opts.expand {
3469 query = query.arg("expand", expand);
3470 }
3471 Container {
3472 proc: self.proc.clone(),
3473 selection: query,
3474 graphql_client: self.graphql_client.clone(),
3475 }
3476 }
3477 pub fn with_mounted_secret(
3485 &self,
3486 path: impl Into<String>,
3487 source: impl IntoID<Id>,
3488 ) -> Container {
3489 let mut query = self.selection.select("withMountedSecret");
3490 query = query.arg("path", path.into());
3491 query = query.arg_lazy(
3492 "source",
3493 Box::new(move || {
3494 let source = source.clone();
3495 Box::pin(async move { source.into_id().await.unwrap().quote() })
3496 }),
3497 );
3498 Container {
3499 proc: self.proc.clone(),
3500 selection: query,
3501 graphql_client: self.graphql_client.clone(),
3502 }
3503 }
3504 pub fn with_mounted_secret_opts<'a>(
3512 &self,
3513 path: impl Into<String>,
3514 source: impl IntoID<Id>,
3515 opts: ContainerWithMountedSecretOpts<'a>,
3516 ) -> Container {
3517 let mut query = self.selection.select("withMountedSecret");
3518 query = query.arg("path", path.into());
3519 query = query.arg_lazy(
3520 "source",
3521 Box::new(move || {
3522 let source = source.clone();
3523 Box::pin(async move { source.into_id().await.unwrap().quote() })
3524 }),
3525 );
3526 if let Some(owner) = opts.owner {
3527 query = query.arg("owner", owner);
3528 }
3529 if let Some(inherit_owner) = opts.inherit_owner {
3530 query = query.arg("inheritOwner", inherit_owner);
3531 }
3532 if let Some(mode) = opts.mode {
3533 query = query.arg("mode", mode);
3534 }
3535 if let Some(expand) = opts.expand {
3536 query = query.arg("expand", expand);
3537 }
3538 Container {
3539 proc: self.proc.clone(),
3540 selection: query,
3541 graphql_client: self.graphql_client.clone(),
3542 }
3543 }
3544 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3551 let mut query = self.selection.select("withMountedTemp");
3552 query = query.arg("path", path.into());
3553 Container {
3554 proc: self.proc.clone(),
3555 selection: query,
3556 graphql_client: self.graphql_client.clone(),
3557 }
3558 }
3559 pub fn with_mounted_temp_opts(
3566 &self,
3567 path: impl Into<String>,
3568 opts: ContainerWithMountedTempOpts,
3569 ) -> Container {
3570 let mut query = self.selection.select("withMountedTemp");
3571 query = query.arg("path", path.into());
3572 if let Some(size) = opts.size {
3573 query = query.arg("size", size);
3574 }
3575 if let Some(expand) = opts.expand {
3576 query = query.arg("expand", expand);
3577 }
3578 Container {
3579 proc: self.proc.clone(),
3580 selection: query,
3581 graphql_client: self.graphql_client.clone(),
3582 }
3583 }
3584 pub fn with_mounted_volume(
3592 &self,
3593 path: impl Into<String>,
3594 volume: impl IntoID<Id>,
3595 ) -> Container {
3596 let mut query = self.selection.select("withMountedVolume");
3597 query = query.arg("path", path.into());
3598 query = query.arg_lazy(
3599 "volume",
3600 Box::new(move || {
3601 let volume = volume.clone();
3602 Box::pin(async move { volume.into_id().await.unwrap().quote() })
3603 }),
3604 );
3605 Container {
3606 proc: self.proc.clone(),
3607 selection: query,
3608 graphql_client: self.graphql_client.clone(),
3609 }
3610 }
3611 pub fn with_mounted_volume_opts(
3619 &self,
3620 path: impl Into<String>,
3621 volume: impl IntoID<Id>,
3622 opts: ContainerWithMountedVolumeOpts,
3623 ) -> Container {
3624 let mut query = self.selection.select("withMountedVolume");
3625 query = query.arg("path", path.into());
3626 query = query.arg_lazy(
3627 "volume",
3628 Box::new(move || {
3629 let volume = volume.clone();
3630 Box::pin(async move { volume.into_id().await.unwrap().quote() })
3631 }),
3632 );
3633 if let Some(read_only) = opts.read_only {
3634 query = query.arg("readOnly", read_only);
3635 }
3636 if let Some(expand) = opts.expand {
3637 query = query.arg("expand", expand);
3638 }
3639 Container {
3640 proc: self.proc.clone(),
3641 selection: query,
3642 graphql_client: self.graphql_client.clone(),
3643 }
3644 }
3645 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3653 let mut query = self.selection.select("withNewFile");
3654 query = query.arg("path", path.into());
3655 query = query.arg("contents", contents.into());
3656 Container {
3657 proc: self.proc.clone(),
3658 selection: query,
3659 graphql_client: self.graphql_client.clone(),
3660 }
3661 }
3662 pub fn with_new_file_opts<'a>(
3670 &self,
3671 path: impl Into<String>,
3672 contents: impl Into<String>,
3673 opts: ContainerWithNewFileOpts<'a>,
3674 ) -> Container {
3675 let mut query = self.selection.select("withNewFile");
3676 query = query.arg("path", path.into());
3677 query = query.arg("contents", contents.into());
3678 if let Some(permissions) = opts.permissions {
3679 query = query.arg("permissions", permissions);
3680 }
3681 if let Some(owner) = opts.owner {
3682 query = query.arg("owner", owner);
3683 }
3684 if let Some(inherit_owner) = opts.inherit_owner {
3685 query = query.arg("inheritOwner", inherit_owner);
3686 }
3687 if let Some(expand) = opts.expand {
3688 query = query.arg("expand", expand);
3689 }
3690 Container {
3691 proc: self.proc.clone(),
3692 selection: query,
3693 graphql_client: self.graphql_client.clone(),
3694 }
3695 }
3696 pub fn with_registry_auth(
3704 &self,
3705 address: impl Into<String>,
3706 username: impl Into<String>,
3707 secret: impl IntoID<Id>,
3708 ) -> Container {
3709 let mut query = self.selection.select("withRegistryAuth");
3710 query = query.arg("address", address.into());
3711 query = query.arg("username", username.into());
3712 query = query.arg_lazy(
3713 "secret",
3714 Box::new(move || {
3715 let secret = secret.clone();
3716 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3717 }),
3718 );
3719 Container {
3720 proc: self.proc.clone(),
3721 selection: query,
3722 graphql_client: self.graphql_client.clone(),
3723 }
3724 }
3725 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3731 let mut query = self.selection.select("withRootfs");
3732 query = query.arg_lazy(
3733 "directory",
3734 Box::new(move || {
3735 let directory = directory.clone();
3736 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3737 }),
3738 );
3739 Container {
3740 proc: self.proc.clone(),
3741 selection: query,
3742 graphql_client: self.graphql_client.clone(),
3743 }
3744 }
3745 pub fn with_secret_variable(
3752 &self,
3753 name: impl Into<String>,
3754 secret: impl IntoID<Id>,
3755 ) -> Container {
3756 let mut query = self.selection.select("withSecretVariable");
3757 query = query.arg("name", name.into());
3758 query = query.arg_lazy(
3759 "secret",
3760 Box::new(move || {
3761 let secret = secret.clone();
3762 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3763 }),
3764 );
3765 Container {
3766 proc: self.proc.clone(),
3767 selection: query,
3768 graphql_client: self.graphql_client.clone(),
3769 }
3770 }
3771 pub fn with_service_binding(
3781 &self,
3782 alias: impl Into<String>,
3783 service: impl IntoID<Id>,
3784 ) -> Container {
3785 let mut query = self.selection.select("withServiceBinding");
3786 query = query.arg("alias", alias.into());
3787 query = query.arg_lazy(
3788 "service",
3789 Box::new(move || {
3790 let service = service.clone();
3791 Box::pin(async move { service.into_id().await.unwrap().quote() })
3792 }),
3793 );
3794 Container {
3795 proc: self.proc.clone(),
3796 selection: query,
3797 graphql_client: self.graphql_client.clone(),
3798 }
3799 }
3800 pub fn with_symlink(
3808 &self,
3809 target: impl Into<String>,
3810 link_name: impl Into<String>,
3811 ) -> Container {
3812 let mut query = self.selection.select("withSymlink");
3813 query = query.arg("target", target.into());
3814 query = query.arg("linkName", link_name.into());
3815 Container {
3816 proc: self.proc.clone(),
3817 selection: query,
3818 graphql_client: self.graphql_client.clone(),
3819 }
3820 }
3821 pub fn with_symlink_opts(
3829 &self,
3830 target: impl Into<String>,
3831 link_name: impl Into<String>,
3832 opts: ContainerWithSymlinkOpts,
3833 ) -> Container {
3834 let mut query = self.selection.select("withSymlink");
3835 query = query.arg("target", target.into());
3836 query = query.arg("linkName", link_name.into());
3837 if let Some(expand) = opts.expand {
3838 query = query.arg("expand", expand);
3839 }
3840 Container {
3841 proc: self.proc.clone(),
3842 selection: query,
3843 graphql_client: self.graphql_client.clone(),
3844 }
3845 }
3846 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3854 let mut query = self.selection.select("withUnixSocket");
3855 query = query.arg("path", path.into());
3856 query = query.arg_lazy(
3857 "source",
3858 Box::new(move || {
3859 let source = source.clone();
3860 Box::pin(async move { source.into_id().await.unwrap().quote() })
3861 }),
3862 );
3863 Container {
3864 proc: self.proc.clone(),
3865 selection: query,
3866 graphql_client: self.graphql_client.clone(),
3867 }
3868 }
3869 pub fn with_unix_socket_opts<'a>(
3877 &self,
3878 path: impl Into<String>,
3879 source: impl IntoID<Id>,
3880 opts: ContainerWithUnixSocketOpts<'a>,
3881 ) -> Container {
3882 let mut query = self.selection.select("withUnixSocket");
3883 query = query.arg("path", path.into());
3884 query = query.arg_lazy(
3885 "source",
3886 Box::new(move || {
3887 let source = source.clone();
3888 Box::pin(async move { source.into_id().await.unwrap().quote() })
3889 }),
3890 );
3891 if let Some(owner) = opts.owner {
3892 query = query.arg("owner", owner);
3893 }
3894 if let Some(inherit_owner) = opts.inherit_owner {
3895 query = query.arg("inheritOwner", inherit_owner);
3896 }
3897 if let Some(expand) = opts.expand {
3898 query = query.arg("expand", expand);
3899 }
3900 Container {
3901 proc: self.proc.clone(),
3902 selection: query,
3903 graphql_client: self.graphql_client.clone(),
3904 }
3905 }
3906 pub fn with_user(&self, name: impl Into<String>) -> Container {
3912 let mut query = self.selection.select("withUser");
3913 query = query.arg("name", name.into());
3914 Container {
3915 proc: self.proc.clone(),
3916 selection: query,
3917 graphql_client: self.graphql_client.clone(),
3918 }
3919 }
3920 pub fn with_volatile_variable(
3928 &self,
3929 name: impl Into<String>,
3930 value: impl Into<String>,
3931 ) -> Container {
3932 let mut query = self.selection.select("withVolatileVariable");
3933 query = query.arg("name", name.into());
3934 query = query.arg("value", value.into());
3935 Container {
3936 proc: self.proc.clone(),
3937 selection: query,
3938 graphql_client: self.graphql_client.clone(),
3939 }
3940 }
3941 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3948 let mut query = self.selection.select("withWorkdir");
3949 query = query.arg("path", path.into());
3950 Container {
3951 proc: self.proc.clone(),
3952 selection: query,
3953 graphql_client: self.graphql_client.clone(),
3954 }
3955 }
3956 pub fn with_workdir_opts(
3963 &self,
3964 path: impl Into<String>,
3965 opts: ContainerWithWorkdirOpts,
3966 ) -> Container {
3967 let mut query = self.selection.select("withWorkdir");
3968 query = query.arg("path", path.into());
3969 if let Some(expand) = opts.expand {
3970 query = query.arg("expand", expand);
3971 }
3972 Container {
3973 proc: self.proc.clone(),
3974 selection: query,
3975 graphql_client: self.graphql_client.clone(),
3976 }
3977 }
3978 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3984 let mut query = self.selection.select("withoutAnnotation");
3985 query = query.arg("name", name.into());
3986 Container {
3987 proc: self.proc.clone(),
3988 selection: query,
3989 graphql_client: self.graphql_client.clone(),
3990 }
3991 }
3992 pub fn without_default_args(&self) -> Container {
3994 let query = self.selection.select("withoutDefaultArgs");
3995 Container {
3996 proc: self.proc.clone(),
3997 selection: query,
3998 graphql_client: self.graphql_client.clone(),
3999 }
4000 }
4001 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4008 let mut query = self.selection.select("withoutDirectory");
4009 query = query.arg("path", path.into());
4010 Container {
4011 proc: self.proc.clone(),
4012 selection: query,
4013 graphql_client: self.graphql_client.clone(),
4014 }
4015 }
4016 pub fn without_directory_opts(
4023 &self,
4024 path: impl Into<String>,
4025 opts: ContainerWithoutDirectoryOpts,
4026 ) -> Container {
4027 let mut query = self.selection.select("withoutDirectory");
4028 query = query.arg("path", path.into());
4029 if let Some(expand) = opts.expand {
4030 query = query.arg("expand", expand);
4031 }
4032 Container {
4033 proc: self.proc.clone(),
4034 selection: query,
4035 graphql_client: self.graphql_client.clone(),
4036 }
4037 }
4038 pub fn without_docker_healthcheck(&self) -> Container {
4040 let query = self.selection.select("withoutDockerHealthcheck");
4041 Container {
4042 proc: self.proc.clone(),
4043 selection: query,
4044 graphql_client: self.graphql_client.clone(),
4045 }
4046 }
4047 pub fn without_entrypoint(&self) -> Container {
4053 let query = self.selection.select("withoutEntrypoint");
4054 Container {
4055 proc: self.proc.clone(),
4056 selection: query,
4057 graphql_client: self.graphql_client.clone(),
4058 }
4059 }
4060 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4066 let mut query = self.selection.select("withoutEntrypoint");
4067 if let Some(keep_default_args) = opts.keep_default_args {
4068 query = query.arg("keepDefaultArgs", keep_default_args);
4069 }
4070 Container {
4071 proc: self.proc.clone(),
4072 selection: query,
4073 graphql_client: self.graphql_client.clone(),
4074 }
4075 }
4076 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4082 let mut query = self.selection.select("withoutEnvVariable");
4083 query = query.arg("name", name.into());
4084 Container {
4085 proc: self.proc.clone(),
4086 selection: query,
4087 graphql_client: self.graphql_client.clone(),
4088 }
4089 }
4090 pub fn without_exposed_port(&self, port: isize) -> Container {
4097 let mut query = self.selection.select("withoutExposedPort");
4098 query = query.arg("port", port);
4099 Container {
4100 proc: self.proc.clone(),
4101 selection: query,
4102 graphql_client: self.graphql_client.clone(),
4103 }
4104 }
4105 pub fn without_exposed_port_opts(
4112 &self,
4113 port: isize,
4114 opts: ContainerWithoutExposedPortOpts,
4115 ) -> Container {
4116 let mut query = self.selection.select("withoutExposedPort");
4117 query = query.arg("port", port);
4118 if let Some(protocol) = opts.protocol {
4119 query = query.arg("protocol", protocol);
4120 }
4121 Container {
4122 proc: self.proc.clone(),
4123 selection: query,
4124 graphql_client: self.graphql_client.clone(),
4125 }
4126 }
4127 pub fn without_file(&self, path: impl Into<String>) -> Container {
4134 let mut query = self.selection.select("withoutFile");
4135 query = query.arg("path", path.into());
4136 Container {
4137 proc: self.proc.clone(),
4138 selection: query,
4139 graphql_client: self.graphql_client.clone(),
4140 }
4141 }
4142 pub fn without_file_opts(
4149 &self,
4150 path: impl Into<String>,
4151 opts: ContainerWithoutFileOpts,
4152 ) -> Container {
4153 let mut query = self.selection.select("withoutFile");
4154 query = query.arg("path", path.into());
4155 if let Some(expand) = opts.expand {
4156 query = query.arg("expand", expand);
4157 }
4158 Container {
4159 proc: self.proc.clone(),
4160 selection: query,
4161 graphql_client: self.graphql_client.clone(),
4162 }
4163 }
4164 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4171 let mut query = self.selection.select("withoutFiles");
4172 query = query.arg(
4173 "paths",
4174 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4175 );
4176 Container {
4177 proc: self.proc.clone(),
4178 selection: query,
4179 graphql_client: self.graphql_client.clone(),
4180 }
4181 }
4182 pub fn without_files_opts(
4189 &self,
4190 paths: Vec<impl Into<String>>,
4191 opts: ContainerWithoutFilesOpts,
4192 ) -> Container {
4193 let mut query = self.selection.select("withoutFiles");
4194 query = query.arg(
4195 "paths",
4196 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4197 );
4198 if let Some(expand) = opts.expand {
4199 query = query.arg("expand", expand);
4200 }
4201 Container {
4202 proc: self.proc.clone(),
4203 selection: query,
4204 graphql_client: self.graphql_client.clone(),
4205 }
4206 }
4207 pub fn without_label(&self, name: impl Into<String>) -> Container {
4213 let mut query = self.selection.select("withoutLabel");
4214 query = query.arg("name", name.into());
4215 Container {
4216 proc: self.proc.clone(),
4217 selection: query,
4218 graphql_client: self.graphql_client.clone(),
4219 }
4220 }
4221 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4228 let mut query = self.selection.select("withoutMount");
4229 query = query.arg("path", path.into());
4230 Container {
4231 proc: self.proc.clone(),
4232 selection: query,
4233 graphql_client: self.graphql_client.clone(),
4234 }
4235 }
4236 pub fn without_mount_opts(
4243 &self,
4244 path: impl Into<String>,
4245 opts: ContainerWithoutMountOpts,
4246 ) -> Container {
4247 let mut query = self.selection.select("withoutMount");
4248 query = query.arg("path", path.into());
4249 if let Some(expand) = opts.expand {
4250 query = query.arg("expand", expand);
4251 }
4252 Container {
4253 proc: self.proc.clone(),
4254 selection: query,
4255 graphql_client: self.graphql_client.clone(),
4256 }
4257 }
4258 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4266 let mut query = self.selection.select("withoutRegistryAuth");
4267 query = query.arg("address", address.into());
4268 Container {
4269 proc: self.proc.clone(),
4270 selection: query,
4271 graphql_client: self.graphql_client.clone(),
4272 }
4273 }
4274 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4280 let mut query = self.selection.select("withoutSecretVariable");
4281 query = query.arg("name", name.into());
4282 Container {
4283 proc: self.proc.clone(),
4284 selection: query,
4285 graphql_client: self.graphql_client.clone(),
4286 }
4287 }
4288 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4295 let mut query = self.selection.select("withoutUnixSocket");
4296 query = query.arg("path", path.into());
4297 Container {
4298 proc: self.proc.clone(),
4299 selection: query,
4300 graphql_client: self.graphql_client.clone(),
4301 }
4302 }
4303 pub fn without_unix_socket_opts(
4310 &self,
4311 path: impl Into<String>,
4312 opts: ContainerWithoutUnixSocketOpts,
4313 ) -> Container {
4314 let mut query = self.selection.select("withoutUnixSocket");
4315 query = query.arg("path", path.into());
4316 if let Some(expand) = opts.expand {
4317 query = query.arg("expand", expand);
4318 }
4319 Container {
4320 proc: self.proc.clone(),
4321 selection: query,
4322 graphql_client: self.graphql_client.clone(),
4323 }
4324 }
4325 pub fn without_user(&self) -> Container {
4328 let query = self.selection.select("withoutUser");
4329 Container {
4330 proc: self.proc.clone(),
4331 selection: query,
4332 graphql_client: self.graphql_client.clone(),
4333 }
4334 }
4335 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4341 let mut query = self.selection.select("withoutVolatileVariable");
4342 query = query.arg("name", name.into());
4343 Container {
4344 proc: self.proc.clone(),
4345 selection: query,
4346 graphql_client: self.graphql_client.clone(),
4347 }
4348 }
4349 pub fn without_workdir(&self) -> Container {
4352 let query = self.selection.select("withoutWorkdir");
4353 Container {
4354 proc: self.proc.clone(),
4355 selection: query,
4356 graphql_client: self.graphql_client.clone(),
4357 }
4358 }
4359 pub async fn workdir(&self) -> Result<String, DaggerError> {
4361 let query = self.selection.select("workdir");
4362 query.execute(self.graphql_client.clone()).await
4363 }
4364}
4365impl Exportable for Container {
4366 fn export(
4367 &self,
4368 path: impl Into<String>,
4369 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4370 let mut query = self.selection.select("export");
4371 query = query.arg("path", path.into());
4372 let graphql_client = self.graphql_client.clone();
4373 async move { query.execute(graphql_client).await }
4374 }
4375 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4376 let query = self.selection.select("id");
4377 let graphql_client = self.graphql_client.clone();
4378 async move { query.execute(graphql_client).await }
4379 }
4380}
4381impl Node for Container {
4382 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4383 let query = self.selection.select("id");
4384 let graphql_client = self.graphql_client.clone();
4385 async move { query.execute(graphql_client).await }
4386 }
4387}
4388impl Syncer for Container {
4389 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4390 let query = self.selection.select("id");
4391 let graphql_client = self.graphql_client.clone();
4392 async move { query.execute(graphql_client).await }
4393 }
4394 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4395 let query = self.selection.select("sync");
4396 let graphql_client = self.graphql_client.clone();
4397 async move { query.execute(graphql_client).await }
4398 }
4399}
4400#[derive(Clone)]
4401pub struct CurrentModule {
4402 pub proc: Option<Arc<DaggerSessionProc>>,
4403 pub selection: Selection,
4404 pub graphql_client: DynGraphQLClient,
4405}
4406#[derive(Builder, Debug, PartialEq)]
4407pub struct CurrentModuleGeneratorsOpts<'a> {
4408 #[builder(setter(into, strip_option), default)]
4410 pub include: Option<Vec<&'a str>>,
4411}
4412#[derive(Builder, Debug, PartialEq)]
4413pub struct CurrentModuleWorkdirOpts<'a> {
4414 #[builder(setter(into, strip_option), default)]
4416 pub exclude: Option<Vec<&'a str>>,
4417 #[builder(setter(into, strip_option), default)]
4419 pub gitignore: Option<bool>,
4420 #[builder(setter(into, strip_option), default)]
4422 pub include: Option<Vec<&'a str>>,
4423}
4424impl IntoID<Id> for CurrentModule {
4425 fn into_id(
4426 self,
4427 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4428 Box::pin(async move { self.id().await })
4429 }
4430}
4431impl Loadable for CurrentModule {
4432 fn graphql_type() -> &'static str {
4433 "CurrentModule"
4434 }
4435 fn from_query(
4436 proc: Option<Arc<DaggerSessionProc>>,
4437 selection: Selection,
4438 graphql_client: DynGraphQLClient,
4439 ) -> Self {
4440 Self {
4441 proc,
4442 selection,
4443 graphql_client,
4444 }
4445 }
4446}
4447impl CurrentModule {
4448 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4450 let query = self.selection.select("dependencies");
4451 let query = query.select("id");
4452 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4453 Ok(ids
4454 .into_iter()
4455 .map(|id| Module {
4456 proc: self.proc.clone(),
4457 selection: crate::querybuilder::query()
4458 .select("node")
4459 .arg("id", &id.0)
4460 .inline_fragment("Module"),
4461 graphql_client: self.graphql_client.clone(),
4462 })
4463 .collect())
4464 }
4465 pub fn generated_context_directory(&self) -> Directory {
4467 let query = self.selection.select("generatedContextDirectory");
4468 Directory {
4469 proc: self.proc.clone(),
4470 selection: query,
4471 graphql_client: self.graphql_client.clone(),
4472 }
4473 }
4474 pub fn generators(&self) -> GeneratorGroup {
4480 let query = self.selection.select("generators");
4481 GeneratorGroup {
4482 proc: self.proc.clone(),
4483 selection: query,
4484 graphql_client: self.graphql_client.clone(),
4485 }
4486 }
4487 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4493 let mut query = self.selection.select("generators");
4494 if let Some(include) = opts.include {
4495 query = query.arg("include", include);
4496 }
4497 GeneratorGroup {
4498 proc: self.proc.clone(),
4499 selection: query,
4500 graphql_client: self.graphql_client.clone(),
4501 }
4502 }
4503 pub async fn id(&self) -> Result<Id, DaggerError> {
4505 let query = self.selection.select("id");
4506 query.execute(self.graphql_client.clone()).await
4507 }
4508 pub async fn name(&self) -> Result<String, DaggerError> {
4510 let query = self.selection.select("name");
4511 query.execute(self.graphql_client.clone()).await
4512 }
4513 pub fn source(&self) -> Directory {
4515 let query = self.selection.select("source");
4516 Directory {
4517 proc: self.proc.clone(),
4518 selection: query,
4519 graphql_client: self.graphql_client.clone(),
4520 }
4521 }
4522 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4529 let mut query = self.selection.select("workdir");
4530 query = query.arg("path", path.into());
4531 Directory {
4532 proc: self.proc.clone(),
4533 selection: query,
4534 graphql_client: self.graphql_client.clone(),
4535 }
4536 }
4537 pub fn workdir_opts<'a>(
4544 &self,
4545 path: impl Into<String>,
4546 opts: CurrentModuleWorkdirOpts<'a>,
4547 ) -> Directory {
4548 let mut query = self.selection.select("workdir");
4549 query = query.arg("path", path.into());
4550 if let Some(exclude) = opts.exclude {
4551 query = query.arg("exclude", exclude);
4552 }
4553 if let Some(include) = opts.include {
4554 query = query.arg("include", include);
4555 }
4556 if let Some(gitignore) = opts.gitignore {
4557 query = query.arg("gitignore", gitignore);
4558 }
4559 Directory {
4560 proc: self.proc.clone(),
4561 selection: query,
4562 graphql_client: self.graphql_client.clone(),
4563 }
4564 }
4565 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4571 let mut query = self.selection.select("workdirFile");
4572 query = query.arg("path", path.into());
4573 File {
4574 proc: self.proc.clone(),
4575 selection: query,
4576 graphql_client: self.graphql_client.clone(),
4577 }
4578 }
4579}
4580impl Node for CurrentModule {
4581 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4582 let query = self.selection.select("id");
4583 let graphql_client = self.graphql_client.clone();
4584 async move { query.execute(graphql_client).await }
4585 }
4586}
4587#[derive(Clone)]
4588pub struct DiffStat {
4589 pub proc: Option<Arc<DaggerSessionProc>>,
4590 pub selection: Selection,
4591 pub graphql_client: DynGraphQLClient,
4592}
4593impl IntoID<Id> for DiffStat {
4594 fn into_id(
4595 self,
4596 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4597 Box::pin(async move { self.id().await })
4598 }
4599}
4600impl Loadable for DiffStat {
4601 fn graphql_type() -> &'static str {
4602 "DiffStat"
4603 }
4604 fn from_query(
4605 proc: Option<Arc<DaggerSessionProc>>,
4606 selection: Selection,
4607 graphql_client: DynGraphQLClient,
4608 ) -> Self {
4609 Self {
4610 proc,
4611 selection,
4612 graphql_client,
4613 }
4614 }
4615}
4616impl DiffStat {
4617 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4619 let query = self.selection.select("addedLines");
4620 query.execute(self.graphql_client.clone()).await
4621 }
4622 pub async fn id(&self) -> Result<Id, DaggerError> {
4624 let query = self.selection.select("id");
4625 query.execute(self.graphql_client.clone()).await
4626 }
4627 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4629 let query = self.selection.select("kind");
4630 query.execute(self.graphql_client.clone()).await
4631 }
4632 pub async fn old_path(&self) -> Result<String, DaggerError> {
4634 let query = self.selection.select("oldPath");
4635 query.execute(self.graphql_client.clone()).await
4636 }
4637 pub async fn path(&self) -> Result<String, DaggerError> {
4639 let query = self.selection.select("path");
4640 query.execute(self.graphql_client.clone()).await
4641 }
4642 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4644 let query = self.selection.select("removedLines");
4645 query.execute(self.graphql_client.clone()).await
4646 }
4647}
4648impl Node for DiffStat {
4649 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4650 let query = self.selection.select("id");
4651 let graphql_client = self.graphql_client.clone();
4652 async move { query.execute(graphql_client).await }
4653 }
4654}
4655#[derive(Clone)]
4656pub struct Directory {
4657 pub proc: Option<Arc<DaggerSessionProc>>,
4658 pub selection: Selection,
4659 pub graphql_client: DynGraphQLClient,
4660}
4661#[derive(Builder, Debug, PartialEq)]
4662pub struct DirectoryAsModuleOpts<'a> {
4663 #[builder(setter(into, strip_option), default)]
4666 pub source_root_path: Option<&'a str>,
4667}
4668#[derive(Builder, Debug, PartialEq)]
4669pub struct DirectoryAsModuleSourceOpts<'a> {
4670 #[builder(setter(into, strip_option), default)]
4673 pub source_root_path: Option<&'a str>,
4674}
4675#[derive(Builder, Debug, PartialEq)]
4676pub struct DirectoryAsWorkspaceOpts<'a> {
4677 #[builder(setter(into, strip_option), default)]
4679 pub cwd: Option<&'a str>,
4680}
4681#[derive(Builder, Debug, PartialEq)]
4682pub struct DirectoryDockerBuildOpts<'a> {
4683 #[builder(setter(into, strip_option), default)]
4685 pub build_args: Option<Vec<BuildArg>>,
4686 #[builder(setter(into, strip_option), default)]
4688 pub dockerfile: Option<&'a str>,
4689 #[builder(setter(into, strip_option), default)]
4692 pub no_init: Option<bool>,
4693 #[builder(setter(into, strip_option), default)]
4695 pub platform: Option<Platform>,
4696 #[builder(setter(into, strip_option), default)]
4699 pub secrets: Option<Vec<Id>>,
4700 #[builder(setter(into, strip_option), default)]
4704 pub ssh: Option<Id>,
4705 #[builder(setter(into, strip_option), default)]
4707 pub target: Option<&'a str>,
4708}
4709#[derive(Builder, Debug, PartialEq)]
4710pub struct DirectoryEntriesOpts<'a> {
4711 #[builder(setter(into, strip_option), default)]
4713 pub path: Option<&'a str>,
4714}
4715#[derive(Builder, Debug, PartialEq)]
4716pub struct DirectoryExistsOpts {
4717 #[builder(setter(into, strip_option), default)]
4719 pub do_not_follow_symlinks: Option<bool>,
4720 #[builder(setter(into, strip_option), default)]
4722 pub expected_type: Option<ExistsType>,
4723}
4724#[derive(Builder, Debug, PartialEq)]
4725pub struct DirectoryExportOpts {
4726 #[builder(setter(into, strip_option), default)]
4728 pub wipe: Option<bool>,
4729}
4730#[derive(Builder, Debug, PartialEq)]
4731pub struct DirectoryFilterOpts<'a> {
4732 #[builder(setter(into, strip_option), default)]
4734 pub exclude: Option<Vec<&'a str>>,
4735 #[builder(setter(into, strip_option), default)]
4737 pub gitignore: Option<bool>,
4738 #[builder(setter(into, strip_option), default)]
4740 pub include: Option<Vec<&'a str>>,
4741}
4742#[derive(Builder, Debug, PartialEq)]
4743pub struct DirectorySearchOpts<'a> {
4744 #[builder(setter(into, strip_option), default)]
4746 pub dotall: Option<bool>,
4747 #[builder(setter(into, strip_option), default)]
4749 pub files_only: Option<bool>,
4750 #[builder(setter(into, strip_option), default)]
4752 pub globs: Option<Vec<&'a str>>,
4753 #[builder(setter(into, strip_option), default)]
4755 pub insensitive: Option<bool>,
4756 #[builder(setter(into, strip_option), default)]
4758 pub limit: Option<isize>,
4759 #[builder(setter(into, strip_option), default)]
4761 pub literal: Option<bool>,
4762 #[builder(setter(into, strip_option), default)]
4764 pub multiline: Option<bool>,
4765 #[builder(setter(into, strip_option), default)]
4767 pub paths: Option<Vec<&'a str>>,
4768 #[builder(setter(into, strip_option), default)]
4770 pub skip_hidden: Option<bool>,
4771 #[builder(setter(into, strip_option), default)]
4773 pub skip_ignored: Option<bool>,
4774}
4775#[derive(Builder, Debug, PartialEq)]
4776pub struct DirectoryStatOpts {
4777 #[builder(setter(into, strip_option), default)]
4779 pub do_not_follow_symlinks: Option<bool>,
4780}
4781#[derive(Builder, Debug, PartialEq)]
4782pub struct DirectoryTerminalOpts<'a> {
4783 #[builder(setter(into, strip_option), default)]
4785 pub cmd: Option<Vec<&'a str>>,
4786 #[builder(setter(into, strip_option), default)]
4788 pub container: Option<Id>,
4789 #[builder(setter(into, strip_option), default)]
4791 pub experimental_privileged_nesting: Option<bool>,
4792 #[builder(setter(into, strip_option), default)]
4794 pub insecure_root_capabilities: Option<bool>,
4795}
4796#[derive(Builder, Debug, PartialEq)]
4797pub struct DirectoryWithDirectoryOpts<'a> {
4798 #[builder(setter(into, strip_option), default)]
4800 pub exclude: Option<Vec<&'a str>>,
4801 #[builder(setter(into, strip_option), default)]
4803 pub gitignore: Option<bool>,
4804 #[builder(setter(into, strip_option), default)]
4806 pub include: Option<Vec<&'a str>>,
4807 #[builder(setter(into, strip_option), default)]
4811 pub owner: Option<&'a str>,
4812 #[builder(setter(into, strip_option), default)]
4814 pub permissions: Option<isize>,
4815}
4816#[derive(Builder, Debug, PartialEq)]
4817pub struct DirectoryWithFileOpts<'a> {
4818 #[builder(setter(into, strip_option), default)]
4822 pub owner: Option<&'a str>,
4823 #[builder(setter(into, strip_option), default)]
4825 pub permissions: Option<isize>,
4826}
4827#[derive(Builder, Debug, PartialEq)]
4828pub struct DirectoryWithFilesOpts {
4829 #[builder(setter(into, strip_option), default)]
4831 pub permissions: Option<isize>,
4832}
4833#[derive(Builder, Debug, PartialEq)]
4834pub struct DirectoryWithNewDirectoryOpts {
4835 #[builder(setter(into, strip_option), default)]
4837 pub permissions: Option<isize>,
4838}
4839#[derive(Builder, Debug, PartialEq)]
4840pub struct DirectoryWithNewFileOpts {
4841 #[builder(setter(into, strip_option), default)]
4843 pub permissions: Option<isize>,
4844}
4845#[derive(Builder, Debug, PartialEq)]
4846pub struct DirectoryWithPatchOpts {
4847 #[builder(setter(into, strip_option), default)]
4849 pub on_conflict: Option<PatchConflict>,
4850}
4851#[derive(Builder, Debug, PartialEq)]
4852pub struct DirectoryWithPatchFileOpts {
4853 #[builder(setter(into, strip_option), default)]
4855 pub on_conflict: Option<PatchConflict>,
4856}
4857impl IntoID<Id> for Directory {
4858 fn into_id(
4859 self,
4860 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4861 Box::pin(async move { self.id().await })
4862 }
4863}
4864impl Loadable for Directory {
4865 fn graphql_type() -> &'static str {
4866 "Directory"
4867 }
4868 fn from_query(
4869 proc: Option<Arc<DaggerSessionProc>>,
4870 selection: Selection,
4871 graphql_client: DynGraphQLClient,
4872 ) -> Self {
4873 Self {
4874 proc,
4875 selection,
4876 graphql_client,
4877 }
4878 }
4879}
4880impl Directory {
4881 pub fn as_git(&self) -> GitRepository {
4883 let query = self.selection.select("asGit");
4884 GitRepository {
4885 proc: self.proc.clone(),
4886 selection: query,
4887 graphql_client: self.graphql_client.clone(),
4888 }
4889 }
4890 pub fn as_module(&self) -> Module {
4896 let query = self.selection.select("asModule");
4897 Module {
4898 proc: self.proc.clone(),
4899 selection: query,
4900 graphql_client: self.graphql_client.clone(),
4901 }
4902 }
4903 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4909 let mut query = self.selection.select("asModule");
4910 if let Some(source_root_path) = opts.source_root_path {
4911 query = query.arg("sourceRootPath", source_root_path);
4912 }
4913 Module {
4914 proc: self.proc.clone(),
4915 selection: query,
4916 graphql_client: self.graphql_client.clone(),
4917 }
4918 }
4919 pub fn as_module_source(&self) -> ModuleSource {
4925 let query = self.selection.select("asModuleSource");
4926 ModuleSource {
4927 proc: self.proc.clone(),
4928 selection: query,
4929 graphql_client: self.graphql_client.clone(),
4930 }
4931 }
4932 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4938 let mut query = self.selection.select("asModuleSource");
4939 if let Some(source_root_path) = opts.source_root_path {
4940 query = query.arg("sourceRootPath", source_root_path);
4941 }
4942 ModuleSource {
4943 proc: self.proc.clone(),
4944 selection: query,
4945 graphql_client: self.graphql_client.clone(),
4946 }
4947 }
4948 pub fn as_workspace(&self) -> Workspace {
4954 let query = self.selection.select("asWorkspace");
4955 Workspace {
4956 proc: self.proc.clone(),
4957 selection: query,
4958 graphql_client: self.graphql_client.clone(),
4959 }
4960 }
4961 pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
4967 let mut query = self.selection.select("asWorkspace");
4968 if let Some(cwd) = opts.cwd {
4969 query = query.arg("cwd", cwd);
4970 }
4971 Workspace {
4972 proc: self.proc.clone(),
4973 selection: query,
4974 graphql_client: self.graphql_client.clone(),
4975 }
4976 }
4977 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4984 let mut query = self.selection.select("changes");
4985 query = query.arg_lazy(
4986 "from",
4987 Box::new(move || {
4988 let from = from.clone();
4989 Box::pin(async move { from.into_id().await.unwrap().quote() })
4990 }),
4991 );
4992 Changeset {
4993 proc: self.proc.clone(),
4994 selection: query,
4995 graphql_client: self.graphql_client.clone(),
4996 }
4997 }
4998 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5009 let mut query = self.selection.select("chown");
5010 query = query.arg("path", path.into());
5011 query = query.arg("owner", owner.into());
5012 Directory {
5013 proc: self.proc.clone(),
5014 selection: query,
5015 graphql_client: self.graphql_client.clone(),
5016 }
5017 }
5018 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
5024 let mut query = self.selection.select("diff");
5025 query = query.arg_lazy(
5026 "other",
5027 Box::new(move || {
5028 let other = other.clone();
5029 Box::pin(async move { other.into_id().await.unwrap().quote() })
5030 }),
5031 );
5032 Directory {
5033 proc: self.proc.clone(),
5034 selection: query,
5035 graphql_client: self.graphql_client.clone(),
5036 }
5037 }
5038 pub async fn digest(&self) -> Result<String, DaggerError> {
5040 let query = self.selection.select("digest");
5041 query.execute(self.graphql_client.clone()).await
5042 }
5043 pub fn directory(&self, path: impl Into<String>) -> Directory {
5049 let mut query = self.selection.select("directory");
5050 query = query.arg("path", path.into());
5051 Directory {
5052 proc: self.proc.clone(),
5053 selection: query,
5054 graphql_client: self.graphql_client.clone(),
5055 }
5056 }
5057 pub fn docker_build(&self) -> Container {
5063 let query = self.selection.select("dockerBuild");
5064 Container {
5065 proc: self.proc.clone(),
5066 selection: query,
5067 graphql_client: self.graphql_client.clone(),
5068 }
5069 }
5070 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5076 let mut query = self.selection.select("dockerBuild");
5077 if let Some(dockerfile) = opts.dockerfile {
5078 query = query.arg("dockerfile", dockerfile);
5079 }
5080 if let Some(platform) = opts.platform {
5081 query = query.arg("platform", platform);
5082 }
5083 if let Some(build_args) = opts.build_args {
5084 query = query.arg("buildArgs", build_args);
5085 }
5086 if let Some(target) = opts.target {
5087 query = query.arg("target", target);
5088 }
5089 if let Some(secrets) = opts.secrets {
5090 query = query.arg("secrets", secrets);
5091 }
5092 if let Some(no_init) = opts.no_init {
5093 query = query.arg("noInit", no_init);
5094 }
5095 if let Some(ssh) = opts.ssh {
5096 query = query.arg("ssh", ssh);
5097 }
5098 Container {
5099 proc: self.proc.clone(),
5100 selection: query,
5101 graphql_client: self.graphql_client.clone(),
5102 }
5103 }
5104 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5110 let query = self.selection.select("entries");
5111 query.execute(self.graphql_client.clone()).await
5112 }
5113 pub async fn entries_opts<'a>(
5119 &self,
5120 opts: DirectoryEntriesOpts<'a>,
5121 ) -> Result<Vec<String>, DaggerError> {
5122 let mut query = self.selection.select("entries");
5123 if let Some(path) = opts.path {
5124 query = query.arg("path", path);
5125 }
5126 query.execute(self.graphql_client.clone()).await
5127 }
5128 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5135 let mut query = self.selection.select("exists");
5136 query = query.arg("path", path.into());
5137 query.execute(self.graphql_client.clone()).await
5138 }
5139 pub async fn exists_opts(
5146 &self,
5147 path: impl Into<String>,
5148 opts: DirectoryExistsOpts,
5149 ) -> Result<bool, DaggerError> {
5150 let mut query = self.selection.select("exists");
5151 query = query.arg("path", path.into());
5152 if let Some(expected_type) = opts.expected_type {
5153 query = query.arg("expectedType", expected_type);
5154 }
5155 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5156 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5157 }
5158 query.execute(self.graphql_client.clone()).await
5159 }
5160 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5167 let mut query = self.selection.select("export");
5168 query = query.arg("path", path.into());
5169 query.execute(self.graphql_client.clone()).await
5170 }
5171 pub async fn export_opts(
5178 &self,
5179 path: impl Into<String>,
5180 opts: DirectoryExportOpts,
5181 ) -> Result<String, DaggerError> {
5182 let mut query = self.selection.select("export");
5183 query = query.arg("path", path.into());
5184 if let Some(wipe) = opts.wipe {
5185 query = query.arg("wipe", wipe);
5186 }
5187 query.execute(self.graphql_client.clone()).await
5188 }
5189 pub fn file(&self, path: impl Into<String>) -> File {
5195 let mut query = self.selection.select("file");
5196 query = query.arg("path", path.into());
5197 File {
5198 proc: self.proc.clone(),
5199 selection: query,
5200 graphql_client: self.graphql_client.clone(),
5201 }
5202 }
5203 pub fn filter(&self) -> Directory {
5209 let query = self.selection.select("filter");
5210 Directory {
5211 proc: self.proc.clone(),
5212 selection: query,
5213 graphql_client: self.graphql_client.clone(),
5214 }
5215 }
5216 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5222 let mut query = self.selection.select("filter");
5223 if let Some(exclude) = opts.exclude {
5224 query = query.arg("exclude", exclude);
5225 }
5226 if let Some(include) = opts.include {
5227 query = query.arg("include", include);
5228 }
5229 if let Some(gitignore) = opts.gitignore {
5230 query = query.arg("gitignore", gitignore);
5231 }
5232 Directory {
5233 proc: self.proc.clone(),
5234 selection: query,
5235 graphql_client: self.graphql_client.clone(),
5236 }
5237 }
5238 pub async fn find_up(
5245 &self,
5246 name: impl Into<String>,
5247 start: impl Into<String>,
5248 ) -> Result<String, DaggerError> {
5249 let mut query = self.selection.select("findUp");
5250 query = query.arg("name", name.into());
5251 query = query.arg("start", start.into());
5252 query.execute(self.graphql_client.clone()).await
5253 }
5254 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5260 let mut query = self.selection.select("glob");
5261 query = query.arg("pattern", pattern.into());
5262 query.execute(self.graphql_client.clone()).await
5263 }
5264 pub async fn id(&self) -> Result<Id, DaggerError> {
5266 let query = self.selection.select("id");
5267 query.execute(self.graphql_client.clone()).await
5268 }
5269 pub async fn name(&self) -> Result<String, DaggerError> {
5271 let query = self.selection.select("name");
5272 query.execute(self.graphql_client.clone()).await
5273 }
5274 pub async fn search(
5282 &self,
5283 pattern: impl Into<String>,
5284 ) -> Result<Vec<SearchResult>, DaggerError> {
5285 let mut query = self.selection.select("search");
5286 query = query.arg("pattern", pattern.into());
5287 let query = query.select("id");
5288 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5289 Ok(ids
5290 .into_iter()
5291 .map(|id| SearchResult {
5292 proc: self.proc.clone(),
5293 selection: crate::querybuilder::query()
5294 .select("node")
5295 .arg("id", &id.0)
5296 .inline_fragment("SearchResult"),
5297 graphql_client: self.graphql_client.clone(),
5298 })
5299 .collect())
5300 }
5301 pub async fn search_opts<'a>(
5309 &self,
5310 pattern: impl Into<String>,
5311 opts: DirectorySearchOpts<'a>,
5312 ) -> Result<Vec<SearchResult>, DaggerError> {
5313 let mut query = self.selection.select("search");
5314 query = query.arg("pattern", pattern.into());
5315 if let Some(paths) = opts.paths {
5316 query = query.arg("paths", paths);
5317 }
5318 if let Some(globs) = opts.globs {
5319 query = query.arg("globs", globs);
5320 }
5321 if let Some(literal) = opts.literal {
5322 query = query.arg("literal", literal);
5323 }
5324 if let Some(multiline) = opts.multiline {
5325 query = query.arg("multiline", multiline);
5326 }
5327 if let Some(dotall) = opts.dotall {
5328 query = query.arg("dotall", dotall);
5329 }
5330 if let Some(insensitive) = opts.insensitive {
5331 query = query.arg("insensitive", insensitive);
5332 }
5333 if let Some(skip_ignored) = opts.skip_ignored {
5334 query = query.arg("skipIgnored", skip_ignored);
5335 }
5336 if let Some(skip_hidden) = opts.skip_hidden {
5337 query = query.arg("skipHidden", skip_hidden);
5338 }
5339 if let Some(files_only) = opts.files_only {
5340 query = query.arg("filesOnly", files_only);
5341 }
5342 if let Some(limit) = opts.limit {
5343 query = query.arg("limit", limit);
5344 }
5345 let query = query.select("id");
5346 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5347 Ok(ids
5348 .into_iter()
5349 .map(|id| SearchResult {
5350 proc: self.proc.clone(),
5351 selection: crate::querybuilder::query()
5352 .select("node")
5353 .arg("id", &id.0)
5354 .inline_fragment("SearchResult"),
5355 graphql_client: self.graphql_client.clone(),
5356 })
5357 .collect())
5358 }
5359 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5366 let mut query = self.selection.select("stat");
5367 query = query.arg("path", path.into());
5368 let query = query.select("id");
5369 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5370 Ok(id.map(|id| Stat {
5371 proc: self.proc.clone(),
5372 selection: query
5373 .root()
5374 .select("node")
5375 .arg("id", &id.0)
5376 .inline_fragment("Stat"),
5377 graphql_client: self.graphql_client.clone(),
5378 }))
5379 }
5380 pub async fn stat_opts(
5387 &self,
5388 path: impl Into<String>,
5389 opts: DirectoryStatOpts,
5390 ) -> Result<Option<Stat>, DaggerError> {
5391 let mut query = self.selection.select("stat");
5392 query = query.arg("path", path.into());
5393 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5394 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5395 }
5396 let query = query.select("id");
5397 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5398 Ok(id.map(|id| Stat {
5399 proc: self.proc.clone(),
5400 selection: query
5401 .root()
5402 .select("node")
5403 .arg("id", &id.0)
5404 .inline_fragment("Stat"),
5405 graphql_client: self.graphql_client.clone(),
5406 }))
5407 }
5408 pub async fn sync(&self) -> Result<Directory, DaggerError> {
5410 let query = self.selection.select("sync");
5411 let id: Id = query.execute(self.graphql_client.clone()).await?;
5412 Ok(Directory {
5413 proc: self.proc.clone(),
5414 selection: query
5415 .root()
5416 .select("node")
5417 .arg("id", &id.0)
5418 .inline_fragment("Directory"),
5419 graphql_client: self.graphql_client.clone(),
5420 })
5421 }
5422 pub fn terminal(&self) -> Directory {
5428 let query = self.selection.select("terminal");
5429 Directory {
5430 proc: self.proc.clone(),
5431 selection: query,
5432 graphql_client: self.graphql_client.clone(),
5433 }
5434 }
5435 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5441 let mut query = self.selection.select("terminal");
5442 if let Some(container) = opts.container {
5443 query = query.arg("container", container);
5444 }
5445 if let Some(cmd) = opts.cmd {
5446 query = query.arg("cmd", cmd);
5447 }
5448 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5449 query = query.arg(
5450 "experimentalPrivilegedNesting",
5451 experimental_privileged_nesting,
5452 );
5453 }
5454 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5455 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5456 }
5457 Directory {
5458 proc: self.proc.clone(),
5459 selection: query,
5460 graphql_client: self.graphql_client.clone(),
5461 }
5462 }
5463 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5469 let mut query = self.selection.select("withChanges");
5470 query = query.arg_lazy(
5471 "changes",
5472 Box::new(move || {
5473 let changes = changes.clone();
5474 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5475 }),
5476 );
5477 Directory {
5478 proc: self.proc.clone(),
5479 selection: query,
5480 graphql_client: self.graphql_client.clone(),
5481 }
5482 }
5483 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5491 let mut query = self.selection.select("withDirectory");
5492 query = query.arg("path", path.into());
5493 query = query.arg_lazy(
5494 "source",
5495 Box::new(move || {
5496 let source = source.clone();
5497 Box::pin(async move { source.into_id().await.unwrap().quote() })
5498 }),
5499 );
5500 Directory {
5501 proc: self.proc.clone(),
5502 selection: query,
5503 graphql_client: self.graphql_client.clone(),
5504 }
5505 }
5506 pub fn with_directory_opts<'a>(
5514 &self,
5515 path: impl Into<String>,
5516 source: impl IntoID<Id>,
5517 opts: DirectoryWithDirectoryOpts<'a>,
5518 ) -> Directory {
5519 let mut query = self.selection.select("withDirectory");
5520 query = query.arg("path", path.into());
5521 query = query.arg_lazy(
5522 "source",
5523 Box::new(move || {
5524 let source = source.clone();
5525 Box::pin(async move { source.into_id().await.unwrap().quote() })
5526 }),
5527 );
5528 if let Some(exclude) = opts.exclude {
5529 query = query.arg("exclude", exclude);
5530 }
5531 if let Some(include) = opts.include {
5532 query = query.arg("include", include);
5533 }
5534 if let Some(gitignore) = opts.gitignore {
5535 query = query.arg("gitignore", gitignore);
5536 }
5537 if let Some(owner) = opts.owner {
5538 query = query.arg("owner", owner);
5539 }
5540 if let Some(permissions) = opts.permissions {
5541 query = query.arg("permissions", permissions);
5542 }
5543 Directory {
5544 proc: self.proc.clone(),
5545 selection: query,
5546 graphql_client: self.graphql_client.clone(),
5547 }
5548 }
5549 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5555 let mut query = self.selection.select("withError");
5556 query = query.arg("err", err.into());
5557 Directory {
5558 proc: self.proc.clone(),
5559 selection: query,
5560 graphql_client: self.graphql_client.clone(),
5561 }
5562 }
5563 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5571 let mut query = self.selection.select("withFile");
5572 query = query.arg("path", path.into());
5573 query = query.arg_lazy(
5574 "source",
5575 Box::new(move || {
5576 let source = source.clone();
5577 Box::pin(async move { source.into_id().await.unwrap().quote() })
5578 }),
5579 );
5580 Directory {
5581 proc: self.proc.clone(),
5582 selection: query,
5583 graphql_client: self.graphql_client.clone(),
5584 }
5585 }
5586 pub fn with_file_opts<'a>(
5594 &self,
5595 path: impl Into<String>,
5596 source: impl IntoID<Id>,
5597 opts: DirectoryWithFileOpts<'a>,
5598 ) -> Directory {
5599 let mut query = self.selection.select("withFile");
5600 query = query.arg("path", path.into());
5601 query = query.arg_lazy(
5602 "source",
5603 Box::new(move || {
5604 let source = source.clone();
5605 Box::pin(async move { source.into_id().await.unwrap().quote() })
5606 }),
5607 );
5608 if let Some(permissions) = opts.permissions {
5609 query = query.arg("permissions", permissions);
5610 }
5611 if let Some(owner) = opts.owner {
5612 query = query.arg("owner", owner);
5613 }
5614 Directory {
5615 proc: self.proc.clone(),
5616 selection: query,
5617 graphql_client: self.graphql_client.clone(),
5618 }
5619 }
5620 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5628 let mut query = self.selection.select("withFiles");
5629 query = query.arg("path", path.into());
5630 query = query.arg("sources", sources);
5631 Directory {
5632 proc: self.proc.clone(),
5633 selection: query,
5634 graphql_client: self.graphql_client.clone(),
5635 }
5636 }
5637 pub fn with_files_opts(
5645 &self,
5646 path: impl Into<String>,
5647 sources: Vec<Id>,
5648 opts: DirectoryWithFilesOpts,
5649 ) -> Directory {
5650 let mut query = self.selection.select("withFiles");
5651 query = query.arg("path", path.into());
5652 query = query.arg("sources", sources);
5653 if let Some(permissions) = opts.permissions {
5654 query = query.arg("permissions", permissions);
5655 }
5656 Directory {
5657 proc: self.proc.clone(),
5658 selection: query,
5659 graphql_client: self.graphql_client.clone(),
5660 }
5661 }
5662 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5669 let mut query = self.selection.select("withNewDirectory");
5670 query = query.arg("path", path.into());
5671 Directory {
5672 proc: self.proc.clone(),
5673 selection: query,
5674 graphql_client: self.graphql_client.clone(),
5675 }
5676 }
5677 pub fn with_new_directory_opts(
5684 &self,
5685 path: impl Into<String>,
5686 opts: DirectoryWithNewDirectoryOpts,
5687 ) -> Directory {
5688 let mut query = self.selection.select("withNewDirectory");
5689 query = query.arg("path", path.into());
5690 if let Some(permissions) = opts.permissions {
5691 query = query.arg("permissions", permissions);
5692 }
5693 Directory {
5694 proc: self.proc.clone(),
5695 selection: query,
5696 graphql_client: self.graphql_client.clone(),
5697 }
5698 }
5699 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5707 let mut query = self.selection.select("withNewFile");
5708 query = query.arg("path", path.into());
5709 query = query.arg("contents", contents.into());
5710 Directory {
5711 proc: self.proc.clone(),
5712 selection: query,
5713 graphql_client: self.graphql_client.clone(),
5714 }
5715 }
5716 pub fn with_new_file_opts(
5724 &self,
5725 path: impl Into<String>,
5726 contents: impl Into<String>,
5727 opts: DirectoryWithNewFileOpts,
5728 ) -> Directory {
5729 let mut query = self.selection.select("withNewFile");
5730 query = query.arg("path", path.into());
5731 query = query.arg("contents", contents.into());
5732 if let Some(permissions) = opts.permissions {
5733 query = query.arg("permissions", permissions);
5734 }
5735 Directory {
5736 proc: self.proc.clone(),
5737 selection: query,
5738 graphql_client: self.graphql_client.clone(),
5739 }
5740 }
5741 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5748 let mut query = self.selection.select("withPatch");
5749 query = query.arg("patch", patch.into());
5750 Directory {
5751 proc: self.proc.clone(),
5752 selection: query,
5753 graphql_client: self.graphql_client.clone(),
5754 }
5755 }
5756 pub fn with_patch_opts(
5763 &self,
5764 patch: impl Into<String>,
5765 opts: DirectoryWithPatchOpts,
5766 ) -> Directory {
5767 let mut query = self.selection.select("withPatch");
5768 query = query.arg("patch", patch.into());
5769 if let Some(on_conflict) = opts.on_conflict {
5770 query = query.arg("onConflict", on_conflict);
5771 }
5772 Directory {
5773 proc: self.proc.clone(),
5774 selection: query,
5775 graphql_client: self.graphql_client.clone(),
5776 }
5777 }
5778 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5785 let mut query = self.selection.select("withPatchFile");
5786 query = query.arg_lazy(
5787 "patch",
5788 Box::new(move || {
5789 let patch = patch.clone();
5790 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5791 }),
5792 );
5793 Directory {
5794 proc: self.proc.clone(),
5795 selection: query,
5796 graphql_client: self.graphql_client.clone(),
5797 }
5798 }
5799 pub fn with_patch_file_opts(
5806 &self,
5807 patch: impl IntoID<Id>,
5808 opts: DirectoryWithPatchFileOpts,
5809 ) -> Directory {
5810 let mut query = self.selection.select("withPatchFile");
5811 query = query.arg_lazy(
5812 "patch",
5813 Box::new(move || {
5814 let patch = patch.clone();
5815 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5816 }),
5817 );
5818 if let Some(on_conflict) = opts.on_conflict {
5819 query = query.arg("onConflict", on_conflict);
5820 }
5821 Directory {
5822 proc: self.proc.clone(),
5823 selection: query,
5824 graphql_client: self.graphql_client.clone(),
5825 }
5826 }
5827 pub fn with_symlink(
5834 &self,
5835 target: impl Into<String>,
5836 link_name: impl Into<String>,
5837 ) -> Directory {
5838 let mut query = self.selection.select("withSymlink");
5839 query = query.arg("target", target.into());
5840 query = query.arg("linkName", link_name.into());
5841 Directory {
5842 proc: self.proc.clone(),
5843 selection: query,
5844 graphql_client: self.graphql_client.clone(),
5845 }
5846 }
5847 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5855 let mut query = self.selection.select("withTimestamps");
5856 query = query.arg("timestamp", timestamp);
5857 Directory {
5858 proc: self.proc.clone(),
5859 selection: query,
5860 graphql_client: self.graphql_client.clone(),
5861 }
5862 }
5863 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5869 let mut query = self.selection.select("withoutDirectory");
5870 query = query.arg("path", path.into());
5871 Directory {
5872 proc: self.proc.clone(),
5873 selection: query,
5874 graphql_client: self.graphql_client.clone(),
5875 }
5876 }
5877 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5883 let mut query = self.selection.select("withoutFile");
5884 query = query.arg("path", path.into());
5885 Directory {
5886 proc: self.proc.clone(),
5887 selection: query,
5888 graphql_client: self.graphql_client.clone(),
5889 }
5890 }
5891 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5897 let mut query = self.selection.select("withoutFiles");
5898 query = query.arg(
5899 "paths",
5900 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5901 );
5902 Directory {
5903 proc: self.proc.clone(),
5904 selection: query,
5905 graphql_client: self.graphql_client.clone(),
5906 }
5907 }
5908}
5909impl Exportable for Directory {
5910 fn export(
5911 &self,
5912 path: impl Into<String>,
5913 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5914 let mut query = self.selection.select("export");
5915 query = query.arg("path", path.into());
5916 let graphql_client = self.graphql_client.clone();
5917 async move { query.execute(graphql_client).await }
5918 }
5919 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5920 let query = self.selection.select("id");
5921 let graphql_client = self.graphql_client.clone();
5922 async move { query.execute(graphql_client).await }
5923 }
5924}
5925impl Node for Directory {
5926 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5927 let query = self.selection.select("id");
5928 let graphql_client = self.graphql_client.clone();
5929 async move { query.execute(graphql_client).await }
5930 }
5931}
5932impl Syncer for Directory {
5933 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5934 let query = self.selection.select("id");
5935 let graphql_client = self.graphql_client.clone();
5936 async move { query.execute(graphql_client).await }
5937 }
5938 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5939 let query = self.selection.select("sync");
5940 let graphql_client = self.graphql_client.clone();
5941 async move { query.execute(graphql_client).await }
5942 }
5943}
5944#[derive(Clone)]
5945pub struct Engine {
5946 pub proc: Option<Arc<DaggerSessionProc>>,
5947 pub selection: Selection,
5948 pub graphql_client: DynGraphQLClient,
5949}
5950impl IntoID<Id> for Engine {
5951 fn into_id(
5952 self,
5953 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5954 Box::pin(async move { self.id().await })
5955 }
5956}
5957impl Loadable for Engine {
5958 fn graphql_type() -> &'static str {
5959 "Engine"
5960 }
5961 fn from_query(
5962 proc: Option<Arc<DaggerSessionProc>>,
5963 selection: Selection,
5964 graphql_client: DynGraphQLClient,
5965 ) -> Self {
5966 Self {
5967 proc,
5968 selection,
5969 graphql_client,
5970 }
5971 }
5972}
5973impl Engine {
5974 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5976 let query = self.selection.select("clients");
5977 query.execute(self.graphql_client.clone()).await
5978 }
5979 pub async fn id(&self) -> Result<Id, DaggerError> {
5981 let query = self.selection.select("id");
5982 query.execute(self.graphql_client.clone()).await
5983 }
5984 pub fn local_cache(&self) -> EngineCache {
5986 let query = self.selection.select("localCache");
5987 EngineCache {
5988 proc: self.proc.clone(),
5989 selection: query,
5990 graphql_client: self.graphql_client.clone(),
5991 }
5992 }
5993 pub async fn name(&self) -> Result<String, DaggerError> {
5995 let query = self.selection.select("name");
5996 query.execute(self.graphql_client.clone()).await
5997 }
5998}
5999impl Node for Engine {
6000 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6001 let query = self.selection.select("id");
6002 let graphql_client = self.graphql_client.clone();
6003 async move { query.execute(graphql_client).await }
6004 }
6005}
6006#[derive(Clone)]
6007pub struct EngineCache {
6008 pub proc: Option<Arc<DaggerSessionProc>>,
6009 pub selection: Selection,
6010 pub graphql_client: DynGraphQLClient,
6011}
6012#[derive(Builder, Debug, PartialEq)]
6013pub struct EngineCacheEntrySetOpts<'a> {
6014 #[builder(setter(into, strip_option), default)]
6015 pub key: Option<&'a str>,
6016}
6017#[derive(Builder, Debug, PartialEq)]
6018pub struct EngineCachePruneOpts<'a> {
6019 #[builder(setter(into, strip_option), default)]
6021 pub max_estimated_bytes: Option<isize>,
6022 #[builder(setter(into, strip_option), default)]
6024 pub max_used_space: Option<&'a str>,
6025 #[builder(setter(into, strip_option), default)]
6027 pub min_free_space: Option<&'a str>,
6028 #[builder(setter(into, strip_option), default)]
6030 pub reserved_space: Option<&'a str>,
6031 #[builder(setter(into, strip_option), default)]
6033 pub target_estimated_bytes: Option<isize>,
6034 #[builder(setter(into, strip_option), default)]
6036 pub target_space: Option<&'a str>,
6037 #[builder(setter(into, strip_option), default)]
6039 pub use_default_policy: Option<bool>,
6040}
6041impl IntoID<Id> for EngineCache {
6042 fn into_id(
6043 self,
6044 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6045 Box::pin(async move { self.id().await })
6046 }
6047}
6048impl Loadable for EngineCache {
6049 fn graphql_type() -> &'static str {
6050 "EngineCache"
6051 }
6052 fn from_query(
6053 proc: Option<Arc<DaggerSessionProc>>,
6054 selection: Selection,
6055 graphql_client: DynGraphQLClient,
6056 ) -> Self {
6057 Self {
6058 proc,
6059 selection,
6060 graphql_client,
6061 }
6062 }
6063}
6064impl EngineCache {
6065 pub fn entry_set(&self) -> EngineCacheEntrySet {
6071 let query = self.selection.select("entrySet");
6072 EngineCacheEntrySet {
6073 proc: self.proc.clone(),
6074 selection: query,
6075 graphql_client: self.graphql_client.clone(),
6076 }
6077 }
6078 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6084 let mut query = self.selection.select("entrySet");
6085 if let Some(key) = opts.key {
6086 query = query.arg("key", key);
6087 }
6088 EngineCacheEntrySet {
6089 proc: self.proc.clone(),
6090 selection: query,
6091 graphql_client: self.graphql_client.clone(),
6092 }
6093 }
6094 pub async fn id(&self) -> Result<Id, DaggerError> {
6096 let query = self.selection.select("id");
6097 query.execute(self.graphql_client.clone()).await
6098 }
6099 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6101 let query = self.selection.select("maxUsedSpace");
6102 query.execute(self.graphql_client.clone()).await
6103 }
6104 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6106 let query = self.selection.select("minFreeSpace");
6107 query.execute(self.graphql_client.clone()).await
6108 }
6109 pub async fn prune(&self) -> Result<Void, DaggerError> {
6115 let query = self.selection.select("prune");
6116 query.execute(self.graphql_client.clone()).await
6117 }
6118 pub async fn prune_opts<'a>(
6124 &self,
6125 opts: EngineCachePruneOpts<'a>,
6126 ) -> Result<Void, DaggerError> {
6127 let mut query = self.selection.select("prune");
6128 if let Some(use_default_policy) = opts.use_default_policy {
6129 query = query.arg("useDefaultPolicy", use_default_policy);
6130 }
6131 if let Some(max_used_space) = opts.max_used_space {
6132 query = query.arg("maxUsedSpace", max_used_space);
6133 }
6134 if let Some(reserved_space) = opts.reserved_space {
6135 query = query.arg("reservedSpace", reserved_space);
6136 }
6137 if let Some(min_free_space) = opts.min_free_space {
6138 query = query.arg("minFreeSpace", min_free_space);
6139 }
6140 if let Some(target_space) = opts.target_space {
6141 query = query.arg("targetSpace", target_space);
6142 }
6143 if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
6144 query = query.arg("maxEstimatedBytes", max_estimated_bytes);
6145 }
6146 if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
6147 query = query.arg("targetEstimatedBytes", target_estimated_bytes);
6148 }
6149 query.execute(self.graphql_client.clone()).await
6150 }
6151 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6153 let query = self.selection.select("reservedSpace");
6154 query.execute(self.graphql_client.clone()).await
6155 }
6156 pub async fn target_space(&self) -> Result<isize, DaggerError> {
6158 let query = self.selection.select("targetSpace");
6159 query.execute(self.graphql_client.clone()).await
6160 }
6161}
6162impl Node for EngineCache {
6163 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6164 let query = self.selection.select("id");
6165 let graphql_client = self.graphql_client.clone();
6166 async move { query.execute(graphql_client).await }
6167 }
6168}
6169#[derive(Clone)]
6170pub struct EngineCacheEntry {
6171 pub proc: Option<Arc<DaggerSessionProc>>,
6172 pub selection: Selection,
6173 pub graphql_client: DynGraphQLClient,
6174}
6175impl IntoID<Id> for EngineCacheEntry {
6176 fn into_id(
6177 self,
6178 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6179 Box::pin(async move { self.id().await })
6180 }
6181}
6182impl Loadable for EngineCacheEntry {
6183 fn graphql_type() -> &'static str {
6184 "EngineCacheEntry"
6185 }
6186 fn from_query(
6187 proc: Option<Arc<DaggerSessionProc>>,
6188 selection: Selection,
6189 graphql_client: DynGraphQLClient,
6190 ) -> Self {
6191 Self {
6192 proc,
6193 selection,
6194 graphql_client,
6195 }
6196 }
6197}
6198impl EngineCacheEntry {
6199 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6201 let query = self.selection.select("activelyUsed");
6202 query.execute(self.graphql_client.clone()).await
6203 }
6204 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6206 let query = self.selection.select("createdTimeUnixNano");
6207 query.execute(self.graphql_client.clone()).await
6208 }
6209 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
6211 let query = self.selection.select("dagqlCall");
6212 query.execute(self.graphql_client.clone()).await
6213 }
6214 pub async fn description(&self) -> Result<String, DaggerError> {
6216 let query = self.selection.select("description");
6217 query.execute(self.graphql_client.clone()).await
6218 }
6219 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6221 let query = self.selection.select("diskSpaceBytes");
6222 query.execute(self.graphql_client.clone()).await
6223 }
6224 pub async fn id(&self) -> Result<Id, DaggerError> {
6226 let query = self.selection.select("id");
6227 query.execute(self.graphql_client.clone()).await
6228 }
6229 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6231 let query = self.selection.select("mostRecentUseTimeUnixNano");
6232 query.execute(self.graphql_client.clone()).await
6233 }
6234 pub async fn record_type(&self) -> Result<String, DaggerError> {
6236 let query = self.selection.select("recordType");
6237 query.execute(self.graphql_client.clone()).await
6238 }
6239 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
6241 let query = self.selection.select("recordTypes");
6242 query.execute(self.graphql_client.clone()).await
6243 }
6244}
6245impl Node for EngineCacheEntry {
6246 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6247 let query = self.selection.select("id");
6248 let graphql_client = self.graphql_client.clone();
6249 async move { query.execute(graphql_client).await }
6250 }
6251}
6252#[derive(Clone)]
6253pub struct EngineCacheEntrySet {
6254 pub proc: Option<Arc<DaggerSessionProc>>,
6255 pub selection: Selection,
6256 pub graphql_client: DynGraphQLClient,
6257}
6258impl IntoID<Id> for EngineCacheEntrySet {
6259 fn into_id(
6260 self,
6261 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6262 Box::pin(async move { self.id().await })
6263 }
6264}
6265impl Loadable for EngineCacheEntrySet {
6266 fn graphql_type() -> &'static str {
6267 "EngineCacheEntrySet"
6268 }
6269 fn from_query(
6270 proc: Option<Arc<DaggerSessionProc>>,
6271 selection: Selection,
6272 graphql_client: DynGraphQLClient,
6273 ) -> Self {
6274 Self {
6275 proc,
6276 selection,
6277 graphql_client,
6278 }
6279 }
6280}
6281impl EngineCacheEntrySet {
6282 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6284 let query = self.selection.select("diskSpaceBytes");
6285 query.execute(self.graphql_client.clone()).await
6286 }
6287 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6289 let query = self.selection.select("entries");
6290 let query = query.select("id");
6291 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6292 Ok(ids
6293 .into_iter()
6294 .map(|id| EngineCacheEntry {
6295 proc: self.proc.clone(),
6296 selection: crate::querybuilder::query()
6297 .select("node")
6298 .arg("id", &id.0)
6299 .inline_fragment("EngineCacheEntry"),
6300 graphql_client: self.graphql_client.clone(),
6301 })
6302 .collect())
6303 }
6304 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6306 let query = self.selection.select("entryCount");
6307 query.execute(self.graphql_client.clone()).await
6308 }
6309 pub async fn id(&self) -> Result<Id, DaggerError> {
6311 let query = self.selection.select("id");
6312 query.execute(self.graphql_client.clone()).await
6313 }
6314}
6315impl Node for EngineCacheEntrySet {
6316 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6317 let query = self.selection.select("id");
6318 let graphql_client = self.graphql_client.clone();
6319 async move { query.execute(graphql_client).await }
6320 }
6321}
6322#[derive(Clone)]
6323pub struct EnumTypeDef {
6324 pub proc: Option<Arc<DaggerSessionProc>>,
6325 pub selection: Selection,
6326 pub graphql_client: DynGraphQLClient,
6327}
6328impl IntoID<Id> for EnumTypeDef {
6329 fn into_id(
6330 self,
6331 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6332 Box::pin(async move { self.id().await })
6333 }
6334}
6335impl Loadable for EnumTypeDef {
6336 fn graphql_type() -> &'static str {
6337 "EnumTypeDef"
6338 }
6339 fn from_query(
6340 proc: Option<Arc<DaggerSessionProc>>,
6341 selection: Selection,
6342 graphql_client: DynGraphQLClient,
6343 ) -> Self {
6344 Self {
6345 proc,
6346 selection,
6347 graphql_client,
6348 }
6349 }
6350}
6351impl EnumTypeDef {
6352 pub async fn description(&self) -> Result<String, DaggerError> {
6354 let query = self.selection.select("description");
6355 query.execute(self.graphql_client.clone()).await
6356 }
6357 pub async fn id(&self) -> Result<Id, DaggerError> {
6359 let query = self.selection.select("id");
6360 query.execute(self.graphql_client.clone()).await
6361 }
6362 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6364 let query = self.selection.select("members");
6365 let query = query.select("id");
6366 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6367 Ok(ids
6368 .into_iter()
6369 .map(|id| EnumValueTypeDef {
6370 proc: self.proc.clone(),
6371 selection: crate::querybuilder::query()
6372 .select("node")
6373 .arg("id", &id.0)
6374 .inline_fragment("EnumValueTypeDef"),
6375 graphql_client: self.graphql_client.clone(),
6376 })
6377 .collect())
6378 }
6379 pub async fn name(&self) -> Result<String, DaggerError> {
6381 let query = self.selection.select("name");
6382 query.execute(self.graphql_client.clone()).await
6383 }
6384 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6386 let query = self.selection.select("sourceMap");
6387 let query = query.select("id");
6388 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6389 Ok(id.map(|id| SourceMap {
6390 proc: self.proc.clone(),
6391 selection: query
6392 .root()
6393 .select("node")
6394 .arg("id", &id.0)
6395 .inline_fragment("SourceMap"),
6396 graphql_client: self.graphql_client.clone(),
6397 }))
6398 }
6399 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6401 let query = self.selection.select("sourceModuleName");
6402 query.execute(self.graphql_client.clone()).await
6403 }
6404 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6406 let query = self.selection.select("values");
6407 let query = query.select("id");
6408 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6409 Ok(ids
6410 .into_iter()
6411 .map(|id| EnumValueTypeDef {
6412 proc: self.proc.clone(),
6413 selection: crate::querybuilder::query()
6414 .select("node")
6415 .arg("id", &id.0)
6416 .inline_fragment("EnumValueTypeDef"),
6417 graphql_client: self.graphql_client.clone(),
6418 })
6419 .collect())
6420 }
6421}
6422impl Node for EnumTypeDef {
6423 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6424 let query = self.selection.select("id");
6425 let graphql_client = self.graphql_client.clone();
6426 async move { query.execute(graphql_client).await }
6427 }
6428}
6429#[derive(Clone)]
6430pub struct EnumValueTypeDef {
6431 pub proc: Option<Arc<DaggerSessionProc>>,
6432 pub selection: Selection,
6433 pub graphql_client: DynGraphQLClient,
6434}
6435impl IntoID<Id> for EnumValueTypeDef {
6436 fn into_id(
6437 self,
6438 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6439 Box::pin(async move { self.id().await })
6440 }
6441}
6442impl Loadable for EnumValueTypeDef {
6443 fn graphql_type() -> &'static str {
6444 "EnumValueTypeDef"
6445 }
6446 fn from_query(
6447 proc: Option<Arc<DaggerSessionProc>>,
6448 selection: Selection,
6449 graphql_client: DynGraphQLClient,
6450 ) -> Self {
6451 Self {
6452 proc,
6453 selection,
6454 graphql_client,
6455 }
6456 }
6457}
6458impl EnumValueTypeDef {
6459 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6461 let query = self.selection.select("deprecated");
6462 query.execute(self.graphql_client.clone()).await
6463 }
6464 pub async fn description(&self) -> Result<String, DaggerError> {
6466 let query = self.selection.select("description");
6467 query.execute(self.graphql_client.clone()).await
6468 }
6469 pub async fn id(&self) -> Result<Id, DaggerError> {
6471 let query = self.selection.select("id");
6472 query.execute(self.graphql_client.clone()).await
6473 }
6474 pub async fn name(&self) -> Result<String, DaggerError> {
6476 let query = self.selection.select("name");
6477 query.execute(self.graphql_client.clone()).await
6478 }
6479 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6481 let query = self.selection.select("sourceMap");
6482 let query = query.select("id");
6483 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6484 Ok(id.map(|id| SourceMap {
6485 proc: self.proc.clone(),
6486 selection: query
6487 .root()
6488 .select("node")
6489 .arg("id", &id.0)
6490 .inline_fragment("SourceMap"),
6491 graphql_client: self.graphql_client.clone(),
6492 }))
6493 }
6494 pub async fn value(&self) -> Result<String, DaggerError> {
6496 let query = self.selection.select("value");
6497 query.execute(self.graphql_client.clone()).await
6498 }
6499}
6500impl Node for EnumValueTypeDef {
6501 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6502 let query = self.selection.select("id");
6503 let graphql_client = self.graphql_client.clone();
6504 async move { query.execute(graphql_client).await }
6505 }
6506}
6507#[derive(Clone)]
6508pub struct EnvFile {
6509 pub proc: Option<Arc<DaggerSessionProc>>,
6510 pub selection: Selection,
6511 pub graphql_client: DynGraphQLClient,
6512}
6513#[derive(Builder, Debug, PartialEq)]
6514pub struct EnvFileGetOpts {
6515 #[builder(setter(into, strip_option), default)]
6517 pub raw: Option<bool>,
6518}
6519#[derive(Builder, Debug, PartialEq)]
6520pub struct EnvFileVariablesOpts {
6521 #[builder(setter(into, strip_option), default)]
6523 pub raw: Option<bool>,
6524}
6525impl IntoID<Id> for EnvFile {
6526 fn into_id(
6527 self,
6528 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6529 Box::pin(async move { self.id().await })
6530 }
6531}
6532impl Loadable for EnvFile {
6533 fn graphql_type() -> &'static str {
6534 "EnvFile"
6535 }
6536 fn from_query(
6537 proc: Option<Arc<DaggerSessionProc>>,
6538 selection: Selection,
6539 graphql_client: DynGraphQLClient,
6540 ) -> Self {
6541 Self {
6542 proc,
6543 selection,
6544 graphql_client,
6545 }
6546 }
6547}
6548impl EnvFile {
6549 pub fn as_file(&self) -> File {
6551 let query = self.selection.select("asFile");
6552 File {
6553 proc: self.proc.clone(),
6554 selection: query,
6555 graphql_client: self.graphql_client.clone(),
6556 }
6557 }
6558 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
6564 let mut query = self.selection.select("exists");
6565 query = query.arg("name", name.into());
6566 query.execute(self.graphql_client.clone()).await
6567 }
6568 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
6575 let mut query = self.selection.select("get");
6576 query = query.arg("name", name.into());
6577 query.execute(self.graphql_client.clone()).await
6578 }
6579 pub async fn get_opts(
6586 &self,
6587 name: impl Into<String>,
6588 opts: EnvFileGetOpts,
6589 ) -> Result<String, DaggerError> {
6590 let mut query = self.selection.select("get");
6591 query = query.arg("name", name.into());
6592 if let Some(raw) = opts.raw {
6593 query = query.arg("raw", raw);
6594 }
6595 query.execute(self.graphql_client.clone()).await
6596 }
6597 pub async fn id(&self) -> Result<Id, DaggerError> {
6599 let query = self.selection.select("id");
6600 query.execute(self.graphql_client.clone()).await
6601 }
6602 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
6608 let mut query = self.selection.select("namespace");
6609 query = query.arg("prefix", prefix.into());
6610 EnvFile {
6611 proc: self.proc.clone(),
6612 selection: query,
6613 graphql_client: self.graphql_client.clone(),
6614 }
6615 }
6616 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
6622 let query = self.selection.select("variables");
6623 let query = query.select("id");
6624 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6625 Ok(ids
6626 .into_iter()
6627 .map(|id| EnvVariable {
6628 proc: self.proc.clone(),
6629 selection: crate::querybuilder::query()
6630 .select("node")
6631 .arg("id", &id.0)
6632 .inline_fragment("EnvVariable"),
6633 graphql_client: self.graphql_client.clone(),
6634 })
6635 .collect())
6636 }
6637 pub async fn variables_opts(
6643 &self,
6644 opts: EnvFileVariablesOpts,
6645 ) -> Result<Vec<EnvVariable>, DaggerError> {
6646 let mut query = self.selection.select("variables");
6647 if let Some(raw) = opts.raw {
6648 query = query.arg("raw", raw);
6649 }
6650 let query = query.select("id");
6651 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6652 Ok(ids
6653 .into_iter()
6654 .map(|id| EnvVariable {
6655 proc: self.proc.clone(),
6656 selection: crate::querybuilder::query()
6657 .select("node")
6658 .arg("id", &id.0)
6659 .inline_fragment("EnvVariable"),
6660 graphql_client: self.graphql_client.clone(),
6661 })
6662 .collect())
6663 }
6664 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
6671 let mut query = self.selection.select("withVariable");
6672 query = query.arg("name", name.into());
6673 query = query.arg("value", value.into());
6674 EnvFile {
6675 proc: self.proc.clone(),
6676 selection: query,
6677 graphql_client: self.graphql_client.clone(),
6678 }
6679 }
6680 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
6686 let mut query = self.selection.select("withoutVariable");
6687 query = query.arg("name", name.into());
6688 EnvFile {
6689 proc: self.proc.clone(),
6690 selection: query,
6691 graphql_client: self.graphql_client.clone(),
6692 }
6693 }
6694}
6695impl Node for EnvFile {
6696 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6697 let query = self.selection.select("id");
6698 let graphql_client = self.graphql_client.clone();
6699 async move { query.execute(graphql_client).await }
6700 }
6701}
6702#[derive(Clone)]
6703pub struct EnvVariable {
6704 pub proc: Option<Arc<DaggerSessionProc>>,
6705 pub selection: Selection,
6706 pub graphql_client: DynGraphQLClient,
6707}
6708impl IntoID<Id> for EnvVariable {
6709 fn into_id(
6710 self,
6711 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6712 Box::pin(async move { self.id().await })
6713 }
6714}
6715impl Loadable for EnvVariable {
6716 fn graphql_type() -> &'static str {
6717 "EnvVariable"
6718 }
6719 fn from_query(
6720 proc: Option<Arc<DaggerSessionProc>>,
6721 selection: Selection,
6722 graphql_client: DynGraphQLClient,
6723 ) -> Self {
6724 Self {
6725 proc,
6726 selection,
6727 graphql_client,
6728 }
6729 }
6730}
6731impl EnvVariable {
6732 pub async fn id(&self) -> Result<Id, DaggerError> {
6734 let query = self.selection.select("id");
6735 query.execute(self.graphql_client.clone()).await
6736 }
6737 pub async fn name(&self) -> Result<String, DaggerError> {
6739 let query = self.selection.select("name");
6740 query.execute(self.graphql_client.clone()).await
6741 }
6742 pub async fn value(&self) -> Result<String, DaggerError> {
6744 let query = self.selection.select("value");
6745 query.execute(self.graphql_client.clone()).await
6746 }
6747}
6748impl Node for EnvVariable {
6749 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6750 let query = self.selection.select("id");
6751 let graphql_client = self.graphql_client.clone();
6752 async move { query.execute(graphql_client).await }
6753 }
6754}
6755#[derive(Clone)]
6756pub struct Error {
6757 pub proc: Option<Arc<DaggerSessionProc>>,
6758 pub selection: Selection,
6759 pub graphql_client: DynGraphQLClient,
6760}
6761impl IntoID<Id> for Error {
6762 fn into_id(
6763 self,
6764 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6765 Box::pin(async move { self.id().await })
6766 }
6767}
6768impl Loadable for Error {
6769 fn graphql_type() -> &'static str {
6770 "Error"
6771 }
6772 fn from_query(
6773 proc: Option<Arc<DaggerSessionProc>>,
6774 selection: Selection,
6775 graphql_client: DynGraphQLClient,
6776 ) -> Self {
6777 Self {
6778 proc,
6779 selection,
6780 graphql_client,
6781 }
6782 }
6783}
6784impl Error {
6785 pub async fn id(&self) -> Result<Id, DaggerError> {
6787 let query = self.selection.select("id");
6788 query.execute(self.graphql_client.clone()).await
6789 }
6790 pub async fn message(&self) -> Result<String, DaggerError> {
6792 let query = self.selection.select("message");
6793 query.execute(self.graphql_client.clone()).await
6794 }
6795 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
6797 let query = self.selection.select("values");
6798 let query = query.select("id");
6799 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6800 Ok(ids
6801 .into_iter()
6802 .map(|id| ErrorValue {
6803 proc: self.proc.clone(),
6804 selection: crate::querybuilder::query()
6805 .select("node")
6806 .arg("id", &id.0)
6807 .inline_fragment("ErrorValue"),
6808 graphql_client: self.graphql_client.clone(),
6809 })
6810 .collect())
6811 }
6812 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
6819 let mut query = self.selection.select("withValue");
6820 query = query.arg("name", name.into());
6821 query = query.arg("value", value);
6822 Error {
6823 proc: self.proc.clone(),
6824 selection: query,
6825 graphql_client: self.graphql_client.clone(),
6826 }
6827 }
6828}
6829impl Node for Error {
6830 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6831 let query = self.selection.select("id");
6832 let graphql_client = self.graphql_client.clone();
6833 async move { query.execute(graphql_client).await }
6834 }
6835}
6836#[derive(Clone)]
6837pub struct ErrorValue {
6838 pub proc: Option<Arc<DaggerSessionProc>>,
6839 pub selection: Selection,
6840 pub graphql_client: DynGraphQLClient,
6841}
6842impl IntoID<Id> for ErrorValue {
6843 fn into_id(
6844 self,
6845 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6846 Box::pin(async move { self.id().await })
6847 }
6848}
6849impl Loadable for ErrorValue {
6850 fn graphql_type() -> &'static str {
6851 "ErrorValue"
6852 }
6853 fn from_query(
6854 proc: Option<Arc<DaggerSessionProc>>,
6855 selection: Selection,
6856 graphql_client: DynGraphQLClient,
6857 ) -> Self {
6858 Self {
6859 proc,
6860 selection,
6861 graphql_client,
6862 }
6863 }
6864}
6865impl ErrorValue {
6866 pub async fn id(&self) -> Result<Id, DaggerError> {
6868 let query = self.selection.select("id");
6869 query.execute(self.graphql_client.clone()).await
6870 }
6871 pub async fn name(&self) -> Result<String, DaggerError> {
6873 let query = self.selection.select("name");
6874 query.execute(self.graphql_client.clone()).await
6875 }
6876 pub async fn value(&self) -> Result<Json, DaggerError> {
6878 let query = self.selection.select("value");
6879 query.execute(self.graphql_client.clone()).await
6880 }
6881}
6882impl Node for ErrorValue {
6883 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6884 let query = self.selection.select("id");
6885 let graphql_client = self.graphql_client.clone();
6886 async move { query.execute(graphql_client).await }
6887 }
6888}
6889#[derive(Clone)]
6890pub struct FieldTypeDef {
6891 pub proc: Option<Arc<DaggerSessionProc>>,
6892 pub selection: Selection,
6893 pub graphql_client: DynGraphQLClient,
6894}
6895impl IntoID<Id> for FieldTypeDef {
6896 fn into_id(
6897 self,
6898 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6899 Box::pin(async move { self.id().await })
6900 }
6901}
6902impl Loadable for FieldTypeDef {
6903 fn graphql_type() -> &'static str {
6904 "FieldTypeDef"
6905 }
6906 fn from_query(
6907 proc: Option<Arc<DaggerSessionProc>>,
6908 selection: Selection,
6909 graphql_client: DynGraphQLClient,
6910 ) -> Self {
6911 Self {
6912 proc,
6913 selection,
6914 graphql_client,
6915 }
6916 }
6917}
6918impl FieldTypeDef {
6919 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6921 let query = self.selection.select("deprecated");
6922 query.execute(self.graphql_client.clone()).await
6923 }
6924 pub async fn description(&self) -> Result<String, DaggerError> {
6926 let query = self.selection.select("description");
6927 query.execute(self.graphql_client.clone()).await
6928 }
6929 pub async fn id(&self) -> Result<Id, DaggerError> {
6931 let query = self.selection.select("id");
6932 query.execute(self.graphql_client.clone()).await
6933 }
6934 pub async fn name(&self) -> Result<String, DaggerError> {
6936 let query = self.selection.select("name");
6937 query.execute(self.graphql_client.clone()).await
6938 }
6939 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6941 let query = self.selection.select("sourceMap");
6942 let query = query.select("id");
6943 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6944 Ok(id.map(|id| SourceMap {
6945 proc: self.proc.clone(),
6946 selection: query
6947 .root()
6948 .select("node")
6949 .arg("id", &id.0)
6950 .inline_fragment("SourceMap"),
6951 graphql_client: self.graphql_client.clone(),
6952 }))
6953 }
6954 pub fn type_def(&self) -> TypeDef {
6956 let query = self.selection.select("typeDef");
6957 TypeDef {
6958 proc: self.proc.clone(),
6959 selection: query,
6960 graphql_client: self.graphql_client.clone(),
6961 }
6962 }
6963}
6964impl Node for FieldTypeDef {
6965 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6966 let query = self.selection.select("id");
6967 let graphql_client = self.graphql_client.clone();
6968 async move { query.execute(graphql_client).await }
6969 }
6970}
6971#[derive(Clone)]
6972pub struct File {
6973 pub proc: Option<Arc<DaggerSessionProc>>,
6974 pub selection: Selection,
6975 pub graphql_client: DynGraphQLClient,
6976}
6977#[derive(Builder, Debug, PartialEq)]
6978pub struct FileAsEnvFileOpts {
6979 #[builder(setter(into, strip_option), default)]
6981 pub expand: Option<bool>,
6982}
6983#[derive(Builder, Debug, PartialEq)]
6984pub struct FileContentsOpts {
6985 #[builder(setter(into, strip_option), default)]
6987 pub limit_lines: Option<isize>,
6988 #[builder(setter(into, strip_option), default)]
6990 pub offset_lines: Option<isize>,
6991}
6992#[derive(Builder, Debug, PartialEq)]
6993pub struct FileDigestOpts {
6994 #[builder(setter(into, strip_option), default)]
6996 pub exclude_metadata: Option<bool>,
6997}
6998#[derive(Builder, Debug, PartialEq)]
6999pub struct FileExportOpts {
7000 #[builder(setter(into, strip_option), default)]
7002 pub allow_parent_dir_path: Option<bool>,
7003}
7004#[derive(Builder, Debug, PartialEq)]
7005pub struct FileSearchOpts<'a> {
7006 #[builder(setter(into, strip_option), default)]
7008 pub dotall: Option<bool>,
7009 #[builder(setter(into, strip_option), default)]
7011 pub files_only: Option<bool>,
7012 #[builder(setter(into, strip_option), default)]
7013 pub globs: Option<Vec<&'a str>>,
7014 #[builder(setter(into, strip_option), default)]
7016 pub insensitive: Option<bool>,
7017 #[builder(setter(into, strip_option), default)]
7019 pub limit: Option<isize>,
7020 #[builder(setter(into, strip_option), default)]
7022 pub literal: Option<bool>,
7023 #[builder(setter(into, strip_option), default)]
7025 pub multiline: Option<bool>,
7026 #[builder(setter(into, strip_option), default)]
7027 pub paths: Option<Vec<&'a str>>,
7028 #[builder(setter(into, strip_option), default)]
7030 pub skip_hidden: Option<bool>,
7031 #[builder(setter(into, strip_option), default)]
7033 pub skip_ignored: Option<bool>,
7034}
7035#[derive(Builder, Debug, PartialEq)]
7036pub struct FileWithReplacedOpts {
7037 #[builder(setter(into, strip_option), default)]
7039 pub all: Option<bool>,
7040 #[builder(setter(into, strip_option), default)]
7042 pub first_from: Option<isize>,
7043}
7044impl IntoID<Id> for File {
7045 fn into_id(
7046 self,
7047 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7048 Box::pin(async move { self.id().await })
7049 }
7050}
7051impl Loadable for File {
7052 fn graphql_type() -> &'static str {
7053 "File"
7054 }
7055 fn from_query(
7056 proc: Option<Arc<DaggerSessionProc>>,
7057 selection: Selection,
7058 graphql_client: DynGraphQLClient,
7059 ) -> Self {
7060 Self {
7061 proc,
7062 selection,
7063 graphql_client,
7064 }
7065 }
7066}
7067impl File {
7068 pub fn as_env_file(&self) -> EnvFile {
7074 let query = self.selection.select("asEnvFile");
7075 EnvFile {
7076 proc: self.proc.clone(),
7077 selection: query,
7078 graphql_client: self.graphql_client.clone(),
7079 }
7080 }
7081 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7087 let mut query = self.selection.select("asEnvFile");
7088 if let Some(expand) = opts.expand {
7089 query = query.arg("expand", expand);
7090 }
7091 EnvFile {
7092 proc: self.proc.clone(),
7093 selection: query,
7094 graphql_client: self.graphql_client.clone(),
7095 }
7096 }
7097 pub fn as_git_bundle(&self) -> GitBundle {
7099 let query = self.selection.select("asGitBundle");
7100 GitBundle {
7101 proc: self.proc.clone(),
7102 selection: query,
7103 graphql_client: self.graphql_client.clone(),
7104 }
7105 }
7106 pub fn as_json(&self) -> JsonValue {
7108 let query = self.selection.select("asJSON");
7109 JsonValue {
7110 proc: self.proc.clone(),
7111 selection: query,
7112 graphql_client: self.graphql_client.clone(),
7113 }
7114 }
7115 pub fn chown(&self, owner: impl Into<String>) -> File {
7125 let mut query = self.selection.select("chown");
7126 query = query.arg("owner", owner.into());
7127 File {
7128 proc: self.proc.clone(),
7129 selection: query,
7130 graphql_client: self.graphql_client.clone(),
7131 }
7132 }
7133 pub async fn contents(&self) -> Result<String, DaggerError> {
7139 let query = self.selection.select("contents");
7140 query.execute(self.graphql_client.clone()).await
7141 }
7142 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7148 let mut query = self.selection.select("contents");
7149 if let Some(offset_lines) = opts.offset_lines {
7150 query = query.arg("offsetLines", offset_lines);
7151 }
7152 if let Some(limit_lines) = opts.limit_lines {
7153 query = query.arg("limitLines", limit_lines);
7154 }
7155 query.execute(self.graphql_client.clone()).await
7156 }
7157 pub async fn digest(&self) -> Result<String, DaggerError> {
7163 let query = self.selection.select("digest");
7164 query.execute(self.graphql_client.clone()).await
7165 }
7166 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7172 let mut query = self.selection.select("digest");
7173 if let Some(exclude_metadata) = opts.exclude_metadata {
7174 query = query.arg("excludeMetadata", exclude_metadata);
7175 }
7176 query.execute(self.graphql_client.clone()).await
7177 }
7178 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7185 let mut query = self.selection.select("export");
7186 query = query.arg("path", path.into());
7187 query.execute(self.graphql_client.clone()).await
7188 }
7189 pub async fn export_opts(
7196 &self,
7197 path: impl Into<String>,
7198 opts: FileExportOpts,
7199 ) -> Result<String, DaggerError> {
7200 let mut query = self.selection.select("export");
7201 query = query.arg("path", path.into());
7202 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7203 query = query.arg("allowParentDirPath", allow_parent_dir_path);
7204 }
7205 query.execute(self.graphql_client.clone()).await
7206 }
7207 pub async fn id(&self) -> Result<Id, DaggerError> {
7209 let query = self.selection.select("id");
7210 query.execute(self.graphql_client.clone()).await
7211 }
7212 pub async fn name(&self) -> Result<String, DaggerError> {
7214 let query = self.selection.select("name");
7215 query.execute(self.graphql_client.clone()).await
7216 }
7217 pub async fn search(
7225 &self,
7226 pattern: impl Into<String>,
7227 ) -> Result<Vec<SearchResult>, DaggerError> {
7228 let mut query = self.selection.select("search");
7229 query = query.arg("pattern", pattern.into());
7230 let query = query.select("id");
7231 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7232 Ok(ids
7233 .into_iter()
7234 .map(|id| SearchResult {
7235 proc: self.proc.clone(),
7236 selection: crate::querybuilder::query()
7237 .select("node")
7238 .arg("id", &id.0)
7239 .inline_fragment("SearchResult"),
7240 graphql_client: self.graphql_client.clone(),
7241 })
7242 .collect())
7243 }
7244 pub async fn search_opts<'a>(
7252 &self,
7253 pattern: impl Into<String>,
7254 opts: FileSearchOpts<'a>,
7255 ) -> Result<Vec<SearchResult>, DaggerError> {
7256 let mut query = self.selection.select("search");
7257 query = query.arg("pattern", pattern.into());
7258 if let Some(literal) = opts.literal {
7259 query = query.arg("literal", literal);
7260 }
7261 if let Some(multiline) = opts.multiline {
7262 query = query.arg("multiline", multiline);
7263 }
7264 if let Some(dotall) = opts.dotall {
7265 query = query.arg("dotall", dotall);
7266 }
7267 if let Some(insensitive) = opts.insensitive {
7268 query = query.arg("insensitive", insensitive);
7269 }
7270 if let Some(skip_ignored) = opts.skip_ignored {
7271 query = query.arg("skipIgnored", skip_ignored);
7272 }
7273 if let Some(skip_hidden) = opts.skip_hidden {
7274 query = query.arg("skipHidden", skip_hidden);
7275 }
7276 if let Some(files_only) = opts.files_only {
7277 query = query.arg("filesOnly", files_only);
7278 }
7279 if let Some(limit) = opts.limit {
7280 query = query.arg("limit", limit);
7281 }
7282 if let Some(paths) = opts.paths {
7283 query = query.arg("paths", paths);
7284 }
7285 if let Some(globs) = opts.globs {
7286 query = query.arg("globs", globs);
7287 }
7288 let query = query.select("id");
7289 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7290 Ok(ids
7291 .into_iter()
7292 .map(|id| SearchResult {
7293 proc: self.proc.clone(),
7294 selection: crate::querybuilder::query()
7295 .select("node")
7296 .arg("id", &id.0)
7297 .inline_fragment("SearchResult"),
7298 graphql_client: self.graphql_client.clone(),
7299 })
7300 .collect())
7301 }
7302 pub async fn size(&self) -> Result<isize, DaggerError> {
7304 let query = self.selection.select("size");
7305 query.execute(self.graphql_client.clone()).await
7306 }
7307 pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
7309 let query = self.selection.select("stat");
7310 let query = query.select("id");
7311 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7312 Ok(id.map(|id| Stat {
7313 proc: self.proc.clone(),
7314 selection: query
7315 .root()
7316 .select("node")
7317 .arg("id", &id.0)
7318 .inline_fragment("Stat"),
7319 graphql_client: self.graphql_client.clone(),
7320 }))
7321 }
7322 pub async fn sync(&self) -> Result<File, DaggerError> {
7324 let query = self.selection.select("sync");
7325 let id: Id = query.execute(self.graphql_client.clone()).await?;
7326 Ok(File {
7327 proc: self.proc.clone(),
7328 selection: query
7329 .root()
7330 .select("node")
7331 .arg("id", &id.0)
7332 .inline_fragment("File"),
7333 graphql_client: self.graphql_client.clone(),
7334 })
7335 }
7336 pub fn with_name(&self, name: impl Into<String>) -> File {
7342 let mut query = self.selection.select("withName");
7343 query = query.arg("name", name.into());
7344 File {
7345 proc: self.proc.clone(),
7346 selection: query,
7347 graphql_client: self.graphql_client.clone(),
7348 }
7349 }
7350 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7362 let mut query = self.selection.select("withReplaced");
7363 query = query.arg("search", search.into());
7364 query = query.arg("replacement", replacement.into());
7365 File {
7366 proc: self.proc.clone(),
7367 selection: query,
7368 graphql_client: self.graphql_client.clone(),
7369 }
7370 }
7371 pub fn with_replaced_opts(
7383 &self,
7384 search: impl Into<String>,
7385 replacement: impl Into<String>,
7386 opts: FileWithReplacedOpts,
7387 ) -> File {
7388 let mut query = self.selection.select("withReplaced");
7389 query = query.arg("search", search.into());
7390 query = query.arg("replacement", replacement.into());
7391 if let Some(all) = opts.all {
7392 query = query.arg("all", all);
7393 }
7394 if let Some(first_from) = opts.first_from {
7395 query = query.arg("firstFrom", first_from);
7396 }
7397 File {
7398 proc: self.proc.clone(),
7399 selection: query,
7400 graphql_client: self.graphql_client.clone(),
7401 }
7402 }
7403 pub fn with_timestamps(&self, timestamp: isize) -> File {
7411 let mut query = self.selection.select("withTimestamps");
7412 query = query.arg("timestamp", timestamp);
7413 File {
7414 proc: self.proc.clone(),
7415 selection: query,
7416 graphql_client: self.graphql_client.clone(),
7417 }
7418 }
7419}
7420impl Exportable for File {
7421 fn export(
7422 &self,
7423 path: impl Into<String>,
7424 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7425 let mut query = self.selection.select("export");
7426 query = query.arg("path", path.into());
7427 let graphql_client = self.graphql_client.clone();
7428 async move { query.execute(graphql_client).await }
7429 }
7430 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7431 let query = self.selection.select("id");
7432 let graphql_client = self.graphql_client.clone();
7433 async move { query.execute(graphql_client).await }
7434 }
7435}
7436impl Node for File {
7437 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7438 let query = self.selection.select("id");
7439 let graphql_client = self.graphql_client.clone();
7440 async move { query.execute(graphql_client).await }
7441 }
7442}
7443impl Syncer for File {
7444 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7445 let query = self.selection.select("id");
7446 let graphql_client = self.graphql_client.clone();
7447 async move { query.execute(graphql_client).await }
7448 }
7449 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7450 let query = self.selection.select("sync");
7451 let graphql_client = self.graphql_client.clone();
7452 async move { query.execute(graphql_client).await }
7453 }
7454}
7455#[derive(Clone)]
7456pub struct Function {
7457 pub proc: Option<Arc<DaggerSessionProc>>,
7458 pub selection: Selection,
7459 pub graphql_client: DynGraphQLClient,
7460}
7461#[derive(Builder, Debug, PartialEq)]
7462pub struct FunctionWithArgOpts<'a> {
7463 #[builder(setter(into, strip_option), default)]
7464 pub default_address: Option<&'a str>,
7465 #[builder(setter(into, strip_option), default)]
7467 pub default_path: Option<&'a str>,
7468 #[builder(setter(into, strip_option), default)]
7470 pub default_value: Option<Json>,
7471 #[builder(setter(into, strip_option), default)]
7473 pub deprecated: Option<&'a str>,
7474 #[builder(setter(into, strip_option), default)]
7476 pub description: Option<&'a str>,
7477 #[builder(setter(into, strip_option), default)]
7479 pub ignore: Option<Vec<&'a str>>,
7480 #[builder(setter(into, strip_option), default)]
7482 pub source_map: Option<Id>,
7483}
7484#[derive(Builder, Debug, PartialEq)]
7485pub struct FunctionWithCachePolicyOpts<'a> {
7486 #[builder(setter(into, strip_option), default)]
7488 pub time_to_live: Option<&'a str>,
7489}
7490#[derive(Builder, Debug, PartialEq)]
7491pub struct FunctionWithDeprecatedOpts<'a> {
7492 #[builder(setter(into, strip_option), default)]
7494 pub reason: Option<&'a str>,
7495}
7496impl IntoID<Id> for Function {
7497 fn into_id(
7498 self,
7499 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7500 Box::pin(async move { self.id().await })
7501 }
7502}
7503impl Loadable for Function {
7504 fn graphql_type() -> &'static str {
7505 "Function"
7506 }
7507 fn from_query(
7508 proc: Option<Arc<DaggerSessionProc>>,
7509 selection: Selection,
7510 graphql_client: DynGraphQLClient,
7511 ) -> Self {
7512 Self {
7513 proc,
7514 selection,
7515 graphql_client,
7516 }
7517 }
7518}
7519impl Function {
7520 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
7522 let query = self.selection.select("args");
7523 let query = query.select("id");
7524 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7525 Ok(ids
7526 .into_iter()
7527 .map(|id| FunctionArg {
7528 proc: self.proc.clone(),
7529 selection: crate::querybuilder::query()
7530 .select("node")
7531 .arg("id", &id.0)
7532 .inline_fragment("FunctionArg"),
7533 graphql_client: self.graphql_client.clone(),
7534 })
7535 .collect())
7536 }
7537 pub async fn deprecated(&self) -> Result<String, DaggerError> {
7539 let query = self.selection.select("deprecated");
7540 query.execute(self.graphql_client.clone()).await
7541 }
7542 pub async fn description(&self) -> Result<String, DaggerError> {
7544 let query = self.selection.select("description");
7545 query.execute(self.graphql_client.clone()).await
7546 }
7547 pub async fn id(&self) -> Result<Id, DaggerError> {
7549 let query = self.selection.select("id");
7550 query.execute(self.graphql_client.clone()).await
7551 }
7552 pub async fn name(&self) -> Result<String, DaggerError> {
7554 let query = self.selection.select("name");
7555 query.execute(self.graphql_client.clone()).await
7556 }
7557 pub fn return_type(&self) -> TypeDef {
7559 let query = self.selection.select("returnType");
7560 TypeDef {
7561 proc: self.proc.clone(),
7562 selection: query,
7563 graphql_client: self.graphql_client.clone(),
7564 }
7565 }
7566 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7568 let query = self.selection.select("sourceMap");
7569 let query = query.select("id");
7570 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7571 Ok(id.map(|id| SourceMap {
7572 proc: self.proc.clone(),
7573 selection: query
7574 .root()
7575 .select("node")
7576 .arg("id", &id.0)
7577 .inline_fragment("SourceMap"),
7578 graphql_client: self.graphql_client.clone(),
7579 }))
7580 }
7581 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7583 let query = self.selection.select("sourceModuleName");
7584 query.execute(self.graphql_client.clone()).await
7585 }
7586 pub fn with_agent(&self) -> Function {
7588 let query = self.selection.select("withAgent");
7589 Function {
7590 proc: self.proc.clone(),
7591 selection: query,
7592 graphql_client: self.graphql_client.clone(),
7593 }
7594 }
7595 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
7603 let mut query = self.selection.select("withArg");
7604 query = query.arg("name", name.into());
7605 query = query.arg_lazy(
7606 "typeDef",
7607 Box::new(move || {
7608 let type_def = type_def.clone();
7609 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7610 }),
7611 );
7612 Function {
7613 proc: self.proc.clone(),
7614 selection: query,
7615 graphql_client: self.graphql_client.clone(),
7616 }
7617 }
7618 pub fn with_arg_opts<'a>(
7626 &self,
7627 name: impl Into<String>,
7628 type_def: impl IntoID<Id>,
7629 opts: FunctionWithArgOpts<'a>,
7630 ) -> Function {
7631 let mut query = self.selection.select("withArg");
7632 query = query.arg("name", name.into());
7633 query = query.arg_lazy(
7634 "typeDef",
7635 Box::new(move || {
7636 let type_def = type_def.clone();
7637 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7638 }),
7639 );
7640 if let Some(description) = opts.description {
7641 query = query.arg("description", description);
7642 }
7643 if let Some(default_value) = opts.default_value {
7644 query = query.arg("defaultValue", default_value);
7645 }
7646 if let Some(default_path) = opts.default_path {
7647 query = query.arg("defaultPath", default_path);
7648 }
7649 if let Some(ignore) = opts.ignore {
7650 query = query.arg("ignore", ignore);
7651 }
7652 if let Some(source_map) = opts.source_map {
7653 query = query.arg("sourceMap", source_map);
7654 }
7655 if let Some(deprecated) = opts.deprecated {
7656 query = query.arg("deprecated", deprecated);
7657 }
7658 if let Some(default_address) = opts.default_address {
7659 query = query.arg("defaultAddress", default_address);
7660 }
7661 Function {
7662 proc: self.proc.clone(),
7663 selection: query,
7664 graphql_client: self.graphql_client.clone(),
7665 }
7666 }
7667 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
7674 let mut query = self.selection.select("withCachePolicy");
7675 query = query.arg("policy", policy);
7676 Function {
7677 proc: self.proc.clone(),
7678 selection: query,
7679 graphql_client: self.graphql_client.clone(),
7680 }
7681 }
7682 pub fn with_cache_policy_opts<'a>(
7689 &self,
7690 policy: FunctionCachePolicy,
7691 opts: FunctionWithCachePolicyOpts<'a>,
7692 ) -> Function {
7693 let mut query = self.selection.select("withCachePolicy");
7694 query = query.arg("policy", policy);
7695 if let Some(time_to_live) = opts.time_to_live {
7696 query = query.arg("timeToLive", time_to_live);
7697 }
7698 Function {
7699 proc: self.proc.clone(),
7700 selection: query,
7701 graphql_client: self.graphql_client.clone(),
7702 }
7703 }
7704 pub fn with_check(&self) -> Function {
7706 let query = self.selection.select("withCheck");
7707 Function {
7708 proc: self.proc.clone(),
7709 selection: query,
7710 graphql_client: self.graphql_client.clone(),
7711 }
7712 }
7713 pub fn with_deprecated(&self) -> Function {
7719 let query = self.selection.select("withDeprecated");
7720 Function {
7721 proc: self.proc.clone(),
7722 selection: query,
7723 graphql_client: self.graphql_client.clone(),
7724 }
7725 }
7726 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
7732 let mut query = self.selection.select("withDeprecated");
7733 if let Some(reason) = opts.reason {
7734 query = query.arg("reason", reason);
7735 }
7736 Function {
7737 proc: self.proc.clone(),
7738 selection: query,
7739 graphql_client: self.graphql_client.clone(),
7740 }
7741 }
7742 pub fn with_description(&self, description: impl Into<String>) -> Function {
7748 let mut query = self.selection.select("withDescription");
7749 query = query.arg("description", description.into());
7750 Function {
7751 proc: self.proc.clone(),
7752 selection: query,
7753 graphql_client: self.graphql_client.clone(),
7754 }
7755 }
7756 pub fn with_generator(&self) -> Function {
7758 let query = self.selection.select("withGenerator");
7759 Function {
7760 proc: self.proc.clone(),
7761 selection: query,
7762 graphql_client: self.graphql_client.clone(),
7763 }
7764 }
7765 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
7771 let mut query = self.selection.select("withSourceMap");
7772 query = query.arg_lazy(
7773 "sourceMap",
7774 Box::new(move || {
7775 let source_map = source_map.clone();
7776 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
7777 }),
7778 );
7779 Function {
7780 proc: self.proc.clone(),
7781 selection: query,
7782 graphql_client: self.graphql_client.clone(),
7783 }
7784 }
7785 pub fn with_up(&self) -> Function {
7787 let query = self.selection.select("withUp");
7788 Function {
7789 proc: self.proc.clone(),
7790 selection: query,
7791 graphql_client: self.graphql_client.clone(),
7792 }
7793 }
7794}
7795impl Node for Function {
7796 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7797 let query = self.selection.select("id");
7798 let graphql_client = self.graphql_client.clone();
7799 async move { query.execute(graphql_client).await }
7800 }
7801}
7802#[derive(Clone)]
7803pub struct FunctionArg {
7804 pub proc: Option<Arc<DaggerSessionProc>>,
7805 pub selection: Selection,
7806 pub graphql_client: DynGraphQLClient,
7807}
7808impl IntoID<Id> for FunctionArg {
7809 fn into_id(
7810 self,
7811 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7812 Box::pin(async move { self.id().await })
7813 }
7814}
7815impl Loadable for FunctionArg {
7816 fn graphql_type() -> &'static str {
7817 "FunctionArg"
7818 }
7819 fn from_query(
7820 proc: Option<Arc<DaggerSessionProc>>,
7821 selection: Selection,
7822 graphql_client: DynGraphQLClient,
7823 ) -> Self {
7824 Self {
7825 proc,
7826 selection,
7827 graphql_client,
7828 }
7829 }
7830}
7831impl FunctionArg {
7832 pub async fn default_address(&self) -> Result<String, DaggerError> {
7834 let query = self.selection.select("defaultAddress");
7835 query.execute(self.graphql_client.clone()).await
7836 }
7837 pub async fn default_path(&self) -> Result<String, DaggerError> {
7839 let query = self.selection.select("defaultPath");
7840 query.execute(self.graphql_client.clone()).await
7841 }
7842 pub async fn default_value(&self) -> Result<Json, DaggerError> {
7844 let query = self.selection.select("defaultValue");
7845 query.execute(self.graphql_client.clone()).await
7846 }
7847 pub async fn deprecated(&self) -> Result<String, DaggerError> {
7849 let query = self.selection.select("deprecated");
7850 query.execute(self.graphql_client.clone()).await
7851 }
7852 pub async fn description(&self) -> Result<String, DaggerError> {
7854 let query = self.selection.select("description");
7855 query.execute(self.graphql_client.clone()).await
7856 }
7857 pub async fn id(&self) -> Result<Id, DaggerError> {
7859 let query = self.selection.select("id");
7860 query.execute(self.graphql_client.clone()).await
7861 }
7862 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
7864 let query = self.selection.select("ignore");
7865 query.execute(self.graphql_client.clone()).await
7866 }
7867 pub async fn name(&self) -> Result<String, DaggerError> {
7869 let query = self.selection.select("name");
7870 query.execute(self.graphql_client.clone()).await
7871 }
7872 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7874 let query = self.selection.select("sourceMap");
7875 let query = query.select("id");
7876 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7877 Ok(id.map(|id| SourceMap {
7878 proc: self.proc.clone(),
7879 selection: query
7880 .root()
7881 .select("node")
7882 .arg("id", &id.0)
7883 .inline_fragment("SourceMap"),
7884 graphql_client: self.graphql_client.clone(),
7885 }))
7886 }
7887 pub fn type_def(&self) -> TypeDef {
7889 let query = self.selection.select("typeDef");
7890 TypeDef {
7891 proc: self.proc.clone(),
7892 selection: query,
7893 graphql_client: self.graphql_client.clone(),
7894 }
7895 }
7896}
7897impl Node for FunctionArg {
7898 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7899 let query = self.selection.select("id");
7900 let graphql_client = self.graphql_client.clone();
7901 async move { query.execute(graphql_client).await }
7902 }
7903}
7904#[derive(Clone)]
7905pub struct FunctionCall {
7906 pub proc: Option<Arc<DaggerSessionProc>>,
7907 pub selection: Selection,
7908 pub graphql_client: DynGraphQLClient,
7909}
7910impl IntoID<Id> for FunctionCall {
7911 fn into_id(
7912 self,
7913 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7914 Box::pin(async move { self.id().await })
7915 }
7916}
7917impl Loadable for FunctionCall {
7918 fn graphql_type() -> &'static str {
7919 "FunctionCall"
7920 }
7921 fn from_query(
7922 proc: Option<Arc<DaggerSessionProc>>,
7923 selection: Selection,
7924 graphql_client: DynGraphQLClient,
7925 ) -> Self {
7926 Self {
7927 proc,
7928 selection,
7929 graphql_client,
7930 }
7931 }
7932}
7933impl FunctionCall {
7934 pub async fn id(&self) -> Result<Id, DaggerError> {
7936 let query = self.selection.select("id");
7937 query.execute(self.graphql_client.clone()).await
7938 }
7939 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
7941 let query = self.selection.select("inputArgs");
7942 let query = query.select("id");
7943 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7944 Ok(ids
7945 .into_iter()
7946 .map(|id| FunctionCallArgValue {
7947 proc: self.proc.clone(),
7948 selection: crate::querybuilder::query()
7949 .select("node")
7950 .arg("id", &id.0)
7951 .inline_fragment("FunctionCallArgValue"),
7952 graphql_client: self.graphql_client.clone(),
7953 })
7954 .collect())
7955 }
7956 pub async fn name(&self) -> Result<String, DaggerError> {
7958 let query = self.selection.select("name");
7959 query.execute(self.graphql_client.clone()).await
7960 }
7961 pub async fn parent(&self) -> Result<Json, DaggerError> {
7963 let query = self.selection.select("parent");
7964 query.execute(self.graphql_client.clone()).await
7965 }
7966 pub async fn parent_name(&self) -> Result<String, DaggerError> {
7968 let query = self.selection.select("parentName");
7969 query.execute(self.graphql_client.clone()).await
7970 }
7971 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
7977 let mut query = self.selection.select("returnError");
7978 query = query.arg_lazy(
7979 "error",
7980 Box::new(move || {
7981 let error = error.clone();
7982 Box::pin(async move { error.into_id().await.unwrap().quote() })
7983 }),
7984 );
7985 query.execute(self.graphql_client.clone()).await
7986 }
7987 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
7993 let mut query = self.selection.select("returnValue");
7994 query = query.arg("value", value);
7995 query.execute(self.graphql_client.clone()).await
7996 }
7997}
7998impl Node for FunctionCall {
7999 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8000 let query = self.selection.select("id");
8001 let graphql_client = self.graphql_client.clone();
8002 async move { query.execute(graphql_client).await }
8003 }
8004}
8005#[derive(Clone)]
8006pub struct FunctionCallArgValue {
8007 pub proc: Option<Arc<DaggerSessionProc>>,
8008 pub selection: Selection,
8009 pub graphql_client: DynGraphQLClient,
8010}
8011impl IntoID<Id> for FunctionCallArgValue {
8012 fn into_id(
8013 self,
8014 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8015 Box::pin(async move { self.id().await })
8016 }
8017}
8018impl Loadable for FunctionCallArgValue {
8019 fn graphql_type() -> &'static str {
8020 "FunctionCallArgValue"
8021 }
8022 fn from_query(
8023 proc: Option<Arc<DaggerSessionProc>>,
8024 selection: Selection,
8025 graphql_client: DynGraphQLClient,
8026 ) -> Self {
8027 Self {
8028 proc,
8029 selection,
8030 graphql_client,
8031 }
8032 }
8033}
8034impl FunctionCallArgValue {
8035 pub async fn id(&self) -> Result<Id, DaggerError> {
8037 let query = self.selection.select("id");
8038 query.execute(self.graphql_client.clone()).await
8039 }
8040 pub async fn name(&self) -> Result<String, DaggerError> {
8042 let query = self.selection.select("name");
8043 query.execute(self.graphql_client.clone()).await
8044 }
8045 pub async fn value(&self) -> Result<Json, DaggerError> {
8047 let query = self.selection.select("value");
8048 query.execute(self.graphql_client.clone()).await
8049 }
8050}
8051impl Node for FunctionCallArgValue {
8052 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8053 let query = self.selection.select("id");
8054 let graphql_client = self.graphql_client.clone();
8055 async move { query.execute(graphql_client).await }
8056 }
8057}
8058#[derive(Clone)]
8059pub struct GeneratedCode {
8060 pub proc: Option<Arc<DaggerSessionProc>>,
8061 pub selection: Selection,
8062 pub graphql_client: DynGraphQLClient,
8063}
8064impl IntoID<Id> for GeneratedCode {
8065 fn into_id(
8066 self,
8067 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8068 Box::pin(async move { self.id().await })
8069 }
8070}
8071impl Loadable for GeneratedCode {
8072 fn graphql_type() -> &'static str {
8073 "GeneratedCode"
8074 }
8075 fn from_query(
8076 proc: Option<Arc<DaggerSessionProc>>,
8077 selection: Selection,
8078 graphql_client: DynGraphQLClient,
8079 ) -> Self {
8080 Self {
8081 proc,
8082 selection,
8083 graphql_client,
8084 }
8085 }
8086}
8087impl GeneratedCode {
8088 pub fn code(&self) -> Directory {
8090 let query = self.selection.select("code");
8091 Directory {
8092 proc: self.proc.clone(),
8093 selection: query,
8094 graphql_client: self.graphql_client.clone(),
8095 }
8096 }
8097 pub async fn id(&self) -> Result<Id, DaggerError> {
8099 let query = self.selection.select("id");
8100 query.execute(self.graphql_client.clone()).await
8101 }
8102 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8104 let query = self.selection.select("vcsGeneratedPaths");
8105 query.execute(self.graphql_client.clone()).await
8106 }
8107 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8109 let query = self.selection.select("vcsIgnoredPaths");
8110 query.execute(self.graphql_client.clone()).await
8111 }
8112 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8114 let mut query = self.selection.select("withVCSGeneratedPaths");
8115 query = query.arg(
8116 "paths",
8117 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8118 );
8119 GeneratedCode {
8120 proc: self.proc.clone(),
8121 selection: query,
8122 graphql_client: self.graphql_client.clone(),
8123 }
8124 }
8125 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8127 let mut query = self.selection.select("withVCSIgnoredPaths");
8128 query = query.arg(
8129 "paths",
8130 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8131 );
8132 GeneratedCode {
8133 proc: self.proc.clone(),
8134 selection: query,
8135 graphql_client: self.graphql_client.clone(),
8136 }
8137 }
8138}
8139impl Node for GeneratedCode {
8140 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8141 let query = self.selection.select("id");
8142 let graphql_client = self.graphql_client.clone();
8143 async move { query.execute(graphql_client).await }
8144 }
8145}
8146#[derive(Clone)]
8147pub struct Generator {
8148 pub proc: Option<Arc<DaggerSessionProc>>,
8149 pub selection: Selection,
8150 pub graphql_client: DynGraphQLClient,
8151}
8152impl IntoID<Id> for Generator {
8153 fn into_id(
8154 self,
8155 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8156 Box::pin(async move { self.id().await })
8157 }
8158}
8159impl Loadable for Generator {
8160 fn graphql_type() -> &'static str {
8161 "Generator"
8162 }
8163 fn from_query(
8164 proc: Option<Arc<DaggerSessionProc>>,
8165 selection: Selection,
8166 graphql_client: DynGraphQLClient,
8167 ) -> Self {
8168 Self {
8169 proc,
8170 selection,
8171 graphql_client,
8172 }
8173 }
8174}
8175impl Generator {
8176 pub fn changes(&self) -> Changeset {
8178 let query = self.selection.select("changes");
8179 Changeset {
8180 proc: self.proc.clone(),
8181 selection: query,
8182 graphql_client: self.graphql_client.clone(),
8183 }
8184 }
8185 pub async fn completed(&self) -> Result<bool, DaggerError> {
8187 let query = self.selection.select("completed");
8188 query.execute(self.graphql_client.clone()).await
8189 }
8190 pub async fn description(&self) -> Result<String, DaggerError> {
8192 let query = self.selection.select("description");
8193 query.execute(self.graphql_client.clone()).await
8194 }
8195 pub async fn id(&self) -> Result<Id, DaggerError> {
8197 let query = self.selection.select("id");
8198 query.execute(self.graphql_client.clone()).await
8199 }
8200 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8202 let query = self.selection.select("isEmpty");
8203 query.execute(self.graphql_client.clone()).await
8204 }
8205 pub async fn name(&self) -> Result<String, DaggerError> {
8207 let query = self.selection.select("name");
8208 query.execute(self.graphql_client.clone()).await
8209 }
8210 pub async fn original_module(&self) -> Result<Option<Module>, DaggerError> {
8212 let query = self.selection.select("originalModule");
8213 let query = query.select("id");
8214 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8215 Ok(id.map(|id| Module {
8216 proc: self.proc.clone(),
8217 selection: query
8218 .root()
8219 .select("node")
8220 .arg("id", &id.0)
8221 .inline_fragment("Module"),
8222 graphql_client: self.graphql_client.clone(),
8223 }))
8224 }
8225 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8227 let query = self.selection.select("path");
8228 query.execute(self.graphql_client.clone()).await
8229 }
8230 pub fn run(&self) -> Generator {
8232 let query = self.selection.select("run");
8233 Generator {
8234 proc: self.proc.clone(),
8235 selection: query,
8236 graphql_client: self.graphql_client.clone(),
8237 }
8238 }
8239}
8240impl Node for Generator {
8241 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8242 let query = self.selection.select("id");
8243 let graphql_client = self.graphql_client.clone();
8244 async move { query.execute(graphql_client).await }
8245 }
8246}
8247#[derive(Clone)]
8248pub struct GeneratorGroup {
8249 pub proc: Option<Arc<DaggerSessionProc>>,
8250 pub selection: Selection,
8251 pub graphql_client: DynGraphQLClient,
8252}
8253#[derive(Builder, Debug, PartialEq)]
8254pub struct GeneratorGroupChangesOpts {
8255 #[builder(setter(into, strip_option), default)]
8257 pub on_conflict: Option<ChangesetsMergeConflict>,
8258}
8259#[derive(Builder, Debug, PartialEq)]
8260pub struct GeneratorGroupWorkspaceOpts {
8261 #[builder(setter(into, strip_option), default)]
8263 pub on_conflict: Option<ChangesetsMergeConflict>,
8264}
8265impl IntoID<Id> for GeneratorGroup {
8266 fn into_id(
8267 self,
8268 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8269 Box::pin(async move { self.id().await })
8270 }
8271}
8272impl Loadable for GeneratorGroup {
8273 fn graphql_type() -> &'static str {
8274 "GeneratorGroup"
8275 }
8276 fn from_query(
8277 proc: Option<Arc<DaggerSessionProc>>,
8278 selection: Selection,
8279 graphql_client: DynGraphQLClient,
8280 ) -> Self {
8281 Self {
8282 proc,
8283 selection,
8284 graphql_client,
8285 }
8286 }
8287}
8288impl GeneratorGroup {
8289 pub fn changes(&self) -> Changeset {
8297 let query = self.selection.select("changes");
8298 Changeset {
8299 proc: self.proc.clone(),
8300 selection: query,
8301 graphql_client: self.graphql_client.clone(),
8302 }
8303 }
8304 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
8312 let mut query = self.selection.select("changes");
8313 if let Some(on_conflict) = opts.on_conflict {
8314 query = query.arg("onConflict", on_conflict);
8315 }
8316 Changeset {
8317 proc: self.proc.clone(),
8318 selection: query,
8319 graphql_client: self.graphql_client.clone(),
8320 }
8321 }
8322 pub async fn id(&self) -> Result<Id, DaggerError> {
8324 let query = self.selection.select("id");
8325 query.execute(self.graphql_client.clone()).await
8326 }
8327 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8329 let query = self.selection.select("isEmpty");
8330 query.execute(self.graphql_client.clone()).await
8331 }
8332 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
8334 let query = self.selection.select("list");
8335 let query = query.select("id");
8336 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8337 Ok(ids
8338 .into_iter()
8339 .map(|id| Generator {
8340 proc: self.proc.clone(),
8341 selection: crate::querybuilder::query()
8342 .select("node")
8343 .arg("id", &id.0)
8344 .inline_fragment("Generator"),
8345 graphql_client: self.graphql_client.clone(),
8346 })
8347 .collect())
8348 }
8349 pub async fn load_failures(&self) -> Result<Vec<String>, DaggerError> {
8352 let query = self.selection.select("loadFailures");
8353 query.execute(self.graphql_client.clone()).await
8354 }
8355 pub fn run(&self) -> GeneratorGroup {
8357 let query = self.selection.select("run");
8358 GeneratorGroup {
8359 proc: self.proc.clone(),
8360 selection: query,
8361 graphql_client: self.graphql_client.clone(),
8362 }
8363 }
8364 pub fn workspace(&self) -> Workspace {
8370 let query = self.selection.select("workspace");
8371 Workspace {
8372 proc: self.proc.clone(),
8373 selection: query,
8374 graphql_client: self.graphql_client.clone(),
8375 }
8376 }
8377 pub fn workspace_opts(&self, opts: GeneratorGroupWorkspaceOpts) -> Workspace {
8383 let mut query = self.selection.select("workspace");
8384 if let Some(on_conflict) = opts.on_conflict {
8385 query = query.arg("onConflict", on_conflict);
8386 }
8387 Workspace {
8388 proc: self.proc.clone(),
8389 selection: query,
8390 graphql_client: self.graphql_client.clone(),
8391 }
8392 }
8393}
8394impl Node for GeneratorGroup {
8395 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8396 let query = self.selection.select("id");
8397 let graphql_client = self.graphql_client.clone();
8398 async move { query.execute(graphql_client).await }
8399 }
8400}
8401#[derive(Clone)]
8402pub struct GitBundle {
8403 pub proc: Option<Arc<DaggerSessionProc>>,
8404 pub selection: Selection,
8405 pub graphql_client: DynGraphQLClient,
8406}
8407impl IntoID<Id> for GitBundle {
8408 fn into_id(
8409 self,
8410 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8411 Box::pin(async move { self.id().await })
8412 }
8413}
8414impl Loadable for GitBundle {
8415 fn graphql_type() -> &'static str {
8416 "GitBundle"
8417 }
8418 fn from_query(
8419 proc: Option<Arc<DaggerSessionProc>>,
8420 selection: Selection,
8421 graphql_client: DynGraphQLClient,
8422 ) -> Self {
8423 Self {
8424 proc,
8425 selection,
8426 graphql_client,
8427 }
8428 }
8429}
8430impl GitBundle {
8431 pub fn as_file(&self) -> File {
8433 let query = self.selection.select("asFile");
8434 File {
8435 proc: self.proc.clone(),
8436 selection: query,
8437 graphql_client: self.graphql_client.clone(),
8438 }
8439 }
8440 pub async fn id(&self) -> Result<Id, DaggerError> {
8442 let query = self.selection.select("id");
8443 query.execute(self.graphql_client.clone()).await
8444 }
8445 pub async fn object_format(&self) -> Result<String, DaggerError> {
8447 let query = self.selection.select("objectFormat");
8448 query.execute(self.graphql_client.clone()).await
8449 }
8450 pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
8452 let query = self.selection.select("prerequisiteSHAs");
8453 query.execute(self.graphql_client.clone()).await
8454 }
8455 pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
8457 let query = self.selection.select("refs");
8458 let query = query.select("id");
8459 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8460 Ok(ids
8461 .into_iter()
8462 .map(|id| GitBundleRef {
8463 proc: self.proc.clone(),
8464 selection: crate::querybuilder::query()
8465 .select("node")
8466 .arg("id", &id.0)
8467 .inline_fragment("GitBundleRef"),
8468 graphql_client: self.graphql_client.clone(),
8469 })
8470 .collect())
8471 }
8472 pub fn validate(&self) -> GitBundle {
8474 let query = self.selection.select("validate");
8475 GitBundle {
8476 proc: self.proc.clone(),
8477 selection: query,
8478 graphql_client: self.graphql_client.clone(),
8479 }
8480 }
8481 pub async fn version(&self) -> Result<isize, DaggerError> {
8483 let query = self.selection.select("version");
8484 query.execute(self.graphql_client.clone()).await
8485 }
8486}
8487impl Node for GitBundle {
8488 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8489 let query = self.selection.select("id");
8490 let graphql_client = self.graphql_client.clone();
8491 async move { query.execute(graphql_client).await }
8492 }
8493}
8494#[derive(Clone)]
8495pub struct GitBundleRef {
8496 pub proc: Option<Arc<DaggerSessionProc>>,
8497 pub selection: Selection,
8498 pub graphql_client: DynGraphQLClient,
8499}
8500impl IntoID<Id> for GitBundleRef {
8501 fn into_id(
8502 self,
8503 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8504 Box::pin(async move { self.id().await })
8505 }
8506}
8507impl Loadable for GitBundleRef {
8508 fn graphql_type() -> &'static str {
8509 "GitBundleRef"
8510 }
8511 fn from_query(
8512 proc: Option<Arc<DaggerSessionProc>>,
8513 selection: Selection,
8514 graphql_client: DynGraphQLClient,
8515 ) -> Self {
8516 Self {
8517 proc,
8518 selection,
8519 graphql_client,
8520 }
8521 }
8522}
8523impl GitBundleRef {
8524 pub async fn id(&self) -> Result<Id, DaggerError> {
8526 let query = self.selection.select("id");
8527 query.execute(self.graphql_client.clone()).await
8528 }
8529 pub async fn name(&self) -> Result<String, DaggerError> {
8531 let query = self.selection.select("name");
8532 query.execute(self.graphql_client.clone()).await
8533 }
8534 pub async fn sha(&self) -> Result<String, DaggerError> {
8536 let query = self.selection.select("sha");
8537 query.execute(self.graphql_client.clone()).await
8538 }
8539}
8540impl Node for GitBundleRef {
8541 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8542 let query = self.selection.select("id");
8543 let graphql_client = self.graphql_client.clone();
8544 async move { query.execute(graphql_client).await }
8545 }
8546}
8547#[derive(Clone)]
8548pub struct GitCommit {
8549 pub proc: Option<Arc<DaggerSessionProc>>,
8550 pub selection: Selection,
8551 pub graphql_client: DynGraphQLClient,
8552}
8553#[derive(Builder, Debug, PartialEq)]
8554pub struct GitCommitAncestorReleaseTagOpts {
8555 #[builder(setter(into, strip_option), default)]
8557 pub include_pre_release: Option<bool>,
8558}
8559#[derive(Builder, Debug, PartialEq)]
8560pub struct GitCommitReleaseTagOpts {
8561 #[builder(setter(into, strip_option), default)]
8563 pub include_pre_release: Option<bool>,
8564}
8565#[derive(Builder, Debug, PartialEq)]
8566pub struct GitCommitTreeOpts {
8567 #[builder(setter(into, strip_option), default)]
8569 pub depth: Option<isize>,
8570 #[builder(setter(into, strip_option), default)]
8572 pub discard_git_dir: Option<bool>,
8573 #[builder(setter(into, strip_option), default)]
8575 pub include_tags: Option<bool>,
8576}
8577impl IntoID<Id> for GitCommit {
8578 fn into_id(
8579 self,
8580 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8581 Box::pin(async move { self.id().await })
8582 }
8583}
8584impl Loadable for GitCommit {
8585 fn graphql_type() -> &'static str {
8586 "GitCommit"
8587 }
8588 fn from_query(
8589 proc: Option<Arc<DaggerSessionProc>>,
8590 selection: Selection,
8591 graphql_client: DynGraphQLClient,
8592 ) -> Self {
8593 Self {
8594 proc,
8595 selection,
8596 graphql_client,
8597 }
8598 }
8599}
8600impl GitCommit {
8601 pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
8607 let query = self.selection.select("ancestorReleaseTag");
8608 let query = query.select("id");
8609 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8610 Ok(id.map(|id| GitRef {
8611 proc: self.proc.clone(),
8612 selection: query
8613 .root()
8614 .select("node")
8615 .arg("id", &id.0)
8616 .inline_fragment("GitRef"),
8617 graphql_client: self.graphql_client.clone(),
8618 }))
8619 }
8620 pub async fn ancestor_release_tag_opts(
8626 &self,
8627 opts: GitCommitAncestorReleaseTagOpts,
8628 ) -> Result<Option<GitRef>, DaggerError> {
8629 let mut query = self.selection.select("ancestorReleaseTag");
8630 if let Some(include_pre_release) = opts.include_pre_release {
8631 query = query.arg("includePreRelease", include_pre_release);
8632 }
8633 let query = query.select("id");
8634 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8635 Ok(id.map(|id| GitRef {
8636 proc: self.proc.clone(),
8637 selection: query
8638 .root()
8639 .select("node")
8640 .arg("id", &id.0)
8641 .inline_fragment("GitRef"),
8642 graphql_client: self.graphql_client.clone(),
8643 }))
8644 }
8645 pub async fn author_email(&self) -> Result<String, DaggerError> {
8647 let query = self.selection.select("authorEmail");
8648 query.execute(self.graphql_client.clone()).await
8649 }
8650 pub async fn author_name(&self) -> Result<String, DaggerError> {
8652 let query = self.selection.select("authorName");
8653 query.execute(self.graphql_client.clone()).await
8654 }
8655 pub async fn authored_date(&self) -> Result<String, DaggerError> {
8657 let query = self.selection.select("authoredDate");
8658 query.execute(self.graphql_client.clone()).await
8659 }
8660 pub async fn committed_date(&self) -> Result<String, DaggerError> {
8662 let query = self.selection.select("committedDate");
8663 query.execute(self.graphql_client.clone()).await
8664 }
8665 pub async fn committer_email(&self) -> Result<String, DaggerError> {
8667 let query = self.selection.select("committerEmail");
8668 query.execute(self.graphql_client.clone()).await
8669 }
8670 pub async fn committer_name(&self) -> Result<String, DaggerError> {
8672 let query = self.selection.select("committerName");
8673 query.execute(self.graphql_client.clone()).await
8674 }
8675 pub async fn id(&self) -> Result<Id, DaggerError> {
8677 let query = self.selection.select("id");
8678 query.execute(self.graphql_client.clone()).await
8679 }
8680 pub async fn message(&self) -> Result<String, DaggerError> {
8682 let query = self.selection.select("message");
8683 query.execute(self.graphql_client.clone()).await
8684 }
8685 pub async fn message_body(&self) -> Result<String, DaggerError> {
8687 let query = self.selection.select("messageBody");
8688 query.execute(self.graphql_client.clone()).await
8689 }
8690 pub async fn message_headline(&self) -> Result<String, DaggerError> {
8692 let query = self.selection.select("messageHeadline");
8693 query.execute(self.graphql_client.clone()).await
8694 }
8695 pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
8697 let query = self.selection.select("parentShas");
8698 query.execute(self.graphql_client.clone()).await
8699 }
8700 pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
8706 let query = self.selection.select("releaseTag");
8707 let query = query.select("id");
8708 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8709 Ok(id.map(|id| GitRef {
8710 proc: self.proc.clone(),
8711 selection: query
8712 .root()
8713 .select("node")
8714 .arg("id", &id.0)
8715 .inline_fragment("GitRef"),
8716 graphql_client: self.graphql_client.clone(),
8717 }))
8718 }
8719 pub async fn release_tag_opts(
8725 &self,
8726 opts: GitCommitReleaseTagOpts,
8727 ) -> Result<Option<GitRef>, DaggerError> {
8728 let mut query = self.selection.select("releaseTag");
8729 if let Some(include_pre_release) = opts.include_pre_release {
8730 query = query.arg("includePreRelease", include_pre_release);
8731 }
8732 let query = query.select("id");
8733 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8734 Ok(id.map(|id| GitRef {
8735 proc: self.proc.clone(),
8736 selection: query
8737 .root()
8738 .select("node")
8739 .arg("id", &id.0)
8740 .inline_fragment("GitRef"),
8741 graphql_client: self.graphql_client.clone(),
8742 }))
8743 }
8744 pub async fn sha(&self) -> Result<String, DaggerError> {
8746 let query = self.selection.select("sha");
8747 query.execute(self.graphql_client.clone()).await
8748 }
8749 pub async fn short_sha(&self) -> Result<String, DaggerError> {
8751 let query = self.selection.select("shortSha");
8752 query.execute(self.graphql_client.clone()).await
8753 }
8754 pub fn tree(&self) -> Directory {
8760 let query = self.selection.select("tree");
8761 Directory {
8762 proc: self.proc.clone(),
8763 selection: query,
8764 graphql_client: self.graphql_client.clone(),
8765 }
8766 }
8767 pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
8773 let mut query = self.selection.select("tree");
8774 if let Some(discard_git_dir) = opts.discard_git_dir {
8775 query = query.arg("discardGitDir", discard_git_dir);
8776 }
8777 if let Some(depth) = opts.depth {
8778 query = query.arg("depth", depth);
8779 }
8780 if let Some(include_tags) = opts.include_tags {
8781 query = query.arg("includeTags", include_tags);
8782 }
8783 Directory {
8784 proc: self.proc.clone(),
8785 selection: query,
8786 graphql_client: self.graphql_client.clone(),
8787 }
8788 }
8789}
8790impl Node for GitCommit {
8791 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8792 let query = self.selection.select("id");
8793 let graphql_client = self.graphql_client.clone();
8794 async move { query.execute(graphql_client).await }
8795 }
8796}
8797#[derive(Clone)]
8798pub struct GitRef {
8799 pub proc: Option<Arc<DaggerSessionProc>>,
8800 pub selection: Selection,
8801 pub graphql_client: DynGraphQLClient,
8802}
8803#[derive(Builder, Debug, PartialEq)]
8804pub struct GitRefAsWorkspaceOpts<'a> {
8805 #[builder(setter(into, strip_option), default)]
8807 pub cwd: Option<&'a str>,
8808}
8809#[derive(Builder, Debug, PartialEq)]
8810pub struct GitRefLogOpts<'a> {
8811 #[builder(setter(into, strip_option), default)]
8813 pub base: Option<Id>,
8814 #[builder(setter(into, strip_option), default)]
8816 pub limit: Option<isize>,
8817 #[builder(setter(into, strip_option), default)]
8819 pub paths: Option<Vec<&'a str>>,
8820}
8821#[derive(Builder, Debug, PartialEq)]
8822pub struct GitRefTreeOpts {
8823 #[builder(setter(into, strip_option), default)]
8825 pub depth: Option<isize>,
8826 #[builder(setter(into, strip_option), default)]
8828 pub discard_git_dir: Option<bool>,
8829 #[builder(setter(into, strip_option), default)]
8831 pub include_tags: Option<bool>,
8832}
8833impl IntoID<Id> for GitRef {
8834 fn into_id(
8835 self,
8836 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8837 Box::pin(async move { self.id().await })
8838 }
8839}
8840impl Loadable for GitRef {
8841 fn graphql_type() -> &'static str {
8842 "GitRef"
8843 }
8844 fn from_query(
8845 proc: Option<Arc<DaggerSessionProc>>,
8846 selection: Selection,
8847 graphql_client: DynGraphQLClient,
8848 ) -> Self {
8849 Self {
8850 proc,
8851 selection,
8852 graphql_client,
8853 }
8854 }
8855}
8856impl GitRef {
8857 pub fn as_workspace(&self) -> Workspace {
8863 let query = self.selection.select("asWorkspace");
8864 Workspace {
8865 proc: self.proc.clone(),
8866 selection: query,
8867 graphql_client: self.graphql_client.clone(),
8868 }
8869 }
8870 pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
8876 let mut query = self.selection.select("asWorkspace");
8877 if let Some(cwd) = opts.cwd {
8878 query = query.arg("cwd", cwd);
8879 }
8880 Workspace {
8881 proc: self.proc.clone(),
8882 selection: query,
8883 graphql_client: self.graphql_client.clone(),
8884 }
8885 }
8886 pub async fn commit(&self) -> Result<String, DaggerError> {
8888 let query = self.selection.select("commit");
8889 query.execute(self.graphql_client.clone()).await
8890 }
8891 pub async fn commit_sha(&self) -> Result<String, DaggerError> {
8893 let query = self.selection.select("commitSHA");
8894 query.execute(self.graphql_client.clone()).await
8895 }
8896 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
8902 let mut query = self.selection.select("commonAncestor");
8903 query = query.arg_lazy(
8904 "other",
8905 Box::new(move || {
8906 let other = other.clone();
8907 Box::pin(async move { other.into_id().await.unwrap().quote() })
8908 }),
8909 );
8910 GitRef {
8911 proc: self.proc.clone(),
8912 selection: query,
8913 graphql_client: self.graphql_client.clone(),
8914 }
8915 }
8916 pub async fn id(&self) -> Result<Id, DaggerError> {
8918 let query = self.selection.select("id");
8919 query.execute(self.graphql_client.clone()).await
8920 }
8921 pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
8927 let query = self.selection.select("log");
8928 let query = query.select("id");
8929 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8930 Ok(ids
8931 .into_iter()
8932 .map(|id| GitCommit {
8933 proc: self.proc.clone(),
8934 selection: crate::querybuilder::query()
8935 .select("node")
8936 .arg("id", &id.0)
8937 .inline_fragment("GitCommit"),
8938 graphql_client: self.graphql_client.clone(),
8939 })
8940 .collect())
8941 }
8942 pub async fn log_opts<'a>(
8948 &self,
8949 opts: GitRefLogOpts<'a>,
8950 ) -> Result<Vec<GitCommit>, DaggerError> {
8951 let mut query = self.selection.select("log");
8952 if let Some(limit) = opts.limit {
8953 query = query.arg("limit", limit);
8954 }
8955 if let Some(paths) = opts.paths {
8956 query = query.arg("paths", paths);
8957 }
8958 if let Some(base) = opts.base {
8959 query = query.arg("base", base);
8960 }
8961 let query = query.select("id");
8962 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8963 Ok(ids
8964 .into_iter()
8965 .map(|id| GitCommit {
8966 proc: self.proc.clone(),
8967 selection: crate::querybuilder::query()
8968 .select("node")
8969 .arg("id", &id.0)
8970 .inline_fragment("GitCommit"),
8971 graphql_client: self.graphql_client.clone(),
8972 })
8973 .collect())
8974 }
8975 pub async fn name(&self) -> Result<String, DaggerError> {
8977 let query = self.selection.select("name");
8978 query.execute(self.graphql_client.clone()).await
8979 }
8980 pub async fn r#ref(&self) -> Result<String, DaggerError> {
8982 let query = self.selection.select("ref");
8983 query.execute(self.graphql_client.clone()).await
8984 }
8985 pub fn target_commit(&self) -> GitCommit {
8987 let query = self.selection.select("targetCommit");
8988 GitCommit {
8989 proc: self.proc.clone(),
8990 selection: query,
8991 graphql_client: self.graphql_client.clone(),
8992 }
8993 }
8994 pub fn tree(&self) -> Directory {
9000 let query = self.selection.select("tree");
9001 Directory {
9002 proc: self.proc.clone(),
9003 selection: query,
9004 graphql_client: self.graphql_client.clone(),
9005 }
9006 }
9007 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9013 let mut query = self.selection.select("tree");
9014 if let Some(discard_git_dir) = opts.discard_git_dir {
9015 query = query.arg("discardGitDir", discard_git_dir);
9016 }
9017 if let Some(depth) = opts.depth {
9018 query = query.arg("depth", depth);
9019 }
9020 if let Some(include_tags) = opts.include_tags {
9021 query = query.arg("includeTags", include_tags);
9022 }
9023 Directory {
9024 proc: self.proc.clone(),
9025 selection: query,
9026 graphql_client: self.graphql_client.clone(),
9027 }
9028 }
9029}
9030impl Node for GitRef {
9031 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9032 let query = self.selection.select("id");
9033 let graphql_client = self.graphql_client.clone();
9034 async move { query.execute(graphql_client).await }
9035 }
9036}
9037#[derive(Clone)]
9038pub struct GitRepository {
9039 pub proc: Option<Arc<DaggerSessionProc>>,
9040 pub selection: Selection,
9041 pub graphql_client: DynGraphQLClient,
9042}
9043#[derive(Builder, Debug, PartialEq)]
9044pub struct GitRepositoryAsWorkspaceOpts<'a> {
9045 #[builder(setter(into, strip_option), default)]
9047 pub cwd: Option<&'a str>,
9048}
9049#[derive(Builder, Debug, PartialEq)]
9050pub struct GitRepositoryBranchesOpts<'a> {
9051 #[builder(setter(into, strip_option), default)]
9053 pub patterns: Option<Vec<&'a str>>,
9054}
9055#[derive(Builder, Debug, PartialEq)]
9056pub struct GitRepositoryBundleOpts {
9057 #[builder(setter(into, strip_option), default)]
9059 pub base: Option<Id>,
9060}
9061#[derive(Builder, Debug, PartialEq)]
9062pub struct GitRepositoryLatestOpts<'a> {
9063 #[builder(setter(into, strip_option), default)]
9065 pub version: Option<&'a str>,
9066}
9067#[derive(Builder, Debug, PartialEq)]
9068pub struct GitRepositoryTagsOpts<'a> {
9069 #[builder(setter(into, strip_option), default)]
9071 pub patterns: Option<Vec<&'a str>>,
9072}
9073#[derive(Builder, Debug, PartialEq)]
9074pub struct GitRepositoryWithBundleOpts<'a> {
9075 #[builder(setter(into, strip_option), default)]
9077 pub prerequisite_ref: Option<&'a str>,
9078}
9079impl IntoID<Id> for GitRepository {
9080 fn into_id(
9081 self,
9082 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9083 Box::pin(async move { self.id().await })
9084 }
9085}
9086impl Loadable for GitRepository {
9087 fn graphql_type() -> &'static str {
9088 "GitRepository"
9089 }
9090 fn from_query(
9091 proc: Option<Arc<DaggerSessionProc>>,
9092 selection: Selection,
9093 graphql_client: DynGraphQLClient,
9094 ) -> Self {
9095 Self {
9096 proc,
9097 selection,
9098 graphql_client,
9099 }
9100 }
9101}
9102impl GitRepository {
9103 pub fn as_workspace(&self) -> Workspace {
9109 let query = self.selection.select("asWorkspace");
9110 Workspace {
9111 proc: self.proc.clone(),
9112 selection: query,
9113 graphql_client: self.graphql_client.clone(),
9114 }
9115 }
9116 pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
9122 let mut query = self.selection.select("asWorkspace");
9123 if let Some(cwd) = opts.cwd {
9124 query = query.arg("cwd", cwd);
9125 }
9126 Workspace {
9127 proc: self.proc.clone(),
9128 selection: query,
9129 graphql_client: self.graphql_client.clone(),
9130 }
9131 }
9132 pub fn branch(&self, name: impl Into<String>) -> GitRef {
9138 let mut query = self.selection.select("branch");
9139 query = query.arg("name", name.into());
9140 GitRef {
9141 proc: self.proc.clone(),
9142 selection: query,
9143 graphql_client: self.graphql_client.clone(),
9144 }
9145 }
9146 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9152 let query = self.selection.select("branches");
9153 query.execute(self.graphql_client.clone()).await
9154 }
9155 pub async fn branches_opts<'a>(
9161 &self,
9162 opts: GitRepositoryBranchesOpts<'a>,
9163 ) -> Result<Vec<String>, DaggerError> {
9164 let mut query = self.selection.select("branches");
9165 if let Some(patterns) = opts.patterns {
9166 query = query.arg("patterns", patterns);
9167 }
9168 query.execute(self.graphql_client.clone()).await
9169 }
9170 pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
9177 let mut query = self.selection.select("bundle");
9178 query = query.arg(
9179 "refs",
9180 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9181 );
9182 GitBundle {
9183 proc: self.proc.clone(),
9184 selection: query,
9185 graphql_client: self.graphql_client.clone(),
9186 }
9187 }
9188 pub fn bundle_opts(
9195 &self,
9196 refs: Vec<impl Into<String>>,
9197 opts: GitRepositoryBundleOpts,
9198 ) -> GitBundle {
9199 let mut query = self.selection.select("bundle");
9200 query = query.arg(
9201 "refs",
9202 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9203 );
9204 if let Some(base) = opts.base {
9205 query = query.arg("base", base);
9206 }
9207 GitBundle {
9208 proc: self.proc.clone(),
9209 selection: query,
9210 graphql_client: self.graphql_client.clone(),
9211 }
9212 }
9213 pub fn commit(&self, id: impl Into<String>) -> GitCommit {
9219 let mut query = self.selection.select("commit");
9220 query = query.arg("id", id.into());
9221 GitCommit {
9222 proc: self.proc.clone(),
9223 selection: query,
9224 graphql_client: self.graphql_client.clone(),
9225 }
9226 }
9227 pub fn head(&self) -> GitRef {
9229 let query = self.selection.select("head");
9230 GitRef {
9231 proc: self.proc.clone(),
9232 selection: query,
9233 graphql_client: self.graphql_client.clone(),
9234 }
9235 }
9236 pub async fn id(&self) -> Result<Id, DaggerError> {
9238 let query = self.selection.select("id");
9239 query.execute(self.graphql_client.clone()).await
9240 }
9241 pub fn latest(&self) -> GitRef {
9248 let query = self.selection.select("latest");
9249 GitRef {
9250 proc: self.proc.clone(),
9251 selection: query,
9252 graphql_client: self.graphql_client.clone(),
9253 }
9254 }
9255 pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
9262 let mut query = self.selection.select("latest");
9263 if let Some(version) = opts.version {
9264 query = query.arg("version", version);
9265 }
9266 GitRef {
9267 proc: self.proc.clone(),
9268 selection: query,
9269 graphql_client: self.graphql_client.clone(),
9270 }
9271 }
9272 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
9278 let mut query = self.selection.select("ref");
9279 query = query.arg("name", name.into());
9280 GitRef {
9281 proc: self.proc.clone(),
9282 selection: query,
9283 graphql_client: self.graphql_client.clone(),
9284 }
9285 }
9286 pub fn tag(&self, name: impl Into<String>) -> GitRef {
9292 let mut query = self.selection.select("tag");
9293 query = query.arg("name", name.into());
9294 GitRef {
9295 proc: self.proc.clone(),
9296 selection: query,
9297 graphql_client: self.graphql_client.clone(),
9298 }
9299 }
9300 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
9306 let query = self.selection.select("tags");
9307 query.execute(self.graphql_client.clone()).await
9308 }
9309 pub async fn tags_opts<'a>(
9315 &self,
9316 opts: GitRepositoryTagsOpts<'a>,
9317 ) -> Result<Vec<String>, DaggerError> {
9318 let mut query = self.selection.select("tags");
9319 if let Some(patterns) = opts.patterns {
9320 query = query.arg("patterns", patterns);
9321 }
9322 query.execute(self.graphql_client.clone()).await
9323 }
9324 pub fn uncommitted(&self) -> Changeset {
9326 let query = self.selection.select("uncommitted");
9327 Changeset {
9328 proc: self.proc.clone(),
9329 selection: query,
9330 graphql_client: self.graphql_client.clone(),
9331 }
9332 }
9333 pub async fn url(&self) -> Result<String, DaggerError> {
9335 let query = self.selection.select("url");
9336 query.execute(self.graphql_client.clone()).await
9337 }
9338 pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
9345 let mut query = self.selection.select("withBundle");
9346 query = query.arg_lazy(
9347 "bundle",
9348 Box::new(move || {
9349 let bundle = bundle.clone();
9350 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
9351 }),
9352 );
9353 GitRepository {
9354 proc: self.proc.clone(),
9355 selection: query,
9356 graphql_client: self.graphql_client.clone(),
9357 }
9358 }
9359 pub fn with_bundle_opts<'a>(
9366 &self,
9367 bundle: impl IntoID<Id>,
9368 opts: GitRepositoryWithBundleOpts<'a>,
9369 ) -> GitRepository {
9370 let mut query = self.selection.select("withBundle");
9371 query = query.arg_lazy(
9372 "bundle",
9373 Box::new(move || {
9374 let bundle = bundle.clone();
9375 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
9376 }),
9377 );
9378 if let Some(prerequisite_ref) = opts.prerequisite_ref {
9379 query = query.arg("prerequisiteRef", prerequisite_ref);
9380 }
9381 GitRepository {
9382 proc: self.proc.clone(),
9383 selection: query,
9384 graphql_client: self.graphql_client.clone(),
9385 }
9386 }
9387}
9388impl Node for GitRepository {
9389 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9390 let query = self.selection.select("id");
9391 let graphql_client = self.graphql_client.clone();
9392 async move { query.execute(graphql_client).await }
9393 }
9394}
9395#[derive(Clone)]
9396pub struct HttpState {
9397 pub proc: Option<Arc<DaggerSessionProc>>,
9398 pub selection: Selection,
9399 pub graphql_client: DynGraphQLClient,
9400}
9401impl IntoID<Id> for HttpState {
9402 fn into_id(
9403 self,
9404 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9405 Box::pin(async move { self.id().await })
9406 }
9407}
9408impl Loadable for HttpState {
9409 fn graphql_type() -> &'static str {
9410 "HTTPState"
9411 }
9412 fn from_query(
9413 proc: Option<Arc<DaggerSessionProc>>,
9414 selection: Selection,
9415 graphql_client: DynGraphQLClient,
9416 ) -> Self {
9417 Self {
9418 proc,
9419 selection,
9420 graphql_client,
9421 }
9422 }
9423}
9424impl HttpState {
9425 pub async fn id(&self) -> Result<Id, DaggerError> {
9427 let query = self.selection.select("id");
9428 query.execute(self.graphql_client.clone()).await
9429 }
9430}
9431impl Node for HttpState {
9432 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9433 let query = self.selection.select("id");
9434 let graphql_client = self.graphql_client.clone();
9435 async move { query.execute(graphql_client).await }
9436 }
9437}
9438#[derive(Clone)]
9439pub struct HealthcheckConfig {
9440 pub proc: Option<Arc<DaggerSessionProc>>,
9441 pub selection: Selection,
9442 pub graphql_client: DynGraphQLClient,
9443}
9444impl IntoID<Id> for HealthcheckConfig {
9445 fn into_id(
9446 self,
9447 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9448 Box::pin(async move { self.id().await })
9449 }
9450}
9451impl Loadable for HealthcheckConfig {
9452 fn graphql_type() -> &'static str {
9453 "HealthcheckConfig"
9454 }
9455 fn from_query(
9456 proc: Option<Arc<DaggerSessionProc>>,
9457 selection: Selection,
9458 graphql_client: DynGraphQLClient,
9459 ) -> Self {
9460 Self {
9461 proc,
9462 selection,
9463 graphql_client,
9464 }
9465 }
9466}
9467impl HealthcheckConfig {
9468 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
9470 let query = self.selection.select("args");
9471 query.execute(self.graphql_client.clone()).await
9472 }
9473 pub async fn id(&self) -> Result<Id, DaggerError> {
9475 let query = self.selection.select("id");
9476 query.execute(self.graphql_client.clone()).await
9477 }
9478 pub async fn interval(&self) -> Result<String, DaggerError> {
9480 let query = self.selection.select("interval");
9481 query.execute(self.graphql_client.clone()).await
9482 }
9483 pub async fn retries(&self) -> Result<isize, DaggerError> {
9485 let query = self.selection.select("retries");
9486 query.execute(self.graphql_client.clone()).await
9487 }
9488 pub async fn shell(&self) -> Result<bool, DaggerError> {
9490 let query = self.selection.select("shell");
9491 query.execute(self.graphql_client.clone()).await
9492 }
9493 pub async fn start_interval(&self) -> Result<String, DaggerError> {
9495 let query = self.selection.select("startInterval");
9496 query.execute(self.graphql_client.clone()).await
9497 }
9498 pub async fn start_period(&self) -> Result<String, DaggerError> {
9500 let query = self.selection.select("startPeriod");
9501 query.execute(self.graphql_client.clone()).await
9502 }
9503 pub async fn timeout(&self) -> Result<String, DaggerError> {
9505 let query = self.selection.select("timeout");
9506 query.execute(self.graphql_client.clone()).await
9507 }
9508}
9509impl Node for HealthcheckConfig {
9510 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9511 let query = self.selection.select("id");
9512 let graphql_client = self.graphql_client.clone();
9513 async move { query.execute(graphql_client).await }
9514 }
9515}
9516#[derive(Clone)]
9517pub struct Host {
9518 pub proc: Option<Arc<DaggerSessionProc>>,
9519 pub selection: Selection,
9520 pub graphql_client: DynGraphQLClient,
9521}
9522#[derive(Builder, Debug, PartialEq)]
9523pub struct HostDirectoryOpts<'a> {
9524 #[builder(setter(into, strip_option), default)]
9526 pub exclude: Option<Vec<&'a str>>,
9527 #[builder(setter(into, strip_option), default)]
9529 pub gitignore: Option<bool>,
9530 #[builder(setter(into, strip_option), default)]
9532 pub include: Option<Vec<&'a str>>,
9533 #[builder(setter(into, strip_option), default)]
9535 pub no_cache: Option<bool>,
9536}
9537#[derive(Builder, Debug, PartialEq)]
9538pub struct HostFileOpts {
9539 #[builder(setter(into, strip_option), default)]
9541 pub no_cache: Option<bool>,
9542}
9543#[derive(Builder, Debug, PartialEq)]
9544pub struct HostFindUpOpts {
9545 #[builder(setter(into, strip_option), default)]
9546 pub no_cache: Option<bool>,
9547}
9548#[derive(Builder, Debug, PartialEq)]
9549pub struct HostServiceOpts<'a> {
9550 #[builder(setter(into, strip_option), default)]
9552 pub host: Option<&'a str>,
9553}
9554#[derive(Builder, Debug, PartialEq)]
9555pub struct HostTunnelOpts {
9556 #[builder(setter(into, strip_option), default)]
9559 pub native: Option<bool>,
9560 #[builder(setter(into, strip_option), default)]
9565 pub ports: Option<Vec<PortForward>>,
9566}
9567impl IntoID<Id> for Host {
9568 fn into_id(
9569 self,
9570 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9571 Box::pin(async move { self.id().await })
9572 }
9573}
9574impl Loadable for Host {
9575 fn graphql_type() -> &'static str {
9576 "Host"
9577 }
9578 fn from_query(
9579 proc: Option<Arc<DaggerSessionProc>>,
9580 selection: Selection,
9581 graphql_client: DynGraphQLClient,
9582 ) -> Self {
9583 Self {
9584 proc,
9585 selection,
9586 graphql_client,
9587 }
9588 }
9589}
9590impl Host {
9591 pub fn container_image(&self, name: impl Into<String>) -> Container {
9597 let mut query = self.selection.select("containerImage");
9598 query = query.arg("name", name.into());
9599 Container {
9600 proc: self.proc.clone(),
9601 selection: query,
9602 graphql_client: self.graphql_client.clone(),
9603 }
9604 }
9605 pub fn directory(&self, path: impl Into<String>) -> Directory {
9612 let mut query = self.selection.select("directory");
9613 query = query.arg("path", path.into());
9614 Directory {
9615 proc: self.proc.clone(),
9616 selection: query,
9617 graphql_client: self.graphql_client.clone(),
9618 }
9619 }
9620 pub fn directory_opts<'a>(
9627 &self,
9628 path: impl Into<String>,
9629 opts: HostDirectoryOpts<'a>,
9630 ) -> Directory {
9631 let mut query = self.selection.select("directory");
9632 query = query.arg("path", path.into());
9633 if let Some(exclude) = opts.exclude {
9634 query = query.arg("exclude", exclude);
9635 }
9636 if let Some(include) = opts.include {
9637 query = query.arg("include", include);
9638 }
9639 if let Some(no_cache) = opts.no_cache {
9640 query = query.arg("noCache", no_cache);
9641 }
9642 if let Some(gitignore) = opts.gitignore {
9643 query = query.arg("gitignore", gitignore);
9644 }
9645 Directory {
9646 proc: self.proc.clone(),
9647 selection: query,
9648 graphql_client: self.graphql_client.clone(),
9649 }
9650 }
9651 pub fn file(&self, path: impl Into<String>) -> File {
9658 let mut query = self.selection.select("file");
9659 query = query.arg("path", path.into());
9660 File {
9661 proc: self.proc.clone(),
9662 selection: query,
9663 graphql_client: self.graphql_client.clone(),
9664 }
9665 }
9666 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
9673 let mut query = self.selection.select("file");
9674 query = query.arg("path", path.into());
9675 if let Some(no_cache) = opts.no_cache {
9676 query = query.arg("noCache", no_cache);
9677 }
9678 File {
9679 proc: self.proc.clone(),
9680 selection: query,
9681 graphql_client: self.graphql_client.clone(),
9682 }
9683 }
9684 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
9691 let mut query = self.selection.select("findUp");
9692 query = query.arg("name", name.into());
9693 query.execute(self.graphql_client.clone()).await
9694 }
9695 pub async fn find_up_opts(
9702 &self,
9703 name: impl Into<String>,
9704 opts: HostFindUpOpts,
9705 ) -> Result<String, DaggerError> {
9706 let mut query = self.selection.select("findUp");
9707 query = query.arg("name", name.into());
9708 if let Some(no_cache) = opts.no_cache {
9709 query = query.arg("noCache", no_cache);
9710 }
9711 query.execute(self.graphql_client.clone()).await
9712 }
9713 pub async fn id(&self) -> Result<Id, DaggerError> {
9715 let query = self.selection.select("id");
9716 query.execute(self.graphql_client.clone()).await
9717 }
9718 pub fn service(&self, ports: Vec<PortForward>) -> Service {
9729 let mut query = self.selection.select("service");
9730 query = query.arg("ports", ports);
9731 Service {
9732 proc: self.proc.clone(),
9733 selection: query,
9734 graphql_client: self.graphql_client.clone(),
9735 }
9736 }
9737 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
9748 let mut query = self.selection.select("service");
9749 query = query.arg("ports", ports);
9750 if let Some(host) = opts.host {
9751 query = query.arg("host", host);
9752 }
9753 Service {
9754 proc: self.proc.clone(),
9755 selection: query,
9756 graphql_client: self.graphql_client.clone(),
9757 }
9758 }
9759 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
9766 let mut query = self.selection.select("tunnel");
9767 query = query.arg_lazy(
9768 "service",
9769 Box::new(move || {
9770 let service = service.clone();
9771 Box::pin(async move { service.into_id().await.unwrap().quote() })
9772 }),
9773 );
9774 Service {
9775 proc: self.proc.clone(),
9776 selection: query,
9777 graphql_client: self.graphql_client.clone(),
9778 }
9779 }
9780 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
9787 let mut query = self.selection.select("tunnel");
9788 query = query.arg_lazy(
9789 "service",
9790 Box::new(move || {
9791 let service = service.clone();
9792 Box::pin(async move { service.into_id().await.unwrap().quote() })
9793 }),
9794 );
9795 if let Some(native) = opts.native {
9796 query = query.arg("native", native);
9797 }
9798 if let Some(ports) = opts.ports {
9799 query = query.arg("ports", ports);
9800 }
9801 Service {
9802 proc: self.proc.clone(),
9803 selection: query,
9804 graphql_client: self.graphql_client.clone(),
9805 }
9806 }
9807 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
9813 let mut query = self.selection.select("unixSocket");
9814 query = query.arg("path", path.into());
9815 Socket {
9816 proc: self.proc.clone(),
9817 selection: query,
9818 graphql_client: self.graphql_client.clone(),
9819 }
9820 }
9821}
9822impl Node for Host {
9823 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9824 let query = self.selection.select("id");
9825 let graphql_client = self.graphql_client.clone();
9826 async move { query.execute(graphql_client).await }
9827 }
9828}
9829#[derive(Clone)]
9830pub struct InputTypeDef {
9831 pub proc: Option<Arc<DaggerSessionProc>>,
9832 pub selection: Selection,
9833 pub graphql_client: DynGraphQLClient,
9834}
9835impl IntoID<Id> for InputTypeDef {
9836 fn into_id(
9837 self,
9838 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9839 Box::pin(async move { self.id().await })
9840 }
9841}
9842impl Loadable for InputTypeDef {
9843 fn graphql_type() -> &'static str {
9844 "InputTypeDef"
9845 }
9846 fn from_query(
9847 proc: Option<Arc<DaggerSessionProc>>,
9848 selection: Selection,
9849 graphql_client: DynGraphQLClient,
9850 ) -> Self {
9851 Self {
9852 proc,
9853 selection,
9854 graphql_client,
9855 }
9856 }
9857}
9858impl InputTypeDef {
9859 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
9861 let query = self.selection.select("fields");
9862 let query = query.select("id");
9863 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9864 Ok(ids
9865 .into_iter()
9866 .map(|id| FieldTypeDef {
9867 proc: self.proc.clone(),
9868 selection: crate::querybuilder::query()
9869 .select("node")
9870 .arg("id", &id.0)
9871 .inline_fragment("FieldTypeDef"),
9872 graphql_client: self.graphql_client.clone(),
9873 })
9874 .collect())
9875 }
9876 pub async fn id(&self) -> Result<Id, DaggerError> {
9878 let query = self.selection.select("id");
9879 query.execute(self.graphql_client.clone()).await
9880 }
9881 pub async fn name(&self) -> Result<String, DaggerError> {
9883 let query = self.selection.select("name");
9884 query.execute(self.graphql_client.clone()).await
9885 }
9886}
9887impl Node for InputTypeDef {
9888 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9889 let query = self.selection.select("id");
9890 let graphql_client = self.graphql_client.clone();
9891 async move { query.execute(graphql_client).await }
9892 }
9893}
9894#[derive(Clone)]
9895pub struct InterfaceTypeDef {
9896 pub proc: Option<Arc<DaggerSessionProc>>,
9897 pub selection: Selection,
9898 pub graphql_client: DynGraphQLClient,
9899}
9900impl IntoID<Id> for InterfaceTypeDef {
9901 fn into_id(
9902 self,
9903 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9904 Box::pin(async move { self.id().await })
9905 }
9906}
9907impl Loadable for InterfaceTypeDef {
9908 fn graphql_type() -> &'static str {
9909 "InterfaceTypeDef"
9910 }
9911 fn from_query(
9912 proc: Option<Arc<DaggerSessionProc>>,
9913 selection: Selection,
9914 graphql_client: DynGraphQLClient,
9915 ) -> Self {
9916 Self {
9917 proc,
9918 selection,
9919 graphql_client,
9920 }
9921 }
9922}
9923impl InterfaceTypeDef {
9924 pub async fn description(&self) -> Result<String, DaggerError> {
9926 let query = self.selection.select("description");
9927 query.execute(self.graphql_client.clone()).await
9928 }
9929 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
9931 let query = self.selection.select("functions");
9932 let query = query.select("id");
9933 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9934 Ok(ids
9935 .into_iter()
9936 .map(|id| Function {
9937 proc: self.proc.clone(),
9938 selection: crate::querybuilder::query()
9939 .select("node")
9940 .arg("id", &id.0)
9941 .inline_fragment("Function"),
9942 graphql_client: self.graphql_client.clone(),
9943 })
9944 .collect())
9945 }
9946 pub async fn id(&self) -> Result<Id, DaggerError> {
9948 let query = self.selection.select("id");
9949 query.execute(self.graphql_client.clone()).await
9950 }
9951 pub async fn name(&self) -> Result<String, DaggerError> {
9953 let query = self.selection.select("name");
9954 query.execute(self.graphql_client.clone()).await
9955 }
9956 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9958 let query = self.selection.select("sourceMap");
9959 let query = query.select("id");
9960 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9961 Ok(id.map(|id| SourceMap {
9962 proc: self.proc.clone(),
9963 selection: query
9964 .root()
9965 .select("node")
9966 .arg("id", &id.0)
9967 .inline_fragment("SourceMap"),
9968 graphql_client: self.graphql_client.clone(),
9969 }))
9970 }
9971 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9973 let query = self.selection.select("sourceModuleName");
9974 query.execute(self.graphql_client.clone()).await
9975 }
9976}
9977impl Node for InterfaceTypeDef {
9978 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9979 let query = self.selection.select("id");
9980 let graphql_client = self.graphql_client.clone();
9981 async move { query.execute(graphql_client).await }
9982 }
9983}
9984#[derive(Clone)]
9985pub struct JsonValue {
9986 pub proc: Option<Arc<DaggerSessionProc>>,
9987 pub selection: Selection,
9988 pub graphql_client: DynGraphQLClient,
9989}
9990#[derive(Builder, Debug, PartialEq)]
9991pub struct JsonValueContentsOpts<'a> {
9992 #[builder(setter(into, strip_option), default)]
9994 pub indent: Option<&'a str>,
9995 #[builder(setter(into, strip_option), default)]
9997 pub pretty: Option<bool>,
9998}
9999impl IntoID<Id> for JsonValue {
10000 fn into_id(
10001 self,
10002 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10003 Box::pin(async move { self.id().await })
10004 }
10005}
10006impl Loadable for JsonValue {
10007 fn graphql_type() -> &'static str {
10008 "JSONValue"
10009 }
10010 fn from_query(
10011 proc: Option<Arc<DaggerSessionProc>>,
10012 selection: Selection,
10013 graphql_client: DynGraphQLClient,
10014 ) -> Self {
10015 Self {
10016 proc,
10017 selection,
10018 graphql_client,
10019 }
10020 }
10021}
10022impl JsonValue {
10023 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10025 let query = self.selection.select("asArray");
10026 let query = query.select("id");
10027 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10028 Ok(ids
10029 .into_iter()
10030 .map(|id| JsonValue {
10031 proc: self.proc.clone(),
10032 selection: crate::querybuilder::query()
10033 .select("node")
10034 .arg("id", &id.0)
10035 .inline_fragment("JSONValue"),
10036 graphql_client: self.graphql_client.clone(),
10037 })
10038 .collect())
10039 }
10040 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10042 let query = self.selection.select("asBoolean");
10043 query.execute(self.graphql_client.clone()).await
10044 }
10045 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10047 let query = self.selection.select("asInteger");
10048 query.execute(self.graphql_client.clone()).await
10049 }
10050 pub async fn as_string(&self) -> Result<String, DaggerError> {
10052 let query = self.selection.select("asString");
10053 query.execute(self.graphql_client.clone()).await
10054 }
10055 pub async fn contents(&self) -> Result<Json, DaggerError> {
10061 let query = self.selection.select("contents");
10062 query.execute(self.graphql_client.clone()).await
10063 }
10064 pub async fn contents_opts<'a>(
10070 &self,
10071 opts: JsonValueContentsOpts<'a>,
10072 ) -> Result<Json, DaggerError> {
10073 let mut query = self.selection.select("contents");
10074 if let Some(pretty) = opts.pretty {
10075 query = query.arg("pretty", pretty);
10076 }
10077 if let Some(indent) = opts.indent {
10078 query = query.arg("indent", indent);
10079 }
10080 query.execute(self.graphql_client.clone()).await
10081 }
10082 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10088 let mut query = self.selection.select("field");
10089 query = query.arg(
10090 "path",
10091 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10092 );
10093 JsonValue {
10094 proc: self.proc.clone(),
10095 selection: query,
10096 graphql_client: self.graphql_client.clone(),
10097 }
10098 }
10099 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10101 let query = self.selection.select("fields");
10102 query.execute(self.graphql_client.clone()).await
10103 }
10104 pub async fn id(&self) -> Result<Id, DaggerError> {
10106 let query = self.selection.select("id");
10107 query.execute(self.graphql_client.clone()).await
10108 }
10109 pub fn new_boolean(&self, value: bool) -> JsonValue {
10115 let mut query = self.selection.select("newBoolean");
10116 query = query.arg("value", value);
10117 JsonValue {
10118 proc: self.proc.clone(),
10119 selection: query,
10120 graphql_client: self.graphql_client.clone(),
10121 }
10122 }
10123 pub fn new_integer(&self, value: isize) -> JsonValue {
10129 let mut query = self.selection.select("newInteger");
10130 query = query.arg("value", value);
10131 JsonValue {
10132 proc: self.proc.clone(),
10133 selection: query,
10134 graphql_client: self.graphql_client.clone(),
10135 }
10136 }
10137 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10143 let mut query = self.selection.select("newString");
10144 query = query.arg("value", value.into());
10145 JsonValue {
10146 proc: self.proc.clone(),
10147 selection: query,
10148 graphql_client: self.graphql_client.clone(),
10149 }
10150 }
10151 pub fn with_contents(&self, contents: Json) -> JsonValue {
10157 let mut query = self.selection.select("withContents");
10158 query = query.arg("contents", contents);
10159 JsonValue {
10160 proc: self.proc.clone(),
10161 selection: query,
10162 graphql_client: self.graphql_client.clone(),
10163 }
10164 }
10165 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10172 let mut query = self.selection.select("withField");
10173 query = query.arg(
10174 "path",
10175 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10176 );
10177 query = query.arg_lazy(
10178 "value",
10179 Box::new(move || {
10180 let value = value.clone();
10181 Box::pin(async move { value.into_id().await.unwrap().quote() })
10182 }),
10183 );
10184 JsonValue {
10185 proc: self.proc.clone(),
10186 selection: query,
10187 graphql_client: self.graphql_client.clone(),
10188 }
10189 }
10190}
10191impl Node for JsonValue {
10192 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10193 let query = self.selection.select("id");
10194 let graphql_client = self.graphql_client.clone();
10195 async move { query.execute(graphql_client).await }
10196 }
10197}
10198#[derive(Clone)]
10199pub struct Llm {
10200 pub proc: Option<Arc<DaggerSessionProc>>,
10201 pub selection: Selection,
10202 pub graphql_client: DynGraphQLClient,
10203}
10204#[derive(Builder, Debug, PartialEq)]
10205pub struct LlmLoopOpts {
10206 #[builder(setter(into, strip_option), default)]
10208 pub max_steps: Option<isize>,
10209 #[builder(setter(into, strip_option), default)]
10211 pub max_tokens: Option<isize>,
10212}
10213#[derive(Builder, Debug, PartialEq)]
10214pub struct LlmStepOpts {
10215 #[builder(setter(into, strip_option), default)]
10217 pub max_tokens: Option<isize>,
10218}
10219#[derive(Builder, Debug, PartialEq)]
10220pub struct LlmWithModelOpts<'a> {
10221 #[builder(setter(into, strip_option), default)]
10223 pub provider: Option<&'a str>,
10224}
10225#[derive(Builder, Debug, PartialEq)]
10226pub struct LlmWithResponseOpts {
10227 #[builder(setter(into, strip_option), default)]
10229 pub cached_token_reads: Option<isize>,
10230 #[builder(setter(into, strip_option), default)]
10232 pub cached_token_writes: Option<isize>,
10233 #[builder(setter(into, strip_option), default)]
10235 pub input_tokens: Option<isize>,
10236 #[builder(setter(into, strip_option), default)]
10238 pub output_tokens: Option<isize>,
10239 #[builder(setter(into, strip_option), default)]
10241 pub total_tokens: Option<isize>,
10242}
10243#[derive(Builder, Debug, PartialEq)]
10244pub struct LlmWithToolsOpts<'a> {
10245 #[builder(setter(into, strip_option), default)]
10247 pub except: Option<Vec<&'a str>>,
10248}
10249impl IntoID<Id> for Llm {
10250 fn into_id(
10251 self,
10252 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10253 Box::pin(async move { self.id().await })
10254 }
10255}
10256impl Loadable for Llm {
10257 fn graphql_type() -> &'static str {
10258 "LLM"
10259 }
10260 fn from_query(
10261 proc: Option<Arc<DaggerSessionProc>>,
10262 selection: Selection,
10263 graphql_client: DynGraphQLClient,
10264 ) -> Self {
10265 Self {
10266 proc,
10267 selection,
10268 graphql_client,
10269 }
10270 }
10271}
10272impl Llm {
10273 pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
10275 let query = self.selection.select("contextTokens");
10276 query.execute(self.graphql_client.clone()).await
10277 }
10278 pub async fn context_window(&self) -> Result<isize, DaggerError> {
10280 let query = self.selection.select("contextWindow");
10281 query.execute(self.graphql_client.clone()).await
10282 }
10283 pub fn fork(&self, label: impl Into<String>) -> Llm {
10289 let mut query = self.selection.select("fork");
10290 query = query.arg("label", label.into());
10291 Llm {
10292 proc: self.proc.clone(),
10293 selection: query,
10294 graphql_client: self.graphql_client.clone(),
10295 }
10296 }
10297 pub async fn has_pending(&self) -> Result<bool, DaggerError> {
10299 let query = self.selection.select("hasPending");
10300 query.execute(self.graphql_client.clone()).await
10301 }
10302 pub async fn id(&self) -> Result<Id, DaggerError> {
10304 let query = self.selection.select("id");
10305 query.execute(self.graphql_client.clone()).await
10306 }
10307 pub async fn last_reply(&self) -> Result<String, DaggerError> {
10309 let query = self.selection.select("lastReply");
10310 query.execute(self.graphql_client.clone()).await
10311 }
10312 pub fn r#loop(&self) -> Llm {
10318 let query = self.selection.select("loop");
10319 Llm {
10320 proc: self.proc.clone(),
10321 selection: query,
10322 graphql_client: self.graphql_client.clone(),
10323 }
10324 }
10325 pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
10331 let mut query = self.selection.select("loop");
10332 if let Some(max_steps) = opts.max_steps {
10333 query = query.arg("maxSteps", max_steps);
10334 }
10335 if let Some(max_tokens) = opts.max_tokens {
10336 query = query.arg("maxTokens", max_tokens);
10337 }
10338 Llm {
10339 proc: self.proc.clone(),
10340 selection: query,
10341 graphql_client: self.graphql_client.clone(),
10342 }
10343 }
10344 pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
10346 let query = self.selection.select("messages");
10347 let query = query.select("id");
10348 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10349 Ok(ids
10350 .into_iter()
10351 .map(|id| LlmMessage {
10352 proc: self.proc.clone(),
10353 selection: crate::querybuilder::query()
10354 .select("node")
10355 .arg("id", &id.0)
10356 .inline_fragment("LLMMessage"),
10357 graphql_client: self.graphql_client.clone(),
10358 })
10359 .collect())
10360 }
10361 pub async fn model(&self) -> Result<String, DaggerError> {
10363 let query = self.selection.select("model");
10364 query.execute(self.graphql_client.clone()).await
10365 }
10366 pub async fn portable_id(&self) -> Result<Id, DaggerError> {
10368 let query = self.selection.select("portableID");
10369 query.execute(self.graphql_client.clone()).await
10370 }
10371 pub async fn provider(&self) -> Result<String, DaggerError> {
10373 let query = self.selection.select("provider");
10374 query.execute(self.graphql_client.clone()).await
10375 }
10376 pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
10378 let query = self.selection.select("reasoningEffort");
10379 query.execute(self.graphql_client.clone()).await
10380 }
10381 pub async fn replay(&self) -> Result<Llm, DaggerError> {
10383 let query = self.selection.select("replay");
10384 let id: Id = query.execute(self.graphql_client.clone()).await?;
10385 Ok(Llm {
10386 proc: self.proc.clone(),
10387 selection: query
10388 .root()
10389 .select("node")
10390 .arg("id", &id.0)
10391 .inline_fragment("LLM"),
10392 graphql_client: self.graphql_client.clone(),
10393 })
10394 }
10395 pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
10397 let query = self.selection.select("skills");
10398 let query = query.select("id");
10399 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10400 Ok(ids
10401 .into_iter()
10402 .map(|id| LlmSkill {
10403 proc: self.proc.clone(),
10404 selection: crate::querybuilder::query()
10405 .select("node")
10406 .arg("id", &id.0)
10407 .inline_fragment("LLMSkill"),
10408 graphql_client: self.graphql_client.clone(),
10409 })
10410 .collect())
10411 }
10412 pub fn step(&self) -> Llm {
10418 let query = self.selection.select("step");
10419 Llm {
10420 proc: self.proc.clone(),
10421 selection: query,
10422 graphql_client: self.graphql_client.clone(),
10423 }
10424 }
10425 pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
10431 let mut query = self.selection.select("step");
10432 if let Some(max_tokens) = opts.max_tokens {
10433 query = query.arg("maxTokens", max_tokens);
10434 }
10435 Llm {
10436 proc: self.proc.clone(),
10437 selection: query,
10438 graphql_client: self.graphql_client.clone(),
10439 }
10440 }
10441 pub async fn sync(&self) -> Result<Llm, DaggerError> {
10443 let query = self.selection.select("sync");
10444 let id: Id = query.execute(self.graphql_client.clone()).await?;
10445 Ok(Llm {
10446 proc: self.proc.clone(),
10447 selection: query
10448 .root()
10449 .select("node")
10450 .arg("id", &id.0)
10451 .inline_fragment("LLM"),
10452 graphql_client: self.graphql_client.clone(),
10453 })
10454 }
10455 pub fn token_usage(&self) -> LlmTokenUsage {
10457 let query = self.selection.select("tokenUsage");
10458 LlmTokenUsage {
10459 proc: self.proc.clone(),
10460 selection: query,
10461 graphql_client: self.graphql_client.clone(),
10462 }
10463 }
10464 pub async fn tools(&self) -> Result<String, DaggerError> {
10466 let query = self.selection.select("tools");
10467 query.execute(self.graphql_client.clone()).await
10468 }
10469 pub async fn transcript(&self) -> Result<String, DaggerError> {
10471 let query = self.selection.select("transcript");
10472 query.execute(self.graphql_client.clone()).await
10473 }
10474 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
10481 let mut query = self.selection.select("withMCPServer");
10482 query = query.arg("name", name.into());
10483 query = query.arg_lazy(
10484 "service",
10485 Box::new(move || {
10486 let service = service.clone();
10487 Box::pin(async move { service.into_id().await.unwrap().quote() })
10488 }),
10489 );
10490 Llm {
10491 proc: self.proc.clone(),
10492 selection: query,
10493 graphql_client: self.graphql_client.clone(),
10494 }
10495 }
10496 pub fn with_model(&self, model: impl Into<String>) -> Llm {
10503 let mut query = self.selection.select("withModel");
10504 query = query.arg("model", model.into());
10505 Llm {
10506 proc: self.proc.clone(),
10507 selection: query,
10508 graphql_client: self.graphql_client.clone(),
10509 }
10510 }
10511 pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
10518 let mut query = self.selection.select("withModel");
10519 query = query.arg("model", model.into());
10520 if let Some(provider) = opts.provider {
10521 query = query.arg("provider", provider);
10522 }
10523 Llm {
10524 proc: self.proc.clone(),
10525 selection: query,
10526 graphql_client: self.graphql_client.clone(),
10527 }
10528 }
10529 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
10535 let mut query = self.selection.select("withPrompt");
10536 query = query.arg("prompt", prompt.into());
10537 Llm {
10538 proc: self.proc.clone(),
10539 selection: query,
10540 graphql_client: self.graphql_client.clone(),
10541 }
10542 }
10543 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
10549 let mut query = self.selection.select("withPromptFile");
10550 query = query.arg_lazy(
10551 "file",
10552 Box::new(move || {
10553 let file = file.clone();
10554 Box::pin(async move { file.into_id().await.unwrap().quote() })
10555 }),
10556 );
10557 Llm {
10558 proc: self.proc.clone(),
10559 selection: query,
10560 graphql_client: self.graphql_client.clone(),
10561 }
10562 }
10563 pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
10569 let mut query = self.selection.select("withReasoningEffort");
10570 query = query.arg("effort", effort.into());
10571 Llm {
10572 proc: self.proc.clone(),
10573 selection: query,
10574 graphql_client: self.graphql_client.clone(),
10575 }
10576 }
10577 pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
10584 let mut query = self.selection.select("withResponse");
10585 query = query.arg("content", content);
10586 Llm {
10587 proc: self.proc.clone(),
10588 selection: query,
10589 graphql_client: self.graphql_client.clone(),
10590 }
10591 }
10592 pub fn with_response_opts(
10599 &self,
10600 content: Vec<LlmContentBlockInput>,
10601 opts: LlmWithResponseOpts,
10602 ) -> Llm {
10603 let mut query = self.selection.select("withResponse");
10604 query = query.arg("content", content);
10605 if let Some(input_tokens) = opts.input_tokens {
10606 query = query.arg("inputTokens", input_tokens);
10607 }
10608 if let Some(output_tokens) = opts.output_tokens {
10609 query = query.arg("outputTokens", output_tokens);
10610 }
10611 if let Some(cached_token_reads) = opts.cached_token_reads {
10612 query = query.arg("cachedTokenReads", cached_token_reads);
10613 }
10614 if let Some(cached_token_writes) = opts.cached_token_writes {
10615 query = query.arg("cachedTokenWrites", cached_token_writes);
10616 }
10617 if let Some(total_tokens) = opts.total_tokens {
10618 query = query.arg("totalTokens", total_tokens);
10619 }
10620 Llm {
10621 proc: self.proc.clone(),
10622 selection: query,
10623 graphql_client: self.graphql_client.clone(),
10624 }
10625 }
10626 pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
10632 let mut query = self.selection.select("withSkills");
10633 query = query.arg_lazy(
10634 "directory",
10635 Box::new(move || {
10636 let directory = directory.clone();
10637 Box::pin(async move { directory.into_id().await.unwrap().quote() })
10638 }),
10639 );
10640 Llm {
10641 proc: self.proc.clone(),
10642 selection: query,
10643 graphql_client: self.graphql_client.clone(),
10644 }
10645 }
10646 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
10652 let mut query = self.selection.select("withSystemPrompt");
10653 query = query.arg("prompt", prompt.into());
10654 Llm {
10655 proc: self.proc.clone(),
10656 selection: query,
10657 graphql_client: self.graphql_client.clone(),
10658 }
10659 }
10660 pub fn with_tool_result(
10668 &self,
10669 call_id: impl Into<String>,
10670 content: impl Into<String>,
10671 errored: bool,
10672 ) -> Llm {
10673 let mut query = self.selection.select("withToolResult");
10674 query = query.arg("callId", call_id.into());
10675 query = query.arg("content", content.into());
10676 query = query.arg("errored", errored);
10677 Llm {
10678 proc: self.proc.clone(),
10679 selection: query,
10680 graphql_client: self.graphql_client.clone(),
10681 }
10682 }
10683 pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
10690 let mut query = self.selection.select("withTools");
10691 query = query.arg_lazy(
10692 "object",
10693 Box::new(move || {
10694 let object = object.clone();
10695 Box::pin(async move { object.into_id().await.unwrap().quote() })
10696 }),
10697 );
10698 Llm {
10699 proc: self.proc.clone(),
10700 selection: query,
10701 graphql_client: self.graphql_client.clone(),
10702 }
10703 }
10704 pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
10711 let mut query = self.selection.select("withTools");
10712 query = query.arg_lazy(
10713 "object",
10714 Box::new(move || {
10715 let object = object.clone();
10716 Box::pin(async move { object.into_id().await.unwrap().quote() })
10717 }),
10718 );
10719 if let Some(except) = opts.except {
10720 query = query.arg("except", except);
10721 }
10722 Llm {
10723 proc: self.proc.clone(),
10724 selection: query,
10725 graphql_client: self.graphql_client.clone(),
10726 }
10727 }
10728 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
10734 let mut query = self.selection.select("withWorkspace");
10735 query = query.arg_lazy(
10736 "workspace",
10737 Box::new(move || {
10738 let workspace = workspace.clone();
10739 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
10740 }),
10741 );
10742 Llm {
10743 proc: self.proc.clone(),
10744 selection: query,
10745 graphql_client: self.graphql_client.clone(),
10746 }
10747 }
10748 pub fn without_default_system_prompt(&self) -> Llm {
10750 let query = self.selection.select("withoutDefaultSystemPrompt");
10751 Llm {
10752 proc: self.proc.clone(),
10753 selection: query,
10754 graphql_client: self.graphql_client.clone(),
10755 }
10756 }
10757 pub fn without_message_history(&self) -> Llm {
10759 let query = self.selection.select("withoutMessageHistory");
10760 Llm {
10761 proc: self.proc.clone(),
10762 selection: query,
10763 graphql_client: self.graphql_client.clone(),
10764 }
10765 }
10766 pub fn without_system_prompts(&self) -> Llm {
10768 let query = self.selection.select("withoutSystemPrompts");
10769 Llm {
10770 proc: self.proc.clone(),
10771 selection: query,
10772 graphql_client: self.graphql_client.clone(),
10773 }
10774 }
10775 pub fn workspace(&self) -> Workspace {
10777 let query = self.selection.select("workspace");
10778 Workspace {
10779 proc: self.proc.clone(),
10780 selection: query,
10781 graphql_client: self.graphql_client.clone(),
10782 }
10783 }
10784}
10785impl Node for Llm {
10786 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10787 let query = self.selection.select("id");
10788 let graphql_client = self.graphql_client.clone();
10789 async move { query.execute(graphql_client).await }
10790 }
10791}
10792impl Syncer for Llm {
10793 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10794 let query = self.selection.select("id");
10795 let graphql_client = self.graphql_client.clone();
10796 async move { query.execute(graphql_client).await }
10797 }
10798 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10799 let query = self.selection.select("sync");
10800 let graphql_client = self.graphql_client.clone();
10801 async move { query.execute(graphql_client).await }
10802 }
10803}
10804#[derive(Clone)]
10805pub struct LlmContentBlock {
10806 pub proc: Option<Arc<DaggerSessionProc>>,
10807 pub selection: Selection,
10808 pub graphql_client: DynGraphQLClient,
10809}
10810impl IntoID<Id> for LlmContentBlock {
10811 fn into_id(
10812 self,
10813 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10814 Box::pin(async move { self.id().await })
10815 }
10816}
10817impl Loadable for LlmContentBlock {
10818 fn graphql_type() -> &'static str {
10819 "LLMContentBlock"
10820 }
10821 fn from_query(
10822 proc: Option<Arc<DaggerSessionProc>>,
10823 selection: Selection,
10824 graphql_client: DynGraphQLClient,
10825 ) -> Self {
10826 Self {
10827 proc,
10828 selection,
10829 graphql_client,
10830 }
10831 }
10832}
10833impl LlmContentBlock {
10834 pub async fn arguments(&self) -> Result<Json, DaggerError> {
10836 let query = self.selection.select("arguments");
10837 query.execute(self.graphql_client.clone()).await
10838 }
10839 pub async fn call_id(&self) -> Result<String, DaggerError> {
10841 let query = self.selection.select("callId");
10842 query.execute(self.graphql_client.clone()).await
10843 }
10844 pub async fn errored(&self) -> Result<bool, DaggerError> {
10846 let query = self.selection.select("errored");
10847 query.execute(self.graphql_client.clone()).await
10848 }
10849 pub async fn id(&self) -> Result<Id, DaggerError> {
10851 let query = self.selection.select("id");
10852 query.execute(self.graphql_client.clone()).await
10853 }
10854 pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
10856 let query = self.selection.select("kind");
10857 query.execute(self.graphql_client.clone()).await
10858 }
10859 pub async fn signature(&self) -> Result<String, DaggerError> {
10861 let query = self.selection.select("signature");
10862 query.execute(self.graphql_client.clone()).await
10863 }
10864 pub async fn text(&self) -> Result<String, DaggerError> {
10866 let query = self.selection.select("text");
10867 query.execute(self.graphql_client.clone()).await
10868 }
10869 pub async fn tool_name(&self) -> Result<String, DaggerError> {
10871 let query = self.selection.select("toolName");
10872 query.execute(self.graphql_client.clone()).await
10873 }
10874}
10875impl Node for LlmContentBlock {
10876 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10877 let query = self.selection.select("id");
10878 let graphql_client = self.graphql_client.clone();
10879 async move { query.execute(graphql_client).await }
10880 }
10881}
10882#[derive(Clone)]
10883pub struct LlmMessage {
10884 pub proc: Option<Arc<DaggerSessionProc>>,
10885 pub selection: Selection,
10886 pub graphql_client: DynGraphQLClient,
10887}
10888impl IntoID<Id> for LlmMessage {
10889 fn into_id(
10890 self,
10891 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10892 Box::pin(async move { self.id().await })
10893 }
10894}
10895impl Loadable for LlmMessage {
10896 fn graphql_type() -> &'static str {
10897 "LLMMessage"
10898 }
10899 fn from_query(
10900 proc: Option<Arc<DaggerSessionProc>>,
10901 selection: Selection,
10902 graphql_client: DynGraphQLClient,
10903 ) -> Self {
10904 Self {
10905 proc,
10906 selection,
10907 graphql_client,
10908 }
10909 }
10910}
10911impl LlmMessage {
10912 pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
10914 let query = self.selection.select("content");
10915 let query = query.select("id");
10916 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10917 Ok(ids
10918 .into_iter()
10919 .map(|id| LlmContentBlock {
10920 proc: self.proc.clone(),
10921 selection: crate::querybuilder::query()
10922 .select("node")
10923 .arg("id", &id.0)
10924 .inline_fragment("LLMContentBlock"),
10925 graphql_client: self.graphql_client.clone(),
10926 })
10927 .collect())
10928 }
10929 pub async fn id(&self) -> Result<Id, DaggerError> {
10931 let query = self.selection.select("id");
10932 query.execute(self.graphql_client.clone()).await
10933 }
10934 pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
10936 let query = self.selection.select("role");
10937 query.execute(self.graphql_client.clone()).await
10938 }
10939 pub fn token_usage(&self) -> LlmTokenUsage {
10941 let query = self.selection.select("tokenUsage");
10942 LlmTokenUsage {
10943 proc: self.proc.clone(),
10944 selection: query,
10945 graphql_client: self.graphql_client.clone(),
10946 }
10947 }
10948}
10949impl Node for LlmMessage {
10950 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10951 let query = self.selection.select("id");
10952 let graphql_client = self.graphql_client.clone();
10953 async move { query.execute(graphql_client).await }
10954 }
10955}
10956#[derive(Clone)]
10957pub struct LlmSkill {
10958 pub proc: Option<Arc<DaggerSessionProc>>,
10959 pub selection: Selection,
10960 pub graphql_client: DynGraphQLClient,
10961}
10962impl IntoID<Id> for LlmSkill {
10963 fn into_id(
10964 self,
10965 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10966 Box::pin(async move { self.id().await })
10967 }
10968}
10969impl Loadable for LlmSkill {
10970 fn graphql_type() -> &'static str {
10971 "LLMSkill"
10972 }
10973 fn from_query(
10974 proc: Option<Arc<DaggerSessionProc>>,
10975 selection: Selection,
10976 graphql_client: DynGraphQLClient,
10977 ) -> Self {
10978 Self {
10979 proc,
10980 selection,
10981 graphql_client,
10982 }
10983 }
10984}
10985impl LlmSkill {
10986 pub async fn description(&self) -> Result<String, DaggerError> {
10988 let query = self.selection.select("description");
10989 query.execute(self.graphql_client.clone()).await
10990 }
10991 pub async fn id(&self) -> Result<Id, DaggerError> {
10993 let query = self.selection.select("id");
10994 query.execute(self.graphql_client.clone()).await
10995 }
10996 pub async fn name(&self) -> Result<String, DaggerError> {
10998 let query = self.selection.select("name");
10999 query.execute(self.graphql_client.clone()).await
11000 }
11001}
11002impl Node for LlmSkill {
11003 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11004 let query = self.selection.select("id");
11005 let graphql_client = self.graphql_client.clone();
11006 async move { query.execute(graphql_client).await }
11007 }
11008}
11009#[derive(Clone)]
11010pub struct LlmTokenUsage {
11011 pub proc: Option<Arc<DaggerSessionProc>>,
11012 pub selection: Selection,
11013 pub graphql_client: DynGraphQLClient,
11014}
11015impl IntoID<Id> for LlmTokenUsage {
11016 fn into_id(
11017 self,
11018 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11019 Box::pin(async move { self.id().await })
11020 }
11021}
11022impl Loadable for LlmTokenUsage {
11023 fn graphql_type() -> &'static str {
11024 "LLMTokenUsage"
11025 }
11026 fn from_query(
11027 proc: Option<Arc<DaggerSessionProc>>,
11028 selection: Selection,
11029 graphql_client: DynGraphQLClient,
11030 ) -> Self {
11031 Self {
11032 proc,
11033 selection,
11034 graphql_client,
11035 }
11036 }
11037}
11038impl LlmTokenUsage {
11039 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11041 let query = self.selection.select("cachedTokenReads");
11042 query.execute(self.graphql_client.clone()).await
11043 }
11044 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11046 let query = self.selection.select("cachedTokenWrites");
11047 query.execute(self.graphql_client.clone()).await
11048 }
11049 pub async fn id(&self) -> Result<Id, DaggerError> {
11051 let query = self.selection.select("id");
11052 query.execute(self.graphql_client.clone()).await
11053 }
11054 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11056 let query = self.selection.select("inputTokens");
11057 query.execute(self.graphql_client.clone()).await
11058 }
11059 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11061 let query = self.selection.select("outputTokens");
11062 query.execute(self.graphql_client.clone()).await
11063 }
11064 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11066 let query = self.selection.select("totalTokens");
11067 query.execute(self.graphql_client.clone()).await
11068 }
11069}
11070impl Node for LlmTokenUsage {
11071 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11072 let query = self.selection.select("id");
11073 let graphql_client = self.graphql_client.clone();
11074 async move { query.execute(graphql_client).await }
11075 }
11076}
11077#[derive(Clone)]
11078pub struct Label {
11079 pub proc: Option<Arc<DaggerSessionProc>>,
11080 pub selection: Selection,
11081 pub graphql_client: DynGraphQLClient,
11082}
11083impl IntoID<Id> for Label {
11084 fn into_id(
11085 self,
11086 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11087 Box::pin(async move { self.id().await })
11088 }
11089}
11090impl Loadable for Label {
11091 fn graphql_type() -> &'static str {
11092 "Label"
11093 }
11094 fn from_query(
11095 proc: Option<Arc<DaggerSessionProc>>,
11096 selection: Selection,
11097 graphql_client: DynGraphQLClient,
11098 ) -> Self {
11099 Self {
11100 proc,
11101 selection,
11102 graphql_client,
11103 }
11104 }
11105}
11106impl Label {
11107 pub async fn id(&self) -> Result<Id, DaggerError> {
11109 let query = self.selection.select("id");
11110 query.execute(self.graphql_client.clone()).await
11111 }
11112 pub async fn name(&self) -> Result<String, DaggerError> {
11114 let query = self.selection.select("name");
11115 query.execute(self.graphql_client.clone()).await
11116 }
11117 pub async fn value(&self) -> Result<String, DaggerError> {
11119 let query = self.selection.select("value");
11120 query.execute(self.graphql_client.clone()).await
11121 }
11122}
11123impl Node for Label {
11124 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11125 let query = self.selection.select("id");
11126 let graphql_client = self.graphql_client.clone();
11127 async move { query.execute(graphql_client).await }
11128 }
11129}
11130#[derive(Clone)]
11131pub struct ListTypeDef {
11132 pub proc: Option<Arc<DaggerSessionProc>>,
11133 pub selection: Selection,
11134 pub graphql_client: DynGraphQLClient,
11135}
11136impl IntoID<Id> for ListTypeDef {
11137 fn into_id(
11138 self,
11139 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11140 Box::pin(async move { self.id().await })
11141 }
11142}
11143impl Loadable for ListTypeDef {
11144 fn graphql_type() -> &'static str {
11145 "ListTypeDef"
11146 }
11147 fn from_query(
11148 proc: Option<Arc<DaggerSessionProc>>,
11149 selection: Selection,
11150 graphql_client: DynGraphQLClient,
11151 ) -> Self {
11152 Self {
11153 proc,
11154 selection,
11155 graphql_client,
11156 }
11157 }
11158}
11159impl ListTypeDef {
11160 pub fn element_type_def(&self) -> TypeDef {
11162 let query = self.selection.select("elementTypeDef");
11163 TypeDef {
11164 proc: self.proc.clone(),
11165 selection: query,
11166 graphql_client: self.graphql_client.clone(),
11167 }
11168 }
11169 pub async fn id(&self) -> Result<Id, DaggerError> {
11171 let query = self.selection.select("id");
11172 query.execute(self.graphql_client.clone()).await
11173 }
11174}
11175impl Node for ListTypeDef {
11176 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11177 let query = self.selection.select("id");
11178 let graphql_client = self.graphql_client.clone();
11179 async move { query.execute(graphql_client).await }
11180 }
11181}
11182#[derive(Clone)]
11183pub struct Module {
11184 pub proc: Option<Arc<DaggerSessionProc>>,
11185 pub selection: Selection,
11186 pub graphql_client: DynGraphQLClient,
11187}
11188#[derive(Builder, Debug, PartialEq)]
11189pub struct ModuleChecksOpts<'a> {
11190 #[builder(setter(into, strip_option), default)]
11192 pub include: Option<Vec<&'a str>>,
11193 #[builder(setter(into, strip_option), default)]
11195 pub no_generate: Option<bool>,
11196}
11197#[derive(Builder, Debug, PartialEq)]
11198pub struct ModuleGeneratorsOpts<'a> {
11199 #[builder(setter(into, strip_option), default)]
11201 pub include: Option<Vec<&'a str>>,
11202}
11203#[derive(Builder, Debug, PartialEq)]
11204pub struct ModuleServeOpts {
11205 #[builder(setter(into, strip_option), default)]
11207 pub entrypoint: Option<bool>,
11208 #[builder(setter(into, strip_option), default)]
11210 pub include_dependencies: Option<bool>,
11211}
11212#[derive(Builder, Debug, PartialEq)]
11213pub struct ModuleServicesOpts<'a> {
11214 #[builder(setter(into, strip_option), default)]
11216 pub include: Option<Vec<&'a str>>,
11217}
11218impl IntoID<Id> for Module {
11219 fn into_id(
11220 self,
11221 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11222 Box::pin(async move { self.id().await })
11223 }
11224}
11225impl Loadable for Module {
11226 fn graphql_type() -> &'static str {
11227 "Module"
11228 }
11229 fn from_query(
11230 proc: Option<Arc<DaggerSessionProc>>,
11231 selection: Selection,
11232 graphql_client: DynGraphQLClient,
11233 ) -> Self {
11234 Self {
11235 proc,
11236 selection,
11237 graphql_client,
11238 }
11239 }
11240}
11241impl Module {
11242 pub fn check(&self, name: impl Into<String>) -> Check {
11248 let mut query = self.selection.select("check");
11249 query = query.arg("name", name.into());
11250 Check {
11251 proc: self.proc.clone(),
11252 selection: query,
11253 graphql_client: self.graphql_client.clone(),
11254 }
11255 }
11256 pub fn checks(&self) -> CheckGroup {
11262 let query = self.selection.select("checks");
11263 CheckGroup {
11264 proc: self.proc.clone(),
11265 selection: query,
11266 graphql_client: self.graphql_client.clone(),
11267 }
11268 }
11269 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11275 let mut query = self.selection.select("checks");
11276 if let Some(include) = opts.include {
11277 query = query.arg("include", include);
11278 }
11279 if let Some(no_generate) = opts.no_generate {
11280 query = query.arg("noGenerate", no_generate);
11281 }
11282 CheckGroup {
11283 proc: self.proc.clone(),
11284 selection: query,
11285 graphql_client: self.graphql_client.clone(),
11286 }
11287 }
11288 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11290 let query = self.selection.select("dependencies");
11291 let query = query.select("id");
11292 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11293 Ok(ids
11294 .into_iter()
11295 .map(|id| Module {
11296 proc: self.proc.clone(),
11297 selection: crate::querybuilder::query()
11298 .select("node")
11299 .arg("id", &id.0)
11300 .inline_fragment("Module"),
11301 graphql_client: self.graphql_client.clone(),
11302 })
11303 .collect())
11304 }
11305 pub async fn description(&self) -> Result<String, DaggerError> {
11307 let query = self.selection.select("description");
11308 query.execute(self.graphql_client.clone()).await
11309 }
11310 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11312 let query = self.selection.select("enums");
11313 let query = query.select("id");
11314 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11315 Ok(ids
11316 .into_iter()
11317 .map(|id| TypeDef {
11318 proc: self.proc.clone(),
11319 selection: crate::querybuilder::query()
11320 .select("node")
11321 .arg("id", &id.0)
11322 .inline_fragment("TypeDef"),
11323 graphql_client: self.graphql_client.clone(),
11324 })
11325 .collect())
11326 }
11327 pub fn generated_context_directory(&self) -> Directory {
11329 let query = self.selection.select("generatedContextDirectory");
11330 Directory {
11331 proc: self.proc.clone(),
11332 selection: query,
11333 graphql_client: self.graphql_client.clone(),
11334 }
11335 }
11336 pub fn generator(&self, name: impl Into<String>) -> Generator {
11342 let mut query = self.selection.select("generator");
11343 query = query.arg("name", name.into());
11344 Generator {
11345 proc: self.proc.clone(),
11346 selection: query,
11347 graphql_client: self.graphql_client.clone(),
11348 }
11349 }
11350 pub fn generators(&self) -> GeneratorGroup {
11356 let query = self.selection.select("generators");
11357 GeneratorGroup {
11358 proc: self.proc.clone(),
11359 selection: query,
11360 graphql_client: self.graphql_client.clone(),
11361 }
11362 }
11363 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11369 let mut query = self.selection.select("generators");
11370 if let Some(include) = opts.include {
11371 query = query.arg("include", include);
11372 }
11373 GeneratorGroup {
11374 proc: self.proc.clone(),
11375 selection: query,
11376 graphql_client: self.graphql_client.clone(),
11377 }
11378 }
11379 pub async fn id(&self) -> Result<Id, DaggerError> {
11381 let query = self.selection.select("id");
11382 query.execute(self.graphql_client.clone()).await
11383 }
11384 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11386 let query = self.selection.select("interfaces");
11387 let query = query.select("id");
11388 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11389 Ok(ids
11390 .into_iter()
11391 .map(|id| TypeDef {
11392 proc: self.proc.clone(),
11393 selection: crate::querybuilder::query()
11394 .select("node")
11395 .arg("id", &id.0)
11396 .inline_fragment("TypeDef"),
11397 graphql_client: self.graphql_client.clone(),
11398 })
11399 .collect())
11400 }
11401 pub fn introspection_schema_json(&self) -> File {
11405 let query = self.selection.select("introspectionSchemaJSON");
11406 File {
11407 proc: self.proc.clone(),
11408 selection: query,
11409 graphql_client: self.graphql_client.clone(),
11410 }
11411 }
11412 pub async fn name(&self) -> Result<String, DaggerError> {
11414 let query = self.selection.select("name");
11415 query.execute(self.graphql_client.clone()).await
11416 }
11417 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11419 let query = self.selection.select("objects");
11420 let query = query.select("id");
11421 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11422 Ok(ids
11423 .into_iter()
11424 .map(|id| TypeDef {
11425 proc: self.proc.clone(),
11426 selection: crate::querybuilder::query()
11427 .select("node")
11428 .arg("id", &id.0)
11429 .inline_fragment("TypeDef"),
11430 graphql_client: self.graphql_client.clone(),
11431 })
11432 .collect())
11433 }
11434 pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
11436 let query = self.selection.select("runtime");
11437 let query = query.select("id");
11438 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11439 Ok(id.map(|id| Container {
11440 proc: self.proc.clone(),
11441 selection: query
11442 .root()
11443 .select("node")
11444 .arg("id", &id.0)
11445 .inline_fragment("Container"),
11446 graphql_client: self.graphql_client.clone(),
11447 }))
11448 }
11449 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
11451 let query = self.selection.select("sdk");
11452 let query = query.select("id");
11453 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11454 Ok(id.map(|id| SdkConfig {
11455 proc: self.proc.clone(),
11456 selection: query
11457 .root()
11458 .select("node")
11459 .arg("id", &id.0)
11460 .inline_fragment("SDKConfig"),
11461 graphql_client: self.graphql_client.clone(),
11462 }))
11463 }
11464 pub async fn serve(&self) -> Result<Void, DaggerError> {
11471 let query = self.selection.select("serve");
11472 query.execute(self.graphql_client.clone()).await
11473 }
11474 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11481 let mut query = self.selection.select("serve");
11482 if let Some(include_dependencies) = opts.include_dependencies {
11483 query = query.arg("includeDependencies", include_dependencies);
11484 }
11485 if let Some(entrypoint) = opts.entrypoint {
11486 query = query.arg("entrypoint", entrypoint);
11487 }
11488 query.execute(self.graphql_client.clone()).await
11489 }
11490 pub fn services(&self) -> UpGroup {
11496 let query = self.selection.select("services");
11497 UpGroup {
11498 proc: self.proc.clone(),
11499 selection: query,
11500 graphql_client: self.graphql_client.clone(),
11501 }
11502 }
11503 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11509 let mut query = self.selection.select("services");
11510 if let Some(include) = opts.include {
11511 query = query.arg("include", include);
11512 }
11513 UpGroup {
11514 proc: self.proc.clone(),
11515 selection: query,
11516 graphql_client: self.graphql_client.clone(),
11517 }
11518 }
11519 pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
11521 let query = self.selection.select("source");
11522 let query = query.select("id");
11523 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11524 Ok(id.map(|id| ModuleSource {
11525 proc: self.proc.clone(),
11526 selection: query
11527 .root()
11528 .select("node")
11529 .arg("id", &id.0)
11530 .inline_fragment("ModuleSource"),
11531 graphql_client: self.graphql_client.clone(),
11532 }))
11533 }
11534 pub async fn sync(&self) -> Result<Module, DaggerError> {
11536 let query = self.selection.select("sync");
11537 let id: Id = query.execute(self.graphql_client.clone()).await?;
11538 Ok(Module {
11539 proc: self.proc.clone(),
11540 selection: query
11541 .root()
11542 .select("node")
11543 .arg("id", &id.0)
11544 .inline_fragment("Module"),
11545 graphql_client: self.graphql_client.clone(),
11546 })
11547 }
11548 pub fn user_defaults(&self) -> EnvFile {
11550 let query = self.selection.select("userDefaults");
11551 EnvFile {
11552 proc: self.proc.clone(),
11553 selection: query,
11554 graphql_client: self.graphql_client.clone(),
11555 }
11556 }
11557 pub fn with_description(&self, description: impl Into<String>) -> Module {
11563 let mut query = self.selection.select("withDescription");
11564 query = query.arg("description", description.into());
11565 Module {
11566 proc: self.proc.clone(),
11567 selection: query,
11568 graphql_client: self.graphql_client.clone(),
11569 }
11570 }
11571 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11573 let mut query = self.selection.select("withEnum");
11574 query = query.arg_lazy(
11575 "enum",
11576 Box::new(move || {
11577 let r#enum = r#enum.clone();
11578 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11579 }),
11580 );
11581 Module {
11582 proc: self.proc.clone(),
11583 selection: query,
11584 graphql_client: self.graphql_client.clone(),
11585 }
11586 }
11587 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11589 let mut query = self.selection.select("withInterface");
11590 query = query.arg_lazy(
11591 "iface",
11592 Box::new(move || {
11593 let iface = iface.clone();
11594 Box::pin(async move { iface.into_id().await.unwrap().quote() })
11595 }),
11596 );
11597 Module {
11598 proc: self.proc.clone(),
11599 selection: query,
11600 graphql_client: self.graphql_client.clone(),
11601 }
11602 }
11603 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11605 let mut query = self.selection.select("withObject");
11606 query = query.arg_lazy(
11607 "object",
11608 Box::new(move || {
11609 let object = object.clone();
11610 Box::pin(async move { object.into_id().await.unwrap().quote() })
11611 }),
11612 );
11613 Module {
11614 proc: self.proc.clone(),
11615 selection: query,
11616 graphql_client: self.graphql_client.clone(),
11617 }
11618 }
11619}
11620impl Node for Module {
11621 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11622 let query = self.selection.select("id");
11623 let graphql_client = self.graphql_client.clone();
11624 async move { query.execute(graphql_client).await }
11625 }
11626}
11627impl Syncer for Module {
11628 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11629 let query = self.selection.select("id");
11630 let graphql_client = self.graphql_client.clone();
11631 async move { query.execute(graphql_client).await }
11632 }
11633 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11634 let query = self.selection.select("sync");
11635 let graphql_client = self.graphql_client.clone();
11636 async move { query.execute(graphql_client).await }
11637 }
11638}
11639#[derive(Clone)]
11640pub struct ModuleConfigClient {
11641 pub proc: Option<Arc<DaggerSessionProc>>,
11642 pub selection: Selection,
11643 pub graphql_client: DynGraphQLClient,
11644}
11645impl IntoID<Id> for ModuleConfigClient {
11646 fn into_id(
11647 self,
11648 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11649 Box::pin(async move { self.id().await })
11650 }
11651}
11652impl Loadable for ModuleConfigClient {
11653 fn graphql_type() -> &'static str {
11654 "ModuleConfigClient"
11655 }
11656 fn from_query(
11657 proc: Option<Arc<DaggerSessionProc>>,
11658 selection: Selection,
11659 graphql_client: DynGraphQLClient,
11660 ) -> Self {
11661 Self {
11662 proc,
11663 selection,
11664 graphql_client,
11665 }
11666 }
11667}
11668impl ModuleConfigClient {
11669 pub async fn directory(&self) -> Result<String, DaggerError> {
11671 let query = self.selection.select("directory");
11672 query.execute(self.graphql_client.clone()).await
11673 }
11674 pub async fn generator(&self) -> Result<String, DaggerError> {
11676 let query = self.selection.select("generator");
11677 query.execute(self.graphql_client.clone()).await
11678 }
11679 pub async fn id(&self) -> Result<Id, DaggerError> {
11681 let query = self.selection.select("id");
11682 query.execute(self.graphql_client.clone()).await
11683 }
11684}
11685impl Node for ModuleConfigClient {
11686 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11687 let query = self.selection.select("id");
11688 let graphql_client = self.graphql_client.clone();
11689 async move { query.execute(graphql_client).await }
11690 }
11691}
11692#[derive(Clone)]
11693pub struct ModuleSource {
11694 pub proc: Option<Arc<DaggerSessionProc>>,
11695 pub selection: Selection,
11696 pub graphql_client: DynGraphQLClient,
11697}
11698impl IntoID<Id> for ModuleSource {
11699 fn into_id(
11700 self,
11701 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11702 Box::pin(async move { self.id().await })
11703 }
11704}
11705impl Loadable for ModuleSource {
11706 fn graphql_type() -> &'static str {
11707 "ModuleSource"
11708 }
11709 fn from_query(
11710 proc: Option<Arc<DaggerSessionProc>>,
11711 selection: Selection,
11712 graphql_client: DynGraphQLClient,
11713 ) -> Self {
11714 Self {
11715 proc,
11716 selection,
11717 graphql_client,
11718 }
11719 }
11720}
11721impl ModuleSource {
11722 pub fn as_module(&self) -> Module {
11724 let query = self.selection.select("asModule");
11725 Module {
11726 proc: self.proc.clone(),
11727 selection: query,
11728 graphql_client: self.graphql_client.clone(),
11729 }
11730 }
11731 pub async fn as_string(&self) -> Result<String, DaggerError> {
11733 let query = self.selection.select("asString");
11734 query.execute(self.graphql_client.clone()).await
11735 }
11736 pub fn blueprint(&self) -> ModuleSource {
11738 let query = self.selection.select("blueprint");
11739 ModuleSource {
11740 proc: self.proc.clone(),
11741 selection: query,
11742 graphql_client: self.graphql_client.clone(),
11743 }
11744 }
11745 pub fn client_schema_introspection_json(&self) -> File {
11748 let query = self.selection.select("clientSchemaIntrospectionJSON");
11749 File {
11750 proc: self.proc.clone(),
11751 selection: query,
11752 graphql_client: self.graphql_client.clone(),
11753 }
11754 }
11755 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11757 let query = self.selection.select("cloneRef");
11758 query.execute(self.graphql_client.clone()).await
11759 }
11760 pub async fn commit(&self) -> Result<String, DaggerError> {
11762 let query = self.selection.select("commit");
11763 query.execute(self.graphql_client.clone()).await
11764 }
11765 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11767 let query = self.selection.select("configClients");
11768 let query = query.select("id");
11769 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11770 Ok(ids
11771 .into_iter()
11772 .map(|id| ModuleConfigClient {
11773 proc: self.proc.clone(),
11774 selection: crate::querybuilder::query()
11775 .select("node")
11776 .arg("id", &id.0)
11777 .inline_fragment("ModuleConfigClient"),
11778 graphql_client: self.graphql_client.clone(),
11779 })
11780 .collect())
11781 }
11782 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11784 let query = self.selection.select("configExists");
11785 query.execute(self.graphql_client.clone()).await
11786 }
11787 pub fn context_directory(&self) -> Directory {
11789 let query = self.selection.select("contextDirectory");
11790 Directory {
11791 proc: self.proc.clone(),
11792 selection: query,
11793 graphql_client: self.graphql_client.clone(),
11794 }
11795 }
11796 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
11798 let query = self.selection.select("dependencies");
11799 let query = query.select("id");
11800 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11801 Ok(ids
11802 .into_iter()
11803 .map(|id| ModuleSource {
11804 proc: self.proc.clone(),
11805 selection: crate::querybuilder::query()
11806 .select("node")
11807 .arg("id", &id.0)
11808 .inline_fragment("ModuleSource"),
11809 graphql_client: self.graphql_client.clone(),
11810 })
11811 .collect())
11812 }
11813 pub async fn digest(&self) -> Result<String, DaggerError> {
11815 let query = self.selection.select("digest");
11816 query.execute(self.graphql_client.clone()).await
11817 }
11818 pub fn directory(&self, path: impl Into<String>) -> Directory {
11824 let mut query = self.selection.select("directory");
11825 query = query.arg("path", path.into());
11826 Directory {
11827 proc: self.proc.clone(),
11828 selection: query,
11829 graphql_client: self.graphql_client.clone(),
11830 }
11831 }
11832 pub async fn engine_version(&self) -> Result<String, DaggerError> {
11834 let query = self.selection.select("engineVersion");
11835 query.execute(self.graphql_client.clone()).await
11836 }
11837 pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
11844 let mut query = self.selection.select("generate");
11845 query = query.arg_lazy(
11846 "workspace",
11847 Box::new(move || {
11848 let workspace = workspace.clone();
11849 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
11850 }),
11851 );
11852 Workspace {
11853 proc: self.proc.clone(),
11854 selection: query,
11855 graphql_client: self.graphql_client.clone(),
11856 }
11857 }
11858 pub fn generated_context_changeset(&self) -> Changeset {
11860 let query = self.selection.select("generatedContextChangeset");
11861 Changeset {
11862 proc: self.proc.clone(),
11863 selection: query,
11864 graphql_client: self.graphql_client.clone(),
11865 }
11866 }
11867 pub fn generated_context_directory(&self) -> Directory {
11869 let query = self.selection.select("generatedContextDirectory");
11870 Directory {
11871 proc: self.proc.clone(),
11872 selection: query,
11873 graphql_client: self.graphql_client.clone(),
11874 }
11875 }
11876 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
11878 let query = self.selection.select("htmlRepoURL");
11879 query.execute(self.graphql_client.clone()).await
11880 }
11881 pub async fn html_url(&self) -> Result<String, DaggerError> {
11883 let query = self.selection.select("htmlURL");
11884 query.execute(self.graphql_client.clone()).await
11885 }
11886 pub async fn id(&self) -> Result<Id, DaggerError> {
11888 let query = self.selection.select("id");
11889 query.execute(self.graphql_client.clone()).await
11890 }
11891 pub fn introspection_schema_json(&self) -> File {
11895 let query = self.selection.select("introspectionSchemaJSON");
11896 File {
11897 proc: self.proc.clone(),
11898 selection: query,
11899 graphql_client: self.graphql_client.clone(),
11900 }
11901 }
11902 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
11904 let query = self.selection.select("kind");
11905 query.execute(self.graphql_client.clone()).await
11906 }
11907 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
11909 let query = self.selection.select("localContextDirectoryPath");
11910 query.execute(self.graphql_client.clone()).await
11911 }
11912 pub async fn module_name(&self) -> Result<String, DaggerError> {
11914 let query = self.selection.select("moduleName");
11915 query.execute(self.graphql_client.clone()).await
11916 }
11917 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
11919 let query = self.selection.select("moduleOriginalName");
11920 query.execute(self.graphql_client.clone()).await
11921 }
11922 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
11924 let query = self.selection.select("originalSubpath");
11925 query.execute(self.graphql_client.clone()).await
11926 }
11927 pub async fn pin(&self) -> Result<String, DaggerError> {
11929 let query = self.selection.select("pin");
11930 query.execute(self.graphql_client.clone()).await
11931 }
11932 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
11934 let query = self.selection.select("repoRootPath");
11935 query.execute(self.graphql_client.clone()).await
11936 }
11937 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
11939 let query = self.selection.select("sdk");
11940 let query = query.select("id");
11941 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11942 Ok(id.map(|id| SdkConfig {
11943 proc: self.proc.clone(),
11944 selection: query
11945 .root()
11946 .select("node")
11947 .arg("id", &id.0)
11948 .inline_fragment("SDKConfig"),
11949 graphql_client: self.graphql_client.clone(),
11950 }))
11951 }
11952 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
11954 let query = self.selection.select("sourceRootSubpath");
11955 query.execute(self.graphql_client.clone()).await
11956 }
11957 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
11959 let query = self.selection.select("sourceSubpath");
11960 query.execute(self.graphql_client.clone()).await
11961 }
11962 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
11964 let query = self.selection.select("sync");
11965 let id: Id = query.execute(self.graphql_client.clone()).await?;
11966 Ok(ModuleSource {
11967 proc: self.proc.clone(),
11968 selection: query
11969 .root()
11970 .select("node")
11971 .arg("id", &id.0)
11972 .inline_fragment("ModuleSource"),
11973 graphql_client: self.graphql_client.clone(),
11974 })
11975 }
11976 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
11978 let query = self.selection.select("toolchains");
11979 let query = query.select("id");
11980 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11981 Ok(ids
11982 .into_iter()
11983 .map(|id| ModuleSource {
11984 proc: self.proc.clone(),
11985 selection: crate::querybuilder::query()
11986 .select("node")
11987 .arg("id", &id.0)
11988 .inline_fragment("ModuleSource"),
11989 graphql_client: self.graphql_client.clone(),
11990 })
11991 .collect())
11992 }
11993 pub fn updated_config_directory(&self) -> Directory {
11996 let query = self.selection.select("updatedConfigDirectory");
11997 Directory {
11998 proc: self.proc.clone(),
11999 selection: query,
12000 graphql_client: self.graphql_client.clone(),
12001 }
12002 }
12003 pub fn user_defaults(&self) -> EnvFile {
12005 let query = self.selection.select("userDefaults");
12006 EnvFile {
12007 proc: self.proc.clone(),
12008 selection: query,
12009 graphql_client: self.graphql_client.clone(),
12010 }
12011 }
12012 pub async fn version(&self) -> Result<String, DaggerError> {
12014 let query = self.selection.select("version");
12015 query.execute(self.graphql_client.clone()).await
12016 }
12017 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12023 let mut query = self.selection.select("withBlueprint");
12024 query = query.arg_lazy(
12025 "blueprint",
12026 Box::new(move || {
12027 let blueprint = blueprint.clone();
12028 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12029 }),
12030 );
12031 ModuleSource {
12032 proc: self.proc.clone(),
12033 selection: query,
12034 graphql_client: self.graphql_client.clone(),
12035 }
12036 }
12037 pub fn with_client(
12044 &self,
12045 generator: impl Into<String>,
12046 output_dir: impl Into<String>,
12047 ) -> ModuleSource {
12048 let mut query = self.selection.select("withClient");
12049 query = query.arg("generator", generator.into());
12050 query = query.arg("outputDir", output_dir.into());
12051 ModuleSource {
12052 proc: self.proc.clone(),
12053 selection: query,
12054 graphql_client: self.graphql_client.clone(),
12055 }
12056 }
12057 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12063 let mut query = self.selection.select("withDependencies");
12064 query = query.arg("dependencies", dependencies);
12065 ModuleSource {
12066 proc: self.proc.clone(),
12067 selection: query,
12068 graphql_client: self.graphql_client.clone(),
12069 }
12070 }
12071 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12077 let mut query = self.selection.select("withEngineVersion");
12078 query = query.arg("version", version.into());
12079 ModuleSource {
12080 proc: self.proc.clone(),
12081 selection: query,
12082 graphql_client: self.graphql_client.clone(),
12083 }
12084 }
12085 pub fn with_experimental_features(
12091 &self,
12092 features: Vec<ModuleSourceExperimentalFeature>,
12093 ) -> ModuleSource {
12094 let mut query = self.selection.select("withExperimentalFeatures");
12095 query = query.arg("features", features);
12096 ModuleSource {
12097 proc: self.proc.clone(),
12098 selection: query,
12099 graphql_client: self.graphql_client.clone(),
12100 }
12101 }
12102 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12108 let mut query = self.selection.select("withIncludes");
12109 query = query.arg(
12110 "patterns",
12111 patterns
12112 .into_iter()
12113 .map(|i| i.into())
12114 .collect::<Vec<String>>(),
12115 );
12116 ModuleSource {
12117 proc: self.proc.clone(),
12118 selection: query,
12119 graphql_client: self.graphql_client.clone(),
12120 }
12121 }
12122 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12128 let mut query = self.selection.select("withName");
12129 query = query.arg("name", name.into());
12130 ModuleSource {
12131 proc: self.proc.clone(),
12132 selection: query,
12133 graphql_client: self.graphql_client.clone(),
12134 }
12135 }
12136 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12142 let mut query = self.selection.select("withSDK");
12143 query = query.arg("source", source.into());
12144 ModuleSource {
12145 proc: self.proc.clone(),
12146 selection: query,
12147 graphql_client: self.graphql_client.clone(),
12148 }
12149 }
12150 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12156 let mut query = self.selection.select("withSourceSubpath");
12157 query = query.arg("path", path.into());
12158 ModuleSource {
12159 proc: self.proc.clone(),
12160 selection: query,
12161 graphql_client: self.graphql_client.clone(),
12162 }
12163 }
12164 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12170 let mut query = self.selection.select("withToolchains");
12171 query = query.arg("toolchains", toolchains);
12172 ModuleSource {
12173 proc: self.proc.clone(),
12174 selection: query,
12175 graphql_client: self.graphql_client.clone(),
12176 }
12177 }
12178 pub fn with_update_blueprint(&self) -> ModuleSource {
12180 let query = self.selection.select("withUpdateBlueprint");
12181 ModuleSource {
12182 proc: self.proc.clone(),
12183 selection: query,
12184 graphql_client: self.graphql_client.clone(),
12185 }
12186 }
12187 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12193 let mut query = self.selection.select("withUpdateDependencies");
12194 query = query.arg(
12195 "dependencies",
12196 dependencies
12197 .into_iter()
12198 .map(|i| i.into())
12199 .collect::<Vec<String>>(),
12200 );
12201 ModuleSource {
12202 proc: self.proc.clone(),
12203 selection: query,
12204 graphql_client: self.graphql_client.clone(),
12205 }
12206 }
12207 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12213 let mut query = self.selection.select("withUpdateToolchains");
12214 query = query.arg(
12215 "toolchains",
12216 toolchains
12217 .into_iter()
12218 .map(|i| i.into())
12219 .collect::<Vec<String>>(),
12220 );
12221 ModuleSource {
12222 proc: self.proc.clone(),
12223 selection: query,
12224 graphql_client: self.graphql_client.clone(),
12225 }
12226 }
12227 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12233 let mut query = self.selection.select("withUpdatedClients");
12234 query = query.arg(
12235 "clients",
12236 clients
12237 .into_iter()
12238 .map(|i| i.into())
12239 .collect::<Vec<String>>(),
12240 );
12241 ModuleSource {
12242 proc: self.proc.clone(),
12243 selection: query,
12244 graphql_client: self.graphql_client.clone(),
12245 }
12246 }
12247 pub fn without_blueprint(&self) -> ModuleSource {
12249 let query = self.selection.select("withoutBlueprint");
12250 ModuleSource {
12251 proc: self.proc.clone(),
12252 selection: query,
12253 graphql_client: self.graphql_client.clone(),
12254 }
12255 }
12256 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12262 let mut query = self.selection.select("withoutClient");
12263 query = query.arg("path", path.into());
12264 ModuleSource {
12265 proc: self.proc.clone(),
12266 selection: query,
12267 graphql_client: self.graphql_client.clone(),
12268 }
12269 }
12270 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12276 let mut query = self.selection.select("withoutDependencies");
12277 query = query.arg(
12278 "dependencies",
12279 dependencies
12280 .into_iter()
12281 .map(|i| i.into())
12282 .collect::<Vec<String>>(),
12283 );
12284 ModuleSource {
12285 proc: self.proc.clone(),
12286 selection: query,
12287 graphql_client: self.graphql_client.clone(),
12288 }
12289 }
12290 pub fn without_experimental_features(
12296 &self,
12297 features: Vec<ModuleSourceExperimentalFeature>,
12298 ) -> ModuleSource {
12299 let mut query = self.selection.select("withoutExperimentalFeatures");
12300 query = query.arg("features", features);
12301 ModuleSource {
12302 proc: self.proc.clone(),
12303 selection: query,
12304 graphql_client: self.graphql_client.clone(),
12305 }
12306 }
12307 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12313 let mut query = self.selection.select("withoutToolchains");
12314 query = query.arg(
12315 "toolchains",
12316 toolchains
12317 .into_iter()
12318 .map(|i| i.into())
12319 .collect::<Vec<String>>(),
12320 );
12321 ModuleSource {
12322 proc: self.proc.clone(),
12323 selection: query,
12324 graphql_client: self.graphql_client.clone(),
12325 }
12326 }
12327}
12328impl Node for ModuleSource {
12329 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12330 let query = self.selection.select("id");
12331 let graphql_client = self.graphql_client.clone();
12332 async move { query.execute(graphql_client).await }
12333 }
12334}
12335impl Syncer for ModuleSource {
12336 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12337 let query = self.selection.select("id");
12338 let graphql_client = self.graphql_client.clone();
12339 async move { query.execute(graphql_client).await }
12340 }
12341 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12342 let query = self.selection.select("sync");
12343 let graphql_client = self.graphql_client.clone();
12344 async move { query.execute(graphql_client).await }
12345 }
12346}
12347#[derive(Clone)]
12348pub struct ObjectTypeDef {
12349 pub proc: Option<Arc<DaggerSessionProc>>,
12350 pub selection: Selection,
12351 pub graphql_client: DynGraphQLClient,
12352}
12353impl IntoID<Id> for ObjectTypeDef {
12354 fn into_id(
12355 self,
12356 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12357 Box::pin(async move { self.id().await })
12358 }
12359}
12360impl Loadable for ObjectTypeDef {
12361 fn graphql_type() -> &'static str {
12362 "ObjectTypeDef"
12363 }
12364 fn from_query(
12365 proc: Option<Arc<DaggerSessionProc>>,
12366 selection: Selection,
12367 graphql_client: DynGraphQLClient,
12368 ) -> Self {
12369 Self {
12370 proc,
12371 selection,
12372 graphql_client,
12373 }
12374 }
12375}
12376impl ObjectTypeDef {
12377 pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
12379 let query = self.selection.select("constructor");
12380 let query = query.select("id");
12381 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12382 Ok(id.map(|id| Function {
12383 proc: self.proc.clone(),
12384 selection: query
12385 .root()
12386 .select("node")
12387 .arg("id", &id.0)
12388 .inline_fragment("Function"),
12389 graphql_client: self.graphql_client.clone(),
12390 }))
12391 }
12392 pub async fn deprecated(&self) -> Result<String, DaggerError> {
12394 let query = self.selection.select("deprecated");
12395 query.execute(self.graphql_client.clone()).await
12396 }
12397 pub async fn description(&self) -> Result<String, DaggerError> {
12399 let query = self.selection.select("description");
12400 query.execute(self.graphql_client.clone()).await
12401 }
12402 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12404 let query = self.selection.select("fields");
12405 let query = query.select("id");
12406 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12407 Ok(ids
12408 .into_iter()
12409 .map(|id| FieldTypeDef {
12410 proc: self.proc.clone(),
12411 selection: crate::querybuilder::query()
12412 .select("node")
12413 .arg("id", &id.0)
12414 .inline_fragment("FieldTypeDef"),
12415 graphql_client: self.graphql_client.clone(),
12416 })
12417 .collect())
12418 }
12419 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12421 let query = self.selection.select("functions");
12422 let query = query.select("id");
12423 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12424 Ok(ids
12425 .into_iter()
12426 .map(|id| Function {
12427 proc: self.proc.clone(),
12428 selection: crate::querybuilder::query()
12429 .select("node")
12430 .arg("id", &id.0)
12431 .inline_fragment("Function"),
12432 graphql_client: self.graphql_client.clone(),
12433 })
12434 .collect())
12435 }
12436 pub async fn id(&self) -> Result<Id, DaggerError> {
12438 let query = self.selection.select("id");
12439 query.execute(self.graphql_client.clone()).await
12440 }
12441 pub async fn name(&self) -> Result<String, DaggerError> {
12443 let query = self.selection.select("name");
12444 query.execute(self.graphql_client.clone()).await
12445 }
12446 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12448 let query = self.selection.select("sourceMap");
12449 let query = query.select("id");
12450 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12451 Ok(id.map(|id| SourceMap {
12452 proc: self.proc.clone(),
12453 selection: query
12454 .root()
12455 .select("node")
12456 .arg("id", &id.0)
12457 .inline_fragment("SourceMap"),
12458 graphql_client: self.graphql_client.clone(),
12459 }))
12460 }
12461 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12463 let query = self.selection.select("sourceModuleName");
12464 query.execute(self.graphql_client.clone()).await
12465 }
12466}
12467impl Node for ObjectTypeDef {
12468 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12469 let query = self.selection.select("id");
12470 let graphql_client = self.graphql_client.clone();
12471 async move { query.execute(graphql_client).await }
12472 }
12473}
12474#[derive(Clone)]
12475pub struct Port {
12476 pub proc: Option<Arc<DaggerSessionProc>>,
12477 pub selection: Selection,
12478 pub graphql_client: DynGraphQLClient,
12479}
12480impl IntoID<Id> for Port {
12481 fn into_id(
12482 self,
12483 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12484 Box::pin(async move { self.id().await })
12485 }
12486}
12487impl Loadable for Port {
12488 fn graphql_type() -> &'static str {
12489 "Port"
12490 }
12491 fn from_query(
12492 proc: Option<Arc<DaggerSessionProc>>,
12493 selection: Selection,
12494 graphql_client: DynGraphQLClient,
12495 ) -> Self {
12496 Self {
12497 proc,
12498 selection,
12499 graphql_client,
12500 }
12501 }
12502}
12503impl Port {
12504 pub async fn description(&self) -> Result<String, DaggerError> {
12506 let query = self.selection.select("description");
12507 query.execute(self.graphql_client.clone()).await
12508 }
12509 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12511 let query = self.selection.select("experimentalSkipHealthcheck");
12512 query.execute(self.graphql_client.clone()).await
12513 }
12514 pub async fn id(&self) -> Result<Id, DaggerError> {
12516 let query = self.selection.select("id");
12517 query.execute(self.graphql_client.clone()).await
12518 }
12519 pub async fn port(&self) -> Result<isize, DaggerError> {
12521 let query = self.selection.select("port");
12522 query.execute(self.graphql_client.clone()).await
12523 }
12524 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12526 let query = self.selection.select("protocol");
12527 query.execute(self.graphql_client.clone()).await
12528 }
12529}
12530impl Node for Port {
12531 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12532 let query = self.selection.select("id");
12533 let graphql_client = self.graphql_client.clone();
12534 async move { query.execute(graphql_client).await }
12535 }
12536}
12537#[derive(Clone)]
12538pub struct Query {
12539 pub proc: Option<Arc<DaggerSessionProc>>,
12540 pub selection: Selection,
12541 pub graphql_client: DynGraphQLClient,
12542}
12543#[derive(Builder, Debug, PartialEq)]
12544pub struct QueryBlobOpts {
12545 #[builder(setter(into, strip_option), default)]
12547 pub permissions: Option<isize>,
12548}
12549#[derive(Builder, Debug, PartialEq)]
12550pub struct QueryCacheVolumeOpts<'a> {
12551 #[builder(setter(into, strip_option), default)]
12555 pub owner: Option<&'a str>,
12556 #[builder(setter(into, strip_option), default)]
12558 pub sharing: Option<CacheSharingMode>,
12559 #[builder(setter(into, strip_option), default)]
12561 pub source: Option<Id>,
12562}
12563#[derive(Builder, Debug, PartialEq)]
12564pub struct QueryContainerOpts {
12565 #[builder(setter(into, strip_option), default)]
12567 pub platform: Option<Platform>,
12568}
12569#[derive(Builder, Debug, PartialEq)]
12570pub struct QueryCurrentTypeDefsOpts {
12571 #[builder(setter(into, strip_option), default)]
12574 pub hide_core: Option<bool>,
12575 #[builder(setter(into, strip_option), default)]
12577 pub return_all_types: Option<bool>,
12578}
12579#[derive(Builder, Debug, PartialEq)]
12580pub struct QueryEngineVolumeOpts<'a> {
12581 #[builder(setter(into, strip_option), default)]
12583 pub subdir: Option<&'a str>,
12584}
12585#[derive(Builder, Debug, PartialEq)]
12586pub struct QueryEnvFileOpts {
12587 #[builder(setter(into, strip_option), default)]
12589 pub expand: Option<bool>,
12590}
12591#[derive(Builder, Debug, PartialEq)]
12592pub struct QueryFileOpts {
12593 #[builder(setter(into, strip_option), default)]
12595 pub permissions: Option<isize>,
12596}
12597#[derive(Builder, Debug, PartialEq)]
12598pub struct QueryGitOpts<'a> {
12599 #[builder(setter(into, strip_option), default)]
12601 pub experimental_service_host: Option<Id>,
12602 #[builder(setter(into, strip_option), default)]
12604 pub http_auth_header: Option<Id>,
12605 #[builder(setter(into, strip_option), default)]
12607 pub http_auth_token: Option<Id>,
12608 #[builder(setter(into, strip_option), default)]
12610 pub http_auth_username: Option<&'a str>,
12611 #[builder(setter(into, strip_option), default)]
12613 pub keep_git_dir: Option<bool>,
12614 #[builder(setter(into, strip_option), default)]
12616 pub ssh_auth_socket: Option<Id>,
12617 #[builder(setter(into, strip_option), default)]
12619 pub ssh_known_hosts: Option<&'a str>,
12620}
12621#[derive(Builder, Debug, PartialEq)]
12622pub struct QueryHttpOpts<'a> {
12623 #[builder(setter(into, strip_option), default)]
12625 pub auth_header: Option<Id>,
12626 #[builder(setter(into, strip_option), default)]
12628 pub checksum: Option<&'a str>,
12629 #[builder(setter(into, strip_option), default)]
12631 pub experimental_service_host: Option<Id>,
12632 #[builder(setter(into, strip_option), default)]
12634 pub name: Option<&'a str>,
12635 #[builder(setter(into, strip_option), default)]
12637 pub permissions: Option<isize>,
12638}
12639#[derive(Builder, Debug, PartialEq)]
12640pub struct QueryLlmOpts<'a> {
12641 #[builder(setter(into, strip_option), default)]
12643 pub model: Option<&'a str>,
12644 #[builder(setter(into, strip_option), default)]
12646 pub provider: Option<&'a str>,
12647}
12648#[derive(Builder, Debug, PartialEq)]
12649pub struct QueryModuleSourceOpts<'a> {
12650 #[builder(setter(into, strip_option), default)]
12652 pub allow_not_exists: Option<bool>,
12653 #[builder(setter(into, strip_option), default)]
12655 pub disable_find_up: Option<bool>,
12656 #[builder(setter(into, strip_option), default)]
12658 pub ref_pin: Option<&'a str>,
12659 #[builder(setter(into, strip_option), default)]
12661 pub require_kind: Option<ModuleSourceKind>,
12662 #[builder(setter(into, strip_option), default)]
12664 pub version: Option<&'a str>,
12665}
12666#[derive(Builder, Debug, PartialEq)]
12667pub struct QuerySecretOpts<'a> {
12668 #[builder(setter(into, strip_option), default)]
12672 pub cache_key: Option<&'a str>,
12673}
12674#[derive(Builder, Debug, PartialEq)]
12675pub struct QuerySshfsVolumeOpts<'a> {
12676 #[builder(setter(into, strip_option), default)]
12678 pub cache_key: Option<&'a str>,
12679 #[builder(setter(into, strip_option), default)]
12681 pub experimental_service_host: Option<Id>,
12682 #[builder(setter(into, strip_option), default)]
12684 pub insecure_skip_host_key_check: Option<bool>,
12685 #[builder(setter(into, strip_option), default)]
12687 pub known_hosts: Option<Id>,
12688}
12689impl IntoID<Id> for Query {
12690 fn into_id(
12691 self,
12692 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12693 Box::pin(async move { self.id().await })
12694 }
12695}
12696impl Loadable for Query {
12697 fn graphql_type() -> &'static str {
12698 "Query"
12699 }
12700 fn from_query(
12701 proc: Option<Arc<DaggerSessionProc>>,
12702 selection: Selection,
12703 graphql_client: DynGraphQLClient,
12704 ) -> Self {
12705 Self {
12706 proc,
12707 selection,
12708 graphql_client,
12709 }
12710 }
12711}
12712impl Query {
12713 pub fn address(&self, value: impl Into<String>) -> Address {
12715 let mut query = self.selection.select("address");
12716 query = query.arg("value", value.into());
12717 Address {
12718 proc: self.proc.clone(),
12719 selection: query,
12720 graphql_client: self.graphql_client.clone(),
12721 }
12722 }
12723 pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
12731 let mut query = self.selection.select("blob");
12732 query = query.arg("name", name.into());
12733 query = query.arg("contents", contents);
12734 File {
12735 proc: self.proc.clone(),
12736 selection: query,
12737 graphql_client: self.graphql_client.clone(),
12738 }
12739 }
12740 pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
12748 let mut query = self.selection.select("blob");
12749 query = query.arg("name", name.into());
12750 query = query.arg("contents", contents);
12751 if let Some(permissions) = opts.permissions {
12752 query = query.arg("permissions", permissions);
12753 }
12754 File {
12755 proc: self.proc.clone(),
12756 selection: query,
12757 graphql_client: self.graphql_client.clone(),
12758 }
12759 }
12760 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12767 let mut query = self.selection.select("cacheVolume");
12768 query = query.arg("key", key.into());
12769 CacheVolume {
12770 proc: self.proc.clone(),
12771 selection: query,
12772 graphql_client: self.graphql_client.clone(),
12773 }
12774 }
12775 pub fn cache_volume_opts<'a>(
12782 &self,
12783 key: impl Into<String>,
12784 opts: QueryCacheVolumeOpts<'a>,
12785 ) -> CacheVolume {
12786 let mut query = self.selection.select("cacheVolume");
12787 query = query.arg("key", key.into());
12788 if let Some(source) = opts.source {
12789 query = query.arg("source", source);
12790 }
12791 if let Some(sharing) = opts.sharing {
12792 query = query.arg("sharing", sharing);
12793 }
12794 if let Some(owner) = opts.owner {
12795 query = query.arg("owner", owner);
12796 }
12797 CacheVolume {
12798 proc: self.proc.clone(),
12799 selection: query,
12800 graphql_client: self.graphql_client.clone(),
12801 }
12802 }
12803 pub fn changeset(&self) -> Changeset {
12805 let query = self.selection.select("changeset");
12806 Changeset {
12807 proc: self.proc.clone(),
12808 selection: query,
12809 graphql_client: self.graphql_client.clone(),
12810 }
12811 }
12812 pub fn cloud(&self) -> Cloud {
12814 let query = self.selection.select("cloud");
12815 Cloud {
12816 proc: self.proc.clone(),
12817 selection: query,
12818 graphql_client: self.graphql_client.clone(),
12819 }
12820 }
12821 pub fn container(&self) -> Container {
12828 let query = self.selection.select("container");
12829 Container {
12830 proc: self.proc.clone(),
12831 selection: query,
12832 graphql_client: self.graphql_client.clone(),
12833 }
12834 }
12835 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12842 let mut query = self.selection.select("container");
12843 if let Some(platform) = opts.platform {
12844 query = query.arg("platform", platform);
12845 }
12846 Container {
12847 proc: self.proc.clone(),
12848 selection: query,
12849 graphql_client: self.graphql_client.clone(),
12850 }
12851 }
12852 pub fn current_function_call(&self) -> FunctionCall {
12855 let query = self.selection.select("currentFunctionCall");
12856 FunctionCall {
12857 proc: self.proc.clone(),
12858 selection: query,
12859 graphql_client: self.graphql_client.clone(),
12860 }
12861 }
12862 pub fn current_module(&self) -> CurrentModule {
12864 let query = self.selection.select("currentModule");
12865 CurrentModule {
12866 proc: self.proc.clone(),
12867 selection: query,
12868 graphql_client: self.graphql_client.clone(),
12869 }
12870 }
12871 pub fn current_node(&self) -> NodeClient {
12873 let query = self.selection.select("currentNode");
12874 NodeClient {
12875 proc: self.proc.clone(),
12876 selection: query,
12877 graphql_client: self.graphql_client.clone(),
12878 }
12879 }
12880 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12886 let query = self.selection.select("currentTypeDefs");
12887 let query = query.select("id");
12888 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12889 Ok(ids
12890 .into_iter()
12891 .map(|id| TypeDef {
12892 proc: self.proc.clone(),
12893 selection: crate::querybuilder::query()
12894 .select("node")
12895 .arg("id", &id.0)
12896 .inline_fragment("TypeDef"),
12897 graphql_client: self.graphql_client.clone(),
12898 })
12899 .collect())
12900 }
12901 pub async fn current_type_defs_opts(
12907 &self,
12908 opts: QueryCurrentTypeDefsOpts,
12909 ) -> Result<Vec<TypeDef>, DaggerError> {
12910 let mut query = self.selection.select("currentTypeDefs");
12911 if let Some(return_all_types) = opts.return_all_types {
12912 query = query.arg("returnAllTypes", return_all_types);
12913 }
12914 if let Some(hide_core) = opts.hide_core {
12915 query = query.arg("hideCore", hide_core);
12916 }
12917 let query = query.select("id");
12918 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12919 Ok(ids
12920 .into_iter()
12921 .map(|id| TypeDef {
12922 proc: self.proc.clone(),
12923 selection: crate::querybuilder::query()
12924 .select("node")
12925 .arg("id", &id.0)
12926 .inline_fragment("TypeDef"),
12927 graphql_client: self.graphql_client.clone(),
12928 })
12929 .collect())
12930 }
12931 pub fn current_workspace(&self) -> Workspace {
12933 let query = self.selection.select("currentWorkspace");
12934 Workspace {
12935 proc: self.proc.clone(),
12936 selection: query,
12937 graphql_client: self.graphql_client.clone(),
12938 }
12939 }
12940 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
12942 let query = self.selection.select("defaultPlatform");
12943 query.execute(self.graphql_client.clone()).await
12944 }
12945 pub fn directory(&self) -> Directory {
12947 let query = self.selection.select("directory");
12948 Directory {
12949 proc: self.proc.clone(),
12950 selection: query,
12951 graphql_client: self.graphql_client.clone(),
12952 }
12953 }
12954 pub fn engine(&self) -> Engine {
12956 let query = self.selection.select("engine");
12957 Engine {
12958 proc: self.proc.clone(),
12959 selection: query,
12960 graphql_client: self.graphql_client.clone(),
12961 }
12962 }
12963 pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
12970 let mut query = self.selection.select("engineVolume");
12971 query = query.arg("name", name.into());
12972 Volume {
12973 proc: self.proc.clone(),
12974 selection: query,
12975 graphql_client: self.graphql_client.clone(),
12976 }
12977 }
12978 pub fn engine_volume_opts<'a>(
12985 &self,
12986 name: impl Into<String>,
12987 opts: QueryEngineVolumeOpts<'a>,
12988 ) -> Volume {
12989 let mut query = self.selection.select("engineVolume");
12990 query = query.arg("name", name.into());
12991 if let Some(subdir) = opts.subdir {
12992 query = query.arg("subdir", subdir);
12993 }
12994 Volume {
12995 proc: self.proc.clone(),
12996 selection: query,
12997 graphql_client: self.graphql_client.clone(),
12998 }
12999 }
13000 pub fn env_file(&self) -> EnvFile {
13006 let query = self.selection.select("envFile");
13007 EnvFile {
13008 proc: self.proc.clone(),
13009 selection: query,
13010 graphql_client: self.graphql_client.clone(),
13011 }
13012 }
13013 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13019 let mut query = self.selection.select("envFile");
13020 if let Some(expand) = opts.expand {
13021 query = query.arg("expand", expand);
13022 }
13023 EnvFile {
13024 proc: self.proc.clone(),
13025 selection: query,
13026 graphql_client: self.graphql_client.clone(),
13027 }
13028 }
13029 pub fn error(&self, message: impl Into<String>) -> Error {
13035 let mut query = self.selection.select("error");
13036 query = query.arg("message", message.into());
13037 Error {
13038 proc: self.proc.clone(),
13039 selection: query,
13040 graphql_client: self.graphql_client.clone(),
13041 }
13042 }
13043 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13051 let mut query = self.selection.select("file");
13052 query = query.arg("name", name.into());
13053 query = query.arg("contents", contents.into());
13054 File {
13055 proc: self.proc.clone(),
13056 selection: query,
13057 graphql_client: self.graphql_client.clone(),
13058 }
13059 }
13060 pub fn file_opts(
13068 &self,
13069 name: impl Into<String>,
13070 contents: impl Into<String>,
13071 opts: QueryFileOpts,
13072 ) -> File {
13073 let mut query = self.selection.select("file");
13074 query = query.arg("name", name.into());
13075 query = query.arg("contents", contents.into());
13076 if let Some(permissions) = opts.permissions {
13077 query = query.arg("permissions", permissions);
13078 }
13079 File {
13080 proc: self.proc.clone(),
13081 selection: query,
13082 graphql_client: self.graphql_client.clone(),
13083 }
13084 }
13085 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13092 let mut query = self.selection.select("function");
13093 query = query.arg("name", name.into());
13094 query = query.arg_lazy(
13095 "returnType",
13096 Box::new(move || {
13097 let return_type = return_type.clone();
13098 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13099 }),
13100 );
13101 Function {
13102 proc: self.proc.clone(),
13103 selection: query,
13104 graphql_client: self.graphql_client.clone(),
13105 }
13106 }
13107 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13109 let mut query = self.selection.select("generatedCode");
13110 query = query.arg_lazy(
13111 "code",
13112 Box::new(move || {
13113 let code = code.clone();
13114 Box::pin(async move { code.into_id().await.unwrap().quote() })
13115 }),
13116 );
13117 GeneratedCode {
13118 proc: self.proc.clone(),
13119 selection: query,
13120 graphql_client: self.graphql_client.clone(),
13121 }
13122 }
13123 pub fn git(&self, url: impl Into<String>) -> GitRepository {
13134 let mut query = self.selection.select("git");
13135 query = query.arg("url", url.into());
13136 GitRepository {
13137 proc: self.proc.clone(),
13138 selection: query,
13139 graphql_client: self.graphql_client.clone(),
13140 }
13141 }
13142 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13153 let mut query = self.selection.select("git");
13154 query = query.arg("url", url.into());
13155 if let Some(keep_git_dir) = opts.keep_git_dir {
13156 query = query.arg("keepGitDir", keep_git_dir);
13157 }
13158 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13159 query = query.arg("sshKnownHosts", ssh_known_hosts);
13160 }
13161 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13162 query = query.arg("sshAuthSocket", ssh_auth_socket);
13163 }
13164 if let Some(http_auth_username) = opts.http_auth_username {
13165 query = query.arg("httpAuthUsername", http_auth_username);
13166 }
13167 if let Some(http_auth_token) = opts.http_auth_token {
13168 query = query.arg("httpAuthToken", http_auth_token);
13169 }
13170 if let Some(http_auth_header) = opts.http_auth_header {
13171 query = query.arg("httpAuthHeader", http_auth_header);
13172 }
13173 if let Some(experimental_service_host) = opts.experimental_service_host {
13174 query = query.arg("experimentalServiceHost", experimental_service_host);
13175 }
13176 GitRepository {
13177 proc: self.proc.clone(),
13178 selection: query,
13179 graphql_client: self.graphql_client.clone(),
13180 }
13181 }
13182 pub fn host(&self) -> Host {
13184 let query = self.selection.select("host");
13185 Host {
13186 proc: self.proc.clone(),
13187 selection: query,
13188 graphql_client: self.graphql_client.clone(),
13189 }
13190 }
13191 pub fn http(&self, url: impl Into<String>) -> File {
13198 let mut query = self.selection.select("http");
13199 query = query.arg("url", url.into());
13200 File {
13201 proc: self.proc.clone(),
13202 selection: query,
13203 graphql_client: self.graphql_client.clone(),
13204 }
13205 }
13206 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13213 let mut query = self.selection.select("http");
13214 query = query.arg("url", url.into());
13215 if let Some(name) = opts.name {
13216 query = query.arg("name", name);
13217 }
13218 if let Some(permissions) = opts.permissions {
13219 query = query.arg("permissions", permissions);
13220 }
13221 if let Some(checksum) = opts.checksum {
13222 query = query.arg("checksum", checksum);
13223 }
13224 if let Some(auth_header) = opts.auth_header {
13225 query = query.arg("authHeader", auth_header);
13226 }
13227 if let Some(experimental_service_host) = opts.experimental_service_host {
13228 query = query.arg("experimentalServiceHost", experimental_service_host);
13229 }
13230 File {
13231 proc: self.proc.clone(),
13232 selection: query,
13233 graphql_client: self.graphql_client.clone(),
13234 }
13235 }
13236 pub async fn id(&self) -> Result<Id, DaggerError> {
13238 let query = self.selection.select("id");
13239 query.execute(self.graphql_client.clone()).await
13240 }
13241 pub fn json(&self) -> JsonValue {
13243 let query = self.selection.select("json");
13244 JsonValue {
13245 proc: self.proc.clone(),
13246 selection: query,
13247 graphql_client: self.graphql_client.clone(),
13248 }
13249 }
13250 pub fn llm(&self) -> Llm {
13256 let query = self.selection.select("llm");
13257 Llm {
13258 proc: self.proc.clone(),
13259 selection: query,
13260 graphql_client: self.graphql_client.clone(),
13261 }
13262 }
13263 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13269 let mut query = self.selection.select("llm");
13270 if let Some(model) = opts.model {
13271 query = query.arg("model", model);
13272 }
13273 if let Some(provider) = opts.provider {
13274 query = query.arg("provider", provider);
13275 }
13276 Llm {
13277 proc: self.proc.clone(),
13278 selection: query,
13279 graphql_client: self.graphql_client.clone(),
13280 }
13281 }
13282 pub fn module(&self) -> Module {
13284 let query = self.selection.select("module");
13285 Module {
13286 proc: self.proc.clone(),
13287 selection: query,
13288 graphql_client: self.graphql_client.clone(),
13289 }
13290 }
13291 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
13298 let mut query = self.selection.select("moduleSource");
13299 query = query.arg("refString", ref_string.into());
13300 ModuleSource {
13301 proc: self.proc.clone(),
13302 selection: query,
13303 graphql_client: self.graphql_client.clone(),
13304 }
13305 }
13306 pub fn module_source_opts<'a>(
13313 &self,
13314 ref_string: impl Into<String>,
13315 opts: QueryModuleSourceOpts<'a>,
13316 ) -> ModuleSource {
13317 let mut query = self.selection.select("moduleSource");
13318 query = query.arg("refString", ref_string.into());
13319 if let Some(version) = opts.version {
13320 query = query.arg("version", version);
13321 }
13322 if let Some(ref_pin) = opts.ref_pin {
13323 query = query.arg("refPin", ref_pin);
13324 }
13325 if let Some(disable_find_up) = opts.disable_find_up {
13326 query = query.arg("disableFindUp", disable_find_up);
13327 }
13328 if let Some(allow_not_exists) = opts.allow_not_exists {
13329 query = query.arg("allowNotExists", allow_not_exists);
13330 }
13331 if let Some(require_kind) = opts.require_kind {
13332 query = query.arg("requireKind", require_kind);
13333 }
13334 ModuleSource {
13335 proc: self.proc.clone(),
13336 selection: query,
13337 graphql_client: self.graphql_client.clone(),
13338 }
13339 }
13340 pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
13342 let mut query = self.selection.select("node");
13343 query = query.arg_lazy(
13344 "id",
13345 Box::new(move || {
13346 let id = id.clone();
13347 Box::pin(async move { id.into_id().await.unwrap().quote() })
13348 }),
13349 );
13350 let query = query.select("id");
13351 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13352 Ok(id.map(|id| NodeClient {
13353 proc: self.proc.clone(),
13354 selection: query
13355 .root()
13356 .select("node")
13357 .arg("id", &id.0)
13358 .inline_fragment("Node"),
13359 graphql_client: self.graphql_client.clone(),
13360 }))
13361 }
13362 pub fn schema(&self, json: Json) -> Schema {
13368 let mut query = self.selection.select("schema");
13369 query = query.arg("json", json);
13370 Schema {
13371 proc: self.proc.clone(),
13372 selection: query,
13373 graphql_client: self.graphql_client.clone(),
13374 }
13375 }
13376 pub fn secret(&self, uri: impl Into<String>) -> Secret {
13383 let mut query = self.selection.select("secret");
13384 query = query.arg("uri", uri.into());
13385 Secret {
13386 proc: self.proc.clone(),
13387 selection: query,
13388 graphql_client: self.graphql_client.clone(),
13389 }
13390 }
13391 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
13398 let mut query = self.selection.select("secret");
13399 query = query.arg("uri", uri.into());
13400 if let Some(cache_key) = opts.cache_key {
13401 query = query.arg("cacheKey", cache_key);
13402 }
13403 Secret {
13404 proc: self.proc.clone(),
13405 selection: query,
13406 graphql_client: self.graphql_client.clone(),
13407 }
13408 }
13409 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
13417 let mut query = self.selection.select("setSecret");
13418 query = query.arg("name", name.into());
13419 query = query.arg("plaintext", plaintext.into());
13420 Secret {
13421 proc: self.proc.clone(),
13422 selection: query,
13423 graphql_client: self.graphql_client.clone(),
13424 }
13425 }
13426 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
13434 let mut query = self.selection.select("sourceMap");
13435 query = query.arg("filename", filename.into());
13436 query = query.arg("line", line);
13437 query = query.arg("column", column);
13438 SourceMap {
13439 proc: self.proc.clone(),
13440 selection: query,
13441 graphql_client: self.graphql_client.clone(),
13442 }
13443 }
13444 pub fn sshfs_volume(
13452 &self,
13453 endpoint: impl Into<String>,
13454 private_key: impl IntoID<Id>,
13455 ) -> Volume {
13456 let mut query = self.selection.select("sshfsVolume");
13457 query = query.arg("endpoint", endpoint.into());
13458 query = query.arg_lazy(
13459 "privateKey",
13460 Box::new(move || {
13461 let private_key = private_key.clone();
13462 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
13463 }),
13464 );
13465 Volume {
13466 proc: self.proc.clone(),
13467 selection: query,
13468 graphql_client: self.graphql_client.clone(),
13469 }
13470 }
13471 pub fn sshfs_volume_opts<'a>(
13479 &self,
13480 endpoint: impl Into<String>,
13481 private_key: impl IntoID<Id>,
13482 opts: QuerySshfsVolumeOpts<'a>,
13483 ) -> Volume {
13484 let mut query = self.selection.select("sshfsVolume");
13485 query = query.arg("endpoint", endpoint.into());
13486 query = query.arg_lazy(
13487 "privateKey",
13488 Box::new(move || {
13489 let private_key = private_key.clone();
13490 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
13491 }),
13492 );
13493 if let Some(known_hosts) = opts.known_hosts {
13494 query = query.arg("knownHosts", known_hosts);
13495 }
13496 if let Some(cache_key) = opts.cache_key {
13497 query = query.arg("cacheKey", cache_key);
13498 }
13499 if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
13500 query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
13501 }
13502 if let Some(experimental_service_host) = opts.experimental_service_host {
13503 query = query.arg("experimentalServiceHost", experimental_service_host);
13504 }
13505 Volume {
13506 proc: self.proc.clone(),
13507 selection: query,
13508 graphql_client: self.graphql_client.clone(),
13509 }
13510 }
13511 pub fn type_def(&self) -> TypeDef {
13513 let query = self.selection.select("typeDef");
13514 TypeDef {
13515 proc: self.proc.clone(),
13516 selection: query,
13517 graphql_client: self.graphql_client.clone(),
13518 }
13519 }
13520 pub async fn version(&self) -> Result<String, DaggerError> {
13522 let query = self.selection.select("version");
13523 query.execute(self.graphql_client.clone()).await
13524 }
13525}
13526impl Node for Query {
13527 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13528 let query = self.selection.select("id");
13529 let graphql_client = self.graphql_client.clone();
13530 async move { query.execute(graphql_client).await }
13531 }
13532}
13533#[derive(Clone)]
13534pub struct RemoteGitMirror {
13535 pub proc: Option<Arc<DaggerSessionProc>>,
13536 pub selection: Selection,
13537 pub graphql_client: DynGraphQLClient,
13538}
13539impl IntoID<Id> for RemoteGitMirror {
13540 fn into_id(
13541 self,
13542 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13543 Box::pin(async move { self.id().await })
13544 }
13545}
13546impl Loadable for RemoteGitMirror {
13547 fn graphql_type() -> &'static str {
13548 "RemoteGitMirror"
13549 }
13550 fn from_query(
13551 proc: Option<Arc<DaggerSessionProc>>,
13552 selection: Selection,
13553 graphql_client: DynGraphQLClient,
13554 ) -> Self {
13555 Self {
13556 proc,
13557 selection,
13558 graphql_client,
13559 }
13560 }
13561}
13562impl RemoteGitMirror {
13563 pub async fn id(&self) -> Result<Id, DaggerError> {
13565 let query = self.selection.select("id");
13566 query.execute(self.graphql_client.clone()).await
13567 }
13568}
13569impl Node for RemoteGitMirror {
13570 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13571 let query = self.selection.select("id");
13572 let graphql_client = self.graphql_client.clone();
13573 async move { query.execute(graphql_client).await }
13574 }
13575}
13576#[derive(Clone)]
13577pub struct SdkConfig {
13578 pub proc: Option<Arc<DaggerSessionProc>>,
13579 pub selection: Selection,
13580 pub graphql_client: DynGraphQLClient,
13581}
13582impl IntoID<Id> for SdkConfig {
13583 fn into_id(
13584 self,
13585 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13586 Box::pin(async move { self.id().await })
13587 }
13588}
13589impl Loadable for SdkConfig {
13590 fn graphql_type() -> &'static str {
13591 "SDKConfig"
13592 }
13593 fn from_query(
13594 proc: Option<Arc<DaggerSessionProc>>,
13595 selection: Selection,
13596 graphql_client: DynGraphQLClient,
13597 ) -> Self {
13598 Self {
13599 proc,
13600 selection,
13601 graphql_client,
13602 }
13603 }
13604}
13605impl SdkConfig {
13606 pub async fn debug(&self) -> Result<bool, DaggerError> {
13608 let query = self.selection.select("debug");
13609 query.execute(self.graphql_client.clone()).await
13610 }
13611 pub async fn id(&self) -> Result<Id, DaggerError> {
13613 let query = self.selection.select("id");
13614 query.execute(self.graphql_client.clone()).await
13615 }
13616 pub async fn source(&self) -> Result<String, DaggerError> {
13618 let query = self.selection.select("source");
13619 query.execute(self.graphql_client.clone()).await
13620 }
13621}
13622impl Node for SdkConfig {
13623 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13624 let query = self.selection.select("id");
13625 let graphql_client = self.graphql_client.clone();
13626 async move { query.execute(graphql_client).await }
13627 }
13628}
13629#[derive(Clone)]
13630pub struct ScalarTypeDef {
13631 pub proc: Option<Arc<DaggerSessionProc>>,
13632 pub selection: Selection,
13633 pub graphql_client: DynGraphQLClient,
13634}
13635impl IntoID<Id> for ScalarTypeDef {
13636 fn into_id(
13637 self,
13638 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13639 Box::pin(async move { self.id().await })
13640 }
13641}
13642impl Loadable for ScalarTypeDef {
13643 fn graphql_type() -> &'static str {
13644 "ScalarTypeDef"
13645 }
13646 fn from_query(
13647 proc: Option<Arc<DaggerSessionProc>>,
13648 selection: Selection,
13649 graphql_client: DynGraphQLClient,
13650 ) -> Self {
13651 Self {
13652 proc,
13653 selection,
13654 graphql_client,
13655 }
13656 }
13657}
13658impl ScalarTypeDef {
13659 pub async fn description(&self) -> Result<String, DaggerError> {
13661 let query = self.selection.select("description");
13662 query.execute(self.graphql_client.clone()).await
13663 }
13664 pub async fn id(&self) -> Result<Id, DaggerError> {
13666 let query = self.selection.select("id");
13667 query.execute(self.graphql_client.clone()).await
13668 }
13669 pub async fn name(&self) -> Result<String, DaggerError> {
13671 let query = self.selection.select("name");
13672 query.execute(self.graphql_client.clone()).await
13673 }
13674 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
13676 let query = self.selection.select("sourceModuleName");
13677 query.execute(self.graphql_client.clone()).await
13678 }
13679}
13680impl Node for ScalarTypeDef {
13681 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13682 let query = self.selection.select("id");
13683 let graphql_client = self.graphql_client.clone();
13684 async move { query.execute(graphql_client).await }
13685 }
13686}
13687#[derive(Clone)]
13688pub struct Schema {
13689 pub proc: Option<Arc<DaggerSessionProc>>,
13690 pub selection: Selection,
13691 pub graphql_client: DynGraphQLClient,
13692}
13693impl IntoID<Id> for Schema {
13694 fn into_id(
13695 self,
13696 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13697 Box::pin(async move { self.id().await })
13698 }
13699}
13700impl Loadable for Schema {
13701 fn graphql_type() -> &'static str {
13702 "Schema"
13703 }
13704 fn from_query(
13705 proc: Option<Arc<DaggerSessionProc>>,
13706 selection: Selection,
13707 graphql_client: DynGraphQLClient,
13708 ) -> Self {
13709 Self {
13710 proc,
13711 selection,
13712 graphql_client,
13713 }
13714 }
13715}
13716impl Schema {
13717 pub async fn contents(&self) -> Result<Json, DaggerError> {
13719 let query = self.selection.select("contents");
13720 query.execute(self.graphql_client.clone()).await
13721 }
13722 pub async fn id(&self) -> Result<Id, DaggerError> {
13724 let query = self.selection.select("id");
13725 query.execute(self.graphql_client.clone()).await
13726 }
13727 pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
13734 let mut query = self.selection.select("merge");
13735 query = query.arg("moduleTypes", module_types);
13736 query = query.arg("moduleName", module_name.into());
13737 Schema {
13738 proc: self.proc.clone(),
13739 selection: query,
13740 graphql_client: self.graphql_client.clone(),
13741 }
13742 }
13743}
13744impl Node for Schema {
13745 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13746 let query = self.selection.select("id");
13747 let graphql_client = self.graphql_client.clone();
13748 async move { query.execute(graphql_client).await }
13749 }
13750}
13751#[derive(Clone)]
13752pub struct SearchResult {
13753 pub proc: Option<Arc<DaggerSessionProc>>,
13754 pub selection: Selection,
13755 pub graphql_client: DynGraphQLClient,
13756}
13757impl IntoID<Id> for SearchResult {
13758 fn into_id(
13759 self,
13760 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13761 Box::pin(async move { self.id().await })
13762 }
13763}
13764impl Loadable for SearchResult {
13765 fn graphql_type() -> &'static str {
13766 "SearchResult"
13767 }
13768 fn from_query(
13769 proc: Option<Arc<DaggerSessionProc>>,
13770 selection: Selection,
13771 graphql_client: DynGraphQLClient,
13772 ) -> Self {
13773 Self {
13774 proc,
13775 selection,
13776 graphql_client,
13777 }
13778 }
13779}
13780impl SearchResult {
13781 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
13783 let query = self.selection.select("absoluteOffset");
13784 query.execute(self.graphql_client.clone()).await
13785 }
13786 pub async fn file_path(&self) -> Result<String, DaggerError> {
13788 let query = self.selection.select("filePath");
13789 query.execute(self.graphql_client.clone()).await
13790 }
13791 pub async fn id(&self) -> Result<Id, DaggerError> {
13793 let query = self.selection.select("id");
13794 query.execute(self.graphql_client.clone()).await
13795 }
13796 pub async fn line_number(&self) -> Result<isize, DaggerError> {
13798 let query = self.selection.select("lineNumber");
13799 query.execute(self.graphql_client.clone()).await
13800 }
13801 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
13803 let query = self.selection.select("matchedLines");
13804 query.execute(self.graphql_client.clone()).await
13805 }
13806 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
13808 let query = self.selection.select("submatches");
13809 let query = query.select("id");
13810 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13811 Ok(ids
13812 .into_iter()
13813 .map(|id| SearchSubmatch {
13814 proc: self.proc.clone(),
13815 selection: crate::querybuilder::query()
13816 .select("node")
13817 .arg("id", &id.0)
13818 .inline_fragment("SearchSubmatch"),
13819 graphql_client: self.graphql_client.clone(),
13820 })
13821 .collect())
13822 }
13823}
13824impl Node for SearchResult {
13825 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13826 let query = self.selection.select("id");
13827 let graphql_client = self.graphql_client.clone();
13828 async move { query.execute(graphql_client).await }
13829 }
13830}
13831#[derive(Clone)]
13832pub struct SearchSubmatch {
13833 pub proc: Option<Arc<DaggerSessionProc>>,
13834 pub selection: Selection,
13835 pub graphql_client: DynGraphQLClient,
13836}
13837impl IntoID<Id> for SearchSubmatch {
13838 fn into_id(
13839 self,
13840 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13841 Box::pin(async move { self.id().await })
13842 }
13843}
13844impl Loadable for SearchSubmatch {
13845 fn graphql_type() -> &'static str {
13846 "SearchSubmatch"
13847 }
13848 fn from_query(
13849 proc: Option<Arc<DaggerSessionProc>>,
13850 selection: Selection,
13851 graphql_client: DynGraphQLClient,
13852 ) -> Self {
13853 Self {
13854 proc,
13855 selection,
13856 graphql_client,
13857 }
13858 }
13859}
13860impl SearchSubmatch {
13861 pub async fn end(&self) -> Result<isize, DaggerError> {
13863 let query = self.selection.select("end");
13864 query.execute(self.graphql_client.clone()).await
13865 }
13866 pub async fn id(&self) -> Result<Id, DaggerError> {
13868 let query = self.selection.select("id");
13869 query.execute(self.graphql_client.clone()).await
13870 }
13871 pub async fn start(&self) -> Result<isize, DaggerError> {
13873 let query = self.selection.select("start");
13874 query.execute(self.graphql_client.clone()).await
13875 }
13876 pub async fn text(&self) -> Result<String, DaggerError> {
13878 let query = self.selection.select("text");
13879 query.execute(self.graphql_client.clone()).await
13880 }
13881}
13882impl Node for SearchSubmatch {
13883 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13884 let query = self.selection.select("id");
13885 let graphql_client = self.graphql_client.clone();
13886 async move { query.execute(graphql_client).await }
13887 }
13888}
13889#[derive(Clone)]
13890pub struct Secret {
13891 pub proc: Option<Arc<DaggerSessionProc>>,
13892 pub selection: Selection,
13893 pub graphql_client: DynGraphQLClient,
13894}
13895impl IntoID<Id> for Secret {
13896 fn into_id(
13897 self,
13898 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13899 Box::pin(async move { self.id().await })
13900 }
13901}
13902impl Loadable for Secret {
13903 fn graphql_type() -> &'static str {
13904 "Secret"
13905 }
13906 fn from_query(
13907 proc: Option<Arc<DaggerSessionProc>>,
13908 selection: Selection,
13909 graphql_client: DynGraphQLClient,
13910 ) -> Self {
13911 Self {
13912 proc,
13913 selection,
13914 graphql_client,
13915 }
13916 }
13917}
13918impl Secret {
13919 pub async fn id(&self) -> Result<Id, DaggerError> {
13921 let query = self.selection.select("id");
13922 query.execute(self.graphql_client.clone()).await
13923 }
13924 pub async fn name(&self) -> Result<String, DaggerError> {
13926 let query = self.selection.select("name");
13927 query.execute(self.graphql_client.clone()).await
13928 }
13929 pub async fn plaintext(&self) -> Result<String, DaggerError> {
13931 let query = self.selection.select("plaintext");
13932 query.execute(self.graphql_client.clone()).await
13933 }
13934 pub async fn uri(&self) -> Result<String, DaggerError> {
13936 let query = self.selection.select("uri");
13937 query.execute(self.graphql_client.clone()).await
13938 }
13939}
13940impl Node for Secret {
13941 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13942 let query = self.selection.select("id");
13943 let graphql_client = self.graphql_client.clone();
13944 async move { query.execute(graphql_client).await }
13945 }
13946}
13947#[derive(Clone)]
13948pub struct Service {
13949 pub proc: Option<Arc<DaggerSessionProc>>,
13950 pub selection: Selection,
13951 pub graphql_client: DynGraphQLClient,
13952}
13953#[derive(Builder, Debug, PartialEq)]
13954pub struct ServiceEndpointOpts<'a> {
13955 #[builder(setter(into, strip_option), default)]
13957 pub port: Option<isize>,
13958 #[builder(setter(into, strip_option), default)]
13960 pub scheme: Option<&'a str>,
13961}
13962#[derive(Builder, Debug, PartialEq)]
13963pub struct ServiceStopOpts {
13964 #[builder(setter(into, strip_option), default)]
13966 pub kill: Option<bool>,
13967}
13968#[derive(Builder, Debug, PartialEq)]
13969pub struct ServiceTerminalOpts<'a> {
13970 #[builder(setter(into, strip_option), default)]
13971 pub cmd: Option<Vec<&'a str>>,
13972}
13973#[derive(Builder, Debug, PartialEq)]
13974pub struct ServiceUpOpts {
13975 #[builder(setter(into, strip_option), default)]
13978 pub ports: Option<Vec<PortForward>>,
13979 #[builder(setter(into, strip_option), default)]
13981 pub random: Option<bool>,
13982}
13983impl IntoID<Id> for Service {
13984 fn into_id(
13985 self,
13986 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13987 Box::pin(async move { self.id().await })
13988 }
13989}
13990impl Loadable for Service {
13991 fn graphql_type() -> &'static str {
13992 "Service"
13993 }
13994 fn from_query(
13995 proc: Option<Arc<DaggerSessionProc>>,
13996 selection: Selection,
13997 graphql_client: DynGraphQLClient,
13998 ) -> Self {
13999 Self {
14000 proc,
14001 selection,
14002 graphql_client,
14003 }
14004 }
14005}
14006impl Service {
14007 pub async fn endpoint(&self) -> Result<String, DaggerError> {
14015 let query = self.selection.select("endpoint");
14016 query.execute(self.graphql_client.clone()).await
14017 }
14018 pub async fn endpoint_opts<'a>(
14026 &self,
14027 opts: ServiceEndpointOpts<'a>,
14028 ) -> Result<String, DaggerError> {
14029 let mut query = self.selection.select("endpoint");
14030 if let Some(port) = opts.port {
14031 query = query.arg("port", port);
14032 }
14033 if let Some(scheme) = opts.scheme {
14034 query = query.arg("scheme", scheme);
14035 }
14036 query.execute(self.graphql_client.clone()).await
14037 }
14038 pub async fn hostname(&self) -> Result<String, DaggerError> {
14040 let query = self.selection.select("hostname");
14041 query.execute(self.graphql_client.clone()).await
14042 }
14043 pub async fn id(&self) -> Result<Id, DaggerError> {
14045 let query = self.selection.select("id");
14046 query.execute(self.graphql_client.clone()).await
14047 }
14048 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
14050 let query = self.selection.select("ports");
14051 let query = query.select("id");
14052 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14053 Ok(ids
14054 .into_iter()
14055 .map(|id| Port {
14056 proc: self.proc.clone(),
14057 selection: crate::querybuilder::query()
14058 .select("node")
14059 .arg("id", &id.0)
14060 .inline_fragment("Port"),
14061 graphql_client: self.graphql_client.clone(),
14062 })
14063 .collect())
14064 }
14065 pub async fn start(&self) -> Result<Service, DaggerError> {
14068 let query = self.selection.select("start");
14069 let id: Id = query.execute(self.graphql_client.clone()).await?;
14070 Ok(Service {
14071 proc: self.proc.clone(),
14072 selection: query
14073 .root()
14074 .select("node")
14075 .arg("id", &id.0)
14076 .inline_fragment("Service"),
14077 graphql_client: self.graphql_client.clone(),
14078 })
14079 }
14080 pub async fn stop(&self) -> Result<Service, DaggerError> {
14086 let query = self.selection.select("stop");
14087 let id: Id = query.execute(self.graphql_client.clone()).await?;
14088 Ok(Service {
14089 proc: self.proc.clone(),
14090 selection: query
14091 .root()
14092 .select("node")
14093 .arg("id", &id.0)
14094 .inline_fragment("Service"),
14095 graphql_client: self.graphql_client.clone(),
14096 })
14097 }
14098 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
14104 let mut query = self.selection.select("stop");
14105 if let Some(kill) = opts.kill {
14106 query = query.arg("kill", kill);
14107 }
14108 let id: Id = query.execute(self.graphql_client.clone()).await?;
14109 Ok(Service {
14110 proc: self.proc.clone(),
14111 selection: query
14112 .root()
14113 .select("node")
14114 .arg("id", &id.0)
14115 .inline_fragment("Service"),
14116 graphql_client: self.graphql_client.clone(),
14117 })
14118 }
14119 pub async fn sync(&self) -> Result<Service, DaggerError> {
14121 let query = self.selection.select("sync");
14122 let id: Id = query.execute(self.graphql_client.clone()).await?;
14123 Ok(Service {
14124 proc: self.proc.clone(),
14125 selection: query
14126 .root()
14127 .select("node")
14128 .arg("id", &id.0)
14129 .inline_fragment("Service"),
14130 graphql_client: self.graphql_client.clone(),
14131 })
14132 }
14133 pub fn terminal(&self) -> Service {
14138 let query = self.selection.select("terminal");
14139 Service {
14140 proc: self.proc.clone(),
14141 selection: query,
14142 graphql_client: self.graphql_client.clone(),
14143 }
14144 }
14145 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
14150 let mut query = self.selection.select("terminal");
14151 if let Some(cmd) = opts.cmd {
14152 query = query.arg("cmd", cmd);
14153 }
14154 Service {
14155 proc: self.proc.clone(),
14156 selection: query,
14157 graphql_client: self.graphql_client.clone(),
14158 }
14159 }
14160 pub async fn up(&self) -> Result<Void, DaggerError> {
14166 let query = self.selection.select("up");
14167 query.execute(self.graphql_client.clone()).await
14168 }
14169 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
14175 let mut query = self.selection.select("up");
14176 if let Some(ports) = opts.ports {
14177 query = query.arg("ports", ports);
14178 }
14179 if let Some(random) = opts.random {
14180 query = query.arg("random", random);
14181 }
14182 query.execute(self.graphql_client.clone()).await
14183 }
14184 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
14190 let mut query = self.selection.select("withHostname");
14191 query = query.arg("hostname", hostname.into());
14192 Service {
14193 proc: self.proc.clone(),
14194 selection: query,
14195 graphql_client: self.graphql_client.clone(),
14196 }
14197 }
14198}
14199impl Node for Service {
14200 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14201 let query = self.selection.select("id");
14202 let graphql_client = self.graphql_client.clone();
14203 async move { query.execute(graphql_client).await }
14204 }
14205}
14206impl Syncer for Service {
14207 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14208 let query = self.selection.select("id");
14209 let graphql_client = self.graphql_client.clone();
14210 async move { query.execute(graphql_client).await }
14211 }
14212 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14213 let query = self.selection.select("sync");
14214 let graphql_client = self.graphql_client.clone();
14215 async move { query.execute(graphql_client).await }
14216 }
14217}
14218#[derive(Clone)]
14219pub struct Socket {
14220 pub proc: Option<Arc<DaggerSessionProc>>,
14221 pub selection: Selection,
14222 pub graphql_client: DynGraphQLClient,
14223}
14224impl IntoID<Id> for Socket {
14225 fn into_id(
14226 self,
14227 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14228 Box::pin(async move { self.id().await })
14229 }
14230}
14231impl Loadable for Socket {
14232 fn graphql_type() -> &'static str {
14233 "Socket"
14234 }
14235 fn from_query(
14236 proc: Option<Arc<DaggerSessionProc>>,
14237 selection: Selection,
14238 graphql_client: DynGraphQLClient,
14239 ) -> Self {
14240 Self {
14241 proc,
14242 selection,
14243 graphql_client,
14244 }
14245 }
14246}
14247impl Socket {
14248 pub async fn id(&self) -> Result<Id, DaggerError> {
14250 let query = self.selection.select("id");
14251 query.execute(self.graphql_client.clone()).await
14252 }
14253}
14254impl Node for Socket {
14255 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14256 let query = self.selection.select("id");
14257 let graphql_client = self.graphql_client.clone();
14258 async move { query.execute(graphql_client).await }
14259 }
14260}
14261#[derive(Clone)]
14262pub struct SourceMap {
14263 pub proc: Option<Arc<DaggerSessionProc>>,
14264 pub selection: Selection,
14265 pub graphql_client: DynGraphQLClient,
14266}
14267impl IntoID<Id> for SourceMap {
14268 fn into_id(
14269 self,
14270 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14271 Box::pin(async move { self.id().await })
14272 }
14273}
14274impl Loadable for SourceMap {
14275 fn graphql_type() -> &'static str {
14276 "SourceMap"
14277 }
14278 fn from_query(
14279 proc: Option<Arc<DaggerSessionProc>>,
14280 selection: Selection,
14281 graphql_client: DynGraphQLClient,
14282 ) -> Self {
14283 Self {
14284 proc,
14285 selection,
14286 graphql_client,
14287 }
14288 }
14289}
14290impl SourceMap {
14291 pub async fn column(&self) -> Result<isize, DaggerError> {
14293 let query = self.selection.select("column");
14294 query.execute(self.graphql_client.clone()).await
14295 }
14296 pub async fn filename(&self) -> Result<String, DaggerError> {
14298 let query = self.selection.select("filename");
14299 query.execute(self.graphql_client.clone()).await
14300 }
14301 pub async fn id(&self) -> Result<Id, DaggerError> {
14303 let query = self.selection.select("id");
14304 query.execute(self.graphql_client.clone()).await
14305 }
14306 pub async fn line(&self) -> Result<isize, DaggerError> {
14308 let query = self.selection.select("line");
14309 query.execute(self.graphql_client.clone()).await
14310 }
14311 pub async fn module(&self) -> Result<String, DaggerError> {
14313 let query = self.selection.select("module");
14314 query.execute(self.graphql_client.clone()).await
14315 }
14316 pub async fn url(&self) -> Result<String, DaggerError> {
14318 let query = self.selection.select("url");
14319 query.execute(self.graphql_client.clone()).await
14320 }
14321}
14322impl Node for SourceMap {
14323 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14324 let query = self.selection.select("id");
14325 let graphql_client = self.graphql_client.clone();
14326 async move { query.execute(graphql_client).await }
14327 }
14328}
14329#[derive(Clone)]
14330pub struct Stat {
14331 pub proc: Option<Arc<DaggerSessionProc>>,
14332 pub selection: Selection,
14333 pub graphql_client: DynGraphQLClient,
14334}
14335impl IntoID<Id> for Stat {
14336 fn into_id(
14337 self,
14338 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14339 Box::pin(async move { self.id().await })
14340 }
14341}
14342impl Loadable for Stat {
14343 fn graphql_type() -> &'static str {
14344 "Stat"
14345 }
14346 fn from_query(
14347 proc: Option<Arc<DaggerSessionProc>>,
14348 selection: Selection,
14349 graphql_client: DynGraphQLClient,
14350 ) -> Self {
14351 Self {
14352 proc,
14353 selection,
14354 graphql_client,
14355 }
14356 }
14357}
14358impl Stat {
14359 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
14361 let query = self.selection.select("fileType");
14362 query.execute(self.graphql_client.clone()).await
14363 }
14364 pub async fn id(&self) -> Result<Id, DaggerError> {
14366 let query = self.selection.select("id");
14367 query.execute(self.graphql_client.clone()).await
14368 }
14369 pub async fn name(&self) -> Result<String, DaggerError> {
14371 let query = self.selection.select("name");
14372 query.execute(self.graphql_client.clone()).await
14373 }
14374 pub async fn permissions(&self) -> Result<isize, DaggerError> {
14376 let query = self.selection.select("permissions");
14377 query.execute(self.graphql_client.clone()).await
14378 }
14379 pub async fn size(&self) -> Result<isize, DaggerError> {
14381 let query = self.selection.select("size");
14382 query.execute(self.graphql_client.clone()).await
14383 }
14384}
14385impl Node for Stat {
14386 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14387 let query = self.selection.select("id");
14388 let graphql_client = self.graphql_client.clone();
14389 async move { query.execute(graphql_client).await }
14390 }
14391}
14392#[derive(Clone)]
14393pub struct Terminal {
14394 pub proc: Option<Arc<DaggerSessionProc>>,
14395 pub selection: Selection,
14396 pub graphql_client: DynGraphQLClient,
14397}
14398impl IntoID<Id> for Terminal {
14399 fn into_id(
14400 self,
14401 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14402 Box::pin(async move { self.id().await })
14403 }
14404}
14405impl Loadable for Terminal {
14406 fn graphql_type() -> &'static str {
14407 "Terminal"
14408 }
14409 fn from_query(
14410 proc: Option<Arc<DaggerSessionProc>>,
14411 selection: Selection,
14412 graphql_client: DynGraphQLClient,
14413 ) -> Self {
14414 Self {
14415 proc,
14416 selection,
14417 graphql_client,
14418 }
14419 }
14420}
14421impl Terminal {
14422 pub async fn id(&self) -> Result<Id, DaggerError> {
14424 let query = self.selection.select("id");
14425 query.execute(self.graphql_client.clone()).await
14426 }
14427 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
14430 let query = self.selection.select("sync");
14431 let id: Id = query.execute(self.graphql_client.clone()).await?;
14432 Ok(Terminal {
14433 proc: self.proc.clone(),
14434 selection: query
14435 .root()
14436 .select("node")
14437 .arg("id", &id.0)
14438 .inline_fragment("Terminal"),
14439 graphql_client: self.graphql_client.clone(),
14440 })
14441 }
14442}
14443impl Node for Terminal {
14444 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14445 let query = self.selection.select("id");
14446 let graphql_client = self.graphql_client.clone();
14447 async move { query.execute(graphql_client).await }
14448 }
14449}
14450impl Syncer for Terminal {
14451 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14452 let query = self.selection.select("id");
14453 let graphql_client = self.graphql_client.clone();
14454 async move { query.execute(graphql_client).await }
14455 }
14456 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14457 let query = self.selection.select("sync");
14458 let graphql_client = self.graphql_client.clone();
14459 async move { query.execute(graphql_client).await }
14460 }
14461}
14462#[derive(Clone)]
14463pub struct TerminalGroup {
14464 pub proc: Option<Arc<DaggerSessionProc>>,
14465 pub selection: Selection,
14466 pub graphql_client: DynGraphQLClient,
14467}
14468impl IntoID<Id> for TerminalGroup {
14469 fn into_id(
14470 self,
14471 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14472 Box::pin(async move { self.id().await })
14473 }
14474}
14475impl Loadable for TerminalGroup {
14476 fn graphql_type() -> &'static str {
14477 "TerminalGroup"
14478 }
14479 fn from_query(
14480 proc: Option<Arc<DaggerSessionProc>>,
14481 selection: Selection,
14482 graphql_client: DynGraphQLClient,
14483 ) -> Self {
14484 Self {
14485 proc,
14486 selection,
14487 graphql_client,
14488 }
14489 }
14490}
14491impl TerminalGroup {
14492 pub async fn id(&self) -> Result<Id, DaggerError> {
14494 let query = self.selection.select("id");
14495 query.execute(self.graphql_client.clone()).await
14496 }
14497 pub async fn list(&self) -> Result<Vec<TerminalTarget>, DaggerError> {
14499 let query = self.selection.select("list");
14500 let query = query.select("id");
14501 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14502 Ok(ids
14503 .into_iter()
14504 .map(|id| TerminalTarget {
14505 proc: self.proc.clone(),
14506 selection: crate::querybuilder::query()
14507 .select("node")
14508 .arg("id", &id.0)
14509 .inline_fragment("TerminalTarget"),
14510 graphql_client: self.graphql_client.clone(),
14511 })
14512 .collect())
14513 }
14514 pub fn run(&self) -> TerminalGroup {
14516 let query = self.selection.select("run");
14517 TerminalGroup {
14518 proc: self.proc.clone(),
14519 selection: query,
14520 graphql_client: self.graphql_client.clone(),
14521 }
14522 }
14523}
14524impl Node for TerminalGroup {
14525 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14526 let query = self.selection.select("id");
14527 let graphql_client = self.graphql_client.clone();
14528 async move { query.execute(graphql_client).await }
14529 }
14530}
14531#[derive(Clone)]
14532pub struct TerminalTarget {
14533 pub proc: Option<Arc<DaggerSessionProc>>,
14534 pub selection: Selection,
14535 pub graphql_client: DynGraphQLClient,
14536}
14537impl IntoID<Id> for TerminalTarget {
14538 fn into_id(
14539 self,
14540 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14541 Box::pin(async move { self.id().await })
14542 }
14543}
14544impl Loadable for TerminalTarget {
14545 fn graphql_type() -> &'static str {
14546 "TerminalTarget"
14547 }
14548 fn from_query(
14549 proc: Option<Arc<DaggerSessionProc>>,
14550 selection: Selection,
14551 graphql_client: DynGraphQLClient,
14552 ) -> Self {
14553 Self {
14554 proc,
14555 selection,
14556 graphql_client,
14557 }
14558 }
14559}
14560impl TerminalTarget {
14561 pub async fn description(&self) -> Result<String, DaggerError> {
14563 let query = self.selection.select("description");
14564 query.execute(self.graphql_client.clone()).await
14565 }
14566 pub async fn id(&self) -> Result<Id, DaggerError> {
14568 let query = self.selection.select("id");
14569 query.execute(self.graphql_client.clone()).await
14570 }
14571 pub async fn name(&self) -> Result<String, DaggerError> {
14573 let query = self.selection.select("name");
14574 query.execute(self.graphql_client.clone()).await
14575 }
14576 pub fn original_module(&self) -> Module {
14578 let query = self.selection.select("originalModule");
14579 Module {
14580 proc: self.proc.clone(),
14581 selection: query,
14582 graphql_client: self.graphql_client.clone(),
14583 }
14584 }
14585 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
14587 let query = self.selection.select("path");
14588 query.execute(self.graphql_client.clone()).await
14589 }
14590}
14591impl Node for TerminalTarget {
14592 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14593 let query = self.selection.select("id");
14594 let graphql_client = self.graphql_client.clone();
14595 async move { query.execute(graphql_client).await }
14596 }
14597}
14598#[derive(Clone)]
14599pub struct TypeDef {
14600 pub proc: Option<Arc<DaggerSessionProc>>,
14601 pub selection: Selection,
14602 pub graphql_client: DynGraphQLClient,
14603}
14604#[derive(Builder, Debug, PartialEq)]
14605pub struct TypeDefWithEnumOpts<'a> {
14606 #[builder(setter(into, strip_option), default)]
14608 pub description: Option<&'a str>,
14609 #[builder(setter(into, strip_option), default)]
14611 pub source_map: Option<Id>,
14612}
14613#[derive(Builder, Debug, PartialEq)]
14614pub struct TypeDefWithEnumMemberOpts<'a> {
14615 #[builder(setter(into, strip_option), default)]
14617 pub deprecated: Option<&'a str>,
14618 #[builder(setter(into, strip_option), default)]
14620 pub description: Option<&'a str>,
14621 #[builder(setter(into, strip_option), default)]
14623 pub source_map: Option<Id>,
14624 #[builder(setter(into, strip_option), default)]
14626 pub value: Option<&'a str>,
14627}
14628#[derive(Builder, Debug, PartialEq)]
14629pub struct TypeDefWithEnumValueOpts<'a> {
14630 #[builder(setter(into, strip_option), default)]
14632 pub deprecated: Option<&'a str>,
14633 #[builder(setter(into, strip_option), default)]
14635 pub description: Option<&'a str>,
14636 #[builder(setter(into, strip_option), default)]
14638 pub source_map: Option<Id>,
14639}
14640#[derive(Builder, Debug, PartialEq)]
14641pub struct TypeDefWithFieldOpts<'a> {
14642 #[builder(setter(into, strip_option), default)]
14644 pub deprecated: Option<&'a str>,
14645 #[builder(setter(into, strip_option), default)]
14647 pub description: Option<&'a str>,
14648 #[builder(setter(into, strip_option), default)]
14650 pub source_map: Option<Id>,
14651}
14652#[derive(Builder, Debug, PartialEq)]
14653pub struct TypeDefWithInterfaceOpts<'a> {
14654 #[builder(setter(into, strip_option), default)]
14655 pub description: Option<&'a str>,
14656 #[builder(setter(into, strip_option), default)]
14657 pub source_map: Option<Id>,
14658}
14659#[derive(Builder, Debug, PartialEq)]
14660pub struct TypeDefWithObjectOpts<'a> {
14661 #[builder(setter(into, strip_option), default)]
14662 pub deprecated: Option<&'a str>,
14663 #[builder(setter(into, strip_option), default)]
14664 pub description: Option<&'a str>,
14665 #[builder(setter(into, strip_option), default)]
14666 pub source_map: Option<Id>,
14667}
14668#[derive(Builder, Debug, PartialEq)]
14669pub struct TypeDefWithScalarOpts<'a> {
14670 #[builder(setter(into, strip_option), default)]
14671 pub description: Option<&'a str>,
14672}
14673impl IntoID<Id> for TypeDef {
14674 fn into_id(
14675 self,
14676 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14677 Box::pin(async move { self.id().await })
14678 }
14679}
14680impl Loadable for TypeDef {
14681 fn graphql_type() -> &'static str {
14682 "TypeDef"
14683 }
14684 fn from_query(
14685 proc: Option<Arc<DaggerSessionProc>>,
14686 selection: Selection,
14687 graphql_client: DynGraphQLClient,
14688 ) -> Self {
14689 Self {
14690 proc,
14691 selection,
14692 graphql_client,
14693 }
14694 }
14695}
14696impl TypeDef {
14697 pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
14699 let query = self.selection.select("asEnum");
14700 let query = query.select("id");
14701 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14702 Ok(id.map(|id| EnumTypeDef {
14703 proc: self.proc.clone(),
14704 selection: query
14705 .root()
14706 .select("node")
14707 .arg("id", &id.0)
14708 .inline_fragment("EnumTypeDef"),
14709 graphql_client: self.graphql_client.clone(),
14710 }))
14711 }
14712 pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
14714 let query = self.selection.select("asInput");
14715 let query = query.select("id");
14716 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14717 Ok(id.map(|id| InputTypeDef {
14718 proc: self.proc.clone(),
14719 selection: query
14720 .root()
14721 .select("node")
14722 .arg("id", &id.0)
14723 .inline_fragment("InputTypeDef"),
14724 graphql_client: self.graphql_client.clone(),
14725 }))
14726 }
14727 pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
14729 let query = self.selection.select("asInterface");
14730 let query = query.select("id");
14731 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14732 Ok(id.map(|id| InterfaceTypeDef {
14733 proc: self.proc.clone(),
14734 selection: query
14735 .root()
14736 .select("node")
14737 .arg("id", &id.0)
14738 .inline_fragment("InterfaceTypeDef"),
14739 graphql_client: self.graphql_client.clone(),
14740 }))
14741 }
14742 pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
14744 let query = self.selection.select("asList");
14745 let query = query.select("id");
14746 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14747 Ok(id.map(|id| ListTypeDef {
14748 proc: self.proc.clone(),
14749 selection: query
14750 .root()
14751 .select("node")
14752 .arg("id", &id.0)
14753 .inline_fragment("ListTypeDef"),
14754 graphql_client: self.graphql_client.clone(),
14755 }))
14756 }
14757 pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
14759 let query = self.selection.select("asObject");
14760 let query = query.select("id");
14761 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14762 Ok(id.map(|id| ObjectTypeDef {
14763 proc: self.proc.clone(),
14764 selection: query
14765 .root()
14766 .select("node")
14767 .arg("id", &id.0)
14768 .inline_fragment("ObjectTypeDef"),
14769 graphql_client: self.graphql_client.clone(),
14770 }))
14771 }
14772 pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
14774 let query = self.selection.select("asScalar");
14775 let query = query.select("id");
14776 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14777 Ok(id.map(|id| ScalarTypeDef {
14778 proc: self.proc.clone(),
14779 selection: query
14780 .root()
14781 .select("node")
14782 .arg("id", &id.0)
14783 .inline_fragment("ScalarTypeDef"),
14784 graphql_client: self.graphql_client.clone(),
14785 }))
14786 }
14787 pub async fn id(&self) -> Result<Id, DaggerError> {
14789 let query = self.selection.select("id");
14790 query.execute(self.graphql_client.clone()).await
14791 }
14792 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
14794 let query = self.selection.select("kind");
14795 query.execute(self.graphql_client.clone()).await
14796 }
14797 pub async fn name(&self) -> Result<String, DaggerError> {
14799 let query = self.selection.select("name");
14800 query.execute(self.graphql_client.clone()).await
14801 }
14802 pub async fn optional(&self) -> Result<bool, DaggerError> {
14804 let query = self.selection.select("optional");
14805 query.execute(self.graphql_client.clone()).await
14806 }
14807 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
14809 let mut query = self.selection.select("withConstructor");
14810 query = query.arg_lazy(
14811 "function",
14812 Box::new(move || {
14813 let function = function.clone();
14814 Box::pin(async move { function.into_id().await.unwrap().quote() })
14815 }),
14816 );
14817 TypeDef {
14818 proc: self.proc.clone(),
14819 selection: query,
14820 graphql_client: self.graphql_client.clone(),
14821 }
14822 }
14823 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
14831 let mut query = self.selection.select("withEnum");
14832 query = query.arg("name", name.into());
14833 TypeDef {
14834 proc: self.proc.clone(),
14835 selection: query,
14836 graphql_client: self.graphql_client.clone(),
14837 }
14838 }
14839 pub fn with_enum_opts<'a>(
14847 &self,
14848 name: impl Into<String>,
14849 opts: TypeDefWithEnumOpts<'a>,
14850 ) -> TypeDef {
14851 let mut query = self.selection.select("withEnum");
14852 query = query.arg("name", name.into());
14853 if let Some(description) = opts.description {
14854 query = query.arg("description", description);
14855 }
14856 if let Some(source_map) = opts.source_map {
14857 query = query.arg("sourceMap", source_map);
14858 }
14859 TypeDef {
14860 proc: self.proc.clone(),
14861 selection: query,
14862 graphql_client: self.graphql_client.clone(),
14863 }
14864 }
14865 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
14872 let mut query = self.selection.select("withEnumMember");
14873 query = query.arg("name", name.into());
14874 TypeDef {
14875 proc: self.proc.clone(),
14876 selection: query,
14877 graphql_client: self.graphql_client.clone(),
14878 }
14879 }
14880 pub fn with_enum_member_opts<'a>(
14887 &self,
14888 name: impl Into<String>,
14889 opts: TypeDefWithEnumMemberOpts<'a>,
14890 ) -> TypeDef {
14891 let mut query = self.selection.select("withEnumMember");
14892 query = query.arg("name", name.into());
14893 if let Some(value) = opts.value {
14894 query = query.arg("value", value);
14895 }
14896 if let Some(description) = opts.description {
14897 query = query.arg("description", description);
14898 }
14899 if let Some(source_map) = opts.source_map {
14900 query = query.arg("sourceMap", source_map);
14901 }
14902 if let Some(deprecated) = opts.deprecated {
14903 query = query.arg("deprecated", deprecated);
14904 }
14905 TypeDef {
14906 proc: self.proc.clone(),
14907 selection: query,
14908 graphql_client: self.graphql_client.clone(),
14909 }
14910 }
14911 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
14918 let mut query = self.selection.select("withEnumValue");
14919 query = query.arg("value", value.into());
14920 TypeDef {
14921 proc: self.proc.clone(),
14922 selection: query,
14923 graphql_client: self.graphql_client.clone(),
14924 }
14925 }
14926 pub fn with_enum_value_opts<'a>(
14933 &self,
14934 value: impl Into<String>,
14935 opts: TypeDefWithEnumValueOpts<'a>,
14936 ) -> TypeDef {
14937 let mut query = self.selection.select("withEnumValue");
14938 query = query.arg("value", value.into());
14939 if let Some(description) = opts.description {
14940 query = query.arg("description", description);
14941 }
14942 if let Some(source_map) = opts.source_map {
14943 query = query.arg("sourceMap", source_map);
14944 }
14945 if let Some(deprecated) = opts.deprecated {
14946 query = query.arg("deprecated", deprecated);
14947 }
14948 TypeDef {
14949 proc: self.proc.clone(),
14950 selection: query,
14951 graphql_client: self.graphql_client.clone(),
14952 }
14953 }
14954 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
14962 let mut query = self.selection.select("withField");
14963 query = query.arg("name", name.into());
14964 query = query.arg_lazy(
14965 "typeDef",
14966 Box::new(move || {
14967 let type_def = type_def.clone();
14968 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14969 }),
14970 );
14971 TypeDef {
14972 proc: self.proc.clone(),
14973 selection: query,
14974 graphql_client: self.graphql_client.clone(),
14975 }
14976 }
14977 pub fn with_field_opts<'a>(
14985 &self,
14986 name: impl Into<String>,
14987 type_def: impl IntoID<Id>,
14988 opts: TypeDefWithFieldOpts<'a>,
14989 ) -> TypeDef {
14990 let mut query = self.selection.select("withField");
14991 query = query.arg("name", name.into());
14992 query = query.arg_lazy(
14993 "typeDef",
14994 Box::new(move || {
14995 let type_def = type_def.clone();
14996 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14997 }),
14998 );
14999 if let Some(description) = opts.description {
15000 query = query.arg("description", description);
15001 }
15002 if let Some(source_map) = opts.source_map {
15003 query = query.arg("sourceMap", source_map);
15004 }
15005 if let Some(deprecated) = opts.deprecated {
15006 query = query.arg("deprecated", deprecated);
15007 }
15008 TypeDef {
15009 proc: self.proc.clone(),
15010 selection: query,
15011 graphql_client: self.graphql_client.clone(),
15012 }
15013 }
15014 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15016 let mut query = self.selection.select("withFunction");
15017 query = query.arg_lazy(
15018 "function",
15019 Box::new(move || {
15020 let function = function.clone();
15021 Box::pin(async move { function.into_id().await.unwrap().quote() })
15022 }),
15023 );
15024 TypeDef {
15025 proc: self.proc.clone(),
15026 selection: query,
15027 graphql_client: self.graphql_client.clone(),
15028 }
15029 }
15030 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15036 let mut query = self.selection.select("withInterface");
15037 query = query.arg("name", name.into());
15038 TypeDef {
15039 proc: self.proc.clone(),
15040 selection: query,
15041 graphql_client: self.graphql_client.clone(),
15042 }
15043 }
15044 pub fn with_interface_opts<'a>(
15050 &self,
15051 name: impl Into<String>,
15052 opts: TypeDefWithInterfaceOpts<'a>,
15053 ) -> TypeDef {
15054 let mut query = self.selection.select("withInterface");
15055 query = query.arg("name", name.into());
15056 if let Some(description) = opts.description {
15057 query = query.arg("description", description);
15058 }
15059 if let Some(source_map) = opts.source_map {
15060 query = query.arg("sourceMap", source_map);
15061 }
15062 TypeDef {
15063 proc: self.proc.clone(),
15064 selection: query,
15065 graphql_client: self.graphql_client.clone(),
15066 }
15067 }
15068 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15070 let mut query = self.selection.select("withKind");
15071 query = query.arg("kind", kind);
15072 TypeDef {
15073 proc: self.proc.clone(),
15074 selection: query,
15075 graphql_client: self.graphql_client.clone(),
15076 }
15077 }
15078 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15080 let mut query = self.selection.select("withListOf");
15081 query = query.arg_lazy(
15082 "elementType",
15083 Box::new(move || {
15084 let element_type = element_type.clone();
15085 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15086 }),
15087 );
15088 TypeDef {
15089 proc: self.proc.clone(),
15090 selection: query,
15091 graphql_client: self.graphql_client.clone(),
15092 }
15093 }
15094 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15101 let mut query = self.selection.select("withObject");
15102 query = query.arg("name", name.into());
15103 TypeDef {
15104 proc: self.proc.clone(),
15105 selection: query,
15106 graphql_client: self.graphql_client.clone(),
15107 }
15108 }
15109 pub fn with_object_opts<'a>(
15116 &self,
15117 name: impl Into<String>,
15118 opts: TypeDefWithObjectOpts<'a>,
15119 ) -> TypeDef {
15120 let mut query = self.selection.select("withObject");
15121 query = query.arg("name", name.into());
15122 if let Some(description) = opts.description {
15123 query = query.arg("description", description);
15124 }
15125 if let Some(source_map) = opts.source_map {
15126 query = query.arg("sourceMap", source_map);
15127 }
15128 if let Some(deprecated) = opts.deprecated {
15129 query = query.arg("deprecated", deprecated);
15130 }
15131 TypeDef {
15132 proc: self.proc.clone(),
15133 selection: query,
15134 graphql_client: self.graphql_client.clone(),
15135 }
15136 }
15137 pub fn with_optional(&self, optional: bool) -> TypeDef {
15139 let mut query = self.selection.select("withOptional");
15140 query = query.arg("optional", optional);
15141 TypeDef {
15142 proc: self.proc.clone(),
15143 selection: query,
15144 graphql_client: self.graphql_client.clone(),
15145 }
15146 }
15147 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
15153 let mut query = self.selection.select("withScalar");
15154 query = query.arg("name", name.into());
15155 TypeDef {
15156 proc: self.proc.clone(),
15157 selection: query,
15158 graphql_client: self.graphql_client.clone(),
15159 }
15160 }
15161 pub fn with_scalar_opts<'a>(
15167 &self,
15168 name: impl Into<String>,
15169 opts: TypeDefWithScalarOpts<'a>,
15170 ) -> TypeDef {
15171 let mut query = self.selection.select("withScalar");
15172 query = query.arg("name", name.into());
15173 if let Some(description) = opts.description {
15174 query = query.arg("description", description);
15175 }
15176 TypeDef {
15177 proc: self.proc.clone(),
15178 selection: query,
15179 graphql_client: self.graphql_client.clone(),
15180 }
15181 }
15182}
15183impl Node for TypeDef {
15184 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15185 let query = self.selection.select("id");
15186 let graphql_client = self.graphql_client.clone();
15187 async move { query.execute(graphql_client).await }
15188 }
15189}
15190#[derive(Clone)]
15191pub struct Up {
15192 pub proc: Option<Arc<DaggerSessionProc>>,
15193 pub selection: Selection,
15194 pub graphql_client: DynGraphQLClient,
15195}
15196impl IntoID<Id> for Up {
15197 fn into_id(
15198 self,
15199 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15200 Box::pin(async move { self.id().await })
15201 }
15202}
15203impl Loadable for Up {
15204 fn graphql_type() -> &'static str {
15205 "Up"
15206 }
15207 fn from_query(
15208 proc: Option<Arc<DaggerSessionProc>>,
15209 selection: Selection,
15210 graphql_client: DynGraphQLClient,
15211 ) -> Self {
15212 Self {
15213 proc,
15214 selection,
15215 graphql_client,
15216 }
15217 }
15218}
15219impl Up {
15220 pub async fn description(&self) -> Result<String, DaggerError> {
15222 let query = self.selection.select("description");
15223 query.execute(self.graphql_client.clone()).await
15224 }
15225 pub async fn id(&self) -> Result<Id, DaggerError> {
15227 let query = self.selection.select("id");
15228 query.execute(self.graphql_client.clone()).await
15229 }
15230 pub async fn name(&self) -> Result<String, DaggerError> {
15232 let query = self.selection.select("name");
15233 query.execute(self.graphql_client.clone()).await
15234 }
15235 pub fn original_module(&self) -> Module {
15237 let query = self.selection.select("originalModule");
15238 Module {
15239 proc: self.proc.clone(),
15240 selection: query,
15241 graphql_client: self.graphql_client.clone(),
15242 }
15243 }
15244 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
15246 let query = self.selection.select("path");
15247 query.execute(self.graphql_client.clone()).await
15248 }
15249 pub fn run(&self) -> Up {
15251 let query = self.selection.select("run");
15252 Up {
15253 proc: self.proc.clone(),
15254 selection: query,
15255 graphql_client: self.graphql_client.clone(),
15256 }
15257 }
15258}
15259impl Node for Up {
15260 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15261 let query = self.selection.select("id");
15262 let graphql_client = self.graphql_client.clone();
15263 async move { query.execute(graphql_client).await }
15264 }
15265}
15266#[derive(Clone)]
15267pub struct UpGroup {
15268 pub proc: Option<Arc<DaggerSessionProc>>,
15269 pub selection: Selection,
15270 pub graphql_client: DynGraphQLClient,
15271}
15272impl IntoID<Id> for UpGroup {
15273 fn into_id(
15274 self,
15275 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15276 Box::pin(async move { self.id().await })
15277 }
15278}
15279impl Loadable for UpGroup {
15280 fn graphql_type() -> &'static str {
15281 "UpGroup"
15282 }
15283 fn from_query(
15284 proc: Option<Arc<DaggerSessionProc>>,
15285 selection: Selection,
15286 graphql_client: DynGraphQLClient,
15287 ) -> Self {
15288 Self {
15289 proc,
15290 selection,
15291 graphql_client,
15292 }
15293 }
15294}
15295impl UpGroup {
15296 pub async fn id(&self) -> Result<Id, DaggerError> {
15298 let query = self.selection.select("id");
15299 query.execute(self.graphql_client.clone()).await
15300 }
15301 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
15303 let query = self.selection.select("list");
15304 let query = query.select("id");
15305 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15306 Ok(ids
15307 .into_iter()
15308 .map(|id| Up {
15309 proc: self.proc.clone(),
15310 selection: crate::querybuilder::query()
15311 .select("node")
15312 .arg("id", &id.0)
15313 .inline_fragment("Up"),
15314 graphql_client: self.graphql_client.clone(),
15315 })
15316 .collect())
15317 }
15318 pub fn run(&self) -> UpGroup {
15320 let query = self.selection.select("run");
15321 UpGroup {
15322 proc: self.proc.clone(),
15323 selection: query,
15324 graphql_client: self.graphql_client.clone(),
15325 }
15326 }
15327}
15328impl Node for UpGroup {
15329 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15330 let query = self.selection.select("id");
15331 let graphql_client = self.graphql_client.clone();
15332 async move { query.execute(graphql_client).await }
15333 }
15334}
15335#[derive(Clone)]
15336pub struct Volume {
15337 pub proc: Option<Arc<DaggerSessionProc>>,
15338 pub selection: Selection,
15339 pub graphql_client: DynGraphQLClient,
15340}
15341impl IntoID<Id> for Volume {
15342 fn into_id(
15343 self,
15344 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15345 Box::pin(async move { self.id().await })
15346 }
15347}
15348impl Loadable for Volume {
15349 fn graphql_type() -> &'static str {
15350 "Volume"
15351 }
15352 fn from_query(
15353 proc: Option<Arc<DaggerSessionProc>>,
15354 selection: Selection,
15355 graphql_client: DynGraphQLClient,
15356 ) -> Self {
15357 Self {
15358 proc,
15359 selection,
15360 graphql_client,
15361 }
15362 }
15363}
15364impl Volume {
15365 pub async fn id(&self) -> Result<Id, DaggerError> {
15367 let query = self.selection.select("id");
15368 query.execute(self.graphql_client.clone()).await
15369 }
15370}
15371impl Node for Volume {
15372 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15373 let query = self.selection.select("id");
15374 let graphql_client = self.graphql_client.clone();
15375 async move { query.execute(graphql_client).await }
15376 }
15377}
15378#[derive(Clone)]
15379pub struct Workspace {
15380 pub proc: Option<Arc<DaggerSessionProc>>,
15381 pub selection: Selection,
15382 pub graphql_client: DynGraphQLClient,
15383}
15384#[derive(Builder, Debug, PartialEq)]
15385pub struct WorkspaceAgentsOpts<'a> {
15386 #[builder(setter(into, strip_option), default)]
15388 pub include: Option<Vec<&'a str>>,
15389}
15390#[derive(Builder, Debug, PartialEq)]
15391pub struct WorkspaceChangesOpts {
15392 #[builder(setter(into, strip_option), default)]
15394 pub from: Option<Id>,
15395}
15396#[derive(Builder, Debug, PartialEq)]
15397pub struct WorkspaceChecksOpts<'a> {
15398 #[builder(setter(into, strip_option), default)]
15400 pub include: Option<Vec<&'a str>>,
15401 #[builder(setter(into, strip_option), default)]
15403 pub no_generate: Option<bool>,
15404 #[builder(setter(into, strip_option), default)]
15406 pub only_generate: Option<bool>,
15407 #[builder(setter(into, strip_option), default)]
15409 pub skip: Option<Vec<&'a str>>,
15410}
15411#[derive(Builder, Debug, PartialEq)]
15412pub struct WorkspaceConfigReadOpts<'a> {
15413 #[builder(setter(into, strip_option), default)]
15415 pub key: Option<&'a str>,
15416}
15417#[derive(Builder, Debug, PartialEq)]
15418pub struct WorkspaceDirectoryOpts<'a> {
15419 #[builder(setter(into, strip_option), default)]
15421 pub exclude: Option<Vec<&'a str>>,
15422 #[builder(setter(into, strip_option), default)]
15424 pub gitignore: Option<bool>,
15425 #[builder(setter(into, strip_option), default)]
15427 pub include: Option<Vec<&'a str>>,
15428}
15429#[derive(Builder, Debug, PartialEq)]
15430pub struct WorkspaceFindRootsOpts<'a> {
15431 #[builder(setter(into, strip_option), default)]
15433 pub exclude: Option<Vec<&'a str>>,
15434 #[builder(setter(into, strip_option), default)]
15436 pub start: Option<&'a str>,
15437}
15438#[derive(Builder, Debug, PartialEq)]
15439pub struct WorkspaceFindUpOpts<'a> {
15440 #[builder(setter(into, strip_option), default)]
15442 pub from: Option<&'a str>,
15443}
15444#[derive(Builder, Debug, PartialEq)]
15445pub struct WorkspaceGeneratorsOpts<'a> {
15446 #[builder(setter(into, strip_option), default)]
15448 pub include: Option<Vec<&'a str>>,
15449}
15450#[derive(Builder, Debug, PartialEq)]
15451pub struct WorkspaceMigrateOpts<'a> {
15452 #[builder(setter(into, strip_option), default)]
15454 pub modules: Option<Vec<&'a str>>,
15455}
15456#[derive(Builder, Debug, PartialEq)]
15457pub struct WorkspaceMigrateModuleOpts<'a> {
15458 #[builder(setter(into, strip_option), default)]
15460 pub path: Option<&'a str>,
15461}
15462#[derive(Builder, Debug, PartialEq)]
15463pub struct WorkspaceSearchOpts<'a> {
15464 #[builder(setter(into, strip_option), default)]
15466 pub dotall: Option<bool>,
15467 #[builder(setter(into, strip_option), default)]
15469 pub files_only: Option<bool>,
15470 #[builder(setter(into, strip_option), default)]
15472 pub globs: Option<Vec<&'a str>>,
15473 #[builder(setter(into, strip_option), default)]
15475 pub insensitive: Option<bool>,
15476 #[builder(setter(into, strip_option), default)]
15478 pub limit: Option<isize>,
15479 #[builder(setter(into, strip_option), default)]
15481 pub literal: Option<bool>,
15482 #[builder(setter(into, strip_option), default)]
15484 pub multiline: Option<bool>,
15485 #[builder(setter(into, strip_option), default)]
15487 pub paths: Option<Vec<&'a str>>,
15488 #[builder(setter(into, strip_option), default)]
15490 pub skip_hidden: Option<bool>,
15491 #[builder(setter(into, strip_option), default)]
15493 pub skip_ignored: Option<bool>,
15494}
15495#[derive(Builder, Debug, PartialEq)]
15496pub struct WorkspaceServicesOpts<'a> {
15497 #[builder(setter(into, strip_option), default)]
15499 pub include: Option<Vec<&'a str>>,
15500}
15501#[derive(Builder, Debug, PartialEq)]
15502pub struct WorkspaceTerminalsOpts<'a> {
15503 #[builder(setter(into, strip_option), default)]
15505 pub include: Option<Vec<&'a str>>,
15506}
15507#[derive(Builder, Debug, PartialEq)]
15508pub struct WorkspaceWithClientOpts<'a> {
15509 #[builder(setter(into, strip_option), default)]
15511 pub sdk: Option<&'a str>,
15512 #[builder(setter(into, strip_option), default)]
15514 pub settings: Option<Json>,
15515}
15516#[derive(Builder, Debug, PartialEq)]
15517pub struct WorkspaceWithConfigEnvOpts {
15518 #[builder(setter(into, strip_option), default)]
15520 pub here: Option<bool>,
15521}
15522#[derive(Builder, Debug, PartialEq)]
15523pub struct WorkspaceWithConfigValueOpts<'a> {
15524 #[builder(setter(into, strip_option), default)]
15526 pub here: Option<bool>,
15527 #[builder(setter(into, strip_option), default)]
15529 pub values: Option<Vec<&'a str>>,
15530}
15531#[derive(Builder, Debug, PartialEq)]
15532pub struct WorkspaceWithFileOpts {
15533 #[builder(setter(into, strip_option), default)]
15535 pub permissions: Option<isize>,
15536}
15537#[derive(Builder, Debug, PartialEq)]
15538pub struct WorkspaceWithInitModuleOpts<'a> {
15539 #[builder(setter(into, strip_option), default)]
15541 pub entrypoint: Option<bool>,
15542 #[builder(setter(into, strip_option), default)]
15544 pub install: Option<bool>,
15545 #[builder(setter(into, strip_option), default)]
15547 pub name: Option<&'a str>,
15548 #[builder(setter(into, strip_option), default)]
15550 pub path: Option<&'a str>,
15551 #[builder(setter(into, strip_option), default)]
15553 pub settings: Option<Json>,
15554}
15555#[derive(Builder, Debug, PartialEq)]
15556pub struct WorkspaceWithModuleOpts<'a> {
15557 #[builder(setter(into, strip_option), default)]
15559 pub here: Option<bool>,
15560 #[builder(setter(into, strip_option), default)]
15562 pub name: Option<&'a str>,
15563}
15564#[derive(Builder, Debug, PartialEq)]
15565pub struct WorkspaceWithNewFileOpts {
15566 #[builder(setter(into, strip_option), default)]
15568 pub permissions: Option<isize>,
15569}
15570#[derive(Builder, Debug, PartialEq)]
15571pub struct WorkspaceWithSdkOpts<'a> {
15572 #[builder(setter(into, strip_option), default)]
15574 pub as_sdk_name: Option<&'a str>,
15575 #[builder(setter(into, strip_option), default)]
15577 pub here: Option<bool>,
15578 #[builder(setter(into, strip_option), default)]
15580 pub name: Option<&'a str>,
15581}
15582#[derive(Builder, Debug, PartialEq)]
15583pub struct WorkspaceWithUpdatedClientsOpts<'a> {
15584 #[builder(setter(into, strip_option), default)]
15586 pub all: Option<bool>,
15587 #[builder(setter(into, strip_option), default)]
15589 pub modules: Option<Vec<&'a str>>,
15590 #[builder(setter(into, strip_option), default)]
15592 pub sdk: Option<&'a str>,
15593}
15594#[derive(Builder, Debug, PartialEq)]
15595pub struct WorkspaceWithUpdatedLockOpts {
15596 #[builder(setter(into, strip_option), default)]
15598 pub no_generate: Option<bool>,
15599}
15600#[derive(Builder, Debug, PartialEq)]
15601pub struct WorkspaceWithUpdatedModulesOpts<'a> {
15602 #[builder(setter(into, strip_option), default)]
15604 pub names: Option<Vec<&'a str>>,
15605 #[builder(setter(into, strip_option), default)]
15607 pub version: Option<&'a str>,
15608}
15609#[derive(Builder, Debug, PartialEq)]
15610pub struct WorkspaceWithoutClientOpts<'a> {
15611 #[builder(setter(into, strip_option), default)]
15613 pub sdk: Option<&'a str>,
15614}
15615#[derive(Builder, Debug, PartialEq)]
15616pub struct WorkspaceWithoutConfigEnvOpts {
15617 #[builder(setter(into, strip_option), default)]
15619 pub here: Option<bool>,
15620}
15621#[derive(Builder, Debug, PartialEq)]
15622pub struct WorkspaceWithoutConfigValueOpts {
15623 #[builder(setter(into, strip_option), default)]
15625 pub here: Option<bool>,
15626}
15627#[derive(Builder, Debug, PartialEq)]
15628pub struct WorkspaceWithoutModuleOpts {
15629 #[builder(setter(into, strip_option), default)]
15631 pub here: Option<bool>,
15632}
15633#[derive(Builder, Debug, PartialEq)]
15634pub struct WorkspaceWithoutSdkOpts {
15635 #[builder(setter(into, strip_option), default)]
15637 pub here: Option<bool>,
15638}
15639impl IntoID<Id> for Workspace {
15640 fn into_id(
15641 self,
15642 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15643 Box::pin(async move { self.id().await })
15644 }
15645}
15646impl Loadable for Workspace {
15647 fn graphql_type() -> &'static str {
15648 "Workspace"
15649 }
15650 fn from_query(
15651 proc: Option<Arc<DaggerSessionProc>>,
15652 selection: Selection,
15653 graphql_client: DynGraphQLClient,
15654 ) -> Self {
15655 Self {
15656 proc,
15657 selection,
15658 graphql_client,
15659 }
15660 }
15661}
15662impl Workspace {
15663 pub async fn address(&self) -> Result<String, DaggerError> {
15665 let query = self.selection.select("address");
15666 query.execute(self.graphql_client.clone()).await
15667 }
15668 pub fn agents(&self) -> AgentGroup {
15674 let query = self.selection.select("agents");
15675 AgentGroup {
15676 proc: self.proc.clone(),
15677 selection: query,
15678 graphql_client: self.graphql_client.clone(),
15679 }
15680 }
15681 pub fn agents_opts<'a>(&self, opts: WorkspaceAgentsOpts<'a>) -> AgentGroup {
15687 let mut query = self.selection.select("agents");
15688 if let Some(include) = opts.include {
15689 query = query.arg("include", include);
15690 }
15691 AgentGroup {
15692 proc: self.proc.clone(),
15693 selection: query,
15694 graphql_client: self.graphql_client.clone(),
15695 }
15696 }
15697 pub fn changes(&self) -> Changeset {
15704 let query = self.selection.select("changes");
15705 Changeset {
15706 proc: self.proc.clone(),
15707 selection: query,
15708 graphql_client: self.graphql_client.clone(),
15709 }
15710 }
15711 pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
15718 let mut query = self.selection.select("changes");
15719 if let Some(from) = opts.from {
15720 query = query.arg("from", from);
15721 }
15722 Changeset {
15723 proc: self.proc.clone(),
15724 selection: query,
15725 graphql_client: self.graphql_client.clone(),
15726 }
15727 }
15728 pub fn checks(&self) -> CheckGroup {
15734 let query = self.selection.select("checks");
15735 CheckGroup {
15736 proc: self.proc.clone(),
15737 selection: query,
15738 graphql_client: self.graphql_client.clone(),
15739 }
15740 }
15741 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
15747 let mut query = self.selection.select("checks");
15748 if let Some(include) = opts.include {
15749 query = query.arg("include", include);
15750 }
15751 if let Some(skip) = opts.skip {
15752 query = query.arg("skip", skip);
15753 }
15754 if let Some(no_generate) = opts.no_generate {
15755 query = query.arg("noGenerate", no_generate);
15756 }
15757 if let Some(only_generate) = opts.only_generate {
15758 query = query.arg("onlyGenerate", only_generate);
15759 }
15760 CheckGroup {
15761 proc: self.proc.clone(),
15762 selection: query,
15763 graphql_client: self.graphql_client.clone(),
15764 }
15765 }
15766 pub async fn config_file(&self) -> Result<String, DaggerError> {
15768 let query = self.selection.select("configFile");
15769 query.execute(self.graphql_client.clone()).await
15770 }
15771 pub async fn config_read(&self) -> Result<String, DaggerError> {
15780 let query = self.selection.select("configRead");
15781 query.execute(self.graphql_client.clone()).await
15782 }
15783 pub async fn config_read_opts<'a>(
15792 &self,
15793 opts: WorkspaceConfigReadOpts<'a>,
15794 ) -> Result<String, DaggerError> {
15795 let mut query = self.selection.select("configRead");
15796 if let Some(key) = opts.key {
15797 query = query.arg("key", key);
15798 }
15799 query.execute(self.graphql_client.clone()).await
15800 }
15801 pub async fn cwd(&self) -> Result<String, DaggerError> {
15805 let query = self.selection.select("cwd");
15806 query.execute(self.graphql_client.clone()).await
15807 }
15808 pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
15814 let mut query = self.selection.select("detectScope");
15815 query = query.arg("sdk", sdk.into());
15816 query.execute(self.graphql_client.clone()).await
15817 }
15818 pub fn directory(&self, path: impl Into<String>) -> Directory {
15826 let mut query = self.selection.select("directory");
15827 query = query.arg("path", path.into());
15828 Directory {
15829 proc: self.proc.clone(),
15830 selection: query,
15831 graphql_client: self.graphql_client.clone(),
15832 }
15833 }
15834 pub fn directory_opts<'a>(
15842 &self,
15843 path: impl Into<String>,
15844 opts: WorkspaceDirectoryOpts<'a>,
15845 ) -> Directory {
15846 let mut query = self.selection.select("directory");
15847 query = query.arg("path", path.into());
15848 if let Some(exclude) = opts.exclude {
15849 query = query.arg("exclude", exclude);
15850 }
15851 if let Some(include) = opts.include {
15852 query = query.arg("include", include);
15853 }
15854 if let Some(gitignore) = opts.gitignore {
15855 query = query.arg("gitignore", gitignore);
15856 }
15857 Directory {
15858 proc: self.proc.clone(),
15859 selection: query,
15860 graphql_client: self.graphql_client.clone(),
15861 }
15862 }
15863 pub async fn entrypoint(&self) -> Result<String, DaggerError> {
15866 let query = self.selection.select("entrypoint");
15867 query.execute(self.graphql_client.clone()).await
15868 }
15869 pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
15871 let query = self.selection.select("envList");
15872 query.execute(self.graphql_client.clone()).await
15873 }
15874 pub async fn export(&self) -> Result<Void, DaggerError> {
15877 let query = self.selection.select("export");
15878 query.execute(self.graphql_client.clone()).await
15879 }
15880 pub fn file(&self, path: impl Into<String>) -> File {
15887 let mut query = self.selection.select("file");
15888 query = query.arg("path", path.into());
15889 File {
15890 proc: self.proc.clone(),
15891 selection: query,
15892 graphql_client: self.graphql_client.clone(),
15893 }
15894 }
15895 pub async fn find_roots(
15904 &self,
15905 markers: Vec<impl Into<String>>,
15906 ) -> Result<Vec<String>, DaggerError> {
15907 let mut query = self.selection.select("findRoots");
15908 query = query.arg(
15909 "markers",
15910 markers
15911 .into_iter()
15912 .map(|i| i.into())
15913 .collect::<Vec<String>>(),
15914 );
15915 query.execute(self.graphql_client.clone()).await
15916 }
15917 pub async fn find_roots_opts<'a>(
15926 &self,
15927 markers: Vec<impl Into<String>>,
15928 opts: WorkspaceFindRootsOpts<'a>,
15929 ) -> Result<Vec<String>, DaggerError> {
15930 let mut query = self.selection.select("findRoots");
15931 query = query.arg(
15932 "markers",
15933 markers
15934 .into_iter()
15935 .map(|i| i.into())
15936 .collect::<Vec<String>>(),
15937 );
15938 if let Some(start) = opts.start {
15939 query = query.arg("start", start);
15940 }
15941 if let Some(exclude) = opts.exclude {
15942 query = query.arg("exclude", exclude);
15943 }
15944 query.execute(self.graphql_client.clone()).await
15945 }
15946 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
15956 let mut query = self.selection.select("findUp");
15957 query = query.arg("name", name.into());
15958 query.execute(self.graphql_client.clone()).await
15959 }
15960 pub async fn find_up_opts<'a>(
15970 &self,
15971 name: impl Into<String>,
15972 opts: WorkspaceFindUpOpts<'a>,
15973 ) -> Result<String, DaggerError> {
15974 let mut query = self.selection.select("findUp");
15975 query = query.arg("name", name.into());
15976 if let Some(from) = opts.from {
15977 query = query.arg("from", from);
15978 }
15979 query.execute(self.graphql_client.clone()).await
15980 }
15981 pub fn generators(&self) -> GeneratorGroup {
15987 let query = self.selection.select("generators");
15988 GeneratorGroup {
15989 proc: self.proc.clone(),
15990 selection: query,
15991 graphql_client: self.graphql_client.clone(),
15992 }
15993 }
15994 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16000 let mut query = self.selection.select("generators");
16001 if let Some(include) = opts.include {
16002 query = query.arg("include", include);
16003 }
16004 GeneratorGroup {
16005 proc: self.proc.clone(),
16006 selection: query,
16007 graphql_client: self.graphql_client.clone(),
16008 }
16009 }
16010 pub fn git(&self) -> WorkspaceGit {
16012 let query = self.selection.select("git");
16013 WorkspaceGit {
16014 proc: self.proc.clone(),
16015 selection: query,
16016 graphql_client: self.graphql_client.clone(),
16017 }
16018 }
16019 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
16026 let mut query = self.selection.select("glob");
16027 query = query.arg("pattern", pattern.into());
16028 query.execute(self.graphql_client.clone()).await
16029 }
16030 pub async fn id(&self) -> Result<Id, DaggerError> {
16032 let query = self.selection.select("id");
16033 query.execute(self.graphql_client.clone()).await
16034 }
16035 pub fn migrate(&self) -> WorkspaceMigration {
16043 let query = self.selection.select("migrate");
16044 WorkspaceMigration {
16045 proc: self.proc.clone(),
16046 selection: query,
16047 graphql_client: self.graphql_client.clone(),
16048 }
16049 }
16050 pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
16058 let mut query = self.selection.select("migrate");
16059 if let Some(modules) = opts.modules {
16060 query = query.arg("modules", modules);
16061 }
16062 WorkspaceMigration {
16063 proc: self.proc.clone(),
16064 selection: query,
16065 graphql_client: self.graphql_client.clone(),
16066 }
16067 }
16068 pub fn migrate_module(&self) -> WorkspaceMigration {
16075 let query = self.selection.select("migrateModule");
16076 WorkspaceMigration {
16077 proc: self.proc.clone(),
16078 selection: query,
16079 graphql_client: self.graphql_client.clone(),
16080 }
16081 }
16082 pub fn migrate_module_opts<'a>(
16089 &self,
16090 opts: WorkspaceMigrateModuleOpts<'a>,
16091 ) -> WorkspaceMigration {
16092 let mut query = self.selection.select("migrateModule");
16093 if let Some(path) = opts.path {
16094 query = query.arg("path", path);
16095 }
16096 WorkspaceMigration {
16097 proc: self.proc.clone(),
16098 selection: query,
16099 graphql_client: self.graphql_client.clone(),
16100 }
16101 }
16102 pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
16109 let mut query = self.selection.select("module");
16110 query = query.arg("name", name.into());
16111 WorkspaceModule {
16112 proc: self.proc.clone(),
16113 selection: query,
16114 graphql_client: self.graphql_client.clone(),
16115 }
16116 }
16117 pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
16125 let mut query = self.selection.select("moduleSource");
16126 query = query.arg("path", path.into());
16127 ModuleSource {
16128 proc: self.proc.clone(),
16129 selection: query,
16130 graphql_client: self.graphql_client.clone(),
16131 }
16132 }
16133 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
16136 let query = self.selection.select("modules");
16137 let query = query.select("id");
16138 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16139 Ok(ids
16140 .into_iter()
16141 .map(|id| WorkspaceModule {
16142 proc: self.proc.clone(),
16143 selection: crate::querybuilder::query()
16144 .select("node")
16145 .arg("id", &id.0)
16146 .inline_fragment("WorkspaceModule"),
16147 graphql_client: self.graphql_client.clone(),
16148 })
16149 .collect())
16150 }
16151 pub fn reloaded(&self) -> Workspace {
16153 let query = self.selection.select("reloaded");
16154 Workspace {
16155 proc: self.proc.clone(),
16156 selection: query,
16157 graphql_client: self.graphql_client.clone(),
16158 }
16159 }
16160 pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
16166 let mut query = self.selection.select("sdk");
16167 query = query.arg("name", name.into());
16168 WorkspaceSdk {
16169 proc: self.proc.clone(),
16170 selection: query,
16171 graphql_client: self.graphql_client.clone(),
16172 }
16173 }
16174 pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
16176 let query = self.selection.select("sdks");
16177 let query = query.select("id");
16178 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16179 Ok(ids
16180 .into_iter()
16181 .map(|id| WorkspaceSdk {
16182 proc: self.proc.clone(),
16183 selection: crate::querybuilder::query()
16184 .select("node")
16185 .arg("id", &id.0)
16186 .inline_fragment("WorkspaceSDK"),
16187 graphql_client: self.graphql_client.clone(),
16188 })
16189 .collect())
16190 }
16191 pub async fn search(
16200 &self,
16201 pattern: impl Into<String>,
16202 ) -> Result<Vec<SearchResult>, DaggerError> {
16203 let mut query = self.selection.select("search");
16204 query = query.arg("pattern", pattern.into());
16205 let query = query.select("id");
16206 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16207 Ok(ids
16208 .into_iter()
16209 .map(|id| SearchResult {
16210 proc: self.proc.clone(),
16211 selection: crate::querybuilder::query()
16212 .select("node")
16213 .arg("id", &id.0)
16214 .inline_fragment("SearchResult"),
16215 graphql_client: self.graphql_client.clone(),
16216 })
16217 .collect())
16218 }
16219 pub async fn search_opts<'a>(
16228 &self,
16229 pattern: impl Into<String>,
16230 opts: WorkspaceSearchOpts<'a>,
16231 ) -> Result<Vec<SearchResult>, DaggerError> {
16232 let mut query = self.selection.select("search");
16233 query = query.arg("pattern", pattern.into());
16234 if let Some(paths) = opts.paths {
16235 query = query.arg("paths", paths);
16236 }
16237 if let Some(globs) = opts.globs {
16238 query = query.arg("globs", globs);
16239 }
16240 if let Some(literal) = opts.literal {
16241 query = query.arg("literal", literal);
16242 }
16243 if let Some(multiline) = opts.multiline {
16244 query = query.arg("multiline", multiline);
16245 }
16246 if let Some(dotall) = opts.dotall {
16247 query = query.arg("dotall", dotall);
16248 }
16249 if let Some(insensitive) = opts.insensitive {
16250 query = query.arg("insensitive", insensitive);
16251 }
16252 if let Some(skip_ignored) = opts.skip_ignored {
16253 query = query.arg("skipIgnored", skip_ignored);
16254 }
16255 if let Some(skip_hidden) = opts.skip_hidden {
16256 query = query.arg("skipHidden", skip_hidden);
16257 }
16258 if let Some(files_only) = opts.files_only {
16259 query = query.arg("filesOnly", files_only);
16260 }
16261 if let Some(limit) = opts.limit {
16262 query = query.arg("limit", limit);
16263 }
16264 let query = query.select("id");
16265 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16266 Ok(ids
16267 .into_iter()
16268 .map(|id| SearchResult {
16269 proc: self.proc.clone(),
16270 selection: crate::querybuilder::query()
16271 .select("node")
16272 .arg("id", &id.0)
16273 .inline_fragment("SearchResult"),
16274 graphql_client: self.graphql_client.clone(),
16275 })
16276 .collect())
16277 }
16278 pub fn services(&self) -> UpGroup {
16284 let query = self.selection.select("services");
16285 UpGroup {
16286 proc: self.proc.clone(),
16287 selection: query,
16288 graphql_client: self.graphql_client.clone(),
16289 }
16290 }
16291 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16297 let mut query = self.selection.select("services");
16298 if let Some(include) = opts.include {
16299 query = query.arg("include", include);
16300 }
16301 UpGroup {
16302 proc: self.proc.clone(),
16303 selection: query,
16304 graphql_client: self.graphql_client.clone(),
16305 }
16306 }
16307 pub fn terminals(&self) -> TerminalGroup {
16313 let query = self.selection.select("terminals");
16314 TerminalGroup {
16315 proc: self.proc.clone(),
16316 selection: query,
16317 graphql_client: self.graphql_client.clone(),
16318 }
16319 }
16320 pub fn terminals_opts<'a>(&self, opts: WorkspaceTerminalsOpts<'a>) -> TerminalGroup {
16326 let mut query = self.selection.select("terminals");
16327 if let Some(include) = opts.include {
16328 query = query.arg("include", include);
16329 }
16330 TerminalGroup {
16331 proc: self.proc.clone(),
16332 selection: query,
16333 graphql_client: self.graphql_client.clone(),
16334 }
16335 }
16336 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
16342 let mut query = self.selection.select("withChanges");
16343 query = query.arg_lazy(
16344 "changes",
16345 Box::new(move || {
16346 let changes = changes.clone();
16347 Box::pin(async move { changes.into_id().await.unwrap().quote() })
16348 }),
16349 );
16350 Workspace {
16351 proc: self.proc.clone(),
16352 selection: query,
16353 graphql_client: self.graphql_client.clone(),
16354 }
16355 }
16356 pub fn with_client(&self, module: impl Into<String>) -> Workspace {
16364 let mut query = self.selection.select("withClient");
16365 query = query.arg("module", module.into());
16366 Workspace {
16367 proc: self.proc.clone(),
16368 selection: query,
16369 graphql_client: self.graphql_client.clone(),
16370 }
16371 }
16372 pub fn with_client_opts<'a>(
16380 &self,
16381 module: impl Into<String>,
16382 opts: WorkspaceWithClientOpts<'a>,
16383 ) -> Workspace {
16384 let mut query = self.selection.select("withClient");
16385 query = query.arg("module", module.into());
16386 if let Some(sdk) = opts.sdk {
16387 query = query.arg("sdk", sdk);
16388 }
16389 if let Some(settings) = opts.settings {
16390 query = query.arg("settings", settings);
16391 }
16392 Workspace {
16393 proc: self.proc.clone(),
16394 selection: query,
16395 graphql_client: self.graphql_client.clone(),
16396 }
16397 }
16398 pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
16405 let mut query = self.selection.select("withConfigEnv");
16406 query = query.arg("name", name.into());
16407 Workspace {
16408 proc: self.proc.clone(),
16409 selection: query,
16410 graphql_client: self.graphql_client.clone(),
16411 }
16412 }
16413 pub fn with_config_env_opts(
16420 &self,
16421 name: impl Into<String>,
16422 opts: WorkspaceWithConfigEnvOpts,
16423 ) -> Workspace {
16424 let mut query = self.selection.select("withConfigEnv");
16425 query = query.arg("name", name.into());
16426 if let Some(here) = opts.here {
16427 query = query.arg("here", here);
16428 }
16429 Workspace {
16430 proc: self.proc.clone(),
16431 selection: query,
16432 graphql_client: self.graphql_client.clone(),
16433 }
16434 }
16435 pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
16444 let mut query = self.selection.select("withConfigValue");
16445 query = query.arg("key", key.into());
16446 query = query.arg("value", value.into());
16447 Workspace {
16448 proc: self.proc.clone(),
16449 selection: query,
16450 graphql_client: self.graphql_client.clone(),
16451 }
16452 }
16453 pub fn with_config_value_opts<'a>(
16462 &self,
16463 key: impl Into<String>,
16464 value: impl Into<String>,
16465 opts: WorkspaceWithConfigValueOpts<'a>,
16466 ) -> Workspace {
16467 let mut query = self.selection.select("withConfigValue");
16468 query = query.arg("key", key.into());
16469 query = query.arg("value", value.into());
16470 if let Some(values) = opts.values {
16471 query = query.arg("values", values);
16472 }
16473 if let Some(here) = opts.here {
16474 query = query.arg("here", here);
16475 }
16476 Workspace {
16477 proc: self.proc.clone(),
16478 selection: query,
16479 graphql_client: self.graphql_client.clone(),
16480 }
16481 }
16482 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
16490 let mut query = self.selection.select("withDirectory");
16491 query = query.arg("path", path.into());
16492 query = query.arg_lazy(
16493 "source",
16494 Box::new(move || {
16495 let source = source.clone();
16496 Box::pin(async move { source.into_id().await.unwrap().quote() })
16497 }),
16498 );
16499 Workspace {
16500 proc: self.proc.clone(),
16501 selection: query,
16502 graphql_client: self.graphql_client.clone(),
16503 }
16504 }
16505 pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
16512 let mut query = self.selection.select("withEntrypoint");
16513 query = query.arg("name", name.into());
16514 Workspace {
16515 proc: self.proc.clone(),
16516 selection: query,
16517 graphql_client: self.graphql_client.clone(),
16518 }
16519 }
16520 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
16528 let mut query = self.selection.select("withFile");
16529 query = query.arg("path", path.into());
16530 query = query.arg_lazy(
16531 "source",
16532 Box::new(move || {
16533 let source = source.clone();
16534 Box::pin(async move { source.into_id().await.unwrap().quote() })
16535 }),
16536 );
16537 Workspace {
16538 proc: self.proc.clone(),
16539 selection: query,
16540 graphql_client: self.graphql_client.clone(),
16541 }
16542 }
16543 pub fn with_file_opts(
16551 &self,
16552 path: impl Into<String>,
16553 source: impl IntoID<Id>,
16554 opts: WorkspaceWithFileOpts,
16555 ) -> Workspace {
16556 let mut query = self.selection.select("withFile");
16557 query = query.arg("path", path.into());
16558 query = query.arg_lazy(
16559 "source",
16560 Box::new(move || {
16561 let source = source.clone();
16562 Box::pin(async move { source.into_id().await.unwrap().quote() })
16563 }),
16564 );
16565 if let Some(permissions) = opts.permissions {
16566 query = query.arg("permissions", permissions);
16567 }
16568 Workspace {
16569 proc: self.proc.clone(),
16570 selection: query,
16571 graphql_client: self.graphql_client.clone(),
16572 }
16573 }
16574 pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
16582 let mut query = self.selection.select("withInitModule");
16583 query = query.arg("sdk", sdk.into());
16584 Workspace {
16585 proc: self.proc.clone(),
16586 selection: query,
16587 graphql_client: self.graphql_client.clone(),
16588 }
16589 }
16590 pub fn with_init_module_opts<'a>(
16598 &self,
16599 sdk: impl Into<String>,
16600 opts: WorkspaceWithInitModuleOpts<'a>,
16601 ) -> Workspace {
16602 let mut query = self.selection.select("withInitModule");
16603 query = query.arg("sdk", sdk.into());
16604 if let Some(name) = opts.name {
16605 query = query.arg("name", name);
16606 }
16607 if let Some(path) = opts.path {
16608 query = query.arg("path", path);
16609 }
16610 if let Some(install) = opts.install {
16611 query = query.arg("install", install);
16612 }
16613 if let Some(entrypoint) = opts.entrypoint {
16614 query = query.arg("entrypoint", entrypoint);
16615 }
16616 if let Some(settings) = opts.settings {
16617 query = query.arg("settings", settings);
16618 }
16619 Workspace {
16620 proc: self.proc.clone(),
16621 selection: query,
16622 graphql_client: self.graphql_client.clone(),
16623 }
16624 }
16625 pub fn with_initialized(&self) -> Workspace {
16628 let query = self.selection.select("withInitialized");
16629 Workspace {
16630 proc: self.proc.clone(),
16631 selection: query,
16632 graphql_client: self.graphql_client.clone(),
16633 }
16634 }
16635 pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
16643 let mut query = self.selection.select("withModule");
16644 query = query.arg("ref", r#ref.into());
16645 Workspace {
16646 proc: self.proc.clone(),
16647 selection: query,
16648 graphql_client: self.graphql_client.clone(),
16649 }
16650 }
16651 pub fn with_module_opts<'a>(
16659 &self,
16660 r#ref: impl Into<String>,
16661 opts: WorkspaceWithModuleOpts<'a>,
16662 ) -> Workspace {
16663 let mut query = self.selection.select("withModule");
16664 query = query.arg("ref", r#ref.into());
16665 if let Some(name) = opts.name {
16666 query = query.arg("name", name);
16667 }
16668 if let Some(here) = opts.here {
16669 query = query.arg("here", here);
16670 }
16671 Workspace {
16672 proc: self.proc.clone(),
16673 selection: query,
16674 graphql_client: self.graphql_client.clone(),
16675 }
16676 }
16677 pub fn with_mounted_directory(
16685 &self,
16686 path: impl Into<String>,
16687 source: impl IntoID<Id>,
16688 ) -> Workspace {
16689 let mut query = self.selection.select("withMountedDirectory");
16690 query = query.arg("path", path.into());
16691 query = query.arg_lazy(
16692 "source",
16693 Box::new(move || {
16694 let source = source.clone();
16695 Box::pin(async move { source.into_id().await.unwrap().quote() })
16696 }),
16697 );
16698 Workspace {
16699 proc: self.proc.clone(),
16700 selection: query,
16701 graphql_client: self.graphql_client.clone(),
16702 }
16703 }
16704 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
16712 let mut query = self.selection.select("withMountedFile");
16713 query = query.arg("path", path.into());
16714 query = query.arg_lazy(
16715 "source",
16716 Box::new(move || {
16717 let source = source.clone();
16718 Box::pin(async move { source.into_id().await.unwrap().quote() })
16719 }),
16720 );
16721 Workspace {
16722 proc: self.proc.clone(),
16723 selection: query,
16724 graphql_client: self.graphql_client.clone(),
16725 }
16726 }
16727 pub fn with_new_directory(
16735 &self,
16736 path: impl Into<String>,
16737 source: impl IntoID<Id>,
16738 ) -> Workspace {
16739 let mut query = self.selection.select("withNewDirectory");
16740 query = query.arg("path", path.into());
16741 query = query.arg_lazy(
16742 "source",
16743 Box::new(move || {
16744 let source = source.clone();
16745 Box::pin(async move { source.into_id().await.unwrap().quote() })
16746 }),
16747 );
16748 Workspace {
16749 proc: self.proc.clone(),
16750 selection: query,
16751 graphql_client: self.graphql_client.clone(),
16752 }
16753 }
16754 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
16762 let mut query = self.selection.select("withNewFile");
16763 query = query.arg("path", path.into());
16764 query = query.arg("contents", contents.into());
16765 Workspace {
16766 proc: self.proc.clone(),
16767 selection: query,
16768 graphql_client: self.graphql_client.clone(),
16769 }
16770 }
16771 pub fn with_new_file_opts(
16779 &self,
16780 path: impl Into<String>,
16781 contents: impl Into<String>,
16782 opts: WorkspaceWithNewFileOpts,
16783 ) -> Workspace {
16784 let mut query = self.selection.select("withNewFile");
16785 query = query.arg("path", path.into());
16786 query = query.arg("contents", contents.into());
16787 if let Some(permissions) = opts.permissions {
16788 query = query.arg("permissions", permissions);
16789 }
16790 Workspace {
16791 proc: self.proc.clone(),
16792 selection: query,
16793 graphql_client: self.graphql_client.clone(),
16794 }
16795 }
16796 pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
16803 let mut query = self.selection.select("withSDK");
16804 query = query.arg("ref", r#ref.into());
16805 Workspace {
16806 proc: self.proc.clone(),
16807 selection: query,
16808 graphql_client: self.graphql_client.clone(),
16809 }
16810 }
16811 pub fn with_sdk_opts<'a>(
16818 &self,
16819 r#ref: impl Into<String>,
16820 opts: WorkspaceWithSdkOpts<'a>,
16821 ) -> Workspace {
16822 let mut query = self.selection.select("withSDK");
16823 query = query.arg("ref", r#ref.into());
16824 if let Some(name) = opts.name {
16825 query = query.arg("name", name);
16826 }
16827 if let Some(here) = opts.here {
16828 query = query.arg("here", here);
16829 }
16830 if let Some(as_sdk_name) = opts.as_sdk_name {
16831 query = query.arg("asSdkName", as_sdk_name);
16832 }
16833 Workspace {
16834 proc: self.proc.clone(),
16835 selection: query,
16836 graphql_client: self.graphql_client.clone(),
16837 }
16838 }
16839 pub fn with_updated_clients(&self) -> Workspace {
16847 let query = self.selection.select("withUpdatedClients");
16848 Workspace {
16849 proc: self.proc.clone(),
16850 selection: query,
16851 graphql_client: self.graphql_client.clone(),
16852 }
16853 }
16854 pub fn with_updated_clients_opts<'a>(
16862 &self,
16863 opts: WorkspaceWithUpdatedClientsOpts<'a>,
16864 ) -> Workspace {
16865 let mut query = self.selection.select("withUpdatedClients");
16866 if let Some(modules) = opts.modules {
16867 query = query.arg("modules", modules);
16868 }
16869 if let Some(all) = opts.all {
16870 query = query.arg("all", all);
16871 }
16872 if let Some(sdk) = opts.sdk {
16873 query = query.arg("sdk", sdk);
16874 }
16875 Workspace {
16876 proc: self.proc.clone(),
16877 selection: query,
16878 graphql_client: self.graphql_client.clone(),
16879 }
16880 }
16881 pub fn with_updated_lock(&self) -> Workspace {
16888 let query = self.selection.select("withUpdatedLock");
16889 Workspace {
16890 proc: self.proc.clone(),
16891 selection: query,
16892 graphql_client: self.graphql_client.clone(),
16893 }
16894 }
16895 pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
16902 let mut query = self.selection.select("withUpdatedLock");
16903 if let Some(no_generate) = opts.no_generate {
16904 query = query.arg("noGenerate", no_generate);
16905 }
16906 Workspace {
16907 proc: self.proc.clone(),
16908 selection: query,
16909 graphql_client: self.graphql_client.clone(),
16910 }
16911 }
16912 pub fn with_updated_modules(&self) -> Workspace {
16919 let query = self.selection.select("withUpdatedModules");
16920 Workspace {
16921 proc: self.proc.clone(),
16922 selection: query,
16923 graphql_client: self.graphql_client.clone(),
16924 }
16925 }
16926 pub fn with_updated_modules_opts<'a>(
16933 &self,
16934 opts: WorkspaceWithUpdatedModulesOpts<'a>,
16935 ) -> Workspace {
16936 let mut query = self.selection.select("withUpdatedModules");
16937 if let Some(names) = opts.names {
16938 query = query.arg("names", names);
16939 }
16940 if let Some(version) = opts.version {
16941 query = query.arg("version", version);
16942 }
16943 Workspace {
16944 proc: self.proc.clone(),
16945 selection: query,
16946 graphql_client: self.graphql_client.clone(),
16947 }
16948 }
16949 pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
16955 let mut query = self.selection.select("withWorkdir");
16956 query = query.arg("path", path.into());
16957 Workspace {
16958 proc: self.proc.clone(),
16959 selection: query,
16960 graphql_client: self.graphql_client.clone(),
16961 }
16962 }
16963 pub fn without_client(&self, module: impl Into<String>) -> Workspace {
16972 let mut query = self.selection.select("withoutClient");
16973 query = query.arg("module", module.into());
16974 Workspace {
16975 proc: self.proc.clone(),
16976 selection: query,
16977 graphql_client: self.graphql_client.clone(),
16978 }
16979 }
16980 pub fn without_client_opts<'a>(
16989 &self,
16990 module: impl Into<String>,
16991 opts: WorkspaceWithoutClientOpts<'a>,
16992 ) -> Workspace {
16993 let mut query = self.selection.select("withoutClient");
16994 query = query.arg("module", module.into());
16995 if let Some(sdk) = opts.sdk {
16996 query = query.arg("sdk", sdk);
16997 }
16998 Workspace {
16999 proc: self.proc.clone(),
17000 selection: query,
17001 graphql_client: self.graphql_client.clone(),
17002 }
17003 }
17004 pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
17011 let mut query = self.selection.select("withoutConfigEnv");
17012 query = query.arg("name", name.into());
17013 Workspace {
17014 proc: self.proc.clone(),
17015 selection: query,
17016 graphql_client: self.graphql_client.clone(),
17017 }
17018 }
17019 pub fn without_config_env_opts(
17026 &self,
17027 name: impl Into<String>,
17028 opts: WorkspaceWithoutConfigEnvOpts,
17029 ) -> Workspace {
17030 let mut query = self.selection.select("withoutConfigEnv");
17031 query = query.arg("name", name.into());
17032 if let Some(here) = opts.here {
17033 query = query.arg("here", here);
17034 }
17035 Workspace {
17036 proc: self.proc.clone(),
17037 selection: query,
17038 graphql_client: self.graphql_client.clone(),
17039 }
17040 }
17041 pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
17050 let mut query = self.selection.select("withoutConfigValue");
17051 query = query.arg("key", key.into());
17052 Workspace {
17053 proc: self.proc.clone(),
17054 selection: query,
17055 graphql_client: self.graphql_client.clone(),
17056 }
17057 }
17058 pub fn without_config_value_opts(
17067 &self,
17068 key: impl Into<String>,
17069 opts: WorkspaceWithoutConfigValueOpts,
17070 ) -> Workspace {
17071 let mut query = self.selection.select("withoutConfigValue");
17072 query = query.arg("key", key.into());
17073 if let Some(here) = opts.here {
17074 query = query.arg("here", here);
17075 }
17076 Workspace {
17077 proc: self.proc.clone(),
17078 selection: query,
17079 graphql_client: self.graphql_client.clone(),
17080 }
17081 }
17082 pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
17088 let mut query = self.selection.select("withoutDirectory");
17089 query = query.arg("path", path.into());
17090 Workspace {
17091 proc: self.proc.clone(),
17092 selection: query,
17093 graphql_client: self.graphql_client.clone(),
17094 }
17095 }
17096 pub fn without_entrypoint(&self) -> Workspace {
17098 let query = self.selection.select("withoutEntrypoint");
17099 Workspace {
17100 proc: self.proc.clone(),
17101 selection: query,
17102 graphql_client: self.graphql_client.clone(),
17103 }
17104 }
17105 pub fn without_file(&self, path: impl Into<String>) -> Workspace {
17111 let mut query = self.selection.select("withoutFile");
17112 query = query.arg("path", path.into());
17113 Workspace {
17114 proc: self.proc.clone(),
17115 selection: query,
17116 graphql_client: self.graphql_client.clone(),
17117 }
17118 }
17119 pub fn without_module(&self, name: impl Into<String>) -> Workspace {
17127 let mut query = self.selection.select("withoutModule");
17128 query = query.arg("name", name.into());
17129 Workspace {
17130 proc: self.proc.clone(),
17131 selection: query,
17132 graphql_client: self.graphql_client.clone(),
17133 }
17134 }
17135 pub fn without_module_opts(
17143 &self,
17144 name: impl Into<String>,
17145 opts: WorkspaceWithoutModuleOpts,
17146 ) -> Workspace {
17147 let mut query = self.selection.select("withoutModule");
17148 query = query.arg("name", name.into());
17149 if let Some(here) = opts.here {
17150 query = query.arg("here", here);
17151 }
17152 Workspace {
17153 proc: self.proc.clone(),
17154 selection: query,
17155 graphql_client: self.graphql_client.clone(),
17156 }
17157 }
17158 pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
17165 let mut query = self.selection.select("withoutSDK");
17166 query = query.arg("name", name.into());
17167 Workspace {
17168 proc: self.proc.clone(),
17169 selection: query,
17170 graphql_client: self.graphql_client.clone(),
17171 }
17172 }
17173 pub fn without_sdk_opts(
17180 &self,
17181 name: impl Into<String>,
17182 opts: WorkspaceWithoutSdkOpts,
17183 ) -> Workspace {
17184 let mut query = self.selection.select("withoutSDK");
17185 query = query.arg("name", name.into());
17186 if let Some(here) = opts.here {
17187 query = query.arg("here", here);
17188 }
17189 Workspace {
17190 proc: self.proc.clone(),
17191 selection: query,
17192 graphql_client: self.graphql_client.clone(),
17193 }
17194 }
17195}
17196impl Node for Workspace {
17197 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17198 let query = self.selection.select("id");
17199 let graphql_client = self.graphql_client.clone();
17200 async move { query.execute(graphql_client).await }
17201 }
17202}
17203#[derive(Clone)]
17204pub struct WorkspaceGit {
17205 pub proc: Option<Arc<DaggerSessionProc>>,
17206 pub selection: Selection,
17207 pub graphql_client: DynGraphQLClient,
17208}
17209impl IntoID<Id> for WorkspaceGit {
17210 fn into_id(
17211 self,
17212 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17213 Box::pin(async move { self.id().await })
17214 }
17215}
17216impl Loadable for WorkspaceGit {
17217 fn graphql_type() -> &'static str {
17218 "WorkspaceGit"
17219 }
17220 fn from_query(
17221 proc: Option<Arc<DaggerSessionProc>>,
17222 selection: Selection,
17223 graphql_client: DynGraphQLClient,
17224 ) -> Self {
17225 Self {
17226 proc,
17227 selection,
17228 graphql_client,
17229 }
17230 }
17231}
17232impl WorkspaceGit {
17233 pub fn head(&self) -> GitRef {
17235 let query = self.selection.select("head");
17236 GitRef {
17237 proc: self.proc.clone(),
17238 selection: query,
17239 graphql_client: self.graphql_client.clone(),
17240 }
17241 }
17242 pub async fn id(&self) -> Result<Id, DaggerError> {
17244 let query = self.selection.select("id");
17245 query.execute(self.graphql_client.clone()).await
17246 }
17247 pub fn uncommitted(&self) -> Changeset {
17249 let query = self.selection.select("uncommitted");
17250 Changeset {
17251 proc: self.proc.clone(),
17252 selection: query,
17253 graphql_client: self.graphql_client.clone(),
17254 }
17255 }
17256}
17257impl Node for WorkspaceGit {
17258 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17259 let query = self.selection.select("id");
17260 let graphql_client = self.graphql_client.clone();
17261 async move { query.execute(graphql_client).await }
17262 }
17263}
17264#[derive(Clone)]
17265pub struct WorkspaceMigration {
17266 pub proc: Option<Arc<DaggerSessionProc>>,
17267 pub selection: Selection,
17268 pub graphql_client: DynGraphQLClient,
17269}
17270impl IntoID<Id> for WorkspaceMigration {
17271 fn into_id(
17272 self,
17273 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17274 Box::pin(async move { self.id().await })
17275 }
17276}
17277impl Loadable for WorkspaceMigration {
17278 fn graphql_type() -> &'static str {
17279 "WorkspaceMigration"
17280 }
17281 fn from_query(
17282 proc: Option<Arc<DaggerSessionProc>>,
17283 selection: Selection,
17284 graphql_client: DynGraphQLClient,
17285 ) -> Self {
17286 Self {
17287 proc,
17288 selection,
17289 graphql_client,
17290 }
17291 }
17292}
17293impl WorkspaceMigration {
17294 pub fn changes(&self) -> Changeset {
17296 let query = self.selection.select("changes");
17297 Changeset {
17298 proc: self.proc.clone(),
17299 selection: query,
17300 graphql_client: self.graphql_client.clone(),
17301 }
17302 }
17303 pub async fn config_file(&self) -> Result<String, DaggerError> {
17305 let query = self.selection.select("configFile");
17306 query.execute(self.graphql_client.clone()).await
17307 }
17308 pub async fn id(&self) -> Result<Id, DaggerError> {
17310 let query = self.selection.select("id");
17311 query.execute(self.graphql_client.clone()).await
17312 }
17313 pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
17315 let query = self.selection.select("moduleCandidates");
17316 query.execute(self.graphql_client.clone()).await
17317 }
17318 pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
17320 let query = self.selection.select("steps");
17321 let query = query.select("id");
17322 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17323 Ok(ids
17324 .into_iter()
17325 .map(|id| WorkspaceMigrationStep {
17326 proc: self.proc.clone(),
17327 selection: crate::querybuilder::query()
17328 .select("node")
17329 .arg("id", &id.0)
17330 .inline_fragment("WorkspaceMigrationStep"),
17331 graphql_client: self.graphql_client.clone(),
17332 })
17333 .collect())
17334 }
17335}
17336impl Node for WorkspaceMigration {
17337 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17338 let query = self.selection.select("id");
17339 let graphql_client = self.graphql_client.clone();
17340 async move { query.execute(graphql_client).await }
17341 }
17342}
17343#[derive(Clone)]
17344pub struct WorkspaceMigrationStep {
17345 pub proc: Option<Arc<DaggerSessionProc>>,
17346 pub selection: Selection,
17347 pub graphql_client: DynGraphQLClient,
17348}
17349impl IntoID<Id> for WorkspaceMigrationStep {
17350 fn into_id(
17351 self,
17352 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17353 Box::pin(async move { self.id().await })
17354 }
17355}
17356impl Loadable for WorkspaceMigrationStep {
17357 fn graphql_type() -> &'static str {
17358 "WorkspaceMigrationStep"
17359 }
17360 fn from_query(
17361 proc: Option<Arc<DaggerSessionProc>>,
17362 selection: Selection,
17363 graphql_client: DynGraphQLClient,
17364 ) -> Self {
17365 Self {
17366 proc,
17367 selection,
17368 graphql_client,
17369 }
17370 }
17371}
17372impl WorkspaceMigrationStep {
17373 pub fn changes(&self) -> Changeset {
17375 let query = self.selection.select("changes");
17376 Changeset {
17377 proc: self.proc.clone(),
17378 selection: query,
17379 graphql_client: self.graphql_client.clone(),
17380 }
17381 }
17382 pub async fn code(&self) -> Result<String, DaggerError> {
17384 let query = self.selection.select("code");
17385 query.execute(self.graphql_client.clone()).await
17386 }
17387 pub async fn description(&self) -> Result<String, DaggerError> {
17389 let query = self.selection.select("description");
17390 query.execute(self.graphql_client.clone()).await
17391 }
17392 pub async fn id(&self) -> Result<Id, DaggerError> {
17394 let query = self.selection.select("id");
17395 query.execute(self.graphql_client.clone()).await
17396 }
17397 pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
17399 let query = self.selection.select("warnings");
17400 query.execute(self.graphql_client.clone()).await
17401 }
17402}
17403impl Node for WorkspaceMigrationStep {
17404 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17405 let query = self.selection.select("id");
17406 let graphql_client = self.graphql_client.clone();
17407 async move { query.execute(graphql_client).await }
17408 }
17409}
17410#[derive(Clone)]
17411pub struct WorkspaceModule {
17412 pub proc: Option<Arc<DaggerSessionProc>>,
17413 pub selection: Selection,
17414 pub graphql_client: DynGraphQLClient,
17415}
17416impl IntoID<Id> for WorkspaceModule {
17417 fn into_id(
17418 self,
17419 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17420 Box::pin(async move { self.id().await })
17421 }
17422}
17423impl Loadable for WorkspaceModule {
17424 fn graphql_type() -> &'static str {
17425 "WorkspaceModule"
17426 }
17427 fn from_query(
17428 proc: Option<Arc<DaggerSessionProc>>,
17429 selection: Selection,
17430 graphql_client: DynGraphQLClient,
17431 ) -> Self {
17432 Self {
17433 proc,
17434 selection,
17435 graphql_client,
17436 }
17437 }
17438}
17439impl WorkspaceModule {
17440 pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
17442 let query = self.selection.select("entrypoint");
17443 query.execute(self.graphql_client.clone()).await
17444 }
17445 pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
17447 let query = self.selection.select("functions");
17448 query.execute(self.graphql_client.clone()).await
17449 }
17450 pub async fn id(&self) -> Result<Id, DaggerError> {
17452 let query = self.selection.select("id");
17453 query.execute(self.graphql_client.clone()).await
17454 }
17455 pub async fn name(&self) -> Result<String, DaggerError> {
17457 let query = self.selection.select("name");
17458 query.execute(self.graphql_client.clone()).await
17459 }
17460 pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
17462 let query = self.selection.select("settings");
17463 let query = query.select("id");
17464 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17465 Ok(ids
17466 .into_iter()
17467 .map(|id| WorkspaceModuleSetting {
17468 proc: self.proc.clone(),
17469 selection: crate::querybuilder::query()
17470 .select("node")
17471 .arg("id", &id.0)
17472 .inline_fragment("WorkspaceModuleSetting"),
17473 graphql_client: self.graphql_client.clone(),
17474 })
17475 .collect())
17476 }
17477 pub async fn source(&self) -> Result<String, DaggerError> {
17479 let query = self.selection.select("source");
17480 query.execute(self.graphql_client.clone()).await
17481 }
17482}
17483impl Node for WorkspaceModule {
17484 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17485 let query = self.selection.select("id");
17486 let graphql_client = self.graphql_client.clone();
17487 async move { query.execute(graphql_client).await }
17488 }
17489}
17490#[derive(Clone)]
17491pub struct WorkspaceModuleSetting {
17492 pub proc: Option<Arc<DaggerSessionProc>>,
17493 pub selection: Selection,
17494 pub graphql_client: DynGraphQLClient,
17495}
17496impl IntoID<Id> for WorkspaceModuleSetting {
17497 fn into_id(
17498 self,
17499 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17500 Box::pin(async move { self.id().await })
17501 }
17502}
17503impl Loadable for WorkspaceModuleSetting {
17504 fn graphql_type() -> &'static str {
17505 "WorkspaceModuleSetting"
17506 }
17507 fn from_query(
17508 proc: Option<Arc<DaggerSessionProc>>,
17509 selection: Selection,
17510 graphql_client: DynGraphQLClient,
17511 ) -> Self {
17512 Self {
17513 proc,
17514 selection,
17515 graphql_client,
17516 }
17517 }
17518}
17519impl WorkspaceModuleSetting {
17520 pub async fn description(&self) -> Result<String, DaggerError> {
17522 let query = self.selection.select("description");
17523 query.execute(self.graphql_client.clone()).await
17524 }
17525 pub async fn id(&self) -> Result<Id, DaggerError> {
17527 let query = self.selection.select("id");
17528 query.execute(self.graphql_client.clone()).await
17529 }
17530 pub async fn is_list(&self) -> Result<bool, DaggerError> {
17532 let query = self.selection.select("isList");
17533 query.execute(self.graphql_client.clone()).await
17534 }
17535 pub async fn is_object(&self) -> Result<bool, DaggerError> {
17537 let query = self.selection.select("isObject");
17538 query.execute(self.graphql_client.clone()).await
17539 }
17540 pub async fn key(&self) -> Result<String, DaggerError> {
17542 let query = self.selection.select("key");
17543 query.execute(self.graphql_client.clone()).await
17544 }
17545 pub async fn value(&self) -> Result<String, DaggerError> {
17547 let query = self.selection.select("value");
17548 query.execute(self.graphql_client.clone()).await
17549 }
17550}
17551impl Node for WorkspaceModuleSetting {
17552 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17553 let query = self.selection.select("id");
17554 let graphql_client = self.graphql_client.clone();
17555 async move { query.execute(graphql_client).await }
17556 }
17557}
17558#[derive(Clone)]
17559pub struct WorkspaceSdk {
17560 pub proc: Option<Arc<DaggerSessionProc>>,
17561 pub selection: Selection,
17562 pub graphql_client: DynGraphQLClient,
17563}
17564impl IntoID<Id> for WorkspaceSdk {
17565 fn into_id(
17566 self,
17567 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17568 Box::pin(async move { self.id().await })
17569 }
17570}
17571impl Loadable for WorkspaceSdk {
17572 fn graphql_type() -> &'static str {
17573 "WorkspaceSDK"
17574 }
17575 fn from_query(
17576 proc: Option<Arc<DaggerSessionProc>>,
17577 selection: Selection,
17578 graphql_client: DynGraphQLClient,
17579 ) -> Self {
17580 Self {
17581 proc,
17582 selection,
17583 graphql_client,
17584 }
17585 }
17586}
17587impl WorkspaceSdk {
17588 pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
17590 let query = self.selection.select("clients");
17591 let query = query.select("id");
17592 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17593 Ok(ids
17594 .into_iter()
17595 .map(|id| WorkspaceModule {
17596 proc: self.proc.clone(),
17597 selection: crate::querybuilder::query()
17598 .select("node")
17599 .arg("id", &id.0)
17600 .inline_fragment("WorkspaceModule"),
17601 graphql_client: self.graphql_client.clone(),
17602 })
17603 .collect())
17604 }
17605 pub async fn id(&self) -> Result<Id, DaggerError> {
17607 let query = self.selection.select("id");
17608 query.execute(self.graphql_client.clone()).await
17609 }
17610 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
17612 let query = self.selection.select("modules");
17613 let query = query.select("id");
17614 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17615 Ok(ids
17616 .into_iter()
17617 .map(|id| WorkspaceModule {
17618 proc: self.proc.clone(),
17619 selection: crate::querybuilder::query()
17620 .select("node")
17621 .arg("id", &id.0)
17622 .inline_fragment("WorkspaceModule"),
17623 graphql_client: self.graphql_client.clone(),
17624 })
17625 .collect())
17626 }
17627 pub async fn name(&self) -> Result<String, DaggerError> {
17629 let query = self.selection.select("name");
17630 query.execute(self.graphql_client.clone()).await
17631 }
17632 pub async fn r#ref(&self) -> Result<String, DaggerError> {
17634 let query = self.selection.select("ref");
17635 query.execute(self.graphql_client.clone()).await
17636 }
17637}
17638impl Node for WorkspaceSdk {
17639 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17640 let query = self.selection.select("id");
17641 let graphql_client = self.graphql_client.clone();
17642 async move { query.execute(graphql_client).await }
17643 }
17644}
17645#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17646pub enum CacheSharingMode {
17647 #[serde(rename = "LOCKED")]
17648 Locked,
17649 #[serde(rename = "PRIVATE")]
17650 Private,
17651 #[serde(rename = "SHARED")]
17652 Shared,
17653}
17654#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17655pub enum ChangesetMergeConflict {
17656 #[serde(rename = "FAIL")]
17657 Fail,
17658 #[serde(rename = "FAIL_EARLY")]
17659 FailEarly,
17660 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
17661 LeaveConflictMarkers,
17662 #[serde(rename = "PREFER_OURS")]
17663 PreferOurs,
17664 #[serde(rename = "PREFER_THEIRS")]
17665 PreferTheirs,
17666}
17667#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17668pub enum ChangesetsMergeConflict {
17669 #[serde(rename = "FAIL")]
17670 Fail,
17671 #[serde(rename = "FAIL_EARLY")]
17672 FailEarly,
17673}
17674#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17675pub enum DiffStatKind {
17676 #[serde(rename = "ADDED")]
17677 Added,
17678 #[serde(rename = "MODIFIED")]
17679 Modified,
17680 #[serde(rename = "REMOVED")]
17681 Removed,
17682 #[serde(rename = "RENAMED")]
17683 Renamed,
17684}
17685#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17686pub enum ExistsType {
17687 #[serde(rename = "DIRECTORY_TYPE")]
17688 DirectoryType,
17689 #[serde(rename = "REGULAR_TYPE")]
17690 RegularType,
17691 #[serde(rename = "SYMLINK_TYPE")]
17692 SymlinkType,
17693}
17694#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17695pub enum FileType {
17696 #[serde(rename = "DIRECTORY")]
17697 Directory,
17698 #[serde(rename = "DIRECTORY_TYPE")]
17699 DirectoryType,
17700 #[serde(rename = "REGULAR")]
17701 Regular,
17702 #[serde(rename = "REGULAR_TYPE")]
17703 RegularType,
17704 #[serde(rename = "SYMLINK")]
17705 Symlink,
17706 #[serde(rename = "SYMLINK_TYPE")]
17707 SymlinkType,
17708 #[serde(rename = "UNKNOWN")]
17709 Unknown,
17710}
17711#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17712pub enum FunctionCachePolicy {
17713 #[serde(rename = "Default")]
17714 Default,
17715 #[serde(rename = "Never")]
17716 Never,
17717 #[serde(rename = "PerSession")]
17718 PerSession,
17719}
17720#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17721pub enum ImageLayerCompression {
17722 #[serde(rename = "EStarGZ")]
17723 EStarGz,
17724 #[serde(rename = "ESTARGZ")]
17725 Estargz,
17726 #[serde(rename = "Gzip")]
17727 Gzip,
17728 #[serde(rename = "Uncompressed")]
17729 Uncompressed,
17730 #[serde(rename = "Zstd")]
17731 Zstd,
17732}
17733#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17734pub enum ImageMediaTypes {
17735 #[serde(rename = "DOCKER")]
17736 Docker,
17737 #[serde(rename = "DockerMediaTypes")]
17738 DockerMediaTypes,
17739 #[serde(rename = "OCI")]
17740 Oci,
17741 #[serde(rename = "OCIMediaTypes")]
17742 OciMediaTypes,
17743}
17744#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17745pub enum LlmContentBlockKind {
17746 #[serde(rename = "TEXT")]
17747 Text,
17748 #[serde(rename = "THINKING")]
17749 Thinking,
17750 #[serde(rename = "TOOL_CALL")]
17751 ToolCall,
17752 #[serde(rename = "TOOL_RESULT")]
17753 ToolResult,
17754}
17755#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17756pub enum LlmMessageRole {
17757 #[serde(rename = "ASSISTANT")]
17758 Assistant,
17759 #[serde(rename = "SYSTEM")]
17760 System,
17761 #[serde(rename = "USER")]
17762 User,
17763}
17764#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17765pub enum ModuleSourceExperimentalFeature {
17766 #[serde(rename = "SELF_CALLS")]
17767 SelfCalls,
17768}
17769#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17770pub enum ModuleSourceKind {
17771 #[serde(rename = "DIR")]
17772 Dir,
17773 #[serde(rename = "DIR_SOURCE")]
17774 DirSource,
17775 #[serde(rename = "GIT")]
17776 Git,
17777 #[serde(rename = "GIT_SOURCE")]
17778 GitSource,
17779 #[serde(rename = "LOCAL")]
17780 Local,
17781 #[serde(rename = "LOCAL_SOURCE")]
17782 LocalSource,
17783}
17784#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17785pub enum NetworkProtocol {
17786 #[serde(rename = "TCP")]
17787 Tcp,
17788 #[serde(rename = "UDP")]
17789 Udp,
17790}
17791#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17792pub enum PatchConflict {
17793 #[serde(rename = "FAIL")]
17794 Fail,
17795 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
17796 LeaveConflictMarkers,
17797}
17798#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17799pub enum RegistryProtocol {
17800 #[serde(rename = "HTTP")]
17801 Http,
17802 #[serde(rename = "HTTPS")]
17803 Https,
17804}
17805#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17806pub enum ReturnType {
17807 #[serde(rename = "ANY")]
17808 Any,
17809 #[serde(rename = "FAILURE")]
17810 Failure,
17811 #[serde(rename = "SUCCESS")]
17812 Success,
17813}
17814#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
17815pub enum TypeDefKind {
17816 #[serde(rename = "BOOLEAN")]
17817 Boolean,
17818 #[serde(rename = "BOOLEAN_KIND")]
17819 BooleanKind,
17820 #[serde(rename = "ENUM")]
17821 Enum,
17822 #[serde(rename = "ENUM_KIND")]
17823 EnumKind,
17824 #[serde(rename = "FLOAT")]
17825 Float,
17826 #[serde(rename = "FLOAT_KIND")]
17827 FloatKind,
17828 #[serde(rename = "INPUT")]
17829 Input,
17830 #[serde(rename = "INPUT_KIND")]
17831 InputKind,
17832 #[serde(rename = "INTEGER")]
17833 Integer,
17834 #[serde(rename = "INTEGER_KIND")]
17835 IntegerKind,
17836 #[serde(rename = "INTERFACE")]
17837 Interface,
17838 #[serde(rename = "INTERFACE_KIND")]
17839 InterfaceKind,
17840 #[serde(rename = "LIST")]
17841 List,
17842 #[serde(rename = "LIST_KIND")]
17843 ListKind,
17844 #[serde(rename = "OBJECT")]
17845 Object,
17846 #[serde(rename = "OBJECT_KIND")]
17847 ObjectKind,
17848 #[serde(rename = "SCALAR")]
17849 Scalar,
17850 #[serde(rename = "SCALAR_KIND")]
17851 ScalarKind,
17852 #[serde(rename = "STRING")]
17853 String,
17854 #[serde(rename = "STRING_KIND")]
17855 StringKind,
17856 #[serde(rename = "VOID")]
17857 Void,
17858 #[serde(rename = "VOID_KIND")]
17859 VoidKind,
17860}