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 LlmMessageOriginInput {
122 pub agent_name: String,
123 pub kind: LlmMessageOriginKind,
124 pub r#ref: String,
125 pub reply_to: String,
126}
127#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
128pub struct PipelineLabel {
129 pub name: String,
130 pub value: String,
131}
132#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
133pub struct PortForward {
134 pub backend: isize,
135 pub frontend: isize,
136 pub protocol: NetworkProtocol,
137}
138pub trait Exportable {
141 fn export(
142 &self,
143 path: impl Into<String>,
144 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
145 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
146}
147#[derive(Clone)]
148pub struct ExportableClient {
149 pub proc: Option<Arc<DaggerSessionProc>>,
150 pub selection: Selection,
151 pub graphql_client: DynGraphQLClient,
152}
153impl IntoID<Id> for ExportableClient {
154 fn into_id(
155 self,
156 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
157 Box::pin(async move { self.id().await })
158 }
159}
160impl ExportableClient {
161 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
162 let mut query = self.selection.select("export");
163 query = query.arg("path", path.into());
164 query.execute(self.graphql_client.clone()).await
165 }
166 pub async fn id(&self) -> Result<Id, DaggerError> {
167 let query = self.selection.select("id");
168 query.execute(self.graphql_client.clone()).await
169 }
170}
171impl Loadable for ExportableClient {
172 fn graphql_type() -> &'static str {
173 "Exportable"
174 }
175 fn from_query(
176 proc: Option<Arc<DaggerSessionProc>>,
177 selection: Selection,
178 graphql_client: DynGraphQLClient,
179 ) -> Self {
180 Self {
181 proc,
182 selection,
183 graphql_client,
184 }
185 }
186}
187impl Exportable for ExportableClient {
188 fn export(
189 &self,
190 path: impl Into<String>,
191 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
192 let mut query = self.selection.select("export");
193 query = query.arg("path", path.into());
194 let graphql_client = self.graphql_client.clone();
195 async move { query.execute(graphql_client).await }
196 }
197 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
198 let query = self.selection.select("id");
199 let graphql_client = self.graphql_client.clone();
200 async move { query.execute(graphql_client).await }
201 }
202}
203pub trait Node {
205 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
206}
207#[derive(Clone)]
208pub struct NodeClient {
209 pub proc: Option<Arc<DaggerSessionProc>>,
210 pub selection: Selection,
211 pub graphql_client: DynGraphQLClient,
212}
213impl IntoID<Id> for NodeClient {
214 fn into_id(
215 self,
216 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
217 Box::pin(async move { self.id().await })
218 }
219}
220impl NodeClient {
221 pub async fn id(&self) -> Result<Id, DaggerError> {
222 let query = self.selection.select("id");
223 query.execute(self.graphql_client.clone()).await
224 }
225}
226impl Loadable for NodeClient {
227 fn graphql_type() -> &'static str {
228 "Node"
229 }
230 fn from_query(
231 proc: Option<Arc<DaggerSessionProc>>,
232 selection: Selection,
233 graphql_client: DynGraphQLClient,
234 ) -> Self {
235 Self {
236 proc,
237 selection,
238 graphql_client,
239 }
240 }
241}
242impl Node for NodeClient {
243 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
244 let query = self.selection.select("id");
245 let graphql_client = self.graphql_client.clone();
246 async move { query.execute(graphql_client).await }
247 }
248}
249pub trait Syncer {
252 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
253 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send
254 where
255 Self: Sized;
256}
257#[derive(Clone)]
258pub struct SyncerClient {
259 pub proc: Option<Arc<DaggerSessionProc>>,
260 pub selection: Selection,
261 pub graphql_client: DynGraphQLClient,
262}
263impl IntoID<Id> for SyncerClient {
264 fn into_id(
265 self,
266 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
267 Box::pin(async move { self.id().await })
268 }
269}
270impl SyncerClient {
271 pub async fn id(&self) -> Result<Id, DaggerError> {
272 let query = self.selection.select("id");
273 query.execute(self.graphql_client.clone()).await
274 }
275 pub async fn sync(&self) -> Result<SyncerClient, DaggerError> {
276 let query = self.selection.select("sync");
277 let id: Id = query.execute(self.graphql_client.clone()).await?;
278 Ok(SyncerClient {
279 proc: self.proc.clone(),
280 selection: query
281 .root()
282 .select("node")
283 .arg("id", &id.0)
284 .inline_fragment("Syncer"),
285 graphql_client: self.graphql_client.clone(),
286 })
287 }
288}
289impl Loadable for SyncerClient {
290 fn graphql_type() -> &'static str {
291 "Syncer"
292 }
293 fn from_query(
294 proc: Option<Arc<DaggerSessionProc>>,
295 selection: Selection,
296 graphql_client: DynGraphQLClient,
297 ) -> Self {
298 Self {
299 proc,
300 selection,
301 graphql_client,
302 }
303 }
304}
305impl Syncer for SyncerClient {
306 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
307 let query = self.selection.select("id");
308 let graphql_client = self.graphql_client.clone();
309 async move { query.execute(graphql_client).await }
310 }
311 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
312 let query = self.selection.select("sync");
313 let proc = self.proc.clone();
314 let graphql_client = self.graphql_client.clone();
315 async move {
316 let id: Id = query.execute(graphql_client.clone()).await?;
317 Ok(Self {
318 proc,
319 selection: query
320 .root()
321 .select("node")
322 .arg("id", &id.0)
323 .inline_fragment("Syncer"),
324 graphql_client,
325 })
326 }
327 }
328}
329#[derive(Clone)]
330pub struct Address {
331 pub proc: Option<Arc<DaggerSessionProc>>,
332 pub selection: Selection,
333 pub graphql_client: DynGraphQLClient,
334}
335#[derive(Builder, Debug, PartialEq)]
336pub struct AddressDirectoryOpts<'a> {
337 #[builder(setter(into, strip_option), default)]
338 pub exclude: Option<Vec<&'a str>>,
339 #[builder(setter(into, strip_option), default)]
340 pub gitignore: Option<bool>,
341 #[builder(setter(into, strip_option), default)]
342 pub include: Option<Vec<&'a str>>,
343 #[builder(setter(into, strip_option), default)]
344 pub no_cache: Option<bool>,
345}
346#[derive(Builder, Debug, PartialEq)]
347pub struct AddressFileOpts<'a> {
348 #[builder(setter(into, strip_option), default)]
349 pub exclude: Option<Vec<&'a str>>,
350 #[builder(setter(into, strip_option), default)]
351 pub gitignore: Option<bool>,
352 #[builder(setter(into, strip_option), default)]
353 pub include: Option<Vec<&'a str>>,
354 #[builder(setter(into, strip_option), default)]
355 pub no_cache: Option<bool>,
356}
357impl IntoID<Id> for Address {
358 fn into_id(
359 self,
360 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
361 Box::pin(async move { self.id().await })
362 }
363}
364impl Loadable for Address {
365 fn graphql_type() -> &'static str {
366 "Address"
367 }
368 fn from_query(
369 proc: Option<Arc<DaggerSessionProc>>,
370 selection: Selection,
371 graphql_client: DynGraphQLClient,
372 ) -> Self {
373 Self {
374 proc,
375 selection,
376 graphql_client,
377 }
378 }
379}
380impl Address {
381 pub fn container(&self) -> Container {
383 let query = self.selection.select("container");
384 Container {
385 proc: self.proc.clone(),
386 selection: query,
387 graphql_client: self.graphql_client.clone(),
388 }
389 }
390 pub fn directory(&self) -> Directory {
396 let query = self.selection.select("directory");
397 Directory {
398 proc: self.proc.clone(),
399 selection: query,
400 graphql_client: self.graphql_client.clone(),
401 }
402 }
403 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
409 let mut query = self.selection.select("directory");
410 if let Some(exclude) = opts.exclude {
411 query = query.arg("exclude", exclude);
412 }
413 if let Some(include) = opts.include {
414 query = query.arg("include", include);
415 }
416 if let Some(gitignore) = opts.gitignore {
417 query = query.arg("gitignore", gitignore);
418 }
419 if let Some(no_cache) = opts.no_cache {
420 query = query.arg("noCache", no_cache);
421 }
422 Directory {
423 proc: self.proc.clone(),
424 selection: query,
425 graphql_client: self.graphql_client.clone(),
426 }
427 }
428 pub fn file(&self) -> File {
434 let query = self.selection.select("file");
435 File {
436 proc: self.proc.clone(),
437 selection: query,
438 graphql_client: self.graphql_client.clone(),
439 }
440 }
441 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
447 let mut query = self.selection.select("file");
448 if let Some(exclude) = opts.exclude {
449 query = query.arg("exclude", exclude);
450 }
451 if let Some(include) = opts.include {
452 query = query.arg("include", include);
453 }
454 if let Some(gitignore) = opts.gitignore {
455 query = query.arg("gitignore", gitignore);
456 }
457 if let Some(no_cache) = opts.no_cache {
458 query = query.arg("noCache", no_cache);
459 }
460 File {
461 proc: self.proc.clone(),
462 selection: query,
463 graphql_client: self.graphql_client.clone(),
464 }
465 }
466 pub fn git_ref(&self) -> GitRef {
468 let query = self.selection.select("gitRef");
469 GitRef {
470 proc: self.proc.clone(),
471 selection: query,
472 graphql_client: self.graphql_client.clone(),
473 }
474 }
475 pub fn git_repository(&self) -> GitRepository {
477 let query = self.selection.select("gitRepository");
478 GitRepository {
479 proc: self.proc.clone(),
480 selection: query,
481 graphql_client: self.graphql_client.clone(),
482 }
483 }
484 pub async fn id(&self) -> Result<Id, DaggerError> {
486 let query = self.selection.select("id");
487 query.execute(self.graphql_client.clone()).await
488 }
489 pub fn secret(&self) -> Secret {
491 let query = self.selection.select("secret");
492 Secret {
493 proc: self.proc.clone(),
494 selection: query,
495 graphql_client: self.graphql_client.clone(),
496 }
497 }
498 pub fn service(&self) -> Service {
500 let query = self.selection.select("service");
501 Service {
502 proc: self.proc.clone(),
503 selection: query,
504 graphql_client: self.graphql_client.clone(),
505 }
506 }
507 pub fn socket(&self) -> Socket {
509 let query = self.selection.select("socket");
510 Socket {
511 proc: self.proc.clone(),
512 selection: query,
513 graphql_client: self.graphql_client.clone(),
514 }
515 }
516 pub async fn value(&self) -> Result<String, DaggerError> {
518 let query = self.selection.select("value");
519 query.execute(self.graphql_client.clone()).await
520 }
521 pub fn volume(&self) -> Volume {
523 let query = self.selection.select("volume");
524 Volume {
525 proc: self.proc.clone(),
526 selection: query,
527 graphql_client: self.graphql_client.clone(),
528 }
529 }
530 pub fn workspace(&self) -> Workspace {
532 let query = self.selection.select("workspace");
533 Workspace {
534 proc: self.proc.clone(),
535 selection: query,
536 graphql_client: self.graphql_client.clone(),
537 }
538 }
539}
540impl Node for Address {
541 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
542 let query = self.selection.select("id");
543 let graphql_client = self.graphql_client.clone();
544 async move { query.execute(graphql_client).await }
545 }
546}
547#[derive(Clone)]
548pub struct Agent {
549 pub proc: Option<Arc<DaggerSessionProc>>,
550 pub selection: Selection,
551 pub graphql_client: DynGraphQLClient,
552}
553#[derive(Builder, Debug, PartialEq)]
554pub struct AgentNotifyOpts {
555 #[builder(setter(into, strip_option), default)]
557 pub on: Option<Vec<AgentState>>,
558}
559#[derive(Builder, Debug, PartialEq)]
560pub struct AgentPauseOpts {
561 #[builder(setter(into, strip_option), default)]
563 pub interrupt: Option<bool>,
564}
565#[derive(Builder, Debug, PartialEq)]
566pub struct AgentSendOpts<'a> {
567 #[builder(setter(into, strip_option), default)]
569 pub reply_to: Option<&'a str>,
570}
571#[derive(Builder, Debug, PartialEq)]
572pub struct AgentStopOpts {
573 #[builder(setter(into, strip_option), default)]
575 pub kill: Option<bool>,
576}
577impl IntoID<Id> for Agent {
578 fn into_id(
579 self,
580 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
581 Box::pin(async move { self.id().await })
582 }
583}
584impl Loadable for Agent {
585 fn graphql_type() -> &'static str {
586 "Agent"
587 }
588 fn from_query(
589 proc: Option<Arc<DaggerSessionProc>>,
590 selection: Selection,
591 graphql_client: DynGraphQLClient,
592 ) -> Self {
593 Self {
594 proc,
595 selection,
596 graphql_client,
597 }
598 }
599}
600impl Agent {
601 pub async fn error(&self) -> Result<String, DaggerError> {
604 let query = self.selection.select("error");
605 query.execute(self.graphql_client.clone()).await
606 }
607 pub async fn handle(&self) -> Result<String, DaggerError> {
610 let query = self.selection.select("handle");
611 query.execute(self.graphql_client.clone()).await
612 }
613 pub async fn id(&self) -> Result<Id, DaggerError> {
615 let query = self.selection.select("id");
616 query.execute(self.graphql_client.clone()).await
617 }
618 pub fn message(&self, r#ref: impl Into<String>) -> AgentMessage {
626 let mut query = self.selection.select("message");
627 query = query.arg("ref", r#ref.into());
628 AgentMessage {
629 proc: self.proc.clone(),
630 selection: query,
631 graphql_client: self.graphql_client.clone(),
632 }
633 }
634 pub async fn name(&self) -> Result<String, DaggerError> {
636 let query = self.selection.select("name");
637 query.execute(self.graphql_client.clone()).await
638 }
639 pub async fn notify(&self, subscriber: impl IntoID<Id>) -> Result<Agent, DaggerError> {
649 let mut query = self.selection.select("notify");
650 query = query.arg_lazy(
651 "subscriber",
652 Box::new(move || {
653 let subscriber = subscriber.clone();
654 Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
655 }),
656 );
657 let id: Id = query.execute(self.graphql_client.clone()).await?;
658 Ok(Agent {
659 proc: self.proc.clone(),
660 selection: query
661 .root()
662 .select("node")
663 .arg("id", &id.0)
664 .inline_fragment("Agent"),
665 graphql_client: self.graphql_client.clone(),
666 })
667 }
668 pub async fn notify_opts(
678 &self,
679 subscriber: impl IntoID<Id>,
680 opts: AgentNotifyOpts,
681 ) -> Result<Agent, DaggerError> {
682 let mut query = self.selection.select("notify");
683 query = query.arg_lazy(
684 "subscriber",
685 Box::new(move || {
686 let subscriber = subscriber.clone();
687 Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
688 }),
689 );
690 if let Some(on) = opts.on {
691 query = query.arg("on", on);
692 }
693 let id: Id = query.execute(self.graphql_client.clone()).await?;
694 Ok(Agent {
695 proc: self.proc.clone(),
696 selection: query
697 .root()
698 .select("node")
699 .arg("id", &id.0)
700 .inline_fragment("Agent"),
701 graphql_client: self.graphql_client.clone(),
702 })
703 }
704 pub async fn pause(&self) -> Result<Agent, DaggerError> {
712 let query = self.selection.select("pause");
713 let id: Id = query.execute(self.graphql_client.clone()).await?;
714 Ok(Agent {
715 proc: self.proc.clone(),
716 selection: query
717 .root()
718 .select("node")
719 .arg("id", &id.0)
720 .inline_fragment("Agent"),
721 graphql_client: self.graphql_client.clone(),
722 })
723 }
724 pub async fn pause_opts(&self, opts: AgentPauseOpts) -> Result<Agent, DaggerError> {
732 let mut query = self.selection.select("pause");
733 if let Some(interrupt) = opts.interrupt {
734 query = query.arg("interrupt", interrupt);
735 }
736 let id: Id = query.execute(self.graphql_client.clone()).await?;
737 Ok(Agent {
738 proc: self.proc.clone(),
739 selection: query
740 .root()
741 .select("node")
742 .arg("id", &id.0)
743 .inline_fragment("Agent"),
744 graphql_client: self.graphql_client.clone(),
745 })
746 }
747 pub async fn reseed(&self, conversation: impl IntoID<Id>) -> Result<Agent, DaggerError> {
756 let mut query = self.selection.select("reseed");
757 query = query.arg_lazy(
758 "conversation",
759 Box::new(move || {
760 let conversation = conversation.clone();
761 Box::pin(async move { conversation.into_id().await.unwrap().quote() })
762 }),
763 );
764 let id: Id = query.execute(self.graphql_client.clone()).await?;
765 Ok(Agent {
766 proc: self.proc.clone(),
767 selection: query
768 .root()
769 .select("node")
770 .arg("id", &id.0)
771 .inline_fragment("Agent"),
772 graphql_client: self.graphql_client.clone(),
773 })
774 }
775 pub async fn resume(&self) -> Result<Agent, DaggerError> {
779 let query = self.selection.select("resume");
780 let id: Id = query.execute(self.graphql_client.clone()).await?;
781 Ok(Agent {
782 proc: self.proc.clone(),
783 selection: query
784 .root()
785 .select("node")
786 .arg("id", &id.0)
787 .inline_fragment("Agent"),
788 graphql_client: self.graphql_client.clone(),
789 })
790 }
791 pub async fn send(&self, message: impl Into<String>) -> Result<AgentMessage, DaggerError> {
801 let mut query = self.selection.select("send");
802 query = query.arg("message", message.into());
803 let id: Id = query.execute(self.graphql_client.clone()).await?;
804 Ok(AgentMessage {
805 proc: self.proc.clone(),
806 selection: query
807 .root()
808 .select("node")
809 .arg("id", &id.0)
810 .inline_fragment("AgentMessage"),
811 graphql_client: self.graphql_client.clone(),
812 })
813 }
814 pub async fn send_opts<'a>(
824 &self,
825 message: impl Into<String>,
826 opts: AgentSendOpts<'a>,
827 ) -> Result<AgentMessage, DaggerError> {
828 let mut query = self.selection.select("send");
829 query = query.arg("message", message.into());
830 if let Some(reply_to) = opts.reply_to {
831 query = query.arg("replyTo", reply_to);
832 }
833 let id: Id = query.execute(self.graphql_client.clone()).await?;
834 Ok(AgentMessage {
835 proc: self.proc.clone(),
836 selection: query
837 .root()
838 .select("node")
839 .arg("id", &id.0)
840 .inline_fragment("AgentMessage"),
841 graphql_client: self.graphql_client.clone(),
842 })
843 }
844 pub fn snapshot(&self) -> Llm {
848 let query = self.selection.select("snapshot");
849 Llm {
850 proc: self.proc.clone(),
851 selection: query,
852 graphql_client: self.graphql_client.clone(),
853 }
854 }
855 pub async fn state(&self) -> Result<AgentState, DaggerError> {
858 let query = self.selection.select("state");
859 query.execute(self.graphql_client.clone()).await
860 }
861 pub async fn stop(&self) -> Result<Agent, DaggerError> {
867 let query = self.selection.select("stop");
868 let id: Id = query.execute(self.graphql_client.clone()).await?;
869 Ok(Agent {
870 proc: self.proc.clone(),
871 selection: query
872 .root()
873 .select("node")
874 .arg("id", &id.0)
875 .inline_fragment("Agent"),
876 graphql_client: self.graphql_client.clone(),
877 })
878 }
879 pub async fn stop_opts(&self, opts: AgentStopOpts) -> Result<Agent, DaggerError> {
885 let mut query = self.selection.select("stop");
886 if let Some(kill) = opts.kill {
887 query = query.arg("kill", kill);
888 }
889 let id: Id = query.execute(self.graphql_client.clone()).await?;
890 Ok(Agent {
891 proc: self.proc.clone(),
892 selection: query
893 .root()
894 .select("node")
895 .arg("id", &id.0)
896 .inline_fragment("Agent"),
897 graphql_client: self.graphql_client.clone(),
898 })
899 }
900 pub async fn wait(&self) -> Result<Agent, DaggerError> {
903 let query = self.selection.select("wait");
904 let id: Id = query.execute(self.graphql_client.clone()).await?;
905 Ok(Agent {
906 proc: self.proc.clone(),
907 selection: query
908 .root()
909 .select("node")
910 .arg("id", &id.0)
911 .inline_fragment("Agent"),
912 graphql_client: self.graphql_client.clone(),
913 })
914 }
915}
916impl Node for Agent {
917 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
918 let query = self.selection.select("id");
919 let graphql_client = self.graphql_client.clone();
920 async move { query.execute(graphql_client).await }
921 }
922}
923#[derive(Clone)]
924pub struct AgentMessage {
925 pub proc: Option<Arc<DaggerSessionProc>>,
926 pub selection: Selection,
927 pub graphql_client: DynGraphQLClient,
928}
929impl IntoID<Id> for AgentMessage {
930 fn into_id(
931 self,
932 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
933 Box::pin(async move { self.id().await })
934 }
935}
936impl Loadable for AgentMessage {
937 fn graphql_type() -> &'static str {
938 "AgentMessage"
939 }
940 fn from_query(
941 proc: Option<Arc<DaggerSessionProc>>,
942 selection: Selection,
943 graphql_client: DynGraphQLClient,
944 ) -> Self {
945 Self {
946 proc,
947 selection,
948 graphql_client,
949 }
950 }
951}
952impl AgentMessage {
953 pub async fn delivery(&self) -> Result<AgentMessageDelivery, DaggerError> {
956 let query = self.selection.select("delivery");
957 query.execute(self.graphql_client.clone()).await
958 }
959 pub async fn id(&self) -> Result<Id, DaggerError> {
961 let query = self.selection.select("id");
962 query.execute(self.graphql_client.clone()).await
963 }
964 pub async fn r#ref(&self) -> Result<String, DaggerError> {
967 let query = self.selection.select("ref");
968 query.execute(self.graphql_client.clone()).await
969 }
970 pub async fn response(&self) -> Result<String, DaggerError> {
975 let query = self.selection.select("response");
976 query.execute(self.graphql_client.clone()).await
977 }
978}
979impl Node for AgentMessage {
980 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
981 let query = self.selection.select("id");
982 let graphql_client = self.graphql_client.clone();
983 async move { query.execute(graphql_client).await }
984 }
985}
986#[derive(Clone)]
987pub struct AgentMiddleware {
988 pub proc: Option<Arc<DaggerSessionProc>>,
989 pub selection: Selection,
990 pub graphql_client: DynGraphQLClient,
991}
992impl IntoID<Id> for AgentMiddleware {
993 fn into_id(
994 self,
995 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
996 Box::pin(async move { self.id().await })
997 }
998}
999impl Loadable for AgentMiddleware {
1000 fn graphql_type() -> &'static str {
1001 "AgentMiddleware"
1002 }
1003 fn from_query(
1004 proc: Option<Arc<DaggerSessionProc>>,
1005 selection: Selection,
1006 graphql_client: DynGraphQLClient,
1007 ) -> Self {
1008 Self {
1009 proc,
1010 selection,
1011 graphql_client,
1012 }
1013 }
1014}
1015impl AgentMiddleware {
1016 pub async fn description(&self) -> Result<String, DaggerError> {
1018 let query = self.selection.select("description");
1019 query.execute(self.graphql_client.clone()).await
1020 }
1021 pub async fn id(&self) -> Result<Id, DaggerError> {
1023 let query = self.selection.select("id");
1024 query.execute(self.graphql_client.clone()).await
1025 }
1026 pub async fn name(&self) -> Result<String, DaggerError> {
1028 let query = self.selection.select("name");
1029 query.execute(self.graphql_client.clone()).await
1030 }
1031 pub fn original_module(&self) -> Module {
1033 let query = self.selection.select("originalModule");
1034 Module {
1035 proc: self.proc.clone(),
1036 selection: query,
1037 graphql_client: self.graphql_client.clone(),
1038 }
1039 }
1040 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1042 let query = self.selection.select("path");
1043 query.execute(self.graphql_client.clone()).await
1044 }
1045}
1046impl Node for AgentMiddleware {
1047 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1048 let query = self.selection.select("id");
1049 let graphql_client = self.graphql_client.clone();
1050 async move { query.execute(graphql_client).await }
1051 }
1052}
1053#[derive(Clone)]
1054pub struct AgentMiddlewareGroup {
1055 pub proc: Option<Arc<DaggerSessionProc>>,
1056 pub selection: Selection,
1057 pub graphql_client: DynGraphQLClient,
1058}
1059#[derive(Builder, Debug, PartialEq)]
1060pub struct AgentMiddlewareGroupComposeOpts {
1061 #[builder(setter(into, strip_option), default)]
1063 pub base: Option<Id>,
1064}
1065impl IntoID<Id> for AgentMiddlewareGroup {
1066 fn into_id(
1067 self,
1068 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1069 Box::pin(async move { self.id().await })
1070 }
1071}
1072impl Loadable for AgentMiddlewareGroup {
1073 fn graphql_type() -> &'static str {
1074 "AgentMiddlewareGroup"
1075 }
1076 fn from_query(
1077 proc: Option<Arc<DaggerSessionProc>>,
1078 selection: Selection,
1079 graphql_client: DynGraphQLClient,
1080 ) -> Self {
1081 Self {
1082 proc,
1083 selection,
1084 graphql_client,
1085 }
1086 }
1087}
1088impl AgentMiddlewareGroup {
1089 pub fn compose(&self) -> Llm {
1095 let query = self.selection.select("compose");
1096 Llm {
1097 proc: self.proc.clone(),
1098 selection: query,
1099 graphql_client: self.graphql_client.clone(),
1100 }
1101 }
1102 pub fn compose_opts(&self, opts: AgentMiddlewareGroupComposeOpts) -> Llm {
1108 let mut query = self.selection.select("compose");
1109 if let Some(base) = opts.base {
1110 query = query.arg("base", base);
1111 }
1112 Llm {
1113 proc: self.proc.clone(),
1114 selection: query,
1115 graphql_client: self.graphql_client.clone(),
1116 }
1117 }
1118 pub async fn id(&self) -> Result<Id, DaggerError> {
1120 let query = self.selection.select("id");
1121 query.execute(self.graphql_client.clone()).await
1122 }
1123 pub async fn list(&self) -> Result<Vec<AgentMiddleware>, DaggerError> {
1125 let query = self.selection.select("list");
1126 let query = query.select("id");
1127 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1128 Ok(ids
1129 .into_iter()
1130 .map(|id| AgentMiddleware {
1131 proc: self.proc.clone(),
1132 selection: crate::querybuilder::query()
1133 .select("node")
1134 .arg("id", &id.0)
1135 .inline_fragment("AgentMiddleware"),
1136 graphql_client: self.graphql_client.clone(),
1137 })
1138 .collect())
1139 }
1140}
1141impl Node for AgentMiddlewareGroup {
1142 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1143 let query = self.selection.select("id");
1144 let graphql_client = self.graphql_client.clone();
1145 async move { query.execute(graphql_client).await }
1146 }
1147}
1148#[derive(Clone)]
1149pub struct CacheVolume {
1150 pub proc: Option<Arc<DaggerSessionProc>>,
1151 pub selection: Selection,
1152 pub graphql_client: DynGraphQLClient,
1153}
1154impl IntoID<Id> for CacheVolume {
1155 fn into_id(
1156 self,
1157 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1158 Box::pin(async move { self.id().await })
1159 }
1160}
1161impl Loadable for CacheVolume {
1162 fn graphql_type() -> &'static str {
1163 "CacheVolume"
1164 }
1165 fn from_query(
1166 proc: Option<Arc<DaggerSessionProc>>,
1167 selection: Selection,
1168 graphql_client: DynGraphQLClient,
1169 ) -> Self {
1170 Self {
1171 proc,
1172 selection,
1173 graphql_client,
1174 }
1175 }
1176}
1177impl CacheVolume {
1178 pub async fn id(&self) -> Result<Id, DaggerError> {
1180 let query = self.selection.select("id");
1181 query.execute(self.graphql_client.clone()).await
1182 }
1183}
1184impl Node for CacheVolume {
1185 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1186 let query = self.selection.select("id");
1187 let graphql_client = self.graphql_client.clone();
1188 async move { query.execute(graphql_client).await }
1189 }
1190}
1191#[derive(Clone)]
1192pub struct Changeset {
1193 pub proc: Option<Arc<DaggerSessionProc>>,
1194 pub selection: Selection,
1195 pub graphql_client: DynGraphQLClient,
1196}
1197#[derive(Builder, Debug, PartialEq)]
1198pub struct ChangesetFilterOpts<'a> {
1199 #[builder(setter(into, strip_option), default)]
1201 pub exclude: Option<Vec<&'a str>>,
1202 #[builder(setter(into, strip_option), default)]
1204 pub include: Option<Vec<&'a str>>,
1205}
1206#[derive(Builder, Debug, PartialEq)]
1207pub struct ChangesetWithChangesetOpts {
1208 #[builder(setter(into, strip_option), default)]
1210 pub on_conflict: Option<ChangesetMergeConflict>,
1211}
1212#[derive(Builder, Debug, PartialEq)]
1213pub struct ChangesetWithChangesetsOpts {
1214 #[builder(setter(into, strip_option), default)]
1216 pub on_conflict: Option<ChangesetsMergeConflict>,
1217}
1218impl IntoID<Id> for Changeset {
1219 fn into_id(
1220 self,
1221 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1222 Box::pin(async move { self.id().await })
1223 }
1224}
1225impl Loadable for Changeset {
1226 fn graphql_type() -> &'static str {
1227 "Changeset"
1228 }
1229 fn from_query(
1230 proc: Option<Arc<DaggerSessionProc>>,
1231 selection: Selection,
1232 graphql_client: DynGraphQLClient,
1233 ) -> Self {
1234 Self {
1235 proc,
1236 selection,
1237 graphql_client,
1238 }
1239 }
1240}
1241impl Changeset {
1242 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
1244 let query = self.selection.select("addedPaths");
1245 query.execute(self.graphql_client.clone()).await
1246 }
1247 pub fn after(&self) -> Directory {
1249 let query = self.selection.select("after");
1250 Directory {
1251 proc: self.proc.clone(),
1252 selection: query,
1253 graphql_client: self.graphql_client.clone(),
1254 }
1255 }
1256 pub fn as_patch(&self) -> File {
1258 let query = self.selection.select("asPatch");
1259 File {
1260 proc: self.proc.clone(),
1261 selection: query,
1262 graphql_client: self.graphql_client.clone(),
1263 }
1264 }
1265 pub fn before(&self) -> Directory {
1267 let query = self.selection.select("before");
1268 Directory {
1269 proc: self.proc.clone(),
1270 selection: query,
1271 graphql_client: self.graphql_client.clone(),
1272 }
1273 }
1274 pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
1276 let query = self.selection.select("diffStats");
1277 let query = query.select("id");
1278 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1279 Ok(ids
1280 .into_iter()
1281 .map(|id| DiffStat {
1282 proc: self.proc.clone(),
1283 selection: crate::querybuilder::query()
1284 .select("node")
1285 .arg("id", &id.0)
1286 .inline_fragment("DiffStat"),
1287 graphql_client: self.graphql_client.clone(),
1288 })
1289 .collect())
1290 }
1291 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
1297 let mut query = self.selection.select("export");
1298 query = query.arg("path", path.into());
1299 query.execute(self.graphql_client.clone()).await
1300 }
1301 pub fn filter(&self) -> Changeset {
1308 let query = self.selection.select("filter");
1309 Changeset {
1310 proc: self.proc.clone(),
1311 selection: query,
1312 graphql_client: self.graphql_client.clone(),
1313 }
1314 }
1315 pub fn filter_opts<'a>(&self, opts: ChangesetFilterOpts<'a>) -> Changeset {
1322 let mut query = self.selection.select("filter");
1323 if let Some(include) = opts.include {
1324 query = query.arg("include", include);
1325 }
1326 if let Some(exclude) = opts.exclude {
1327 query = query.arg("exclude", exclude);
1328 }
1329 Changeset {
1330 proc: self.proc.clone(),
1331 selection: query,
1332 graphql_client: self.graphql_client.clone(),
1333 }
1334 }
1335 pub async fn id(&self) -> Result<Id, DaggerError> {
1337 let query = self.selection.select("id");
1338 query.execute(self.graphql_client.clone()).await
1339 }
1340 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
1342 let query = self.selection.select("isEmpty");
1343 query.execute(self.graphql_client.clone()).await
1344 }
1345 pub fn layer(&self) -> Directory {
1347 let query = self.selection.select("layer");
1348 Directory {
1349 proc: self.proc.clone(),
1350 selection: query,
1351 graphql_client: self.graphql_client.clone(),
1352 }
1353 }
1354 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
1356 let query = self.selection.select("modifiedPaths");
1357 query.execute(self.graphql_client.clone()).await
1358 }
1359 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
1361 let query = self.selection.select("removedPaths");
1362 query.execute(self.graphql_client.clone()).await
1363 }
1364 pub async fn sync(&self) -> Result<Changeset, DaggerError> {
1366 let query = self.selection.select("sync");
1367 let id: Id = query.execute(self.graphql_client.clone()).await?;
1368 Ok(Changeset {
1369 proc: self.proc.clone(),
1370 selection: query
1371 .root()
1372 .select("node")
1373 .arg("id", &id.0)
1374 .inline_fragment("Changeset"),
1375 graphql_client: self.graphql_client.clone(),
1376 })
1377 }
1378 pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
1386 let mut query = self.selection.select("withChangeset");
1387 query = query.arg_lazy(
1388 "changes",
1389 Box::new(move || {
1390 let changes = changes.clone();
1391 Box::pin(async move { changes.into_id().await.unwrap().quote() })
1392 }),
1393 );
1394 Changeset {
1395 proc: self.proc.clone(),
1396 selection: query,
1397 graphql_client: self.graphql_client.clone(),
1398 }
1399 }
1400 pub fn with_changeset_opts(
1408 &self,
1409 changes: impl IntoID<Id>,
1410 opts: ChangesetWithChangesetOpts,
1411 ) -> Changeset {
1412 let mut query = self.selection.select("withChangeset");
1413 query = query.arg_lazy(
1414 "changes",
1415 Box::new(move || {
1416 let changes = changes.clone();
1417 Box::pin(async move { changes.into_id().await.unwrap().quote() })
1418 }),
1419 );
1420 if let Some(on_conflict) = opts.on_conflict {
1421 query = query.arg("onConflict", on_conflict);
1422 }
1423 Changeset {
1424 proc: self.proc.clone(),
1425 selection: query,
1426 graphql_client: self.graphql_client.clone(),
1427 }
1428 }
1429 pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
1438 let mut query = self.selection.select("withChangesets");
1439 query = query.arg("changes", changes);
1440 Changeset {
1441 proc: self.proc.clone(),
1442 selection: query,
1443 graphql_client: self.graphql_client.clone(),
1444 }
1445 }
1446 pub fn with_changesets_opts(
1455 &self,
1456 changes: Vec<Id>,
1457 opts: ChangesetWithChangesetsOpts,
1458 ) -> Changeset {
1459 let mut query = self.selection.select("withChangesets");
1460 query = query.arg("changes", changes);
1461 if let Some(on_conflict) = opts.on_conflict {
1462 query = query.arg("onConflict", on_conflict);
1463 }
1464 Changeset {
1465 proc: self.proc.clone(),
1466 selection: query,
1467 graphql_client: self.graphql_client.clone(),
1468 }
1469 }
1470}
1471impl Exportable for Changeset {
1472 fn export(
1473 &self,
1474 path: impl Into<String>,
1475 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
1476 let mut query = self.selection.select("export");
1477 query = query.arg("path", path.into());
1478 let graphql_client = self.graphql_client.clone();
1479 async move { query.execute(graphql_client).await }
1480 }
1481 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1482 let query = self.selection.select("id");
1483 let graphql_client = self.graphql_client.clone();
1484 async move { query.execute(graphql_client).await }
1485 }
1486}
1487impl Node for Changeset {
1488 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1489 let query = self.selection.select("id");
1490 let graphql_client = self.graphql_client.clone();
1491 async move { query.execute(graphql_client).await }
1492 }
1493}
1494impl Syncer for Changeset {
1495 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1496 let query = self.selection.select("id");
1497 let graphql_client = self.graphql_client.clone();
1498 async move { query.execute(graphql_client).await }
1499 }
1500 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
1501 let query = self.selection.select("sync");
1502 let proc = self.proc.clone();
1503 let graphql_client = self.graphql_client.clone();
1504 async move {
1505 let id: Id = query.execute(graphql_client.clone()).await?;
1506 Ok(Self {
1507 proc,
1508 selection: query
1509 .root()
1510 .select("node")
1511 .arg("id", &id.0)
1512 .inline_fragment("Changeset"),
1513 graphql_client,
1514 })
1515 }
1516 }
1517}
1518#[derive(Clone)]
1519pub struct Check {
1520 pub proc: Option<Arc<DaggerSessionProc>>,
1521 pub selection: Selection,
1522 pub graphql_client: DynGraphQLClient,
1523}
1524impl IntoID<Id> for Check {
1525 fn into_id(
1526 self,
1527 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1528 Box::pin(async move { self.id().await })
1529 }
1530}
1531impl Loadable for Check {
1532 fn graphql_type() -> &'static str {
1533 "Check"
1534 }
1535 fn from_query(
1536 proc: Option<Arc<DaggerSessionProc>>,
1537 selection: Selection,
1538 graphql_client: DynGraphQLClient,
1539 ) -> Self {
1540 Self {
1541 proc,
1542 selection,
1543 graphql_client,
1544 }
1545 }
1546}
1547impl Check {
1548 pub async fn check_type(&self) -> Result<String, DaggerError> {
1550 let query = self.selection.select("checkType");
1551 query.execute(self.graphql_client.clone()).await
1552 }
1553 pub async fn completed(&self) -> Result<bool, DaggerError> {
1555 let query = self.selection.select("completed");
1556 query.execute(self.graphql_client.clone()).await
1557 }
1558 pub async fn description(&self) -> Result<String, DaggerError> {
1560 let query = self.selection.select("description");
1561 query.execute(self.graphql_client.clone()).await
1562 }
1563 pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1565 let query = self.selection.select("error");
1566 let query = query.select("id");
1567 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1568 Ok(id.map(|id| Error {
1569 proc: self.proc.clone(),
1570 selection: query
1571 .root()
1572 .select("node")
1573 .arg("id", &id.0)
1574 .inline_fragment("Error"),
1575 graphql_client: self.graphql_client.clone(),
1576 }))
1577 }
1578 pub async fn id(&self) -> Result<Id, DaggerError> {
1580 let query = self.selection.select("id");
1581 query.execute(self.graphql_client.clone()).await
1582 }
1583 pub async fn name(&self) -> Result<String, DaggerError> {
1585 let query = self.selection.select("name");
1586 query.execute(self.graphql_client.clone()).await
1587 }
1588 pub fn original_module(&self) -> Module {
1590 let query = self.selection.select("originalModule");
1591 Module {
1592 proc: self.proc.clone(),
1593 selection: query,
1594 graphql_client: self.graphql_client.clone(),
1595 }
1596 }
1597 pub async fn passed(&self) -> Result<bool, DaggerError> {
1599 let query = self.selection.select("passed");
1600 query.execute(self.graphql_client.clone()).await
1601 }
1602 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1604 let query = self.selection.select("path");
1605 query.execute(self.graphql_client.clone()).await
1606 }
1607 pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1609 let query = self.selection.select("resultEmoji");
1610 query.execute(self.graphql_client.clone()).await
1611 }
1612 pub fn run(&self) -> Check {
1614 let query = self.selection.select("run");
1615 Check {
1616 proc: self.proc.clone(),
1617 selection: query,
1618 graphql_client: self.graphql_client.clone(),
1619 }
1620 }
1621}
1622impl Node for Check {
1623 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1624 let query = self.selection.select("id");
1625 let graphql_client = self.graphql_client.clone();
1626 async move { query.execute(graphql_client).await }
1627 }
1628}
1629#[derive(Clone)]
1630pub struct CheckGroup {
1631 pub proc: Option<Arc<DaggerSessionProc>>,
1632 pub selection: Selection,
1633 pub graphql_client: DynGraphQLClient,
1634}
1635#[derive(Builder, Debug, PartialEq)]
1636pub struct CheckGroupRunOpts {
1637 #[builder(setter(into, strip_option), default)]
1639 pub fail_fast: Option<bool>,
1640}
1641impl IntoID<Id> for CheckGroup {
1642 fn into_id(
1643 self,
1644 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1645 Box::pin(async move { self.id().await })
1646 }
1647}
1648impl Loadable for CheckGroup {
1649 fn graphql_type() -> &'static str {
1650 "CheckGroup"
1651 }
1652 fn from_query(
1653 proc: Option<Arc<DaggerSessionProc>>,
1654 selection: Selection,
1655 graphql_client: DynGraphQLClient,
1656 ) -> Self {
1657 Self {
1658 proc,
1659 selection,
1660 graphql_client,
1661 }
1662 }
1663}
1664impl CheckGroup {
1665 pub async fn id(&self) -> Result<Id, DaggerError> {
1667 let query = self.selection.select("id");
1668 query.execute(self.graphql_client.clone()).await
1669 }
1670 pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1672 let query = self.selection.select("list");
1673 let query = query.select("id");
1674 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1675 Ok(ids
1676 .into_iter()
1677 .map(|id| Check {
1678 proc: self.proc.clone(),
1679 selection: crate::querybuilder::query()
1680 .select("node")
1681 .arg("id", &id.0)
1682 .inline_fragment("Check"),
1683 graphql_client: self.graphql_client.clone(),
1684 })
1685 .collect())
1686 }
1687 pub fn report(&self) -> File {
1689 let query = self.selection.select("report");
1690 File {
1691 proc: self.proc.clone(),
1692 selection: query,
1693 graphql_client: self.graphql_client.clone(),
1694 }
1695 }
1696 pub fn run(&self) -> CheckGroup {
1702 let query = self.selection.select("run");
1703 CheckGroup {
1704 proc: self.proc.clone(),
1705 selection: query,
1706 graphql_client: self.graphql_client.clone(),
1707 }
1708 }
1709 pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1715 let mut query = self.selection.select("run");
1716 if let Some(fail_fast) = opts.fail_fast {
1717 query = query.arg("failFast", fail_fast);
1718 }
1719 CheckGroup {
1720 proc: self.proc.clone(),
1721 selection: query,
1722 graphql_client: self.graphql_client.clone(),
1723 }
1724 }
1725}
1726impl Node for CheckGroup {
1727 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1728 let query = self.selection.select("id");
1729 let graphql_client = self.graphql_client.clone();
1730 async move { query.execute(graphql_client).await }
1731 }
1732}
1733#[derive(Clone)]
1734pub struct ClientFilesyncMirror {
1735 pub proc: Option<Arc<DaggerSessionProc>>,
1736 pub selection: Selection,
1737 pub graphql_client: DynGraphQLClient,
1738}
1739impl IntoID<Id> for ClientFilesyncMirror {
1740 fn into_id(
1741 self,
1742 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1743 Box::pin(async move { self.id().await })
1744 }
1745}
1746impl Loadable for ClientFilesyncMirror {
1747 fn graphql_type() -> &'static str {
1748 "ClientFilesyncMirror"
1749 }
1750 fn from_query(
1751 proc: Option<Arc<DaggerSessionProc>>,
1752 selection: Selection,
1753 graphql_client: DynGraphQLClient,
1754 ) -> Self {
1755 Self {
1756 proc,
1757 selection,
1758 graphql_client,
1759 }
1760 }
1761}
1762impl ClientFilesyncMirror {
1763 pub async fn id(&self) -> Result<Id, DaggerError> {
1765 let query = self.selection.select("id");
1766 query.execute(self.graphql_client.clone()).await
1767 }
1768}
1769impl Node for ClientFilesyncMirror {
1770 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1771 let query = self.selection.select("id");
1772 let graphql_client = self.graphql_client.clone();
1773 async move { query.execute(graphql_client).await }
1774 }
1775}
1776#[derive(Clone)]
1777pub struct Cloud {
1778 pub proc: Option<Arc<DaggerSessionProc>>,
1779 pub selection: Selection,
1780 pub graphql_client: DynGraphQLClient,
1781}
1782impl IntoID<Id> for Cloud {
1783 fn into_id(
1784 self,
1785 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1786 Box::pin(async move { self.id().await })
1787 }
1788}
1789impl Loadable for Cloud {
1790 fn graphql_type() -> &'static str {
1791 "Cloud"
1792 }
1793 fn from_query(
1794 proc: Option<Arc<DaggerSessionProc>>,
1795 selection: Selection,
1796 graphql_client: DynGraphQLClient,
1797 ) -> Self {
1798 Self {
1799 proc,
1800 selection,
1801 graphql_client,
1802 }
1803 }
1804}
1805impl Cloud {
1806 pub async fn id(&self) -> Result<Id, DaggerError> {
1808 let query = self.selection.select("id");
1809 query.execute(self.graphql_client.clone()).await
1810 }
1811 pub async fn trace_url(&self) -> Result<String, DaggerError> {
1813 let query = self.selection.select("traceURL");
1814 query.execute(self.graphql_client.clone()).await
1815 }
1816}
1817impl Node for Cloud {
1818 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1819 let query = self.selection.select("id");
1820 let graphql_client = self.graphql_client.clone();
1821 async move { query.execute(graphql_client).await }
1822 }
1823}
1824#[derive(Clone)]
1825pub struct Container {
1826 pub proc: Option<Arc<DaggerSessionProc>>,
1827 pub selection: Selection,
1828 pub graphql_client: DynGraphQLClient,
1829}
1830#[derive(Builder, Debug, PartialEq)]
1831pub struct ContainerAsServiceOpts<'a> {
1832 #[builder(setter(into, strip_option), default)]
1835 pub args: Option<Vec<&'a str>>,
1836 #[builder(setter(into, strip_option), default)]
1838 pub expand: Option<bool>,
1839 #[builder(setter(into, strip_option), default)]
1841 pub experimental_privileged_nesting: Option<bool>,
1842 #[builder(setter(into, strip_option), default)]
1844 pub insecure_root_capabilities: Option<bool>,
1845 #[builder(setter(into, strip_option), default)]
1848 pub no_init: Option<bool>,
1849 #[builder(setter(into, strip_option), default)]
1851 pub use_entrypoint: Option<bool>,
1852}
1853#[derive(Builder, Debug, PartialEq)]
1854pub struct ContainerAsTarballOpts {
1855 #[builder(setter(into, strip_option), default)]
1858 pub forced_compression: Option<ImageLayerCompression>,
1859 #[builder(setter(into, strip_option), default)]
1862 pub media_types: Option<ImageMediaTypes>,
1863 #[builder(setter(into, strip_option), default)]
1866 pub platform_variants: Option<Vec<Id>>,
1867}
1868#[derive(Builder, Debug, PartialEq)]
1869pub struct ContainerDirectoryOpts {
1870 #[builder(setter(into, strip_option), default)]
1872 pub expand: Option<bool>,
1873}
1874#[derive(Builder, Debug, PartialEq)]
1875pub struct ContainerExistsOpts {
1876 #[builder(setter(into, strip_option), default)]
1878 pub do_not_follow_symlinks: Option<bool>,
1879 #[builder(setter(into, strip_option), default)]
1881 pub expand: Option<bool>,
1882 #[builder(setter(into, strip_option), default)]
1884 pub expected_type: Option<ExistsType>,
1885}
1886#[derive(Builder, Debug, PartialEq)]
1887pub struct ContainerExportOpts {
1888 #[builder(setter(into, strip_option), default)]
1890 pub expand: Option<bool>,
1891 #[builder(setter(into, strip_option), default)]
1894 pub forced_compression: Option<ImageLayerCompression>,
1895 #[builder(setter(into, strip_option), default)]
1898 pub media_types: Option<ImageMediaTypes>,
1899 #[builder(setter(into, strip_option), default)]
1902 pub platform_variants: Option<Vec<Id>>,
1903}
1904#[derive(Builder, Debug, PartialEq)]
1905pub struct ContainerExportImageOpts {
1906 #[builder(setter(into, strip_option), default)]
1909 pub forced_compression: Option<ImageLayerCompression>,
1910 #[builder(setter(into, strip_option), default)]
1913 pub media_types: Option<ImageMediaTypes>,
1914 #[builder(setter(into, strip_option), default)]
1917 pub platform_variants: Option<Vec<Id>>,
1918}
1919#[derive(Builder, Debug, PartialEq)]
1920pub struct ContainerFileOpts {
1921 #[builder(setter(into, strip_option), default)]
1923 pub expand: Option<bool>,
1924}
1925#[derive(Builder, Debug, PartialEq)]
1926pub struct ContainerFromOpts<'a> {
1927 #[builder(setter(into, strip_option), default)]
1929 pub insecure_skip_tls_verify: Option<bool>,
1930 #[builder(setter(into, strip_option), default)]
1933 pub protocol: Option<RegistryProtocol>,
1934 #[builder(setter(into, strip_option), default)]
1937 pub registry_service: Option<Id>,
1938 #[builder(setter(into, strip_option), default)]
1940 pub version: Option<&'a str>,
1941}
1942#[derive(Builder, Debug, PartialEq)]
1943pub struct ContainerImportOpts<'a> {
1944 #[builder(setter(into, strip_option), default)]
1946 pub tag: Option<&'a str>,
1947}
1948#[derive(Builder, Debug, PartialEq)]
1949pub struct ContainerLayerOpts {
1950 #[builder(setter(into, strip_option), default)]
1953 pub forced_compression: Option<ImageLayerCompression>,
1954 #[builder(setter(into, strip_option), default)]
1956 pub media_types: Option<ImageMediaTypes>,
1957}
1958#[derive(Builder, Debug, PartialEq)]
1959pub struct ContainerManifestOpts {
1960 #[builder(setter(into, strip_option), default)]
1963 pub forced_compression: Option<ImageLayerCompression>,
1964 #[builder(setter(into, strip_option), default)]
1966 pub media_types: Option<ImageMediaTypes>,
1967}
1968#[derive(Builder, Debug, PartialEq)]
1969pub struct ContainerPublishOpts {
1970 #[builder(setter(into, strip_option), default)]
1973 pub forced_compression: Option<ImageLayerCompression>,
1974 #[builder(setter(into, strip_option), default)]
1976 pub insecure_skip_tls_verify: Option<bool>,
1977 #[builder(setter(into, strip_option), default)]
1980 pub media_types: Option<ImageMediaTypes>,
1981 #[builder(setter(into, strip_option), default)]
1984 pub platform_variants: Option<Vec<Id>>,
1985 #[builder(setter(into, strip_option), default)]
1988 pub protocol: Option<RegistryProtocol>,
1989 #[builder(setter(into, strip_option), default)]
1992 pub registry_service: Option<Id>,
1993}
1994#[derive(Builder, Debug, PartialEq)]
1995pub struct ContainerStatOpts {
1996 #[builder(setter(into, strip_option), default)]
1998 pub do_not_follow_symlinks: Option<bool>,
1999}
2000#[derive(Builder, Debug, PartialEq)]
2001pub struct ContainerTerminalOpts<'a> {
2002 #[builder(setter(into, strip_option), default)]
2004 pub cmd: Option<Vec<&'a str>>,
2005 #[builder(setter(into, strip_option), default)]
2007 pub experimental_privileged_nesting: Option<bool>,
2008 #[builder(setter(into, strip_option), default)]
2010 pub insecure_root_capabilities: Option<bool>,
2011}
2012#[derive(Builder, Debug, PartialEq)]
2013pub struct ContainerUpOpts<'a> {
2014 #[builder(setter(into, strip_option), default)]
2017 pub args: Option<Vec<&'a str>>,
2018 #[builder(setter(into, strip_option), default)]
2020 pub expand: Option<bool>,
2021 #[builder(setter(into, strip_option), default)]
2023 pub experimental_privileged_nesting: Option<bool>,
2024 #[builder(setter(into, strip_option), default)]
2026 pub insecure_root_capabilities: Option<bool>,
2027 #[builder(setter(into, strip_option), default)]
2030 pub no_init: Option<bool>,
2031 #[builder(setter(into, strip_option), default)]
2034 pub ports: Option<Vec<PortForward>>,
2035 #[builder(setter(into, strip_option), default)]
2037 pub random: Option<bool>,
2038 #[builder(setter(into, strip_option), default)]
2040 pub use_entrypoint: Option<bool>,
2041}
2042#[derive(Builder, Debug, PartialEq)]
2043pub struct ContainerWithDefaultTerminalCmdOpts {
2044 #[builder(setter(into, strip_option), default)]
2046 pub experimental_privileged_nesting: Option<bool>,
2047 #[builder(setter(into, strip_option), default)]
2049 pub insecure_root_capabilities: Option<bool>,
2050}
2051#[derive(Builder, Debug, PartialEq)]
2052pub struct ContainerWithDirectoryOpts<'a> {
2053 #[builder(setter(into, strip_option), default)]
2055 pub exclude: Option<Vec<&'a str>>,
2056 #[builder(setter(into, strip_option), default)]
2058 pub expand: Option<bool>,
2059 #[builder(setter(into, strip_option), default)]
2061 pub gitignore: Option<bool>,
2062 #[builder(setter(into, strip_option), default)]
2064 pub include: Option<Vec<&'a str>>,
2065 #[builder(setter(into, strip_option), default)]
2067 pub inherit_owner: Option<bool>,
2068 #[builder(setter(into, strip_option), default)]
2072 pub owner: Option<&'a str>,
2073 #[builder(setter(into, strip_option), default)]
2074 pub permissions: Option<isize>,
2075}
2076#[derive(Builder, Debug, PartialEq)]
2077pub struct ContainerWithDockerHealthcheckOpts<'a> {
2078 #[builder(setter(into, strip_option), default)]
2080 pub interval: Option<&'a str>,
2081 #[builder(setter(into, strip_option), default)]
2083 pub retries: Option<isize>,
2084 #[builder(setter(into, strip_option), default)]
2086 pub shell: Option<bool>,
2087 #[builder(setter(into, strip_option), default)]
2089 pub start_interval: Option<&'a str>,
2090 #[builder(setter(into, strip_option), default)]
2092 pub start_period: Option<&'a str>,
2093 #[builder(setter(into, strip_option), default)]
2095 pub timeout: Option<&'a str>,
2096}
2097#[derive(Builder, Debug, PartialEq)]
2098pub struct ContainerWithEntrypointOpts {
2099 #[builder(setter(into, strip_option), default)]
2101 pub keep_default_args: Option<bool>,
2102}
2103#[derive(Builder, Debug, PartialEq)]
2104pub struct ContainerWithEnvVariableOpts {
2105 #[builder(setter(into, strip_option), default)]
2107 pub expand: Option<bool>,
2108}
2109#[derive(Builder, Debug, PartialEq)]
2110pub struct ContainerWithExecOpts<'a> {
2111 #[builder(setter(into, strip_option), default)]
2113 pub expand: Option<bool>,
2114 #[builder(setter(into, strip_option), default)]
2116 pub expect: Option<ReturnType>,
2117 #[builder(setter(into, strip_option), default)]
2119 pub experimental_privileged_nesting: Option<bool>,
2120 #[builder(setter(into, strip_option), default)]
2123 pub insecure_root_capabilities: Option<bool>,
2124 #[builder(setter(into, strip_option), default)]
2127 pub no_init: Option<bool>,
2128 #[builder(setter(into, strip_option), default)]
2130 pub redirect_stderr: Option<&'a str>,
2131 #[builder(setter(into, strip_option), default)]
2133 pub redirect_stdin: Option<&'a str>,
2134 #[builder(setter(into, strip_option), default)]
2136 pub redirect_stdout: Option<&'a str>,
2137 #[builder(setter(into, strip_option), default)]
2139 pub stdin: Option<&'a str>,
2140 #[builder(setter(into, strip_option), default)]
2142 pub use_entrypoint: Option<bool>,
2143}
2144#[derive(Builder, Debug, PartialEq)]
2145pub struct ContainerWithExposedPortOpts<'a> {
2146 #[builder(setter(into, strip_option), default)]
2148 pub description: Option<&'a str>,
2149 #[builder(setter(into, strip_option), default)]
2151 pub experimental_skip_healthcheck: Option<bool>,
2152 #[builder(setter(into, strip_option), default)]
2154 pub protocol: Option<NetworkProtocol>,
2155}
2156#[derive(Builder, Debug, PartialEq)]
2157pub struct ContainerWithFileOpts<'a> {
2158 #[builder(setter(into, strip_option), default)]
2160 pub expand: Option<bool>,
2161 #[builder(setter(into, strip_option), default)]
2163 pub inherit_owner: Option<bool>,
2164 #[builder(setter(into, strip_option), default)]
2168 pub owner: Option<&'a str>,
2169 #[builder(setter(into, strip_option), default)]
2171 pub permissions: Option<isize>,
2172}
2173#[derive(Builder, Debug, PartialEq)]
2174pub struct ContainerWithFilesOpts<'a> {
2175 #[builder(setter(into, strip_option), default)]
2177 pub expand: Option<bool>,
2178 #[builder(setter(into, strip_option), default)]
2180 pub inherit_owner: Option<bool>,
2181 #[builder(setter(into, strip_option), default)]
2185 pub owner: Option<&'a str>,
2186 #[builder(setter(into, strip_option), default)]
2188 pub permissions: Option<isize>,
2189}
2190#[derive(Builder, Debug, PartialEq)]
2191pub struct ContainerWithMountedCacheOpts<'a> {
2192 #[builder(setter(into, strip_option), default)]
2194 pub expand: Option<bool>,
2195 #[builder(setter(into, strip_option), default)]
2197 pub inherit_owner: Option<bool>,
2198 #[builder(setter(into, strip_option), default)]
2203 pub owner: Option<&'a str>,
2204 #[builder(setter(into, strip_option), default)]
2206 pub sharing: Option<CacheSharingMode>,
2207 #[builder(setter(into, strip_option), default)]
2209 pub source: Option<Id>,
2210}
2211#[derive(Builder, Debug, PartialEq)]
2212pub struct ContainerWithMountedDirectoryOpts<'a> {
2213 #[builder(setter(into, strip_option), default)]
2215 pub expand: Option<bool>,
2216 #[builder(setter(into, strip_option), default)]
2218 pub inherit_owner: Option<bool>,
2219 #[builder(setter(into, strip_option), default)]
2223 pub owner: Option<&'a str>,
2224 #[builder(setter(into, strip_option), default)]
2226 pub read_only: Option<bool>,
2227}
2228#[derive(Builder, Debug, PartialEq)]
2229pub struct ContainerWithMountedFileOpts<'a> {
2230 #[builder(setter(into, strip_option), default)]
2232 pub expand: Option<bool>,
2233 #[builder(setter(into, strip_option), default)]
2235 pub inherit_owner: Option<bool>,
2236 #[builder(setter(into, strip_option), default)]
2240 pub owner: Option<&'a str>,
2241}
2242#[derive(Builder, Debug, PartialEq)]
2243pub struct ContainerWithMountedSecretOpts<'a> {
2244 #[builder(setter(into, strip_option), default)]
2246 pub expand: Option<bool>,
2247 #[builder(setter(into, strip_option), default)]
2249 pub inherit_owner: Option<bool>,
2250 #[builder(setter(into, strip_option), default)]
2253 pub mode: Option<isize>,
2254 #[builder(setter(into, strip_option), default)]
2258 pub owner: Option<&'a str>,
2259}
2260#[derive(Builder, Debug, PartialEq)]
2261pub struct ContainerWithMountedTempOpts {
2262 #[builder(setter(into, strip_option), default)]
2264 pub expand: Option<bool>,
2265 #[builder(setter(into, strip_option), default)]
2267 pub size: Option<isize>,
2268}
2269#[derive(Builder, Debug, PartialEq)]
2270pub struct ContainerWithMountedVolumeOpts {
2271 #[builder(setter(into, strip_option), default)]
2273 pub expand: Option<bool>,
2274 #[builder(setter(into, strip_option), default)]
2276 pub read_only: Option<bool>,
2277}
2278#[derive(Builder, Debug, PartialEq)]
2279pub struct ContainerWithNewFileOpts<'a> {
2280 #[builder(setter(into, strip_option), default)]
2282 pub expand: Option<bool>,
2283 #[builder(setter(into, strip_option), default)]
2285 pub inherit_owner: Option<bool>,
2286 #[builder(setter(into, strip_option), default)]
2290 pub owner: Option<&'a str>,
2291 #[builder(setter(into, strip_option), default)]
2293 pub permissions: Option<isize>,
2294}
2295#[derive(Builder, Debug, PartialEq)]
2296pub struct ContainerWithSymlinkOpts {
2297 #[builder(setter(into, strip_option), default)]
2299 pub expand: Option<bool>,
2300}
2301#[derive(Builder, Debug, PartialEq)]
2302pub struct ContainerWithUnixSocketOpts<'a> {
2303 #[builder(setter(into, strip_option), default)]
2305 pub expand: Option<bool>,
2306 #[builder(setter(into, strip_option), default)]
2308 pub inherit_owner: Option<bool>,
2309 #[builder(setter(into, strip_option), default)]
2313 pub owner: Option<&'a str>,
2314}
2315#[derive(Builder, Debug, PartialEq)]
2316pub struct ContainerWithWorkdirOpts {
2317 #[builder(setter(into, strip_option), default)]
2319 pub expand: Option<bool>,
2320}
2321#[derive(Builder, Debug, PartialEq)]
2322pub struct ContainerWithoutDirectoryOpts {
2323 #[builder(setter(into, strip_option), default)]
2325 pub expand: Option<bool>,
2326}
2327#[derive(Builder, Debug, PartialEq)]
2328pub struct ContainerWithoutEntrypointOpts {
2329 #[builder(setter(into, strip_option), default)]
2331 pub keep_default_args: Option<bool>,
2332}
2333#[derive(Builder, Debug, PartialEq)]
2334pub struct ContainerWithoutExposedPortOpts {
2335 #[builder(setter(into, strip_option), default)]
2337 pub protocol: Option<NetworkProtocol>,
2338}
2339#[derive(Builder, Debug, PartialEq)]
2340pub struct ContainerWithoutFileOpts {
2341 #[builder(setter(into, strip_option), default)]
2343 pub expand: Option<bool>,
2344}
2345#[derive(Builder, Debug, PartialEq)]
2346pub struct ContainerWithoutFilesOpts {
2347 #[builder(setter(into, strip_option), default)]
2349 pub expand: Option<bool>,
2350}
2351#[derive(Builder, Debug, PartialEq)]
2352pub struct ContainerWithoutMountOpts {
2353 #[builder(setter(into, strip_option), default)]
2355 pub expand: Option<bool>,
2356}
2357#[derive(Builder, Debug, PartialEq)]
2358pub struct ContainerWithoutUnixSocketOpts {
2359 #[builder(setter(into, strip_option), default)]
2361 pub expand: Option<bool>,
2362}
2363impl IntoID<Id> for Container {
2364 fn into_id(
2365 self,
2366 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2367 Box::pin(async move { self.id().await })
2368 }
2369}
2370impl Loadable for Container {
2371 fn graphql_type() -> &'static str {
2372 "Container"
2373 }
2374 fn from_query(
2375 proc: Option<Arc<DaggerSessionProc>>,
2376 selection: Selection,
2377 graphql_client: DynGraphQLClient,
2378 ) -> Self {
2379 Self {
2380 proc,
2381 selection,
2382 graphql_client,
2383 }
2384 }
2385}
2386impl Container {
2387 pub fn as_service(&self) -> Service {
2394 let query = self.selection.select("asService");
2395 Service {
2396 proc: self.proc.clone(),
2397 selection: query,
2398 graphql_client: self.graphql_client.clone(),
2399 }
2400 }
2401 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2408 let mut query = self.selection.select("asService");
2409 if let Some(args) = opts.args {
2410 query = query.arg("args", args);
2411 }
2412 if let Some(use_entrypoint) = opts.use_entrypoint {
2413 query = query.arg("useEntrypoint", use_entrypoint);
2414 }
2415 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2416 query = query.arg(
2417 "experimentalPrivilegedNesting",
2418 experimental_privileged_nesting,
2419 );
2420 }
2421 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2422 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2423 }
2424 if let Some(expand) = opts.expand {
2425 query = query.arg("expand", expand);
2426 }
2427 if let Some(no_init) = opts.no_init {
2428 query = query.arg("noInit", no_init);
2429 }
2430 Service {
2431 proc: self.proc.clone(),
2432 selection: query,
2433 graphql_client: self.graphql_client.clone(),
2434 }
2435 }
2436 pub fn as_tarball(&self) -> File {
2442 let query = self.selection.select("asTarball");
2443 File {
2444 proc: self.proc.clone(),
2445 selection: query,
2446 graphql_client: self.graphql_client.clone(),
2447 }
2448 }
2449 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2455 let mut query = self.selection.select("asTarball");
2456 if let Some(platform_variants) = opts.platform_variants {
2457 query = query.arg("platformVariants", platform_variants);
2458 }
2459 if let Some(forced_compression) = opts.forced_compression {
2460 query = query.arg("forcedCompression", forced_compression);
2461 }
2462 if let Some(media_types) = opts.media_types {
2463 query = query.arg("mediaTypes", media_types);
2464 }
2465 File {
2466 proc: self.proc.clone(),
2467 selection: query,
2468 graphql_client: self.graphql_client.clone(),
2469 }
2470 }
2471 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2474 let query = self.selection.select("combinedOutput");
2475 query.execute(self.graphql_client.clone()).await
2476 }
2477 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2479 let query = self.selection.select("defaultArgs");
2480 query.execute(self.graphql_client.clone()).await
2481 }
2482 pub fn directory(&self, path: impl Into<String>) -> Directory {
2490 let mut query = self.selection.select("directory");
2491 query = query.arg("path", path.into());
2492 Directory {
2493 proc: self.proc.clone(),
2494 selection: query,
2495 graphql_client: self.graphql_client.clone(),
2496 }
2497 }
2498 pub fn directory_opts(
2506 &self,
2507 path: impl Into<String>,
2508 opts: ContainerDirectoryOpts,
2509 ) -> Directory {
2510 let mut query = self.selection.select("directory");
2511 query = query.arg("path", path.into());
2512 if let Some(expand) = opts.expand {
2513 query = query.arg("expand", expand);
2514 }
2515 Directory {
2516 proc: self.proc.clone(),
2517 selection: query,
2518 graphql_client: self.graphql_client.clone(),
2519 }
2520 }
2521 pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
2523 let query = self.selection.select("dockerHealthcheck");
2524 let query = query.select("id");
2525 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2526 Ok(id.map(|id| HealthcheckConfig {
2527 proc: self.proc.clone(),
2528 selection: query
2529 .root()
2530 .select("node")
2531 .arg("id", &id.0)
2532 .inline_fragment("HealthcheckConfig"),
2533 graphql_client: self.graphql_client.clone(),
2534 }))
2535 }
2536 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2538 let query = self.selection.select("entrypoint");
2539 query.execute(self.graphql_client.clone()).await
2540 }
2541 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2547 let mut query = self.selection.select("envVariable");
2548 query = query.arg("name", name.into());
2549 query.execute(self.graphql_client.clone()).await
2550 }
2551 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2553 let query = self.selection.select("envVariables");
2554 let query = query.select("id");
2555 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2556 Ok(ids
2557 .into_iter()
2558 .map(|id| EnvVariable {
2559 proc: self.proc.clone(),
2560 selection: crate::querybuilder::query()
2561 .select("node")
2562 .arg("id", &id.0)
2563 .inline_fragment("EnvVariable"),
2564 graphql_client: self.graphql_client.clone(),
2565 })
2566 .collect())
2567 }
2568 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2575 let mut query = self.selection.select("exists");
2576 query = query.arg("path", path.into());
2577 query.execute(self.graphql_client.clone()).await
2578 }
2579 pub async fn exists_opts(
2586 &self,
2587 path: impl Into<String>,
2588 opts: ContainerExistsOpts,
2589 ) -> Result<bool, DaggerError> {
2590 let mut query = self.selection.select("exists");
2591 query = query.arg("path", path.into());
2592 if let Some(expected_type) = opts.expected_type {
2593 query = query.arg("expectedType", expected_type);
2594 }
2595 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2596 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2597 }
2598 if let Some(expand) = opts.expand {
2599 query = query.arg("expand", expand);
2600 }
2601 query.execute(self.graphql_client.clone()).await
2602 }
2603 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2606 let query = self.selection.select("exitCode");
2607 query.execute(self.graphql_client.clone()).await
2608 }
2609 pub fn experimental_with_all_gp_us(&self) -> Container {
2613 let query = self.selection.select("experimentalWithAllGPUs");
2614 Container {
2615 proc: self.proc.clone(),
2616 selection: query,
2617 graphql_client: self.graphql_client.clone(),
2618 }
2619 }
2620 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2628 let mut query = self.selection.select("experimentalWithGPU");
2629 query = query.arg(
2630 "devices",
2631 devices
2632 .into_iter()
2633 .map(|i| i.into())
2634 .collect::<Vec<String>>(),
2635 );
2636 Container {
2637 proc: self.proc.clone(),
2638 selection: query,
2639 graphql_client: self.graphql_client.clone(),
2640 }
2641 }
2642 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2652 let mut query = self.selection.select("export");
2653 query = query.arg("path", path.into());
2654 query.execute(self.graphql_client.clone()).await
2655 }
2656 pub async fn export_opts(
2666 &self,
2667 path: impl Into<String>,
2668 opts: ContainerExportOpts,
2669 ) -> Result<String, DaggerError> {
2670 let mut query = self.selection.select("export");
2671 query = query.arg("path", path.into());
2672 if let Some(platform_variants) = opts.platform_variants {
2673 query = query.arg("platformVariants", platform_variants);
2674 }
2675 if let Some(forced_compression) = opts.forced_compression {
2676 query = query.arg("forcedCompression", forced_compression);
2677 }
2678 if let Some(media_types) = opts.media_types {
2679 query = query.arg("mediaTypes", media_types);
2680 }
2681 if let Some(expand) = opts.expand {
2682 query = query.arg("expand", expand);
2683 }
2684 query.execute(self.graphql_client.clone()).await
2685 }
2686 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2693 let mut query = self.selection.select("exportImage");
2694 query = query.arg("name", name.into());
2695 query.execute(self.graphql_client.clone()).await
2696 }
2697 pub async fn export_image_opts(
2704 &self,
2705 name: impl Into<String>,
2706 opts: ContainerExportImageOpts,
2707 ) -> Result<Void, DaggerError> {
2708 let mut query = self.selection.select("exportImage");
2709 query = query.arg("name", name.into());
2710 if let Some(platform_variants) = opts.platform_variants {
2711 query = query.arg("platformVariants", platform_variants);
2712 }
2713 if let Some(forced_compression) = opts.forced_compression {
2714 query = query.arg("forcedCompression", forced_compression);
2715 }
2716 if let Some(media_types) = opts.media_types {
2717 query = query.arg("mediaTypes", media_types);
2718 }
2719 query.execute(self.graphql_client.clone()).await
2720 }
2721 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2724 let query = self.selection.select("exposedPorts");
2725 let query = query.select("id");
2726 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2727 Ok(ids
2728 .into_iter()
2729 .map(|id| Port {
2730 proc: self.proc.clone(),
2731 selection: crate::querybuilder::query()
2732 .select("node")
2733 .arg("id", &id.0)
2734 .inline_fragment("Port"),
2735 graphql_client: self.graphql_client.clone(),
2736 })
2737 .collect())
2738 }
2739 pub fn file(&self, path: impl Into<String>) -> File {
2747 let mut query = self.selection.select("file");
2748 query = query.arg("path", path.into());
2749 File {
2750 proc: self.proc.clone(),
2751 selection: query,
2752 graphql_client: self.graphql_client.clone(),
2753 }
2754 }
2755 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2763 let mut query = self.selection.select("file");
2764 query = query.arg("path", path.into());
2765 if let Some(expand) = opts.expand {
2766 query = query.arg("expand", expand);
2767 }
2768 File {
2769 proc: self.proc.clone(),
2770 selection: query,
2771 graphql_client: self.graphql_client.clone(),
2772 }
2773 }
2774 pub fn from(&self, address: impl Into<String>) -> Container {
2783 let mut query = self.selection.select("from");
2784 query = query.arg("address", address.into());
2785 Container {
2786 proc: self.proc.clone(),
2787 selection: query,
2788 graphql_client: self.graphql_client.clone(),
2789 }
2790 }
2791 pub fn from_opts<'a>(
2800 &self,
2801 address: impl Into<String>,
2802 opts: ContainerFromOpts<'a>,
2803 ) -> Container {
2804 let mut query = self.selection.select("from");
2805 query = query.arg("address", address.into());
2806 if let Some(version) = opts.version {
2807 query = query.arg("version", version);
2808 }
2809 if let Some(registry_service) = opts.registry_service {
2810 query = query.arg("registryService", registry_service);
2811 }
2812 if let Some(protocol) = opts.protocol {
2813 query = query.arg("protocol", protocol);
2814 }
2815 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
2816 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
2817 }
2818 Container {
2819 proc: self.proc.clone(),
2820 selection: query,
2821 graphql_client: self.graphql_client.clone(),
2822 }
2823 }
2824 pub async fn id(&self) -> Result<Id, DaggerError> {
2826 let query = self.selection.select("id");
2827 query.execute(self.graphql_client.clone()).await
2828 }
2829 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2831 let query = self.selection.select("imageRef");
2832 query.execute(self.graphql_client.clone()).await
2833 }
2834 pub fn import(&self, source: impl IntoID<Id>) -> Container {
2841 let mut query = self.selection.select("import");
2842 query = query.arg_lazy(
2843 "source",
2844 Box::new(move || {
2845 let source = source.clone();
2846 Box::pin(async move { source.into_id().await.unwrap().quote() })
2847 }),
2848 );
2849 Container {
2850 proc: self.proc.clone(),
2851 selection: query,
2852 graphql_client: self.graphql_client.clone(),
2853 }
2854 }
2855 pub fn import_opts<'a>(
2862 &self,
2863 source: impl IntoID<Id>,
2864 opts: ContainerImportOpts<'a>,
2865 ) -> Container {
2866 let mut query = self.selection.select("import");
2867 query = query.arg_lazy(
2868 "source",
2869 Box::new(move || {
2870 let source = source.clone();
2871 Box::pin(async move { source.into_id().await.unwrap().quote() })
2872 }),
2873 );
2874 if let Some(tag) = opts.tag {
2875 query = query.arg("tag", tag);
2876 }
2877 Container {
2878 proc: self.proc.clone(),
2879 selection: query,
2880 graphql_client: self.graphql_client.clone(),
2881 }
2882 }
2883 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2889 let mut query = self.selection.select("label");
2890 query = query.arg("name", name.into());
2891 query.execute(self.graphql_client.clone()).await
2892 }
2893 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2895 let query = self.selection.select("labels");
2896 let query = query.select("id");
2897 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2898 Ok(ids
2899 .into_iter()
2900 .map(|id| Label {
2901 proc: self.proc.clone(),
2902 selection: crate::querybuilder::query()
2903 .select("node")
2904 .arg("id", &id.0)
2905 .inline_fragment("Label"),
2906 graphql_client: self.graphql_client.clone(),
2907 })
2908 .collect())
2909 }
2910 pub fn layer(&self, id: impl Into<String>) -> File {
2917 let mut query = self.selection.select("layer");
2918 query = query.arg("id", id.into());
2919 File {
2920 proc: self.proc.clone(),
2921 selection: query,
2922 graphql_client: self.graphql_client.clone(),
2923 }
2924 }
2925 pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
2932 let mut query = self.selection.select("layer");
2933 query = query.arg("id", id.into());
2934 if let Some(forced_compression) = opts.forced_compression {
2935 query = query.arg("forcedCompression", forced_compression);
2936 }
2937 if let Some(media_types) = opts.media_types {
2938 query = query.arg("mediaTypes", media_types);
2939 }
2940 File {
2941 proc: self.proc.clone(),
2942 selection: query,
2943 graphql_client: self.graphql_client.clone(),
2944 }
2945 }
2946 pub fn manifest(&self) -> File {
2952 let query = self.selection.select("manifest");
2953 File {
2954 proc: self.proc.clone(),
2955 selection: query,
2956 graphql_client: self.graphql_client.clone(),
2957 }
2958 }
2959 pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
2965 let mut query = self.selection.select("manifest");
2966 if let Some(forced_compression) = opts.forced_compression {
2967 query = query.arg("forcedCompression", forced_compression);
2968 }
2969 if let Some(media_types) = opts.media_types {
2970 query = query.arg("mediaTypes", media_types);
2971 }
2972 File {
2973 proc: self.proc.clone(),
2974 selection: query,
2975 graphql_client: self.graphql_client.clone(),
2976 }
2977 }
2978 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2980 let query = self.selection.select("mounts");
2981 query.execute(self.graphql_client.clone()).await
2982 }
2983 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2985 let query = self.selection.select("platform");
2986 query.execute(self.graphql_client.clone()).await
2987 }
2988 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2998 let mut query = self.selection.select("publish");
2999 query = query.arg("address", address.into());
3000 query.execute(self.graphql_client.clone()).await
3001 }
3002 pub async fn publish_opts(
3012 &self,
3013 address: impl Into<String>,
3014 opts: ContainerPublishOpts,
3015 ) -> Result<String, DaggerError> {
3016 let mut query = self.selection.select("publish");
3017 query = query.arg("address", address.into());
3018 if let Some(platform_variants) = opts.platform_variants {
3019 query = query.arg("platformVariants", platform_variants);
3020 }
3021 if let Some(forced_compression) = opts.forced_compression {
3022 query = query.arg("forcedCompression", forced_compression);
3023 }
3024 if let Some(media_types) = opts.media_types {
3025 query = query.arg("mediaTypes", media_types);
3026 }
3027 if let Some(registry_service) = opts.registry_service {
3028 query = query.arg("registryService", registry_service);
3029 }
3030 if let Some(protocol) = opts.protocol {
3031 query = query.arg("protocol", protocol);
3032 }
3033 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
3034 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
3035 }
3036 query.execute(self.graphql_client.clone()).await
3037 }
3038 pub fn rootfs(&self) -> Directory {
3040 let query = self.selection.select("rootfs");
3041 Directory {
3042 proc: self.proc.clone(),
3043 selection: query,
3044 graphql_client: self.graphql_client.clone(),
3045 }
3046 }
3047 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
3054 let mut query = self.selection.select("stat");
3055 query = query.arg("path", path.into());
3056 let query = query.select("id");
3057 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
3058 Ok(id.map(|id| Stat {
3059 proc: self.proc.clone(),
3060 selection: query
3061 .root()
3062 .select("node")
3063 .arg("id", &id.0)
3064 .inline_fragment("Stat"),
3065 graphql_client: self.graphql_client.clone(),
3066 }))
3067 }
3068 pub async fn stat_opts(
3075 &self,
3076 path: impl Into<String>,
3077 opts: ContainerStatOpts,
3078 ) -> Result<Option<Stat>, DaggerError> {
3079 let mut query = self.selection.select("stat");
3080 query = query.arg("path", path.into());
3081 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3082 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3083 }
3084 let query = query.select("id");
3085 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
3086 Ok(id.map(|id| Stat {
3087 proc: self.proc.clone(),
3088 selection: query
3089 .root()
3090 .select("node")
3091 .arg("id", &id.0)
3092 .inline_fragment("Stat"),
3093 graphql_client: self.graphql_client.clone(),
3094 }))
3095 }
3096 pub async fn stderr(&self) -> Result<String, DaggerError> {
3099 let query = self.selection.select("stderr");
3100 query.execute(self.graphql_client.clone()).await
3101 }
3102 pub async fn stdout(&self) -> Result<String, DaggerError> {
3105 let query = self.selection.select("stdout");
3106 query.execute(self.graphql_client.clone()).await
3107 }
3108 pub async fn sync(&self) -> Result<Container, DaggerError> {
3111 let query = self.selection.select("sync");
3112 let id: Id = query.execute(self.graphql_client.clone()).await?;
3113 Ok(Container {
3114 proc: self.proc.clone(),
3115 selection: query
3116 .root()
3117 .select("node")
3118 .arg("id", &id.0)
3119 .inline_fragment("Container"),
3120 graphql_client: self.graphql_client.clone(),
3121 })
3122 }
3123 pub fn terminal(&self) -> Container {
3129 let query = self.selection.select("terminal");
3130 Container {
3131 proc: self.proc.clone(),
3132 selection: query,
3133 graphql_client: self.graphql_client.clone(),
3134 }
3135 }
3136 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3142 let mut query = self.selection.select("terminal");
3143 if let Some(cmd) = opts.cmd {
3144 query = query.arg("cmd", cmd);
3145 }
3146 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3147 query = query.arg(
3148 "experimentalPrivilegedNesting",
3149 experimental_privileged_nesting,
3150 );
3151 }
3152 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3153 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3154 }
3155 Container {
3156 proc: self.proc.clone(),
3157 selection: query,
3158 graphql_client: self.graphql_client.clone(),
3159 }
3160 }
3161 pub async fn up(&self) -> Result<Void, DaggerError> {
3168 let query = self.selection.select("up");
3169 query.execute(self.graphql_client.clone()).await
3170 }
3171 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3178 let mut query = self.selection.select("up");
3179 if let Some(random) = opts.random {
3180 query = query.arg("random", random);
3181 }
3182 if let Some(ports) = opts.ports {
3183 query = query.arg("ports", ports);
3184 }
3185 if let Some(args) = opts.args {
3186 query = query.arg("args", args);
3187 }
3188 if let Some(use_entrypoint) = opts.use_entrypoint {
3189 query = query.arg("useEntrypoint", use_entrypoint);
3190 }
3191 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3192 query = query.arg(
3193 "experimentalPrivilegedNesting",
3194 experimental_privileged_nesting,
3195 );
3196 }
3197 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3198 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3199 }
3200 if let Some(expand) = opts.expand {
3201 query = query.arg("expand", expand);
3202 }
3203 if let Some(no_init) = opts.no_init {
3204 query = query.arg("noInit", no_init);
3205 }
3206 query.execute(self.graphql_client.clone()).await
3207 }
3208 pub async fn user(&self) -> Result<String, DaggerError> {
3210 let query = self.selection.select("user");
3211 query.execute(self.graphql_client.clone()).await
3212 }
3213 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3220 let mut query = self.selection.select("withAnnotation");
3221 query = query.arg("name", name.into());
3222 query = query.arg("value", value.into());
3223 Container {
3224 proc: self.proc.clone(),
3225 selection: query,
3226 graphql_client: self.graphql_client.clone(),
3227 }
3228 }
3229 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3235 let mut query = self.selection.select("withDefaultArgs");
3236 query = query.arg(
3237 "args",
3238 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3239 );
3240 Container {
3241 proc: self.proc.clone(),
3242 selection: query,
3243 graphql_client: self.graphql_client.clone(),
3244 }
3245 }
3246 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3253 let mut query = self.selection.select("withDefaultTerminalCmd");
3254 query = query.arg(
3255 "args",
3256 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3257 );
3258 Container {
3259 proc: self.proc.clone(),
3260 selection: query,
3261 graphql_client: self.graphql_client.clone(),
3262 }
3263 }
3264 pub fn with_default_terminal_cmd_opts(
3271 &self,
3272 args: Vec<impl Into<String>>,
3273 opts: ContainerWithDefaultTerminalCmdOpts,
3274 ) -> Container {
3275 let mut query = self.selection.select("withDefaultTerminalCmd");
3276 query = query.arg(
3277 "args",
3278 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3279 );
3280 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3281 query = query.arg(
3282 "experimentalPrivilegedNesting",
3283 experimental_privileged_nesting,
3284 );
3285 }
3286 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3287 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3288 }
3289 Container {
3290 proc: self.proc.clone(),
3291 selection: query,
3292 graphql_client: self.graphql_client.clone(),
3293 }
3294 }
3295 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3303 let mut query = self.selection.select("withDirectory");
3304 query = query.arg("path", path.into());
3305 query = query.arg_lazy(
3306 "source",
3307 Box::new(move || {
3308 let source = source.clone();
3309 Box::pin(async move { source.into_id().await.unwrap().quote() })
3310 }),
3311 );
3312 Container {
3313 proc: self.proc.clone(),
3314 selection: query,
3315 graphql_client: self.graphql_client.clone(),
3316 }
3317 }
3318 pub fn with_directory_opts<'a>(
3326 &self,
3327 path: impl Into<String>,
3328 source: impl IntoID<Id>,
3329 opts: ContainerWithDirectoryOpts<'a>,
3330 ) -> Container {
3331 let mut query = self.selection.select("withDirectory");
3332 query = query.arg("path", path.into());
3333 query = query.arg_lazy(
3334 "source",
3335 Box::new(move || {
3336 let source = source.clone();
3337 Box::pin(async move { source.into_id().await.unwrap().quote() })
3338 }),
3339 );
3340 if let Some(exclude) = opts.exclude {
3341 query = query.arg("exclude", exclude);
3342 }
3343 if let Some(include) = opts.include {
3344 query = query.arg("include", include);
3345 }
3346 if let Some(gitignore) = opts.gitignore {
3347 query = query.arg("gitignore", gitignore);
3348 }
3349 if let Some(owner) = opts.owner {
3350 query = query.arg("owner", owner);
3351 }
3352 if let Some(inherit_owner) = opts.inherit_owner {
3353 query = query.arg("inheritOwner", inherit_owner);
3354 }
3355 if let Some(expand) = opts.expand {
3356 query = query.arg("expand", expand);
3357 }
3358 if let Some(permissions) = opts.permissions {
3359 query = query.arg("permissions", permissions);
3360 }
3361 Container {
3362 proc: self.proc.clone(),
3363 selection: query,
3364 graphql_client: self.graphql_client.clone(),
3365 }
3366 }
3367 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
3374 let mut query = self.selection.select("withDockerHealthcheck");
3375 query = query.arg(
3376 "args",
3377 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3378 );
3379 Container {
3380 proc: self.proc.clone(),
3381 selection: query,
3382 graphql_client: self.graphql_client.clone(),
3383 }
3384 }
3385 pub fn with_docker_healthcheck_opts<'a>(
3392 &self,
3393 args: Vec<impl Into<String>>,
3394 opts: ContainerWithDockerHealthcheckOpts<'a>,
3395 ) -> Container {
3396 let mut query = self.selection.select("withDockerHealthcheck");
3397 query = query.arg(
3398 "args",
3399 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3400 );
3401 if let Some(shell) = opts.shell {
3402 query = query.arg("shell", shell);
3403 }
3404 if let Some(interval) = opts.interval {
3405 query = query.arg("interval", interval);
3406 }
3407 if let Some(timeout) = opts.timeout {
3408 query = query.arg("timeout", timeout);
3409 }
3410 if let Some(start_period) = opts.start_period {
3411 query = query.arg("startPeriod", start_period);
3412 }
3413 if let Some(start_interval) = opts.start_interval {
3414 query = query.arg("startInterval", start_interval);
3415 }
3416 if let Some(retries) = opts.retries {
3417 query = query.arg("retries", retries);
3418 }
3419 Container {
3420 proc: self.proc.clone(),
3421 selection: query,
3422 graphql_client: self.graphql_client.clone(),
3423 }
3424 }
3425 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3432 let mut query = self.selection.select("withEntrypoint");
3433 query = query.arg(
3434 "args",
3435 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3436 );
3437 Container {
3438 proc: self.proc.clone(),
3439 selection: query,
3440 graphql_client: self.graphql_client.clone(),
3441 }
3442 }
3443 pub fn with_entrypoint_opts(
3450 &self,
3451 args: Vec<impl Into<String>>,
3452 opts: ContainerWithEntrypointOpts,
3453 ) -> Container {
3454 let mut query = self.selection.select("withEntrypoint");
3455 query = query.arg(
3456 "args",
3457 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3458 );
3459 if let Some(keep_default_args) = opts.keep_default_args {
3460 query = query.arg("keepDefaultArgs", keep_default_args);
3461 }
3462 Container {
3463 proc: self.proc.clone(),
3464 selection: query,
3465 graphql_client: self.graphql_client.clone(),
3466 }
3467 }
3468 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
3474 let mut query = self.selection.select("withEnvFileVariables");
3475 query = query.arg_lazy(
3476 "source",
3477 Box::new(move || {
3478 let source = source.clone();
3479 Box::pin(async move { source.into_id().await.unwrap().quote() })
3480 }),
3481 );
3482 Container {
3483 proc: self.proc.clone(),
3484 selection: query,
3485 graphql_client: self.graphql_client.clone(),
3486 }
3487 }
3488 pub fn with_env_variable(
3496 &self,
3497 name: impl Into<String>,
3498 value: impl Into<String>,
3499 ) -> Container {
3500 let mut query = self.selection.select("withEnvVariable");
3501 query = query.arg("name", name.into());
3502 query = query.arg("value", value.into());
3503 Container {
3504 proc: self.proc.clone(),
3505 selection: query,
3506 graphql_client: self.graphql_client.clone(),
3507 }
3508 }
3509 pub fn with_env_variable_opts(
3517 &self,
3518 name: impl Into<String>,
3519 value: impl Into<String>,
3520 opts: ContainerWithEnvVariableOpts,
3521 ) -> Container {
3522 let mut query = self.selection.select("withEnvVariable");
3523 query = query.arg("name", name.into());
3524 query = query.arg("value", value.into());
3525 if let Some(expand) = opts.expand {
3526 query = query.arg("expand", expand);
3527 }
3528 Container {
3529 proc: self.proc.clone(),
3530 selection: query,
3531 graphql_client: self.graphql_client.clone(),
3532 }
3533 }
3534 pub fn with_error(&self, err: impl Into<String>) -> Container {
3540 let mut query = self.selection.select("withError");
3541 query = query.arg("err", err.into());
3542 Container {
3543 proc: self.proc.clone(),
3544 selection: query,
3545 graphql_client: self.graphql_client.clone(),
3546 }
3547 }
3548 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3559 let mut query = self.selection.select("withExec");
3560 query = query.arg(
3561 "args",
3562 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3563 );
3564 Container {
3565 proc: self.proc.clone(),
3566 selection: query,
3567 graphql_client: self.graphql_client.clone(),
3568 }
3569 }
3570 pub fn with_exec_opts<'a>(
3581 &self,
3582 args: Vec<impl Into<String>>,
3583 opts: ContainerWithExecOpts<'a>,
3584 ) -> Container {
3585 let mut query = self.selection.select("withExec");
3586 query = query.arg(
3587 "args",
3588 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3589 );
3590 if let Some(use_entrypoint) = opts.use_entrypoint {
3591 query = query.arg("useEntrypoint", use_entrypoint);
3592 }
3593 if let Some(stdin) = opts.stdin {
3594 query = query.arg("stdin", stdin);
3595 }
3596 if let Some(redirect_stdin) = opts.redirect_stdin {
3597 query = query.arg("redirectStdin", redirect_stdin);
3598 }
3599 if let Some(redirect_stdout) = opts.redirect_stdout {
3600 query = query.arg("redirectStdout", redirect_stdout);
3601 }
3602 if let Some(redirect_stderr) = opts.redirect_stderr {
3603 query = query.arg("redirectStderr", redirect_stderr);
3604 }
3605 if let Some(expect) = opts.expect {
3606 query = query.arg("expect", expect);
3607 }
3608 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3609 query = query.arg(
3610 "experimentalPrivilegedNesting",
3611 experimental_privileged_nesting,
3612 );
3613 }
3614 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3615 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3616 }
3617 if let Some(expand) = opts.expand {
3618 query = query.arg("expand", expand);
3619 }
3620 if let Some(no_init) = opts.no_init {
3621 query = query.arg("noInit", no_init);
3622 }
3623 Container {
3624 proc: self.proc.clone(),
3625 selection: query,
3626 graphql_client: self.graphql_client.clone(),
3627 }
3628 }
3629 pub fn with_exposed_port(&self, port: isize) -> Container {
3639 let mut query = self.selection.select("withExposedPort");
3640 query = query.arg("port", port);
3641 Container {
3642 proc: self.proc.clone(),
3643 selection: query,
3644 graphql_client: self.graphql_client.clone(),
3645 }
3646 }
3647 pub fn with_exposed_port_opts<'a>(
3657 &self,
3658 port: isize,
3659 opts: ContainerWithExposedPortOpts<'a>,
3660 ) -> Container {
3661 let mut query = self.selection.select("withExposedPort");
3662 query = query.arg("port", port);
3663 if let Some(protocol) = opts.protocol {
3664 query = query.arg("protocol", protocol);
3665 }
3666 if let Some(description) = opts.description {
3667 query = query.arg("description", description);
3668 }
3669 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3670 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3671 }
3672 Container {
3673 proc: self.proc.clone(),
3674 selection: query,
3675 graphql_client: self.graphql_client.clone(),
3676 }
3677 }
3678 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3686 let mut query = self.selection.select("withFile");
3687 query = query.arg("path", path.into());
3688 query = query.arg_lazy(
3689 "source",
3690 Box::new(move || {
3691 let source = source.clone();
3692 Box::pin(async move { source.into_id().await.unwrap().quote() })
3693 }),
3694 );
3695 Container {
3696 proc: self.proc.clone(),
3697 selection: query,
3698 graphql_client: self.graphql_client.clone(),
3699 }
3700 }
3701 pub fn with_file_opts<'a>(
3709 &self,
3710 path: impl Into<String>,
3711 source: impl IntoID<Id>,
3712 opts: ContainerWithFileOpts<'a>,
3713 ) -> Container {
3714 let mut query = self.selection.select("withFile");
3715 query = query.arg("path", path.into());
3716 query = query.arg_lazy(
3717 "source",
3718 Box::new(move || {
3719 let source = source.clone();
3720 Box::pin(async move { source.into_id().await.unwrap().quote() })
3721 }),
3722 );
3723 if let Some(permissions) = opts.permissions {
3724 query = query.arg("permissions", permissions);
3725 }
3726 if let Some(owner) = opts.owner {
3727 query = query.arg("owner", owner);
3728 }
3729 if let Some(inherit_owner) = opts.inherit_owner {
3730 query = query.arg("inheritOwner", inherit_owner);
3731 }
3732 if let Some(expand) = opts.expand {
3733 query = query.arg("expand", expand);
3734 }
3735 Container {
3736 proc: self.proc.clone(),
3737 selection: query,
3738 graphql_client: self.graphql_client.clone(),
3739 }
3740 }
3741 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3749 let mut query = self.selection.select("withFiles");
3750 query = query.arg("path", path.into());
3751 query = query.arg("sources", sources);
3752 Container {
3753 proc: self.proc.clone(),
3754 selection: query,
3755 graphql_client: self.graphql_client.clone(),
3756 }
3757 }
3758 pub fn with_files_opts<'a>(
3766 &self,
3767 path: impl Into<String>,
3768 sources: Vec<Id>,
3769 opts: ContainerWithFilesOpts<'a>,
3770 ) -> Container {
3771 let mut query = self.selection.select("withFiles");
3772 query = query.arg("path", path.into());
3773 query = query.arg("sources", sources);
3774 if let Some(permissions) = opts.permissions {
3775 query = query.arg("permissions", permissions);
3776 }
3777 if let Some(owner) = opts.owner {
3778 query = query.arg("owner", owner);
3779 }
3780 if let Some(inherit_owner) = opts.inherit_owner {
3781 query = query.arg("inheritOwner", inherit_owner);
3782 }
3783 if let Some(expand) = opts.expand {
3784 query = query.arg("expand", expand);
3785 }
3786 Container {
3787 proc: self.proc.clone(),
3788 selection: query,
3789 graphql_client: self.graphql_client.clone(),
3790 }
3791 }
3792 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3799 let mut query = self.selection.select("withLabel");
3800 query = query.arg("name", name.into());
3801 query = query.arg("value", value.into());
3802 Container {
3803 proc: self.proc.clone(),
3804 selection: query,
3805 graphql_client: self.graphql_client.clone(),
3806 }
3807 }
3808 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3816 let mut query = self.selection.select("withMountedCache");
3817 query = query.arg("path", path.into());
3818 query = query.arg_lazy(
3819 "cache",
3820 Box::new(move || {
3821 let cache = cache.clone();
3822 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3823 }),
3824 );
3825 Container {
3826 proc: self.proc.clone(),
3827 selection: query,
3828 graphql_client: self.graphql_client.clone(),
3829 }
3830 }
3831 pub fn with_mounted_cache_opts<'a>(
3839 &self,
3840 path: impl Into<String>,
3841 cache: impl IntoID<Id>,
3842 opts: ContainerWithMountedCacheOpts<'a>,
3843 ) -> Container {
3844 let mut query = self.selection.select("withMountedCache");
3845 query = query.arg("path", path.into());
3846 query = query.arg_lazy(
3847 "cache",
3848 Box::new(move || {
3849 let cache = cache.clone();
3850 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3851 }),
3852 );
3853 if let Some(source) = opts.source {
3854 query = query.arg("source", source);
3855 }
3856 if let Some(sharing) = opts.sharing {
3857 query = query.arg("sharing", sharing);
3858 }
3859 if let Some(owner) = opts.owner {
3860 query = query.arg("owner", owner);
3861 }
3862 if let Some(inherit_owner) = opts.inherit_owner {
3863 query = query.arg("inheritOwner", inherit_owner);
3864 }
3865 if let Some(expand) = opts.expand {
3866 query = query.arg("expand", expand);
3867 }
3868 Container {
3869 proc: self.proc.clone(),
3870 selection: query,
3871 graphql_client: self.graphql_client.clone(),
3872 }
3873 }
3874 pub fn with_mounted_directory(
3882 &self,
3883 path: impl Into<String>,
3884 source: impl IntoID<Id>,
3885 ) -> Container {
3886 let mut query = self.selection.select("withMountedDirectory");
3887 query = query.arg("path", path.into());
3888 query = query.arg_lazy(
3889 "source",
3890 Box::new(move || {
3891 let source = source.clone();
3892 Box::pin(async move { source.into_id().await.unwrap().quote() })
3893 }),
3894 );
3895 Container {
3896 proc: self.proc.clone(),
3897 selection: query,
3898 graphql_client: self.graphql_client.clone(),
3899 }
3900 }
3901 pub fn with_mounted_directory_opts<'a>(
3909 &self,
3910 path: impl Into<String>,
3911 source: impl IntoID<Id>,
3912 opts: ContainerWithMountedDirectoryOpts<'a>,
3913 ) -> Container {
3914 let mut query = self.selection.select("withMountedDirectory");
3915 query = query.arg("path", path.into());
3916 query = query.arg_lazy(
3917 "source",
3918 Box::new(move || {
3919 let source = source.clone();
3920 Box::pin(async move { source.into_id().await.unwrap().quote() })
3921 }),
3922 );
3923 if let Some(owner) = opts.owner {
3924 query = query.arg("owner", owner);
3925 }
3926 if let Some(inherit_owner) = opts.inherit_owner {
3927 query = query.arg("inheritOwner", inherit_owner);
3928 }
3929 if let Some(read_only) = opts.read_only {
3930 query = query.arg("readOnly", read_only);
3931 }
3932 if let Some(expand) = opts.expand {
3933 query = query.arg("expand", expand);
3934 }
3935 Container {
3936 proc: self.proc.clone(),
3937 selection: query,
3938 graphql_client: self.graphql_client.clone(),
3939 }
3940 }
3941 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3949 let mut query = self.selection.select("withMountedFile");
3950 query = query.arg("path", path.into());
3951 query = query.arg_lazy(
3952 "source",
3953 Box::new(move || {
3954 let source = source.clone();
3955 Box::pin(async move { source.into_id().await.unwrap().quote() })
3956 }),
3957 );
3958 Container {
3959 proc: self.proc.clone(),
3960 selection: query,
3961 graphql_client: self.graphql_client.clone(),
3962 }
3963 }
3964 pub fn with_mounted_file_opts<'a>(
3972 &self,
3973 path: impl Into<String>,
3974 source: impl IntoID<Id>,
3975 opts: ContainerWithMountedFileOpts<'a>,
3976 ) -> Container {
3977 let mut query = self.selection.select("withMountedFile");
3978 query = query.arg("path", path.into());
3979 query = query.arg_lazy(
3980 "source",
3981 Box::new(move || {
3982 let source = source.clone();
3983 Box::pin(async move { source.into_id().await.unwrap().quote() })
3984 }),
3985 );
3986 if let Some(owner) = opts.owner {
3987 query = query.arg("owner", owner);
3988 }
3989 if let Some(inherit_owner) = opts.inherit_owner {
3990 query = query.arg("inheritOwner", inherit_owner);
3991 }
3992 if let Some(expand) = opts.expand {
3993 query = query.arg("expand", expand);
3994 }
3995 Container {
3996 proc: self.proc.clone(),
3997 selection: query,
3998 graphql_client: self.graphql_client.clone(),
3999 }
4000 }
4001 pub fn with_mounted_secret(
4009 &self,
4010 path: impl Into<String>,
4011 source: impl IntoID<Id>,
4012 ) -> Container {
4013 let mut query = self.selection.select("withMountedSecret");
4014 query = query.arg("path", path.into());
4015 query = query.arg_lazy(
4016 "source",
4017 Box::new(move || {
4018 let source = source.clone();
4019 Box::pin(async move { source.into_id().await.unwrap().quote() })
4020 }),
4021 );
4022 Container {
4023 proc: self.proc.clone(),
4024 selection: query,
4025 graphql_client: self.graphql_client.clone(),
4026 }
4027 }
4028 pub fn with_mounted_secret_opts<'a>(
4036 &self,
4037 path: impl Into<String>,
4038 source: impl IntoID<Id>,
4039 opts: ContainerWithMountedSecretOpts<'a>,
4040 ) -> Container {
4041 let mut query = self.selection.select("withMountedSecret");
4042 query = query.arg("path", path.into());
4043 query = query.arg_lazy(
4044 "source",
4045 Box::new(move || {
4046 let source = source.clone();
4047 Box::pin(async move { source.into_id().await.unwrap().quote() })
4048 }),
4049 );
4050 if let Some(owner) = opts.owner {
4051 query = query.arg("owner", owner);
4052 }
4053 if let Some(inherit_owner) = opts.inherit_owner {
4054 query = query.arg("inheritOwner", inherit_owner);
4055 }
4056 if let Some(mode) = opts.mode {
4057 query = query.arg("mode", mode);
4058 }
4059 if let Some(expand) = opts.expand {
4060 query = query.arg("expand", expand);
4061 }
4062 Container {
4063 proc: self.proc.clone(),
4064 selection: query,
4065 graphql_client: self.graphql_client.clone(),
4066 }
4067 }
4068 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4075 let mut query = self.selection.select("withMountedTemp");
4076 query = query.arg("path", path.into());
4077 Container {
4078 proc: self.proc.clone(),
4079 selection: query,
4080 graphql_client: self.graphql_client.clone(),
4081 }
4082 }
4083 pub fn with_mounted_temp_opts(
4090 &self,
4091 path: impl Into<String>,
4092 opts: ContainerWithMountedTempOpts,
4093 ) -> Container {
4094 let mut query = self.selection.select("withMountedTemp");
4095 query = query.arg("path", path.into());
4096 if let Some(size) = opts.size {
4097 query = query.arg("size", size);
4098 }
4099 if let Some(expand) = opts.expand {
4100 query = query.arg("expand", expand);
4101 }
4102 Container {
4103 proc: self.proc.clone(),
4104 selection: query,
4105 graphql_client: self.graphql_client.clone(),
4106 }
4107 }
4108 pub fn with_mounted_volume(
4116 &self,
4117 path: impl Into<String>,
4118 volume: impl IntoID<Id>,
4119 ) -> Container {
4120 let mut query = self.selection.select("withMountedVolume");
4121 query = query.arg("path", path.into());
4122 query = query.arg_lazy(
4123 "volume",
4124 Box::new(move || {
4125 let volume = volume.clone();
4126 Box::pin(async move { volume.into_id().await.unwrap().quote() })
4127 }),
4128 );
4129 Container {
4130 proc: self.proc.clone(),
4131 selection: query,
4132 graphql_client: self.graphql_client.clone(),
4133 }
4134 }
4135 pub fn with_mounted_volume_opts(
4143 &self,
4144 path: impl Into<String>,
4145 volume: impl IntoID<Id>,
4146 opts: ContainerWithMountedVolumeOpts,
4147 ) -> Container {
4148 let mut query = self.selection.select("withMountedVolume");
4149 query = query.arg("path", path.into());
4150 query = query.arg_lazy(
4151 "volume",
4152 Box::new(move || {
4153 let volume = volume.clone();
4154 Box::pin(async move { volume.into_id().await.unwrap().quote() })
4155 }),
4156 );
4157 if let Some(read_only) = opts.read_only {
4158 query = query.arg("readOnly", read_only);
4159 }
4160 if let Some(expand) = opts.expand {
4161 query = query.arg("expand", expand);
4162 }
4163 Container {
4164 proc: self.proc.clone(),
4165 selection: query,
4166 graphql_client: self.graphql_client.clone(),
4167 }
4168 }
4169 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4177 let mut query = self.selection.select("withNewFile");
4178 query = query.arg("path", path.into());
4179 query = query.arg("contents", contents.into());
4180 Container {
4181 proc: self.proc.clone(),
4182 selection: query,
4183 graphql_client: self.graphql_client.clone(),
4184 }
4185 }
4186 pub fn with_new_file_opts<'a>(
4194 &self,
4195 path: impl Into<String>,
4196 contents: impl Into<String>,
4197 opts: ContainerWithNewFileOpts<'a>,
4198 ) -> Container {
4199 let mut query = self.selection.select("withNewFile");
4200 query = query.arg("path", path.into());
4201 query = query.arg("contents", contents.into());
4202 if let Some(permissions) = opts.permissions {
4203 query = query.arg("permissions", permissions);
4204 }
4205 if let Some(owner) = opts.owner {
4206 query = query.arg("owner", owner);
4207 }
4208 if let Some(inherit_owner) = opts.inherit_owner {
4209 query = query.arg("inheritOwner", inherit_owner);
4210 }
4211 if let Some(expand) = opts.expand {
4212 query = query.arg("expand", expand);
4213 }
4214 Container {
4215 proc: self.proc.clone(),
4216 selection: query,
4217 graphql_client: self.graphql_client.clone(),
4218 }
4219 }
4220 pub fn with_registry_auth(
4228 &self,
4229 address: impl Into<String>,
4230 username: impl Into<String>,
4231 secret: impl IntoID<Id>,
4232 ) -> Container {
4233 let mut query = self.selection.select("withRegistryAuth");
4234 query = query.arg("address", address.into());
4235 query = query.arg("username", username.into());
4236 query = query.arg_lazy(
4237 "secret",
4238 Box::new(move || {
4239 let secret = secret.clone();
4240 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4241 }),
4242 );
4243 Container {
4244 proc: self.proc.clone(),
4245 selection: query,
4246 graphql_client: self.graphql_client.clone(),
4247 }
4248 }
4249 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
4255 let mut query = self.selection.select("withRootfs");
4256 query = query.arg_lazy(
4257 "directory",
4258 Box::new(move || {
4259 let directory = directory.clone();
4260 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4261 }),
4262 );
4263 Container {
4264 proc: self.proc.clone(),
4265 selection: query,
4266 graphql_client: self.graphql_client.clone(),
4267 }
4268 }
4269 pub fn with_secret_variable(
4276 &self,
4277 name: impl Into<String>,
4278 secret: impl IntoID<Id>,
4279 ) -> Container {
4280 let mut query = self.selection.select("withSecretVariable");
4281 query = query.arg("name", name.into());
4282 query = query.arg_lazy(
4283 "secret",
4284 Box::new(move || {
4285 let secret = secret.clone();
4286 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4287 }),
4288 );
4289 Container {
4290 proc: self.proc.clone(),
4291 selection: query,
4292 graphql_client: self.graphql_client.clone(),
4293 }
4294 }
4295 pub fn with_service_binding(
4305 &self,
4306 alias: impl Into<String>,
4307 service: impl IntoID<Id>,
4308 ) -> Container {
4309 let mut query = self.selection.select("withServiceBinding");
4310 query = query.arg("alias", alias.into());
4311 query = query.arg_lazy(
4312 "service",
4313 Box::new(move || {
4314 let service = service.clone();
4315 Box::pin(async move { service.into_id().await.unwrap().quote() })
4316 }),
4317 );
4318 Container {
4319 proc: self.proc.clone(),
4320 selection: query,
4321 graphql_client: self.graphql_client.clone(),
4322 }
4323 }
4324 pub fn with_symlink(
4332 &self,
4333 target: impl Into<String>,
4334 link_name: impl Into<String>,
4335 ) -> Container {
4336 let mut query = self.selection.select("withSymlink");
4337 query = query.arg("target", target.into());
4338 query = query.arg("linkName", link_name.into());
4339 Container {
4340 proc: self.proc.clone(),
4341 selection: query,
4342 graphql_client: self.graphql_client.clone(),
4343 }
4344 }
4345 pub fn with_symlink_opts(
4353 &self,
4354 target: impl Into<String>,
4355 link_name: impl Into<String>,
4356 opts: ContainerWithSymlinkOpts,
4357 ) -> Container {
4358 let mut query = self.selection.select("withSymlink");
4359 query = query.arg("target", target.into());
4360 query = query.arg("linkName", link_name.into());
4361 if let Some(expand) = opts.expand {
4362 query = query.arg("expand", expand);
4363 }
4364 Container {
4365 proc: self.proc.clone(),
4366 selection: query,
4367 graphql_client: self.graphql_client.clone(),
4368 }
4369 }
4370 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4378 let mut query = self.selection.select("withUnixSocket");
4379 query = query.arg("path", path.into());
4380 query = query.arg_lazy(
4381 "source",
4382 Box::new(move || {
4383 let source = source.clone();
4384 Box::pin(async move { source.into_id().await.unwrap().quote() })
4385 }),
4386 );
4387 Container {
4388 proc: self.proc.clone(),
4389 selection: query,
4390 graphql_client: self.graphql_client.clone(),
4391 }
4392 }
4393 pub fn with_unix_socket_opts<'a>(
4401 &self,
4402 path: impl Into<String>,
4403 source: impl IntoID<Id>,
4404 opts: ContainerWithUnixSocketOpts<'a>,
4405 ) -> Container {
4406 let mut query = self.selection.select("withUnixSocket");
4407 query = query.arg("path", path.into());
4408 query = query.arg_lazy(
4409 "source",
4410 Box::new(move || {
4411 let source = source.clone();
4412 Box::pin(async move { source.into_id().await.unwrap().quote() })
4413 }),
4414 );
4415 if let Some(owner) = opts.owner {
4416 query = query.arg("owner", owner);
4417 }
4418 if let Some(inherit_owner) = opts.inherit_owner {
4419 query = query.arg("inheritOwner", inherit_owner);
4420 }
4421 if let Some(expand) = opts.expand {
4422 query = query.arg("expand", expand);
4423 }
4424 Container {
4425 proc: self.proc.clone(),
4426 selection: query,
4427 graphql_client: self.graphql_client.clone(),
4428 }
4429 }
4430 pub fn with_user(&self, name: impl Into<String>) -> Container {
4436 let mut query = self.selection.select("withUser");
4437 query = query.arg("name", name.into());
4438 Container {
4439 proc: self.proc.clone(),
4440 selection: query,
4441 graphql_client: self.graphql_client.clone(),
4442 }
4443 }
4444 pub fn with_volatile_variable(
4452 &self,
4453 name: impl Into<String>,
4454 value: impl Into<String>,
4455 ) -> Container {
4456 let mut query = self.selection.select("withVolatileVariable");
4457 query = query.arg("name", name.into());
4458 query = query.arg("value", value.into());
4459 Container {
4460 proc: self.proc.clone(),
4461 selection: query,
4462 graphql_client: self.graphql_client.clone(),
4463 }
4464 }
4465 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4472 let mut query = self.selection.select("withWorkdir");
4473 query = query.arg("path", path.into());
4474 Container {
4475 proc: self.proc.clone(),
4476 selection: query,
4477 graphql_client: self.graphql_client.clone(),
4478 }
4479 }
4480 pub fn with_workdir_opts(
4487 &self,
4488 path: impl Into<String>,
4489 opts: ContainerWithWorkdirOpts,
4490 ) -> Container {
4491 let mut query = self.selection.select("withWorkdir");
4492 query = query.arg("path", path.into());
4493 if let Some(expand) = opts.expand {
4494 query = query.arg("expand", expand);
4495 }
4496 Container {
4497 proc: self.proc.clone(),
4498 selection: query,
4499 graphql_client: self.graphql_client.clone(),
4500 }
4501 }
4502 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4508 let mut query = self.selection.select("withoutAnnotation");
4509 query = query.arg("name", name.into());
4510 Container {
4511 proc: self.proc.clone(),
4512 selection: query,
4513 graphql_client: self.graphql_client.clone(),
4514 }
4515 }
4516 pub fn without_default_args(&self) -> Container {
4518 let query = self.selection.select("withoutDefaultArgs");
4519 Container {
4520 proc: self.proc.clone(),
4521 selection: query,
4522 graphql_client: self.graphql_client.clone(),
4523 }
4524 }
4525 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4532 let mut query = self.selection.select("withoutDirectory");
4533 query = query.arg("path", path.into());
4534 Container {
4535 proc: self.proc.clone(),
4536 selection: query,
4537 graphql_client: self.graphql_client.clone(),
4538 }
4539 }
4540 pub fn without_directory_opts(
4547 &self,
4548 path: impl Into<String>,
4549 opts: ContainerWithoutDirectoryOpts,
4550 ) -> Container {
4551 let mut query = self.selection.select("withoutDirectory");
4552 query = query.arg("path", path.into());
4553 if let Some(expand) = opts.expand {
4554 query = query.arg("expand", expand);
4555 }
4556 Container {
4557 proc: self.proc.clone(),
4558 selection: query,
4559 graphql_client: self.graphql_client.clone(),
4560 }
4561 }
4562 pub fn without_docker_healthcheck(&self) -> Container {
4564 let query = self.selection.select("withoutDockerHealthcheck");
4565 Container {
4566 proc: self.proc.clone(),
4567 selection: query,
4568 graphql_client: self.graphql_client.clone(),
4569 }
4570 }
4571 pub fn without_entrypoint(&self) -> Container {
4577 let query = self.selection.select("withoutEntrypoint");
4578 Container {
4579 proc: self.proc.clone(),
4580 selection: query,
4581 graphql_client: self.graphql_client.clone(),
4582 }
4583 }
4584 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4590 let mut query = self.selection.select("withoutEntrypoint");
4591 if let Some(keep_default_args) = opts.keep_default_args {
4592 query = query.arg("keepDefaultArgs", keep_default_args);
4593 }
4594 Container {
4595 proc: self.proc.clone(),
4596 selection: query,
4597 graphql_client: self.graphql_client.clone(),
4598 }
4599 }
4600 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4606 let mut query = self.selection.select("withoutEnvVariable");
4607 query = query.arg("name", name.into());
4608 Container {
4609 proc: self.proc.clone(),
4610 selection: query,
4611 graphql_client: self.graphql_client.clone(),
4612 }
4613 }
4614 pub fn without_exposed_port(&self, port: isize) -> Container {
4621 let mut query = self.selection.select("withoutExposedPort");
4622 query = query.arg("port", port);
4623 Container {
4624 proc: self.proc.clone(),
4625 selection: query,
4626 graphql_client: self.graphql_client.clone(),
4627 }
4628 }
4629 pub fn without_exposed_port_opts(
4636 &self,
4637 port: isize,
4638 opts: ContainerWithoutExposedPortOpts,
4639 ) -> Container {
4640 let mut query = self.selection.select("withoutExposedPort");
4641 query = query.arg("port", port);
4642 if let Some(protocol) = opts.protocol {
4643 query = query.arg("protocol", protocol);
4644 }
4645 Container {
4646 proc: self.proc.clone(),
4647 selection: query,
4648 graphql_client: self.graphql_client.clone(),
4649 }
4650 }
4651 pub fn without_file(&self, path: impl Into<String>) -> Container {
4658 let mut query = self.selection.select("withoutFile");
4659 query = query.arg("path", path.into());
4660 Container {
4661 proc: self.proc.clone(),
4662 selection: query,
4663 graphql_client: self.graphql_client.clone(),
4664 }
4665 }
4666 pub fn without_file_opts(
4673 &self,
4674 path: impl Into<String>,
4675 opts: ContainerWithoutFileOpts,
4676 ) -> Container {
4677 let mut query = self.selection.select("withoutFile");
4678 query = query.arg("path", path.into());
4679 if let Some(expand) = opts.expand {
4680 query = query.arg("expand", expand);
4681 }
4682 Container {
4683 proc: self.proc.clone(),
4684 selection: query,
4685 graphql_client: self.graphql_client.clone(),
4686 }
4687 }
4688 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4695 let mut query = self.selection.select("withoutFiles");
4696 query = query.arg(
4697 "paths",
4698 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4699 );
4700 Container {
4701 proc: self.proc.clone(),
4702 selection: query,
4703 graphql_client: self.graphql_client.clone(),
4704 }
4705 }
4706 pub fn without_files_opts(
4713 &self,
4714 paths: Vec<impl Into<String>>,
4715 opts: ContainerWithoutFilesOpts,
4716 ) -> Container {
4717 let mut query = self.selection.select("withoutFiles");
4718 query = query.arg(
4719 "paths",
4720 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4721 );
4722 if let Some(expand) = opts.expand {
4723 query = query.arg("expand", expand);
4724 }
4725 Container {
4726 proc: self.proc.clone(),
4727 selection: query,
4728 graphql_client: self.graphql_client.clone(),
4729 }
4730 }
4731 pub fn without_label(&self, name: impl Into<String>) -> Container {
4737 let mut query = self.selection.select("withoutLabel");
4738 query = query.arg("name", name.into());
4739 Container {
4740 proc: self.proc.clone(),
4741 selection: query,
4742 graphql_client: self.graphql_client.clone(),
4743 }
4744 }
4745 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4752 let mut query = self.selection.select("withoutMount");
4753 query = query.arg("path", path.into());
4754 Container {
4755 proc: self.proc.clone(),
4756 selection: query,
4757 graphql_client: self.graphql_client.clone(),
4758 }
4759 }
4760 pub fn without_mount_opts(
4767 &self,
4768 path: impl Into<String>,
4769 opts: ContainerWithoutMountOpts,
4770 ) -> Container {
4771 let mut query = self.selection.select("withoutMount");
4772 query = query.arg("path", path.into());
4773 if let Some(expand) = opts.expand {
4774 query = query.arg("expand", expand);
4775 }
4776 Container {
4777 proc: self.proc.clone(),
4778 selection: query,
4779 graphql_client: self.graphql_client.clone(),
4780 }
4781 }
4782 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4790 let mut query = self.selection.select("withoutRegistryAuth");
4791 query = query.arg("address", address.into());
4792 Container {
4793 proc: self.proc.clone(),
4794 selection: query,
4795 graphql_client: self.graphql_client.clone(),
4796 }
4797 }
4798 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4804 let mut query = self.selection.select("withoutSecretVariable");
4805 query = query.arg("name", name.into());
4806 Container {
4807 proc: self.proc.clone(),
4808 selection: query,
4809 graphql_client: self.graphql_client.clone(),
4810 }
4811 }
4812 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4819 let mut query = self.selection.select("withoutUnixSocket");
4820 query = query.arg("path", path.into());
4821 Container {
4822 proc: self.proc.clone(),
4823 selection: query,
4824 graphql_client: self.graphql_client.clone(),
4825 }
4826 }
4827 pub fn without_unix_socket_opts(
4834 &self,
4835 path: impl Into<String>,
4836 opts: ContainerWithoutUnixSocketOpts,
4837 ) -> Container {
4838 let mut query = self.selection.select("withoutUnixSocket");
4839 query = query.arg("path", path.into());
4840 if let Some(expand) = opts.expand {
4841 query = query.arg("expand", expand);
4842 }
4843 Container {
4844 proc: self.proc.clone(),
4845 selection: query,
4846 graphql_client: self.graphql_client.clone(),
4847 }
4848 }
4849 pub fn without_user(&self) -> Container {
4852 let query = self.selection.select("withoutUser");
4853 Container {
4854 proc: self.proc.clone(),
4855 selection: query,
4856 graphql_client: self.graphql_client.clone(),
4857 }
4858 }
4859 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4865 let mut query = self.selection.select("withoutVolatileVariable");
4866 query = query.arg("name", name.into());
4867 Container {
4868 proc: self.proc.clone(),
4869 selection: query,
4870 graphql_client: self.graphql_client.clone(),
4871 }
4872 }
4873 pub fn without_workdir(&self) -> Container {
4876 let query = self.selection.select("withoutWorkdir");
4877 Container {
4878 proc: self.proc.clone(),
4879 selection: query,
4880 graphql_client: self.graphql_client.clone(),
4881 }
4882 }
4883 pub async fn workdir(&self) -> Result<String, DaggerError> {
4885 let query = self.selection.select("workdir");
4886 query.execute(self.graphql_client.clone()).await
4887 }
4888}
4889impl Exportable for Container {
4890 fn export(
4891 &self,
4892 path: impl Into<String>,
4893 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4894 let mut query = self.selection.select("export");
4895 query = query.arg("path", path.into());
4896 let graphql_client = self.graphql_client.clone();
4897 async move { query.execute(graphql_client).await }
4898 }
4899 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4900 let query = self.selection.select("id");
4901 let graphql_client = self.graphql_client.clone();
4902 async move { query.execute(graphql_client).await }
4903 }
4904}
4905impl Node for Container {
4906 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4907 let query = self.selection.select("id");
4908 let graphql_client = self.graphql_client.clone();
4909 async move { query.execute(graphql_client).await }
4910 }
4911}
4912impl Syncer for Container {
4913 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4914 let query = self.selection.select("id");
4915 let graphql_client = self.graphql_client.clone();
4916 async move { query.execute(graphql_client).await }
4917 }
4918 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
4919 let query = self.selection.select("sync");
4920 let proc = self.proc.clone();
4921 let graphql_client = self.graphql_client.clone();
4922 async move {
4923 let id: Id = query.execute(graphql_client.clone()).await?;
4924 Ok(Self {
4925 proc,
4926 selection: query
4927 .root()
4928 .select("node")
4929 .arg("id", &id.0)
4930 .inline_fragment("Container"),
4931 graphql_client,
4932 })
4933 }
4934 }
4935}
4936#[derive(Clone)]
4937pub struct CurrentModule {
4938 pub proc: Option<Arc<DaggerSessionProc>>,
4939 pub selection: Selection,
4940 pub graphql_client: DynGraphQLClient,
4941}
4942#[derive(Builder, Debug, PartialEq)]
4943pub struct CurrentModuleGeneratorsOpts<'a> {
4944 #[builder(setter(into, strip_option), default)]
4946 pub include: Option<Vec<&'a str>>,
4947}
4948#[derive(Builder, Debug, PartialEq)]
4949pub struct CurrentModuleWorkdirOpts<'a> {
4950 #[builder(setter(into, strip_option), default)]
4952 pub exclude: Option<Vec<&'a str>>,
4953 #[builder(setter(into, strip_option), default)]
4955 pub gitignore: Option<bool>,
4956 #[builder(setter(into, strip_option), default)]
4958 pub include: Option<Vec<&'a str>>,
4959}
4960impl IntoID<Id> for CurrentModule {
4961 fn into_id(
4962 self,
4963 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4964 Box::pin(async move { self.id().await })
4965 }
4966}
4967impl Loadable for CurrentModule {
4968 fn graphql_type() -> &'static str {
4969 "CurrentModule"
4970 }
4971 fn from_query(
4972 proc: Option<Arc<DaggerSessionProc>>,
4973 selection: Selection,
4974 graphql_client: DynGraphQLClient,
4975 ) -> Self {
4976 Self {
4977 proc,
4978 selection,
4979 graphql_client,
4980 }
4981 }
4982}
4983impl CurrentModule {
4984 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4986 let query = self.selection.select("dependencies");
4987 let query = query.select("id");
4988 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4989 Ok(ids
4990 .into_iter()
4991 .map(|id| Module {
4992 proc: self.proc.clone(),
4993 selection: crate::querybuilder::query()
4994 .select("node")
4995 .arg("id", &id.0)
4996 .inline_fragment("Module"),
4997 graphql_client: self.graphql_client.clone(),
4998 })
4999 .collect())
5000 }
5001 pub fn generated_context_directory(&self) -> Directory {
5003 let query = self.selection.select("generatedContextDirectory");
5004 Directory {
5005 proc: self.proc.clone(),
5006 selection: query,
5007 graphql_client: self.graphql_client.clone(),
5008 }
5009 }
5010 pub fn generators(&self) -> GeneratorGroup {
5016 let query = self.selection.select("generators");
5017 GeneratorGroup {
5018 proc: self.proc.clone(),
5019 selection: query,
5020 graphql_client: self.graphql_client.clone(),
5021 }
5022 }
5023 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
5029 let mut query = self.selection.select("generators");
5030 if let Some(include) = opts.include {
5031 query = query.arg("include", include);
5032 }
5033 GeneratorGroup {
5034 proc: self.proc.clone(),
5035 selection: query,
5036 graphql_client: self.graphql_client.clone(),
5037 }
5038 }
5039 pub async fn id(&self) -> Result<Id, DaggerError> {
5041 let query = self.selection.select("id");
5042 query.execute(self.graphql_client.clone()).await
5043 }
5044 pub async fn name(&self) -> Result<String, DaggerError> {
5046 let query = self.selection.select("name");
5047 query.execute(self.graphql_client.clone()).await
5048 }
5049 pub fn source(&self) -> Directory {
5051 let query = self.selection.select("source");
5052 Directory {
5053 proc: self.proc.clone(),
5054 selection: query,
5055 graphql_client: self.graphql_client.clone(),
5056 }
5057 }
5058 pub fn workdir(&self, path: impl Into<String>) -> Directory {
5065 let mut query = self.selection.select("workdir");
5066 query = query.arg("path", path.into());
5067 Directory {
5068 proc: self.proc.clone(),
5069 selection: query,
5070 graphql_client: self.graphql_client.clone(),
5071 }
5072 }
5073 pub fn workdir_opts<'a>(
5080 &self,
5081 path: impl Into<String>,
5082 opts: CurrentModuleWorkdirOpts<'a>,
5083 ) -> Directory {
5084 let mut query = self.selection.select("workdir");
5085 query = query.arg("path", path.into());
5086 if let Some(exclude) = opts.exclude {
5087 query = query.arg("exclude", exclude);
5088 }
5089 if let Some(include) = opts.include {
5090 query = query.arg("include", include);
5091 }
5092 if let Some(gitignore) = opts.gitignore {
5093 query = query.arg("gitignore", gitignore);
5094 }
5095 Directory {
5096 proc: self.proc.clone(),
5097 selection: query,
5098 graphql_client: self.graphql_client.clone(),
5099 }
5100 }
5101 pub fn workdir_file(&self, path: impl Into<String>) -> File {
5107 let mut query = self.selection.select("workdirFile");
5108 query = query.arg("path", path.into());
5109 File {
5110 proc: self.proc.clone(),
5111 selection: query,
5112 graphql_client: self.graphql_client.clone(),
5113 }
5114 }
5115}
5116impl Node for CurrentModule {
5117 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5118 let query = self.selection.select("id");
5119 let graphql_client = self.graphql_client.clone();
5120 async move { query.execute(graphql_client).await }
5121 }
5122}
5123#[derive(Clone)]
5124pub struct DiffStat {
5125 pub proc: Option<Arc<DaggerSessionProc>>,
5126 pub selection: Selection,
5127 pub graphql_client: DynGraphQLClient,
5128}
5129impl IntoID<Id> for DiffStat {
5130 fn into_id(
5131 self,
5132 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5133 Box::pin(async move { self.id().await })
5134 }
5135}
5136impl Loadable for DiffStat {
5137 fn graphql_type() -> &'static str {
5138 "DiffStat"
5139 }
5140 fn from_query(
5141 proc: Option<Arc<DaggerSessionProc>>,
5142 selection: Selection,
5143 graphql_client: DynGraphQLClient,
5144 ) -> Self {
5145 Self {
5146 proc,
5147 selection,
5148 graphql_client,
5149 }
5150 }
5151}
5152impl DiffStat {
5153 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
5155 let query = self.selection.select("addedLines");
5156 query.execute(self.graphql_client.clone()).await
5157 }
5158 pub async fn id(&self) -> Result<Id, DaggerError> {
5160 let query = self.selection.select("id");
5161 query.execute(self.graphql_client.clone()).await
5162 }
5163 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
5165 let query = self.selection.select("kind");
5166 query.execute(self.graphql_client.clone()).await
5167 }
5168 pub async fn old_path(&self) -> Result<String, DaggerError> {
5170 let query = self.selection.select("oldPath");
5171 query.execute(self.graphql_client.clone()).await
5172 }
5173 pub async fn path(&self) -> Result<String, DaggerError> {
5175 let query = self.selection.select("path");
5176 query.execute(self.graphql_client.clone()).await
5177 }
5178 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
5180 let query = self.selection.select("removedLines");
5181 query.execute(self.graphql_client.clone()).await
5182 }
5183}
5184impl Node for DiffStat {
5185 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5186 let query = self.selection.select("id");
5187 let graphql_client = self.graphql_client.clone();
5188 async move { query.execute(graphql_client).await }
5189 }
5190}
5191#[derive(Clone)]
5192pub struct Directory {
5193 pub proc: Option<Arc<DaggerSessionProc>>,
5194 pub selection: Selection,
5195 pub graphql_client: DynGraphQLClient,
5196}
5197#[derive(Builder, Debug, PartialEq)]
5198pub struct DirectoryAsModuleOpts<'a> {
5199 #[builder(setter(into, strip_option), default)]
5202 pub source_root_path: Option<&'a str>,
5203}
5204#[derive(Builder, Debug, PartialEq)]
5205pub struct DirectoryAsModuleSourceOpts<'a> {
5206 #[builder(setter(into, strip_option), default)]
5209 pub source_root_path: Option<&'a str>,
5210}
5211#[derive(Builder, Debug, PartialEq)]
5212pub struct DirectoryAsWorkspaceOpts<'a> {
5213 #[builder(setter(into, strip_option), default)]
5215 pub cwd: Option<&'a str>,
5216}
5217#[derive(Builder, Debug, PartialEq)]
5218pub struct DirectoryDockerBuildOpts<'a> {
5219 #[builder(setter(into, strip_option), default)]
5221 pub build_args: Option<Vec<BuildArg>>,
5222 #[builder(setter(into, strip_option), default)]
5224 pub dockerfile: Option<&'a str>,
5225 #[builder(setter(into, strip_option), default)]
5228 pub no_init: Option<bool>,
5229 #[builder(setter(into, strip_option), default)]
5231 pub platform: Option<Platform>,
5232 #[builder(setter(into, strip_option), default)]
5235 pub secrets: Option<Vec<Id>>,
5236 #[builder(setter(into, strip_option), default)]
5240 pub ssh: Option<Id>,
5241 #[builder(setter(into, strip_option), default)]
5243 pub target: Option<&'a str>,
5244}
5245#[derive(Builder, Debug, PartialEq)]
5246pub struct DirectoryEntriesOpts<'a> {
5247 #[builder(setter(into, strip_option), default)]
5249 pub path: Option<&'a str>,
5250}
5251#[derive(Builder, Debug, PartialEq)]
5252pub struct DirectoryExistsOpts {
5253 #[builder(setter(into, strip_option), default)]
5255 pub do_not_follow_symlinks: Option<bool>,
5256 #[builder(setter(into, strip_option), default)]
5258 pub expected_type: Option<ExistsType>,
5259}
5260#[derive(Builder, Debug, PartialEq)]
5261pub struct DirectoryExportOpts {
5262 #[builder(setter(into, strip_option), default)]
5264 pub wipe: Option<bool>,
5265}
5266#[derive(Builder, Debug, PartialEq)]
5267pub struct DirectoryFilterOpts<'a> {
5268 #[builder(setter(into, strip_option), default)]
5270 pub exclude: Option<Vec<&'a str>>,
5271 #[builder(setter(into, strip_option), default)]
5273 pub gitignore: Option<bool>,
5274 #[builder(setter(into, strip_option), default)]
5276 pub include: Option<Vec<&'a str>>,
5277}
5278#[derive(Builder, Debug, PartialEq)]
5279pub struct DirectorySearchOpts<'a> {
5280 #[builder(setter(into, strip_option), default)]
5282 pub dotall: Option<bool>,
5283 #[builder(setter(into, strip_option), default)]
5285 pub files_only: Option<bool>,
5286 #[builder(setter(into, strip_option), default)]
5288 pub globs: Option<Vec<&'a str>>,
5289 #[builder(setter(into, strip_option), default)]
5291 pub insensitive: Option<bool>,
5292 #[builder(setter(into, strip_option), default)]
5294 pub limit: Option<isize>,
5295 #[builder(setter(into, strip_option), default)]
5297 pub literal: Option<bool>,
5298 #[builder(setter(into, strip_option), default)]
5300 pub multiline: Option<bool>,
5301 #[builder(setter(into, strip_option), default)]
5303 pub paths: Option<Vec<&'a str>>,
5304 #[builder(setter(into, strip_option), default)]
5306 pub skip_hidden: Option<bool>,
5307 #[builder(setter(into, strip_option), default)]
5309 pub skip_ignored: Option<bool>,
5310}
5311#[derive(Builder, Debug, PartialEq)]
5312pub struct DirectoryStatOpts {
5313 #[builder(setter(into, strip_option), default)]
5315 pub do_not_follow_symlinks: Option<bool>,
5316}
5317#[derive(Builder, Debug, PartialEq)]
5318pub struct DirectoryTerminalOpts<'a> {
5319 #[builder(setter(into, strip_option), default)]
5321 pub cmd: Option<Vec<&'a str>>,
5322 #[builder(setter(into, strip_option), default)]
5324 pub container: Option<Id>,
5325 #[builder(setter(into, strip_option), default)]
5327 pub experimental_privileged_nesting: Option<bool>,
5328 #[builder(setter(into, strip_option), default)]
5330 pub insecure_root_capabilities: Option<bool>,
5331}
5332#[derive(Builder, Debug, PartialEq)]
5333pub struct DirectoryWithDirectoryOpts<'a> {
5334 #[builder(setter(into, strip_option), default)]
5336 pub exclude: Option<Vec<&'a str>>,
5337 #[builder(setter(into, strip_option), default)]
5339 pub gitignore: Option<bool>,
5340 #[builder(setter(into, strip_option), default)]
5342 pub include: Option<Vec<&'a str>>,
5343 #[builder(setter(into, strip_option), default)]
5347 pub owner: Option<&'a str>,
5348 #[builder(setter(into, strip_option), default)]
5350 pub permissions: Option<isize>,
5351}
5352#[derive(Builder, Debug, PartialEq)]
5353pub struct DirectoryWithFileOpts<'a> {
5354 #[builder(setter(into, strip_option), default)]
5358 pub owner: Option<&'a str>,
5359 #[builder(setter(into, strip_option), default)]
5361 pub permissions: Option<isize>,
5362}
5363#[derive(Builder, Debug, PartialEq)]
5364pub struct DirectoryWithFilesOpts {
5365 #[builder(setter(into, strip_option), default)]
5367 pub permissions: Option<isize>,
5368}
5369#[derive(Builder, Debug, PartialEq)]
5370pub struct DirectoryWithNewDirectoryOpts {
5371 #[builder(setter(into, strip_option), default)]
5373 pub permissions: Option<isize>,
5374}
5375#[derive(Builder, Debug, PartialEq)]
5376pub struct DirectoryWithNewFileOpts {
5377 #[builder(setter(into, strip_option), default)]
5379 pub permissions: Option<isize>,
5380}
5381#[derive(Builder, Debug, PartialEq)]
5382pub struct DirectoryWithPatchOpts {
5383 #[builder(setter(into, strip_option), default)]
5385 pub on_conflict: Option<PatchConflict>,
5386}
5387#[derive(Builder, Debug, PartialEq)]
5388pub struct DirectoryWithPatchFileOpts {
5389 #[builder(setter(into, strip_option), default)]
5391 pub on_conflict: Option<PatchConflict>,
5392}
5393impl IntoID<Id> for Directory {
5394 fn into_id(
5395 self,
5396 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5397 Box::pin(async move { self.id().await })
5398 }
5399}
5400impl Loadable for Directory {
5401 fn graphql_type() -> &'static str {
5402 "Directory"
5403 }
5404 fn from_query(
5405 proc: Option<Arc<DaggerSessionProc>>,
5406 selection: Selection,
5407 graphql_client: DynGraphQLClient,
5408 ) -> Self {
5409 Self {
5410 proc,
5411 selection,
5412 graphql_client,
5413 }
5414 }
5415}
5416impl Directory {
5417 pub fn as_git(&self) -> GitRepository {
5419 let query = self.selection.select("asGit");
5420 GitRepository {
5421 proc: self.proc.clone(),
5422 selection: query,
5423 graphql_client: self.graphql_client.clone(),
5424 }
5425 }
5426 pub fn as_module(&self) -> Module {
5432 let query = self.selection.select("asModule");
5433 Module {
5434 proc: self.proc.clone(),
5435 selection: query,
5436 graphql_client: self.graphql_client.clone(),
5437 }
5438 }
5439 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5445 let mut query = self.selection.select("asModule");
5446 if let Some(source_root_path) = opts.source_root_path {
5447 query = query.arg("sourceRootPath", source_root_path);
5448 }
5449 Module {
5450 proc: self.proc.clone(),
5451 selection: query,
5452 graphql_client: self.graphql_client.clone(),
5453 }
5454 }
5455 pub fn as_module_source(&self) -> ModuleSource {
5461 let query = self.selection.select("asModuleSource");
5462 ModuleSource {
5463 proc: self.proc.clone(),
5464 selection: query,
5465 graphql_client: self.graphql_client.clone(),
5466 }
5467 }
5468 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5474 let mut query = self.selection.select("asModuleSource");
5475 if let Some(source_root_path) = opts.source_root_path {
5476 query = query.arg("sourceRootPath", source_root_path);
5477 }
5478 ModuleSource {
5479 proc: self.proc.clone(),
5480 selection: query,
5481 graphql_client: self.graphql_client.clone(),
5482 }
5483 }
5484 pub fn as_workspace(&self) -> Workspace {
5490 let query = self.selection.select("asWorkspace");
5491 Workspace {
5492 proc: self.proc.clone(),
5493 selection: query,
5494 graphql_client: self.graphql_client.clone(),
5495 }
5496 }
5497 pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
5503 let mut query = self.selection.select("asWorkspace");
5504 if let Some(cwd) = opts.cwd {
5505 query = query.arg("cwd", cwd);
5506 }
5507 Workspace {
5508 proc: self.proc.clone(),
5509 selection: query,
5510 graphql_client: self.graphql_client.clone(),
5511 }
5512 }
5513 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
5520 let mut query = self.selection.select("changes");
5521 query = query.arg_lazy(
5522 "from",
5523 Box::new(move || {
5524 let from = from.clone();
5525 Box::pin(async move { from.into_id().await.unwrap().quote() })
5526 }),
5527 );
5528 Changeset {
5529 proc: self.proc.clone(),
5530 selection: query,
5531 graphql_client: self.graphql_client.clone(),
5532 }
5533 }
5534 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5545 let mut query = self.selection.select("chown");
5546 query = query.arg("path", path.into());
5547 query = query.arg("owner", owner.into());
5548 Directory {
5549 proc: self.proc.clone(),
5550 selection: query,
5551 graphql_client: self.graphql_client.clone(),
5552 }
5553 }
5554 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
5560 let mut query = self.selection.select("diff");
5561 query = query.arg_lazy(
5562 "other",
5563 Box::new(move || {
5564 let other = other.clone();
5565 Box::pin(async move { other.into_id().await.unwrap().quote() })
5566 }),
5567 );
5568 Directory {
5569 proc: self.proc.clone(),
5570 selection: query,
5571 graphql_client: self.graphql_client.clone(),
5572 }
5573 }
5574 pub async fn digest(&self) -> Result<String, DaggerError> {
5576 let query = self.selection.select("digest");
5577 query.execute(self.graphql_client.clone()).await
5578 }
5579 pub fn directory(&self, path: impl Into<String>) -> Directory {
5585 let mut query = self.selection.select("directory");
5586 query = query.arg("path", path.into());
5587 Directory {
5588 proc: self.proc.clone(),
5589 selection: query,
5590 graphql_client: self.graphql_client.clone(),
5591 }
5592 }
5593 pub fn docker_build(&self) -> Container {
5599 let query = self.selection.select("dockerBuild");
5600 Container {
5601 proc: self.proc.clone(),
5602 selection: query,
5603 graphql_client: self.graphql_client.clone(),
5604 }
5605 }
5606 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5612 let mut query = self.selection.select("dockerBuild");
5613 if let Some(dockerfile) = opts.dockerfile {
5614 query = query.arg("dockerfile", dockerfile);
5615 }
5616 if let Some(platform) = opts.platform {
5617 query = query.arg("platform", platform);
5618 }
5619 if let Some(build_args) = opts.build_args {
5620 query = query.arg("buildArgs", build_args);
5621 }
5622 if let Some(target) = opts.target {
5623 query = query.arg("target", target);
5624 }
5625 if let Some(secrets) = opts.secrets {
5626 query = query.arg("secrets", secrets);
5627 }
5628 if let Some(no_init) = opts.no_init {
5629 query = query.arg("noInit", no_init);
5630 }
5631 if let Some(ssh) = opts.ssh {
5632 query = query.arg("ssh", ssh);
5633 }
5634 Container {
5635 proc: self.proc.clone(),
5636 selection: query,
5637 graphql_client: self.graphql_client.clone(),
5638 }
5639 }
5640 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5646 let query = self.selection.select("entries");
5647 query.execute(self.graphql_client.clone()).await
5648 }
5649 pub async fn entries_opts<'a>(
5655 &self,
5656 opts: DirectoryEntriesOpts<'a>,
5657 ) -> Result<Vec<String>, DaggerError> {
5658 let mut query = self.selection.select("entries");
5659 if let Some(path) = opts.path {
5660 query = query.arg("path", path);
5661 }
5662 query.execute(self.graphql_client.clone()).await
5663 }
5664 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5671 let mut query = self.selection.select("exists");
5672 query = query.arg("path", path.into());
5673 query.execute(self.graphql_client.clone()).await
5674 }
5675 pub async fn exists_opts(
5682 &self,
5683 path: impl Into<String>,
5684 opts: DirectoryExistsOpts,
5685 ) -> Result<bool, DaggerError> {
5686 let mut query = self.selection.select("exists");
5687 query = query.arg("path", path.into());
5688 if let Some(expected_type) = opts.expected_type {
5689 query = query.arg("expectedType", expected_type);
5690 }
5691 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5692 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5693 }
5694 query.execute(self.graphql_client.clone()).await
5695 }
5696 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5703 let mut query = self.selection.select("export");
5704 query = query.arg("path", path.into());
5705 query.execute(self.graphql_client.clone()).await
5706 }
5707 pub async fn export_opts(
5714 &self,
5715 path: impl Into<String>,
5716 opts: DirectoryExportOpts,
5717 ) -> Result<String, DaggerError> {
5718 let mut query = self.selection.select("export");
5719 query = query.arg("path", path.into());
5720 if let Some(wipe) = opts.wipe {
5721 query = query.arg("wipe", wipe);
5722 }
5723 query.execute(self.graphql_client.clone()).await
5724 }
5725 pub fn file(&self, path: impl Into<String>) -> File {
5731 let mut query = self.selection.select("file");
5732 query = query.arg("path", path.into());
5733 File {
5734 proc: self.proc.clone(),
5735 selection: query,
5736 graphql_client: self.graphql_client.clone(),
5737 }
5738 }
5739 pub fn filter(&self) -> Directory {
5745 let query = self.selection.select("filter");
5746 Directory {
5747 proc: self.proc.clone(),
5748 selection: query,
5749 graphql_client: self.graphql_client.clone(),
5750 }
5751 }
5752 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5758 let mut query = self.selection.select("filter");
5759 if let Some(exclude) = opts.exclude {
5760 query = query.arg("exclude", exclude);
5761 }
5762 if let Some(include) = opts.include {
5763 query = query.arg("include", include);
5764 }
5765 if let Some(gitignore) = opts.gitignore {
5766 query = query.arg("gitignore", gitignore);
5767 }
5768 Directory {
5769 proc: self.proc.clone(),
5770 selection: query,
5771 graphql_client: self.graphql_client.clone(),
5772 }
5773 }
5774 pub async fn find_up(
5781 &self,
5782 name: impl Into<String>,
5783 start: impl Into<String>,
5784 ) -> Result<String, DaggerError> {
5785 let mut query = self.selection.select("findUp");
5786 query = query.arg("name", name.into());
5787 query = query.arg("start", start.into());
5788 query.execute(self.graphql_client.clone()).await
5789 }
5790 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5796 let mut query = self.selection.select("glob");
5797 query = query.arg("pattern", pattern.into());
5798 query.execute(self.graphql_client.clone()).await
5799 }
5800 pub async fn id(&self) -> Result<Id, DaggerError> {
5802 let query = self.selection.select("id");
5803 query.execute(self.graphql_client.clone()).await
5804 }
5805 pub async fn name(&self) -> Result<String, DaggerError> {
5807 let query = self.selection.select("name");
5808 query.execute(self.graphql_client.clone()).await
5809 }
5810 pub async fn search(
5818 &self,
5819 pattern: impl Into<String>,
5820 ) -> Result<Vec<SearchResult>, DaggerError> {
5821 let mut query = self.selection.select("search");
5822 query = query.arg("pattern", pattern.into());
5823 let query = query.select("id");
5824 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5825 Ok(ids
5826 .into_iter()
5827 .map(|id| SearchResult {
5828 proc: self.proc.clone(),
5829 selection: crate::querybuilder::query()
5830 .select("node")
5831 .arg("id", &id.0)
5832 .inline_fragment("SearchResult"),
5833 graphql_client: self.graphql_client.clone(),
5834 })
5835 .collect())
5836 }
5837 pub async fn search_opts<'a>(
5845 &self,
5846 pattern: impl Into<String>,
5847 opts: DirectorySearchOpts<'a>,
5848 ) -> Result<Vec<SearchResult>, DaggerError> {
5849 let mut query = self.selection.select("search");
5850 query = query.arg("pattern", pattern.into());
5851 if let Some(paths) = opts.paths {
5852 query = query.arg("paths", paths);
5853 }
5854 if let Some(globs) = opts.globs {
5855 query = query.arg("globs", globs);
5856 }
5857 if let Some(literal) = opts.literal {
5858 query = query.arg("literal", literal);
5859 }
5860 if let Some(multiline) = opts.multiline {
5861 query = query.arg("multiline", multiline);
5862 }
5863 if let Some(dotall) = opts.dotall {
5864 query = query.arg("dotall", dotall);
5865 }
5866 if let Some(insensitive) = opts.insensitive {
5867 query = query.arg("insensitive", insensitive);
5868 }
5869 if let Some(skip_ignored) = opts.skip_ignored {
5870 query = query.arg("skipIgnored", skip_ignored);
5871 }
5872 if let Some(skip_hidden) = opts.skip_hidden {
5873 query = query.arg("skipHidden", skip_hidden);
5874 }
5875 if let Some(files_only) = opts.files_only {
5876 query = query.arg("filesOnly", files_only);
5877 }
5878 if let Some(limit) = opts.limit {
5879 query = query.arg("limit", limit);
5880 }
5881 let query = query.select("id");
5882 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5883 Ok(ids
5884 .into_iter()
5885 .map(|id| SearchResult {
5886 proc: self.proc.clone(),
5887 selection: crate::querybuilder::query()
5888 .select("node")
5889 .arg("id", &id.0)
5890 .inline_fragment("SearchResult"),
5891 graphql_client: self.graphql_client.clone(),
5892 })
5893 .collect())
5894 }
5895 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5902 let mut query = self.selection.select("stat");
5903 query = query.arg("path", path.into());
5904 let query = query.select("id");
5905 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5906 Ok(id.map(|id| Stat {
5907 proc: self.proc.clone(),
5908 selection: query
5909 .root()
5910 .select("node")
5911 .arg("id", &id.0)
5912 .inline_fragment("Stat"),
5913 graphql_client: self.graphql_client.clone(),
5914 }))
5915 }
5916 pub async fn stat_opts(
5923 &self,
5924 path: impl Into<String>,
5925 opts: DirectoryStatOpts,
5926 ) -> Result<Option<Stat>, DaggerError> {
5927 let mut query = self.selection.select("stat");
5928 query = query.arg("path", path.into());
5929 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5930 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5931 }
5932 let query = query.select("id");
5933 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5934 Ok(id.map(|id| Stat {
5935 proc: self.proc.clone(),
5936 selection: query
5937 .root()
5938 .select("node")
5939 .arg("id", &id.0)
5940 .inline_fragment("Stat"),
5941 graphql_client: self.graphql_client.clone(),
5942 }))
5943 }
5944 pub async fn sync(&self) -> Result<Directory, DaggerError> {
5946 let query = self.selection.select("sync");
5947 let id: Id = query.execute(self.graphql_client.clone()).await?;
5948 Ok(Directory {
5949 proc: self.proc.clone(),
5950 selection: query
5951 .root()
5952 .select("node")
5953 .arg("id", &id.0)
5954 .inline_fragment("Directory"),
5955 graphql_client: self.graphql_client.clone(),
5956 })
5957 }
5958 pub fn terminal(&self) -> Directory {
5964 let query = self.selection.select("terminal");
5965 Directory {
5966 proc: self.proc.clone(),
5967 selection: query,
5968 graphql_client: self.graphql_client.clone(),
5969 }
5970 }
5971 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5977 let mut query = self.selection.select("terminal");
5978 if let Some(container) = opts.container {
5979 query = query.arg("container", container);
5980 }
5981 if let Some(cmd) = opts.cmd {
5982 query = query.arg("cmd", cmd);
5983 }
5984 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5985 query = query.arg(
5986 "experimentalPrivilegedNesting",
5987 experimental_privileged_nesting,
5988 );
5989 }
5990 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5991 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5992 }
5993 Directory {
5994 proc: self.proc.clone(),
5995 selection: query,
5996 graphql_client: self.graphql_client.clone(),
5997 }
5998 }
5999 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
6005 let mut query = self.selection.select("withChanges");
6006 query = query.arg_lazy(
6007 "changes",
6008 Box::new(move || {
6009 let changes = changes.clone();
6010 Box::pin(async move { changes.into_id().await.unwrap().quote() })
6011 }),
6012 );
6013 Directory {
6014 proc: self.proc.clone(),
6015 selection: query,
6016 graphql_client: self.graphql_client.clone(),
6017 }
6018 }
6019 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6027 let mut query = self.selection.select("withDirectory");
6028 query = query.arg("path", path.into());
6029 query = query.arg_lazy(
6030 "source",
6031 Box::new(move || {
6032 let source = source.clone();
6033 Box::pin(async move { source.into_id().await.unwrap().quote() })
6034 }),
6035 );
6036 Directory {
6037 proc: self.proc.clone(),
6038 selection: query,
6039 graphql_client: self.graphql_client.clone(),
6040 }
6041 }
6042 pub fn with_directory_opts<'a>(
6050 &self,
6051 path: impl Into<String>,
6052 source: impl IntoID<Id>,
6053 opts: DirectoryWithDirectoryOpts<'a>,
6054 ) -> Directory {
6055 let mut query = self.selection.select("withDirectory");
6056 query = query.arg("path", path.into());
6057 query = query.arg_lazy(
6058 "source",
6059 Box::new(move || {
6060 let source = source.clone();
6061 Box::pin(async move { source.into_id().await.unwrap().quote() })
6062 }),
6063 );
6064 if let Some(exclude) = opts.exclude {
6065 query = query.arg("exclude", exclude);
6066 }
6067 if let Some(include) = opts.include {
6068 query = query.arg("include", include);
6069 }
6070 if let Some(gitignore) = opts.gitignore {
6071 query = query.arg("gitignore", gitignore);
6072 }
6073 if let Some(owner) = opts.owner {
6074 query = query.arg("owner", owner);
6075 }
6076 if let Some(permissions) = opts.permissions {
6077 query = query.arg("permissions", permissions);
6078 }
6079 Directory {
6080 proc: self.proc.clone(),
6081 selection: query,
6082 graphql_client: self.graphql_client.clone(),
6083 }
6084 }
6085 pub fn with_error(&self, err: impl Into<String>) -> Directory {
6091 let mut query = self.selection.select("withError");
6092 query = query.arg("err", err.into());
6093 Directory {
6094 proc: self.proc.clone(),
6095 selection: query,
6096 graphql_client: self.graphql_client.clone(),
6097 }
6098 }
6099 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6107 let mut query = self.selection.select("withFile");
6108 query = query.arg("path", path.into());
6109 query = query.arg_lazy(
6110 "source",
6111 Box::new(move || {
6112 let source = source.clone();
6113 Box::pin(async move { source.into_id().await.unwrap().quote() })
6114 }),
6115 );
6116 Directory {
6117 proc: self.proc.clone(),
6118 selection: query,
6119 graphql_client: self.graphql_client.clone(),
6120 }
6121 }
6122 pub fn with_file_opts<'a>(
6130 &self,
6131 path: impl Into<String>,
6132 source: impl IntoID<Id>,
6133 opts: DirectoryWithFileOpts<'a>,
6134 ) -> Directory {
6135 let mut query = self.selection.select("withFile");
6136 query = query.arg("path", path.into());
6137 query = query.arg_lazy(
6138 "source",
6139 Box::new(move || {
6140 let source = source.clone();
6141 Box::pin(async move { source.into_id().await.unwrap().quote() })
6142 }),
6143 );
6144 if let Some(permissions) = opts.permissions {
6145 query = query.arg("permissions", permissions);
6146 }
6147 if let Some(owner) = opts.owner {
6148 query = query.arg("owner", owner);
6149 }
6150 Directory {
6151 proc: self.proc.clone(),
6152 selection: query,
6153 graphql_client: self.graphql_client.clone(),
6154 }
6155 }
6156 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
6164 let mut query = self.selection.select("withFiles");
6165 query = query.arg("path", path.into());
6166 query = query.arg("sources", sources);
6167 Directory {
6168 proc: self.proc.clone(),
6169 selection: query,
6170 graphql_client: self.graphql_client.clone(),
6171 }
6172 }
6173 pub fn with_files_opts(
6181 &self,
6182 path: impl Into<String>,
6183 sources: Vec<Id>,
6184 opts: DirectoryWithFilesOpts,
6185 ) -> Directory {
6186 let mut query = self.selection.select("withFiles");
6187 query = query.arg("path", path.into());
6188 query = query.arg("sources", sources);
6189 if let Some(permissions) = opts.permissions {
6190 query = query.arg("permissions", permissions);
6191 }
6192 Directory {
6193 proc: self.proc.clone(),
6194 selection: query,
6195 graphql_client: self.graphql_client.clone(),
6196 }
6197 }
6198 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6205 let mut query = self.selection.select("withNewDirectory");
6206 query = query.arg("path", path.into());
6207 Directory {
6208 proc: self.proc.clone(),
6209 selection: query,
6210 graphql_client: self.graphql_client.clone(),
6211 }
6212 }
6213 pub fn with_new_directory_opts(
6220 &self,
6221 path: impl Into<String>,
6222 opts: DirectoryWithNewDirectoryOpts,
6223 ) -> Directory {
6224 let mut query = self.selection.select("withNewDirectory");
6225 query = query.arg("path", path.into());
6226 if let Some(permissions) = opts.permissions {
6227 query = query.arg("permissions", permissions);
6228 }
6229 Directory {
6230 proc: self.proc.clone(),
6231 selection: query,
6232 graphql_client: self.graphql_client.clone(),
6233 }
6234 }
6235 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
6243 let mut query = self.selection.select("withNewFile");
6244 query = query.arg("path", path.into());
6245 query = query.arg("contents", contents.into());
6246 Directory {
6247 proc: self.proc.clone(),
6248 selection: query,
6249 graphql_client: self.graphql_client.clone(),
6250 }
6251 }
6252 pub fn with_new_file_opts(
6260 &self,
6261 path: impl Into<String>,
6262 contents: impl Into<String>,
6263 opts: DirectoryWithNewFileOpts,
6264 ) -> Directory {
6265 let mut query = self.selection.select("withNewFile");
6266 query = query.arg("path", path.into());
6267 query = query.arg("contents", contents.into());
6268 if let Some(permissions) = opts.permissions {
6269 query = query.arg("permissions", permissions);
6270 }
6271 Directory {
6272 proc: self.proc.clone(),
6273 selection: query,
6274 graphql_client: self.graphql_client.clone(),
6275 }
6276 }
6277 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
6284 let mut query = self.selection.select("withPatch");
6285 query = query.arg("patch", patch.into());
6286 Directory {
6287 proc: self.proc.clone(),
6288 selection: query,
6289 graphql_client: self.graphql_client.clone(),
6290 }
6291 }
6292 pub fn with_patch_opts(
6299 &self,
6300 patch: impl Into<String>,
6301 opts: DirectoryWithPatchOpts,
6302 ) -> Directory {
6303 let mut query = self.selection.select("withPatch");
6304 query = query.arg("patch", patch.into());
6305 if let Some(on_conflict) = opts.on_conflict {
6306 query = query.arg("onConflict", on_conflict);
6307 }
6308 Directory {
6309 proc: self.proc.clone(),
6310 selection: query,
6311 graphql_client: self.graphql_client.clone(),
6312 }
6313 }
6314 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
6321 let mut query = self.selection.select("withPatchFile");
6322 query = query.arg_lazy(
6323 "patch",
6324 Box::new(move || {
6325 let patch = patch.clone();
6326 Box::pin(async move { patch.into_id().await.unwrap().quote() })
6327 }),
6328 );
6329 Directory {
6330 proc: self.proc.clone(),
6331 selection: query,
6332 graphql_client: self.graphql_client.clone(),
6333 }
6334 }
6335 pub fn with_patch_file_opts(
6342 &self,
6343 patch: impl IntoID<Id>,
6344 opts: DirectoryWithPatchFileOpts,
6345 ) -> Directory {
6346 let mut query = self.selection.select("withPatchFile");
6347 query = query.arg_lazy(
6348 "patch",
6349 Box::new(move || {
6350 let patch = patch.clone();
6351 Box::pin(async move { patch.into_id().await.unwrap().quote() })
6352 }),
6353 );
6354 if let Some(on_conflict) = opts.on_conflict {
6355 query = query.arg("onConflict", on_conflict);
6356 }
6357 Directory {
6358 proc: self.proc.clone(),
6359 selection: query,
6360 graphql_client: self.graphql_client.clone(),
6361 }
6362 }
6363 pub fn with_symlink(
6370 &self,
6371 target: impl Into<String>,
6372 link_name: impl Into<String>,
6373 ) -> Directory {
6374 let mut query = self.selection.select("withSymlink");
6375 query = query.arg("target", target.into());
6376 query = query.arg("linkName", link_name.into());
6377 Directory {
6378 proc: self.proc.clone(),
6379 selection: query,
6380 graphql_client: self.graphql_client.clone(),
6381 }
6382 }
6383 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
6391 let mut query = self.selection.select("withTimestamps");
6392 query = query.arg("timestamp", timestamp);
6393 Directory {
6394 proc: self.proc.clone(),
6395 selection: query,
6396 graphql_client: self.graphql_client.clone(),
6397 }
6398 }
6399 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
6405 let mut query = self.selection.select("withoutDirectory");
6406 query = query.arg("path", path.into());
6407 Directory {
6408 proc: self.proc.clone(),
6409 selection: query,
6410 graphql_client: self.graphql_client.clone(),
6411 }
6412 }
6413 pub fn without_file(&self, path: impl Into<String>) -> Directory {
6419 let mut query = self.selection.select("withoutFile");
6420 query = query.arg("path", path.into());
6421 Directory {
6422 proc: self.proc.clone(),
6423 selection: query,
6424 graphql_client: self.graphql_client.clone(),
6425 }
6426 }
6427 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
6433 let mut query = self.selection.select("withoutFiles");
6434 query = query.arg(
6435 "paths",
6436 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6437 );
6438 Directory {
6439 proc: self.proc.clone(),
6440 selection: query,
6441 graphql_client: self.graphql_client.clone(),
6442 }
6443 }
6444}
6445impl Exportable for Directory {
6446 fn export(
6447 &self,
6448 path: impl Into<String>,
6449 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
6450 let mut query = self.selection.select("export");
6451 query = query.arg("path", path.into());
6452 let graphql_client = self.graphql_client.clone();
6453 async move { query.execute(graphql_client).await }
6454 }
6455 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6456 let query = self.selection.select("id");
6457 let graphql_client = self.graphql_client.clone();
6458 async move { query.execute(graphql_client).await }
6459 }
6460}
6461impl Node for Directory {
6462 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6463 let query = self.selection.select("id");
6464 let graphql_client = self.graphql_client.clone();
6465 async move { query.execute(graphql_client).await }
6466 }
6467}
6468impl Syncer for Directory {
6469 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6470 let query = self.selection.select("id");
6471 let graphql_client = self.graphql_client.clone();
6472 async move { query.execute(graphql_client).await }
6473 }
6474 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
6475 let query = self.selection.select("sync");
6476 let proc = self.proc.clone();
6477 let graphql_client = self.graphql_client.clone();
6478 async move {
6479 let id: Id = query.execute(graphql_client.clone()).await?;
6480 Ok(Self {
6481 proc,
6482 selection: query
6483 .root()
6484 .select("node")
6485 .arg("id", &id.0)
6486 .inline_fragment("Directory"),
6487 graphql_client,
6488 })
6489 }
6490 }
6491}
6492#[derive(Clone)]
6493pub struct Engine {
6494 pub proc: Option<Arc<DaggerSessionProc>>,
6495 pub selection: Selection,
6496 pub graphql_client: DynGraphQLClient,
6497}
6498impl IntoID<Id> for Engine {
6499 fn into_id(
6500 self,
6501 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6502 Box::pin(async move { self.id().await })
6503 }
6504}
6505impl Loadable for Engine {
6506 fn graphql_type() -> &'static str {
6507 "Engine"
6508 }
6509 fn from_query(
6510 proc: Option<Arc<DaggerSessionProc>>,
6511 selection: Selection,
6512 graphql_client: DynGraphQLClient,
6513 ) -> Self {
6514 Self {
6515 proc,
6516 selection,
6517 graphql_client,
6518 }
6519 }
6520}
6521impl Engine {
6522 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
6524 let query = self.selection.select("clients");
6525 query.execute(self.graphql_client.clone()).await
6526 }
6527 pub async fn id(&self) -> Result<Id, DaggerError> {
6529 let query = self.selection.select("id");
6530 query.execute(self.graphql_client.clone()).await
6531 }
6532 pub fn local_cache(&self) -> EngineCache {
6534 let query = self.selection.select("localCache");
6535 EngineCache {
6536 proc: self.proc.clone(),
6537 selection: query,
6538 graphql_client: self.graphql_client.clone(),
6539 }
6540 }
6541 pub async fn name(&self) -> Result<String, DaggerError> {
6543 let query = self.selection.select("name");
6544 query.execute(self.graphql_client.clone()).await
6545 }
6546}
6547impl Node for Engine {
6548 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6549 let query = self.selection.select("id");
6550 let graphql_client = self.graphql_client.clone();
6551 async move { query.execute(graphql_client).await }
6552 }
6553}
6554#[derive(Clone)]
6555pub struct EngineCache {
6556 pub proc: Option<Arc<DaggerSessionProc>>,
6557 pub selection: Selection,
6558 pub graphql_client: DynGraphQLClient,
6559}
6560#[derive(Builder, Debug, PartialEq)]
6561pub struct EngineCacheEntrySetOpts<'a> {
6562 #[builder(setter(into, strip_option), default)]
6563 pub key: Option<&'a str>,
6564}
6565#[derive(Builder, Debug, PartialEq)]
6566pub struct EngineCachePruneOpts<'a> {
6567 #[builder(setter(into, strip_option), default)]
6569 pub max_estimated_bytes: Option<isize>,
6570 #[builder(setter(into, strip_option), default)]
6572 pub max_used_space: Option<&'a str>,
6573 #[builder(setter(into, strip_option), default)]
6575 pub min_free_space: Option<&'a str>,
6576 #[builder(setter(into, strip_option), default)]
6578 pub reserved_space: Option<&'a str>,
6579 #[builder(setter(into, strip_option), default)]
6581 pub target_estimated_bytes: Option<isize>,
6582 #[builder(setter(into, strip_option), default)]
6584 pub target_space: Option<&'a str>,
6585 #[builder(setter(into, strip_option), default)]
6587 pub use_default_policy: Option<bool>,
6588}
6589impl IntoID<Id> for EngineCache {
6590 fn into_id(
6591 self,
6592 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6593 Box::pin(async move { self.id().await })
6594 }
6595}
6596impl Loadable for EngineCache {
6597 fn graphql_type() -> &'static str {
6598 "EngineCache"
6599 }
6600 fn from_query(
6601 proc: Option<Arc<DaggerSessionProc>>,
6602 selection: Selection,
6603 graphql_client: DynGraphQLClient,
6604 ) -> Self {
6605 Self {
6606 proc,
6607 selection,
6608 graphql_client,
6609 }
6610 }
6611}
6612impl EngineCache {
6613 pub fn entry_set(&self) -> EngineCacheEntrySet {
6619 let query = self.selection.select("entrySet");
6620 EngineCacheEntrySet {
6621 proc: self.proc.clone(),
6622 selection: query,
6623 graphql_client: self.graphql_client.clone(),
6624 }
6625 }
6626 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6632 let mut query = self.selection.select("entrySet");
6633 if let Some(key) = opts.key {
6634 query = query.arg("key", key);
6635 }
6636 EngineCacheEntrySet {
6637 proc: self.proc.clone(),
6638 selection: query,
6639 graphql_client: self.graphql_client.clone(),
6640 }
6641 }
6642 pub async fn id(&self) -> Result<Id, DaggerError> {
6644 let query = self.selection.select("id");
6645 query.execute(self.graphql_client.clone()).await
6646 }
6647 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6649 let query = self.selection.select("maxUsedSpace");
6650 query.execute(self.graphql_client.clone()).await
6651 }
6652 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6654 let query = self.selection.select("minFreeSpace");
6655 query.execute(self.graphql_client.clone()).await
6656 }
6657 pub async fn prune(&self) -> Result<Void, DaggerError> {
6663 let query = self.selection.select("prune");
6664 query.execute(self.graphql_client.clone()).await
6665 }
6666 pub async fn prune_opts<'a>(
6672 &self,
6673 opts: EngineCachePruneOpts<'a>,
6674 ) -> Result<Void, DaggerError> {
6675 let mut query = self.selection.select("prune");
6676 if let Some(use_default_policy) = opts.use_default_policy {
6677 query = query.arg("useDefaultPolicy", use_default_policy);
6678 }
6679 if let Some(max_used_space) = opts.max_used_space {
6680 query = query.arg("maxUsedSpace", max_used_space);
6681 }
6682 if let Some(reserved_space) = opts.reserved_space {
6683 query = query.arg("reservedSpace", reserved_space);
6684 }
6685 if let Some(min_free_space) = opts.min_free_space {
6686 query = query.arg("minFreeSpace", min_free_space);
6687 }
6688 if let Some(target_space) = opts.target_space {
6689 query = query.arg("targetSpace", target_space);
6690 }
6691 if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
6692 query = query.arg("maxEstimatedBytes", max_estimated_bytes);
6693 }
6694 if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
6695 query = query.arg("targetEstimatedBytes", target_estimated_bytes);
6696 }
6697 query.execute(self.graphql_client.clone()).await
6698 }
6699 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6701 let query = self.selection.select("reservedSpace");
6702 query.execute(self.graphql_client.clone()).await
6703 }
6704 pub async fn target_space(&self) -> Result<isize, DaggerError> {
6706 let query = self.selection.select("targetSpace");
6707 query.execute(self.graphql_client.clone()).await
6708 }
6709}
6710impl Node for EngineCache {
6711 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6712 let query = self.selection.select("id");
6713 let graphql_client = self.graphql_client.clone();
6714 async move { query.execute(graphql_client).await }
6715 }
6716}
6717#[derive(Clone)]
6718pub struct EngineCacheEntry {
6719 pub proc: Option<Arc<DaggerSessionProc>>,
6720 pub selection: Selection,
6721 pub graphql_client: DynGraphQLClient,
6722}
6723impl IntoID<Id> for EngineCacheEntry {
6724 fn into_id(
6725 self,
6726 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6727 Box::pin(async move { self.id().await })
6728 }
6729}
6730impl Loadable for EngineCacheEntry {
6731 fn graphql_type() -> &'static str {
6732 "EngineCacheEntry"
6733 }
6734 fn from_query(
6735 proc: Option<Arc<DaggerSessionProc>>,
6736 selection: Selection,
6737 graphql_client: DynGraphQLClient,
6738 ) -> Self {
6739 Self {
6740 proc,
6741 selection,
6742 graphql_client,
6743 }
6744 }
6745}
6746impl EngineCacheEntry {
6747 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6749 let query = self.selection.select("activelyUsed");
6750 query.execute(self.graphql_client.clone()).await
6751 }
6752 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6754 let query = self.selection.select("createdTimeUnixNano");
6755 query.execute(self.graphql_client.clone()).await
6756 }
6757 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
6759 let query = self.selection.select("dagqlCall");
6760 query.execute(self.graphql_client.clone()).await
6761 }
6762 pub async fn description(&self) -> Result<String, DaggerError> {
6764 let query = self.selection.select("description");
6765 query.execute(self.graphql_client.clone()).await
6766 }
6767 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6769 let query = self.selection.select("diskSpaceBytes");
6770 query.execute(self.graphql_client.clone()).await
6771 }
6772 pub async fn id(&self) -> Result<Id, DaggerError> {
6774 let query = self.selection.select("id");
6775 query.execute(self.graphql_client.clone()).await
6776 }
6777 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6779 let query = self.selection.select("mostRecentUseTimeUnixNano");
6780 query.execute(self.graphql_client.clone()).await
6781 }
6782 pub async fn record_type(&self) -> Result<String, DaggerError> {
6784 let query = self.selection.select("recordType");
6785 query.execute(self.graphql_client.clone()).await
6786 }
6787 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
6789 let query = self.selection.select("recordTypes");
6790 query.execute(self.graphql_client.clone()).await
6791 }
6792}
6793impl Node for EngineCacheEntry {
6794 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6795 let query = self.selection.select("id");
6796 let graphql_client = self.graphql_client.clone();
6797 async move { query.execute(graphql_client).await }
6798 }
6799}
6800#[derive(Clone)]
6801pub struct EngineCacheEntrySet {
6802 pub proc: Option<Arc<DaggerSessionProc>>,
6803 pub selection: Selection,
6804 pub graphql_client: DynGraphQLClient,
6805}
6806impl IntoID<Id> for EngineCacheEntrySet {
6807 fn into_id(
6808 self,
6809 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6810 Box::pin(async move { self.id().await })
6811 }
6812}
6813impl Loadable for EngineCacheEntrySet {
6814 fn graphql_type() -> &'static str {
6815 "EngineCacheEntrySet"
6816 }
6817 fn from_query(
6818 proc: Option<Arc<DaggerSessionProc>>,
6819 selection: Selection,
6820 graphql_client: DynGraphQLClient,
6821 ) -> Self {
6822 Self {
6823 proc,
6824 selection,
6825 graphql_client,
6826 }
6827 }
6828}
6829impl EngineCacheEntrySet {
6830 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6832 let query = self.selection.select("diskSpaceBytes");
6833 query.execute(self.graphql_client.clone()).await
6834 }
6835 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6837 let query = self.selection.select("entries");
6838 let query = query.select("id");
6839 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6840 Ok(ids
6841 .into_iter()
6842 .map(|id| EngineCacheEntry {
6843 proc: self.proc.clone(),
6844 selection: crate::querybuilder::query()
6845 .select("node")
6846 .arg("id", &id.0)
6847 .inline_fragment("EngineCacheEntry"),
6848 graphql_client: self.graphql_client.clone(),
6849 })
6850 .collect())
6851 }
6852 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6854 let query = self.selection.select("entryCount");
6855 query.execute(self.graphql_client.clone()).await
6856 }
6857 pub async fn id(&self) -> Result<Id, DaggerError> {
6859 let query = self.selection.select("id");
6860 query.execute(self.graphql_client.clone()).await
6861 }
6862}
6863impl Node for EngineCacheEntrySet {
6864 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6865 let query = self.selection.select("id");
6866 let graphql_client = self.graphql_client.clone();
6867 async move { query.execute(graphql_client).await }
6868 }
6869}
6870#[derive(Clone)]
6871pub struct EnumTypeDef {
6872 pub proc: Option<Arc<DaggerSessionProc>>,
6873 pub selection: Selection,
6874 pub graphql_client: DynGraphQLClient,
6875}
6876impl IntoID<Id> for EnumTypeDef {
6877 fn into_id(
6878 self,
6879 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6880 Box::pin(async move { self.id().await })
6881 }
6882}
6883impl Loadable for EnumTypeDef {
6884 fn graphql_type() -> &'static str {
6885 "EnumTypeDef"
6886 }
6887 fn from_query(
6888 proc: Option<Arc<DaggerSessionProc>>,
6889 selection: Selection,
6890 graphql_client: DynGraphQLClient,
6891 ) -> Self {
6892 Self {
6893 proc,
6894 selection,
6895 graphql_client,
6896 }
6897 }
6898}
6899impl EnumTypeDef {
6900 pub async fn description(&self) -> Result<String, DaggerError> {
6902 let query = self.selection.select("description");
6903 query.execute(self.graphql_client.clone()).await
6904 }
6905 pub async fn id(&self) -> Result<Id, DaggerError> {
6907 let query = self.selection.select("id");
6908 query.execute(self.graphql_client.clone()).await
6909 }
6910 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6912 let query = self.selection.select("members");
6913 let query = query.select("id");
6914 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6915 Ok(ids
6916 .into_iter()
6917 .map(|id| EnumValueTypeDef {
6918 proc: self.proc.clone(),
6919 selection: crate::querybuilder::query()
6920 .select("node")
6921 .arg("id", &id.0)
6922 .inline_fragment("EnumValueTypeDef"),
6923 graphql_client: self.graphql_client.clone(),
6924 })
6925 .collect())
6926 }
6927 pub async fn name(&self) -> Result<String, DaggerError> {
6929 let query = self.selection.select("name");
6930 query.execute(self.graphql_client.clone()).await
6931 }
6932 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
6934 let query = self.selection.select("sourceMap");
6935 let query = query.select("id");
6936 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
6937 Ok(id.map(|id| SourceMap {
6938 proc: self.proc.clone(),
6939 selection: query
6940 .root()
6941 .select("node")
6942 .arg("id", &id.0)
6943 .inline_fragment("SourceMap"),
6944 graphql_client: self.graphql_client.clone(),
6945 }))
6946 }
6947 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6949 let query = self.selection.select("sourceModuleName");
6950 query.execute(self.graphql_client.clone()).await
6951 }
6952 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6954 let query = self.selection.select("values");
6955 let query = query.select("id");
6956 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6957 Ok(ids
6958 .into_iter()
6959 .map(|id| EnumValueTypeDef {
6960 proc: self.proc.clone(),
6961 selection: crate::querybuilder::query()
6962 .select("node")
6963 .arg("id", &id.0)
6964 .inline_fragment("EnumValueTypeDef"),
6965 graphql_client: self.graphql_client.clone(),
6966 })
6967 .collect())
6968 }
6969}
6970impl Node for EnumTypeDef {
6971 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6972 let query = self.selection.select("id");
6973 let graphql_client = self.graphql_client.clone();
6974 async move { query.execute(graphql_client).await }
6975 }
6976}
6977#[derive(Clone)]
6978pub struct EnumValueTypeDef {
6979 pub proc: Option<Arc<DaggerSessionProc>>,
6980 pub selection: Selection,
6981 pub graphql_client: DynGraphQLClient,
6982}
6983impl IntoID<Id> for EnumValueTypeDef {
6984 fn into_id(
6985 self,
6986 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6987 Box::pin(async move { self.id().await })
6988 }
6989}
6990impl Loadable for EnumValueTypeDef {
6991 fn graphql_type() -> &'static str {
6992 "EnumValueTypeDef"
6993 }
6994 fn from_query(
6995 proc: Option<Arc<DaggerSessionProc>>,
6996 selection: Selection,
6997 graphql_client: DynGraphQLClient,
6998 ) -> Self {
6999 Self {
7000 proc,
7001 selection,
7002 graphql_client,
7003 }
7004 }
7005}
7006impl EnumValueTypeDef {
7007 pub async fn deprecated(&self) -> Result<String, DaggerError> {
7009 let query = self.selection.select("deprecated");
7010 query.execute(self.graphql_client.clone()).await
7011 }
7012 pub async fn description(&self) -> Result<String, DaggerError> {
7014 let query = self.selection.select("description");
7015 query.execute(self.graphql_client.clone()).await
7016 }
7017 pub async fn id(&self) -> Result<Id, DaggerError> {
7019 let query = self.selection.select("id");
7020 query.execute(self.graphql_client.clone()).await
7021 }
7022 pub async fn name(&self) -> Result<String, DaggerError> {
7024 let query = self.selection.select("name");
7025 query.execute(self.graphql_client.clone()).await
7026 }
7027 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7029 let query = self.selection.select("sourceMap");
7030 let query = query.select("id");
7031 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7032 Ok(id.map(|id| SourceMap {
7033 proc: self.proc.clone(),
7034 selection: query
7035 .root()
7036 .select("node")
7037 .arg("id", &id.0)
7038 .inline_fragment("SourceMap"),
7039 graphql_client: self.graphql_client.clone(),
7040 }))
7041 }
7042 pub async fn value(&self) -> Result<String, DaggerError> {
7044 let query = self.selection.select("value");
7045 query.execute(self.graphql_client.clone()).await
7046 }
7047}
7048impl Node for EnumValueTypeDef {
7049 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7050 let query = self.selection.select("id");
7051 let graphql_client = self.graphql_client.clone();
7052 async move { query.execute(graphql_client).await }
7053 }
7054}
7055#[derive(Clone)]
7056pub struct EnvFile {
7057 pub proc: Option<Arc<DaggerSessionProc>>,
7058 pub selection: Selection,
7059 pub graphql_client: DynGraphQLClient,
7060}
7061#[derive(Builder, Debug, PartialEq)]
7062pub struct EnvFileGetOpts {
7063 #[builder(setter(into, strip_option), default)]
7065 pub raw: Option<bool>,
7066}
7067#[derive(Builder, Debug, PartialEq)]
7068pub struct EnvFileVariablesOpts {
7069 #[builder(setter(into, strip_option), default)]
7071 pub raw: Option<bool>,
7072}
7073impl IntoID<Id> for EnvFile {
7074 fn into_id(
7075 self,
7076 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7077 Box::pin(async move { self.id().await })
7078 }
7079}
7080impl Loadable for EnvFile {
7081 fn graphql_type() -> &'static str {
7082 "EnvFile"
7083 }
7084 fn from_query(
7085 proc: Option<Arc<DaggerSessionProc>>,
7086 selection: Selection,
7087 graphql_client: DynGraphQLClient,
7088 ) -> Self {
7089 Self {
7090 proc,
7091 selection,
7092 graphql_client,
7093 }
7094 }
7095}
7096impl EnvFile {
7097 pub fn as_file(&self) -> File {
7099 let query = self.selection.select("asFile");
7100 File {
7101 proc: self.proc.clone(),
7102 selection: query,
7103 graphql_client: self.graphql_client.clone(),
7104 }
7105 }
7106 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7112 let mut query = self.selection.select("exists");
7113 query = query.arg("name", name.into());
7114 query.execute(self.graphql_client.clone()).await
7115 }
7116 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7123 let mut query = self.selection.select("get");
7124 query = query.arg("name", name.into());
7125 query.execute(self.graphql_client.clone()).await
7126 }
7127 pub async fn get_opts(
7134 &self,
7135 name: impl Into<String>,
7136 opts: EnvFileGetOpts,
7137 ) -> Result<String, DaggerError> {
7138 let mut query = self.selection.select("get");
7139 query = query.arg("name", name.into());
7140 if let Some(raw) = opts.raw {
7141 query = query.arg("raw", raw);
7142 }
7143 query.execute(self.graphql_client.clone()).await
7144 }
7145 pub async fn id(&self) -> Result<Id, DaggerError> {
7147 let query = self.selection.select("id");
7148 query.execute(self.graphql_client.clone()).await
7149 }
7150 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
7156 let mut query = self.selection.select("namespace");
7157 query = query.arg("prefix", prefix.into());
7158 EnvFile {
7159 proc: self.proc.clone(),
7160 selection: query,
7161 graphql_client: self.graphql_client.clone(),
7162 }
7163 }
7164 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
7170 let query = self.selection.select("variables");
7171 let query = query.select("id");
7172 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7173 Ok(ids
7174 .into_iter()
7175 .map(|id| EnvVariable {
7176 proc: self.proc.clone(),
7177 selection: crate::querybuilder::query()
7178 .select("node")
7179 .arg("id", &id.0)
7180 .inline_fragment("EnvVariable"),
7181 graphql_client: self.graphql_client.clone(),
7182 })
7183 .collect())
7184 }
7185 pub async fn variables_opts(
7191 &self,
7192 opts: EnvFileVariablesOpts,
7193 ) -> Result<Vec<EnvVariable>, DaggerError> {
7194 let mut query = self.selection.select("variables");
7195 if let Some(raw) = opts.raw {
7196 query = query.arg("raw", raw);
7197 }
7198 let query = query.select("id");
7199 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7200 Ok(ids
7201 .into_iter()
7202 .map(|id| EnvVariable {
7203 proc: self.proc.clone(),
7204 selection: crate::querybuilder::query()
7205 .select("node")
7206 .arg("id", &id.0)
7207 .inline_fragment("EnvVariable"),
7208 graphql_client: self.graphql_client.clone(),
7209 })
7210 .collect())
7211 }
7212 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7219 let mut query = self.selection.select("withVariable");
7220 query = query.arg("name", name.into());
7221 query = query.arg("value", value.into());
7222 EnvFile {
7223 proc: self.proc.clone(),
7224 selection: query,
7225 graphql_client: self.graphql_client.clone(),
7226 }
7227 }
7228 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7234 let mut query = self.selection.select("withoutVariable");
7235 query = query.arg("name", name.into());
7236 EnvFile {
7237 proc: self.proc.clone(),
7238 selection: query,
7239 graphql_client: self.graphql_client.clone(),
7240 }
7241 }
7242}
7243impl Node for EnvFile {
7244 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7245 let query = self.selection.select("id");
7246 let graphql_client = self.graphql_client.clone();
7247 async move { query.execute(graphql_client).await }
7248 }
7249}
7250#[derive(Clone)]
7251pub struct EnvVariable {
7252 pub proc: Option<Arc<DaggerSessionProc>>,
7253 pub selection: Selection,
7254 pub graphql_client: DynGraphQLClient,
7255}
7256impl IntoID<Id> for EnvVariable {
7257 fn into_id(
7258 self,
7259 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7260 Box::pin(async move { self.id().await })
7261 }
7262}
7263impl Loadable for EnvVariable {
7264 fn graphql_type() -> &'static str {
7265 "EnvVariable"
7266 }
7267 fn from_query(
7268 proc: Option<Arc<DaggerSessionProc>>,
7269 selection: Selection,
7270 graphql_client: DynGraphQLClient,
7271 ) -> Self {
7272 Self {
7273 proc,
7274 selection,
7275 graphql_client,
7276 }
7277 }
7278}
7279impl EnvVariable {
7280 pub async fn id(&self) -> Result<Id, DaggerError> {
7282 let query = self.selection.select("id");
7283 query.execute(self.graphql_client.clone()).await
7284 }
7285 pub async fn name(&self) -> Result<String, DaggerError> {
7287 let query = self.selection.select("name");
7288 query.execute(self.graphql_client.clone()).await
7289 }
7290 pub async fn value(&self) -> Result<String, DaggerError> {
7292 let query = self.selection.select("value");
7293 query.execute(self.graphql_client.clone()).await
7294 }
7295}
7296impl Node for EnvVariable {
7297 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7298 let query = self.selection.select("id");
7299 let graphql_client = self.graphql_client.clone();
7300 async move { query.execute(graphql_client).await }
7301 }
7302}
7303#[derive(Clone)]
7304pub struct Error {
7305 pub proc: Option<Arc<DaggerSessionProc>>,
7306 pub selection: Selection,
7307 pub graphql_client: DynGraphQLClient,
7308}
7309impl IntoID<Id> for Error {
7310 fn into_id(
7311 self,
7312 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7313 Box::pin(async move { self.id().await })
7314 }
7315}
7316impl Loadable for Error {
7317 fn graphql_type() -> &'static str {
7318 "Error"
7319 }
7320 fn from_query(
7321 proc: Option<Arc<DaggerSessionProc>>,
7322 selection: Selection,
7323 graphql_client: DynGraphQLClient,
7324 ) -> Self {
7325 Self {
7326 proc,
7327 selection,
7328 graphql_client,
7329 }
7330 }
7331}
7332impl Error {
7333 pub async fn id(&self) -> Result<Id, DaggerError> {
7335 let query = self.selection.select("id");
7336 query.execute(self.graphql_client.clone()).await
7337 }
7338 pub async fn message(&self) -> Result<String, DaggerError> {
7340 let query = self.selection.select("message");
7341 query.execute(self.graphql_client.clone()).await
7342 }
7343 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
7345 let query = self.selection.select("values");
7346 let query = query.select("id");
7347 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7348 Ok(ids
7349 .into_iter()
7350 .map(|id| ErrorValue {
7351 proc: self.proc.clone(),
7352 selection: crate::querybuilder::query()
7353 .select("node")
7354 .arg("id", &id.0)
7355 .inline_fragment("ErrorValue"),
7356 graphql_client: self.graphql_client.clone(),
7357 })
7358 .collect())
7359 }
7360 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7367 let mut query = self.selection.select("withValue");
7368 query = query.arg("name", name.into());
7369 query = query.arg("value", value);
7370 Error {
7371 proc: self.proc.clone(),
7372 selection: query,
7373 graphql_client: self.graphql_client.clone(),
7374 }
7375 }
7376}
7377impl Node for Error {
7378 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7379 let query = self.selection.select("id");
7380 let graphql_client = self.graphql_client.clone();
7381 async move { query.execute(graphql_client).await }
7382 }
7383}
7384#[derive(Clone)]
7385pub struct ErrorValue {
7386 pub proc: Option<Arc<DaggerSessionProc>>,
7387 pub selection: Selection,
7388 pub graphql_client: DynGraphQLClient,
7389}
7390impl IntoID<Id> for ErrorValue {
7391 fn into_id(
7392 self,
7393 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7394 Box::pin(async move { self.id().await })
7395 }
7396}
7397impl Loadable for ErrorValue {
7398 fn graphql_type() -> &'static str {
7399 "ErrorValue"
7400 }
7401 fn from_query(
7402 proc: Option<Arc<DaggerSessionProc>>,
7403 selection: Selection,
7404 graphql_client: DynGraphQLClient,
7405 ) -> Self {
7406 Self {
7407 proc,
7408 selection,
7409 graphql_client,
7410 }
7411 }
7412}
7413impl ErrorValue {
7414 pub async fn id(&self) -> Result<Id, DaggerError> {
7416 let query = self.selection.select("id");
7417 query.execute(self.graphql_client.clone()).await
7418 }
7419 pub async fn name(&self) -> Result<String, DaggerError> {
7421 let query = self.selection.select("name");
7422 query.execute(self.graphql_client.clone()).await
7423 }
7424 pub async fn value(&self) -> Result<Json, DaggerError> {
7426 let query = self.selection.select("value");
7427 query.execute(self.graphql_client.clone()).await
7428 }
7429}
7430impl Node for ErrorValue {
7431 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7432 let query = self.selection.select("id");
7433 let graphql_client = self.graphql_client.clone();
7434 async move { query.execute(graphql_client).await }
7435 }
7436}
7437#[derive(Clone)]
7438pub struct FieldTypeDef {
7439 pub proc: Option<Arc<DaggerSessionProc>>,
7440 pub selection: Selection,
7441 pub graphql_client: DynGraphQLClient,
7442}
7443impl IntoID<Id> for FieldTypeDef {
7444 fn into_id(
7445 self,
7446 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7447 Box::pin(async move { self.id().await })
7448 }
7449}
7450impl Loadable for FieldTypeDef {
7451 fn graphql_type() -> &'static str {
7452 "FieldTypeDef"
7453 }
7454 fn from_query(
7455 proc: Option<Arc<DaggerSessionProc>>,
7456 selection: Selection,
7457 graphql_client: DynGraphQLClient,
7458 ) -> Self {
7459 Self {
7460 proc,
7461 selection,
7462 graphql_client,
7463 }
7464 }
7465}
7466impl FieldTypeDef {
7467 pub async fn deprecated(&self) -> Result<String, DaggerError> {
7469 let query = self.selection.select("deprecated");
7470 query.execute(self.graphql_client.clone()).await
7471 }
7472 pub async fn description(&self) -> Result<String, DaggerError> {
7474 let query = self.selection.select("description");
7475 query.execute(self.graphql_client.clone()).await
7476 }
7477 pub async fn id(&self) -> Result<Id, DaggerError> {
7479 let query = self.selection.select("id");
7480 query.execute(self.graphql_client.clone()).await
7481 }
7482 pub async fn name(&self) -> Result<String, DaggerError> {
7484 let query = self.selection.select("name");
7485 query.execute(self.graphql_client.clone()).await
7486 }
7487 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
7489 let query = self.selection.select("sourceMap");
7490 let query = query.select("id");
7491 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7492 Ok(id.map(|id| SourceMap {
7493 proc: self.proc.clone(),
7494 selection: query
7495 .root()
7496 .select("node")
7497 .arg("id", &id.0)
7498 .inline_fragment("SourceMap"),
7499 graphql_client: self.graphql_client.clone(),
7500 }))
7501 }
7502 pub fn type_def(&self) -> TypeDef {
7504 let query = self.selection.select("typeDef");
7505 TypeDef {
7506 proc: self.proc.clone(),
7507 selection: query,
7508 graphql_client: self.graphql_client.clone(),
7509 }
7510 }
7511}
7512impl Node for FieldTypeDef {
7513 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7514 let query = self.selection.select("id");
7515 let graphql_client = self.graphql_client.clone();
7516 async move { query.execute(graphql_client).await }
7517 }
7518}
7519#[derive(Clone)]
7520pub struct File {
7521 pub proc: Option<Arc<DaggerSessionProc>>,
7522 pub selection: Selection,
7523 pub graphql_client: DynGraphQLClient,
7524}
7525#[derive(Builder, Debug, PartialEq)]
7526pub struct FileAsEnvFileOpts {
7527 #[builder(setter(into, strip_option), default)]
7529 pub expand: Option<bool>,
7530}
7531#[derive(Builder, Debug, PartialEq)]
7532pub struct FileContentsOpts {
7533 #[builder(setter(into, strip_option), default)]
7535 pub limit_lines: Option<isize>,
7536 #[builder(setter(into, strip_option), default)]
7538 pub offset_lines: Option<isize>,
7539}
7540#[derive(Builder, Debug, PartialEq)]
7541pub struct FileDigestOpts {
7542 #[builder(setter(into, strip_option), default)]
7544 pub exclude_metadata: Option<bool>,
7545}
7546#[derive(Builder, Debug, PartialEq)]
7547pub struct FileExportOpts {
7548 #[builder(setter(into, strip_option), default)]
7550 pub allow_parent_dir_path: Option<bool>,
7551}
7552#[derive(Builder, Debug, PartialEq)]
7553pub struct FileSearchOpts<'a> {
7554 #[builder(setter(into, strip_option), default)]
7556 pub dotall: Option<bool>,
7557 #[builder(setter(into, strip_option), default)]
7559 pub files_only: Option<bool>,
7560 #[builder(setter(into, strip_option), default)]
7561 pub globs: Option<Vec<&'a str>>,
7562 #[builder(setter(into, strip_option), default)]
7564 pub insensitive: Option<bool>,
7565 #[builder(setter(into, strip_option), default)]
7567 pub limit: Option<isize>,
7568 #[builder(setter(into, strip_option), default)]
7570 pub literal: Option<bool>,
7571 #[builder(setter(into, strip_option), default)]
7573 pub multiline: Option<bool>,
7574 #[builder(setter(into, strip_option), default)]
7575 pub paths: Option<Vec<&'a str>>,
7576 #[builder(setter(into, strip_option), default)]
7578 pub skip_hidden: Option<bool>,
7579 #[builder(setter(into, strip_option), default)]
7581 pub skip_ignored: Option<bool>,
7582}
7583#[derive(Builder, Debug, PartialEq)]
7584pub struct FileWithReplacedOpts {
7585 #[builder(setter(into, strip_option), default)]
7587 pub all: Option<bool>,
7588 #[builder(setter(into, strip_option), default)]
7590 pub first_from: Option<isize>,
7591}
7592impl IntoID<Id> for File {
7593 fn into_id(
7594 self,
7595 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7596 Box::pin(async move { self.id().await })
7597 }
7598}
7599impl Loadable for File {
7600 fn graphql_type() -> &'static str {
7601 "File"
7602 }
7603 fn from_query(
7604 proc: Option<Arc<DaggerSessionProc>>,
7605 selection: Selection,
7606 graphql_client: DynGraphQLClient,
7607 ) -> Self {
7608 Self {
7609 proc,
7610 selection,
7611 graphql_client,
7612 }
7613 }
7614}
7615impl File {
7616 pub fn as_env_file(&self) -> EnvFile {
7622 let query = self.selection.select("asEnvFile");
7623 EnvFile {
7624 proc: self.proc.clone(),
7625 selection: query,
7626 graphql_client: self.graphql_client.clone(),
7627 }
7628 }
7629 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7635 let mut query = self.selection.select("asEnvFile");
7636 if let Some(expand) = opts.expand {
7637 query = query.arg("expand", expand);
7638 }
7639 EnvFile {
7640 proc: self.proc.clone(),
7641 selection: query,
7642 graphql_client: self.graphql_client.clone(),
7643 }
7644 }
7645 pub fn as_git_bundle(&self) -> GitBundle {
7647 let query = self.selection.select("asGitBundle");
7648 GitBundle {
7649 proc: self.proc.clone(),
7650 selection: query,
7651 graphql_client: self.graphql_client.clone(),
7652 }
7653 }
7654 pub fn as_json(&self) -> JsonValue {
7656 let query = self.selection.select("asJSON");
7657 JsonValue {
7658 proc: self.proc.clone(),
7659 selection: query,
7660 graphql_client: self.graphql_client.clone(),
7661 }
7662 }
7663 pub fn chown(&self, owner: impl Into<String>) -> File {
7673 let mut query = self.selection.select("chown");
7674 query = query.arg("owner", owner.into());
7675 File {
7676 proc: self.proc.clone(),
7677 selection: query,
7678 graphql_client: self.graphql_client.clone(),
7679 }
7680 }
7681 pub async fn contents(&self) -> Result<String, DaggerError> {
7687 let query = self.selection.select("contents");
7688 query.execute(self.graphql_client.clone()).await
7689 }
7690 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7696 let mut query = self.selection.select("contents");
7697 if let Some(offset_lines) = opts.offset_lines {
7698 query = query.arg("offsetLines", offset_lines);
7699 }
7700 if let Some(limit_lines) = opts.limit_lines {
7701 query = query.arg("limitLines", limit_lines);
7702 }
7703 query.execute(self.graphql_client.clone()).await
7704 }
7705 pub async fn digest(&self) -> Result<String, DaggerError> {
7711 let query = self.selection.select("digest");
7712 query.execute(self.graphql_client.clone()).await
7713 }
7714 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7720 let mut query = self.selection.select("digest");
7721 if let Some(exclude_metadata) = opts.exclude_metadata {
7722 query = query.arg("excludeMetadata", exclude_metadata);
7723 }
7724 query.execute(self.graphql_client.clone()).await
7725 }
7726 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7733 let mut query = self.selection.select("export");
7734 query = query.arg("path", path.into());
7735 query.execute(self.graphql_client.clone()).await
7736 }
7737 pub async fn export_opts(
7744 &self,
7745 path: impl Into<String>,
7746 opts: FileExportOpts,
7747 ) -> Result<String, DaggerError> {
7748 let mut query = self.selection.select("export");
7749 query = query.arg("path", path.into());
7750 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7751 query = query.arg("allowParentDirPath", allow_parent_dir_path);
7752 }
7753 query.execute(self.graphql_client.clone()).await
7754 }
7755 pub async fn id(&self) -> Result<Id, DaggerError> {
7757 let query = self.selection.select("id");
7758 query.execute(self.graphql_client.clone()).await
7759 }
7760 pub async fn name(&self) -> Result<String, DaggerError> {
7762 let query = self.selection.select("name");
7763 query.execute(self.graphql_client.clone()).await
7764 }
7765 pub async fn search(
7773 &self,
7774 pattern: impl Into<String>,
7775 ) -> Result<Vec<SearchResult>, DaggerError> {
7776 let mut query = self.selection.select("search");
7777 query = query.arg("pattern", pattern.into());
7778 let query = query.select("id");
7779 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7780 Ok(ids
7781 .into_iter()
7782 .map(|id| SearchResult {
7783 proc: self.proc.clone(),
7784 selection: crate::querybuilder::query()
7785 .select("node")
7786 .arg("id", &id.0)
7787 .inline_fragment("SearchResult"),
7788 graphql_client: self.graphql_client.clone(),
7789 })
7790 .collect())
7791 }
7792 pub async fn search_opts<'a>(
7800 &self,
7801 pattern: impl Into<String>,
7802 opts: FileSearchOpts<'a>,
7803 ) -> Result<Vec<SearchResult>, DaggerError> {
7804 let mut query = self.selection.select("search");
7805 query = query.arg("pattern", pattern.into());
7806 if let Some(literal) = opts.literal {
7807 query = query.arg("literal", literal);
7808 }
7809 if let Some(multiline) = opts.multiline {
7810 query = query.arg("multiline", multiline);
7811 }
7812 if let Some(dotall) = opts.dotall {
7813 query = query.arg("dotall", dotall);
7814 }
7815 if let Some(insensitive) = opts.insensitive {
7816 query = query.arg("insensitive", insensitive);
7817 }
7818 if let Some(skip_ignored) = opts.skip_ignored {
7819 query = query.arg("skipIgnored", skip_ignored);
7820 }
7821 if let Some(skip_hidden) = opts.skip_hidden {
7822 query = query.arg("skipHidden", skip_hidden);
7823 }
7824 if let Some(files_only) = opts.files_only {
7825 query = query.arg("filesOnly", files_only);
7826 }
7827 if let Some(limit) = opts.limit {
7828 query = query.arg("limit", limit);
7829 }
7830 if let Some(paths) = opts.paths {
7831 query = query.arg("paths", paths);
7832 }
7833 if let Some(globs) = opts.globs {
7834 query = query.arg("globs", globs);
7835 }
7836 let query = query.select("id");
7837 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
7838 Ok(ids
7839 .into_iter()
7840 .map(|id| SearchResult {
7841 proc: self.proc.clone(),
7842 selection: crate::querybuilder::query()
7843 .select("node")
7844 .arg("id", &id.0)
7845 .inline_fragment("SearchResult"),
7846 graphql_client: self.graphql_client.clone(),
7847 })
7848 .collect())
7849 }
7850 pub async fn size(&self) -> Result<isize, DaggerError> {
7852 let query = self.selection.select("size");
7853 query.execute(self.graphql_client.clone()).await
7854 }
7855 pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
7857 let query = self.selection.select("stat");
7858 let query = query.select("id");
7859 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7860 Ok(id.map(|id| Stat {
7861 proc: self.proc.clone(),
7862 selection: query
7863 .root()
7864 .select("node")
7865 .arg("id", &id.0)
7866 .inline_fragment("Stat"),
7867 graphql_client: self.graphql_client.clone(),
7868 }))
7869 }
7870 pub async fn sync(&self) -> Result<File, DaggerError> {
7872 let query = self.selection.select("sync");
7873 let id: Id = query.execute(self.graphql_client.clone()).await?;
7874 Ok(File {
7875 proc: self.proc.clone(),
7876 selection: query
7877 .root()
7878 .select("node")
7879 .arg("id", &id.0)
7880 .inline_fragment("File"),
7881 graphql_client: self.graphql_client.clone(),
7882 })
7883 }
7884 pub fn with_name(&self, name: impl Into<String>) -> File {
7890 let mut query = self.selection.select("withName");
7891 query = query.arg("name", name.into());
7892 File {
7893 proc: self.proc.clone(),
7894 selection: query,
7895 graphql_client: self.graphql_client.clone(),
7896 }
7897 }
7898 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7910 let mut query = self.selection.select("withReplaced");
7911 query = query.arg("search", search.into());
7912 query = query.arg("replacement", replacement.into());
7913 File {
7914 proc: self.proc.clone(),
7915 selection: query,
7916 graphql_client: self.graphql_client.clone(),
7917 }
7918 }
7919 pub fn with_replaced_opts(
7931 &self,
7932 search: impl Into<String>,
7933 replacement: impl Into<String>,
7934 opts: FileWithReplacedOpts,
7935 ) -> File {
7936 let mut query = self.selection.select("withReplaced");
7937 query = query.arg("search", search.into());
7938 query = query.arg("replacement", replacement.into());
7939 if let Some(all) = opts.all {
7940 query = query.arg("all", all);
7941 }
7942 if let Some(first_from) = opts.first_from {
7943 query = query.arg("firstFrom", first_from);
7944 }
7945 File {
7946 proc: self.proc.clone(),
7947 selection: query,
7948 graphql_client: self.graphql_client.clone(),
7949 }
7950 }
7951 pub fn with_timestamps(&self, timestamp: isize) -> File {
7959 let mut query = self.selection.select("withTimestamps");
7960 query = query.arg("timestamp", timestamp);
7961 File {
7962 proc: self.proc.clone(),
7963 selection: query,
7964 graphql_client: self.graphql_client.clone(),
7965 }
7966 }
7967}
7968impl Exportable for File {
7969 fn export(
7970 &self,
7971 path: impl Into<String>,
7972 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7973 let mut query = self.selection.select("export");
7974 query = query.arg("path", path.into());
7975 let graphql_client = self.graphql_client.clone();
7976 async move { query.execute(graphql_client).await }
7977 }
7978 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7979 let query = self.selection.select("id");
7980 let graphql_client = self.graphql_client.clone();
7981 async move { query.execute(graphql_client).await }
7982 }
7983}
7984impl Node for File {
7985 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7986 let query = self.selection.select("id");
7987 let graphql_client = self.graphql_client.clone();
7988 async move { query.execute(graphql_client).await }
7989 }
7990}
7991impl Syncer for File {
7992 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7993 let query = self.selection.select("id");
7994 let graphql_client = self.graphql_client.clone();
7995 async move { query.execute(graphql_client).await }
7996 }
7997 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7998 let query = self.selection.select("sync");
7999 let proc = self.proc.clone();
8000 let graphql_client = self.graphql_client.clone();
8001 async move {
8002 let id: Id = query.execute(graphql_client.clone()).await?;
8003 Ok(Self {
8004 proc,
8005 selection: query
8006 .root()
8007 .select("node")
8008 .arg("id", &id.0)
8009 .inline_fragment("File"),
8010 graphql_client,
8011 })
8012 }
8013 }
8014}
8015#[derive(Clone)]
8016pub struct Function {
8017 pub proc: Option<Arc<DaggerSessionProc>>,
8018 pub selection: Selection,
8019 pub graphql_client: DynGraphQLClient,
8020}
8021#[derive(Builder, Debug, PartialEq)]
8022pub struct FunctionWithArgOpts<'a> {
8023 #[builder(setter(into, strip_option), default)]
8024 pub default_address: Option<&'a str>,
8025 #[builder(setter(into, strip_option), default)]
8027 pub default_path: Option<&'a str>,
8028 #[builder(setter(into, strip_option), default)]
8030 pub default_value: Option<Json>,
8031 #[builder(setter(into, strip_option), default)]
8033 pub deprecated: Option<&'a str>,
8034 #[builder(setter(into, strip_option), default)]
8036 pub description: Option<&'a str>,
8037 #[builder(setter(into, strip_option), default)]
8039 pub ignore: Option<Vec<&'a str>>,
8040 #[builder(setter(into, strip_option), default)]
8042 pub source_map: Option<Id>,
8043}
8044#[derive(Builder, Debug, PartialEq)]
8045pub struct FunctionWithCachePolicyOpts<'a> {
8046 #[builder(setter(into, strip_option), default)]
8048 pub time_to_live: Option<&'a str>,
8049}
8050#[derive(Builder, Debug, PartialEq)]
8051pub struct FunctionWithDeprecatedOpts<'a> {
8052 #[builder(setter(into, strip_option), default)]
8054 pub reason: Option<&'a str>,
8055}
8056impl IntoID<Id> for Function {
8057 fn into_id(
8058 self,
8059 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8060 Box::pin(async move { self.id().await })
8061 }
8062}
8063impl Loadable for Function {
8064 fn graphql_type() -> &'static str {
8065 "Function"
8066 }
8067 fn from_query(
8068 proc: Option<Arc<DaggerSessionProc>>,
8069 selection: Selection,
8070 graphql_client: DynGraphQLClient,
8071 ) -> Self {
8072 Self {
8073 proc,
8074 selection,
8075 graphql_client,
8076 }
8077 }
8078}
8079impl Function {
8080 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
8082 let query = self.selection.select("args");
8083 let query = query.select("id");
8084 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8085 Ok(ids
8086 .into_iter()
8087 .map(|id| FunctionArg {
8088 proc: self.proc.clone(),
8089 selection: crate::querybuilder::query()
8090 .select("node")
8091 .arg("id", &id.0)
8092 .inline_fragment("FunctionArg"),
8093 graphql_client: self.graphql_client.clone(),
8094 })
8095 .collect())
8096 }
8097 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8099 let query = self.selection.select("deprecated");
8100 query.execute(self.graphql_client.clone()).await
8101 }
8102 pub async fn description(&self) -> Result<String, DaggerError> {
8104 let query = self.selection.select("description");
8105 query.execute(self.graphql_client.clone()).await
8106 }
8107 pub async fn id(&self) -> Result<Id, DaggerError> {
8109 let query = self.selection.select("id");
8110 query.execute(self.graphql_client.clone()).await
8111 }
8112 pub async fn name(&self) -> Result<String, DaggerError> {
8114 let query = self.selection.select("name");
8115 query.execute(self.graphql_client.clone()).await
8116 }
8117 pub fn return_type(&self) -> TypeDef {
8119 let query = self.selection.select("returnType");
8120 TypeDef {
8121 proc: self.proc.clone(),
8122 selection: query,
8123 graphql_client: self.graphql_client.clone(),
8124 }
8125 }
8126 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8128 let query = self.selection.select("sourceMap");
8129 let query = query.select("id");
8130 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8131 Ok(id.map(|id| SourceMap {
8132 proc: self.proc.clone(),
8133 selection: query
8134 .root()
8135 .select("node")
8136 .arg("id", &id.0)
8137 .inline_fragment("SourceMap"),
8138 graphql_client: self.graphql_client.clone(),
8139 }))
8140 }
8141 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8143 let query = self.selection.select("sourceModuleName");
8144 query.execute(self.graphql_client.clone()).await
8145 }
8146 pub fn with_agent(&self) -> Function {
8148 let query = self.selection.select("withAgent");
8149 Function {
8150 proc: self.proc.clone(),
8151 selection: query,
8152 graphql_client: self.graphql_client.clone(),
8153 }
8154 }
8155 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
8163 let mut query = self.selection.select("withArg");
8164 query = query.arg("name", name.into());
8165 query = query.arg_lazy(
8166 "typeDef",
8167 Box::new(move || {
8168 let type_def = type_def.clone();
8169 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8170 }),
8171 );
8172 Function {
8173 proc: self.proc.clone(),
8174 selection: query,
8175 graphql_client: self.graphql_client.clone(),
8176 }
8177 }
8178 pub fn with_arg_opts<'a>(
8186 &self,
8187 name: impl Into<String>,
8188 type_def: impl IntoID<Id>,
8189 opts: FunctionWithArgOpts<'a>,
8190 ) -> Function {
8191 let mut query = self.selection.select("withArg");
8192 query = query.arg("name", name.into());
8193 query = query.arg_lazy(
8194 "typeDef",
8195 Box::new(move || {
8196 let type_def = type_def.clone();
8197 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8198 }),
8199 );
8200 if let Some(description) = opts.description {
8201 query = query.arg("description", description);
8202 }
8203 if let Some(default_value) = opts.default_value {
8204 query = query.arg("defaultValue", default_value);
8205 }
8206 if let Some(default_path) = opts.default_path {
8207 query = query.arg("defaultPath", default_path);
8208 }
8209 if let Some(ignore) = opts.ignore {
8210 query = query.arg("ignore", ignore);
8211 }
8212 if let Some(source_map) = opts.source_map {
8213 query = query.arg("sourceMap", source_map);
8214 }
8215 if let Some(deprecated) = opts.deprecated {
8216 query = query.arg("deprecated", deprecated);
8217 }
8218 if let Some(default_address) = opts.default_address {
8219 query = query.arg("defaultAddress", default_address);
8220 }
8221 Function {
8222 proc: self.proc.clone(),
8223 selection: query,
8224 graphql_client: self.graphql_client.clone(),
8225 }
8226 }
8227 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
8234 let mut query = self.selection.select("withCachePolicy");
8235 query = query.arg("policy", policy);
8236 Function {
8237 proc: self.proc.clone(),
8238 selection: query,
8239 graphql_client: self.graphql_client.clone(),
8240 }
8241 }
8242 pub fn with_cache_policy_opts<'a>(
8249 &self,
8250 policy: FunctionCachePolicy,
8251 opts: FunctionWithCachePolicyOpts<'a>,
8252 ) -> Function {
8253 let mut query = self.selection.select("withCachePolicy");
8254 query = query.arg("policy", policy);
8255 if let Some(time_to_live) = opts.time_to_live {
8256 query = query.arg("timeToLive", time_to_live);
8257 }
8258 Function {
8259 proc: self.proc.clone(),
8260 selection: query,
8261 graphql_client: self.graphql_client.clone(),
8262 }
8263 }
8264 pub fn with_check(&self) -> Function {
8266 let query = self.selection.select("withCheck");
8267 Function {
8268 proc: self.proc.clone(),
8269 selection: query,
8270 graphql_client: self.graphql_client.clone(),
8271 }
8272 }
8273 pub fn with_deprecated(&self) -> Function {
8279 let query = self.selection.select("withDeprecated");
8280 Function {
8281 proc: self.proc.clone(),
8282 selection: query,
8283 graphql_client: self.graphql_client.clone(),
8284 }
8285 }
8286 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
8292 let mut query = self.selection.select("withDeprecated");
8293 if let Some(reason) = opts.reason {
8294 query = query.arg("reason", reason);
8295 }
8296 Function {
8297 proc: self.proc.clone(),
8298 selection: query,
8299 graphql_client: self.graphql_client.clone(),
8300 }
8301 }
8302 pub fn with_description(&self, description: impl Into<String>) -> Function {
8308 let mut query = self.selection.select("withDescription");
8309 query = query.arg("description", description.into());
8310 Function {
8311 proc: self.proc.clone(),
8312 selection: query,
8313 graphql_client: self.graphql_client.clone(),
8314 }
8315 }
8316 pub fn with_generator(&self) -> Function {
8318 let query = self.selection.select("withGenerator");
8319 Function {
8320 proc: self.proc.clone(),
8321 selection: query,
8322 graphql_client: self.graphql_client.clone(),
8323 }
8324 }
8325 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
8331 let mut query = self.selection.select("withSourceMap");
8332 query = query.arg_lazy(
8333 "sourceMap",
8334 Box::new(move || {
8335 let source_map = source_map.clone();
8336 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8337 }),
8338 );
8339 Function {
8340 proc: self.proc.clone(),
8341 selection: query,
8342 graphql_client: self.graphql_client.clone(),
8343 }
8344 }
8345 pub fn with_up(&self) -> Function {
8347 let query = self.selection.select("withUp");
8348 Function {
8349 proc: self.proc.clone(),
8350 selection: query,
8351 graphql_client: self.graphql_client.clone(),
8352 }
8353 }
8354}
8355impl Node for Function {
8356 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8357 let query = self.selection.select("id");
8358 let graphql_client = self.graphql_client.clone();
8359 async move { query.execute(graphql_client).await }
8360 }
8361}
8362#[derive(Clone)]
8363pub struct FunctionArg {
8364 pub proc: Option<Arc<DaggerSessionProc>>,
8365 pub selection: Selection,
8366 pub graphql_client: DynGraphQLClient,
8367}
8368impl IntoID<Id> for FunctionArg {
8369 fn into_id(
8370 self,
8371 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8372 Box::pin(async move { self.id().await })
8373 }
8374}
8375impl Loadable for FunctionArg {
8376 fn graphql_type() -> &'static str {
8377 "FunctionArg"
8378 }
8379 fn from_query(
8380 proc: Option<Arc<DaggerSessionProc>>,
8381 selection: Selection,
8382 graphql_client: DynGraphQLClient,
8383 ) -> Self {
8384 Self {
8385 proc,
8386 selection,
8387 graphql_client,
8388 }
8389 }
8390}
8391impl FunctionArg {
8392 pub async fn default_address(&self) -> Result<String, DaggerError> {
8394 let query = self.selection.select("defaultAddress");
8395 query.execute(self.graphql_client.clone()).await
8396 }
8397 pub async fn default_path(&self) -> Result<String, DaggerError> {
8399 let query = self.selection.select("defaultPath");
8400 query.execute(self.graphql_client.clone()).await
8401 }
8402 pub async fn default_value(&self) -> Result<Json, DaggerError> {
8404 let query = self.selection.select("defaultValue");
8405 query.execute(self.graphql_client.clone()).await
8406 }
8407 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8409 let query = self.selection.select("deprecated");
8410 query.execute(self.graphql_client.clone()).await
8411 }
8412 pub async fn description(&self) -> Result<String, DaggerError> {
8414 let query = self.selection.select("description");
8415 query.execute(self.graphql_client.clone()).await
8416 }
8417 pub async fn id(&self) -> Result<Id, DaggerError> {
8419 let query = self.selection.select("id");
8420 query.execute(self.graphql_client.clone()).await
8421 }
8422 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8424 let query = self.selection.select("ignore");
8425 query.execute(self.graphql_client.clone()).await
8426 }
8427 pub async fn name(&self) -> Result<String, DaggerError> {
8429 let query = self.selection.select("name");
8430 query.execute(self.graphql_client.clone()).await
8431 }
8432 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8434 let query = self.selection.select("sourceMap");
8435 let query = query.select("id");
8436 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8437 Ok(id.map(|id| SourceMap {
8438 proc: self.proc.clone(),
8439 selection: query
8440 .root()
8441 .select("node")
8442 .arg("id", &id.0)
8443 .inline_fragment("SourceMap"),
8444 graphql_client: self.graphql_client.clone(),
8445 }))
8446 }
8447 pub fn type_def(&self) -> TypeDef {
8449 let query = self.selection.select("typeDef");
8450 TypeDef {
8451 proc: self.proc.clone(),
8452 selection: query,
8453 graphql_client: self.graphql_client.clone(),
8454 }
8455 }
8456}
8457impl Node for FunctionArg {
8458 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8459 let query = self.selection.select("id");
8460 let graphql_client = self.graphql_client.clone();
8461 async move { query.execute(graphql_client).await }
8462 }
8463}
8464#[derive(Clone)]
8465pub struct FunctionCall {
8466 pub proc: Option<Arc<DaggerSessionProc>>,
8467 pub selection: Selection,
8468 pub graphql_client: DynGraphQLClient,
8469}
8470impl IntoID<Id> for FunctionCall {
8471 fn into_id(
8472 self,
8473 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8474 Box::pin(async move { self.id().await })
8475 }
8476}
8477impl Loadable for FunctionCall {
8478 fn graphql_type() -> &'static str {
8479 "FunctionCall"
8480 }
8481 fn from_query(
8482 proc: Option<Arc<DaggerSessionProc>>,
8483 selection: Selection,
8484 graphql_client: DynGraphQLClient,
8485 ) -> Self {
8486 Self {
8487 proc,
8488 selection,
8489 graphql_client,
8490 }
8491 }
8492}
8493impl FunctionCall {
8494 pub async fn id(&self) -> Result<Id, DaggerError> {
8496 let query = self.selection.select("id");
8497 query.execute(self.graphql_client.clone()).await
8498 }
8499 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
8501 let query = self.selection.select("inputArgs");
8502 let query = query.select("id");
8503 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8504 Ok(ids
8505 .into_iter()
8506 .map(|id| FunctionCallArgValue {
8507 proc: self.proc.clone(),
8508 selection: crate::querybuilder::query()
8509 .select("node")
8510 .arg("id", &id.0)
8511 .inline_fragment("FunctionCallArgValue"),
8512 graphql_client: self.graphql_client.clone(),
8513 })
8514 .collect())
8515 }
8516 pub async fn name(&self) -> Result<String, DaggerError> {
8518 let query = self.selection.select("name");
8519 query.execute(self.graphql_client.clone()).await
8520 }
8521 pub async fn parent(&self) -> Result<Json, DaggerError> {
8523 let query = self.selection.select("parent");
8524 query.execute(self.graphql_client.clone()).await
8525 }
8526 pub async fn parent_name(&self) -> Result<String, DaggerError> {
8528 let query = self.selection.select("parentName");
8529 query.execute(self.graphql_client.clone()).await
8530 }
8531 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
8537 let mut query = self.selection.select("returnError");
8538 query = query.arg_lazy(
8539 "error",
8540 Box::new(move || {
8541 let error = error.clone();
8542 Box::pin(async move { error.into_id().await.unwrap().quote() })
8543 }),
8544 );
8545 query.execute(self.graphql_client.clone()).await
8546 }
8547 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8553 let mut query = self.selection.select("returnValue");
8554 query = query.arg("value", value);
8555 query.execute(self.graphql_client.clone()).await
8556 }
8557}
8558impl Node for FunctionCall {
8559 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8560 let query = self.selection.select("id");
8561 let graphql_client = self.graphql_client.clone();
8562 async move { query.execute(graphql_client).await }
8563 }
8564}
8565#[derive(Clone)]
8566pub struct FunctionCallArgValue {
8567 pub proc: Option<Arc<DaggerSessionProc>>,
8568 pub selection: Selection,
8569 pub graphql_client: DynGraphQLClient,
8570}
8571impl IntoID<Id> for FunctionCallArgValue {
8572 fn into_id(
8573 self,
8574 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8575 Box::pin(async move { self.id().await })
8576 }
8577}
8578impl Loadable for FunctionCallArgValue {
8579 fn graphql_type() -> &'static str {
8580 "FunctionCallArgValue"
8581 }
8582 fn from_query(
8583 proc: Option<Arc<DaggerSessionProc>>,
8584 selection: Selection,
8585 graphql_client: DynGraphQLClient,
8586 ) -> Self {
8587 Self {
8588 proc,
8589 selection,
8590 graphql_client,
8591 }
8592 }
8593}
8594impl FunctionCallArgValue {
8595 pub async fn id(&self) -> Result<Id, DaggerError> {
8597 let query = self.selection.select("id");
8598 query.execute(self.graphql_client.clone()).await
8599 }
8600 pub async fn name(&self) -> Result<String, DaggerError> {
8602 let query = self.selection.select("name");
8603 query.execute(self.graphql_client.clone()).await
8604 }
8605 pub async fn value(&self) -> Result<Json, DaggerError> {
8607 let query = self.selection.select("value");
8608 query.execute(self.graphql_client.clone()).await
8609 }
8610}
8611impl Node for FunctionCallArgValue {
8612 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8613 let query = self.selection.select("id");
8614 let graphql_client = self.graphql_client.clone();
8615 async move { query.execute(graphql_client).await }
8616 }
8617}
8618#[derive(Clone)]
8619pub struct GeneratedCode {
8620 pub proc: Option<Arc<DaggerSessionProc>>,
8621 pub selection: Selection,
8622 pub graphql_client: DynGraphQLClient,
8623}
8624impl IntoID<Id> for GeneratedCode {
8625 fn into_id(
8626 self,
8627 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8628 Box::pin(async move { self.id().await })
8629 }
8630}
8631impl Loadable for GeneratedCode {
8632 fn graphql_type() -> &'static str {
8633 "GeneratedCode"
8634 }
8635 fn from_query(
8636 proc: Option<Arc<DaggerSessionProc>>,
8637 selection: Selection,
8638 graphql_client: DynGraphQLClient,
8639 ) -> Self {
8640 Self {
8641 proc,
8642 selection,
8643 graphql_client,
8644 }
8645 }
8646}
8647impl GeneratedCode {
8648 pub fn code(&self) -> Directory {
8650 let query = self.selection.select("code");
8651 Directory {
8652 proc: self.proc.clone(),
8653 selection: query,
8654 graphql_client: self.graphql_client.clone(),
8655 }
8656 }
8657 pub async fn id(&self) -> Result<Id, DaggerError> {
8659 let query = self.selection.select("id");
8660 query.execute(self.graphql_client.clone()).await
8661 }
8662 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8664 let query = self.selection.select("vcsGeneratedPaths");
8665 query.execute(self.graphql_client.clone()).await
8666 }
8667 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8669 let query = self.selection.select("vcsIgnoredPaths");
8670 query.execute(self.graphql_client.clone()).await
8671 }
8672 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8674 let mut query = self.selection.select("withVCSGeneratedPaths");
8675 query = query.arg(
8676 "paths",
8677 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8678 );
8679 GeneratedCode {
8680 proc: self.proc.clone(),
8681 selection: query,
8682 graphql_client: self.graphql_client.clone(),
8683 }
8684 }
8685 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8687 let mut query = self.selection.select("withVCSIgnoredPaths");
8688 query = query.arg(
8689 "paths",
8690 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8691 );
8692 GeneratedCode {
8693 proc: self.proc.clone(),
8694 selection: query,
8695 graphql_client: self.graphql_client.clone(),
8696 }
8697 }
8698}
8699impl Node for GeneratedCode {
8700 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8701 let query = self.selection.select("id");
8702 let graphql_client = self.graphql_client.clone();
8703 async move { query.execute(graphql_client).await }
8704 }
8705}
8706#[derive(Clone)]
8707pub struct Generator {
8708 pub proc: Option<Arc<DaggerSessionProc>>,
8709 pub selection: Selection,
8710 pub graphql_client: DynGraphQLClient,
8711}
8712impl IntoID<Id> for Generator {
8713 fn into_id(
8714 self,
8715 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8716 Box::pin(async move { self.id().await })
8717 }
8718}
8719impl Loadable for Generator {
8720 fn graphql_type() -> &'static str {
8721 "Generator"
8722 }
8723 fn from_query(
8724 proc: Option<Arc<DaggerSessionProc>>,
8725 selection: Selection,
8726 graphql_client: DynGraphQLClient,
8727 ) -> Self {
8728 Self {
8729 proc,
8730 selection,
8731 graphql_client,
8732 }
8733 }
8734}
8735impl Generator {
8736 pub fn changes(&self) -> Changeset {
8738 let query = self.selection.select("changes");
8739 Changeset {
8740 proc: self.proc.clone(),
8741 selection: query,
8742 graphql_client: self.graphql_client.clone(),
8743 }
8744 }
8745 pub async fn completed(&self) -> Result<bool, DaggerError> {
8747 let query = self.selection.select("completed");
8748 query.execute(self.graphql_client.clone()).await
8749 }
8750 pub async fn description(&self) -> Result<String, DaggerError> {
8752 let query = self.selection.select("description");
8753 query.execute(self.graphql_client.clone()).await
8754 }
8755 pub async fn id(&self) -> Result<Id, DaggerError> {
8757 let query = self.selection.select("id");
8758 query.execute(self.graphql_client.clone()).await
8759 }
8760 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8762 let query = self.selection.select("isEmpty");
8763 query.execute(self.graphql_client.clone()).await
8764 }
8765 pub async fn name(&self) -> Result<String, DaggerError> {
8767 let query = self.selection.select("name");
8768 query.execute(self.graphql_client.clone()).await
8769 }
8770 pub async fn original_module(&self) -> Result<Option<Module>, DaggerError> {
8772 let query = self.selection.select("originalModule");
8773 let query = query.select("id");
8774 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8775 Ok(id.map(|id| Module {
8776 proc: self.proc.clone(),
8777 selection: query
8778 .root()
8779 .select("node")
8780 .arg("id", &id.0)
8781 .inline_fragment("Module"),
8782 graphql_client: self.graphql_client.clone(),
8783 }))
8784 }
8785 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8787 let query = self.selection.select("path");
8788 query.execute(self.graphql_client.clone()).await
8789 }
8790 pub fn run(&self) -> Generator {
8792 let query = self.selection.select("run");
8793 Generator {
8794 proc: self.proc.clone(),
8795 selection: query,
8796 graphql_client: self.graphql_client.clone(),
8797 }
8798 }
8799}
8800impl Node for Generator {
8801 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8802 let query = self.selection.select("id");
8803 let graphql_client = self.graphql_client.clone();
8804 async move { query.execute(graphql_client).await }
8805 }
8806}
8807#[derive(Clone)]
8808pub struct GeneratorGroup {
8809 pub proc: Option<Arc<DaggerSessionProc>>,
8810 pub selection: Selection,
8811 pub graphql_client: DynGraphQLClient,
8812}
8813#[derive(Builder, Debug, PartialEq)]
8814pub struct GeneratorGroupChangesOpts {
8815 #[builder(setter(into, strip_option), default)]
8817 pub on_conflict: Option<ChangesetsMergeConflict>,
8818}
8819#[derive(Builder, Debug, PartialEq)]
8820pub struct GeneratorGroupWorkspaceOpts {
8821 #[builder(setter(into, strip_option), default)]
8823 pub on_conflict: Option<ChangesetsMergeConflict>,
8824}
8825impl IntoID<Id> for GeneratorGroup {
8826 fn into_id(
8827 self,
8828 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8829 Box::pin(async move { self.id().await })
8830 }
8831}
8832impl Loadable for GeneratorGroup {
8833 fn graphql_type() -> &'static str {
8834 "GeneratorGroup"
8835 }
8836 fn from_query(
8837 proc: Option<Arc<DaggerSessionProc>>,
8838 selection: Selection,
8839 graphql_client: DynGraphQLClient,
8840 ) -> Self {
8841 Self {
8842 proc,
8843 selection,
8844 graphql_client,
8845 }
8846 }
8847}
8848impl GeneratorGroup {
8849 pub fn changes(&self) -> Changeset {
8857 let query = self.selection.select("changes");
8858 Changeset {
8859 proc: self.proc.clone(),
8860 selection: query,
8861 graphql_client: self.graphql_client.clone(),
8862 }
8863 }
8864 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
8872 let mut query = self.selection.select("changes");
8873 if let Some(on_conflict) = opts.on_conflict {
8874 query = query.arg("onConflict", on_conflict);
8875 }
8876 Changeset {
8877 proc: self.proc.clone(),
8878 selection: query,
8879 graphql_client: self.graphql_client.clone(),
8880 }
8881 }
8882 pub async fn id(&self) -> Result<Id, DaggerError> {
8884 let query = self.selection.select("id");
8885 query.execute(self.graphql_client.clone()).await
8886 }
8887 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
8889 let query = self.selection.select("isEmpty");
8890 query.execute(self.graphql_client.clone()).await
8891 }
8892 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
8894 let query = self.selection.select("list");
8895 let query = query.select("id");
8896 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8897 Ok(ids
8898 .into_iter()
8899 .map(|id| Generator {
8900 proc: self.proc.clone(),
8901 selection: crate::querybuilder::query()
8902 .select("node")
8903 .arg("id", &id.0)
8904 .inline_fragment("Generator"),
8905 graphql_client: self.graphql_client.clone(),
8906 })
8907 .collect())
8908 }
8909 pub async fn load_failures(&self) -> Result<Vec<String>, DaggerError> {
8912 let query = self.selection.select("loadFailures");
8913 query.execute(self.graphql_client.clone()).await
8914 }
8915 pub fn run(&self) -> GeneratorGroup {
8917 let query = self.selection.select("run");
8918 GeneratorGroup {
8919 proc: self.proc.clone(),
8920 selection: query,
8921 graphql_client: self.graphql_client.clone(),
8922 }
8923 }
8924 pub fn workspace(&self) -> Workspace {
8930 let query = self.selection.select("workspace");
8931 Workspace {
8932 proc: self.proc.clone(),
8933 selection: query,
8934 graphql_client: self.graphql_client.clone(),
8935 }
8936 }
8937 pub fn workspace_opts(&self, opts: GeneratorGroupWorkspaceOpts) -> Workspace {
8943 let mut query = self.selection.select("workspace");
8944 if let Some(on_conflict) = opts.on_conflict {
8945 query = query.arg("onConflict", on_conflict);
8946 }
8947 Workspace {
8948 proc: self.proc.clone(),
8949 selection: query,
8950 graphql_client: self.graphql_client.clone(),
8951 }
8952 }
8953}
8954impl Node for GeneratorGroup {
8955 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8956 let query = self.selection.select("id");
8957 let graphql_client = self.graphql_client.clone();
8958 async move { query.execute(graphql_client).await }
8959 }
8960}
8961#[derive(Clone)]
8962pub struct GitBundle {
8963 pub proc: Option<Arc<DaggerSessionProc>>,
8964 pub selection: Selection,
8965 pub graphql_client: DynGraphQLClient,
8966}
8967impl IntoID<Id> for GitBundle {
8968 fn into_id(
8969 self,
8970 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8971 Box::pin(async move { self.id().await })
8972 }
8973}
8974impl Loadable for GitBundle {
8975 fn graphql_type() -> &'static str {
8976 "GitBundle"
8977 }
8978 fn from_query(
8979 proc: Option<Arc<DaggerSessionProc>>,
8980 selection: Selection,
8981 graphql_client: DynGraphQLClient,
8982 ) -> Self {
8983 Self {
8984 proc,
8985 selection,
8986 graphql_client,
8987 }
8988 }
8989}
8990impl GitBundle {
8991 pub fn as_file(&self) -> File {
8993 let query = self.selection.select("asFile");
8994 File {
8995 proc: self.proc.clone(),
8996 selection: query,
8997 graphql_client: self.graphql_client.clone(),
8998 }
8999 }
9000 pub async fn id(&self) -> Result<Id, DaggerError> {
9002 let query = self.selection.select("id");
9003 query.execute(self.graphql_client.clone()).await
9004 }
9005 pub async fn object_format(&self) -> Result<String, DaggerError> {
9007 let query = self.selection.select("objectFormat");
9008 query.execute(self.graphql_client.clone()).await
9009 }
9010 pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
9012 let query = self.selection.select("prerequisiteSHAs");
9013 query.execute(self.graphql_client.clone()).await
9014 }
9015 pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
9017 let query = self.selection.select("refs");
9018 let query = query.select("id");
9019 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9020 Ok(ids
9021 .into_iter()
9022 .map(|id| GitBundleRef {
9023 proc: self.proc.clone(),
9024 selection: crate::querybuilder::query()
9025 .select("node")
9026 .arg("id", &id.0)
9027 .inline_fragment("GitBundleRef"),
9028 graphql_client: self.graphql_client.clone(),
9029 })
9030 .collect())
9031 }
9032 pub fn validate(&self) -> GitBundle {
9034 let query = self.selection.select("validate");
9035 GitBundle {
9036 proc: self.proc.clone(),
9037 selection: query,
9038 graphql_client: self.graphql_client.clone(),
9039 }
9040 }
9041 pub async fn version(&self) -> Result<isize, DaggerError> {
9043 let query = self.selection.select("version");
9044 query.execute(self.graphql_client.clone()).await
9045 }
9046}
9047impl Node for GitBundle {
9048 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9049 let query = self.selection.select("id");
9050 let graphql_client = self.graphql_client.clone();
9051 async move { query.execute(graphql_client).await }
9052 }
9053}
9054#[derive(Clone)]
9055pub struct GitBundleRef {
9056 pub proc: Option<Arc<DaggerSessionProc>>,
9057 pub selection: Selection,
9058 pub graphql_client: DynGraphQLClient,
9059}
9060impl IntoID<Id> for GitBundleRef {
9061 fn into_id(
9062 self,
9063 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9064 Box::pin(async move { self.id().await })
9065 }
9066}
9067impl Loadable for GitBundleRef {
9068 fn graphql_type() -> &'static str {
9069 "GitBundleRef"
9070 }
9071 fn from_query(
9072 proc: Option<Arc<DaggerSessionProc>>,
9073 selection: Selection,
9074 graphql_client: DynGraphQLClient,
9075 ) -> Self {
9076 Self {
9077 proc,
9078 selection,
9079 graphql_client,
9080 }
9081 }
9082}
9083impl GitBundleRef {
9084 pub async fn id(&self) -> Result<Id, DaggerError> {
9086 let query = self.selection.select("id");
9087 query.execute(self.graphql_client.clone()).await
9088 }
9089 pub async fn name(&self) -> Result<String, DaggerError> {
9091 let query = self.selection.select("name");
9092 query.execute(self.graphql_client.clone()).await
9093 }
9094 pub async fn sha(&self) -> Result<String, DaggerError> {
9096 let query = self.selection.select("sha");
9097 query.execute(self.graphql_client.clone()).await
9098 }
9099}
9100impl Node for GitBundleRef {
9101 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9102 let query = self.selection.select("id");
9103 let graphql_client = self.graphql_client.clone();
9104 async move { query.execute(graphql_client).await }
9105 }
9106}
9107#[derive(Clone)]
9108pub struct GitCommit {
9109 pub proc: Option<Arc<DaggerSessionProc>>,
9110 pub selection: Selection,
9111 pub graphql_client: DynGraphQLClient,
9112}
9113#[derive(Builder, Debug, PartialEq)]
9114pub struct GitCommitAncestorReleaseTagOpts {
9115 #[builder(setter(into, strip_option), default)]
9117 pub include_pre_release: Option<bool>,
9118}
9119#[derive(Builder, Debug, PartialEq)]
9120pub struct GitCommitChangesOpts {
9121 #[builder(setter(into, strip_option), default)]
9123 pub against: Option<Id>,
9124}
9125#[derive(Builder, Debug, PartialEq)]
9126pub struct GitCommitReleaseTagOpts {
9127 #[builder(setter(into, strip_option), default)]
9129 pub include_pre_release: Option<bool>,
9130}
9131#[derive(Builder, Debug, PartialEq)]
9132pub struct GitCommitTreeOpts {
9133 #[builder(setter(into, strip_option), default)]
9135 pub depth: Option<isize>,
9136 #[builder(setter(into, strip_option), default)]
9138 pub discard_git_dir: Option<bool>,
9139 #[builder(setter(into, strip_option), default)]
9141 pub include_tags: Option<bool>,
9142}
9143impl IntoID<Id> for GitCommit {
9144 fn into_id(
9145 self,
9146 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9147 Box::pin(async move { self.id().await })
9148 }
9149}
9150impl Loadable for GitCommit {
9151 fn graphql_type() -> &'static str {
9152 "GitCommit"
9153 }
9154 fn from_query(
9155 proc: Option<Arc<DaggerSessionProc>>,
9156 selection: Selection,
9157 graphql_client: DynGraphQLClient,
9158 ) -> Self {
9159 Self {
9160 proc,
9161 selection,
9162 graphql_client,
9163 }
9164 }
9165}
9166impl GitCommit {
9167 pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
9173 let query = self.selection.select("ancestorReleaseTag");
9174 let query = query.select("id");
9175 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9176 Ok(id.map(|id| GitRef {
9177 proc: self.proc.clone(),
9178 selection: query
9179 .root()
9180 .select("node")
9181 .arg("id", &id.0)
9182 .inline_fragment("GitRef"),
9183 graphql_client: self.graphql_client.clone(),
9184 }))
9185 }
9186 pub async fn ancestor_release_tag_opts(
9192 &self,
9193 opts: GitCommitAncestorReleaseTagOpts,
9194 ) -> Result<Option<GitRef>, DaggerError> {
9195 let mut query = self.selection.select("ancestorReleaseTag");
9196 if let Some(include_pre_release) = opts.include_pre_release {
9197 query = query.arg("includePreRelease", include_pre_release);
9198 }
9199 let query = query.select("id");
9200 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9201 Ok(id.map(|id| GitRef {
9202 proc: self.proc.clone(),
9203 selection: query
9204 .root()
9205 .select("node")
9206 .arg("id", &id.0)
9207 .inline_fragment("GitRef"),
9208 graphql_client: self.graphql_client.clone(),
9209 }))
9210 }
9211 pub async fn author_email(&self) -> Result<String, DaggerError> {
9213 let query = self.selection.select("authorEmail");
9214 query.execute(self.graphql_client.clone()).await
9215 }
9216 pub async fn author_name(&self) -> Result<String, DaggerError> {
9218 let query = self.selection.select("authorName");
9219 query.execute(self.graphql_client.clone()).await
9220 }
9221 pub async fn authored_date(&self) -> Result<String, DaggerError> {
9223 let query = self.selection.select("authoredDate");
9224 query.execute(self.graphql_client.clone()).await
9225 }
9226 pub fn changes(&self) -> Changeset {
9233 let query = self.selection.select("changes");
9234 Changeset {
9235 proc: self.proc.clone(),
9236 selection: query,
9237 graphql_client: self.graphql_client.clone(),
9238 }
9239 }
9240 pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
9247 let mut query = self.selection.select("changes");
9248 if let Some(against) = opts.against {
9249 query = query.arg("against", against);
9250 }
9251 Changeset {
9252 proc: self.proc.clone(),
9253 selection: query,
9254 graphql_client: self.graphql_client.clone(),
9255 }
9256 }
9257 pub async fn committed_date(&self) -> Result<String, DaggerError> {
9259 let query = self.selection.select("committedDate");
9260 query.execute(self.graphql_client.clone()).await
9261 }
9262 pub async fn committer_email(&self) -> Result<String, DaggerError> {
9264 let query = self.selection.select("committerEmail");
9265 query.execute(self.graphql_client.clone()).await
9266 }
9267 pub async fn committer_name(&self) -> Result<String, DaggerError> {
9269 let query = self.selection.select("committerName");
9270 query.execute(self.graphql_client.clone()).await
9271 }
9272 pub async fn id(&self) -> Result<Id, DaggerError> {
9274 let query = self.selection.select("id");
9275 query.execute(self.graphql_client.clone()).await
9276 }
9277 pub async fn message(&self) -> Result<String, DaggerError> {
9279 let query = self.selection.select("message");
9280 query.execute(self.graphql_client.clone()).await
9281 }
9282 pub async fn message_body(&self) -> Result<String, DaggerError> {
9284 let query = self.selection.select("messageBody");
9285 query.execute(self.graphql_client.clone()).await
9286 }
9287 pub async fn message_headline(&self) -> Result<String, DaggerError> {
9289 let query = self.selection.select("messageHeadline");
9290 query.execute(self.graphql_client.clone()).await
9291 }
9292 pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
9294 let query = self.selection.select("parentShas");
9295 query.execute(self.graphql_client.clone()).await
9296 }
9297 pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
9303 let query = self.selection.select("releaseTag");
9304 let query = query.select("id");
9305 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9306 Ok(id.map(|id| GitRef {
9307 proc: self.proc.clone(),
9308 selection: query
9309 .root()
9310 .select("node")
9311 .arg("id", &id.0)
9312 .inline_fragment("GitRef"),
9313 graphql_client: self.graphql_client.clone(),
9314 }))
9315 }
9316 pub async fn release_tag_opts(
9322 &self,
9323 opts: GitCommitReleaseTagOpts,
9324 ) -> Result<Option<GitRef>, DaggerError> {
9325 let mut query = self.selection.select("releaseTag");
9326 if let Some(include_pre_release) = opts.include_pre_release {
9327 query = query.arg("includePreRelease", include_pre_release);
9328 }
9329 let query = query.select("id");
9330 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9331 Ok(id.map(|id| GitRef {
9332 proc: self.proc.clone(),
9333 selection: query
9334 .root()
9335 .select("node")
9336 .arg("id", &id.0)
9337 .inline_fragment("GitRef"),
9338 graphql_client: self.graphql_client.clone(),
9339 }))
9340 }
9341 pub async fn sha(&self) -> Result<String, DaggerError> {
9343 let query = self.selection.select("sha");
9344 query.execute(self.graphql_client.clone()).await
9345 }
9346 pub async fn short_sha(&self) -> Result<String, DaggerError> {
9348 let query = self.selection.select("shortSha");
9349 query.execute(self.graphql_client.clone()).await
9350 }
9351 pub fn tree(&self) -> Directory {
9357 let query = self.selection.select("tree");
9358 Directory {
9359 proc: self.proc.clone(),
9360 selection: query,
9361 graphql_client: self.graphql_client.clone(),
9362 }
9363 }
9364 pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
9370 let mut query = self.selection.select("tree");
9371 if let Some(discard_git_dir) = opts.discard_git_dir {
9372 query = query.arg("discardGitDir", discard_git_dir);
9373 }
9374 if let Some(depth) = opts.depth {
9375 query = query.arg("depth", depth);
9376 }
9377 if let Some(include_tags) = opts.include_tags {
9378 query = query.arg("includeTags", include_tags);
9379 }
9380 Directory {
9381 proc: self.proc.clone(),
9382 selection: query,
9383 graphql_client: self.graphql_client.clone(),
9384 }
9385 }
9386}
9387impl Node for GitCommit {
9388 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9389 let query = self.selection.select("id");
9390 let graphql_client = self.graphql_client.clone();
9391 async move { query.execute(graphql_client).await }
9392 }
9393}
9394#[derive(Clone)]
9395pub struct GitPushResult {
9396 pub proc: Option<Arc<DaggerSessionProc>>,
9397 pub selection: Selection,
9398 pub graphql_client: DynGraphQLClient,
9399}
9400impl IntoID<Id> for GitPushResult {
9401 fn into_id(
9402 self,
9403 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9404 Box::pin(async move { self.id().await })
9405 }
9406}
9407impl Loadable for GitPushResult {
9408 fn graphql_type() -> &'static str {
9409 "GitPushResult"
9410 }
9411 fn from_query(
9412 proc: Option<Arc<DaggerSessionProc>>,
9413 selection: Selection,
9414 graphql_client: DynGraphQLClient,
9415 ) -> Self {
9416 Self {
9417 proc,
9418 selection,
9419 graphql_client,
9420 }
9421 }
9422}
9423impl GitPushResult {
9424 pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
9426 let query = self.selection.select("disposition");
9427 query.execute(self.graphql_client.clone()).await
9428 }
9429 pub async fn id(&self) -> Result<Id, DaggerError> {
9431 let query = self.selection.select("id");
9432 query.execute(self.graphql_client.clone()).await
9433 }
9434 pub async fn previous_sha(&self) -> Result<String, DaggerError> {
9436 let query = self.selection.select("previousSHA");
9437 query.execute(self.graphql_client.clone()).await
9438 }
9439 pub async fn r#ref(&self) -> Result<String, DaggerError> {
9441 let query = self.selection.select("ref");
9442 query.execute(self.graphql_client.clone()).await
9443 }
9444 pub async fn sha(&self) -> Result<String, DaggerError> {
9446 let query = self.selection.select("sha");
9447 query.execute(self.graphql_client.clone()).await
9448 }
9449}
9450impl Node for GitPushResult {
9451 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9452 let query = self.selection.select("id");
9453 let graphql_client = self.graphql_client.clone();
9454 async move { query.execute(graphql_client).await }
9455 }
9456}
9457#[derive(Clone)]
9458pub struct GitRef {
9459 pub proc: Option<Arc<DaggerSessionProc>>,
9460 pub selection: Selection,
9461 pub graphql_client: DynGraphQLClient,
9462}
9463#[derive(Builder, Debug, PartialEq)]
9464pub struct GitRefAsWorkspaceOpts<'a> {
9465 #[builder(setter(into, strip_option), default)]
9467 pub cwd: Option<&'a str>,
9468}
9469#[derive(Builder, Debug, PartialEq)]
9470pub struct GitRefLogOpts<'a> {
9471 #[builder(setter(into, strip_option), default)]
9473 pub base: Option<Id>,
9474 #[builder(setter(into, strip_option), default)]
9476 pub limit: Option<isize>,
9477 #[builder(setter(into, strip_option), default)]
9479 pub paths: Option<Vec<&'a str>>,
9480}
9481#[derive(Builder, Debug, PartialEq)]
9482pub struct GitRefPushOpts<'a> {
9483 #[builder(setter(into, strip_option), default)]
9485 pub branch: Option<&'a str>,
9486 #[builder(setter(into, strip_option), default)]
9488 pub expected_remote_sha: Option<&'a str>,
9489 #[builder(setter(into, strip_option), default)]
9491 pub remote: Option<&'a str>,
9492 #[builder(setter(into, strip_option), default)]
9494 pub to: Option<Id>,
9495}
9496#[derive(Builder, Debug, PartialEq)]
9497pub struct GitRefTreeOpts {
9498 #[builder(setter(into, strip_option), default)]
9500 pub depth: Option<isize>,
9501 #[builder(setter(into, strip_option), default)]
9503 pub discard_git_dir: Option<bool>,
9504 #[builder(setter(into, strip_option), default)]
9506 pub include_tags: Option<bool>,
9507}
9508#[derive(Builder, Debug, PartialEq)]
9509pub struct GitRefWithCommitOpts<'a> {
9510 #[builder(setter(into, strip_option), default)]
9512 pub allow_empty: Option<bool>,
9513 #[builder(setter(into, strip_option), default)]
9515 pub committer_date: Option<&'a str>,
9516 #[builder(setter(into, strip_option), default)]
9518 pub committer_email: Option<&'a str>,
9519 #[builder(setter(into, strip_option), default)]
9521 pub committer_name: Option<&'a str>,
9522 #[builder(setter(into, strip_option), default)]
9524 pub signoff: Option<bool>,
9525}
9526impl IntoID<Id> for GitRef {
9527 fn into_id(
9528 self,
9529 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9530 Box::pin(async move { self.id().await })
9531 }
9532}
9533impl Loadable for GitRef {
9534 fn graphql_type() -> &'static str {
9535 "GitRef"
9536 }
9537 fn from_query(
9538 proc: Option<Arc<DaggerSessionProc>>,
9539 selection: Selection,
9540 graphql_client: DynGraphQLClient,
9541 ) -> Self {
9542 Self {
9543 proc,
9544 selection,
9545 graphql_client,
9546 }
9547 }
9548}
9549impl GitRef {
9550 pub fn as_repository(&self) -> GitRepository {
9553 let query = self.selection.select("asRepository");
9554 GitRepository {
9555 proc: self.proc.clone(),
9556 selection: query,
9557 graphql_client: self.graphql_client.clone(),
9558 }
9559 }
9560 pub fn as_workspace(&self) -> Workspace {
9566 let query = self.selection.select("asWorkspace");
9567 Workspace {
9568 proc: self.proc.clone(),
9569 selection: query,
9570 graphql_client: self.graphql_client.clone(),
9571 }
9572 }
9573 pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
9579 let mut query = self.selection.select("asWorkspace");
9580 if let Some(cwd) = opts.cwd {
9581 query = query.arg("cwd", cwd);
9582 }
9583 Workspace {
9584 proc: self.proc.clone(),
9585 selection: query,
9586 graphql_client: self.graphql_client.clone(),
9587 }
9588 }
9589 pub async fn commit(&self) -> Result<String, DaggerError> {
9591 let query = self.selection.select("commit");
9592 query.execute(self.graphql_client.clone()).await
9593 }
9594 pub async fn commit_sha(&self) -> Result<String, DaggerError> {
9596 let query = self.selection.select("commitSHA");
9597 query.execute(self.graphql_client.clone()).await
9598 }
9599 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9605 let mut query = self.selection.select("commonAncestor");
9606 query = query.arg_lazy(
9607 "other",
9608 Box::new(move || {
9609 let other = other.clone();
9610 Box::pin(async move { other.into_id().await.unwrap().quote() })
9611 }),
9612 );
9613 GitRef {
9614 proc: self.proc.clone(),
9615 selection: query,
9616 graphql_client: self.graphql_client.clone(),
9617 }
9618 }
9619 pub async fn id(&self) -> Result<Id, DaggerError> {
9621 let query = self.selection.select("id");
9622 query.execute(self.graphql_client.clone()).await
9623 }
9624 pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
9630 let query = self.selection.select("log");
9631 let query = query.select("id");
9632 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9633 Ok(ids
9634 .into_iter()
9635 .map(|id| GitCommit {
9636 proc: self.proc.clone(),
9637 selection: crate::querybuilder::query()
9638 .select("node")
9639 .arg("id", &id.0)
9640 .inline_fragment("GitCommit"),
9641 graphql_client: self.graphql_client.clone(),
9642 })
9643 .collect())
9644 }
9645 pub async fn log_opts<'a>(
9651 &self,
9652 opts: GitRefLogOpts<'a>,
9653 ) -> Result<Vec<GitCommit>, DaggerError> {
9654 let mut query = self.selection.select("log");
9655 if let Some(limit) = opts.limit {
9656 query = query.arg("limit", limit);
9657 }
9658 if let Some(paths) = opts.paths {
9659 query = query.arg("paths", paths);
9660 }
9661 if let Some(base) = opts.base {
9662 query = query.arg("base", base);
9663 }
9664 let query = query.select("id");
9665 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9666 Ok(ids
9667 .into_iter()
9668 .map(|id| GitCommit {
9669 proc: self.proc.clone(),
9670 selection: crate::querybuilder::query()
9671 .select("node")
9672 .arg("id", &id.0)
9673 .inline_fragment("GitCommit"),
9674 graphql_client: self.graphql_client.clone(),
9675 })
9676 .collect())
9677 }
9678 pub async fn name(&self) -> Result<String, DaggerError> {
9680 let query = self.selection.select("name");
9681 query.execute(self.graphql_client.clone()).await
9682 }
9683 pub fn push(&self) -> GitPushResult {
9691 let query = self.selection.select("push");
9692 GitPushResult {
9693 proc: self.proc.clone(),
9694 selection: query,
9695 graphql_client: self.graphql_client.clone(),
9696 }
9697 }
9698 pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
9706 let mut query = self.selection.select("push");
9707 if let Some(to) = opts.to {
9708 query = query.arg("to", to);
9709 }
9710 if let Some(remote) = opts.remote {
9711 query = query.arg("remote", remote);
9712 }
9713 if let Some(branch) = opts.branch {
9714 query = query.arg("branch", branch);
9715 }
9716 if let Some(expected_remote_sha) = opts.expected_remote_sha {
9717 query = query.arg("expectedRemoteSHA", expected_remote_sha);
9718 }
9719 GitPushResult {
9720 proc: self.proc.clone(),
9721 selection: query,
9722 graphql_client: self.graphql_client.clone(),
9723 }
9724 }
9725 pub async fn r#ref(&self) -> Result<String, DaggerError> {
9727 let query = self.selection.select("ref");
9728 query.execute(self.graphql_client.clone()).await
9729 }
9730 pub fn target_commit(&self) -> GitCommit {
9732 let query = self.selection.select("targetCommit");
9733 GitCommit {
9734 proc: self.proc.clone(),
9735 selection: query,
9736 graphql_client: self.graphql_client.clone(),
9737 }
9738 }
9739 pub fn tree(&self) -> Directory {
9745 let query = self.selection.select("tree");
9746 Directory {
9747 proc: self.proc.clone(),
9748 selection: query,
9749 graphql_client: self.graphql_client.clone(),
9750 }
9751 }
9752 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9758 let mut query = self.selection.select("tree");
9759 if let Some(discard_git_dir) = opts.discard_git_dir {
9760 query = query.arg("discardGitDir", discard_git_dir);
9761 }
9762 if let Some(depth) = opts.depth {
9763 query = query.arg("depth", depth);
9764 }
9765 if let Some(include_tags) = opts.include_tags {
9766 query = query.arg("includeTags", include_tags);
9767 }
9768 Directory {
9769 proc: self.proc.clone(),
9770 selection: query,
9771 graphql_client: self.graphql_client.clone(),
9772 }
9773 }
9774 pub fn with_commit(
9787 &self,
9788 changes: impl IntoID<Id>,
9789 message: impl Into<String>,
9790 date: impl Into<String>,
9791 author_name: impl Into<String>,
9792 author_email: impl Into<String>,
9793 ) -> GitRef {
9794 let mut query = self.selection.select("withCommit");
9795 query = query.arg_lazy(
9796 "changes",
9797 Box::new(move || {
9798 let changes = changes.clone();
9799 Box::pin(async move { changes.into_id().await.unwrap().quote() })
9800 }),
9801 );
9802 query = query.arg("message", message.into());
9803 query = query.arg("date", date.into());
9804 query = query.arg("authorName", author_name.into());
9805 query = query.arg("authorEmail", author_email.into());
9806 GitRef {
9807 proc: self.proc.clone(),
9808 selection: query,
9809 graphql_client: self.graphql_client.clone(),
9810 }
9811 }
9812 pub fn with_commit_opts<'a>(
9825 &self,
9826 changes: impl IntoID<Id>,
9827 message: impl Into<String>,
9828 date: impl Into<String>,
9829 author_name: impl Into<String>,
9830 author_email: impl Into<String>,
9831 opts: GitRefWithCommitOpts<'a>,
9832 ) -> GitRef {
9833 let mut query = self.selection.select("withCommit");
9834 query = query.arg_lazy(
9835 "changes",
9836 Box::new(move || {
9837 let changes = changes.clone();
9838 Box::pin(async move { changes.into_id().await.unwrap().quote() })
9839 }),
9840 );
9841 query = query.arg("message", message.into());
9842 query = query.arg("date", date.into());
9843 query = query.arg("authorName", author_name.into());
9844 query = query.arg("authorEmail", author_email.into());
9845 if let Some(committer_name) = opts.committer_name {
9846 query = query.arg("committerName", committer_name);
9847 }
9848 if let Some(committer_email) = opts.committer_email {
9849 query = query.arg("committerEmail", committer_email);
9850 }
9851 if let Some(committer_date) = opts.committer_date {
9852 query = query.arg("committerDate", committer_date);
9853 }
9854 if let Some(allow_empty) = opts.allow_empty {
9855 query = query.arg("allowEmpty", allow_empty);
9856 }
9857 if let Some(signoff) = opts.signoff {
9858 query = query.arg("signoff", signoff);
9859 }
9860 GitRef {
9861 proc: self.proc.clone(),
9862 selection: query,
9863 graphql_client: self.graphql_client.clone(),
9864 }
9865 }
9866}
9867impl Node for GitRef {
9868 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9869 let query = self.selection.select("id");
9870 let graphql_client = self.graphql_client.clone();
9871 async move { query.execute(graphql_client).await }
9872 }
9873}
9874#[derive(Clone)]
9875pub struct GitRepository {
9876 pub proc: Option<Arc<DaggerSessionProc>>,
9877 pub selection: Selection,
9878 pub graphql_client: DynGraphQLClient,
9879}
9880#[derive(Builder, Debug, PartialEq)]
9881pub struct GitRepositoryAsWorkspaceOpts<'a> {
9882 #[builder(setter(into, strip_option), default)]
9884 pub cwd: Option<&'a str>,
9885}
9886#[derive(Builder, Debug, PartialEq)]
9887pub struct GitRepositoryBranchesOpts<'a> {
9888 #[builder(setter(into, strip_option), default)]
9890 pub patterns: Option<Vec<&'a str>>,
9891}
9892#[derive(Builder, Debug, PartialEq)]
9893pub struct GitRepositoryBundleOpts {
9894 #[builder(setter(into, strip_option), default)]
9896 pub base: Option<Id>,
9897}
9898#[derive(Builder, Debug, PartialEq)]
9899pub struct GitRepositoryLatestOpts<'a> {
9900 #[builder(setter(into, strip_option), default)]
9902 pub version: Option<&'a str>,
9903}
9904#[derive(Builder, Debug, PartialEq)]
9905pub struct GitRepositoryTagsOpts<'a> {
9906 #[builder(setter(into, strip_option), default)]
9908 pub patterns: Option<Vec<&'a str>>,
9909}
9910#[derive(Builder, Debug, PartialEq)]
9911pub struct GitRepositoryWithBundleOpts<'a> {
9912 #[builder(setter(into, strip_option), default)]
9914 pub prerequisite_ref: Option<&'a str>,
9915}
9916#[derive(Builder, Debug, PartialEq)]
9917pub struct GitRepositoryWithRemoteOpts<'a> {
9918 #[builder(setter(into, strip_option), default)]
9920 pub push_url: Option<&'a str>,
9921}
9922impl IntoID<Id> for GitRepository {
9923 fn into_id(
9924 self,
9925 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9926 Box::pin(async move { self.id().await })
9927 }
9928}
9929impl Loadable for GitRepository {
9930 fn graphql_type() -> &'static str {
9931 "GitRepository"
9932 }
9933 fn from_query(
9934 proc: Option<Arc<DaggerSessionProc>>,
9935 selection: Selection,
9936 graphql_client: DynGraphQLClient,
9937 ) -> Self {
9938 Self {
9939 proc,
9940 selection,
9941 graphql_client,
9942 }
9943 }
9944}
9945impl GitRepository {
9946 pub fn as_workspace(&self) -> Workspace {
9953 let query = self.selection.select("asWorkspace");
9954 Workspace {
9955 proc: self.proc.clone(),
9956 selection: query,
9957 graphql_client: self.graphql_client.clone(),
9958 }
9959 }
9960 pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
9967 let mut query = self.selection.select("asWorkspace");
9968 if let Some(cwd) = opts.cwd {
9969 query = query.arg("cwd", cwd);
9970 }
9971 Workspace {
9972 proc: self.proc.clone(),
9973 selection: query,
9974 graphql_client: self.graphql_client.clone(),
9975 }
9976 }
9977 pub fn branch(&self, name: impl Into<String>) -> GitRef {
9983 let mut query = self.selection.select("branch");
9984 query = query.arg("name", name.into());
9985 GitRef {
9986 proc: self.proc.clone(),
9987 selection: query,
9988 graphql_client: self.graphql_client.clone(),
9989 }
9990 }
9991 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9997 let query = self.selection.select("branches");
9998 query.execute(self.graphql_client.clone()).await
9999 }
10000 pub async fn branches_opts<'a>(
10006 &self,
10007 opts: GitRepositoryBranchesOpts<'a>,
10008 ) -> Result<Vec<String>, DaggerError> {
10009 let mut query = self.selection.select("branches");
10010 if let Some(patterns) = opts.patterns {
10011 query = query.arg("patterns", patterns);
10012 }
10013 query.execute(self.graphql_client.clone()).await
10014 }
10015 pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
10022 let mut query = self.selection.select("bundle");
10023 query = query.arg(
10024 "refs",
10025 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10026 );
10027 GitBundle {
10028 proc: self.proc.clone(),
10029 selection: query,
10030 graphql_client: self.graphql_client.clone(),
10031 }
10032 }
10033 pub fn bundle_opts(
10040 &self,
10041 refs: Vec<impl Into<String>>,
10042 opts: GitRepositoryBundleOpts,
10043 ) -> GitBundle {
10044 let mut query = self.selection.select("bundle");
10045 query = query.arg(
10046 "refs",
10047 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10048 );
10049 if let Some(base) = opts.base {
10050 query = query.arg("base", base);
10051 }
10052 GitBundle {
10053 proc: self.proc.clone(),
10054 selection: query,
10055 graphql_client: self.graphql_client.clone(),
10056 }
10057 }
10058 pub fn commit(&self, id: impl Into<String>) -> GitCommit {
10066 let mut query = self.selection.select("commit");
10067 query = query.arg("id", id.into());
10068 GitCommit {
10069 proc: self.proc.clone(),
10070 selection: query,
10071 graphql_client: self.graphql_client.clone(),
10072 }
10073 }
10074 pub fn head(&self) -> GitRef {
10076 let query = self.selection.select("head");
10077 GitRef {
10078 proc: self.proc.clone(),
10079 selection: query,
10080 graphql_client: self.graphql_client.clone(),
10081 }
10082 }
10083 pub async fn id(&self) -> Result<Id, DaggerError> {
10085 let query = self.selection.select("id");
10086 query.execute(self.graphql_client.clone()).await
10087 }
10088 pub fn latest(&self) -> GitRef {
10095 let query = self.selection.select("latest");
10096 GitRef {
10097 proc: self.proc.clone(),
10098 selection: query,
10099 graphql_client: self.graphql_client.clone(),
10100 }
10101 }
10102 pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
10109 let mut query = self.selection.select("latest");
10110 if let Some(version) = opts.version {
10111 query = query.arg("version", version);
10112 }
10113 GitRef {
10114 proc: self.proc.clone(),
10115 selection: query,
10116 graphql_client: self.graphql_client.clone(),
10117 }
10118 }
10119 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10127 let mut query = self.selection.select("ref");
10128 query = query.arg("name", name.into());
10129 GitRef {
10130 proc: self.proc.clone(),
10131 selection: query,
10132 graphql_client: self.graphql_client.clone(),
10133 }
10134 }
10135 pub fn tag(&self, name: impl Into<String>) -> GitRef {
10141 let mut query = self.selection.select("tag");
10142 query = query.arg("name", name.into());
10143 GitRef {
10144 proc: self.proc.clone(),
10145 selection: query,
10146 graphql_client: self.graphql_client.clone(),
10147 }
10148 }
10149 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10155 let query = self.selection.select("tags");
10156 query.execute(self.graphql_client.clone()).await
10157 }
10158 pub async fn tags_opts<'a>(
10164 &self,
10165 opts: GitRepositoryTagsOpts<'a>,
10166 ) -> Result<Vec<String>, DaggerError> {
10167 let mut query = self.selection.select("tags");
10168 if let Some(patterns) = opts.patterns {
10169 query = query.arg("patterns", patterns);
10170 }
10171 query.execute(self.graphql_client.clone()).await
10172 }
10173 pub fn uncommitted(&self) -> Changeset {
10175 let query = self.selection.select("uncommitted");
10176 Changeset {
10177 proc: self.proc.clone(),
10178 selection: query,
10179 graphql_client: self.graphql_client.clone(),
10180 }
10181 }
10182 pub async fn url(&self) -> Result<String, DaggerError> {
10184 let query = self.selection.select("url");
10185 query.execute(self.graphql_client.clone()).await
10186 }
10187 pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
10194 let mut query = self.selection.select("withBundle");
10195 query = query.arg_lazy(
10196 "bundle",
10197 Box::new(move || {
10198 let bundle = bundle.clone();
10199 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
10200 }),
10201 );
10202 GitRepository {
10203 proc: self.proc.clone(),
10204 selection: query,
10205 graphql_client: self.graphql_client.clone(),
10206 }
10207 }
10208 pub fn with_bundle_opts<'a>(
10215 &self,
10216 bundle: impl IntoID<Id>,
10217 opts: GitRepositoryWithBundleOpts<'a>,
10218 ) -> GitRepository {
10219 let mut query = self.selection.select("withBundle");
10220 query = query.arg_lazy(
10221 "bundle",
10222 Box::new(move || {
10223 let bundle = bundle.clone();
10224 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
10225 }),
10226 );
10227 if let Some(prerequisite_ref) = opts.prerequisite_ref {
10228 query = query.arg("prerequisiteRef", prerequisite_ref);
10229 }
10230 GitRepository {
10231 proc: self.proc.clone(),
10232 selection: query,
10233 graphql_client: self.graphql_client.clone(),
10234 }
10235 }
10236 pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
10244 let mut query = self.selection.select("withContents");
10245 query = query.arg_lazy(
10246 "directory",
10247 Box::new(move || {
10248 let directory = directory.clone();
10249 Box::pin(async move { directory.into_id().await.unwrap().quote() })
10250 }),
10251 );
10252 GitRepository {
10253 proc: self.proc.clone(),
10254 selection: query,
10255 graphql_client: self.graphql_client.clone(),
10256 }
10257 }
10258 pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
10268 let mut query = self.selection.select("withRemote");
10269 query = query.arg("name", name.into());
10270 query = query.arg("url", url.into());
10271 GitRepository {
10272 proc: self.proc.clone(),
10273 selection: query,
10274 graphql_client: self.graphql_client.clone(),
10275 }
10276 }
10277 pub fn with_remote_opts<'a>(
10287 &self,
10288 name: impl Into<String>,
10289 url: impl Into<String>,
10290 opts: GitRepositoryWithRemoteOpts<'a>,
10291 ) -> GitRepository {
10292 let mut query = self.selection.select("withRemote");
10293 query = query.arg("name", name.into());
10294 query = query.arg("url", url.into());
10295 if let Some(push_url) = opts.push_url {
10296 query = query.arg("pushUrl", push_url);
10297 }
10298 GitRepository {
10299 proc: self.proc.clone(),
10300 selection: query,
10301 graphql_client: self.graphql_client.clone(),
10302 }
10303 }
10304}
10305impl Node for GitRepository {
10306 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10307 let query = self.selection.select("id");
10308 let graphql_client = self.graphql_client.clone();
10309 async move { query.execute(graphql_client).await }
10310 }
10311}
10312#[derive(Clone)]
10313pub struct HttpState {
10314 pub proc: Option<Arc<DaggerSessionProc>>,
10315 pub selection: Selection,
10316 pub graphql_client: DynGraphQLClient,
10317}
10318impl IntoID<Id> for HttpState {
10319 fn into_id(
10320 self,
10321 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10322 Box::pin(async move { self.id().await })
10323 }
10324}
10325impl Loadable for HttpState {
10326 fn graphql_type() -> &'static str {
10327 "HTTPState"
10328 }
10329 fn from_query(
10330 proc: Option<Arc<DaggerSessionProc>>,
10331 selection: Selection,
10332 graphql_client: DynGraphQLClient,
10333 ) -> Self {
10334 Self {
10335 proc,
10336 selection,
10337 graphql_client,
10338 }
10339 }
10340}
10341impl HttpState {
10342 pub async fn id(&self) -> Result<Id, DaggerError> {
10344 let query = self.selection.select("id");
10345 query.execute(self.graphql_client.clone()).await
10346 }
10347}
10348impl Node for HttpState {
10349 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10350 let query = self.selection.select("id");
10351 let graphql_client = self.graphql_client.clone();
10352 async move { query.execute(graphql_client).await }
10353 }
10354}
10355#[derive(Clone)]
10356pub struct HealthcheckConfig {
10357 pub proc: Option<Arc<DaggerSessionProc>>,
10358 pub selection: Selection,
10359 pub graphql_client: DynGraphQLClient,
10360}
10361impl IntoID<Id> for HealthcheckConfig {
10362 fn into_id(
10363 self,
10364 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10365 Box::pin(async move { self.id().await })
10366 }
10367}
10368impl Loadable for HealthcheckConfig {
10369 fn graphql_type() -> &'static str {
10370 "HealthcheckConfig"
10371 }
10372 fn from_query(
10373 proc: Option<Arc<DaggerSessionProc>>,
10374 selection: Selection,
10375 graphql_client: DynGraphQLClient,
10376 ) -> Self {
10377 Self {
10378 proc,
10379 selection,
10380 graphql_client,
10381 }
10382 }
10383}
10384impl HealthcheckConfig {
10385 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10387 let query = self.selection.select("args");
10388 query.execute(self.graphql_client.clone()).await
10389 }
10390 pub async fn id(&self) -> Result<Id, DaggerError> {
10392 let query = self.selection.select("id");
10393 query.execute(self.graphql_client.clone()).await
10394 }
10395 pub async fn interval(&self) -> Result<String, DaggerError> {
10397 let query = self.selection.select("interval");
10398 query.execute(self.graphql_client.clone()).await
10399 }
10400 pub async fn retries(&self) -> Result<isize, DaggerError> {
10402 let query = self.selection.select("retries");
10403 query.execute(self.graphql_client.clone()).await
10404 }
10405 pub async fn shell(&self) -> Result<bool, DaggerError> {
10407 let query = self.selection.select("shell");
10408 query.execute(self.graphql_client.clone()).await
10409 }
10410 pub async fn start_interval(&self) -> Result<String, DaggerError> {
10412 let query = self.selection.select("startInterval");
10413 query.execute(self.graphql_client.clone()).await
10414 }
10415 pub async fn start_period(&self) -> Result<String, DaggerError> {
10417 let query = self.selection.select("startPeriod");
10418 query.execute(self.graphql_client.clone()).await
10419 }
10420 pub async fn timeout(&self) -> Result<String, DaggerError> {
10422 let query = self.selection.select("timeout");
10423 query.execute(self.graphql_client.clone()).await
10424 }
10425}
10426impl Node for HealthcheckConfig {
10427 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10428 let query = self.selection.select("id");
10429 let graphql_client = self.graphql_client.clone();
10430 async move { query.execute(graphql_client).await }
10431 }
10432}
10433#[derive(Clone)]
10434pub struct Host {
10435 pub proc: Option<Arc<DaggerSessionProc>>,
10436 pub selection: Selection,
10437 pub graphql_client: DynGraphQLClient,
10438}
10439#[derive(Builder, Debug, PartialEq)]
10440pub struct HostDirectoryOpts<'a> {
10441 #[builder(setter(into, strip_option), default)]
10443 pub exclude: Option<Vec<&'a str>>,
10444 #[builder(setter(into, strip_option), default)]
10446 pub gitignore: Option<bool>,
10447 #[builder(setter(into, strip_option), default)]
10449 pub include: Option<Vec<&'a str>>,
10450 #[builder(setter(into, strip_option), default)]
10452 pub no_cache: Option<bool>,
10453}
10454#[derive(Builder, Debug, PartialEq)]
10455pub struct HostFileOpts {
10456 #[builder(setter(into, strip_option), default)]
10458 pub no_cache: Option<bool>,
10459}
10460#[derive(Builder, Debug, PartialEq)]
10461pub struct HostFindUpOpts {
10462 #[builder(setter(into, strip_option), default)]
10463 pub no_cache: Option<bool>,
10464}
10465#[derive(Builder, Debug, PartialEq)]
10466pub struct HostServiceOpts<'a> {
10467 #[builder(setter(into, strip_option), default)]
10469 pub host: Option<&'a str>,
10470}
10471#[derive(Builder, Debug, PartialEq)]
10472pub struct HostTunnelOpts {
10473 #[builder(setter(into, strip_option), default)]
10476 pub native: Option<bool>,
10477 #[builder(setter(into, strip_option), default)]
10482 pub ports: Option<Vec<PortForward>>,
10483}
10484impl IntoID<Id> for Host {
10485 fn into_id(
10486 self,
10487 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10488 Box::pin(async move { self.id().await })
10489 }
10490}
10491impl Loadable for Host {
10492 fn graphql_type() -> &'static str {
10493 "Host"
10494 }
10495 fn from_query(
10496 proc: Option<Arc<DaggerSessionProc>>,
10497 selection: Selection,
10498 graphql_client: DynGraphQLClient,
10499 ) -> Self {
10500 Self {
10501 proc,
10502 selection,
10503 graphql_client,
10504 }
10505 }
10506}
10507impl Host {
10508 pub fn container_image(&self, name: impl Into<String>) -> Container {
10514 let mut query = self.selection.select("containerImage");
10515 query = query.arg("name", name.into());
10516 Container {
10517 proc: self.proc.clone(),
10518 selection: query,
10519 graphql_client: self.graphql_client.clone(),
10520 }
10521 }
10522 pub fn directory(&self, path: impl Into<String>) -> Directory {
10529 let mut query = self.selection.select("directory");
10530 query = query.arg("path", path.into());
10531 Directory {
10532 proc: self.proc.clone(),
10533 selection: query,
10534 graphql_client: self.graphql_client.clone(),
10535 }
10536 }
10537 pub fn directory_opts<'a>(
10544 &self,
10545 path: impl Into<String>,
10546 opts: HostDirectoryOpts<'a>,
10547 ) -> Directory {
10548 let mut query = self.selection.select("directory");
10549 query = query.arg("path", path.into());
10550 if let Some(exclude) = opts.exclude {
10551 query = query.arg("exclude", exclude);
10552 }
10553 if let Some(include) = opts.include {
10554 query = query.arg("include", include);
10555 }
10556 if let Some(no_cache) = opts.no_cache {
10557 query = query.arg("noCache", no_cache);
10558 }
10559 if let Some(gitignore) = opts.gitignore {
10560 query = query.arg("gitignore", gitignore);
10561 }
10562 Directory {
10563 proc: self.proc.clone(),
10564 selection: query,
10565 graphql_client: self.graphql_client.clone(),
10566 }
10567 }
10568 pub fn file(&self, path: impl Into<String>) -> File {
10575 let mut query = self.selection.select("file");
10576 query = query.arg("path", path.into());
10577 File {
10578 proc: self.proc.clone(),
10579 selection: query,
10580 graphql_client: self.graphql_client.clone(),
10581 }
10582 }
10583 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10590 let mut query = self.selection.select("file");
10591 query = query.arg("path", path.into());
10592 if let Some(no_cache) = opts.no_cache {
10593 query = query.arg("noCache", no_cache);
10594 }
10595 File {
10596 proc: self.proc.clone(),
10597 selection: query,
10598 graphql_client: self.graphql_client.clone(),
10599 }
10600 }
10601 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10608 let mut query = self.selection.select("findUp");
10609 query = query.arg("name", name.into());
10610 query.execute(self.graphql_client.clone()).await
10611 }
10612 pub async fn find_up_opts(
10619 &self,
10620 name: impl Into<String>,
10621 opts: HostFindUpOpts,
10622 ) -> Result<String, DaggerError> {
10623 let mut query = self.selection.select("findUp");
10624 query = query.arg("name", name.into());
10625 if let Some(no_cache) = opts.no_cache {
10626 query = query.arg("noCache", no_cache);
10627 }
10628 query.execute(self.graphql_client.clone()).await
10629 }
10630 pub async fn id(&self) -> Result<Id, DaggerError> {
10632 let query = self.selection.select("id");
10633 query.execute(self.graphql_client.clone()).await
10634 }
10635 pub fn service(&self, ports: Vec<PortForward>) -> Service {
10646 let mut query = self.selection.select("service");
10647 query = query.arg("ports", ports);
10648 Service {
10649 proc: self.proc.clone(),
10650 selection: query,
10651 graphql_client: self.graphql_client.clone(),
10652 }
10653 }
10654 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10665 let mut query = self.selection.select("service");
10666 query = query.arg("ports", ports);
10667 if let Some(host) = opts.host {
10668 query = query.arg("host", host);
10669 }
10670 Service {
10671 proc: self.proc.clone(),
10672 selection: query,
10673 graphql_client: self.graphql_client.clone(),
10674 }
10675 }
10676 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10683 let mut query = self.selection.select("tunnel");
10684 query = query.arg_lazy(
10685 "service",
10686 Box::new(move || {
10687 let service = service.clone();
10688 Box::pin(async move { service.into_id().await.unwrap().quote() })
10689 }),
10690 );
10691 Service {
10692 proc: self.proc.clone(),
10693 selection: query,
10694 graphql_client: self.graphql_client.clone(),
10695 }
10696 }
10697 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10704 let mut query = self.selection.select("tunnel");
10705 query = query.arg_lazy(
10706 "service",
10707 Box::new(move || {
10708 let service = service.clone();
10709 Box::pin(async move { service.into_id().await.unwrap().quote() })
10710 }),
10711 );
10712 if let Some(native) = opts.native {
10713 query = query.arg("native", native);
10714 }
10715 if let Some(ports) = opts.ports {
10716 query = query.arg("ports", ports);
10717 }
10718 Service {
10719 proc: self.proc.clone(),
10720 selection: query,
10721 graphql_client: self.graphql_client.clone(),
10722 }
10723 }
10724 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10730 let mut query = self.selection.select("unixSocket");
10731 query = query.arg("path", path.into());
10732 Socket {
10733 proc: self.proc.clone(),
10734 selection: query,
10735 graphql_client: self.graphql_client.clone(),
10736 }
10737 }
10738}
10739impl Node for Host {
10740 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10741 let query = self.selection.select("id");
10742 let graphql_client = self.graphql_client.clone();
10743 async move { query.execute(graphql_client).await }
10744 }
10745}
10746#[derive(Clone)]
10747pub struct InputTypeDef {
10748 pub proc: Option<Arc<DaggerSessionProc>>,
10749 pub selection: Selection,
10750 pub graphql_client: DynGraphQLClient,
10751}
10752impl IntoID<Id> for InputTypeDef {
10753 fn into_id(
10754 self,
10755 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10756 Box::pin(async move { self.id().await })
10757 }
10758}
10759impl Loadable for InputTypeDef {
10760 fn graphql_type() -> &'static str {
10761 "InputTypeDef"
10762 }
10763 fn from_query(
10764 proc: Option<Arc<DaggerSessionProc>>,
10765 selection: Selection,
10766 graphql_client: DynGraphQLClient,
10767 ) -> Self {
10768 Self {
10769 proc,
10770 selection,
10771 graphql_client,
10772 }
10773 }
10774}
10775impl InputTypeDef {
10776 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10778 let query = self.selection.select("fields");
10779 let query = query.select("id");
10780 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10781 Ok(ids
10782 .into_iter()
10783 .map(|id| FieldTypeDef {
10784 proc: self.proc.clone(),
10785 selection: crate::querybuilder::query()
10786 .select("node")
10787 .arg("id", &id.0)
10788 .inline_fragment("FieldTypeDef"),
10789 graphql_client: self.graphql_client.clone(),
10790 })
10791 .collect())
10792 }
10793 pub async fn id(&self) -> Result<Id, DaggerError> {
10795 let query = self.selection.select("id");
10796 query.execute(self.graphql_client.clone()).await
10797 }
10798 pub async fn name(&self) -> Result<String, DaggerError> {
10800 let query = self.selection.select("name");
10801 query.execute(self.graphql_client.clone()).await
10802 }
10803}
10804impl Node for InputTypeDef {
10805 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10806 let query = self.selection.select("id");
10807 let graphql_client = self.graphql_client.clone();
10808 async move { query.execute(graphql_client).await }
10809 }
10810}
10811#[derive(Clone)]
10812pub struct InterfaceTypeDef {
10813 pub proc: Option<Arc<DaggerSessionProc>>,
10814 pub selection: Selection,
10815 pub graphql_client: DynGraphQLClient,
10816}
10817impl IntoID<Id> for InterfaceTypeDef {
10818 fn into_id(
10819 self,
10820 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10821 Box::pin(async move { self.id().await })
10822 }
10823}
10824impl Loadable for InterfaceTypeDef {
10825 fn graphql_type() -> &'static str {
10826 "InterfaceTypeDef"
10827 }
10828 fn from_query(
10829 proc: Option<Arc<DaggerSessionProc>>,
10830 selection: Selection,
10831 graphql_client: DynGraphQLClient,
10832 ) -> Self {
10833 Self {
10834 proc,
10835 selection,
10836 graphql_client,
10837 }
10838 }
10839}
10840impl InterfaceTypeDef {
10841 pub async fn description(&self) -> Result<String, DaggerError> {
10843 let query = self.selection.select("description");
10844 query.execute(self.graphql_client.clone()).await
10845 }
10846 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10848 let query = self.selection.select("functions");
10849 let query = query.select("id");
10850 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10851 Ok(ids
10852 .into_iter()
10853 .map(|id| Function {
10854 proc: self.proc.clone(),
10855 selection: crate::querybuilder::query()
10856 .select("node")
10857 .arg("id", &id.0)
10858 .inline_fragment("Function"),
10859 graphql_client: self.graphql_client.clone(),
10860 })
10861 .collect())
10862 }
10863 pub async fn id(&self) -> Result<Id, DaggerError> {
10865 let query = self.selection.select("id");
10866 query.execute(self.graphql_client.clone()).await
10867 }
10868 pub async fn name(&self) -> Result<String, DaggerError> {
10870 let query = self.selection.select("name");
10871 query.execute(self.graphql_client.clone()).await
10872 }
10873 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
10875 let query = self.selection.select("sourceMap");
10876 let query = query.select("id");
10877 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10878 Ok(id.map(|id| SourceMap {
10879 proc: self.proc.clone(),
10880 selection: query
10881 .root()
10882 .select("node")
10883 .arg("id", &id.0)
10884 .inline_fragment("SourceMap"),
10885 graphql_client: self.graphql_client.clone(),
10886 }))
10887 }
10888 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10890 let query = self.selection.select("sourceModuleName");
10891 query.execute(self.graphql_client.clone()).await
10892 }
10893}
10894impl Node for InterfaceTypeDef {
10895 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10896 let query = self.selection.select("id");
10897 let graphql_client = self.graphql_client.clone();
10898 async move { query.execute(graphql_client).await }
10899 }
10900}
10901#[derive(Clone)]
10902pub struct JsonValue {
10903 pub proc: Option<Arc<DaggerSessionProc>>,
10904 pub selection: Selection,
10905 pub graphql_client: DynGraphQLClient,
10906}
10907#[derive(Builder, Debug, PartialEq)]
10908pub struct JsonValueContentsOpts<'a> {
10909 #[builder(setter(into, strip_option), default)]
10911 pub indent: Option<&'a str>,
10912 #[builder(setter(into, strip_option), default)]
10914 pub pretty: Option<bool>,
10915}
10916impl IntoID<Id> for JsonValue {
10917 fn into_id(
10918 self,
10919 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10920 Box::pin(async move { self.id().await })
10921 }
10922}
10923impl Loadable for JsonValue {
10924 fn graphql_type() -> &'static str {
10925 "JSONValue"
10926 }
10927 fn from_query(
10928 proc: Option<Arc<DaggerSessionProc>>,
10929 selection: Selection,
10930 graphql_client: DynGraphQLClient,
10931 ) -> Self {
10932 Self {
10933 proc,
10934 selection,
10935 graphql_client,
10936 }
10937 }
10938}
10939impl JsonValue {
10940 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10942 let query = self.selection.select("asArray");
10943 let query = query.select("id");
10944 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10945 Ok(ids
10946 .into_iter()
10947 .map(|id| JsonValue {
10948 proc: self.proc.clone(),
10949 selection: crate::querybuilder::query()
10950 .select("node")
10951 .arg("id", &id.0)
10952 .inline_fragment("JSONValue"),
10953 graphql_client: self.graphql_client.clone(),
10954 })
10955 .collect())
10956 }
10957 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10959 let query = self.selection.select("asBoolean");
10960 query.execute(self.graphql_client.clone()).await
10961 }
10962 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10964 let query = self.selection.select("asInteger");
10965 query.execute(self.graphql_client.clone()).await
10966 }
10967 pub async fn as_string(&self) -> Result<String, DaggerError> {
10969 let query = self.selection.select("asString");
10970 query.execute(self.graphql_client.clone()).await
10971 }
10972 pub async fn contents(&self) -> Result<Json, DaggerError> {
10978 let query = self.selection.select("contents");
10979 query.execute(self.graphql_client.clone()).await
10980 }
10981 pub async fn contents_opts<'a>(
10987 &self,
10988 opts: JsonValueContentsOpts<'a>,
10989 ) -> Result<Json, DaggerError> {
10990 let mut query = self.selection.select("contents");
10991 if let Some(pretty) = opts.pretty {
10992 query = query.arg("pretty", pretty);
10993 }
10994 if let Some(indent) = opts.indent {
10995 query = query.arg("indent", indent);
10996 }
10997 query.execute(self.graphql_client.clone()).await
10998 }
10999 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
11005 let mut query = self.selection.select("field");
11006 query = query.arg(
11007 "path",
11008 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11009 );
11010 JsonValue {
11011 proc: self.proc.clone(),
11012 selection: query,
11013 graphql_client: self.graphql_client.clone(),
11014 }
11015 }
11016 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
11018 let query = self.selection.select("fields");
11019 query.execute(self.graphql_client.clone()).await
11020 }
11021 pub async fn id(&self) -> Result<Id, DaggerError> {
11023 let query = self.selection.select("id");
11024 query.execute(self.graphql_client.clone()).await
11025 }
11026 pub fn new_boolean(&self, value: bool) -> JsonValue {
11032 let mut query = self.selection.select("newBoolean");
11033 query = query.arg("value", value);
11034 JsonValue {
11035 proc: self.proc.clone(),
11036 selection: query,
11037 graphql_client: self.graphql_client.clone(),
11038 }
11039 }
11040 pub fn new_integer(&self, value: isize) -> JsonValue {
11046 let mut query = self.selection.select("newInteger");
11047 query = query.arg("value", value);
11048 JsonValue {
11049 proc: self.proc.clone(),
11050 selection: query,
11051 graphql_client: self.graphql_client.clone(),
11052 }
11053 }
11054 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
11060 let mut query = self.selection.select("newString");
11061 query = query.arg("value", value.into());
11062 JsonValue {
11063 proc: self.proc.clone(),
11064 selection: query,
11065 graphql_client: self.graphql_client.clone(),
11066 }
11067 }
11068 pub fn with_contents(&self, contents: Json) -> JsonValue {
11074 let mut query = self.selection.select("withContents");
11075 query = query.arg("contents", contents);
11076 JsonValue {
11077 proc: self.proc.clone(),
11078 selection: query,
11079 graphql_client: self.graphql_client.clone(),
11080 }
11081 }
11082 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
11089 let mut query = self.selection.select("withField");
11090 query = query.arg(
11091 "path",
11092 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11093 );
11094 query = query.arg_lazy(
11095 "value",
11096 Box::new(move || {
11097 let value = value.clone();
11098 Box::pin(async move { value.into_id().await.unwrap().quote() })
11099 }),
11100 );
11101 JsonValue {
11102 proc: self.proc.clone(),
11103 selection: query,
11104 graphql_client: self.graphql_client.clone(),
11105 }
11106 }
11107}
11108impl Node for JsonValue {
11109 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11110 let query = self.selection.select("id");
11111 let graphql_client = self.graphql_client.clone();
11112 async move { query.execute(graphql_client).await }
11113 }
11114}
11115#[derive(Clone)]
11116pub struct Llm {
11117 pub proc: Option<Arc<DaggerSessionProc>>,
11118 pub selection: Selection,
11119 pub graphql_client: DynGraphQLClient,
11120}
11121#[derive(Builder, Debug, PartialEq)]
11122pub struct LlmLoopOpts {
11123 #[builder(setter(into, strip_option), default)]
11125 pub max_steps: Option<isize>,
11126 #[builder(setter(into, strip_option), default)]
11128 pub max_tokens: Option<isize>,
11129}
11130#[derive(Builder, Debug, PartialEq)]
11131pub struct LlmSpawnOpts<'a> {
11132 #[builder(setter(into, strip_option), default)]
11134 pub error: Option<&'a str>,
11135 #[builder(setter(into, strip_option), default)]
11137 pub handle: Option<&'a str>,
11138 #[builder(setter(into, strip_option), default)]
11140 pub name: Option<&'a str>,
11141 #[builder(setter(into, strip_option), default)]
11144 pub state: Option<AgentState>,
11145}
11146#[derive(Builder, Debug, PartialEq)]
11147pub struct LlmStepOpts {
11148 #[builder(setter(into, strip_option), default)]
11150 pub max_tokens: Option<isize>,
11151}
11152#[derive(Builder, Debug, PartialEq)]
11153pub struct LlmWithModelOpts<'a> {
11154 #[builder(setter(into, strip_option), default)]
11156 pub provider: Option<&'a str>,
11157}
11158#[derive(Builder, Debug, PartialEq)]
11159pub struct LlmWithPromptOpts {
11160 #[builder(setter(into, strip_option), default)]
11162 pub origin: Option<LlmMessageOriginInput>,
11163}
11164#[derive(Builder, Debug, PartialEq)]
11165pub struct LlmWithResponseOpts {
11166 #[builder(setter(into, strip_option), default)]
11168 pub cached_token_reads: Option<isize>,
11169 #[builder(setter(into, strip_option), default)]
11171 pub cached_token_writes: Option<isize>,
11172 #[builder(setter(into, strip_option), default)]
11174 pub input_tokens: Option<isize>,
11175 #[builder(setter(into, strip_option), default)]
11177 pub output_tokens: Option<isize>,
11178 #[builder(setter(into, strip_option), default)]
11180 pub total_tokens: Option<isize>,
11181}
11182#[derive(Builder, Debug, PartialEq)]
11183pub struct LlmWithToolsOpts<'a> {
11184 #[builder(setter(into, strip_option), default)]
11186 pub except: Option<Vec<&'a str>>,
11187}
11188impl IntoID<Id> for Llm {
11189 fn into_id(
11190 self,
11191 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11192 Box::pin(async move { self.id().await })
11193 }
11194}
11195impl Loadable for Llm {
11196 fn graphql_type() -> &'static str {
11197 "LLM"
11198 }
11199 fn from_query(
11200 proc: Option<Arc<DaggerSessionProc>>,
11201 selection: Selection,
11202 graphql_client: DynGraphQLClient,
11203 ) -> Self {
11204 Self {
11205 proc,
11206 selection,
11207 graphql_client,
11208 }
11209 }
11210}
11211impl Llm {
11212 pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
11220 let mut query = self.selection.select("agent");
11221 query = query.arg("handle", handle.into());
11222 query = query.arg("name", name.into());
11223 Agent {
11224 proc: self.proc.clone(),
11225 selection: query,
11226 graphql_client: self.graphql_client.clone(),
11227 }
11228 }
11229 pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
11231 let query = self.selection.select("contextTokens");
11232 query.execute(self.graphql_client.clone()).await
11233 }
11234 pub async fn context_window(&self) -> Result<isize, DaggerError> {
11236 let query = self.selection.select("contextWindow");
11237 query.execute(self.graphql_client.clone()).await
11238 }
11239 pub fn fork(&self, label: impl Into<String>) -> Llm {
11245 let mut query = self.selection.select("fork");
11246 query = query.arg("label", label.into());
11247 Llm {
11248 proc: self.proc.clone(),
11249 selection: query,
11250 graphql_client: self.graphql_client.clone(),
11251 }
11252 }
11253 pub async fn has_pending(&self) -> Result<bool, DaggerError> {
11255 let query = self.selection.select("hasPending");
11256 query.execute(self.graphql_client.clone()).await
11257 }
11258 pub async fn id(&self) -> Result<Id, DaggerError> {
11260 let query = self.selection.select("id");
11261 query.execute(self.graphql_client.clone()).await
11262 }
11263 pub async fn last_reply(&self) -> Result<String, DaggerError> {
11265 let query = self.selection.select("lastReply");
11266 query.execute(self.graphql_client.clone()).await
11267 }
11268 pub fn r#loop(&self) -> Llm {
11274 let query = self.selection.select("loop");
11275 Llm {
11276 proc: self.proc.clone(),
11277 selection: query,
11278 graphql_client: self.graphql_client.clone(),
11279 }
11280 }
11281 pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
11287 let mut query = self.selection.select("loop");
11288 if let Some(max_steps) = opts.max_steps {
11289 query = query.arg("maxSteps", max_steps);
11290 }
11291 if let Some(max_tokens) = opts.max_tokens {
11292 query = query.arg("maxTokens", max_tokens);
11293 }
11294 Llm {
11295 proc: self.proc.clone(),
11296 selection: query,
11297 graphql_client: self.graphql_client.clone(),
11298 }
11299 }
11300 pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
11302 let query = self.selection.select("messages");
11303 let query = query.select("id");
11304 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11305 Ok(ids
11306 .into_iter()
11307 .map(|id| LlmMessage {
11308 proc: self.proc.clone(),
11309 selection: crate::querybuilder::query()
11310 .select("node")
11311 .arg("id", &id.0)
11312 .inline_fragment("LLMMessage"),
11313 graphql_client: self.graphql_client.clone(),
11314 })
11315 .collect())
11316 }
11317 pub async fn model(&self) -> Result<String, DaggerError> {
11319 let query = self.selection.select("model");
11320 query.execute(self.graphql_client.clone()).await
11321 }
11322 pub async fn portable_id(&self) -> Result<Id, DaggerError> {
11324 let query = self.selection.select("portableID");
11325 query.execute(self.graphql_client.clone()).await
11326 }
11327 pub async fn provider(&self) -> Result<String, DaggerError> {
11329 let query = self.selection.select("provider");
11330 query.execute(self.graphql_client.clone()).await
11331 }
11332 pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
11334 let query = self.selection.select("reasoningEffort");
11335 query.execute(self.graphql_client.clone()).await
11336 }
11337 pub async fn replay(&self) -> Result<Llm, DaggerError> {
11339 let query = self.selection.select("replay");
11340 let id: Id = query.execute(self.graphql_client.clone()).await?;
11341 Ok(Llm {
11342 proc: self.proc.clone(),
11343 selection: query
11344 .root()
11345 .select("node")
11346 .arg("id", &id.0)
11347 .inline_fragment("LLM"),
11348 graphql_client: self.graphql_client.clone(),
11349 })
11350 }
11351 pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
11353 let query = self.selection.select("skills");
11354 let query = query.select("id");
11355 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11356 Ok(ids
11357 .into_iter()
11358 .map(|id| LlmSkill {
11359 proc: self.proc.clone(),
11360 selection: crate::querybuilder::query()
11361 .select("node")
11362 .arg("id", &id.0)
11363 .inline_fragment("LLMSkill"),
11364 graphql_client: self.graphql_client.clone(),
11365 })
11366 .collect())
11367 }
11368 pub async fn spawn(&self) -> Result<Agent, DaggerError> {
11377 let query = self.selection.select("spawn");
11378 let id: Id = query.execute(self.graphql_client.clone()).await?;
11379 Ok(Agent {
11380 proc: self.proc.clone(),
11381 selection: query
11382 .root()
11383 .select("node")
11384 .arg("id", &id.0)
11385 .inline_fragment("Agent"),
11386 graphql_client: self.graphql_client.clone(),
11387 })
11388 }
11389 pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
11398 let mut query = self.selection.select("spawn");
11399 if let Some(name) = opts.name {
11400 query = query.arg("name", name);
11401 }
11402 if let Some(handle) = opts.handle {
11403 query = query.arg("handle", handle);
11404 }
11405 if let Some(state) = opts.state {
11406 query = query.arg("state", state);
11407 }
11408 if let Some(error) = opts.error {
11409 query = query.arg("error", error);
11410 }
11411 let id: Id = query.execute(self.graphql_client.clone()).await?;
11412 Ok(Agent {
11413 proc: self.proc.clone(),
11414 selection: query
11415 .root()
11416 .select("node")
11417 .arg("id", &id.0)
11418 .inline_fragment("Agent"),
11419 graphql_client: self.graphql_client.clone(),
11420 })
11421 }
11422 pub fn step(&self) -> Llm {
11428 let query = self.selection.select("step");
11429 Llm {
11430 proc: self.proc.clone(),
11431 selection: query,
11432 graphql_client: self.graphql_client.clone(),
11433 }
11434 }
11435 pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
11441 let mut query = self.selection.select("step");
11442 if let Some(max_tokens) = opts.max_tokens {
11443 query = query.arg("maxTokens", max_tokens);
11444 }
11445 Llm {
11446 proc: self.proc.clone(),
11447 selection: query,
11448 graphql_client: self.graphql_client.clone(),
11449 }
11450 }
11451 pub async fn sync(&self) -> Result<Llm, DaggerError> {
11453 let query = self.selection.select("sync");
11454 let id: Id = query.execute(self.graphql_client.clone()).await?;
11455 Ok(Llm {
11456 proc: self.proc.clone(),
11457 selection: query
11458 .root()
11459 .select("node")
11460 .arg("id", &id.0)
11461 .inline_fragment("LLM"),
11462 graphql_client: self.graphql_client.clone(),
11463 })
11464 }
11465 pub fn token_usage(&self) -> LlmTokenUsage {
11467 let query = self.selection.select("tokenUsage");
11468 LlmTokenUsage {
11469 proc: self.proc.clone(),
11470 selection: query,
11471 graphql_client: self.graphql_client.clone(),
11472 }
11473 }
11474 pub async fn tools(&self) -> Result<String, DaggerError> {
11476 let query = self.selection.select("tools");
11477 query.execute(self.graphql_client.clone()).await
11478 }
11479 pub async fn transcript(&self) -> Result<String, DaggerError> {
11481 let query = self.selection.select("transcript");
11482 query.execute(self.graphql_client.clone()).await
11483 }
11484 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11491 let mut query = self.selection.select("withMCPServer");
11492 query = query.arg("name", name.into());
11493 query = query.arg_lazy(
11494 "service",
11495 Box::new(move || {
11496 let service = service.clone();
11497 Box::pin(async move { service.into_id().await.unwrap().quote() })
11498 }),
11499 );
11500 Llm {
11501 proc: self.proc.clone(),
11502 selection: query,
11503 graphql_client: self.graphql_client.clone(),
11504 }
11505 }
11506 pub fn with_model(&self, model: impl Into<String>) -> Llm {
11513 let mut query = self.selection.select("withModel");
11514 query = query.arg("model", model.into());
11515 Llm {
11516 proc: self.proc.clone(),
11517 selection: query,
11518 graphql_client: self.graphql_client.clone(),
11519 }
11520 }
11521 pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
11528 let mut query = self.selection.select("withModel");
11529 query = query.arg("model", model.into());
11530 if let Some(provider) = opts.provider {
11531 query = query.arg("provider", provider);
11532 }
11533 Llm {
11534 proc: self.proc.clone(),
11535 selection: query,
11536 graphql_client: self.graphql_client.clone(),
11537 }
11538 }
11539 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11546 let mut query = self.selection.select("withPrompt");
11547 query = query.arg("prompt", prompt.into());
11548 Llm {
11549 proc: self.proc.clone(),
11550 selection: query,
11551 graphql_client: self.graphql_client.clone(),
11552 }
11553 }
11554 pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
11561 let mut query = self.selection.select("withPrompt");
11562 query = query.arg("prompt", prompt.into());
11563 if let Some(origin) = opts.origin {
11564 query = query.arg("origin", origin);
11565 }
11566 Llm {
11567 proc: self.proc.clone(),
11568 selection: query,
11569 graphql_client: self.graphql_client.clone(),
11570 }
11571 }
11572 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11578 let mut query = self.selection.select("withPromptFile");
11579 query = query.arg_lazy(
11580 "file",
11581 Box::new(move || {
11582 let file = file.clone();
11583 Box::pin(async move { file.into_id().await.unwrap().quote() })
11584 }),
11585 );
11586 Llm {
11587 proc: self.proc.clone(),
11588 selection: query,
11589 graphql_client: self.graphql_client.clone(),
11590 }
11591 }
11592 pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
11598 let mut query = self.selection.select("withReasoningEffort");
11599 query = query.arg("effort", effort.into());
11600 Llm {
11601 proc: self.proc.clone(),
11602 selection: query,
11603 graphql_client: self.graphql_client.clone(),
11604 }
11605 }
11606 pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
11613 let mut query = self.selection.select("withResponse");
11614 query = query.arg("content", content);
11615 Llm {
11616 proc: self.proc.clone(),
11617 selection: query,
11618 graphql_client: self.graphql_client.clone(),
11619 }
11620 }
11621 pub fn with_response_opts(
11628 &self,
11629 content: Vec<LlmContentBlockInput>,
11630 opts: LlmWithResponseOpts,
11631 ) -> Llm {
11632 let mut query = self.selection.select("withResponse");
11633 query = query.arg("content", content);
11634 if let Some(input_tokens) = opts.input_tokens {
11635 query = query.arg("inputTokens", input_tokens);
11636 }
11637 if let Some(output_tokens) = opts.output_tokens {
11638 query = query.arg("outputTokens", output_tokens);
11639 }
11640 if let Some(cached_token_reads) = opts.cached_token_reads {
11641 query = query.arg("cachedTokenReads", cached_token_reads);
11642 }
11643 if let Some(cached_token_writes) = opts.cached_token_writes {
11644 query = query.arg("cachedTokenWrites", cached_token_writes);
11645 }
11646 if let Some(total_tokens) = opts.total_tokens {
11647 query = query.arg("totalTokens", total_tokens);
11648 }
11649 Llm {
11650 proc: self.proc.clone(),
11651 selection: query,
11652 graphql_client: self.graphql_client.clone(),
11653 }
11654 }
11655 pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
11661 let mut query = self.selection.select("withSkills");
11662 query = query.arg_lazy(
11663 "directory",
11664 Box::new(move || {
11665 let directory = directory.clone();
11666 Box::pin(async move { directory.into_id().await.unwrap().quote() })
11667 }),
11668 );
11669 Llm {
11670 proc: self.proc.clone(),
11671 selection: query,
11672 graphql_client: self.graphql_client.clone(),
11673 }
11674 }
11675 pub fn with_small_model(&self) -> Llm {
11677 let query = self.selection.select("withSmallModel");
11678 Llm {
11679 proc: self.proc.clone(),
11680 selection: query,
11681 graphql_client: self.graphql_client.clone(),
11682 }
11683 }
11684 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11690 let mut query = self.selection.select("withSystemPrompt");
11691 query = query.arg("prompt", prompt.into());
11692 Llm {
11693 proc: self.proc.clone(),
11694 selection: query,
11695 graphql_client: self.graphql_client.clone(),
11696 }
11697 }
11698 pub fn with_tool_result(
11706 &self,
11707 call_id: impl Into<String>,
11708 content: impl Into<String>,
11709 errored: bool,
11710 ) -> Llm {
11711 let mut query = self.selection.select("withToolResult");
11712 query = query.arg("callId", call_id.into());
11713 query = query.arg("content", content.into());
11714 query = query.arg("errored", errored);
11715 Llm {
11716 proc: self.proc.clone(),
11717 selection: query,
11718 graphql_client: self.graphql_client.clone(),
11719 }
11720 }
11721 pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
11728 let mut query = self.selection.select("withTools");
11729 query = query.arg_lazy(
11730 "object",
11731 Box::new(move || {
11732 let object = object.clone();
11733 Box::pin(async move { object.into_id().await.unwrap().quote() })
11734 }),
11735 );
11736 Llm {
11737 proc: self.proc.clone(),
11738 selection: query,
11739 graphql_client: self.graphql_client.clone(),
11740 }
11741 }
11742 pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
11749 let mut query = self.selection.select("withTools");
11750 query = query.arg_lazy(
11751 "object",
11752 Box::new(move || {
11753 let object = object.clone();
11754 Box::pin(async move { object.into_id().await.unwrap().quote() })
11755 }),
11756 );
11757 if let Some(except) = opts.except {
11758 query = query.arg("except", except);
11759 }
11760 Llm {
11761 proc: self.proc.clone(),
11762 selection: query,
11763 graphql_client: self.graphql_client.clone(),
11764 }
11765 }
11766 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
11772 let mut query = self.selection.select("withWorkspace");
11773 query = query.arg_lazy(
11774 "workspace",
11775 Box::new(move || {
11776 let workspace = workspace.clone();
11777 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
11778 }),
11779 );
11780 Llm {
11781 proc: self.proc.clone(),
11782 selection: query,
11783 graphql_client: self.graphql_client.clone(),
11784 }
11785 }
11786 pub fn without_default_system_prompt(&self) -> Llm {
11788 let query = self.selection.select("withoutDefaultSystemPrompt");
11789 Llm {
11790 proc: self.proc.clone(),
11791 selection: query,
11792 graphql_client: self.graphql_client.clone(),
11793 }
11794 }
11795 pub fn without_message_history(&self) -> Llm {
11797 let query = self.selection.select("withoutMessageHistory");
11798 Llm {
11799 proc: self.proc.clone(),
11800 selection: query,
11801 graphql_client: self.graphql_client.clone(),
11802 }
11803 }
11804 pub fn without_system_prompts(&self) -> Llm {
11806 let query = self.selection.select("withoutSystemPrompts");
11807 Llm {
11808 proc: self.proc.clone(),
11809 selection: query,
11810 graphql_client: self.graphql_client.clone(),
11811 }
11812 }
11813 pub fn workspace(&self) -> Workspace {
11815 let query = self.selection.select("workspace");
11816 Workspace {
11817 proc: self.proc.clone(),
11818 selection: query,
11819 graphql_client: self.graphql_client.clone(),
11820 }
11821 }
11822}
11823impl Node for Llm {
11824 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11825 let query = self.selection.select("id");
11826 let graphql_client = self.graphql_client.clone();
11827 async move { query.execute(graphql_client).await }
11828 }
11829}
11830impl Syncer for Llm {
11831 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11832 let query = self.selection.select("id");
11833 let graphql_client = self.graphql_client.clone();
11834 async move { query.execute(graphql_client).await }
11835 }
11836 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
11837 let query = self.selection.select("sync");
11838 let proc = self.proc.clone();
11839 let graphql_client = self.graphql_client.clone();
11840 async move {
11841 let id: Id = query.execute(graphql_client.clone()).await?;
11842 Ok(Self {
11843 proc,
11844 selection: query
11845 .root()
11846 .select("node")
11847 .arg("id", &id.0)
11848 .inline_fragment("LLM"),
11849 graphql_client,
11850 })
11851 }
11852 }
11853}
11854#[derive(Clone)]
11855pub struct LlmContentBlock {
11856 pub proc: Option<Arc<DaggerSessionProc>>,
11857 pub selection: Selection,
11858 pub graphql_client: DynGraphQLClient,
11859}
11860impl IntoID<Id> for LlmContentBlock {
11861 fn into_id(
11862 self,
11863 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11864 Box::pin(async move { self.id().await })
11865 }
11866}
11867impl Loadable for LlmContentBlock {
11868 fn graphql_type() -> &'static str {
11869 "LLMContentBlock"
11870 }
11871 fn from_query(
11872 proc: Option<Arc<DaggerSessionProc>>,
11873 selection: Selection,
11874 graphql_client: DynGraphQLClient,
11875 ) -> Self {
11876 Self {
11877 proc,
11878 selection,
11879 graphql_client,
11880 }
11881 }
11882}
11883impl LlmContentBlock {
11884 pub async fn arguments(&self) -> Result<Json, DaggerError> {
11886 let query = self.selection.select("arguments");
11887 query.execute(self.graphql_client.clone()).await
11888 }
11889 pub async fn call_id(&self) -> Result<String, DaggerError> {
11891 let query = self.selection.select("callId");
11892 query.execute(self.graphql_client.clone()).await
11893 }
11894 pub async fn errored(&self) -> Result<bool, DaggerError> {
11896 let query = self.selection.select("errored");
11897 query.execute(self.graphql_client.clone()).await
11898 }
11899 pub async fn id(&self) -> Result<Id, DaggerError> {
11901 let query = self.selection.select("id");
11902 query.execute(self.graphql_client.clone()).await
11903 }
11904 pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
11906 let query = self.selection.select("kind");
11907 query.execute(self.graphql_client.clone()).await
11908 }
11909 pub async fn signature(&self) -> Result<String, DaggerError> {
11911 let query = self.selection.select("signature");
11912 query.execute(self.graphql_client.clone()).await
11913 }
11914 pub async fn text(&self) -> Result<String, DaggerError> {
11916 let query = self.selection.select("text");
11917 query.execute(self.graphql_client.clone()).await
11918 }
11919 pub async fn tool_name(&self) -> Result<String, DaggerError> {
11921 let query = self.selection.select("toolName");
11922 query.execute(self.graphql_client.clone()).await
11923 }
11924}
11925impl Node for LlmContentBlock {
11926 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11927 let query = self.selection.select("id");
11928 let graphql_client = self.graphql_client.clone();
11929 async move { query.execute(graphql_client).await }
11930 }
11931}
11932#[derive(Clone)]
11933pub struct LlmMessage {
11934 pub proc: Option<Arc<DaggerSessionProc>>,
11935 pub selection: Selection,
11936 pub graphql_client: DynGraphQLClient,
11937}
11938impl IntoID<Id> for LlmMessage {
11939 fn into_id(
11940 self,
11941 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11942 Box::pin(async move { self.id().await })
11943 }
11944}
11945impl Loadable for LlmMessage {
11946 fn graphql_type() -> &'static str {
11947 "LLMMessage"
11948 }
11949 fn from_query(
11950 proc: Option<Arc<DaggerSessionProc>>,
11951 selection: Selection,
11952 graphql_client: DynGraphQLClient,
11953 ) -> Self {
11954 Self {
11955 proc,
11956 selection,
11957 graphql_client,
11958 }
11959 }
11960}
11961impl LlmMessage {
11962 pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
11964 let query = self.selection.select("content");
11965 let query = query.select("id");
11966 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11967 Ok(ids
11968 .into_iter()
11969 .map(|id| LlmContentBlock {
11970 proc: self.proc.clone(),
11971 selection: crate::querybuilder::query()
11972 .select("node")
11973 .arg("id", &id.0)
11974 .inline_fragment("LLMContentBlock"),
11975 graphql_client: self.graphql_client.clone(),
11976 })
11977 .collect())
11978 }
11979 pub async fn id(&self) -> Result<Id, DaggerError> {
11981 let query = self.selection.select("id");
11982 query.execute(self.graphql_client.clone()).await
11983 }
11984 pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
11987 let query = self.selection.select("origin");
11988 let query = query.select("id");
11989 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11990 Ok(id.map(|id| LlmMessageOrigin {
11991 proc: self.proc.clone(),
11992 selection: query
11993 .root()
11994 .select("node")
11995 .arg("id", &id.0)
11996 .inline_fragment("LLMMessageOrigin"),
11997 graphql_client: self.graphql_client.clone(),
11998 }))
11999 }
12000 pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
12002 let query = self.selection.select("role");
12003 query.execute(self.graphql_client.clone()).await
12004 }
12005 pub fn token_usage(&self) -> LlmTokenUsage {
12007 let query = self.selection.select("tokenUsage");
12008 LlmTokenUsage {
12009 proc: self.proc.clone(),
12010 selection: query,
12011 graphql_client: self.graphql_client.clone(),
12012 }
12013 }
12014}
12015impl Node for LlmMessage {
12016 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12017 let query = self.selection.select("id");
12018 let graphql_client = self.graphql_client.clone();
12019 async move { query.execute(graphql_client).await }
12020 }
12021}
12022#[derive(Clone)]
12023pub struct LlmMessageOrigin {
12024 pub proc: Option<Arc<DaggerSessionProc>>,
12025 pub selection: Selection,
12026 pub graphql_client: DynGraphQLClient,
12027}
12028impl IntoID<Id> for LlmMessageOrigin {
12029 fn into_id(
12030 self,
12031 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12032 Box::pin(async move { self.id().await })
12033 }
12034}
12035impl Loadable for LlmMessageOrigin {
12036 fn graphql_type() -> &'static str {
12037 "LLMMessageOrigin"
12038 }
12039 fn from_query(
12040 proc: Option<Arc<DaggerSessionProc>>,
12041 selection: Selection,
12042 graphql_client: DynGraphQLClient,
12043 ) -> Self {
12044 Self {
12045 proc,
12046 selection,
12047 graphql_client,
12048 }
12049 }
12050}
12051impl LlmMessageOrigin {
12052 pub async fn agent_name(&self) -> Result<String, DaggerError> {
12054 let query = self.selection.select("agentName");
12055 query.execute(self.graphql_client.clone()).await
12056 }
12057 pub async fn id(&self) -> Result<Id, DaggerError> {
12059 let query = self.selection.select("id");
12060 query.execute(self.graphql_client.clone()).await
12061 }
12062 pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
12064 let query = self.selection.select("kind");
12065 query.execute(self.graphql_client.clone()).await
12066 }
12067 pub async fn r#ref(&self) -> Result<String, DaggerError> {
12069 let query = self.selection.select("ref");
12070 query.execute(self.graphql_client.clone()).await
12071 }
12072 pub async fn reply_to(&self) -> Result<String, DaggerError> {
12074 let query = self.selection.select("replyTo");
12075 query.execute(self.graphql_client.clone()).await
12076 }
12077}
12078impl Node for LlmMessageOrigin {
12079 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12080 let query = self.selection.select("id");
12081 let graphql_client = self.graphql_client.clone();
12082 async move { query.execute(graphql_client).await }
12083 }
12084}
12085#[derive(Clone)]
12086pub struct LlmSkill {
12087 pub proc: Option<Arc<DaggerSessionProc>>,
12088 pub selection: Selection,
12089 pub graphql_client: DynGraphQLClient,
12090}
12091impl IntoID<Id> for LlmSkill {
12092 fn into_id(
12093 self,
12094 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12095 Box::pin(async move { self.id().await })
12096 }
12097}
12098impl Loadable for LlmSkill {
12099 fn graphql_type() -> &'static str {
12100 "LLMSkill"
12101 }
12102 fn from_query(
12103 proc: Option<Arc<DaggerSessionProc>>,
12104 selection: Selection,
12105 graphql_client: DynGraphQLClient,
12106 ) -> Self {
12107 Self {
12108 proc,
12109 selection,
12110 graphql_client,
12111 }
12112 }
12113}
12114impl LlmSkill {
12115 pub async fn description(&self) -> Result<String, DaggerError> {
12117 let query = self.selection.select("description");
12118 query.execute(self.graphql_client.clone()).await
12119 }
12120 pub async fn id(&self) -> Result<Id, DaggerError> {
12122 let query = self.selection.select("id");
12123 query.execute(self.graphql_client.clone()).await
12124 }
12125 pub async fn name(&self) -> Result<String, DaggerError> {
12127 let query = self.selection.select("name");
12128 query.execute(self.graphql_client.clone()).await
12129 }
12130}
12131impl Node for LlmSkill {
12132 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12133 let query = self.selection.select("id");
12134 let graphql_client = self.graphql_client.clone();
12135 async move { query.execute(graphql_client).await }
12136 }
12137}
12138#[derive(Clone)]
12139pub struct LlmTokenUsage {
12140 pub proc: Option<Arc<DaggerSessionProc>>,
12141 pub selection: Selection,
12142 pub graphql_client: DynGraphQLClient,
12143}
12144impl IntoID<Id> for LlmTokenUsage {
12145 fn into_id(
12146 self,
12147 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12148 Box::pin(async move { self.id().await })
12149 }
12150}
12151impl Loadable for LlmTokenUsage {
12152 fn graphql_type() -> &'static str {
12153 "LLMTokenUsage"
12154 }
12155 fn from_query(
12156 proc: Option<Arc<DaggerSessionProc>>,
12157 selection: Selection,
12158 graphql_client: DynGraphQLClient,
12159 ) -> Self {
12160 Self {
12161 proc,
12162 selection,
12163 graphql_client,
12164 }
12165 }
12166}
12167impl LlmTokenUsage {
12168 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
12170 let query = self.selection.select("cachedTokenReads");
12171 query.execute(self.graphql_client.clone()).await
12172 }
12173 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
12175 let query = self.selection.select("cachedTokenWrites");
12176 query.execute(self.graphql_client.clone()).await
12177 }
12178 pub async fn id(&self) -> Result<Id, DaggerError> {
12180 let query = self.selection.select("id");
12181 query.execute(self.graphql_client.clone()).await
12182 }
12183 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
12185 let query = self.selection.select("inputTokens");
12186 query.execute(self.graphql_client.clone()).await
12187 }
12188 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
12190 let query = self.selection.select("outputTokens");
12191 query.execute(self.graphql_client.clone()).await
12192 }
12193 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
12195 let query = self.selection.select("totalTokens");
12196 query.execute(self.graphql_client.clone()).await
12197 }
12198}
12199impl Node for LlmTokenUsage {
12200 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12201 let query = self.selection.select("id");
12202 let graphql_client = self.graphql_client.clone();
12203 async move { query.execute(graphql_client).await }
12204 }
12205}
12206#[derive(Clone)]
12207pub struct Label {
12208 pub proc: Option<Arc<DaggerSessionProc>>,
12209 pub selection: Selection,
12210 pub graphql_client: DynGraphQLClient,
12211}
12212impl IntoID<Id> for Label {
12213 fn into_id(
12214 self,
12215 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12216 Box::pin(async move { self.id().await })
12217 }
12218}
12219impl Loadable for Label {
12220 fn graphql_type() -> &'static str {
12221 "Label"
12222 }
12223 fn from_query(
12224 proc: Option<Arc<DaggerSessionProc>>,
12225 selection: Selection,
12226 graphql_client: DynGraphQLClient,
12227 ) -> Self {
12228 Self {
12229 proc,
12230 selection,
12231 graphql_client,
12232 }
12233 }
12234}
12235impl Label {
12236 pub async fn id(&self) -> Result<Id, DaggerError> {
12238 let query = self.selection.select("id");
12239 query.execute(self.graphql_client.clone()).await
12240 }
12241 pub async fn name(&self) -> Result<String, DaggerError> {
12243 let query = self.selection.select("name");
12244 query.execute(self.graphql_client.clone()).await
12245 }
12246 pub async fn value(&self) -> Result<String, DaggerError> {
12248 let query = self.selection.select("value");
12249 query.execute(self.graphql_client.clone()).await
12250 }
12251}
12252impl Node for Label {
12253 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12254 let query = self.selection.select("id");
12255 let graphql_client = self.graphql_client.clone();
12256 async move { query.execute(graphql_client).await }
12257 }
12258}
12259#[derive(Clone)]
12260pub struct ListTypeDef {
12261 pub proc: Option<Arc<DaggerSessionProc>>,
12262 pub selection: Selection,
12263 pub graphql_client: DynGraphQLClient,
12264}
12265impl IntoID<Id> for ListTypeDef {
12266 fn into_id(
12267 self,
12268 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12269 Box::pin(async move { self.id().await })
12270 }
12271}
12272impl Loadable for ListTypeDef {
12273 fn graphql_type() -> &'static str {
12274 "ListTypeDef"
12275 }
12276 fn from_query(
12277 proc: Option<Arc<DaggerSessionProc>>,
12278 selection: Selection,
12279 graphql_client: DynGraphQLClient,
12280 ) -> Self {
12281 Self {
12282 proc,
12283 selection,
12284 graphql_client,
12285 }
12286 }
12287}
12288impl ListTypeDef {
12289 pub fn element_type_def(&self) -> TypeDef {
12291 let query = self.selection.select("elementTypeDef");
12292 TypeDef {
12293 proc: self.proc.clone(),
12294 selection: query,
12295 graphql_client: self.graphql_client.clone(),
12296 }
12297 }
12298 pub async fn id(&self) -> Result<Id, DaggerError> {
12300 let query = self.selection.select("id");
12301 query.execute(self.graphql_client.clone()).await
12302 }
12303}
12304impl Node for ListTypeDef {
12305 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12306 let query = self.selection.select("id");
12307 let graphql_client = self.graphql_client.clone();
12308 async move { query.execute(graphql_client).await }
12309 }
12310}
12311#[derive(Clone)]
12312pub struct Module {
12313 pub proc: Option<Arc<DaggerSessionProc>>,
12314 pub selection: Selection,
12315 pub graphql_client: DynGraphQLClient,
12316}
12317#[derive(Builder, Debug, PartialEq)]
12318pub struct ModuleChecksOpts<'a> {
12319 #[builder(setter(into, strip_option), default)]
12321 pub include: Option<Vec<&'a str>>,
12322 #[builder(setter(into, strip_option), default)]
12324 pub no_generate: Option<bool>,
12325}
12326#[derive(Builder, Debug, PartialEq)]
12327pub struct ModuleGeneratorsOpts<'a> {
12328 #[builder(setter(into, strip_option), default)]
12330 pub include: Option<Vec<&'a str>>,
12331}
12332#[derive(Builder, Debug, PartialEq)]
12333pub struct ModuleServeOpts {
12334 #[builder(setter(into, strip_option), default)]
12336 pub entrypoint: Option<bool>,
12337 #[builder(setter(into, strip_option), default)]
12339 pub include_dependencies: Option<bool>,
12340}
12341#[derive(Builder, Debug, PartialEq)]
12342pub struct ModuleServicesOpts<'a> {
12343 #[builder(setter(into, strip_option), default)]
12345 pub include: Option<Vec<&'a str>>,
12346}
12347impl IntoID<Id> for Module {
12348 fn into_id(
12349 self,
12350 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12351 Box::pin(async move { self.id().await })
12352 }
12353}
12354impl Loadable for Module {
12355 fn graphql_type() -> &'static str {
12356 "Module"
12357 }
12358 fn from_query(
12359 proc: Option<Arc<DaggerSessionProc>>,
12360 selection: Selection,
12361 graphql_client: DynGraphQLClient,
12362 ) -> Self {
12363 Self {
12364 proc,
12365 selection,
12366 graphql_client,
12367 }
12368 }
12369}
12370impl Module {
12371 pub fn check(&self, name: impl Into<String>) -> Check {
12377 let mut query = self.selection.select("check");
12378 query = query.arg("name", name.into());
12379 Check {
12380 proc: self.proc.clone(),
12381 selection: query,
12382 graphql_client: self.graphql_client.clone(),
12383 }
12384 }
12385 pub fn checks(&self) -> CheckGroup {
12391 let query = self.selection.select("checks");
12392 CheckGroup {
12393 proc: self.proc.clone(),
12394 selection: query,
12395 graphql_client: self.graphql_client.clone(),
12396 }
12397 }
12398 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
12404 let mut query = self.selection.select("checks");
12405 if let Some(include) = opts.include {
12406 query = query.arg("include", include);
12407 }
12408 if let Some(no_generate) = opts.no_generate {
12409 query = query.arg("noGenerate", no_generate);
12410 }
12411 CheckGroup {
12412 proc: self.proc.clone(),
12413 selection: query,
12414 graphql_client: self.graphql_client.clone(),
12415 }
12416 }
12417 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
12419 let query = self.selection.select("dependencies");
12420 let query = query.select("id");
12421 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12422 Ok(ids
12423 .into_iter()
12424 .map(|id| Module {
12425 proc: self.proc.clone(),
12426 selection: crate::querybuilder::query()
12427 .select("node")
12428 .arg("id", &id.0)
12429 .inline_fragment("Module"),
12430 graphql_client: self.graphql_client.clone(),
12431 })
12432 .collect())
12433 }
12434 pub async fn description(&self) -> Result<String, DaggerError> {
12436 let query = self.selection.select("description");
12437 query.execute(self.graphql_client.clone()).await
12438 }
12439 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
12441 let query = self.selection.select("enums");
12442 let query = query.select("id");
12443 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12444 Ok(ids
12445 .into_iter()
12446 .map(|id| TypeDef {
12447 proc: self.proc.clone(),
12448 selection: crate::querybuilder::query()
12449 .select("node")
12450 .arg("id", &id.0)
12451 .inline_fragment("TypeDef"),
12452 graphql_client: self.graphql_client.clone(),
12453 })
12454 .collect())
12455 }
12456 pub fn generated_context_directory(&self) -> Directory {
12458 let query = self.selection.select("generatedContextDirectory");
12459 Directory {
12460 proc: self.proc.clone(),
12461 selection: query,
12462 graphql_client: self.graphql_client.clone(),
12463 }
12464 }
12465 pub fn generator(&self, name: impl Into<String>) -> Generator {
12471 let mut query = self.selection.select("generator");
12472 query = query.arg("name", name.into());
12473 Generator {
12474 proc: self.proc.clone(),
12475 selection: query,
12476 graphql_client: self.graphql_client.clone(),
12477 }
12478 }
12479 pub fn generators(&self) -> GeneratorGroup {
12485 let query = self.selection.select("generators");
12486 GeneratorGroup {
12487 proc: self.proc.clone(),
12488 selection: query,
12489 graphql_client: self.graphql_client.clone(),
12490 }
12491 }
12492 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
12498 let mut query = self.selection.select("generators");
12499 if let Some(include) = opts.include {
12500 query = query.arg("include", include);
12501 }
12502 GeneratorGroup {
12503 proc: self.proc.clone(),
12504 selection: query,
12505 graphql_client: self.graphql_client.clone(),
12506 }
12507 }
12508 pub async fn id(&self) -> Result<Id, DaggerError> {
12510 let query = self.selection.select("id");
12511 query.execute(self.graphql_client.clone()).await
12512 }
12513 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
12515 let query = self.selection.select("interfaces");
12516 let query = query.select("id");
12517 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12518 Ok(ids
12519 .into_iter()
12520 .map(|id| TypeDef {
12521 proc: self.proc.clone(),
12522 selection: crate::querybuilder::query()
12523 .select("node")
12524 .arg("id", &id.0)
12525 .inline_fragment("TypeDef"),
12526 graphql_client: self.graphql_client.clone(),
12527 })
12528 .collect())
12529 }
12530 pub fn introspection_schema_json(&self) -> File {
12534 let query = self.selection.select("introspectionSchemaJSON");
12535 File {
12536 proc: self.proc.clone(),
12537 selection: query,
12538 graphql_client: self.graphql_client.clone(),
12539 }
12540 }
12541 pub async fn name(&self) -> Result<String, DaggerError> {
12543 let query = self.selection.select("name");
12544 query.execute(self.graphql_client.clone()).await
12545 }
12546 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
12548 let query = self.selection.select("objects");
12549 let query = query.select("id");
12550 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12551 Ok(ids
12552 .into_iter()
12553 .map(|id| TypeDef {
12554 proc: self.proc.clone(),
12555 selection: crate::querybuilder::query()
12556 .select("node")
12557 .arg("id", &id.0)
12558 .inline_fragment("TypeDef"),
12559 graphql_client: self.graphql_client.clone(),
12560 })
12561 .collect())
12562 }
12563 pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
12565 let query = self.selection.select("runtime");
12566 let query = query.select("id");
12567 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12568 Ok(id.map(|id| Container {
12569 proc: self.proc.clone(),
12570 selection: query
12571 .root()
12572 .select("node")
12573 .arg("id", &id.0)
12574 .inline_fragment("Container"),
12575 graphql_client: self.graphql_client.clone(),
12576 }))
12577 }
12578 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
12580 let query = self.selection.select("sdk");
12581 let query = query.select("id");
12582 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12583 Ok(id.map(|id| SdkConfig {
12584 proc: self.proc.clone(),
12585 selection: query
12586 .root()
12587 .select("node")
12588 .arg("id", &id.0)
12589 .inline_fragment("SDKConfig"),
12590 graphql_client: self.graphql_client.clone(),
12591 }))
12592 }
12593 pub async fn serve(&self) -> Result<Void, DaggerError> {
12600 let query = self.selection.select("serve");
12601 query.execute(self.graphql_client.clone()).await
12602 }
12603 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
12610 let mut query = self.selection.select("serve");
12611 if let Some(include_dependencies) = opts.include_dependencies {
12612 query = query.arg("includeDependencies", include_dependencies);
12613 }
12614 if let Some(entrypoint) = opts.entrypoint {
12615 query = query.arg("entrypoint", entrypoint);
12616 }
12617 query.execute(self.graphql_client.clone()).await
12618 }
12619 pub fn services(&self) -> UpGroup {
12625 let query = self.selection.select("services");
12626 UpGroup {
12627 proc: self.proc.clone(),
12628 selection: query,
12629 graphql_client: self.graphql_client.clone(),
12630 }
12631 }
12632 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
12638 let mut query = self.selection.select("services");
12639 if let Some(include) = opts.include {
12640 query = query.arg("include", include);
12641 }
12642 UpGroup {
12643 proc: self.proc.clone(),
12644 selection: query,
12645 graphql_client: self.graphql_client.clone(),
12646 }
12647 }
12648 pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
12650 let query = self.selection.select("source");
12651 let query = query.select("id");
12652 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12653 Ok(id.map(|id| ModuleSource {
12654 proc: self.proc.clone(),
12655 selection: query
12656 .root()
12657 .select("node")
12658 .arg("id", &id.0)
12659 .inline_fragment("ModuleSource"),
12660 graphql_client: self.graphql_client.clone(),
12661 }))
12662 }
12663 pub async fn sync(&self) -> Result<Module, DaggerError> {
12665 let query = self.selection.select("sync");
12666 let id: Id = query.execute(self.graphql_client.clone()).await?;
12667 Ok(Module {
12668 proc: self.proc.clone(),
12669 selection: query
12670 .root()
12671 .select("node")
12672 .arg("id", &id.0)
12673 .inline_fragment("Module"),
12674 graphql_client: self.graphql_client.clone(),
12675 })
12676 }
12677 pub fn user_defaults(&self) -> EnvFile {
12679 let query = self.selection.select("userDefaults");
12680 EnvFile {
12681 proc: self.proc.clone(),
12682 selection: query,
12683 graphql_client: self.graphql_client.clone(),
12684 }
12685 }
12686 pub fn with_description(&self, description: impl Into<String>) -> Module {
12692 let mut query = self.selection.select("withDescription");
12693 query = query.arg("description", description.into());
12694 Module {
12695 proc: self.proc.clone(),
12696 selection: query,
12697 graphql_client: self.graphql_client.clone(),
12698 }
12699 }
12700 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
12702 let mut query = self.selection.select("withEnum");
12703 query = query.arg_lazy(
12704 "enum",
12705 Box::new(move || {
12706 let r#enum = r#enum.clone();
12707 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
12708 }),
12709 );
12710 Module {
12711 proc: self.proc.clone(),
12712 selection: query,
12713 graphql_client: self.graphql_client.clone(),
12714 }
12715 }
12716 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
12718 let mut query = self.selection.select("withInterface");
12719 query = query.arg_lazy(
12720 "iface",
12721 Box::new(move || {
12722 let iface = iface.clone();
12723 Box::pin(async move { iface.into_id().await.unwrap().quote() })
12724 }),
12725 );
12726 Module {
12727 proc: self.proc.clone(),
12728 selection: query,
12729 graphql_client: self.graphql_client.clone(),
12730 }
12731 }
12732 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
12734 let mut query = self.selection.select("withObject");
12735 query = query.arg_lazy(
12736 "object",
12737 Box::new(move || {
12738 let object = object.clone();
12739 Box::pin(async move { object.into_id().await.unwrap().quote() })
12740 }),
12741 );
12742 Module {
12743 proc: self.proc.clone(),
12744 selection: query,
12745 graphql_client: self.graphql_client.clone(),
12746 }
12747 }
12748}
12749impl Node for Module {
12750 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12751 let query = self.selection.select("id");
12752 let graphql_client = self.graphql_client.clone();
12753 async move { query.execute(graphql_client).await }
12754 }
12755}
12756impl Syncer for Module {
12757 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12758 let query = self.selection.select("id");
12759 let graphql_client = self.graphql_client.clone();
12760 async move { query.execute(graphql_client).await }
12761 }
12762 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
12763 let query = self.selection.select("sync");
12764 let proc = self.proc.clone();
12765 let graphql_client = self.graphql_client.clone();
12766 async move {
12767 let id: Id = query.execute(graphql_client.clone()).await?;
12768 Ok(Self {
12769 proc,
12770 selection: query
12771 .root()
12772 .select("node")
12773 .arg("id", &id.0)
12774 .inline_fragment("Module"),
12775 graphql_client,
12776 })
12777 }
12778 }
12779}
12780#[derive(Clone)]
12781pub struct ModuleConfigClient {
12782 pub proc: Option<Arc<DaggerSessionProc>>,
12783 pub selection: Selection,
12784 pub graphql_client: DynGraphQLClient,
12785}
12786impl IntoID<Id> for ModuleConfigClient {
12787 fn into_id(
12788 self,
12789 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12790 Box::pin(async move { self.id().await })
12791 }
12792}
12793impl Loadable for ModuleConfigClient {
12794 fn graphql_type() -> &'static str {
12795 "ModuleConfigClient"
12796 }
12797 fn from_query(
12798 proc: Option<Arc<DaggerSessionProc>>,
12799 selection: Selection,
12800 graphql_client: DynGraphQLClient,
12801 ) -> Self {
12802 Self {
12803 proc,
12804 selection,
12805 graphql_client,
12806 }
12807 }
12808}
12809impl ModuleConfigClient {
12810 pub async fn directory(&self) -> Result<String, DaggerError> {
12812 let query = self.selection.select("directory");
12813 query.execute(self.graphql_client.clone()).await
12814 }
12815 pub async fn generator(&self) -> Result<String, DaggerError> {
12817 let query = self.selection.select("generator");
12818 query.execute(self.graphql_client.clone()).await
12819 }
12820 pub async fn id(&self) -> Result<Id, DaggerError> {
12822 let query = self.selection.select("id");
12823 query.execute(self.graphql_client.clone()).await
12824 }
12825}
12826impl Node for ModuleConfigClient {
12827 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12828 let query = self.selection.select("id");
12829 let graphql_client = self.graphql_client.clone();
12830 async move { query.execute(graphql_client).await }
12831 }
12832}
12833#[derive(Clone)]
12834pub struct ModuleSource {
12835 pub proc: Option<Arc<DaggerSessionProc>>,
12836 pub selection: Selection,
12837 pub graphql_client: DynGraphQLClient,
12838}
12839impl IntoID<Id> for ModuleSource {
12840 fn into_id(
12841 self,
12842 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12843 Box::pin(async move { self.id().await })
12844 }
12845}
12846impl Loadable for ModuleSource {
12847 fn graphql_type() -> &'static str {
12848 "ModuleSource"
12849 }
12850 fn from_query(
12851 proc: Option<Arc<DaggerSessionProc>>,
12852 selection: Selection,
12853 graphql_client: DynGraphQLClient,
12854 ) -> Self {
12855 Self {
12856 proc,
12857 selection,
12858 graphql_client,
12859 }
12860 }
12861}
12862impl ModuleSource {
12863 pub fn as_module(&self) -> Module {
12865 let query = self.selection.select("asModule");
12866 Module {
12867 proc: self.proc.clone(),
12868 selection: query,
12869 graphql_client: self.graphql_client.clone(),
12870 }
12871 }
12872 pub async fn as_string(&self) -> Result<String, DaggerError> {
12874 let query = self.selection.select("asString");
12875 query.execute(self.graphql_client.clone()).await
12876 }
12877 pub fn blueprint(&self) -> ModuleSource {
12879 let query = self.selection.select("blueprint");
12880 ModuleSource {
12881 proc: self.proc.clone(),
12882 selection: query,
12883 graphql_client: self.graphql_client.clone(),
12884 }
12885 }
12886 pub fn client_schema_introspection_json(&self) -> File {
12889 let query = self.selection.select("clientSchemaIntrospectionJSON");
12890 File {
12891 proc: self.proc.clone(),
12892 selection: query,
12893 graphql_client: self.graphql_client.clone(),
12894 }
12895 }
12896 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
12898 let query = self.selection.select("cloneRef");
12899 query.execute(self.graphql_client.clone()).await
12900 }
12901 pub async fn commit(&self) -> Result<String, DaggerError> {
12903 let query = self.selection.select("commit");
12904 query.execute(self.graphql_client.clone()).await
12905 }
12906 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
12908 let query = self.selection.select("configClients");
12909 let query = query.select("id");
12910 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12911 Ok(ids
12912 .into_iter()
12913 .map(|id| ModuleConfigClient {
12914 proc: self.proc.clone(),
12915 selection: crate::querybuilder::query()
12916 .select("node")
12917 .arg("id", &id.0)
12918 .inline_fragment("ModuleConfigClient"),
12919 graphql_client: self.graphql_client.clone(),
12920 })
12921 .collect())
12922 }
12923 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
12925 let query = self.selection.select("configExists");
12926 query.execute(self.graphql_client.clone()).await
12927 }
12928 pub fn context_directory(&self) -> Directory {
12930 let query = self.selection.select("contextDirectory");
12931 Directory {
12932 proc: self.proc.clone(),
12933 selection: query,
12934 graphql_client: self.graphql_client.clone(),
12935 }
12936 }
12937 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12939 let query = self.selection.select("dependencies");
12940 let query = query.select("id");
12941 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12942 Ok(ids
12943 .into_iter()
12944 .map(|id| ModuleSource {
12945 proc: self.proc.clone(),
12946 selection: crate::querybuilder::query()
12947 .select("node")
12948 .arg("id", &id.0)
12949 .inline_fragment("ModuleSource"),
12950 graphql_client: self.graphql_client.clone(),
12951 })
12952 .collect())
12953 }
12954 pub async fn digest(&self) -> Result<String, DaggerError> {
12956 let query = self.selection.select("digest");
12957 query.execute(self.graphql_client.clone()).await
12958 }
12959 pub fn directory(&self, path: impl Into<String>) -> Directory {
12965 let mut query = self.selection.select("directory");
12966 query = query.arg("path", path.into());
12967 Directory {
12968 proc: self.proc.clone(),
12969 selection: query,
12970 graphql_client: self.graphql_client.clone(),
12971 }
12972 }
12973 pub async fn engine_version(&self) -> Result<String, DaggerError> {
12975 let query = self.selection.select("engineVersion");
12976 query.execute(self.graphql_client.clone()).await
12977 }
12978 pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
12985 let mut query = self.selection.select("generate");
12986 query = query.arg_lazy(
12987 "workspace",
12988 Box::new(move || {
12989 let workspace = workspace.clone();
12990 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
12991 }),
12992 );
12993 Workspace {
12994 proc: self.proc.clone(),
12995 selection: query,
12996 graphql_client: self.graphql_client.clone(),
12997 }
12998 }
12999 pub fn generated_context_changeset(&self) -> Changeset {
13001 let query = self.selection.select("generatedContextChangeset");
13002 Changeset {
13003 proc: self.proc.clone(),
13004 selection: query,
13005 graphql_client: self.graphql_client.clone(),
13006 }
13007 }
13008 pub fn generated_context_directory(&self) -> Directory {
13010 let query = self.selection.select("generatedContextDirectory");
13011 Directory {
13012 proc: self.proc.clone(),
13013 selection: query,
13014 graphql_client: self.graphql_client.clone(),
13015 }
13016 }
13017 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
13019 let query = self.selection.select("htmlRepoURL");
13020 query.execute(self.graphql_client.clone()).await
13021 }
13022 pub async fn html_url(&self) -> Result<String, DaggerError> {
13024 let query = self.selection.select("htmlURL");
13025 query.execute(self.graphql_client.clone()).await
13026 }
13027 pub async fn id(&self) -> Result<Id, DaggerError> {
13029 let query = self.selection.select("id");
13030 query.execute(self.graphql_client.clone()).await
13031 }
13032 pub fn introspection_schema_json(&self) -> File {
13036 let query = self.selection.select("introspectionSchemaJSON");
13037 File {
13038 proc: self.proc.clone(),
13039 selection: query,
13040 graphql_client: self.graphql_client.clone(),
13041 }
13042 }
13043 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
13045 let query = self.selection.select("kind");
13046 query.execute(self.graphql_client.clone()).await
13047 }
13048 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
13050 let query = self.selection.select("localContextDirectoryPath");
13051 query.execute(self.graphql_client.clone()).await
13052 }
13053 pub async fn module_name(&self) -> Result<String, DaggerError> {
13055 let query = self.selection.select("moduleName");
13056 query.execute(self.graphql_client.clone()).await
13057 }
13058 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
13060 let query = self.selection.select("moduleOriginalName");
13061 query.execute(self.graphql_client.clone()).await
13062 }
13063 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
13065 let query = self.selection.select("originalSubpath");
13066 query.execute(self.graphql_client.clone()).await
13067 }
13068 pub async fn pin(&self) -> Result<String, DaggerError> {
13070 let query = self.selection.select("pin");
13071 query.execute(self.graphql_client.clone()).await
13072 }
13073 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
13075 let query = self.selection.select("repoRootPath");
13076 query.execute(self.graphql_client.clone()).await
13077 }
13078 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
13080 let query = self.selection.select("sdk");
13081 let query = query.select("id");
13082 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13083 Ok(id.map(|id| SdkConfig {
13084 proc: self.proc.clone(),
13085 selection: query
13086 .root()
13087 .select("node")
13088 .arg("id", &id.0)
13089 .inline_fragment("SDKConfig"),
13090 graphql_client: self.graphql_client.clone(),
13091 }))
13092 }
13093 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
13095 let query = self.selection.select("sourceRootSubpath");
13096 query.execute(self.graphql_client.clone()).await
13097 }
13098 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
13100 let query = self.selection.select("sourceSubpath");
13101 query.execute(self.graphql_client.clone()).await
13102 }
13103 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
13105 let query = self.selection.select("sync");
13106 let id: Id = query.execute(self.graphql_client.clone()).await?;
13107 Ok(ModuleSource {
13108 proc: self.proc.clone(),
13109 selection: query
13110 .root()
13111 .select("node")
13112 .arg("id", &id.0)
13113 .inline_fragment("ModuleSource"),
13114 graphql_client: self.graphql_client.clone(),
13115 })
13116 }
13117 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
13119 let query = self.selection.select("toolchains");
13120 let query = query.select("id");
13121 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13122 Ok(ids
13123 .into_iter()
13124 .map(|id| ModuleSource {
13125 proc: self.proc.clone(),
13126 selection: crate::querybuilder::query()
13127 .select("node")
13128 .arg("id", &id.0)
13129 .inline_fragment("ModuleSource"),
13130 graphql_client: self.graphql_client.clone(),
13131 })
13132 .collect())
13133 }
13134 pub fn updated_config_directory(&self) -> Directory {
13137 let query = self.selection.select("updatedConfigDirectory");
13138 Directory {
13139 proc: self.proc.clone(),
13140 selection: query,
13141 graphql_client: self.graphql_client.clone(),
13142 }
13143 }
13144 pub fn user_defaults(&self) -> EnvFile {
13146 let query = self.selection.select("userDefaults");
13147 EnvFile {
13148 proc: self.proc.clone(),
13149 selection: query,
13150 graphql_client: self.graphql_client.clone(),
13151 }
13152 }
13153 pub async fn version(&self) -> Result<String, DaggerError> {
13155 let query = self.selection.select("version");
13156 query.execute(self.graphql_client.clone()).await
13157 }
13158 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
13164 let mut query = self.selection.select("withBlueprint");
13165 query = query.arg_lazy(
13166 "blueprint",
13167 Box::new(move || {
13168 let blueprint = blueprint.clone();
13169 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
13170 }),
13171 );
13172 ModuleSource {
13173 proc: self.proc.clone(),
13174 selection: query,
13175 graphql_client: self.graphql_client.clone(),
13176 }
13177 }
13178 pub fn with_client(
13185 &self,
13186 generator: impl Into<String>,
13187 output_dir: impl Into<String>,
13188 ) -> ModuleSource {
13189 let mut query = self.selection.select("withClient");
13190 query = query.arg("generator", generator.into());
13191 query = query.arg("outputDir", output_dir.into());
13192 ModuleSource {
13193 proc: self.proc.clone(),
13194 selection: query,
13195 graphql_client: self.graphql_client.clone(),
13196 }
13197 }
13198 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
13204 let mut query = self.selection.select("withDependencies");
13205 query = query.arg("dependencies", dependencies);
13206 ModuleSource {
13207 proc: self.proc.clone(),
13208 selection: query,
13209 graphql_client: self.graphql_client.clone(),
13210 }
13211 }
13212 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
13218 let mut query = self.selection.select("withEngineVersion");
13219 query = query.arg("version", version.into());
13220 ModuleSource {
13221 proc: self.proc.clone(),
13222 selection: query,
13223 graphql_client: self.graphql_client.clone(),
13224 }
13225 }
13226 pub fn with_experimental_features(
13232 &self,
13233 features: Vec<ModuleSourceExperimentalFeature>,
13234 ) -> ModuleSource {
13235 let mut query = self.selection.select("withExperimentalFeatures");
13236 query = query.arg("features", features);
13237 ModuleSource {
13238 proc: self.proc.clone(),
13239 selection: query,
13240 graphql_client: self.graphql_client.clone(),
13241 }
13242 }
13243 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
13249 let mut query = self.selection.select("withIncludes");
13250 query = query.arg(
13251 "patterns",
13252 patterns
13253 .into_iter()
13254 .map(|i| i.into())
13255 .collect::<Vec<String>>(),
13256 );
13257 ModuleSource {
13258 proc: self.proc.clone(),
13259 selection: query,
13260 graphql_client: self.graphql_client.clone(),
13261 }
13262 }
13263 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
13269 let mut query = self.selection.select("withName");
13270 query = query.arg("name", name.into());
13271 ModuleSource {
13272 proc: self.proc.clone(),
13273 selection: query,
13274 graphql_client: self.graphql_client.clone(),
13275 }
13276 }
13277 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
13283 let mut query = self.selection.select("withSDK");
13284 query = query.arg("source", source.into());
13285 ModuleSource {
13286 proc: self.proc.clone(),
13287 selection: query,
13288 graphql_client: self.graphql_client.clone(),
13289 }
13290 }
13291 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
13297 let mut query = self.selection.select("withSourceSubpath");
13298 query = query.arg("path", path.into());
13299 ModuleSource {
13300 proc: self.proc.clone(),
13301 selection: query,
13302 graphql_client: self.graphql_client.clone(),
13303 }
13304 }
13305 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
13311 let mut query = self.selection.select("withToolchains");
13312 query = query.arg("toolchains", toolchains);
13313 ModuleSource {
13314 proc: self.proc.clone(),
13315 selection: query,
13316 graphql_client: self.graphql_client.clone(),
13317 }
13318 }
13319 pub fn with_update_blueprint(&self) -> ModuleSource {
13321 let query = self.selection.select("withUpdateBlueprint");
13322 ModuleSource {
13323 proc: self.proc.clone(),
13324 selection: query,
13325 graphql_client: self.graphql_client.clone(),
13326 }
13327 }
13328 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
13334 let mut query = self.selection.select("withUpdateDependencies");
13335 query = query.arg(
13336 "dependencies",
13337 dependencies
13338 .into_iter()
13339 .map(|i| i.into())
13340 .collect::<Vec<String>>(),
13341 );
13342 ModuleSource {
13343 proc: self.proc.clone(),
13344 selection: query,
13345 graphql_client: self.graphql_client.clone(),
13346 }
13347 }
13348 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
13354 let mut query = self.selection.select("withUpdateToolchains");
13355 query = query.arg(
13356 "toolchains",
13357 toolchains
13358 .into_iter()
13359 .map(|i| i.into())
13360 .collect::<Vec<String>>(),
13361 );
13362 ModuleSource {
13363 proc: self.proc.clone(),
13364 selection: query,
13365 graphql_client: self.graphql_client.clone(),
13366 }
13367 }
13368 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
13374 let mut query = self.selection.select("withUpdatedClients");
13375 query = query.arg(
13376 "clients",
13377 clients
13378 .into_iter()
13379 .map(|i| i.into())
13380 .collect::<Vec<String>>(),
13381 );
13382 ModuleSource {
13383 proc: self.proc.clone(),
13384 selection: query,
13385 graphql_client: self.graphql_client.clone(),
13386 }
13387 }
13388 pub fn without_blueprint(&self) -> ModuleSource {
13390 let query = self.selection.select("withoutBlueprint");
13391 ModuleSource {
13392 proc: self.proc.clone(),
13393 selection: query,
13394 graphql_client: self.graphql_client.clone(),
13395 }
13396 }
13397 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
13403 let mut query = self.selection.select("withoutClient");
13404 query = query.arg("path", path.into());
13405 ModuleSource {
13406 proc: self.proc.clone(),
13407 selection: query,
13408 graphql_client: self.graphql_client.clone(),
13409 }
13410 }
13411 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
13417 let mut query = self.selection.select("withoutDependencies");
13418 query = query.arg(
13419 "dependencies",
13420 dependencies
13421 .into_iter()
13422 .map(|i| i.into())
13423 .collect::<Vec<String>>(),
13424 );
13425 ModuleSource {
13426 proc: self.proc.clone(),
13427 selection: query,
13428 graphql_client: self.graphql_client.clone(),
13429 }
13430 }
13431 pub fn without_experimental_features(
13437 &self,
13438 features: Vec<ModuleSourceExperimentalFeature>,
13439 ) -> ModuleSource {
13440 let mut query = self.selection.select("withoutExperimentalFeatures");
13441 query = query.arg("features", features);
13442 ModuleSource {
13443 proc: self.proc.clone(),
13444 selection: query,
13445 graphql_client: self.graphql_client.clone(),
13446 }
13447 }
13448 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
13454 let mut query = self.selection.select("withoutToolchains");
13455 query = query.arg(
13456 "toolchains",
13457 toolchains
13458 .into_iter()
13459 .map(|i| i.into())
13460 .collect::<Vec<String>>(),
13461 );
13462 ModuleSource {
13463 proc: self.proc.clone(),
13464 selection: query,
13465 graphql_client: self.graphql_client.clone(),
13466 }
13467 }
13468}
13469impl Node for ModuleSource {
13470 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13471 let query = self.selection.select("id");
13472 let graphql_client = self.graphql_client.clone();
13473 async move { query.execute(graphql_client).await }
13474 }
13475}
13476impl Syncer for ModuleSource {
13477 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13478 let query = self.selection.select("id");
13479 let graphql_client = self.graphql_client.clone();
13480 async move { query.execute(graphql_client).await }
13481 }
13482 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13483 let query = self.selection.select("sync");
13484 let proc = self.proc.clone();
13485 let graphql_client = self.graphql_client.clone();
13486 async move {
13487 let id: Id = query.execute(graphql_client.clone()).await?;
13488 Ok(Self {
13489 proc,
13490 selection: query
13491 .root()
13492 .select("node")
13493 .arg("id", &id.0)
13494 .inline_fragment("ModuleSource"),
13495 graphql_client,
13496 })
13497 }
13498 }
13499}
13500#[derive(Clone)]
13501pub struct ObjectTypeDef {
13502 pub proc: Option<Arc<DaggerSessionProc>>,
13503 pub selection: Selection,
13504 pub graphql_client: DynGraphQLClient,
13505}
13506impl IntoID<Id> for ObjectTypeDef {
13507 fn into_id(
13508 self,
13509 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13510 Box::pin(async move { self.id().await })
13511 }
13512}
13513impl Loadable for ObjectTypeDef {
13514 fn graphql_type() -> &'static str {
13515 "ObjectTypeDef"
13516 }
13517 fn from_query(
13518 proc: Option<Arc<DaggerSessionProc>>,
13519 selection: Selection,
13520 graphql_client: DynGraphQLClient,
13521 ) -> Self {
13522 Self {
13523 proc,
13524 selection,
13525 graphql_client,
13526 }
13527 }
13528}
13529impl ObjectTypeDef {
13530 pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
13532 let query = self.selection.select("constructor");
13533 let query = query.select("id");
13534 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13535 Ok(id.map(|id| Function {
13536 proc: self.proc.clone(),
13537 selection: query
13538 .root()
13539 .select("node")
13540 .arg("id", &id.0)
13541 .inline_fragment("Function"),
13542 graphql_client: self.graphql_client.clone(),
13543 }))
13544 }
13545 pub async fn deprecated(&self) -> Result<String, DaggerError> {
13547 let query = self.selection.select("deprecated");
13548 query.execute(self.graphql_client.clone()).await
13549 }
13550 pub async fn description(&self) -> Result<String, DaggerError> {
13552 let query = self.selection.select("description");
13553 query.execute(self.graphql_client.clone()).await
13554 }
13555 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
13557 let query = self.selection.select("fields");
13558 let query = query.select("id");
13559 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13560 Ok(ids
13561 .into_iter()
13562 .map(|id| FieldTypeDef {
13563 proc: self.proc.clone(),
13564 selection: crate::querybuilder::query()
13565 .select("node")
13566 .arg("id", &id.0)
13567 .inline_fragment("FieldTypeDef"),
13568 graphql_client: self.graphql_client.clone(),
13569 })
13570 .collect())
13571 }
13572 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
13574 let query = self.selection.select("functions");
13575 let query = query.select("id");
13576 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13577 Ok(ids
13578 .into_iter()
13579 .map(|id| Function {
13580 proc: self.proc.clone(),
13581 selection: crate::querybuilder::query()
13582 .select("node")
13583 .arg("id", &id.0)
13584 .inline_fragment("Function"),
13585 graphql_client: self.graphql_client.clone(),
13586 })
13587 .collect())
13588 }
13589 pub async fn id(&self) -> Result<Id, DaggerError> {
13591 let query = self.selection.select("id");
13592 query.execute(self.graphql_client.clone()).await
13593 }
13594 pub async fn name(&self) -> Result<String, DaggerError> {
13596 let query = self.selection.select("name");
13597 query.execute(self.graphql_client.clone()).await
13598 }
13599 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
13601 let query = self.selection.select("sourceMap");
13602 let query = query.select("id");
13603 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13604 Ok(id.map(|id| SourceMap {
13605 proc: self.proc.clone(),
13606 selection: query
13607 .root()
13608 .select("node")
13609 .arg("id", &id.0)
13610 .inline_fragment("SourceMap"),
13611 graphql_client: self.graphql_client.clone(),
13612 }))
13613 }
13614 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
13616 let query = self.selection.select("sourceModuleName");
13617 query.execute(self.graphql_client.clone()).await
13618 }
13619}
13620impl Node for ObjectTypeDef {
13621 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13622 let query = self.selection.select("id");
13623 let graphql_client = self.graphql_client.clone();
13624 async move { query.execute(graphql_client).await }
13625 }
13626}
13627#[derive(Clone)]
13628pub struct Port {
13629 pub proc: Option<Arc<DaggerSessionProc>>,
13630 pub selection: Selection,
13631 pub graphql_client: DynGraphQLClient,
13632}
13633impl IntoID<Id> for Port {
13634 fn into_id(
13635 self,
13636 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13637 Box::pin(async move { self.id().await })
13638 }
13639}
13640impl Loadable for Port {
13641 fn graphql_type() -> &'static str {
13642 "Port"
13643 }
13644 fn from_query(
13645 proc: Option<Arc<DaggerSessionProc>>,
13646 selection: Selection,
13647 graphql_client: DynGraphQLClient,
13648 ) -> Self {
13649 Self {
13650 proc,
13651 selection,
13652 graphql_client,
13653 }
13654 }
13655}
13656impl Port {
13657 pub async fn description(&self) -> Result<String, DaggerError> {
13659 let query = self.selection.select("description");
13660 query.execute(self.graphql_client.clone()).await
13661 }
13662 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
13664 let query = self.selection.select("experimentalSkipHealthcheck");
13665 query.execute(self.graphql_client.clone()).await
13666 }
13667 pub async fn id(&self) -> Result<Id, DaggerError> {
13669 let query = self.selection.select("id");
13670 query.execute(self.graphql_client.clone()).await
13671 }
13672 pub async fn port(&self) -> Result<isize, DaggerError> {
13674 let query = self.selection.select("port");
13675 query.execute(self.graphql_client.clone()).await
13676 }
13677 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
13679 let query = self.selection.select("protocol");
13680 query.execute(self.graphql_client.clone()).await
13681 }
13682}
13683impl Node for Port {
13684 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13685 let query = self.selection.select("id");
13686 let graphql_client = self.graphql_client.clone();
13687 async move { query.execute(graphql_client).await }
13688 }
13689}
13690#[derive(Clone)]
13691pub struct Query {
13692 pub proc: Option<Arc<DaggerSessionProc>>,
13693 pub selection: Selection,
13694 pub graphql_client: DynGraphQLClient,
13695}
13696#[derive(Builder, Debug, PartialEq)]
13697pub struct QueryBlobOpts {
13698 #[builder(setter(into, strip_option), default)]
13700 pub permissions: Option<isize>,
13701}
13702#[derive(Builder, Debug, PartialEq)]
13703pub struct QueryCacheVolumeOpts<'a> {
13704 #[builder(setter(into, strip_option), default)]
13708 pub owner: Option<&'a str>,
13709 #[builder(setter(into, strip_option), default)]
13711 pub sharing: Option<CacheSharingMode>,
13712 #[builder(setter(into, strip_option), default)]
13714 pub source: Option<Id>,
13715}
13716#[derive(Builder, Debug, PartialEq)]
13717pub struct QueryContainerOpts {
13718 #[builder(setter(into, strip_option), default)]
13720 pub platform: Option<Platform>,
13721}
13722#[derive(Builder, Debug, PartialEq)]
13723pub struct QueryCurrentTypeDefsOpts {
13724 #[builder(setter(into, strip_option), default)]
13727 pub hide_core: Option<bool>,
13728 #[builder(setter(into, strip_option), default)]
13730 pub return_all_types: Option<bool>,
13731}
13732#[derive(Builder, Debug, PartialEq)]
13733pub struct QueryEngineVolumeOpts<'a> {
13734 #[builder(setter(into, strip_option), default)]
13736 pub subdir: Option<&'a str>,
13737}
13738#[derive(Builder, Debug, PartialEq)]
13739pub struct QueryEnvFileOpts {
13740 #[builder(setter(into, strip_option), default)]
13742 pub expand: Option<bool>,
13743}
13744#[derive(Builder, Debug, PartialEq)]
13745pub struct QueryFileOpts {
13746 #[builder(setter(into, strip_option), default)]
13748 pub permissions: Option<isize>,
13749}
13750#[derive(Builder, Debug, PartialEq)]
13751pub struct QueryGitOpts<'a> {
13752 #[builder(setter(into, strip_option), default)]
13754 pub experimental_service_host: Option<Id>,
13755 #[builder(setter(into, strip_option), default)]
13757 pub http_auth_header: Option<Id>,
13758 #[builder(setter(into, strip_option), default)]
13760 pub http_auth_token: Option<Id>,
13761 #[builder(setter(into, strip_option), default)]
13763 pub http_auth_username: Option<&'a str>,
13764 #[builder(setter(into, strip_option), default)]
13766 pub keep_git_dir: Option<bool>,
13767 #[builder(setter(into, strip_option), default)]
13769 pub ssh_auth_socket: Option<Id>,
13770 #[builder(setter(into, strip_option), default)]
13772 pub ssh_known_hosts: Option<&'a str>,
13773}
13774#[derive(Builder, Debug, PartialEq)]
13775pub struct QueryHttpOpts<'a> {
13776 #[builder(setter(into, strip_option), default)]
13778 pub auth_header: Option<Id>,
13779 #[builder(setter(into, strip_option), default)]
13781 pub checksum: Option<&'a str>,
13782 #[builder(setter(into, strip_option), default)]
13784 pub experimental_service_host: Option<Id>,
13785 #[builder(setter(into, strip_option), default)]
13787 pub name: Option<&'a str>,
13788 #[builder(setter(into, strip_option), default)]
13790 pub permissions: Option<isize>,
13791}
13792#[derive(Builder, Debug, PartialEq)]
13793pub struct QueryLlmOpts<'a> {
13794 #[builder(setter(into, strip_option), default)]
13796 pub model: Option<&'a str>,
13797 #[builder(setter(into, strip_option), default)]
13799 pub provider: Option<&'a str>,
13800}
13801#[derive(Builder, Debug, PartialEq)]
13802pub struct QueryModuleSourceOpts<'a> {
13803 #[builder(setter(into, strip_option), default)]
13805 pub allow_not_exists: Option<bool>,
13806 #[builder(setter(into, strip_option), default)]
13808 pub disable_find_up: Option<bool>,
13809 #[builder(setter(into, strip_option), default)]
13811 pub ref_pin: Option<&'a str>,
13812 #[builder(setter(into, strip_option), default)]
13814 pub require_kind: Option<ModuleSourceKind>,
13815 #[builder(setter(into, strip_option), default)]
13817 pub version: Option<&'a str>,
13818}
13819#[derive(Builder, Debug, PartialEq)]
13820pub struct QuerySecretOpts<'a> {
13821 #[builder(setter(into, strip_option), default)]
13825 pub cache_key: Option<&'a str>,
13826}
13827#[derive(Builder, Debug, PartialEq)]
13828pub struct QueryServeModuleOpts<'a> {
13829 #[builder(setter(into, strip_option), default)]
13831 pub ref_pin: Option<&'a str>,
13832}
13833#[derive(Builder, Debug, PartialEq)]
13834pub struct QuerySshfsVolumeOpts<'a> {
13835 #[builder(setter(into, strip_option), default)]
13837 pub cache_key: Option<&'a str>,
13838 #[builder(setter(into, strip_option), default)]
13840 pub experimental_service_host: Option<Id>,
13841 #[builder(setter(into, strip_option), default)]
13843 pub insecure_skip_host_key_check: Option<bool>,
13844 #[builder(setter(into, strip_option), default)]
13846 pub known_hosts: Option<Id>,
13847}
13848impl IntoID<Id> for Query {
13849 fn into_id(
13850 self,
13851 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13852 Box::pin(async move { self.id().await })
13853 }
13854}
13855impl Loadable for Query {
13856 fn graphql_type() -> &'static str {
13857 "Query"
13858 }
13859 fn from_query(
13860 proc: Option<Arc<DaggerSessionProc>>,
13861 selection: Selection,
13862 graphql_client: DynGraphQLClient,
13863 ) -> Self {
13864 Self {
13865 proc,
13866 selection,
13867 graphql_client,
13868 }
13869 }
13870}
13871impl Query {
13872 pub fn address(&self, value: impl Into<String>) -> Address {
13874 let mut query = self.selection.select("address");
13875 query = query.arg("value", value.into());
13876 Address {
13877 proc: self.proc.clone(),
13878 selection: query,
13879 graphql_client: self.graphql_client.clone(),
13880 }
13881 }
13882 pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
13890 let mut query = self.selection.select("blob");
13891 query = query.arg("name", name.into());
13892 query = query.arg("contents", contents);
13893 File {
13894 proc: self.proc.clone(),
13895 selection: query,
13896 graphql_client: self.graphql_client.clone(),
13897 }
13898 }
13899 pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
13907 let mut query = self.selection.select("blob");
13908 query = query.arg("name", name.into());
13909 query = query.arg("contents", contents);
13910 if let Some(permissions) = opts.permissions {
13911 query = query.arg("permissions", permissions);
13912 }
13913 File {
13914 proc: self.proc.clone(),
13915 selection: query,
13916 graphql_client: self.graphql_client.clone(),
13917 }
13918 }
13919 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
13926 let mut query = self.selection.select("cacheVolume");
13927 query = query.arg("key", key.into());
13928 CacheVolume {
13929 proc: self.proc.clone(),
13930 selection: query,
13931 graphql_client: self.graphql_client.clone(),
13932 }
13933 }
13934 pub fn cache_volume_opts<'a>(
13941 &self,
13942 key: impl Into<String>,
13943 opts: QueryCacheVolumeOpts<'a>,
13944 ) -> CacheVolume {
13945 let mut query = self.selection.select("cacheVolume");
13946 query = query.arg("key", key.into());
13947 if let Some(source) = opts.source {
13948 query = query.arg("source", source);
13949 }
13950 if let Some(sharing) = opts.sharing {
13951 query = query.arg("sharing", sharing);
13952 }
13953 if let Some(owner) = opts.owner {
13954 query = query.arg("owner", owner);
13955 }
13956 CacheVolume {
13957 proc: self.proc.clone(),
13958 selection: query,
13959 graphql_client: self.graphql_client.clone(),
13960 }
13961 }
13962 pub fn changeset(&self) -> Changeset {
13964 let query = self.selection.select("changeset");
13965 Changeset {
13966 proc: self.proc.clone(),
13967 selection: query,
13968 graphql_client: self.graphql_client.clone(),
13969 }
13970 }
13971 pub fn cloud(&self) -> Cloud {
13973 let query = self.selection.select("cloud");
13974 Cloud {
13975 proc: self.proc.clone(),
13976 selection: query,
13977 graphql_client: self.graphql_client.clone(),
13978 }
13979 }
13980 pub fn container(&self) -> Container {
13987 let query = self.selection.select("container");
13988 Container {
13989 proc: self.proc.clone(),
13990 selection: query,
13991 graphql_client: self.graphql_client.clone(),
13992 }
13993 }
13994 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
14001 let mut query = self.selection.select("container");
14002 if let Some(platform) = opts.platform {
14003 query = query.arg("platform", platform);
14004 }
14005 Container {
14006 proc: self.proc.clone(),
14007 selection: query,
14008 graphql_client: self.graphql_client.clone(),
14009 }
14010 }
14011 pub fn current_function_call(&self) -> FunctionCall {
14014 let query = self.selection.select("currentFunctionCall");
14015 FunctionCall {
14016 proc: self.proc.clone(),
14017 selection: query,
14018 graphql_client: self.graphql_client.clone(),
14019 }
14020 }
14021 pub fn current_module(&self) -> CurrentModule {
14023 let query = self.selection.select("currentModule");
14024 CurrentModule {
14025 proc: self.proc.clone(),
14026 selection: query,
14027 graphql_client: self.graphql_client.clone(),
14028 }
14029 }
14030 pub fn current_node(&self) -> NodeClient {
14032 let query = self.selection.select("currentNode");
14033 NodeClient {
14034 proc: self.proc.clone(),
14035 selection: query,
14036 graphql_client: self.graphql_client.clone(),
14037 }
14038 }
14039 pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
14041 let query = self.selection.select("currentTimestamp");
14042 query.execute(self.graphql_client.clone()).await
14043 }
14044 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
14050 let query = self.selection.select("currentTypeDefs");
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| TypeDef {
14056 proc: self.proc.clone(),
14057 selection: crate::querybuilder::query()
14058 .select("node")
14059 .arg("id", &id.0)
14060 .inline_fragment("TypeDef"),
14061 graphql_client: self.graphql_client.clone(),
14062 })
14063 .collect())
14064 }
14065 pub async fn current_type_defs_opts(
14071 &self,
14072 opts: QueryCurrentTypeDefsOpts,
14073 ) -> Result<Vec<TypeDef>, DaggerError> {
14074 let mut query = self.selection.select("currentTypeDefs");
14075 if let Some(return_all_types) = opts.return_all_types {
14076 query = query.arg("returnAllTypes", return_all_types);
14077 }
14078 if let Some(hide_core) = opts.hide_core {
14079 query = query.arg("hideCore", hide_core);
14080 }
14081 let query = query.select("id");
14082 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14083 Ok(ids
14084 .into_iter()
14085 .map(|id| TypeDef {
14086 proc: self.proc.clone(),
14087 selection: crate::querybuilder::query()
14088 .select("node")
14089 .arg("id", &id.0)
14090 .inline_fragment("TypeDef"),
14091 graphql_client: self.graphql_client.clone(),
14092 })
14093 .collect())
14094 }
14095 pub fn current_workspace(&self) -> Workspace {
14097 let query = self.selection.select("currentWorkspace");
14098 Workspace {
14099 proc: self.proc.clone(),
14100 selection: query,
14101 graphql_client: self.graphql_client.clone(),
14102 }
14103 }
14104 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
14106 let query = self.selection.select("defaultPlatform");
14107 query.execute(self.graphql_client.clone()).await
14108 }
14109 pub fn directory(&self) -> Directory {
14111 let query = self.selection.select("directory");
14112 Directory {
14113 proc: self.proc.clone(),
14114 selection: query,
14115 graphql_client: self.graphql_client.clone(),
14116 }
14117 }
14118 pub fn engine(&self) -> Engine {
14120 let query = self.selection.select("engine");
14121 Engine {
14122 proc: self.proc.clone(),
14123 selection: query,
14124 graphql_client: self.graphql_client.clone(),
14125 }
14126 }
14127 pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
14134 let mut query = self.selection.select("engineVolume");
14135 query = query.arg("name", name.into());
14136 Volume {
14137 proc: self.proc.clone(),
14138 selection: query,
14139 graphql_client: self.graphql_client.clone(),
14140 }
14141 }
14142 pub fn engine_volume_opts<'a>(
14149 &self,
14150 name: impl Into<String>,
14151 opts: QueryEngineVolumeOpts<'a>,
14152 ) -> Volume {
14153 let mut query = self.selection.select("engineVolume");
14154 query = query.arg("name", name.into());
14155 if let Some(subdir) = opts.subdir {
14156 query = query.arg("subdir", subdir);
14157 }
14158 Volume {
14159 proc: self.proc.clone(),
14160 selection: query,
14161 graphql_client: self.graphql_client.clone(),
14162 }
14163 }
14164 pub fn env_file(&self) -> EnvFile {
14170 let query = self.selection.select("envFile");
14171 EnvFile {
14172 proc: self.proc.clone(),
14173 selection: query,
14174 graphql_client: self.graphql_client.clone(),
14175 }
14176 }
14177 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
14183 let mut query = self.selection.select("envFile");
14184 if let Some(expand) = opts.expand {
14185 query = query.arg("expand", expand);
14186 }
14187 EnvFile {
14188 proc: self.proc.clone(),
14189 selection: query,
14190 graphql_client: self.graphql_client.clone(),
14191 }
14192 }
14193 pub fn error(&self, message: impl Into<String>) -> Error {
14199 let mut query = self.selection.select("error");
14200 query = query.arg("message", message.into());
14201 Error {
14202 proc: self.proc.clone(),
14203 selection: query,
14204 graphql_client: self.graphql_client.clone(),
14205 }
14206 }
14207 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
14215 let mut query = self.selection.select("file");
14216 query = query.arg("name", name.into());
14217 query = query.arg("contents", contents.into());
14218 File {
14219 proc: self.proc.clone(),
14220 selection: query,
14221 graphql_client: self.graphql_client.clone(),
14222 }
14223 }
14224 pub fn file_opts(
14232 &self,
14233 name: impl Into<String>,
14234 contents: impl Into<String>,
14235 opts: QueryFileOpts,
14236 ) -> File {
14237 let mut query = self.selection.select("file");
14238 query = query.arg("name", name.into());
14239 query = query.arg("contents", contents.into());
14240 if let Some(permissions) = opts.permissions {
14241 query = query.arg("permissions", permissions);
14242 }
14243 File {
14244 proc: self.proc.clone(),
14245 selection: query,
14246 graphql_client: self.graphql_client.clone(),
14247 }
14248 }
14249 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
14256 let mut query = self.selection.select("function");
14257 query = query.arg("name", name.into());
14258 query = query.arg_lazy(
14259 "returnType",
14260 Box::new(move || {
14261 let return_type = return_type.clone();
14262 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
14263 }),
14264 );
14265 Function {
14266 proc: self.proc.clone(),
14267 selection: query,
14268 graphql_client: self.graphql_client.clone(),
14269 }
14270 }
14271 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
14273 let mut query = self.selection.select("generatedCode");
14274 query = query.arg_lazy(
14275 "code",
14276 Box::new(move || {
14277 let code = code.clone();
14278 Box::pin(async move { code.into_id().await.unwrap().quote() })
14279 }),
14280 );
14281 GeneratedCode {
14282 proc: self.proc.clone(),
14283 selection: query,
14284 graphql_client: self.graphql_client.clone(),
14285 }
14286 }
14287 pub fn git(&self, url: impl Into<String>) -> GitRepository {
14298 let mut query = self.selection.select("git");
14299 query = query.arg("url", url.into());
14300 GitRepository {
14301 proc: self.proc.clone(),
14302 selection: query,
14303 graphql_client: self.graphql_client.clone(),
14304 }
14305 }
14306 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
14317 let mut query = self.selection.select("git");
14318 query = query.arg("url", url.into());
14319 if let Some(keep_git_dir) = opts.keep_git_dir {
14320 query = query.arg("keepGitDir", keep_git_dir);
14321 }
14322 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
14323 query = query.arg("sshKnownHosts", ssh_known_hosts);
14324 }
14325 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
14326 query = query.arg("sshAuthSocket", ssh_auth_socket);
14327 }
14328 if let Some(http_auth_username) = opts.http_auth_username {
14329 query = query.arg("httpAuthUsername", http_auth_username);
14330 }
14331 if let Some(http_auth_token) = opts.http_auth_token {
14332 query = query.arg("httpAuthToken", http_auth_token);
14333 }
14334 if let Some(http_auth_header) = opts.http_auth_header {
14335 query = query.arg("httpAuthHeader", http_auth_header);
14336 }
14337 if let Some(experimental_service_host) = opts.experimental_service_host {
14338 query = query.arg("experimentalServiceHost", experimental_service_host);
14339 }
14340 GitRepository {
14341 proc: self.proc.clone(),
14342 selection: query,
14343 graphql_client: self.graphql_client.clone(),
14344 }
14345 }
14346 pub fn host(&self) -> Host {
14348 let query = self.selection.select("host");
14349 Host {
14350 proc: self.proc.clone(),
14351 selection: query,
14352 graphql_client: self.graphql_client.clone(),
14353 }
14354 }
14355 pub fn http(&self, url: impl Into<String>) -> File {
14362 let mut query = self.selection.select("http");
14363 query = query.arg("url", url.into());
14364 File {
14365 proc: self.proc.clone(),
14366 selection: query,
14367 graphql_client: self.graphql_client.clone(),
14368 }
14369 }
14370 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
14377 let mut query = self.selection.select("http");
14378 query = query.arg("url", url.into());
14379 if let Some(name) = opts.name {
14380 query = query.arg("name", name);
14381 }
14382 if let Some(permissions) = opts.permissions {
14383 query = query.arg("permissions", permissions);
14384 }
14385 if let Some(checksum) = opts.checksum {
14386 query = query.arg("checksum", checksum);
14387 }
14388 if let Some(auth_header) = opts.auth_header {
14389 query = query.arg("authHeader", auth_header);
14390 }
14391 if let Some(experimental_service_host) = opts.experimental_service_host {
14392 query = query.arg("experimentalServiceHost", experimental_service_host);
14393 }
14394 File {
14395 proc: self.proc.clone(),
14396 selection: query,
14397 graphql_client: self.graphql_client.clone(),
14398 }
14399 }
14400 pub async fn id(&self) -> Result<Id, DaggerError> {
14402 let query = self.selection.select("id");
14403 query.execute(self.graphql_client.clone()).await
14404 }
14405 pub fn json(&self) -> JsonValue {
14407 let query = self.selection.select("json");
14408 JsonValue {
14409 proc: self.proc.clone(),
14410 selection: query,
14411 graphql_client: self.graphql_client.clone(),
14412 }
14413 }
14414 pub fn llm(&self) -> Llm {
14420 let query = self.selection.select("llm");
14421 Llm {
14422 proc: self.proc.clone(),
14423 selection: query,
14424 graphql_client: self.graphql_client.clone(),
14425 }
14426 }
14427 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
14433 let mut query = self.selection.select("llm");
14434 if let Some(model) = opts.model {
14435 query = query.arg("model", model);
14436 }
14437 if let Some(provider) = opts.provider {
14438 query = query.arg("provider", provider);
14439 }
14440 Llm {
14441 proc: self.proc.clone(),
14442 selection: query,
14443 graphql_client: self.graphql_client.clone(),
14444 }
14445 }
14446 pub fn module(&self) -> Module {
14448 let query = self.selection.select("module");
14449 Module {
14450 proc: self.proc.clone(),
14451 selection: query,
14452 graphql_client: self.graphql_client.clone(),
14453 }
14454 }
14455 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14462 let mut query = self.selection.select("moduleSource");
14463 query = query.arg("refString", ref_string.into());
14464 ModuleSource {
14465 proc: self.proc.clone(),
14466 selection: query,
14467 graphql_client: self.graphql_client.clone(),
14468 }
14469 }
14470 pub fn module_source_opts<'a>(
14477 &self,
14478 ref_string: impl Into<String>,
14479 opts: QueryModuleSourceOpts<'a>,
14480 ) -> ModuleSource {
14481 let mut query = self.selection.select("moduleSource");
14482 query = query.arg("refString", ref_string.into());
14483 if let Some(version) = opts.version {
14484 query = query.arg("version", version);
14485 }
14486 if let Some(ref_pin) = opts.ref_pin {
14487 query = query.arg("refPin", ref_pin);
14488 }
14489 if let Some(disable_find_up) = opts.disable_find_up {
14490 query = query.arg("disableFindUp", disable_find_up);
14491 }
14492 if let Some(allow_not_exists) = opts.allow_not_exists {
14493 query = query.arg("allowNotExists", allow_not_exists);
14494 }
14495 if let Some(require_kind) = opts.require_kind {
14496 query = query.arg("requireKind", require_kind);
14497 }
14498 ModuleSource {
14499 proc: self.proc.clone(),
14500 selection: query,
14501 graphql_client: self.graphql_client.clone(),
14502 }
14503 }
14504 pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
14506 let mut query = self.selection.select("node");
14507 query = query.arg_lazy(
14508 "id",
14509 Box::new(move || {
14510 let id = id.clone();
14511 Box::pin(async move { id.into_id().await.unwrap().quote() })
14512 }),
14513 );
14514 let query = query.select("id");
14515 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14516 Ok(id.map(|id| NodeClient {
14517 proc: self.proc.clone(),
14518 selection: query
14519 .root()
14520 .select("node")
14521 .arg("id", &id.0)
14522 .inline_fragment("Node"),
14523 graphql_client: self.graphql_client.clone(),
14524 }))
14525 }
14526 pub fn schema(&self, json: Json) -> Schema {
14532 let mut query = self.selection.select("schema");
14533 query = query.arg("json", json);
14534 Schema {
14535 proc: self.proc.clone(),
14536 selection: query,
14537 graphql_client: self.graphql_client.clone(),
14538 }
14539 }
14540 pub fn secret(&self, uri: impl Into<String>) -> Secret {
14547 let mut query = self.selection.select("secret");
14548 query = query.arg("uri", uri.into());
14549 Secret {
14550 proc: self.proc.clone(),
14551 selection: query,
14552 graphql_client: self.graphql_client.clone(),
14553 }
14554 }
14555 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14562 let mut query = self.selection.select("secret");
14563 query = query.arg("uri", uri.into());
14564 if let Some(cache_key) = opts.cache_key {
14565 query = query.arg("cacheKey", cache_key);
14566 }
14567 Secret {
14568 proc: self.proc.clone(),
14569 selection: query,
14570 graphql_client: self.graphql_client.clone(),
14571 }
14572 }
14573 pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
14585 let mut query = self.selection.select("serveModule");
14586 query = query.arg("address", address.into());
14587 query.execute(self.graphql_client.clone()).await
14588 }
14589 pub async fn serve_module_opts<'a>(
14601 &self,
14602 address: impl Into<String>,
14603 opts: QueryServeModuleOpts<'a>,
14604 ) -> Result<Void, DaggerError> {
14605 let mut query = self.selection.select("serveModule");
14606 query = query.arg("address", address.into());
14607 if let Some(ref_pin) = opts.ref_pin {
14608 query = query.arg("refPin", ref_pin);
14609 }
14610 query.execute(self.graphql_client.clone()).await
14611 }
14612 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14620 let mut query = self.selection.select("setSecret");
14621 query = query.arg("name", name.into());
14622 query = query.arg("plaintext", plaintext.into());
14623 Secret {
14624 proc: self.proc.clone(),
14625 selection: query,
14626 graphql_client: self.graphql_client.clone(),
14627 }
14628 }
14629 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14637 let mut query = self.selection.select("sourceMap");
14638 query = query.arg("filename", filename.into());
14639 query = query.arg("line", line);
14640 query = query.arg("column", column);
14641 SourceMap {
14642 proc: self.proc.clone(),
14643 selection: query,
14644 graphql_client: self.graphql_client.clone(),
14645 }
14646 }
14647 pub fn sshfs_volume(
14655 &self,
14656 endpoint: impl Into<String>,
14657 private_key: impl IntoID<Id>,
14658 ) -> Volume {
14659 let mut query = self.selection.select("sshfsVolume");
14660 query = query.arg("endpoint", endpoint.into());
14661 query = query.arg_lazy(
14662 "privateKey",
14663 Box::new(move || {
14664 let private_key = private_key.clone();
14665 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14666 }),
14667 );
14668 Volume {
14669 proc: self.proc.clone(),
14670 selection: query,
14671 graphql_client: self.graphql_client.clone(),
14672 }
14673 }
14674 pub fn sshfs_volume_opts<'a>(
14682 &self,
14683 endpoint: impl Into<String>,
14684 private_key: impl IntoID<Id>,
14685 opts: QuerySshfsVolumeOpts<'a>,
14686 ) -> Volume {
14687 let mut query = self.selection.select("sshfsVolume");
14688 query = query.arg("endpoint", endpoint.into());
14689 query = query.arg_lazy(
14690 "privateKey",
14691 Box::new(move || {
14692 let private_key = private_key.clone();
14693 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14694 }),
14695 );
14696 if let Some(known_hosts) = opts.known_hosts {
14697 query = query.arg("knownHosts", known_hosts);
14698 }
14699 if let Some(cache_key) = opts.cache_key {
14700 query = query.arg("cacheKey", cache_key);
14701 }
14702 if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
14703 query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
14704 }
14705 if let Some(experimental_service_host) = opts.experimental_service_host {
14706 query = query.arg("experimentalServiceHost", experimental_service_host);
14707 }
14708 Volume {
14709 proc: self.proc.clone(),
14710 selection: query,
14711 graphql_client: self.graphql_client.clone(),
14712 }
14713 }
14714 pub fn type_def(&self) -> TypeDef {
14716 let query = self.selection.select("typeDef");
14717 TypeDef {
14718 proc: self.proc.clone(),
14719 selection: query,
14720 graphql_client: self.graphql_client.clone(),
14721 }
14722 }
14723 pub async fn version(&self) -> Result<String, DaggerError> {
14725 let query = self.selection.select("version");
14726 query.execute(self.graphql_client.clone()).await
14727 }
14728}
14729impl Node for Query {
14730 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14731 let query = self.selection.select("id");
14732 let graphql_client = self.graphql_client.clone();
14733 async move { query.execute(graphql_client).await }
14734 }
14735}
14736#[derive(Clone)]
14737pub struct RemoteGitMirror {
14738 pub proc: Option<Arc<DaggerSessionProc>>,
14739 pub selection: Selection,
14740 pub graphql_client: DynGraphQLClient,
14741}
14742impl IntoID<Id> for RemoteGitMirror {
14743 fn into_id(
14744 self,
14745 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14746 Box::pin(async move { self.id().await })
14747 }
14748}
14749impl Loadable for RemoteGitMirror {
14750 fn graphql_type() -> &'static str {
14751 "RemoteGitMirror"
14752 }
14753 fn from_query(
14754 proc: Option<Arc<DaggerSessionProc>>,
14755 selection: Selection,
14756 graphql_client: DynGraphQLClient,
14757 ) -> Self {
14758 Self {
14759 proc,
14760 selection,
14761 graphql_client,
14762 }
14763 }
14764}
14765impl RemoteGitMirror {
14766 pub async fn id(&self) -> Result<Id, DaggerError> {
14768 let query = self.selection.select("id");
14769 query.execute(self.graphql_client.clone()).await
14770 }
14771}
14772impl Node for RemoteGitMirror {
14773 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14774 let query = self.selection.select("id");
14775 let graphql_client = self.graphql_client.clone();
14776 async move { query.execute(graphql_client).await }
14777 }
14778}
14779#[derive(Clone)]
14780pub struct SdkConfig {
14781 pub proc: Option<Arc<DaggerSessionProc>>,
14782 pub selection: Selection,
14783 pub graphql_client: DynGraphQLClient,
14784}
14785impl IntoID<Id> for SdkConfig {
14786 fn into_id(
14787 self,
14788 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14789 Box::pin(async move { self.id().await })
14790 }
14791}
14792impl Loadable for SdkConfig {
14793 fn graphql_type() -> &'static str {
14794 "SDKConfig"
14795 }
14796 fn from_query(
14797 proc: Option<Arc<DaggerSessionProc>>,
14798 selection: Selection,
14799 graphql_client: DynGraphQLClient,
14800 ) -> Self {
14801 Self {
14802 proc,
14803 selection,
14804 graphql_client,
14805 }
14806 }
14807}
14808impl SdkConfig {
14809 pub async fn debug(&self) -> Result<bool, DaggerError> {
14811 let query = self.selection.select("debug");
14812 query.execute(self.graphql_client.clone()).await
14813 }
14814 pub async fn id(&self) -> Result<Id, DaggerError> {
14816 let query = self.selection.select("id");
14817 query.execute(self.graphql_client.clone()).await
14818 }
14819 pub async fn source(&self) -> Result<String, DaggerError> {
14821 let query = self.selection.select("source");
14822 query.execute(self.graphql_client.clone()).await
14823 }
14824}
14825impl Node for SdkConfig {
14826 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14827 let query = self.selection.select("id");
14828 let graphql_client = self.graphql_client.clone();
14829 async move { query.execute(graphql_client).await }
14830 }
14831}
14832#[derive(Clone)]
14833pub struct ScalarTypeDef {
14834 pub proc: Option<Arc<DaggerSessionProc>>,
14835 pub selection: Selection,
14836 pub graphql_client: DynGraphQLClient,
14837}
14838impl IntoID<Id> for ScalarTypeDef {
14839 fn into_id(
14840 self,
14841 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14842 Box::pin(async move { self.id().await })
14843 }
14844}
14845impl Loadable for ScalarTypeDef {
14846 fn graphql_type() -> &'static str {
14847 "ScalarTypeDef"
14848 }
14849 fn from_query(
14850 proc: Option<Arc<DaggerSessionProc>>,
14851 selection: Selection,
14852 graphql_client: DynGraphQLClient,
14853 ) -> Self {
14854 Self {
14855 proc,
14856 selection,
14857 graphql_client,
14858 }
14859 }
14860}
14861impl ScalarTypeDef {
14862 pub async fn description(&self) -> Result<String, DaggerError> {
14864 let query = self.selection.select("description");
14865 query.execute(self.graphql_client.clone()).await
14866 }
14867 pub async fn id(&self) -> Result<Id, DaggerError> {
14869 let query = self.selection.select("id");
14870 query.execute(self.graphql_client.clone()).await
14871 }
14872 pub async fn name(&self) -> Result<String, DaggerError> {
14874 let query = self.selection.select("name");
14875 query.execute(self.graphql_client.clone()).await
14876 }
14877 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14879 let query = self.selection.select("sourceModuleName");
14880 query.execute(self.graphql_client.clone()).await
14881 }
14882}
14883impl Node for ScalarTypeDef {
14884 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14885 let query = self.selection.select("id");
14886 let graphql_client = self.graphql_client.clone();
14887 async move { query.execute(graphql_client).await }
14888 }
14889}
14890#[derive(Clone)]
14891pub struct Schema {
14892 pub proc: Option<Arc<DaggerSessionProc>>,
14893 pub selection: Selection,
14894 pub graphql_client: DynGraphQLClient,
14895}
14896impl IntoID<Id> for Schema {
14897 fn into_id(
14898 self,
14899 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14900 Box::pin(async move { self.id().await })
14901 }
14902}
14903impl Loadable for Schema {
14904 fn graphql_type() -> &'static str {
14905 "Schema"
14906 }
14907 fn from_query(
14908 proc: Option<Arc<DaggerSessionProc>>,
14909 selection: Selection,
14910 graphql_client: DynGraphQLClient,
14911 ) -> Self {
14912 Self {
14913 proc,
14914 selection,
14915 graphql_client,
14916 }
14917 }
14918}
14919impl Schema {
14920 pub async fn contents(&self) -> Result<Json, DaggerError> {
14922 let query = self.selection.select("contents");
14923 query.execute(self.graphql_client.clone()).await
14924 }
14925 pub async fn id(&self) -> Result<Id, DaggerError> {
14927 let query = self.selection.select("id");
14928 query.execute(self.graphql_client.clone()).await
14929 }
14930 pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
14937 let mut query = self.selection.select("merge");
14938 query = query.arg("moduleTypes", module_types);
14939 query = query.arg("moduleName", module_name.into());
14940 Schema {
14941 proc: self.proc.clone(),
14942 selection: query,
14943 graphql_client: self.graphql_client.clone(),
14944 }
14945 }
14946}
14947impl Node for Schema {
14948 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14949 let query = self.selection.select("id");
14950 let graphql_client = self.graphql_client.clone();
14951 async move { query.execute(graphql_client).await }
14952 }
14953}
14954#[derive(Clone)]
14955pub struct SearchResult {
14956 pub proc: Option<Arc<DaggerSessionProc>>,
14957 pub selection: Selection,
14958 pub graphql_client: DynGraphQLClient,
14959}
14960impl IntoID<Id> for SearchResult {
14961 fn into_id(
14962 self,
14963 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14964 Box::pin(async move { self.id().await })
14965 }
14966}
14967impl Loadable for SearchResult {
14968 fn graphql_type() -> &'static str {
14969 "SearchResult"
14970 }
14971 fn from_query(
14972 proc: Option<Arc<DaggerSessionProc>>,
14973 selection: Selection,
14974 graphql_client: DynGraphQLClient,
14975 ) -> Self {
14976 Self {
14977 proc,
14978 selection,
14979 graphql_client,
14980 }
14981 }
14982}
14983impl SearchResult {
14984 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14986 let query = self.selection.select("absoluteOffset");
14987 query.execute(self.graphql_client.clone()).await
14988 }
14989 pub async fn file_path(&self) -> Result<String, DaggerError> {
14991 let query = self.selection.select("filePath");
14992 query.execute(self.graphql_client.clone()).await
14993 }
14994 pub async fn id(&self) -> Result<Id, DaggerError> {
14996 let query = self.selection.select("id");
14997 query.execute(self.graphql_client.clone()).await
14998 }
14999 pub async fn line_number(&self) -> Result<isize, DaggerError> {
15001 let query = self.selection.select("lineNumber");
15002 query.execute(self.graphql_client.clone()).await
15003 }
15004 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
15006 let query = self.selection.select("matchedLines");
15007 query.execute(self.graphql_client.clone()).await
15008 }
15009 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
15011 let query = self.selection.select("submatches");
15012 let query = query.select("id");
15013 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15014 Ok(ids
15015 .into_iter()
15016 .map(|id| SearchSubmatch {
15017 proc: self.proc.clone(),
15018 selection: crate::querybuilder::query()
15019 .select("node")
15020 .arg("id", &id.0)
15021 .inline_fragment("SearchSubmatch"),
15022 graphql_client: self.graphql_client.clone(),
15023 })
15024 .collect())
15025 }
15026}
15027impl Node for SearchResult {
15028 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15029 let query = self.selection.select("id");
15030 let graphql_client = self.graphql_client.clone();
15031 async move { query.execute(graphql_client).await }
15032 }
15033}
15034#[derive(Clone)]
15035pub struct SearchSubmatch {
15036 pub proc: Option<Arc<DaggerSessionProc>>,
15037 pub selection: Selection,
15038 pub graphql_client: DynGraphQLClient,
15039}
15040impl IntoID<Id> for SearchSubmatch {
15041 fn into_id(
15042 self,
15043 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15044 Box::pin(async move { self.id().await })
15045 }
15046}
15047impl Loadable for SearchSubmatch {
15048 fn graphql_type() -> &'static str {
15049 "SearchSubmatch"
15050 }
15051 fn from_query(
15052 proc: Option<Arc<DaggerSessionProc>>,
15053 selection: Selection,
15054 graphql_client: DynGraphQLClient,
15055 ) -> Self {
15056 Self {
15057 proc,
15058 selection,
15059 graphql_client,
15060 }
15061 }
15062}
15063impl SearchSubmatch {
15064 pub async fn end(&self) -> Result<isize, DaggerError> {
15066 let query = self.selection.select("end");
15067 query.execute(self.graphql_client.clone()).await
15068 }
15069 pub async fn id(&self) -> Result<Id, DaggerError> {
15071 let query = self.selection.select("id");
15072 query.execute(self.graphql_client.clone()).await
15073 }
15074 pub async fn start(&self) -> Result<isize, DaggerError> {
15076 let query = self.selection.select("start");
15077 query.execute(self.graphql_client.clone()).await
15078 }
15079 pub async fn text(&self) -> Result<String, DaggerError> {
15081 let query = self.selection.select("text");
15082 query.execute(self.graphql_client.clone()).await
15083 }
15084}
15085impl Node for SearchSubmatch {
15086 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15087 let query = self.selection.select("id");
15088 let graphql_client = self.graphql_client.clone();
15089 async move { query.execute(graphql_client).await }
15090 }
15091}
15092#[derive(Clone)]
15093pub struct Secret {
15094 pub proc: Option<Arc<DaggerSessionProc>>,
15095 pub selection: Selection,
15096 pub graphql_client: DynGraphQLClient,
15097}
15098impl IntoID<Id> for Secret {
15099 fn into_id(
15100 self,
15101 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15102 Box::pin(async move { self.id().await })
15103 }
15104}
15105impl Loadable for Secret {
15106 fn graphql_type() -> &'static str {
15107 "Secret"
15108 }
15109 fn from_query(
15110 proc: Option<Arc<DaggerSessionProc>>,
15111 selection: Selection,
15112 graphql_client: DynGraphQLClient,
15113 ) -> Self {
15114 Self {
15115 proc,
15116 selection,
15117 graphql_client,
15118 }
15119 }
15120}
15121impl Secret {
15122 pub async fn id(&self) -> Result<Id, DaggerError> {
15124 let query = self.selection.select("id");
15125 query.execute(self.graphql_client.clone()).await
15126 }
15127 pub async fn name(&self) -> Result<String, DaggerError> {
15129 let query = self.selection.select("name");
15130 query.execute(self.graphql_client.clone()).await
15131 }
15132 pub async fn plaintext(&self) -> Result<String, DaggerError> {
15134 let query = self.selection.select("plaintext");
15135 query.execute(self.graphql_client.clone()).await
15136 }
15137 pub async fn uri(&self) -> Result<String, DaggerError> {
15139 let query = self.selection.select("uri");
15140 query.execute(self.graphql_client.clone()).await
15141 }
15142}
15143impl Node for Secret {
15144 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15145 let query = self.selection.select("id");
15146 let graphql_client = self.graphql_client.clone();
15147 async move { query.execute(graphql_client).await }
15148 }
15149}
15150#[derive(Clone)]
15151pub struct Service {
15152 pub proc: Option<Arc<DaggerSessionProc>>,
15153 pub selection: Selection,
15154 pub graphql_client: DynGraphQLClient,
15155}
15156#[derive(Builder, Debug, PartialEq)]
15157pub struct ServiceEndpointOpts<'a> {
15158 #[builder(setter(into, strip_option), default)]
15160 pub port: Option<isize>,
15161 #[builder(setter(into, strip_option), default)]
15163 pub scheme: Option<&'a str>,
15164}
15165#[derive(Builder, Debug, PartialEq)]
15166pub struct ServiceStopOpts {
15167 #[builder(setter(into, strip_option), default)]
15169 pub kill: Option<bool>,
15170}
15171#[derive(Builder, Debug, PartialEq)]
15172pub struct ServiceTerminalOpts<'a> {
15173 #[builder(setter(into, strip_option), default)]
15174 pub cmd: Option<Vec<&'a str>>,
15175}
15176#[derive(Builder, Debug, PartialEq)]
15177pub struct ServiceUpOpts {
15178 #[builder(setter(into, strip_option), default)]
15181 pub ports: Option<Vec<PortForward>>,
15182 #[builder(setter(into, strip_option), default)]
15184 pub random: Option<bool>,
15185}
15186impl IntoID<Id> for Service {
15187 fn into_id(
15188 self,
15189 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15190 Box::pin(async move { self.id().await })
15191 }
15192}
15193impl Loadable for Service {
15194 fn graphql_type() -> &'static str {
15195 "Service"
15196 }
15197 fn from_query(
15198 proc: Option<Arc<DaggerSessionProc>>,
15199 selection: Selection,
15200 graphql_client: DynGraphQLClient,
15201 ) -> Self {
15202 Self {
15203 proc,
15204 selection,
15205 graphql_client,
15206 }
15207 }
15208}
15209impl Service {
15210 pub async fn endpoint(&self) -> Result<String, DaggerError> {
15218 let query = self.selection.select("endpoint");
15219 query.execute(self.graphql_client.clone()).await
15220 }
15221 pub async fn endpoint_opts<'a>(
15229 &self,
15230 opts: ServiceEndpointOpts<'a>,
15231 ) -> Result<String, DaggerError> {
15232 let mut query = self.selection.select("endpoint");
15233 if let Some(port) = opts.port {
15234 query = query.arg("port", port);
15235 }
15236 if let Some(scheme) = opts.scheme {
15237 query = query.arg("scheme", scheme);
15238 }
15239 query.execute(self.graphql_client.clone()).await
15240 }
15241 pub async fn hostname(&self) -> Result<String, DaggerError> {
15243 let query = self.selection.select("hostname");
15244 query.execute(self.graphql_client.clone()).await
15245 }
15246 pub async fn id(&self) -> Result<Id, DaggerError> {
15248 let query = self.selection.select("id");
15249 query.execute(self.graphql_client.clone()).await
15250 }
15251 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15253 let query = self.selection.select("ports");
15254 let query = query.select("id");
15255 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15256 Ok(ids
15257 .into_iter()
15258 .map(|id| Port {
15259 proc: self.proc.clone(),
15260 selection: crate::querybuilder::query()
15261 .select("node")
15262 .arg("id", &id.0)
15263 .inline_fragment("Port"),
15264 graphql_client: self.graphql_client.clone(),
15265 })
15266 .collect())
15267 }
15268 pub async fn start(&self) -> Result<Service, DaggerError> {
15271 let query = self.selection.select("start");
15272 let id: Id = query.execute(self.graphql_client.clone()).await?;
15273 Ok(Service {
15274 proc: self.proc.clone(),
15275 selection: query
15276 .root()
15277 .select("node")
15278 .arg("id", &id.0)
15279 .inline_fragment("Service"),
15280 graphql_client: self.graphql_client.clone(),
15281 })
15282 }
15283 pub async fn stop(&self) -> Result<Service, DaggerError> {
15289 let query = self.selection.select("stop");
15290 let id: Id = query.execute(self.graphql_client.clone()).await?;
15291 Ok(Service {
15292 proc: self.proc.clone(),
15293 selection: query
15294 .root()
15295 .select("node")
15296 .arg("id", &id.0)
15297 .inline_fragment("Service"),
15298 graphql_client: self.graphql_client.clone(),
15299 })
15300 }
15301 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15307 let mut query = self.selection.select("stop");
15308 if let Some(kill) = opts.kill {
15309 query = query.arg("kill", kill);
15310 }
15311 let id: Id = query.execute(self.graphql_client.clone()).await?;
15312 Ok(Service {
15313 proc: self.proc.clone(),
15314 selection: query
15315 .root()
15316 .select("node")
15317 .arg("id", &id.0)
15318 .inline_fragment("Service"),
15319 graphql_client: self.graphql_client.clone(),
15320 })
15321 }
15322 pub async fn sync(&self) -> Result<Service, DaggerError> {
15324 let query = self.selection.select("sync");
15325 let id: Id = query.execute(self.graphql_client.clone()).await?;
15326 Ok(Service {
15327 proc: self.proc.clone(),
15328 selection: query
15329 .root()
15330 .select("node")
15331 .arg("id", &id.0)
15332 .inline_fragment("Service"),
15333 graphql_client: self.graphql_client.clone(),
15334 })
15335 }
15336 pub fn terminal(&self) -> Service {
15341 let query = self.selection.select("terminal");
15342 Service {
15343 proc: self.proc.clone(),
15344 selection: query,
15345 graphql_client: self.graphql_client.clone(),
15346 }
15347 }
15348 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15353 let mut query = self.selection.select("terminal");
15354 if let Some(cmd) = opts.cmd {
15355 query = query.arg("cmd", cmd);
15356 }
15357 Service {
15358 proc: self.proc.clone(),
15359 selection: query,
15360 graphql_client: self.graphql_client.clone(),
15361 }
15362 }
15363 pub async fn up(&self) -> Result<Void, DaggerError> {
15369 let query = self.selection.select("up");
15370 query.execute(self.graphql_client.clone()).await
15371 }
15372 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15378 let mut query = self.selection.select("up");
15379 if let Some(ports) = opts.ports {
15380 query = query.arg("ports", ports);
15381 }
15382 if let Some(random) = opts.random {
15383 query = query.arg("random", random);
15384 }
15385 query.execute(self.graphql_client.clone()).await
15386 }
15387 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15393 let mut query = self.selection.select("withHostname");
15394 query = query.arg("hostname", hostname.into());
15395 Service {
15396 proc: self.proc.clone(),
15397 selection: query,
15398 graphql_client: self.graphql_client.clone(),
15399 }
15400 }
15401}
15402impl Node for Service {
15403 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15404 let query = self.selection.select("id");
15405 let graphql_client = self.graphql_client.clone();
15406 async move { query.execute(graphql_client).await }
15407 }
15408}
15409impl Syncer for Service {
15410 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15411 let query = self.selection.select("id");
15412 let graphql_client = self.graphql_client.clone();
15413 async move { query.execute(graphql_client).await }
15414 }
15415 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15416 let query = self.selection.select("sync");
15417 let proc = self.proc.clone();
15418 let graphql_client = self.graphql_client.clone();
15419 async move {
15420 let id: Id = query.execute(graphql_client.clone()).await?;
15421 Ok(Self {
15422 proc,
15423 selection: query
15424 .root()
15425 .select("node")
15426 .arg("id", &id.0)
15427 .inline_fragment("Service"),
15428 graphql_client,
15429 })
15430 }
15431 }
15432}
15433#[derive(Clone)]
15434pub struct Socket {
15435 pub proc: Option<Arc<DaggerSessionProc>>,
15436 pub selection: Selection,
15437 pub graphql_client: DynGraphQLClient,
15438}
15439impl IntoID<Id> for Socket {
15440 fn into_id(
15441 self,
15442 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15443 Box::pin(async move { self.id().await })
15444 }
15445}
15446impl Loadable for Socket {
15447 fn graphql_type() -> &'static str {
15448 "Socket"
15449 }
15450 fn from_query(
15451 proc: Option<Arc<DaggerSessionProc>>,
15452 selection: Selection,
15453 graphql_client: DynGraphQLClient,
15454 ) -> Self {
15455 Self {
15456 proc,
15457 selection,
15458 graphql_client,
15459 }
15460 }
15461}
15462impl Socket {
15463 pub async fn id(&self) -> Result<Id, DaggerError> {
15465 let query = self.selection.select("id");
15466 query.execute(self.graphql_client.clone()).await
15467 }
15468}
15469impl Node for Socket {
15470 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15471 let query = self.selection.select("id");
15472 let graphql_client = self.graphql_client.clone();
15473 async move { query.execute(graphql_client).await }
15474 }
15475}
15476#[derive(Clone)]
15477pub struct SourceMap {
15478 pub proc: Option<Arc<DaggerSessionProc>>,
15479 pub selection: Selection,
15480 pub graphql_client: DynGraphQLClient,
15481}
15482impl IntoID<Id> for SourceMap {
15483 fn into_id(
15484 self,
15485 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15486 Box::pin(async move { self.id().await })
15487 }
15488}
15489impl Loadable for SourceMap {
15490 fn graphql_type() -> &'static str {
15491 "SourceMap"
15492 }
15493 fn from_query(
15494 proc: Option<Arc<DaggerSessionProc>>,
15495 selection: Selection,
15496 graphql_client: DynGraphQLClient,
15497 ) -> Self {
15498 Self {
15499 proc,
15500 selection,
15501 graphql_client,
15502 }
15503 }
15504}
15505impl SourceMap {
15506 pub async fn column(&self) -> Result<isize, DaggerError> {
15508 let query = self.selection.select("column");
15509 query.execute(self.graphql_client.clone()).await
15510 }
15511 pub async fn filename(&self) -> Result<String, DaggerError> {
15513 let query = self.selection.select("filename");
15514 query.execute(self.graphql_client.clone()).await
15515 }
15516 pub async fn id(&self) -> Result<Id, DaggerError> {
15518 let query = self.selection.select("id");
15519 query.execute(self.graphql_client.clone()).await
15520 }
15521 pub async fn line(&self) -> Result<isize, DaggerError> {
15523 let query = self.selection.select("line");
15524 query.execute(self.graphql_client.clone()).await
15525 }
15526 pub async fn module(&self) -> Result<String, DaggerError> {
15528 let query = self.selection.select("module");
15529 query.execute(self.graphql_client.clone()).await
15530 }
15531 pub async fn url(&self) -> Result<String, DaggerError> {
15533 let query = self.selection.select("url");
15534 query.execute(self.graphql_client.clone()).await
15535 }
15536}
15537impl Node for SourceMap {
15538 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15539 let query = self.selection.select("id");
15540 let graphql_client = self.graphql_client.clone();
15541 async move { query.execute(graphql_client).await }
15542 }
15543}
15544#[derive(Clone)]
15545pub struct Stat {
15546 pub proc: Option<Arc<DaggerSessionProc>>,
15547 pub selection: Selection,
15548 pub graphql_client: DynGraphQLClient,
15549}
15550impl IntoID<Id> for Stat {
15551 fn into_id(
15552 self,
15553 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15554 Box::pin(async move { self.id().await })
15555 }
15556}
15557impl Loadable for Stat {
15558 fn graphql_type() -> &'static str {
15559 "Stat"
15560 }
15561 fn from_query(
15562 proc: Option<Arc<DaggerSessionProc>>,
15563 selection: Selection,
15564 graphql_client: DynGraphQLClient,
15565 ) -> Self {
15566 Self {
15567 proc,
15568 selection,
15569 graphql_client,
15570 }
15571 }
15572}
15573impl Stat {
15574 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15576 let query = self.selection.select("fileType");
15577 query.execute(self.graphql_client.clone()).await
15578 }
15579 pub async fn id(&self) -> Result<Id, DaggerError> {
15581 let query = self.selection.select("id");
15582 query.execute(self.graphql_client.clone()).await
15583 }
15584 pub async fn name(&self) -> Result<String, DaggerError> {
15586 let query = self.selection.select("name");
15587 query.execute(self.graphql_client.clone()).await
15588 }
15589 pub async fn permissions(&self) -> Result<isize, DaggerError> {
15591 let query = self.selection.select("permissions");
15592 query.execute(self.graphql_client.clone()).await
15593 }
15594 pub async fn size(&self) -> Result<isize, DaggerError> {
15596 let query = self.selection.select("size");
15597 query.execute(self.graphql_client.clone()).await
15598 }
15599}
15600impl Node for Stat {
15601 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15602 let query = self.selection.select("id");
15603 let graphql_client = self.graphql_client.clone();
15604 async move { query.execute(graphql_client).await }
15605 }
15606}
15607#[derive(Clone)]
15608pub struct Terminal {
15609 pub proc: Option<Arc<DaggerSessionProc>>,
15610 pub selection: Selection,
15611 pub graphql_client: DynGraphQLClient,
15612}
15613impl IntoID<Id> for Terminal {
15614 fn into_id(
15615 self,
15616 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15617 Box::pin(async move { self.id().await })
15618 }
15619}
15620impl Loadable for Terminal {
15621 fn graphql_type() -> &'static str {
15622 "Terminal"
15623 }
15624 fn from_query(
15625 proc: Option<Arc<DaggerSessionProc>>,
15626 selection: Selection,
15627 graphql_client: DynGraphQLClient,
15628 ) -> Self {
15629 Self {
15630 proc,
15631 selection,
15632 graphql_client,
15633 }
15634 }
15635}
15636impl Terminal {
15637 pub async fn id(&self) -> Result<Id, DaggerError> {
15639 let query = self.selection.select("id");
15640 query.execute(self.graphql_client.clone()).await
15641 }
15642 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15645 let query = self.selection.select("sync");
15646 let id: Id = query.execute(self.graphql_client.clone()).await?;
15647 Ok(Terminal {
15648 proc: self.proc.clone(),
15649 selection: query
15650 .root()
15651 .select("node")
15652 .arg("id", &id.0)
15653 .inline_fragment("Terminal"),
15654 graphql_client: self.graphql_client.clone(),
15655 })
15656 }
15657}
15658impl Node for Terminal {
15659 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15660 let query = self.selection.select("id");
15661 let graphql_client = self.graphql_client.clone();
15662 async move { query.execute(graphql_client).await }
15663 }
15664}
15665impl Syncer for Terminal {
15666 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15667 let query = self.selection.select("id");
15668 let graphql_client = self.graphql_client.clone();
15669 async move { query.execute(graphql_client).await }
15670 }
15671 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15672 let query = self.selection.select("sync");
15673 let proc = self.proc.clone();
15674 let graphql_client = self.graphql_client.clone();
15675 async move {
15676 let id: Id = query.execute(graphql_client.clone()).await?;
15677 Ok(Self {
15678 proc,
15679 selection: query
15680 .root()
15681 .select("node")
15682 .arg("id", &id.0)
15683 .inline_fragment("Terminal"),
15684 graphql_client,
15685 })
15686 }
15687 }
15688}
15689#[derive(Clone)]
15690pub struct TerminalGroup {
15691 pub proc: Option<Arc<DaggerSessionProc>>,
15692 pub selection: Selection,
15693 pub graphql_client: DynGraphQLClient,
15694}
15695impl IntoID<Id> for TerminalGroup {
15696 fn into_id(
15697 self,
15698 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15699 Box::pin(async move { self.id().await })
15700 }
15701}
15702impl Loadable for TerminalGroup {
15703 fn graphql_type() -> &'static str {
15704 "TerminalGroup"
15705 }
15706 fn from_query(
15707 proc: Option<Arc<DaggerSessionProc>>,
15708 selection: Selection,
15709 graphql_client: DynGraphQLClient,
15710 ) -> Self {
15711 Self {
15712 proc,
15713 selection,
15714 graphql_client,
15715 }
15716 }
15717}
15718impl TerminalGroup {
15719 pub async fn id(&self) -> Result<Id, DaggerError> {
15721 let query = self.selection.select("id");
15722 query.execute(self.graphql_client.clone()).await
15723 }
15724 pub async fn list(&self) -> Result<Vec<TerminalTarget>, DaggerError> {
15726 let query = self.selection.select("list");
15727 let query = query.select("id");
15728 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15729 Ok(ids
15730 .into_iter()
15731 .map(|id| TerminalTarget {
15732 proc: self.proc.clone(),
15733 selection: crate::querybuilder::query()
15734 .select("node")
15735 .arg("id", &id.0)
15736 .inline_fragment("TerminalTarget"),
15737 graphql_client: self.graphql_client.clone(),
15738 })
15739 .collect())
15740 }
15741 pub fn run(&self) -> TerminalGroup {
15743 let query = self.selection.select("run");
15744 TerminalGroup {
15745 proc: self.proc.clone(),
15746 selection: query,
15747 graphql_client: self.graphql_client.clone(),
15748 }
15749 }
15750}
15751impl Node for TerminalGroup {
15752 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15753 let query = self.selection.select("id");
15754 let graphql_client = self.graphql_client.clone();
15755 async move { query.execute(graphql_client).await }
15756 }
15757}
15758#[derive(Clone)]
15759pub struct TerminalTarget {
15760 pub proc: Option<Arc<DaggerSessionProc>>,
15761 pub selection: Selection,
15762 pub graphql_client: DynGraphQLClient,
15763}
15764impl IntoID<Id> for TerminalTarget {
15765 fn into_id(
15766 self,
15767 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15768 Box::pin(async move { self.id().await })
15769 }
15770}
15771impl Loadable for TerminalTarget {
15772 fn graphql_type() -> &'static str {
15773 "TerminalTarget"
15774 }
15775 fn from_query(
15776 proc: Option<Arc<DaggerSessionProc>>,
15777 selection: Selection,
15778 graphql_client: DynGraphQLClient,
15779 ) -> Self {
15780 Self {
15781 proc,
15782 selection,
15783 graphql_client,
15784 }
15785 }
15786}
15787impl TerminalTarget {
15788 pub async fn description(&self) -> Result<String, DaggerError> {
15790 let query = self.selection.select("description");
15791 query.execute(self.graphql_client.clone()).await
15792 }
15793 pub async fn id(&self) -> Result<Id, DaggerError> {
15795 let query = self.selection.select("id");
15796 query.execute(self.graphql_client.clone()).await
15797 }
15798 pub async fn name(&self) -> Result<String, DaggerError> {
15800 let query = self.selection.select("name");
15801 query.execute(self.graphql_client.clone()).await
15802 }
15803 pub fn original_module(&self) -> Module {
15805 let query = self.selection.select("originalModule");
15806 Module {
15807 proc: self.proc.clone(),
15808 selection: query,
15809 graphql_client: self.graphql_client.clone(),
15810 }
15811 }
15812 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
15814 let query = self.selection.select("path");
15815 query.execute(self.graphql_client.clone()).await
15816 }
15817}
15818impl Node for TerminalTarget {
15819 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15820 let query = self.selection.select("id");
15821 let graphql_client = self.graphql_client.clone();
15822 async move { query.execute(graphql_client).await }
15823 }
15824}
15825#[derive(Clone)]
15826pub struct TypeDef {
15827 pub proc: Option<Arc<DaggerSessionProc>>,
15828 pub selection: Selection,
15829 pub graphql_client: DynGraphQLClient,
15830}
15831#[derive(Builder, Debug, PartialEq)]
15832pub struct TypeDefWithEnumOpts<'a> {
15833 #[builder(setter(into, strip_option), default)]
15835 pub description: Option<&'a str>,
15836 #[builder(setter(into, strip_option), default)]
15838 pub source_map: Option<Id>,
15839}
15840#[derive(Builder, Debug, PartialEq)]
15841pub struct TypeDefWithEnumMemberOpts<'a> {
15842 #[builder(setter(into, strip_option), default)]
15844 pub deprecated: Option<&'a str>,
15845 #[builder(setter(into, strip_option), default)]
15847 pub description: Option<&'a str>,
15848 #[builder(setter(into, strip_option), default)]
15850 pub source_map: Option<Id>,
15851 #[builder(setter(into, strip_option), default)]
15853 pub value: Option<&'a str>,
15854}
15855#[derive(Builder, Debug, PartialEq)]
15856pub struct TypeDefWithEnumValueOpts<'a> {
15857 #[builder(setter(into, strip_option), default)]
15859 pub deprecated: Option<&'a str>,
15860 #[builder(setter(into, strip_option), default)]
15862 pub description: Option<&'a str>,
15863 #[builder(setter(into, strip_option), default)]
15865 pub source_map: Option<Id>,
15866}
15867#[derive(Builder, Debug, PartialEq)]
15868pub struct TypeDefWithFieldOpts<'a> {
15869 #[builder(setter(into, strip_option), default)]
15871 pub deprecated: Option<&'a str>,
15872 #[builder(setter(into, strip_option), default)]
15874 pub description: Option<&'a str>,
15875 #[builder(setter(into, strip_option), default)]
15877 pub source_map: Option<Id>,
15878}
15879#[derive(Builder, Debug, PartialEq)]
15880pub struct TypeDefWithInterfaceOpts<'a> {
15881 #[builder(setter(into, strip_option), default)]
15882 pub description: Option<&'a str>,
15883 #[builder(setter(into, strip_option), default)]
15884 pub source_map: Option<Id>,
15885}
15886#[derive(Builder, Debug, PartialEq)]
15887pub struct TypeDefWithObjectOpts<'a> {
15888 #[builder(setter(into, strip_option), default)]
15889 pub deprecated: Option<&'a str>,
15890 #[builder(setter(into, strip_option), default)]
15891 pub description: Option<&'a str>,
15892 #[builder(setter(into, strip_option), default)]
15893 pub source_map: Option<Id>,
15894}
15895#[derive(Builder, Debug, PartialEq)]
15896pub struct TypeDefWithScalarOpts<'a> {
15897 #[builder(setter(into, strip_option), default)]
15898 pub description: Option<&'a str>,
15899}
15900impl IntoID<Id> for TypeDef {
15901 fn into_id(
15902 self,
15903 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15904 Box::pin(async move { self.id().await })
15905 }
15906}
15907impl Loadable for TypeDef {
15908 fn graphql_type() -> &'static str {
15909 "TypeDef"
15910 }
15911 fn from_query(
15912 proc: Option<Arc<DaggerSessionProc>>,
15913 selection: Selection,
15914 graphql_client: DynGraphQLClient,
15915 ) -> Self {
15916 Self {
15917 proc,
15918 selection,
15919 graphql_client,
15920 }
15921 }
15922}
15923impl TypeDef {
15924 pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
15926 let query = self.selection.select("asEnum");
15927 let query = query.select("id");
15928 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15929 Ok(id.map(|id| EnumTypeDef {
15930 proc: self.proc.clone(),
15931 selection: query
15932 .root()
15933 .select("node")
15934 .arg("id", &id.0)
15935 .inline_fragment("EnumTypeDef"),
15936 graphql_client: self.graphql_client.clone(),
15937 }))
15938 }
15939 pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
15941 let query = self.selection.select("asInput");
15942 let query = query.select("id");
15943 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15944 Ok(id.map(|id| InputTypeDef {
15945 proc: self.proc.clone(),
15946 selection: query
15947 .root()
15948 .select("node")
15949 .arg("id", &id.0)
15950 .inline_fragment("InputTypeDef"),
15951 graphql_client: self.graphql_client.clone(),
15952 }))
15953 }
15954 pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
15956 let query = self.selection.select("asInterface");
15957 let query = query.select("id");
15958 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15959 Ok(id.map(|id| InterfaceTypeDef {
15960 proc: self.proc.clone(),
15961 selection: query
15962 .root()
15963 .select("node")
15964 .arg("id", &id.0)
15965 .inline_fragment("InterfaceTypeDef"),
15966 graphql_client: self.graphql_client.clone(),
15967 }))
15968 }
15969 pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
15971 let query = self.selection.select("asList");
15972 let query = query.select("id");
15973 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15974 Ok(id.map(|id| ListTypeDef {
15975 proc: self.proc.clone(),
15976 selection: query
15977 .root()
15978 .select("node")
15979 .arg("id", &id.0)
15980 .inline_fragment("ListTypeDef"),
15981 graphql_client: self.graphql_client.clone(),
15982 }))
15983 }
15984 pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
15986 let query = self.selection.select("asObject");
15987 let query = query.select("id");
15988 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15989 Ok(id.map(|id| ObjectTypeDef {
15990 proc: self.proc.clone(),
15991 selection: query
15992 .root()
15993 .select("node")
15994 .arg("id", &id.0)
15995 .inline_fragment("ObjectTypeDef"),
15996 graphql_client: self.graphql_client.clone(),
15997 }))
15998 }
15999 pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
16001 let query = self.selection.select("asScalar");
16002 let query = query.select("id");
16003 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
16004 Ok(id.map(|id| ScalarTypeDef {
16005 proc: self.proc.clone(),
16006 selection: query
16007 .root()
16008 .select("node")
16009 .arg("id", &id.0)
16010 .inline_fragment("ScalarTypeDef"),
16011 graphql_client: self.graphql_client.clone(),
16012 }))
16013 }
16014 pub async fn id(&self) -> Result<Id, DaggerError> {
16016 let query = self.selection.select("id");
16017 query.execute(self.graphql_client.clone()).await
16018 }
16019 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
16021 let query = self.selection.select("kind");
16022 query.execute(self.graphql_client.clone()).await
16023 }
16024 pub async fn name(&self) -> Result<String, DaggerError> {
16026 let query = self.selection.select("name");
16027 query.execute(self.graphql_client.clone()).await
16028 }
16029 pub async fn optional(&self) -> Result<bool, DaggerError> {
16031 let query = self.selection.select("optional");
16032 query.execute(self.graphql_client.clone()).await
16033 }
16034 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
16036 let mut query = self.selection.select("withConstructor");
16037 query = query.arg_lazy(
16038 "function",
16039 Box::new(move || {
16040 let function = function.clone();
16041 Box::pin(async move { function.into_id().await.unwrap().quote() })
16042 }),
16043 );
16044 TypeDef {
16045 proc: self.proc.clone(),
16046 selection: query,
16047 graphql_client: self.graphql_client.clone(),
16048 }
16049 }
16050 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
16058 let mut query = self.selection.select("withEnum");
16059 query = query.arg("name", name.into());
16060 TypeDef {
16061 proc: self.proc.clone(),
16062 selection: query,
16063 graphql_client: self.graphql_client.clone(),
16064 }
16065 }
16066 pub fn with_enum_opts<'a>(
16074 &self,
16075 name: impl Into<String>,
16076 opts: TypeDefWithEnumOpts<'a>,
16077 ) -> TypeDef {
16078 let mut query = self.selection.select("withEnum");
16079 query = query.arg("name", name.into());
16080 if let Some(description) = opts.description {
16081 query = query.arg("description", description);
16082 }
16083 if let Some(source_map) = opts.source_map {
16084 query = query.arg("sourceMap", source_map);
16085 }
16086 TypeDef {
16087 proc: self.proc.clone(),
16088 selection: query,
16089 graphql_client: self.graphql_client.clone(),
16090 }
16091 }
16092 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
16099 let mut query = self.selection.select("withEnumMember");
16100 query = query.arg("name", name.into());
16101 TypeDef {
16102 proc: self.proc.clone(),
16103 selection: query,
16104 graphql_client: self.graphql_client.clone(),
16105 }
16106 }
16107 pub fn with_enum_member_opts<'a>(
16114 &self,
16115 name: impl Into<String>,
16116 opts: TypeDefWithEnumMemberOpts<'a>,
16117 ) -> TypeDef {
16118 let mut query = self.selection.select("withEnumMember");
16119 query = query.arg("name", name.into());
16120 if let Some(value) = opts.value {
16121 query = query.arg("value", value);
16122 }
16123 if let Some(description) = opts.description {
16124 query = query.arg("description", description);
16125 }
16126 if let Some(source_map) = opts.source_map {
16127 query = query.arg("sourceMap", source_map);
16128 }
16129 if let Some(deprecated) = opts.deprecated {
16130 query = query.arg("deprecated", deprecated);
16131 }
16132 TypeDef {
16133 proc: self.proc.clone(),
16134 selection: query,
16135 graphql_client: self.graphql_client.clone(),
16136 }
16137 }
16138 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
16145 let mut query = self.selection.select("withEnumValue");
16146 query = query.arg("value", value.into());
16147 TypeDef {
16148 proc: self.proc.clone(),
16149 selection: query,
16150 graphql_client: self.graphql_client.clone(),
16151 }
16152 }
16153 pub fn with_enum_value_opts<'a>(
16160 &self,
16161 value: impl Into<String>,
16162 opts: TypeDefWithEnumValueOpts<'a>,
16163 ) -> TypeDef {
16164 let mut query = self.selection.select("withEnumValue");
16165 query = query.arg("value", value.into());
16166 if let Some(description) = opts.description {
16167 query = query.arg("description", description);
16168 }
16169 if let Some(source_map) = opts.source_map {
16170 query = query.arg("sourceMap", source_map);
16171 }
16172 if let Some(deprecated) = opts.deprecated {
16173 query = query.arg("deprecated", deprecated);
16174 }
16175 TypeDef {
16176 proc: self.proc.clone(),
16177 selection: query,
16178 graphql_client: self.graphql_client.clone(),
16179 }
16180 }
16181 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
16189 let mut query = self.selection.select("withField");
16190 query = query.arg("name", name.into());
16191 query = query.arg_lazy(
16192 "typeDef",
16193 Box::new(move || {
16194 let type_def = type_def.clone();
16195 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16196 }),
16197 );
16198 TypeDef {
16199 proc: self.proc.clone(),
16200 selection: query,
16201 graphql_client: self.graphql_client.clone(),
16202 }
16203 }
16204 pub fn with_field_opts<'a>(
16212 &self,
16213 name: impl Into<String>,
16214 type_def: impl IntoID<Id>,
16215 opts: TypeDefWithFieldOpts<'a>,
16216 ) -> TypeDef {
16217 let mut query = self.selection.select("withField");
16218 query = query.arg("name", name.into());
16219 query = query.arg_lazy(
16220 "typeDef",
16221 Box::new(move || {
16222 let type_def = type_def.clone();
16223 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16224 }),
16225 );
16226 if let Some(description) = opts.description {
16227 query = query.arg("description", description);
16228 }
16229 if let Some(source_map) = opts.source_map {
16230 query = query.arg("sourceMap", source_map);
16231 }
16232 if let Some(deprecated) = opts.deprecated {
16233 query = query.arg("deprecated", deprecated);
16234 }
16235 TypeDef {
16236 proc: self.proc.clone(),
16237 selection: query,
16238 graphql_client: self.graphql_client.clone(),
16239 }
16240 }
16241 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
16243 let mut query = self.selection.select("withFunction");
16244 query = query.arg_lazy(
16245 "function",
16246 Box::new(move || {
16247 let function = function.clone();
16248 Box::pin(async move { function.into_id().await.unwrap().quote() })
16249 }),
16250 );
16251 TypeDef {
16252 proc: self.proc.clone(),
16253 selection: query,
16254 graphql_client: self.graphql_client.clone(),
16255 }
16256 }
16257 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
16263 let mut query = self.selection.select("withInterface");
16264 query = query.arg("name", name.into());
16265 TypeDef {
16266 proc: self.proc.clone(),
16267 selection: query,
16268 graphql_client: self.graphql_client.clone(),
16269 }
16270 }
16271 pub fn with_interface_opts<'a>(
16277 &self,
16278 name: impl Into<String>,
16279 opts: TypeDefWithInterfaceOpts<'a>,
16280 ) -> TypeDef {
16281 let mut query = self.selection.select("withInterface");
16282 query = query.arg("name", name.into());
16283 if let Some(description) = opts.description {
16284 query = query.arg("description", description);
16285 }
16286 if let Some(source_map) = opts.source_map {
16287 query = query.arg("sourceMap", source_map);
16288 }
16289 TypeDef {
16290 proc: self.proc.clone(),
16291 selection: query,
16292 graphql_client: self.graphql_client.clone(),
16293 }
16294 }
16295 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
16297 let mut query = self.selection.select("withKind");
16298 query = query.arg("kind", kind);
16299 TypeDef {
16300 proc: self.proc.clone(),
16301 selection: query,
16302 graphql_client: self.graphql_client.clone(),
16303 }
16304 }
16305 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
16307 let mut query = self.selection.select("withListOf");
16308 query = query.arg_lazy(
16309 "elementType",
16310 Box::new(move || {
16311 let element_type = element_type.clone();
16312 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
16313 }),
16314 );
16315 TypeDef {
16316 proc: self.proc.clone(),
16317 selection: query,
16318 graphql_client: self.graphql_client.clone(),
16319 }
16320 }
16321 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
16328 let mut query = self.selection.select("withObject");
16329 query = query.arg("name", name.into());
16330 TypeDef {
16331 proc: self.proc.clone(),
16332 selection: query,
16333 graphql_client: self.graphql_client.clone(),
16334 }
16335 }
16336 pub fn with_object_opts<'a>(
16343 &self,
16344 name: impl Into<String>,
16345 opts: TypeDefWithObjectOpts<'a>,
16346 ) -> TypeDef {
16347 let mut query = self.selection.select("withObject");
16348 query = query.arg("name", name.into());
16349 if let Some(description) = opts.description {
16350 query = query.arg("description", description);
16351 }
16352 if let Some(source_map) = opts.source_map {
16353 query = query.arg("sourceMap", source_map);
16354 }
16355 if let Some(deprecated) = opts.deprecated {
16356 query = query.arg("deprecated", deprecated);
16357 }
16358 TypeDef {
16359 proc: self.proc.clone(),
16360 selection: query,
16361 graphql_client: self.graphql_client.clone(),
16362 }
16363 }
16364 pub fn with_optional(&self, optional: bool) -> TypeDef {
16366 let mut query = self.selection.select("withOptional");
16367 query = query.arg("optional", optional);
16368 TypeDef {
16369 proc: self.proc.clone(),
16370 selection: query,
16371 graphql_client: self.graphql_client.clone(),
16372 }
16373 }
16374 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16380 let mut query = self.selection.select("withScalar");
16381 query = query.arg("name", name.into());
16382 TypeDef {
16383 proc: self.proc.clone(),
16384 selection: query,
16385 graphql_client: self.graphql_client.clone(),
16386 }
16387 }
16388 pub fn with_scalar_opts<'a>(
16394 &self,
16395 name: impl Into<String>,
16396 opts: TypeDefWithScalarOpts<'a>,
16397 ) -> TypeDef {
16398 let mut query = self.selection.select("withScalar");
16399 query = query.arg("name", name.into());
16400 if let Some(description) = opts.description {
16401 query = query.arg("description", description);
16402 }
16403 TypeDef {
16404 proc: self.proc.clone(),
16405 selection: query,
16406 graphql_client: self.graphql_client.clone(),
16407 }
16408 }
16409}
16410impl Node for TypeDef {
16411 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16412 let query = self.selection.select("id");
16413 let graphql_client = self.graphql_client.clone();
16414 async move { query.execute(graphql_client).await }
16415 }
16416}
16417#[derive(Clone)]
16418pub struct Up {
16419 pub proc: Option<Arc<DaggerSessionProc>>,
16420 pub selection: Selection,
16421 pub graphql_client: DynGraphQLClient,
16422}
16423impl IntoID<Id> for Up {
16424 fn into_id(
16425 self,
16426 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16427 Box::pin(async move { self.id().await })
16428 }
16429}
16430impl Loadable for Up {
16431 fn graphql_type() -> &'static str {
16432 "Up"
16433 }
16434 fn from_query(
16435 proc: Option<Arc<DaggerSessionProc>>,
16436 selection: Selection,
16437 graphql_client: DynGraphQLClient,
16438 ) -> Self {
16439 Self {
16440 proc,
16441 selection,
16442 graphql_client,
16443 }
16444 }
16445}
16446impl Up {
16447 pub async fn description(&self) -> Result<String, DaggerError> {
16449 let query = self.selection.select("description");
16450 query.execute(self.graphql_client.clone()).await
16451 }
16452 pub async fn id(&self) -> Result<Id, DaggerError> {
16454 let query = self.selection.select("id");
16455 query.execute(self.graphql_client.clone()).await
16456 }
16457 pub async fn name(&self) -> Result<String, DaggerError> {
16459 let query = self.selection.select("name");
16460 query.execute(self.graphql_client.clone()).await
16461 }
16462 pub fn original_module(&self) -> Module {
16464 let query = self.selection.select("originalModule");
16465 Module {
16466 proc: self.proc.clone(),
16467 selection: query,
16468 graphql_client: self.graphql_client.clone(),
16469 }
16470 }
16471 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16473 let query = self.selection.select("path");
16474 query.execute(self.graphql_client.clone()).await
16475 }
16476 pub fn run(&self) -> Up {
16478 let query = self.selection.select("run");
16479 Up {
16480 proc: self.proc.clone(),
16481 selection: query,
16482 graphql_client: self.graphql_client.clone(),
16483 }
16484 }
16485}
16486impl Node for Up {
16487 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16488 let query = self.selection.select("id");
16489 let graphql_client = self.graphql_client.clone();
16490 async move { query.execute(graphql_client).await }
16491 }
16492}
16493#[derive(Clone)]
16494pub struct UpGroup {
16495 pub proc: Option<Arc<DaggerSessionProc>>,
16496 pub selection: Selection,
16497 pub graphql_client: DynGraphQLClient,
16498}
16499impl IntoID<Id> for UpGroup {
16500 fn into_id(
16501 self,
16502 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16503 Box::pin(async move { self.id().await })
16504 }
16505}
16506impl Loadable for UpGroup {
16507 fn graphql_type() -> &'static str {
16508 "UpGroup"
16509 }
16510 fn from_query(
16511 proc: Option<Arc<DaggerSessionProc>>,
16512 selection: Selection,
16513 graphql_client: DynGraphQLClient,
16514 ) -> Self {
16515 Self {
16516 proc,
16517 selection,
16518 graphql_client,
16519 }
16520 }
16521}
16522impl UpGroup {
16523 pub async fn id(&self) -> Result<Id, DaggerError> {
16525 let query = self.selection.select("id");
16526 query.execute(self.graphql_client.clone()).await
16527 }
16528 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16530 let query = self.selection.select("list");
16531 let query = query.select("id");
16532 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16533 Ok(ids
16534 .into_iter()
16535 .map(|id| Up {
16536 proc: self.proc.clone(),
16537 selection: crate::querybuilder::query()
16538 .select("node")
16539 .arg("id", &id.0)
16540 .inline_fragment("Up"),
16541 graphql_client: self.graphql_client.clone(),
16542 })
16543 .collect())
16544 }
16545 pub fn run(&self) -> UpGroup {
16547 let query = self.selection.select("run");
16548 UpGroup {
16549 proc: self.proc.clone(),
16550 selection: query,
16551 graphql_client: self.graphql_client.clone(),
16552 }
16553 }
16554}
16555impl Node for UpGroup {
16556 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16557 let query = self.selection.select("id");
16558 let graphql_client = self.graphql_client.clone();
16559 async move { query.execute(graphql_client).await }
16560 }
16561}
16562#[derive(Clone)]
16563pub struct Volume {
16564 pub proc: Option<Arc<DaggerSessionProc>>,
16565 pub selection: Selection,
16566 pub graphql_client: DynGraphQLClient,
16567}
16568impl IntoID<Id> for Volume {
16569 fn into_id(
16570 self,
16571 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16572 Box::pin(async move { self.id().await })
16573 }
16574}
16575impl Loadable for Volume {
16576 fn graphql_type() -> &'static str {
16577 "Volume"
16578 }
16579 fn from_query(
16580 proc: Option<Arc<DaggerSessionProc>>,
16581 selection: Selection,
16582 graphql_client: DynGraphQLClient,
16583 ) -> Self {
16584 Self {
16585 proc,
16586 selection,
16587 graphql_client,
16588 }
16589 }
16590}
16591impl Volume {
16592 pub async fn id(&self) -> Result<Id, DaggerError> {
16594 let query = self.selection.select("id");
16595 query.execute(self.graphql_client.clone()).await
16596 }
16597}
16598impl Node for Volume {
16599 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16600 let query = self.selection.select("id");
16601 let graphql_client = self.graphql_client.clone();
16602 async move { query.execute(graphql_client).await }
16603 }
16604}
16605#[derive(Clone)]
16606pub struct Workspace {
16607 pub proc: Option<Arc<DaggerSessionProc>>,
16608 pub selection: Selection,
16609 pub graphql_client: DynGraphQLClient,
16610}
16611#[derive(Builder, Debug, PartialEq)]
16612pub struct WorkspaceAgentsOpts<'a> {
16613 #[builder(setter(into, strip_option), default)]
16615 pub exclude: Option<Vec<&'a str>>,
16616 #[builder(setter(into, strip_option), default)]
16618 pub include: Option<Vec<&'a str>>,
16619}
16620#[derive(Builder, Debug, PartialEq)]
16621pub struct WorkspaceChangesOpts {
16622 #[builder(setter(into, strip_option), default)]
16624 pub from: Option<Id>,
16625}
16626#[derive(Builder, Debug, PartialEq)]
16627pub struct WorkspaceChecksOpts<'a> {
16628 #[builder(setter(into, strip_option), default)]
16630 pub include: Option<Vec<&'a str>>,
16631 #[builder(setter(into, strip_option), default)]
16633 pub no_generate: Option<bool>,
16634 #[builder(setter(into, strip_option), default)]
16636 pub only_generate: Option<bool>,
16637 #[builder(setter(into, strip_option), default)]
16639 pub skip: Option<Vec<&'a str>>,
16640}
16641#[derive(Builder, Debug, PartialEq)]
16642pub struct WorkspaceCompareCommitsFromOpts<'a> {
16643 #[builder(setter(into, strip_option), default)]
16645 pub commits: Option<Vec<&'a str>>,
16646 #[builder(setter(into, strip_option), default)]
16648 pub max_commits: Option<isize>,
16649}
16650#[derive(Builder, Debug, PartialEq)]
16651pub struct WorkspaceConfigReadOpts<'a> {
16652 #[builder(setter(into, strip_option), default)]
16654 pub key: Option<&'a str>,
16655}
16656#[derive(Builder, Debug, PartialEq)]
16657pub struct WorkspaceDirectoryOpts<'a> {
16658 #[builder(setter(into, strip_option), default)]
16660 pub exclude: Option<Vec<&'a str>>,
16661 #[builder(setter(into, strip_option), default)]
16663 pub gitignore: Option<bool>,
16664 #[builder(setter(into, strip_option), default)]
16666 pub include: Option<Vec<&'a str>>,
16667}
16668#[derive(Builder, Debug, PartialEq)]
16669pub struct WorkspaceExportOpts<'a> {
16670 #[builder(setter(into, strip_option), default)]
16672 pub from: Option<Id>,
16673 #[builder(setter(into, strip_option), default)]
16675 pub path: Option<&'a str>,
16676}
16677#[derive(Builder, Debug, PartialEq)]
16678pub struct WorkspaceFindRootsOpts<'a> {
16679 #[builder(setter(into, strip_option), default)]
16681 pub exclude: Option<Vec<&'a str>>,
16682 #[builder(setter(into, strip_option), default)]
16684 pub start: Option<&'a str>,
16685}
16686#[derive(Builder, Debug, PartialEq)]
16687pub struct WorkspaceFindUpOpts<'a> {
16688 #[builder(setter(into, strip_option), default)]
16690 pub from: Option<&'a str>,
16691}
16692#[derive(Builder, Debug, PartialEq)]
16693pub struct WorkspaceGeneratorsOpts<'a> {
16694 #[builder(setter(into, strip_option), default)]
16696 pub include: Option<Vec<&'a str>>,
16697}
16698#[derive(Builder, Debug, PartialEq)]
16699pub struct WorkspaceMigrateOpts<'a> {
16700 #[builder(setter(into, strip_option), default)]
16702 pub modules: Option<Vec<&'a str>>,
16703}
16704#[derive(Builder, Debug, PartialEq)]
16705pub struct WorkspaceMigrateModuleOpts<'a> {
16706 #[builder(setter(into, strip_option), default)]
16708 pub path: Option<&'a str>,
16709}
16710#[derive(Builder, Debug, PartialEq)]
16711pub struct WorkspaceSearchOpts<'a> {
16712 #[builder(setter(into, strip_option), default)]
16714 pub dotall: Option<bool>,
16715 #[builder(setter(into, strip_option), default)]
16717 pub files_only: Option<bool>,
16718 #[builder(setter(into, strip_option), default)]
16720 pub globs: Option<Vec<&'a str>>,
16721 #[builder(setter(into, strip_option), default)]
16723 pub insensitive: Option<bool>,
16724 #[builder(setter(into, strip_option), default)]
16726 pub limit: Option<isize>,
16727 #[builder(setter(into, strip_option), default)]
16729 pub literal: Option<bool>,
16730 #[builder(setter(into, strip_option), default)]
16732 pub multiline: Option<bool>,
16733 #[builder(setter(into, strip_option), default)]
16735 pub paths: Option<Vec<&'a str>>,
16736 #[builder(setter(into, strip_option), default)]
16738 pub skip_hidden: Option<bool>,
16739 #[builder(setter(into, strip_option), default)]
16741 pub skip_ignored: Option<bool>,
16742}
16743#[derive(Builder, Debug, PartialEq)]
16744pub struct WorkspaceServicesOpts<'a> {
16745 #[builder(setter(into, strip_option), default)]
16747 pub include: Option<Vec<&'a str>>,
16748}
16749#[derive(Builder, Debug, PartialEq)]
16750pub struct WorkspaceTerminalsOpts<'a> {
16751 #[builder(setter(into, strip_option), default)]
16753 pub include: Option<Vec<&'a str>>,
16754}
16755#[derive(Builder, Debug, PartialEq)]
16756pub struct WorkspaceWithClientOpts<'a> {
16757 #[builder(setter(into, strip_option), default)]
16759 pub sdk: Option<&'a str>,
16760 #[builder(setter(into, strip_option), default)]
16762 pub settings: Option<Json>,
16763}
16764#[derive(Builder, Debug, PartialEq)]
16765pub struct WorkspaceWithCommitOpts<'a> {
16766 #[builder(setter(into, strip_option), default)]
16768 pub author_email: Option<&'a str>,
16769 #[builder(setter(into, strip_option), default)]
16771 pub author_name: Option<&'a str>,
16772 #[builder(setter(into, strip_option), default)]
16774 pub signoff: Option<bool>,
16775}
16776#[derive(Builder, Debug, PartialEq)]
16777pub struct WorkspaceWithCommitsFromOpts<'a> {
16778 #[builder(setter(into, strip_option), default)]
16780 pub commits: Option<Vec<&'a str>>,
16781 #[builder(setter(into, strip_option), default)]
16783 pub max_commits: Option<isize>,
16784}
16785#[derive(Builder, Debug, PartialEq)]
16786pub struct WorkspaceWithConfigEnvOpts {
16787 #[builder(setter(into, strip_option), default)]
16789 pub here: Option<bool>,
16790}
16791#[derive(Builder, Debug, PartialEq)]
16792pub struct WorkspaceWithConfigValueOpts<'a> {
16793 #[builder(setter(into, strip_option), default)]
16795 pub here: Option<bool>,
16796 #[builder(setter(into, strip_option), default)]
16798 pub values: Option<Vec<&'a str>>,
16799}
16800#[derive(Builder, Debug, PartialEq)]
16801pub struct WorkspaceWithFileOpts {
16802 #[builder(setter(into, strip_option), default)]
16804 pub permissions: Option<isize>,
16805}
16806#[derive(Builder, Debug, PartialEq)]
16807pub struct WorkspaceWithInitModuleOpts<'a> {
16808 #[builder(setter(into, strip_option), default)]
16810 pub entrypoint: Option<bool>,
16811 #[builder(setter(into, strip_option), default)]
16813 pub install: Option<bool>,
16814 #[builder(setter(into, strip_option), default)]
16816 pub name: Option<&'a str>,
16817 #[builder(setter(into, strip_option), default)]
16819 pub path: Option<&'a str>,
16820 #[builder(setter(into, strip_option), default)]
16822 pub settings: Option<Json>,
16823}
16824#[derive(Builder, Debug, PartialEq)]
16825pub struct WorkspaceWithModuleOpts<'a> {
16826 #[builder(setter(into, strip_option), default)]
16828 pub here: Option<bool>,
16829 #[builder(setter(into, strip_option), default)]
16831 pub name: Option<&'a str>,
16832}
16833#[derive(Builder, Debug, PartialEq)]
16834pub struct WorkspaceWithNewFileOpts {
16835 #[builder(setter(into, strip_option), default)]
16837 pub permissions: Option<isize>,
16838}
16839#[derive(Builder, Debug, PartialEq)]
16840pub struct WorkspaceWithResetOpts {
16841 #[builder(setter(into, strip_option), default)]
16843 pub hard: Option<bool>,
16844}
16845#[derive(Builder, Debug, PartialEq)]
16846pub struct WorkspaceWithSdkOpts<'a> {
16847 #[builder(setter(into, strip_option), default)]
16849 pub as_sdk_name: Option<&'a str>,
16850 #[builder(setter(into, strip_option), default)]
16852 pub here: Option<bool>,
16853 #[builder(setter(into, strip_option), default)]
16855 pub name: Option<&'a str>,
16856}
16857#[derive(Builder, Debug, PartialEq)]
16858pub struct WorkspaceWithUpdatedClientsOpts<'a> {
16859 #[builder(setter(into, strip_option), default)]
16861 pub all: Option<bool>,
16862 #[builder(setter(into, strip_option), default)]
16864 pub modules: Option<Vec<&'a str>>,
16865 #[builder(setter(into, strip_option), default)]
16867 pub sdk: Option<&'a str>,
16868}
16869#[derive(Builder, Debug, PartialEq)]
16870pub struct WorkspaceWithUpdatedLockOpts {
16871 #[builder(setter(into, strip_option), default)]
16873 pub no_generate: Option<bool>,
16874}
16875#[derive(Builder, Debug, PartialEq)]
16876pub struct WorkspaceWithUpdatedModulesOpts<'a> {
16877 #[builder(setter(into, strip_option), default)]
16879 pub names: Option<Vec<&'a str>>,
16880 #[builder(setter(into, strip_option), default)]
16882 pub version: Option<&'a str>,
16883}
16884#[derive(Builder, Debug, PartialEq)]
16885pub struct WorkspaceWithoutClientOpts<'a> {
16886 #[builder(setter(into, strip_option), default)]
16888 pub sdk: Option<&'a str>,
16889}
16890#[derive(Builder, Debug, PartialEq)]
16891pub struct WorkspaceWithoutConfigEnvOpts {
16892 #[builder(setter(into, strip_option), default)]
16894 pub here: Option<bool>,
16895}
16896#[derive(Builder, Debug, PartialEq)]
16897pub struct WorkspaceWithoutConfigValueOpts {
16898 #[builder(setter(into, strip_option), default)]
16900 pub here: Option<bool>,
16901}
16902#[derive(Builder, Debug, PartialEq)]
16903pub struct WorkspaceWithoutModuleOpts {
16904 #[builder(setter(into, strip_option), default)]
16906 pub here: Option<bool>,
16907}
16908#[derive(Builder, Debug, PartialEq)]
16909pub struct WorkspaceWithoutSdkOpts {
16910 #[builder(setter(into, strip_option), default)]
16912 pub here: Option<bool>,
16913}
16914impl IntoID<Id> for Workspace {
16915 fn into_id(
16916 self,
16917 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16918 Box::pin(async move { self.id().await })
16919 }
16920}
16921impl Loadable for Workspace {
16922 fn graphql_type() -> &'static str {
16923 "Workspace"
16924 }
16925 fn from_query(
16926 proc: Option<Arc<DaggerSessionProc>>,
16927 selection: Selection,
16928 graphql_client: DynGraphQLClient,
16929 ) -> Self {
16930 Self {
16931 proc,
16932 selection,
16933 graphql_client,
16934 }
16935 }
16936}
16937impl Workspace {
16938 pub async fn address(&self) -> Result<String, DaggerError> {
16940 let query = self.selection.select("address");
16941 query.execute(self.graphql_client.clone()).await
16942 }
16943 pub fn agents(&self) -> AgentMiddlewareGroup {
16949 let query = self.selection.select("agents");
16950 AgentMiddlewareGroup {
16951 proc: self.proc.clone(),
16952 selection: query,
16953 graphql_client: self.graphql_client.clone(),
16954 }
16955 }
16956 pub fn agents_opts<'a>(&self, opts: WorkspaceAgentsOpts<'a>) -> AgentMiddlewareGroup {
16962 let mut query = self.selection.select("agents");
16963 if let Some(include) = opts.include {
16964 query = query.arg("include", include);
16965 }
16966 if let Some(exclude) = opts.exclude {
16967 query = query.arg("exclude", exclude);
16968 }
16969 AgentMiddlewareGroup {
16970 proc: self.proc.clone(),
16971 selection: query,
16972 graphql_client: self.graphql_client.clone(),
16973 }
16974 }
16975 pub fn changes(&self) -> Changeset {
16982 let query = self.selection.select("changes");
16983 Changeset {
16984 proc: self.proc.clone(),
16985 selection: query,
16986 graphql_client: self.graphql_client.clone(),
16987 }
16988 }
16989 pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
16996 let mut query = self.selection.select("changes");
16997 if let Some(from) = opts.from {
16998 query = query.arg("from", from);
16999 }
17000 Changeset {
17001 proc: self.proc.clone(),
17002 selection: query,
17003 graphql_client: self.graphql_client.clone(),
17004 }
17005 }
17006 pub fn checks(&self) -> CheckGroup {
17012 let query = self.selection.select("checks");
17013 CheckGroup {
17014 proc: self.proc.clone(),
17015 selection: query,
17016 graphql_client: self.graphql_client.clone(),
17017 }
17018 }
17019 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
17025 let mut query = self.selection.select("checks");
17026 if let Some(include) = opts.include {
17027 query = query.arg("include", include);
17028 }
17029 if let Some(skip) = opts.skip {
17030 query = query.arg("skip", skip);
17031 }
17032 if let Some(no_generate) = opts.no_generate {
17033 query = query.arg("noGenerate", no_generate);
17034 }
17035 if let Some(only_generate) = opts.only_generate {
17036 query = query.arg("onlyGenerate", only_generate);
17037 }
17038 CheckGroup {
17039 proc: self.proc.clone(),
17040 selection: query,
17041 graphql_client: self.graphql_client.clone(),
17042 }
17043 }
17044 pub async fn compare_commits_from(
17053 &self,
17054 source: impl IntoID<Id>,
17055 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
17056 let mut query = self.selection.select("compareCommitsFrom");
17057 query = query.arg_lazy(
17058 "source",
17059 Box::new(move || {
17060 let source = source.clone();
17061 Box::pin(async move { source.into_id().await.unwrap().quote() })
17062 }),
17063 );
17064 let query = query.select("id");
17065 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17066 Ok(ids
17067 .into_iter()
17068 .map(|id| WorkspaceCommitPick {
17069 proc: self.proc.clone(),
17070 selection: crate::querybuilder::query()
17071 .select("node")
17072 .arg("id", &id.0)
17073 .inline_fragment("WorkspaceCommitPick"),
17074 graphql_client: self.graphql_client.clone(),
17075 })
17076 .collect())
17077 }
17078 pub async fn compare_commits_from_opts<'a>(
17087 &self,
17088 source: impl IntoID<Id>,
17089 opts: WorkspaceCompareCommitsFromOpts<'a>,
17090 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
17091 let mut query = self.selection.select("compareCommitsFrom");
17092 query = query.arg_lazy(
17093 "source",
17094 Box::new(move || {
17095 let source = source.clone();
17096 Box::pin(async move { source.into_id().await.unwrap().quote() })
17097 }),
17098 );
17099 if let Some(commits) = opts.commits {
17100 query = query.arg("commits", commits);
17101 }
17102 if let Some(max_commits) = opts.max_commits {
17103 query = query.arg("maxCommits", max_commits);
17104 }
17105 let query = query.select("id");
17106 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17107 Ok(ids
17108 .into_iter()
17109 .map(|id| WorkspaceCommitPick {
17110 proc: self.proc.clone(),
17111 selection: crate::querybuilder::query()
17112 .select("node")
17113 .arg("id", &id.0)
17114 .inline_fragment("WorkspaceCommitPick"),
17115 graphql_client: self.graphql_client.clone(),
17116 })
17117 .collect())
17118 }
17119 pub async fn config_file(&self) -> Result<String, DaggerError> {
17121 let query = self.selection.select("configFile");
17122 query.execute(self.graphql_client.clone()).await
17123 }
17124 pub async fn config_read(&self) -> Result<String, DaggerError> {
17133 let query = self.selection.select("configRead");
17134 query.execute(self.graphql_client.clone()).await
17135 }
17136 pub async fn config_read_opts<'a>(
17145 &self,
17146 opts: WorkspaceConfigReadOpts<'a>,
17147 ) -> Result<String, DaggerError> {
17148 let mut query = self.selection.select("configRead");
17149 if let Some(key) = opts.key {
17150 query = query.arg("key", key);
17151 }
17152 query.execute(self.graphql_client.clone()).await
17153 }
17154 pub async fn cwd(&self) -> Result<String, DaggerError> {
17158 let query = self.selection.select("cwd");
17159 query.execute(self.graphql_client.clone()).await
17160 }
17161 pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
17167 let mut query = self.selection.select("detectScope");
17168 query = query.arg("sdk", sdk.into());
17169 query.execute(self.graphql_client.clone()).await
17170 }
17171 pub fn directory(&self, path: impl Into<String>) -> Directory {
17179 let mut query = self.selection.select("directory");
17180 query = query.arg("path", path.into());
17181 Directory {
17182 proc: self.proc.clone(),
17183 selection: query,
17184 graphql_client: self.graphql_client.clone(),
17185 }
17186 }
17187 pub fn directory_opts<'a>(
17195 &self,
17196 path: impl Into<String>,
17197 opts: WorkspaceDirectoryOpts<'a>,
17198 ) -> Directory {
17199 let mut query = self.selection.select("directory");
17200 query = query.arg("path", path.into());
17201 if let Some(exclude) = opts.exclude {
17202 query = query.arg("exclude", exclude);
17203 }
17204 if let Some(include) = opts.include {
17205 query = query.arg("include", include);
17206 }
17207 if let Some(gitignore) = opts.gitignore {
17208 query = query.arg("gitignore", gitignore);
17209 }
17210 Directory {
17211 proc: self.proc.clone(),
17212 selection: query,
17213 graphql_client: self.graphql_client.clone(),
17214 }
17215 }
17216 pub async fn entrypoint(&self) -> Result<String, DaggerError> {
17219 let query = self.selection.select("entrypoint");
17220 query.execute(self.graphql_client.clone()).await
17221 }
17222 pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
17224 let query = self.selection.select("envList");
17225 query.execute(self.graphql_client.clone()).await
17226 }
17227 pub async fn export(&self) -> Result<Void, DaggerError> {
17235 let query = self.selection.select("export");
17236 query.execute(self.graphql_client.clone()).await
17237 }
17238 pub async fn export_opts<'a>(
17246 &self,
17247 opts: WorkspaceExportOpts<'a>,
17248 ) -> Result<Void, DaggerError> {
17249 let mut query = self.selection.select("export");
17250 if let Some(path) = opts.path {
17251 query = query.arg("path", path);
17252 }
17253 if let Some(from) = opts.from {
17254 query = query.arg("from", from);
17255 }
17256 query.execute(self.graphql_client.clone()).await
17257 }
17258 pub fn file(&self, path: impl Into<String>) -> File {
17265 let mut query = self.selection.select("file");
17266 query = query.arg("path", path.into());
17267 File {
17268 proc: self.proc.clone(),
17269 selection: query,
17270 graphql_client: self.graphql_client.clone(),
17271 }
17272 }
17273 pub async fn find_roots(
17282 &self,
17283 markers: Vec<impl Into<String>>,
17284 ) -> Result<Vec<String>, DaggerError> {
17285 let mut query = self.selection.select("findRoots");
17286 query = query.arg(
17287 "markers",
17288 markers
17289 .into_iter()
17290 .map(|i| i.into())
17291 .collect::<Vec<String>>(),
17292 );
17293 query.execute(self.graphql_client.clone()).await
17294 }
17295 pub async fn find_roots_opts<'a>(
17304 &self,
17305 markers: Vec<impl Into<String>>,
17306 opts: WorkspaceFindRootsOpts<'a>,
17307 ) -> Result<Vec<String>, DaggerError> {
17308 let mut query = self.selection.select("findRoots");
17309 query = query.arg(
17310 "markers",
17311 markers
17312 .into_iter()
17313 .map(|i| i.into())
17314 .collect::<Vec<String>>(),
17315 );
17316 if let Some(start) = opts.start {
17317 query = query.arg("start", start);
17318 }
17319 if let Some(exclude) = opts.exclude {
17320 query = query.arg("exclude", exclude);
17321 }
17322 query.execute(self.graphql_client.clone()).await
17323 }
17324 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
17334 let mut query = self.selection.select("findUp");
17335 query = query.arg("name", name.into());
17336 query.execute(self.graphql_client.clone()).await
17337 }
17338 pub async fn find_up_opts<'a>(
17348 &self,
17349 name: impl Into<String>,
17350 opts: WorkspaceFindUpOpts<'a>,
17351 ) -> Result<String, DaggerError> {
17352 let mut query = self.selection.select("findUp");
17353 query = query.arg("name", name.into());
17354 if let Some(from) = opts.from {
17355 query = query.arg("from", from);
17356 }
17357 query.execute(self.graphql_client.clone()).await
17358 }
17359 pub fn generators(&self) -> GeneratorGroup {
17365 let query = self.selection.select("generators");
17366 GeneratorGroup {
17367 proc: self.proc.clone(),
17368 selection: query,
17369 graphql_client: self.graphql_client.clone(),
17370 }
17371 }
17372 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
17378 let mut query = self.selection.select("generators");
17379 if let Some(include) = opts.include {
17380 query = query.arg("include", include);
17381 }
17382 GeneratorGroup {
17383 proc: self.proc.clone(),
17384 selection: query,
17385 graphql_client: self.graphql_client.clone(),
17386 }
17387 }
17388 pub fn git(&self) -> WorkspaceGit {
17390 let query = self.selection.select("git");
17391 WorkspaceGit {
17392 proc: self.proc.clone(),
17393 selection: query,
17394 graphql_client: self.graphql_client.clone(),
17395 }
17396 }
17397 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
17404 let mut query = self.selection.select("glob");
17405 query = query.arg("pattern", pattern.into());
17406 query.execute(self.graphql_client.clone()).await
17407 }
17408 pub async fn id(&self) -> Result<Id, DaggerError> {
17410 let query = self.selection.select("id");
17411 query.execute(self.graphql_client.clone()).await
17412 }
17413 pub fn migrate(&self) -> WorkspaceMigration {
17421 let query = self.selection.select("migrate");
17422 WorkspaceMigration {
17423 proc: self.proc.clone(),
17424 selection: query,
17425 graphql_client: self.graphql_client.clone(),
17426 }
17427 }
17428 pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
17436 let mut query = self.selection.select("migrate");
17437 if let Some(modules) = opts.modules {
17438 query = query.arg("modules", modules);
17439 }
17440 WorkspaceMigration {
17441 proc: self.proc.clone(),
17442 selection: query,
17443 graphql_client: self.graphql_client.clone(),
17444 }
17445 }
17446 pub fn migrate_module(&self) -> WorkspaceMigration {
17453 let query = self.selection.select("migrateModule");
17454 WorkspaceMigration {
17455 proc: self.proc.clone(),
17456 selection: query,
17457 graphql_client: self.graphql_client.clone(),
17458 }
17459 }
17460 pub fn migrate_module_opts<'a>(
17467 &self,
17468 opts: WorkspaceMigrateModuleOpts<'a>,
17469 ) -> WorkspaceMigration {
17470 let mut query = self.selection.select("migrateModule");
17471 if let Some(path) = opts.path {
17472 query = query.arg("path", path);
17473 }
17474 WorkspaceMigration {
17475 proc: self.proc.clone(),
17476 selection: query,
17477 graphql_client: self.graphql_client.clone(),
17478 }
17479 }
17480 pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
17487 let mut query = self.selection.select("module");
17488 query = query.arg("name", name.into());
17489 WorkspaceModule {
17490 proc: self.proc.clone(),
17491 selection: query,
17492 graphql_client: self.graphql_client.clone(),
17493 }
17494 }
17495 pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
17503 let mut query = self.selection.select("moduleSource");
17504 query = query.arg("path", path.into());
17505 ModuleSource {
17506 proc: self.proc.clone(),
17507 selection: query,
17508 graphql_client: self.graphql_client.clone(),
17509 }
17510 }
17511 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
17514 let query = self.selection.select("modules");
17515 let query = query.select("id");
17516 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17517 Ok(ids
17518 .into_iter()
17519 .map(|id| WorkspaceModule {
17520 proc: self.proc.clone(),
17521 selection: crate::querybuilder::query()
17522 .select("node")
17523 .arg("id", &id.0)
17524 .inline_fragment("WorkspaceModule"),
17525 graphql_client: self.graphql_client.clone(),
17526 })
17527 .collect())
17528 }
17529 pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
17535 let mut query = self.selection.select("sdk");
17536 query = query.arg("name", name.into());
17537 WorkspaceSdk {
17538 proc: self.proc.clone(),
17539 selection: query,
17540 graphql_client: self.graphql_client.clone(),
17541 }
17542 }
17543 pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
17545 let query = self.selection.select("sdks");
17546 let query = query.select("id");
17547 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17548 Ok(ids
17549 .into_iter()
17550 .map(|id| WorkspaceSdk {
17551 proc: self.proc.clone(),
17552 selection: crate::querybuilder::query()
17553 .select("node")
17554 .arg("id", &id.0)
17555 .inline_fragment("WorkspaceSDK"),
17556 graphql_client: self.graphql_client.clone(),
17557 })
17558 .collect())
17559 }
17560 pub async fn search(
17569 &self,
17570 pattern: impl Into<String>,
17571 ) -> Result<Vec<SearchResult>, DaggerError> {
17572 let mut query = self.selection.select("search");
17573 query = query.arg("pattern", pattern.into());
17574 let query = query.select("id");
17575 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17576 Ok(ids
17577 .into_iter()
17578 .map(|id| SearchResult {
17579 proc: self.proc.clone(),
17580 selection: crate::querybuilder::query()
17581 .select("node")
17582 .arg("id", &id.0)
17583 .inline_fragment("SearchResult"),
17584 graphql_client: self.graphql_client.clone(),
17585 })
17586 .collect())
17587 }
17588 pub async fn search_opts<'a>(
17597 &self,
17598 pattern: impl Into<String>,
17599 opts: WorkspaceSearchOpts<'a>,
17600 ) -> Result<Vec<SearchResult>, DaggerError> {
17601 let mut query = self.selection.select("search");
17602 query = query.arg("pattern", pattern.into());
17603 if let Some(paths) = opts.paths {
17604 query = query.arg("paths", paths);
17605 }
17606 if let Some(globs) = opts.globs {
17607 query = query.arg("globs", globs);
17608 }
17609 if let Some(literal) = opts.literal {
17610 query = query.arg("literal", literal);
17611 }
17612 if let Some(multiline) = opts.multiline {
17613 query = query.arg("multiline", multiline);
17614 }
17615 if let Some(dotall) = opts.dotall {
17616 query = query.arg("dotall", dotall);
17617 }
17618 if let Some(insensitive) = opts.insensitive {
17619 query = query.arg("insensitive", insensitive);
17620 }
17621 if let Some(skip_ignored) = opts.skip_ignored {
17622 query = query.arg("skipIgnored", skip_ignored);
17623 }
17624 if let Some(skip_hidden) = opts.skip_hidden {
17625 query = query.arg("skipHidden", skip_hidden);
17626 }
17627 if let Some(files_only) = opts.files_only {
17628 query = query.arg("filesOnly", files_only);
17629 }
17630 if let Some(limit) = opts.limit {
17631 query = query.arg("limit", limit);
17632 }
17633 let query = query.select("id");
17634 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17635 Ok(ids
17636 .into_iter()
17637 .map(|id| SearchResult {
17638 proc: self.proc.clone(),
17639 selection: crate::querybuilder::query()
17640 .select("node")
17641 .arg("id", &id.0)
17642 .inline_fragment("SearchResult"),
17643 graphql_client: self.graphql_client.clone(),
17644 })
17645 .collect())
17646 }
17647 pub fn services(&self) -> UpGroup {
17653 let query = self.selection.select("services");
17654 UpGroup {
17655 proc: self.proc.clone(),
17656 selection: query,
17657 graphql_client: self.graphql_client.clone(),
17658 }
17659 }
17660 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
17666 let mut query = self.selection.select("services");
17667 if let Some(include) = opts.include {
17668 query = query.arg("include", include);
17669 }
17670 UpGroup {
17671 proc: self.proc.clone(),
17672 selection: query,
17673 graphql_client: self.graphql_client.clone(),
17674 }
17675 }
17676 pub fn snapshot(&self) -> Workspace {
17682 let query = self.selection.select("snapshot");
17683 Workspace {
17684 proc: self.proc.clone(),
17685 selection: query,
17686 graphql_client: self.graphql_client.clone(),
17687 }
17688 }
17689 pub fn terminals(&self) -> TerminalGroup {
17695 let query = self.selection.select("terminals");
17696 TerminalGroup {
17697 proc: self.proc.clone(),
17698 selection: query,
17699 graphql_client: self.graphql_client.clone(),
17700 }
17701 }
17702 pub fn terminals_opts<'a>(&self, opts: WorkspaceTerminalsOpts<'a>) -> TerminalGroup {
17708 let mut query = self.selection.select("terminals");
17709 if let Some(include) = opts.include {
17710 query = query.arg("include", include);
17711 }
17712 TerminalGroup {
17713 proc: self.proc.clone(),
17714 selection: query,
17715 graphql_client: self.graphql_client.clone(),
17716 }
17717 }
17718 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
17724 let mut query = self.selection.select("withChanges");
17725 query = query.arg_lazy(
17726 "changes",
17727 Box::new(move || {
17728 let changes = changes.clone();
17729 Box::pin(async move { changes.into_id().await.unwrap().quote() })
17730 }),
17731 );
17732 Workspace {
17733 proc: self.proc.clone(),
17734 selection: query,
17735 graphql_client: self.graphql_client.clone(),
17736 }
17737 }
17738 pub fn with_client(&self, module: impl Into<String>) -> Workspace {
17746 let mut query = self.selection.select("withClient");
17747 query = query.arg("module", module.into());
17748 Workspace {
17749 proc: self.proc.clone(),
17750 selection: query,
17751 graphql_client: self.graphql_client.clone(),
17752 }
17753 }
17754 pub fn with_client_opts<'a>(
17762 &self,
17763 module: impl Into<String>,
17764 opts: WorkspaceWithClientOpts<'a>,
17765 ) -> Workspace {
17766 let mut query = self.selection.select("withClient");
17767 query = query.arg("module", module.into());
17768 if let Some(sdk) = opts.sdk {
17769 query = query.arg("sdk", sdk);
17770 }
17771 if let Some(settings) = opts.settings {
17772 query = query.arg("settings", settings);
17773 }
17774 Workspace {
17775 proc: self.proc.clone(),
17776 selection: query,
17777 graphql_client: self.graphql_client.clone(),
17778 }
17779 }
17780 pub fn with_commit(
17792 &self,
17793 changes: impl IntoID<Id>,
17794 message: impl Into<String>,
17795 date: impl Into<String>,
17796 ) -> Workspace {
17797 let mut query = self.selection.select("withCommit");
17798 query = query.arg_lazy(
17799 "changes",
17800 Box::new(move || {
17801 let changes = changes.clone();
17802 Box::pin(async move { changes.into_id().await.unwrap().quote() })
17803 }),
17804 );
17805 query = query.arg("message", message.into());
17806 query = query.arg("date", date.into());
17807 Workspace {
17808 proc: self.proc.clone(),
17809 selection: query,
17810 graphql_client: self.graphql_client.clone(),
17811 }
17812 }
17813 pub fn with_commit_opts<'a>(
17825 &self,
17826 changes: impl IntoID<Id>,
17827 message: impl Into<String>,
17828 date: impl Into<String>,
17829 opts: WorkspaceWithCommitOpts<'a>,
17830 ) -> Workspace {
17831 let mut query = self.selection.select("withCommit");
17832 query = query.arg_lazy(
17833 "changes",
17834 Box::new(move || {
17835 let changes = changes.clone();
17836 Box::pin(async move { changes.into_id().await.unwrap().quote() })
17837 }),
17838 );
17839 query = query.arg("message", message.into());
17840 query = query.arg("date", date.into());
17841 if let Some(author_name) = opts.author_name {
17842 query = query.arg("authorName", author_name);
17843 }
17844 if let Some(author_email) = opts.author_email {
17845 query = query.arg("authorEmail", author_email);
17846 }
17847 if let Some(signoff) = opts.signoff {
17848 query = query.arg("signoff", signoff);
17849 }
17850 Workspace {
17851 proc: self.proc.clone(),
17852 selection: query,
17853 graphql_client: self.graphql_client.clone(),
17854 }
17855 }
17856 pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
17866 let mut query = self.selection.select("withCommitsFrom");
17867 query = query.arg_lazy(
17868 "source",
17869 Box::new(move || {
17870 let source = source.clone();
17871 Box::pin(async move { source.into_id().await.unwrap().quote() })
17872 }),
17873 );
17874 Workspace {
17875 proc: self.proc.clone(),
17876 selection: query,
17877 graphql_client: self.graphql_client.clone(),
17878 }
17879 }
17880 pub fn with_commits_from_opts<'a>(
17890 &self,
17891 source: impl IntoID<Id>,
17892 opts: WorkspaceWithCommitsFromOpts<'a>,
17893 ) -> Workspace {
17894 let mut query = self.selection.select("withCommitsFrom");
17895 query = query.arg_lazy(
17896 "source",
17897 Box::new(move || {
17898 let source = source.clone();
17899 Box::pin(async move { source.into_id().await.unwrap().quote() })
17900 }),
17901 );
17902 if let Some(commits) = opts.commits {
17903 query = query.arg("commits", commits);
17904 }
17905 if let Some(max_commits) = opts.max_commits {
17906 query = query.arg("maxCommits", max_commits);
17907 }
17908 Workspace {
17909 proc: self.proc.clone(),
17910 selection: query,
17911 graphql_client: self.graphql_client.clone(),
17912 }
17913 }
17914 pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
17921 let mut query = self.selection.select("withConfigEnv");
17922 query = query.arg("name", name.into());
17923 Workspace {
17924 proc: self.proc.clone(),
17925 selection: query,
17926 graphql_client: self.graphql_client.clone(),
17927 }
17928 }
17929 pub fn with_config_env_opts(
17936 &self,
17937 name: impl Into<String>,
17938 opts: WorkspaceWithConfigEnvOpts,
17939 ) -> Workspace {
17940 let mut query = self.selection.select("withConfigEnv");
17941 query = query.arg("name", name.into());
17942 if let Some(here) = opts.here {
17943 query = query.arg("here", here);
17944 }
17945 Workspace {
17946 proc: self.proc.clone(),
17947 selection: query,
17948 graphql_client: self.graphql_client.clone(),
17949 }
17950 }
17951 pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
17957 let mut query = self.selection.select("withConfigEnvironment");
17958 query = query.arg("name", name.into());
17959 Workspace {
17960 proc: self.proc.clone(),
17961 selection: query,
17962 graphql_client: self.graphql_client.clone(),
17963 }
17964 }
17965 pub fn with_config_paths(
17972 &self,
17973 config_file: impl Into<String>,
17974 lock_file: impl Into<String>,
17975 ) -> Workspace {
17976 let mut query = self.selection.select("withConfigPaths");
17977 query = query.arg("configFile", config_file.into());
17978 query = query.arg("lockFile", lock_file.into());
17979 Workspace {
17980 proc: self.proc.clone(),
17981 selection: query,
17982 graphql_client: self.graphql_client.clone(),
17983 }
17984 }
17985 pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
17994 let mut query = self.selection.select("withConfigValue");
17995 query = query.arg("key", key.into());
17996 query = query.arg("value", value.into());
17997 Workspace {
17998 proc: self.proc.clone(),
17999 selection: query,
18000 graphql_client: self.graphql_client.clone(),
18001 }
18002 }
18003 pub fn with_config_value_opts<'a>(
18012 &self,
18013 key: impl Into<String>,
18014 value: impl Into<String>,
18015 opts: WorkspaceWithConfigValueOpts<'a>,
18016 ) -> Workspace {
18017 let mut query = self.selection.select("withConfigValue");
18018 query = query.arg("key", key.into());
18019 query = query.arg("value", value.into());
18020 if let Some(values) = opts.values {
18021 query = query.arg("values", values);
18022 }
18023 if let Some(here) = opts.here {
18024 query = query.arg("here", here);
18025 }
18026 Workspace {
18027 proc: self.proc.clone(),
18028 selection: query,
18029 graphql_client: self.graphql_client.clone(),
18030 }
18031 }
18032 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
18040 let mut query = self.selection.select("withDirectory");
18041 query = query.arg("path", path.into());
18042 query = query.arg_lazy(
18043 "source",
18044 Box::new(move || {
18045 let source = source.clone();
18046 Box::pin(async move { source.into_id().await.unwrap().quote() })
18047 }),
18048 );
18049 Workspace {
18050 proc: self.proc.clone(),
18051 selection: query,
18052 graphql_client: self.graphql_client.clone(),
18053 }
18054 }
18055 pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
18062 let mut query = self.selection.select("withEntrypoint");
18063 query = query.arg("name", name.into());
18064 Workspace {
18065 proc: self.proc.clone(),
18066 selection: query,
18067 graphql_client: self.graphql_client.clone(),
18068 }
18069 }
18070 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
18078 let mut query = self.selection.select("withFile");
18079 query = query.arg("path", path.into());
18080 query = query.arg_lazy(
18081 "source",
18082 Box::new(move || {
18083 let source = source.clone();
18084 Box::pin(async move { source.into_id().await.unwrap().quote() })
18085 }),
18086 );
18087 Workspace {
18088 proc: self.proc.clone(),
18089 selection: query,
18090 graphql_client: self.graphql_client.clone(),
18091 }
18092 }
18093 pub fn with_file_opts(
18101 &self,
18102 path: impl Into<String>,
18103 source: impl IntoID<Id>,
18104 opts: WorkspaceWithFileOpts,
18105 ) -> Workspace {
18106 let mut query = self.selection.select("withFile");
18107 query = query.arg("path", path.into());
18108 query = query.arg_lazy(
18109 "source",
18110 Box::new(move || {
18111 let source = source.clone();
18112 Box::pin(async move { source.into_id().await.unwrap().quote() })
18113 }),
18114 );
18115 if let Some(permissions) = opts.permissions {
18116 query = query.arg("permissions", permissions);
18117 }
18118 Workspace {
18119 proc: self.proc.clone(),
18120 selection: query,
18121 graphql_client: self.graphql_client.clone(),
18122 }
18123 }
18124 pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
18132 let mut query = self.selection.select("withInitModule");
18133 query = query.arg("sdk", sdk.into());
18134 Workspace {
18135 proc: self.proc.clone(),
18136 selection: query,
18137 graphql_client: self.graphql_client.clone(),
18138 }
18139 }
18140 pub fn with_init_module_opts<'a>(
18148 &self,
18149 sdk: impl Into<String>,
18150 opts: WorkspaceWithInitModuleOpts<'a>,
18151 ) -> Workspace {
18152 let mut query = self.selection.select("withInitModule");
18153 query = query.arg("sdk", sdk.into());
18154 if let Some(name) = opts.name {
18155 query = query.arg("name", name);
18156 }
18157 if let Some(path) = opts.path {
18158 query = query.arg("path", path);
18159 }
18160 if let Some(install) = opts.install {
18161 query = query.arg("install", install);
18162 }
18163 if let Some(entrypoint) = opts.entrypoint {
18164 query = query.arg("entrypoint", entrypoint);
18165 }
18166 if let Some(settings) = opts.settings {
18167 query = query.arg("settings", settings);
18168 }
18169 Workspace {
18170 proc: self.proc.clone(),
18171 selection: query,
18172 graphql_client: self.graphql_client.clone(),
18173 }
18174 }
18175 pub fn with_initialized(&self) -> Workspace {
18178 let query = self.selection.select("withInitialized");
18179 Workspace {
18180 proc: self.proc.clone(),
18181 selection: query,
18182 graphql_client: self.graphql_client.clone(),
18183 }
18184 }
18185 pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
18193 let mut query = self.selection.select("withModule");
18194 query = query.arg("ref", r#ref.into());
18195 Workspace {
18196 proc: self.proc.clone(),
18197 selection: query,
18198 graphql_client: self.graphql_client.clone(),
18199 }
18200 }
18201 pub fn with_module_opts<'a>(
18209 &self,
18210 r#ref: impl Into<String>,
18211 opts: WorkspaceWithModuleOpts<'a>,
18212 ) -> Workspace {
18213 let mut query = self.selection.select("withModule");
18214 query = query.arg("ref", r#ref.into());
18215 if let Some(name) = opts.name {
18216 query = query.arg("name", name);
18217 }
18218 if let Some(here) = opts.here {
18219 query = query.arg("here", here);
18220 }
18221 Workspace {
18222 proc: self.proc.clone(),
18223 selection: query,
18224 graphql_client: self.graphql_client.clone(),
18225 }
18226 }
18227 pub fn with_mounted_directory(
18235 &self,
18236 path: impl Into<String>,
18237 source: impl IntoID<Id>,
18238 ) -> Workspace {
18239 let mut query = self.selection.select("withMountedDirectory");
18240 query = query.arg("path", path.into());
18241 query = query.arg_lazy(
18242 "source",
18243 Box::new(move || {
18244 let source = source.clone();
18245 Box::pin(async move { source.into_id().await.unwrap().quote() })
18246 }),
18247 );
18248 Workspace {
18249 proc: self.proc.clone(),
18250 selection: query,
18251 graphql_client: self.graphql_client.clone(),
18252 }
18253 }
18254 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
18262 let mut query = self.selection.select("withMountedFile");
18263 query = query.arg("path", path.into());
18264 query = query.arg_lazy(
18265 "source",
18266 Box::new(move || {
18267 let source = source.clone();
18268 Box::pin(async move { source.into_id().await.unwrap().quote() })
18269 }),
18270 );
18271 Workspace {
18272 proc: self.proc.clone(),
18273 selection: query,
18274 graphql_client: self.graphql_client.clone(),
18275 }
18276 }
18277 pub fn with_new_directory(
18285 &self,
18286 path: impl Into<String>,
18287 source: impl IntoID<Id>,
18288 ) -> Workspace {
18289 let mut query = self.selection.select("withNewDirectory");
18290 query = query.arg("path", path.into());
18291 query = query.arg_lazy(
18292 "source",
18293 Box::new(move || {
18294 let source = source.clone();
18295 Box::pin(async move { source.into_id().await.unwrap().quote() })
18296 }),
18297 );
18298 Workspace {
18299 proc: self.proc.clone(),
18300 selection: query,
18301 graphql_client: self.graphql_client.clone(),
18302 }
18303 }
18304 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
18312 let mut query = self.selection.select("withNewFile");
18313 query = query.arg("path", path.into());
18314 query = query.arg("contents", contents.into());
18315 Workspace {
18316 proc: self.proc.clone(),
18317 selection: query,
18318 graphql_client: self.graphql_client.clone(),
18319 }
18320 }
18321 pub fn with_new_file_opts(
18329 &self,
18330 path: impl Into<String>,
18331 contents: impl Into<String>,
18332 opts: WorkspaceWithNewFileOpts,
18333 ) -> Workspace {
18334 let mut query = self.selection.select("withNewFile");
18335 query = query.arg("path", path.into());
18336 query = query.arg("contents", contents.into());
18337 if let Some(permissions) = opts.permissions {
18338 query = query.arg("permissions", permissions);
18339 }
18340 Workspace {
18341 proc: self.proc.clone(),
18342 selection: query,
18343 graphql_client: self.graphql_client.clone(),
18344 }
18345 }
18346 pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
18356 let mut query = self.selection.select("withReset");
18357 query = query.arg("commit", commit.into());
18358 Workspace {
18359 proc: self.proc.clone(),
18360 selection: query,
18361 graphql_client: self.graphql_client.clone(),
18362 }
18363 }
18364 pub fn with_reset_opts(
18374 &self,
18375 commit: impl Into<String>,
18376 opts: WorkspaceWithResetOpts,
18377 ) -> Workspace {
18378 let mut query = self.selection.select("withReset");
18379 query = query.arg("commit", commit.into());
18380 if let Some(hard) = opts.hard {
18381 query = query.arg("hard", hard);
18382 }
18383 Workspace {
18384 proc: self.proc.clone(),
18385 selection: query,
18386 graphql_client: self.graphql_client.clone(),
18387 }
18388 }
18389 pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
18396 let mut query = self.selection.select("withSDK");
18397 query = query.arg("ref", r#ref.into());
18398 Workspace {
18399 proc: self.proc.clone(),
18400 selection: query,
18401 graphql_client: self.graphql_client.clone(),
18402 }
18403 }
18404 pub fn with_sdk_opts<'a>(
18411 &self,
18412 r#ref: impl Into<String>,
18413 opts: WorkspaceWithSdkOpts<'a>,
18414 ) -> Workspace {
18415 let mut query = self.selection.select("withSDK");
18416 query = query.arg("ref", r#ref.into());
18417 if let Some(name) = opts.name {
18418 query = query.arg("name", name);
18419 }
18420 if let Some(here) = opts.here {
18421 query = query.arg("here", here);
18422 }
18423 if let Some(as_sdk_name) = opts.as_sdk_name {
18424 query = query.arg("asSdkName", as_sdk_name);
18425 }
18426 Workspace {
18427 proc: self.proc.clone(),
18428 selection: query,
18429 graphql_client: self.graphql_client.clone(),
18430 }
18431 }
18432 pub fn with_updated_clients(&self) -> Workspace {
18440 let query = self.selection.select("withUpdatedClients");
18441 Workspace {
18442 proc: self.proc.clone(),
18443 selection: query,
18444 graphql_client: self.graphql_client.clone(),
18445 }
18446 }
18447 pub fn with_updated_clients_opts<'a>(
18455 &self,
18456 opts: WorkspaceWithUpdatedClientsOpts<'a>,
18457 ) -> Workspace {
18458 let mut query = self.selection.select("withUpdatedClients");
18459 if let Some(modules) = opts.modules {
18460 query = query.arg("modules", modules);
18461 }
18462 if let Some(all) = opts.all {
18463 query = query.arg("all", all);
18464 }
18465 if let Some(sdk) = opts.sdk {
18466 query = query.arg("sdk", sdk);
18467 }
18468 Workspace {
18469 proc: self.proc.clone(),
18470 selection: query,
18471 graphql_client: self.graphql_client.clone(),
18472 }
18473 }
18474 pub fn with_updated_lock(&self) -> Workspace {
18481 let query = self.selection.select("withUpdatedLock");
18482 Workspace {
18483 proc: self.proc.clone(),
18484 selection: query,
18485 graphql_client: self.graphql_client.clone(),
18486 }
18487 }
18488 pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
18495 let mut query = self.selection.select("withUpdatedLock");
18496 if let Some(no_generate) = opts.no_generate {
18497 query = query.arg("noGenerate", no_generate);
18498 }
18499 Workspace {
18500 proc: self.proc.clone(),
18501 selection: query,
18502 graphql_client: self.graphql_client.clone(),
18503 }
18504 }
18505 pub fn with_updated_modules(&self) -> Workspace {
18512 let query = self.selection.select("withUpdatedModules");
18513 Workspace {
18514 proc: self.proc.clone(),
18515 selection: query,
18516 graphql_client: self.graphql_client.clone(),
18517 }
18518 }
18519 pub fn with_updated_modules_opts<'a>(
18526 &self,
18527 opts: WorkspaceWithUpdatedModulesOpts<'a>,
18528 ) -> Workspace {
18529 let mut query = self.selection.select("withUpdatedModules");
18530 if let Some(names) = opts.names {
18531 query = query.arg("names", names);
18532 }
18533 if let Some(version) = opts.version {
18534 query = query.arg("version", version);
18535 }
18536 Workspace {
18537 proc: self.proc.clone(),
18538 selection: query,
18539 graphql_client: self.graphql_client.clone(),
18540 }
18541 }
18542 pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
18548 let mut query = self.selection.select("withWorkdir");
18549 query = query.arg("path", path.into());
18550 Workspace {
18551 proc: self.proc.clone(),
18552 selection: query,
18553 graphql_client: self.graphql_client.clone(),
18554 }
18555 }
18556 pub fn without_client(&self, module: impl Into<String>) -> Workspace {
18565 let mut query = self.selection.select("withoutClient");
18566 query = query.arg("module", module.into());
18567 Workspace {
18568 proc: self.proc.clone(),
18569 selection: query,
18570 graphql_client: self.graphql_client.clone(),
18571 }
18572 }
18573 pub fn without_client_opts<'a>(
18582 &self,
18583 module: impl Into<String>,
18584 opts: WorkspaceWithoutClientOpts<'a>,
18585 ) -> Workspace {
18586 let mut query = self.selection.select("withoutClient");
18587 query = query.arg("module", module.into());
18588 if let Some(sdk) = opts.sdk {
18589 query = query.arg("sdk", sdk);
18590 }
18591 Workspace {
18592 proc: self.proc.clone(),
18593 selection: query,
18594 graphql_client: self.graphql_client.clone(),
18595 }
18596 }
18597 pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
18604 let mut query = self.selection.select("withoutConfigEnv");
18605 query = query.arg("name", name.into());
18606 Workspace {
18607 proc: self.proc.clone(),
18608 selection: query,
18609 graphql_client: self.graphql_client.clone(),
18610 }
18611 }
18612 pub fn without_config_env_opts(
18619 &self,
18620 name: impl Into<String>,
18621 opts: WorkspaceWithoutConfigEnvOpts,
18622 ) -> Workspace {
18623 let mut query = self.selection.select("withoutConfigEnv");
18624 query = query.arg("name", name.into());
18625 if let Some(here) = opts.here {
18626 query = query.arg("here", here);
18627 }
18628 Workspace {
18629 proc: self.proc.clone(),
18630 selection: query,
18631 graphql_client: self.graphql_client.clone(),
18632 }
18633 }
18634 pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
18643 let mut query = self.selection.select("withoutConfigValue");
18644 query = query.arg("key", key.into());
18645 Workspace {
18646 proc: self.proc.clone(),
18647 selection: query,
18648 graphql_client: self.graphql_client.clone(),
18649 }
18650 }
18651 pub fn without_config_value_opts(
18660 &self,
18661 key: impl Into<String>,
18662 opts: WorkspaceWithoutConfigValueOpts,
18663 ) -> Workspace {
18664 let mut query = self.selection.select("withoutConfigValue");
18665 query = query.arg("key", key.into());
18666 if let Some(here) = opts.here {
18667 query = query.arg("here", here);
18668 }
18669 Workspace {
18670 proc: self.proc.clone(),
18671 selection: query,
18672 graphql_client: self.graphql_client.clone(),
18673 }
18674 }
18675 pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
18681 let mut query = self.selection.select("withoutDirectory");
18682 query = query.arg("path", path.into());
18683 Workspace {
18684 proc: self.proc.clone(),
18685 selection: query,
18686 graphql_client: self.graphql_client.clone(),
18687 }
18688 }
18689 pub fn without_entrypoint(&self) -> Workspace {
18691 let query = self.selection.select("withoutEntrypoint");
18692 Workspace {
18693 proc: self.proc.clone(),
18694 selection: query,
18695 graphql_client: self.graphql_client.clone(),
18696 }
18697 }
18698 pub fn without_file(&self, path: impl Into<String>) -> Workspace {
18704 let mut query = self.selection.select("withoutFile");
18705 query = query.arg("path", path.into());
18706 Workspace {
18707 proc: self.proc.clone(),
18708 selection: query,
18709 graphql_client: self.graphql_client.clone(),
18710 }
18711 }
18712 pub fn without_module(&self, name: impl Into<String>) -> Workspace {
18720 let mut query = self.selection.select("withoutModule");
18721 query = query.arg("name", name.into());
18722 Workspace {
18723 proc: self.proc.clone(),
18724 selection: query,
18725 graphql_client: self.graphql_client.clone(),
18726 }
18727 }
18728 pub fn without_module_opts(
18736 &self,
18737 name: impl Into<String>,
18738 opts: WorkspaceWithoutModuleOpts,
18739 ) -> Workspace {
18740 let mut query = self.selection.select("withoutModule");
18741 query = query.arg("name", name.into());
18742 if let Some(here) = opts.here {
18743 query = query.arg("here", here);
18744 }
18745 Workspace {
18746 proc: self.proc.clone(),
18747 selection: query,
18748 graphql_client: self.graphql_client.clone(),
18749 }
18750 }
18751 pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
18758 let mut query = self.selection.select("withoutMount");
18759 query = query.arg("path", path.into());
18760 Workspace {
18761 proc: self.proc.clone(),
18762 selection: query,
18763 graphql_client: self.graphql_client.clone(),
18764 }
18765 }
18766 pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
18773 let mut query = self.selection.select("withoutSDK");
18774 query = query.arg("name", name.into());
18775 Workspace {
18776 proc: self.proc.clone(),
18777 selection: query,
18778 graphql_client: self.graphql_client.clone(),
18779 }
18780 }
18781 pub fn without_sdk_opts(
18788 &self,
18789 name: impl Into<String>,
18790 opts: WorkspaceWithoutSdkOpts,
18791 ) -> Workspace {
18792 let mut query = self.selection.select("withoutSDK");
18793 query = query.arg("name", name.into());
18794 if let Some(here) = opts.here {
18795 query = query.arg("here", here);
18796 }
18797 Workspace {
18798 proc: self.proc.clone(),
18799 selection: query,
18800 graphql_client: self.graphql_client.clone(),
18801 }
18802 }
18803}
18804impl Node for Workspace {
18805 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18806 let query = self.selection.select("id");
18807 let graphql_client = self.graphql_client.clone();
18808 async move { query.execute(graphql_client).await }
18809 }
18810}
18811#[derive(Clone)]
18812pub struct WorkspaceCommitPick {
18813 pub proc: Option<Arc<DaggerSessionProc>>,
18814 pub selection: Selection,
18815 pub graphql_client: DynGraphQLClient,
18816}
18817impl IntoID<Id> for WorkspaceCommitPick {
18818 fn into_id(
18819 self,
18820 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18821 Box::pin(async move { self.id().await })
18822 }
18823}
18824impl Loadable for WorkspaceCommitPick {
18825 fn graphql_type() -> &'static str {
18826 "WorkspaceCommitPick"
18827 }
18828 fn from_query(
18829 proc: Option<Arc<DaggerSessionProc>>,
18830 selection: Selection,
18831 graphql_client: DynGraphQLClient,
18832 ) -> Self {
18833 Self {
18834 proc,
18835 selection,
18836 graphql_client,
18837 }
18838 }
18839}
18840impl WorkspaceCommitPick {
18841 pub fn commit(&self) -> GitCommit {
18843 let query = self.selection.select("commit");
18844 GitCommit {
18845 proc: self.proc.clone(),
18846 selection: query,
18847 graphql_client: self.graphql_client.clone(),
18848 }
18849 }
18850 pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
18852 let query = self.selection.select("conflictPaths");
18853 query.execute(self.graphql_client.clone()).await
18854 }
18855 pub async fn id(&self) -> Result<Id, DaggerError> {
18857 let query = self.selection.select("id");
18858 query.execute(self.graphql_client.clone()).await
18859 }
18860 pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
18862 let query = self.selection.select("reason");
18863 query.execute(self.graphql_client.clone()).await
18864 }
18865 pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
18867 let query = self.selection.select("status");
18868 query.execute(self.graphql_client.clone()).await
18869 }
18870}
18871impl Node for WorkspaceCommitPick {
18872 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18873 let query = self.selection.select("id");
18874 let graphql_client = self.graphql_client.clone();
18875 async move { query.execute(graphql_client).await }
18876 }
18877}
18878#[derive(Clone)]
18879pub struct WorkspaceGit {
18880 pub proc: Option<Arc<DaggerSessionProc>>,
18881 pub selection: Selection,
18882 pub graphql_client: DynGraphQLClient,
18883}
18884impl IntoID<Id> for WorkspaceGit {
18885 fn into_id(
18886 self,
18887 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18888 Box::pin(async move { self.id().await })
18889 }
18890}
18891impl Loadable for WorkspaceGit {
18892 fn graphql_type() -> &'static str {
18893 "WorkspaceGit"
18894 }
18895 fn from_query(
18896 proc: Option<Arc<DaggerSessionProc>>,
18897 selection: Selection,
18898 graphql_client: DynGraphQLClient,
18899 ) -> Self {
18900 Self {
18901 proc,
18902 selection,
18903 graphql_client,
18904 }
18905 }
18906}
18907impl WorkspaceGit {
18908 pub fn directory(&self) -> Directory {
18912 let query = self.selection.select("directory");
18913 Directory {
18914 proc: self.proc.clone(),
18915 selection: query,
18916 graphql_client: self.graphql_client.clone(),
18917 }
18918 }
18919 pub fn head(&self) -> GitRef {
18921 let query = self.selection.select("head");
18922 GitRef {
18923 proc: self.proc.clone(),
18924 selection: query,
18925 graphql_client: self.graphql_client.clone(),
18926 }
18927 }
18928 pub async fn id(&self) -> Result<Id, DaggerError> {
18930 let query = self.selection.select("id");
18931 query.execute(self.graphql_client.clone()).await
18932 }
18933 pub fn uncommitted(&self) -> Changeset {
18935 let query = self.selection.select("uncommitted");
18936 Changeset {
18937 proc: self.proc.clone(),
18938 selection: query,
18939 graphql_client: self.graphql_client.clone(),
18940 }
18941 }
18942}
18943impl Node for WorkspaceGit {
18944 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18945 let query = self.selection.select("id");
18946 let graphql_client = self.graphql_client.clone();
18947 async move { query.execute(graphql_client).await }
18948 }
18949}
18950#[derive(Clone)]
18951pub struct WorkspaceMigration {
18952 pub proc: Option<Arc<DaggerSessionProc>>,
18953 pub selection: Selection,
18954 pub graphql_client: DynGraphQLClient,
18955}
18956impl IntoID<Id> for WorkspaceMigration {
18957 fn into_id(
18958 self,
18959 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18960 Box::pin(async move { self.id().await })
18961 }
18962}
18963impl Loadable for WorkspaceMigration {
18964 fn graphql_type() -> &'static str {
18965 "WorkspaceMigration"
18966 }
18967 fn from_query(
18968 proc: Option<Arc<DaggerSessionProc>>,
18969 selection: Selection,
18970 graphql_client: DynGraphQLClient,
18971 ) -> Self {
18972 Self {
18973 proc,
18974 selection,
18975 graphql_client,
18976 }
18977 }
18978}
18979impl WorkspaceMigration {
18980 pub fn changes(&self) -> Changeset {
18982 let query = self.selection.select("changes");
18983 Changeset {
18984 proc: self.proc.clone(),
18985 selection: query,
18986 graphql_client: self.graphql_client.clone(),
18987 }
18988 }
18989 pub async fn config_file(&self) -> Result<String, DaggerError> {
18991 let query = self.selection.select("configFile");
18992 query.execute(self.graphql_client.clone()).await
18993 }
18994 pub async fn id(&self) -> Result<Id, DaggerError> {
18996 let query = self.selection.select("id");
18997 query.execute(self.graphql_client.clone()).await
18998 }
18999 pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
19001 let query = self.selection.select("moduleCandidates");
19002 query.execute(self.graphql_client.clone()).await
19003 }
19004 pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
19006 let query = self.selection.select("steps");
19007 let query = query.select("id");
19008 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19009 Ok(ids
19010 .into_iter()
19011 .map(|id| WorkspaceMigrationStep {
19012 proc: self.proc.clone(),
19013 selection: crate::querybuilder::query()
19014 .select("node")
19015 .arg("id", &id.0)
19016 .inline_fragment("WorkspaceMigrationStep"),
19017 graphql_client: self.graphql_client.clone(),
19018 })
19019 .collect())
19020 }
19021}
19022impl Node for WorkspaceMigration {
19023 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19024 let query = self.selection.select("id");
19025 let graphql_client = self.graphql_client.clone();
19026 async move { query.execute(graphql_client).await }
19027 }
19028}
19029#[derive(Clone)]
19030pub struct WorkspaceMigrationStep {
19031 pub proc: Option<Arc<DaggerSessionProc>>,
19032 pub selection: Selection,
19033 pub graphql_client: DynGraphQLClient,
19034}
19035impl IntoID<Id> for WorkspaceMigrationStep {
19036 fn into_id(
19037 self,
19038 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19039 Box::pin(async move { self.id().await })
19040 }
19041}
19042impl Loadable for WorkspaceMigrationStep {
19043 fn graphql_type() -> &'static str {
19044 "WorkspaceMigrationStep"
19045 }
19046 fn from_query(
19047 proc: Option<Arc<DaggerSessionProc>>,
19048 selection: Selection,
19049 graphql_client: DynGraphQLClient,
19050 ) -> Self {
19051 Self {
19052 proc,
19053 selection,
19054 graphql_client,
19055 }
19056 }
19057}
19058impl WorkspaceMigrationStep {
19059 pub fn changes(&self) -> Changeset {
19061 let query = self.selection.select("changes");
19062 Changeset {
19063 proc: self.proc.clone(),
19064 selection: query,
19065 graphql_client: self.graphql_client.clone(),
19066 }
19067 }
19068 pub async fn code(&self) -> Result<String, DaggerError> {
19070 let query = self.selection.select("code");
19071 query.execute(self.graphql_client.clone()).await
19072 }
19073 pub async fn description(&self) -> Result<String, DaggerError> {
19075 let query = self.selection.select("description");
19076 query.execute(self.graphql_client.clone()).await
19077 }
19078 pub async fn id(&self) -> Result<Id, DaggerError> {
19080 let query = self.selection.select("id");
19081 query.execute(self.graphql_client.clone()).await
19082 }
19083 pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
19085 let query = self.selection.select("warnings");
19086 query.execute(self.graphql_client.clone()).await
19087 }
19088}
19089impl Node for WorkspaceMigrationStep {
19090 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19091 let query = self.selection.select("id");
19092 let graphql_client = self.graphql_client.clone();
19093 async move { query.execute(graphql_client).await }
19094 }
19095}
19096#[derive(Clone)]
19097pub struct WorkspaceModule {
19098 pub proc: Option<Arc<DaggerSessionProc>>,
19099 pub selection: Selection,
19100 pub graphql_client: DynGraphQLClient,
19101}
19102impl IntoID<Id> for WorkspaceModule {
19103 fn into_id(
19104 self,
19105 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19106 Box::pin(async move { self.id().await })
19107 }
19108}
19109impl Loadable for WorkspaceModule {
19110 fn graphql_type() -> &'static str {
19111 "WorkspaceModule"
19112 }
19113 fn from_query(
19114 proc: Option<Arc<DaggerSessionProc>>,
19115 selection: Selection,
19116 graphql_client: DynGraphQLClient,
19117 ) -> Self {
19118 Self {
19119 proc,
19120 selection,
19121 graphql_client,
19122 }
19123 }
19124}
19125impl WorkspaceModule {
19126 pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
19128 let query = self.selection.select("entrypoint");
19129 query.execute(self.graphql_client.clone()).await
19130 }
19131 pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
19133 let query = self.selection.select("functions");
19134 query.execute(self.graphql_client.clone()).await
19135 }
19136 pub async fn id(&self) -> Result<Id, DaggerError> {
19138 let query = self.selection.select("id");
19139 query.execute(self.graphql_client.clone()).await
19140 }
19141 pub async fn name(&self) -> Result<String, DaggerError> {
19143 let query = self.selection.select("name");
19144 query.execute(self.graphql_client.clone()).await
19145 }
19146 pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
19148 let query = self.selection.select("settings");
19149 let query = query.select("id");
19150 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19151 Ok(ids
19152 .into_iter()
19153 .map(|id| WorkspaceModuleSetting {
19154 proc: self.proc.clone(),
19155 selection: crate::querybuilder::query()
19156 .select("node")
19157 .arg("id", &id.0)
19158 .inline_fragment("WorkspaceModuleSetting"),
19159 graphql_client: self.graphql_client.clone(),
19160 })
19161 .collect())
19162 }
19163 pub async fn source(&self) -> Result<String, DaggerError> {
19165 let query = self.selection.select("source");
19166 query.execute(self.graphql_client.clone()).await
19167 }
19168}
19169impl Node for WorkspaceModule {
19170 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19171 let query = self.selection.select("id");
19172 let graphql_client = self.graphql_client.clone();
19173 async move { query.execute(graphql_client).await }
19174 }
19175}
19176#[derive(Clone)]
19177pub struct WorkspaceModuleSetting {
19178 pub proc: Option<Arc<DaggerSessionProc>>,
19179 pub selection: Selection,
19180 pub graphql_client: DynGraphQLClient,
19181}
19182impl IntoID<Id> for WorkspaceModuleSetting {
19183 fn into_id(
19184 self,
19185 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19186 Box::pin(async move { self.id().await })
19187 }
19188}
19189impl Loadable for WorkspaceModuleSetting {
19190 fn graphql_type() -> &'static str {
19191 "WorkspaceModuleSetting"
19192 }
19193 fn from_query(
19194 proc: Option<Arc<DaggerSessionProc>>,
19195 selection: Selection,
19196 graphql_client: DynGraphQLClient,
19197 ) -> Self {
19198 Self {
19199 proc,
19200 selection,
19201 graphql_client,
19202 }
19203 }
19204}
19205impl WorkspaceModuleSetting {
19206 pub async fn default_value(&self) -> Result<String, DaggerError> {
19208 let query = self.selection.select("defaultValue");
19209 query.execute(self.graphql_client.clone()).await
19210 }
19211 pub async fn description(&self) -> Result<String, DaggerError> {
19213 let query = self.selection.select("description");
19214 query.execute(self.graphql_client.clone()).await
19215 }
19216 pub async fn id(&self) -> Result<Id, DaggerError> {
19218 let query = self.selection.select("id");
19219 query.execute(self.graphql_client.clone()).await
19220 }
19221 pub async fn is_list(&self) -> Result<bool, DaggerError> {
19223 let query = self.selection.select("isList");
19224 query.execute(self.graphql_client.clone()).await
19225 }
19226 pub async fn is_object(&self) -> Result<bool, DaggerError> {
19228 let query = self.selection.select("isObject");
19229 query.execute(self.graphql_client.clone()).await
19230 }
19231 pub async fn is_string(&self) -> Result<bool, DaggerError> {
19233 let query = self.selection.select("isString");
19234 query.execute(self.graphql_client.clone()).await
19235 }
19236 pub async fn key(&self) -> Result<String, DaggerError> {
19238 let query = self.selection.select("key");
19239 query.execute(self.graphql_client.clone()).await
19240 }
19241 pub async fn value(&self) -> Result<String, DaggerError> {
19243 let query = self.selection.select("value");
19244 query.execute(self.graphql_client.clone()).await
19245 }
19246}
19247impl Node for WorkspaceModuleSetting {
19248 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19249 let query = self.selection.select("id");
19250 let graphql_client = self.graphql_client.clone();
19251 async move { query.execute(graphql_client).await }
19252 }
19253}
19254#[derive(Clone)]
19255pub struct WorkspaceSdk {
19256 pub proc: Option<Arc<DaggerSessionProc>>,
19257 pub selection: Selection,
19258 pub graphql_client: DynGraphQLClient,
19259}
19260impl IntoID<Id> for WorkspaceSdk {
19261 fn into_id(
19262 self,
19263 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
19264 Box::pin(async move { self.id().await })
19265 }
19266}
19267impl Loadable for WorkspaceSdk {
19268 fn graphql_type() -> &'static str {
19269 "WorkspaceSDK"
19270 }
19271 fn from_query(
19272 proc: Option<Arc<DaggerSessionProc>>,
19273 selection: Selection,
19274 graphql_client: DynGraphQLClient,
19275 ) -> Self {
19276 Self {
19277 proc,
19278 selection,
19279 graphql_client,
19280 }
19281 }
19282}
19283impl WorkspaceSdk {
19284 pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
19286 let query = self.selection.select("clients");
19287 let query = query.select("id");
19288 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19289 Ok(ids
19290 .into_iter()
19291 .map(|id| WorkspaceModule {
19292 proc: self.proc.clone(),
19293 selection: crate::querybuilder::query()
19294 .select("node")
19295 .arg("id", &id.0)
19296 .inline_fragment("WorkspaceModule"),
19297 graphql_client: self.graphql_client.clone(),
19298 })
19299 .collect())
19300 }
19301 pub async fn id(&self) -> Result<Id, DaggerError> {
19303 let query = self.selection.select("id");
19304 query.execute(self.graphql_client.clone()).await
19305 }
19306 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
19308 let query = self.selection.select("modules");
19309 let query = query.select("id");
19310 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19311 Ok(ids
19312 .into_iter()
19313 .map(|id| WorkspaceModule {
19314 proc: self.proc.clone(),
19315 selection: crate::querybuilder::query()
19316 .select("node")
19317 .arg("id", &id.0)
19318 .inline_fragment("WorkspaceModule"),
19319 graphql_client: self.graphql_client.clone(),
19320 })
19321 .collect())
19322 }
19323 pub async fn name(&self) -> Result<String, DaggerError> {
19325 let query = self.selection.select("name");
19326 query.execute(self.graphql_client.clone()).await
19327 }
19328 pub async fn r#ref(&self) -> Result<String, DaggerError> {
19330 let query = self.selection.select("ref");
19331 query.execute(self.graphql_client.clone()).await
19332 }
19333}
19334impl Node for WorkspaceSdk {
19335 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
19336 let query = self.selection.select("id");
19337 let graphql_client = self.graphql_client.clone();
19338 async move { query.execute(graphql_client).await }
19339 }
19340}
19341#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19342pub enum AgentMessageDelivery {
19343 #[serde(rename = "QUEUED")]
19344 Queued,
19345 #[serde(rename = "STARTED")]
19346 Started,
19347 #[serde(rename = "STEERED")]
19348 Steered,
19349}
19350#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19351pub enum AgentState {
19352 #[serde(rename = "FAILED")]
19353 Failed,
19354 #[serde(rename = "IDLE")]
19355 Idle,
19356 #[serde(rename = "PAUSED")]
19357 Paused,
19358 #[serde(rename = "RUNNING")]
19359 Running,
19360 #[serde(rename = "STOPPED")]
19361 Stopped,
19362 #[serde(rename = "WAITING_INPUT")]
19363 WaitingInput,
19364}
19365#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19366pub enum CacheSharingMode {
19367 #[serde(rename = "LOCKED")]
19368 Locked,
19369 #[serde(rename = "PRIVATE")]
19370 Private,
19371 #[serde(rename = "SHARED")]
19372 Shared,
19373}
19374#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19375pub enum ChangesetMergeConflict {
19376 #[serde(rename = "FAIL")]
19377 Fail,
19378 #[serde(rename = "FAIL_EARLY")]
19379 FailEarly,
19380 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
19381 LeaveConflictMarkers,
19382 #[serde(rename = "PREFER_OURS")]
19383 PreferOurs,
19384 #[serde(rename = "PREFER_THEIRS")]
19385 PreferTheirs,
19386}
19387#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19388pub enum ChangesetsMergeConflict {
19389 #[serde(rename = "FAIL")]
19390 Fail,
19391 #[serde(rename = "FAIL_EARLY")]
19392 FailEarly,
19393}
19394#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19395pub enum DiffStatKind {
19396 #[serde(rename = "ADDED")]
19397 Added,
19398 #[serde(rename = "MODIFIED")]
19399 Modified,
19400 #[serde(rename = "REMOVED")]
19401 Removed,
19402 #[serde(rename = "RENAMED")]
19403 Renamed,
19404}
19405#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19406pub enum ExistsType {
19407 #[serde(rename = "DIRECTORY_TYPE")]
19408 DirectoryType,
19409 #[serde(rename = "REGULAR_TYPE")]
19410 RegularType,
19411 #[serde(rename = "SYMLINK_TYPE")]
19412 SymlinkType,
19413}
19414#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19415pub enum FileType {
19416 #[serde(rename = "DIRECTORY")]
19417 Directory,
19418 #[serde(rename = "DIRECTORY_TYPE")]
19419 DirectoryType,
19420 #[serde(rename = "REGULAR")]
19421 Regular,
19422 #[serde(rename = "REGULAR_TYPE")]
19423 RegularType,
19424 #[serde(rename = "SYMLINK")]
19425 Symlink,
19426 #[serde(rename = "SYMLINK_TYPE")]
19427 SymlinkType,
19428 #[serde(rename = "UNKNOWN")]
19429 Unknown,
19430}
19431#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19432pub enum FunctionCachePolicy {
19433 #[serde(rename = "Default")]
19434 Default,
19435 #[serde(rename = "Never")]
19436 Never,
19437 #[serde(rename = "PerSession")]
19438 PerSession,
19439}
19440#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19441pub enum GitPushDisposition {
19442 #[serde(rename = "CREATED")]
19443 Created,
19444 #[serde(rename = "FAST_FORWARD")]
19445 FastForward,
19446 #[serde(rename = "FORCED")]
19447 Forced,
19448 #[serde(rename = "UP_TO_DATE")]
19449 UpToDate,
19450}
19451#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19452pub enum ImageLayerCompression {
19453 #[serde(rename = "EStarGZ")]
19454 EStarGz,
19455 #[serde(rename = "ESTARGZ")]
19456 Estargz,
19457 #[serde(rename = "Gzip")]
19458 Gzip,
19459 #[serde(rename = "Uncompressed")]
19460 Uncompressed,
19461 #[serde(rename = "Zstd")]
19462 Zstd,
19463}
19464#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19465pub enum ImageMediaTypes {
19466 #[serde(rename = "DOCKER")]
19467 Docker,
19468 #[serde(rename = "DockerMediaTypes")]
19469 DockerMediaTypes,
19470 #[serde(rename = "OCI")]
19471 Oci,
19472 #[serde(rename = "OCIMediaTypes")]
19473 OciMediaTypes,
19474}
19475#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19476pub enum LlmContentBlockKind {
19477 #[serde(rename = "TEXT")]
19478 Text,
19479 #[serde(rename = "THINKING")]
19480 Thinking,
19481 #[serde(rename = "TOOL_CALL")]
19482 ToolCall,
19483 #[serde(rename = "TOOL_RESULT")]
19484 ToolResult,
19485}
19486#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19487pub enum LlmMessageOriginKind {
19488 #[serde(rename = "AGENT")]
19489 Agent,
19490 #[serde(rename = "EVENT")]
19491 Event,
19492 #[serde(rename = "USER")]
19493 User,
19494}
19495#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19496pub enum LlmMessageRole {
19497 #[serde(rename = "ASSISTANT")]
19498 Assistant,
19499 #[serde(rename = "SYSTEM")]
19500 System,
19501 #[serde(rename = "USER")]
19502 User,
19503}
19504#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19505pub enum ModuleSourceExperimentalFeature {
19506 #[serde(rename = "SELF_CALLS")]
19507 SelfCalls,
19508}
19509#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19510pub enum ModuleSourceKind {
19511 #[serde(rename = "DIR")]
19512 Dir,
19513 #[serde(rename = "DIR_SOURCE")]
19514 DirSource,
19515 #[serde(rename = "GIT")]
19516 Git,
19517 #[serde(rename = "GIT_SOURCE")]
19518 GitSource,
19519 #[serde(rename = "LOCAL")]
19520 Local,
19521 #[serde(rename = "LOCAL_SOURCE")]
19522 LocalSource,
19523}
19524#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19525pub enum NetworkProtocol {
19526 #[serde(rename = "TCP")]
19527 Tcp,
19528 #[serde(rename = "UDP")]
19529 Udp,
19530}
19531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19532pub enum PatchConflict {
19533 #[serde(rename = "FAIL")]
19534 Fail,
19535 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
19536 LeaveConflictMarkers,
19537}
19538#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19539pub enum RegistryProtocol {
19540 #[serde(rename = "HTTP")]
19541 Http,
19542 #[serde(rename = "HTTPS")]
19543 Https,
19544}
19545#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19546pub enum ReturnType {
19547 #[serde(rename = "ANY")]
19548 Any,
19549 #[serde(rename = "FAILURE")]
19550 Failure,
19551 #[serde(rename = "SUCCESS")]
19552 Success,
19553}
19554#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19555pub enum TypeDefKind {
19556 #[serde(rename = "BOOLEAN")]
19557 Boolean,
19558 #[serde(rename = "BOOLEAN_KIND")]
19559 BooleanKind,
19560 #[serde(rename = "ENUM")]
19561 Enum,
19562 #[serde(rename = "ENUM_KIND")]
19563 EnumKind,
19564 #[serde(rename = "FLOAT")]
19565 Float,
19566 #[serde(rename = "FLOAT_KIND")]
19567 FloatKind,
19568 #[serde(rename = "INPUT")]
19569 Input,
19570 #[serde(rename = "INPUT_KIND")]
19571 InputKind,
19572 #[serde(rename = "INTEGER")]
19573 Integer,
19574 #[serde(rename = "INTEGER_KIND")]
19575 IntegerKind,
19576 #[serde(rename = "INTERFACE")]
19577 Interface,
19578 #[serde(rename = "INTERFACE_KIND")]
19579 InterfaceKind,
19580 #[serde(rename = "LIST")]
19581 List,
19582 #[serde(rename = "LIST_KIND")]
19583 ListKind,
19584 #[serde(rename = "OBJECT")]
19585 Object,
19586 #[serde(rename = "OBJECT_KIND")]
19587 ObjectKind,
19588 #[serde(rename = "SCALAR")]
19589 Scalar,
19590 #[serde(rename = "SCALAR_KIND")]
19591 ScalarKind,
19592 #[serde(rename = "STRING")]
19593 String,
19594 #[serde(rename = "STRING_KIND")]
19595 StringKind,
19596 #[serde(rename = "VOID")]
19597 Void,
19598 #[serde(rename = "VOID_KIND")]
19599 VoidKind,
19600}
19601#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19602pub enum WorkspaceCommitPickReason {
19603 #[serde(rename = "CONTENT")]
19604 Content,
19605 #[serde(rename = "DIRTY")]
19606 Dirty,
19607 #[serde(rename = "NONE")]
19608 None,
19609}
19610#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
19611pub enum WorkspaceCommitPickStatus {
19612 #[serde(rename = "CONFLICT")]
19613 Conflict,
19614 #[serde(rename = "PICKABLE")]
19615 Pickable,
19616 #[serde(rename = "PICKED")]
19617 Picked,
19618 #[serde(rename = "REDUNDANT")]
19619 Redundant,
19620}