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 content: Vec<LlmContentBlockInput>,
115 pub data: Bytes,
116 pub errored: bool,
117 pub file: Id,
118 pub kind: LlmContentBlockKind,
119 pub mime_type: String,
120 pub signature: String,
121 pub text: String,
122 pub tool_name: String,
123}
124#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
125pub struct LlmMessageOriginInput {
126 pub agent_name: String,
127 pub kind: LlmMessageOriginKind,
128 pub r#ref: String,
129 pub reply_to: String,
130}
131#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
132pub struct PipelineLabel {
133 pub name: String,
134 pub value: String,
135}
136#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
137pub struct PortForward {
138 pub backend: isize,
139 pub frontend: isize,
140 pub protocol: NetworkProtocol,
141}
142pub trait Exportable {
145 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
146 fn export(
147 &self,
148 path: impl Into<String>,
149 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
150}
151#[derive(Clone)]
152pub struct ExportableClient {
153 pub proc: Option<Arc<DaggerSessionProc>>,
154 pub selection: Selection,
155 pub graphql_client: DynGraphQLClient,
156}
157impl IntoID<Id> for ExportableClient {
158 fn into_id(
159 self,
160 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
161 Box::pin(async move { self.id().await })
162 }
163}
164impl ExportableClient {
165 pub async fn id(&self) -> Result<Id, DaggerError> {
166 let query = self.selection.select("id");
167 query.execute(self.graphql_client.clone()).await
168 }
169 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
170 let mut query = self.selection.select("export");
171 query = query.arg("path", path.into());
172 query.execute(self.graphql_client.clone()).await
173 }
174}
175impl Loadable for ExportableClient {
176 fn graphql_type() -> &'static str {
177 "Exportable"
178 }
179 fn from_query(
180 proc: Option<Arc<DaggerSessionProc>>,
181 selection: Selection,
182 graphql_client: DynGraphQLClient,
183 ) -> Self {
184 Self {
185 proc,
186 selection,
187 graphql_client,
188 }
189 }
190}
191impl Exportable for ExportableClient {
192 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
193 let query = self.selection.select("id");
194 let graphql_client = self.graphql_client.clone();
195 async move { query.execute(graphql_client).await }
196 }
197 fn export(
198 &self,
199 path: impl Into<String>,
200 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
201 let mut query = self.selection.select("export");
202 query = query.arg("path", path.into());
203 let graphql_client = self.graphql_client.clone();
204 async move { query.execute(graphql_client).await }
205 }
206}
207pub trait Node {
209 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
210}
211#[derive(Clone)]
212pub struct NodeClient {
213 pub proc: Option<Arc<DaggerSessionProc>>,
214 pub selection: Selection,
215 pub graphql_client: DynGraphQLClient,
216}
217impl IntoID<Id> for NodeClient {
218 fn into_id(
219 self,
220 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
221 Box::pin(async move { self.id().await })
222 }
223}
224impl NodeClient {
225 pub async fn id(&self) -> Result<Id, DaggerError> {
226 let query = self.selection.select("id");
227 query.execute(self.graphql_client.clone()).await
228 }
229}
230impl Loadable for NodeClient {
231 fn graphql_type() -> &'static str {
232 "Node"
233 }
234 fn from_query(
235 proc: Option<Arc<DaggerSessionProc>>,
236 selection: Selection,
237 graphql_client: DynGraphQLClient,
238 ) -> Self {
239 Self {
240 proc,
241 selection,
242 graphql_client,
243 }
244 }
245}
246impl Node for NodeClient {
247 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
248 let query = self.selection.select("id");
249 let graphql_client = self.graphql_client.clone();
250 async move { query.execute(graphql_client).await }
251 }
252}
253pub trait Syncer {
256 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
257 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send
258 where
259 Self: Sized;
260}
261#[derive(Clone)]
262pub struct SyncerClient {
263 pub proc: Option<Arc<DaggerSessionProc>>,
264 pub selection: Selection,
265 pub graphql_client: DynGraphQLClient,
266}
267impl IntoID<Id> for SyncerClient {
268 fn into_id(
269 self,
270 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
271 Box::pin(async move { self.id().await })
272 }
273}
274impl SyncerClient {
275 pub async fn id(&self) -> Result<Id, DaggerError> {
276 let query = self.selection.select("id");
277 query.execute(self.graphql_client.clone()).await
278 }
279 pub async fn sync(&self) -> Result<SyncerClient, DaggerError> {
280 let query = self.selection.select("sync");
281 let id: Id = query.execute(self.graphql_client.clone()).await?;
282 Ok(SyncerClient {
283 proc: self.proc.clone(),
284 selection: query
285 .root()
286 .select("node")
287 .arg("id", &id.0)
288 .inline_fragment("Syncer"),
289 graphql_client: self.graphql_client.clone(),
290 })
291 }
292}
293impl Loadable for SyncerClient {
294 fn graphql_type() -> &'static str {
295 "Syncer"
296 }
297 fn from_query(
298 proc: Option<Arc<DaggerSessionProc>>,
299 selection: Selection,
300 graphql_client: DynGraphQLClient,
301 ) -> Self {
302 Self {
303 proc,
304 selection,
305 graphql_client,
306 }
307 }
308}
309impl Syncer for SyncerClient {
310 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
311 let query = self.selection.select("id");
312 let graphql_client = self.graphql_client.clone();
313 async move { query.execute(graphql_client).await }
314 }
315 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
316 let query = self.selection.select("sync");
317 let proc = self.proc.clone();
318 let graphql_client = self.graphql_client.clone();
319 async move {
320 let id: Id = query.execute(graphql_client.clone()).await?;
321 Ok(Self {
322 proc,
323 selection: query
324 .root()
325 .select("node")
326 .arg("id", &id.0)
327 .inline_fragment("Syncer"),
328 graphql_client,
329 })
330 }
331 }
332}
333#[derive(Clone)]
334pub struct Address {
335 pub proc: Option<Arc<DaggerSessionProc>>,
336 pub selection: Selection,
337 pub graphql_client: DynGraphQLClient,
338}
339#[derive(Builder, Debug, PartialEq)]
340pub struct AddressContainerOpts {
341 #[builder(setter(into, strip_option), default)]
344 pub no_lock: Option<bool>,
345}
346#[derive(Builder, Debug, PartialEq)]
347pub struct AddressDirectoryOpts<'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 #[builder(setter(into, strip_option), default)]
359 pub no_lock: Option<bool>,
360}
361#[derive(Builder, Debug, PartialEq)]
362pub struct AddressFileOpts<'a> {
363 #[builder(setter(into, strip_option), default)]
364 pub exclude: Option<Vec<&'a str>>,
365 #[builder(setter(into, strip_option), default)]
366 pub gitignore: Option<bool>,
367 #[builder(setter(into, strip_option), default)]
368 pub include: Option<Vec<&'a str>>,
369 #[builder(setter(into, strip_option), default)]
370 pub no_cache: Option<bool>,
371 #[builder(setter(into, strip_option), default)]
374 pub no_lock: Option<bool>,
375}
376#[derive(Builder, Debug, PartialEq)]
377pub struct AddressGitRefOpts {
378 #[builder(setter(into, strip_option), default)]
381 pub no_lock: Option<bool>,
382}
383impl IntoID<Id> for Address {
384 fn into_id(
385 self,
386 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
387 Box::pin(async move { self.id().await })
388 }
389}
390impl Loadable for Address {
391 fn graphql_type() -> &'static str {
392 "Address"
393 }
394 fn from_query(
395 proc: Option<Arc<DaggerSessionProc>>,
396 selection: Selection,
397 graphql_client: DynGraphQLClient,
398 ) -> Self {
399 Self {
400 proc,
401 selection,
402 graphql_client,
403 }
404 }
405}
406impl Address {
407 pub async fn id(&self) -> Result<Id, DaggerError> {
409 let query = self.selection.select("id");
410 query.execute(self.graphql_client.clone()).await
411 }
412 pub async fn value(&self) -> Result<String, DaggerError> {
414 let query = self.selection.select("value");
415 query.execute(self.graphql_client.clone()).await
416 }
417 pub fn container(&self) -> Container {
423 let query = self.selection.select("container");
424 Container {
425 proc: self.proc.clone(),
426 selection: query,
427 graphql_client: self.graphql_client.clone(),
428 }
429 }
430 pub fn container_opts(&self, opts: AddressContainerOpts) -> Container {
436 let mut query = self.selection.select("container");
437 if let Some(no_lock) = opts.no_lock {
438 query = query.arg("noLock", no_lock);
439 }
440 Container {
441 proc: self.proc.clone(),
442 selection: query,
443 graphql_client: self.graphql_client.clone(),
444 }
445 }
446 pub fn directory(&self) -> Directory {
452 let query = self.selection.select("directory");
453 Directory {
454 proc: self.proc.clone(),
455 selection: query,
456 graphql_client: self.graphql_client.clone(),
457 }
458 }
459 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
465 let mut query = self.selection.select("directory");
466 if let Some(exclude) = opts.exclude {
467 query = query.arg("exclude", exclude);
468 }
469 if let Some(include) = opts.include {
470 query = query.arg("include", include);
471 }
472 if let Some(gitignore) = opts.gitignore {
473 query = query.arg("gitignore", gitignore);
474 }
475 if let Some(no_cache) = opts.no_cache {
476 query = query.arg("noCache", no_cache);
477 }
478 if let Some(no_lock) = opts.no_lock {
479 query = query.arg("noLock", no_lock);
480 }
481 Directory {
482 proc: self.proc.clone(),
483 selection: query,
484 graphql_client: self.graphql_client.clone(),
485 }
486 }
487 pub fn file(&self) -> File {
493 let query = self.selection.select("file");
494 File {
495 proc: self.proc.clone(),
496 selection: query,
497 graphql_client: self.graphql_client.clone(),
498 }
499 }
500 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
506 let mut query = self.selection.select("file");
507 if let Some(exclude) = opts.exclude {
508 query = query.arg("exclude", exclude);
509 }
510 if let Some(include) = opts.include {
511 query = query.arg("include", include);
512 }
513 if let Some(gitignore) = opts.gitignore {
514 query = query.arg("gitignore", gitignore);
515 }
516 if let Some(no_cache) = opts.no_cache {
517 query = query.arg("noCache", no_cache);
518 }
519 if let Some(no_lock) = opts.no_lock {
520 query = query.arg("noLock", no_lock);
521 }
522 File {
523 proc: self.proc.clone(),
524 selection: query,
525 graphql_client: self.graphql_client.clone(),
526 }
527 }
528 pub fn git_ref(&self) -> GitRef {
534 let query = self.selection.select("gitRef");
535 GitRef {
536 proc: self.proc.clone(),
537 selection: query,
538 graphql_client: self.graphql_client.clone(),
539 }
540 }
541 pub fn git_ref_opts(&self, opts: AddressGitRefOpts) -> GitRef {
547 let mut query = self.selection.select("gitRef");
548 if let Some(no_lock) = opts.no_lock {
549 query = query.arg("noLock", no_lock);
550 }
551 GitRef {
552 proc: self.proc.clone(),
553 selection: query,
554 graphql_client: self.graphql_client.clone(),
555 }
556 }
557 pub fn git_repository(&self) -> GitRepository {
559 let query = self.selection.select("gitRepository");
560 GitRepository {
561 proc: self.proc.clone(),
562 selection: query,
563 graphql_client: self.graphql_client.clone(),
564 }
565 }
566 pub fn secret(&self) -> Secret {
568 let query = self.selection.select("secret");
569 Secret {
570 proc: self.proc.clone(),
571 selection: query,
572 graphql_client: self.graphql_client.clone(),
573 }
574 }
575 pub fn service(&self) -> Service {
577 let query = self.selection.select("service");
578 Service {
579 proc: self.proc.clone(),
580 selection: query,
581 graphql_client: self.graphql_client.clone(),
582 }
583 }
584 pub fn socket(&self) -> Socket {
586 let query = self.selection.select("socket");
587 Socket {
588 proc: self.proc.clone(),
589 selection: query,
590 graphql_client: self.graphql_client.clone(),
591 }
592 }
593 pub fn volume(&self) -> Volume {
595 let query = self.selection.select("volume");
596 Volume {
597 proc: self.proc.clone(),
598 selection: query,
599 graphql_client: self.graphql_client.clone(),
600 }
601 }
602 pub fn workspace(&self) -> Workspace {
604 let query = self.selection.select("workspace");
605 Workspace {
606 proc: self.proc.clone(),
607 selection: query,
608 graphql_client: self.graphql_client.clone(),
609 }
610 }
611}
612impl Node for Address {
613 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
614 let query = self.selection.select("id");
615 let graphql_client = self.graphql_client.clone();
616 async move { query.execute(graphql_client).await }
617 }
618}
619#[derive(Clone)]
620pub struct Agent {
621 pub proc: Option<Arc<DaggerSessionProc>>,
622 pub selection: Selection,
623 pub graphql_client: DynGraphQLClient,
624}
625#[derive(Builder, Debug, PartialEq)]
626pub struct AgentSendOpts<'a> {
627 #[builder(setter(into, strip_option), default)]
629 pub content: Option<Vec<LlmContentBlockInput>>,
630 #[builder(setter(into, strip_option), default)]
632 pub reply_to: Option<&'a str>,
633}
634#[derive(Builder, Debug, PartialEq)]
635pub struct AgentPauseOpts {
636 #[builder(setter(into, strip_option), default)]
638 pub interrupt: Option<bool>,
639}
640#[derive(Builder, Debug, PartialEq)]
641pub struct AgentNotifyOpts {
642 #[builder(setter(into, strip_option), default)]
644 pub on: Option<Vec<AgentState>>,
645}
646#[derive(Builder, Debug, PartialEq)]
647pub struct AgentStopOpts {
648 #[builder(setter(into, strip_option), default)]
650 pub kill: Option<bool>,
651}
652impl IntoID<Id> for Agent {
653 fn into_id(
654 self,
655 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
656 Box::pin(async move { self.id().await })
657 }
658}
659impl Loadable for Agent {
660 fn graphql_type() -> &'static str {
661 "Agent"
662 }
663 fn from_query(
664 proc: Option<Arc<DaggerSessionProc>>,
665 selection: Selection,
666 graphql_client: DynGraphQLClient,
667 ) -> Self {
668 Self {
669 proc,
670 selection,
671 graphql_client,
672 }
673 }
674}
675impl Agent {
676 pub async fn id(&self) -> Result<Id, DaggerError> {
678 let query = self.selection.select("id");
679 query.execute(self.graphql_client.clone()).await
680 }
681 pub async fn name(&self) -> Result<String, DaggerError> {
683 let query = self.selection.select("name");
684 query.execute(self.graphql_client.clone()).await
685 }
686 pub async fn handle(&self) -> Result<String, DaggerError> {
689 let query = self.selection.select("handle");
690 query.execute(self.graphql_client.clone()).await
691 }
692 pub async fn state(&self) -> Result<AgentState, DaggerError> {
695 let query = self.selection.select("state");
696 query.execute(self.graphql_client.clone()).await
697 }
698 pub async fn error(&self) -> Result<String, DaggerError> {
701 let query = self.selection.select("error");
702 query.execute(self.graphql_client.clone()).await
703 }
704 pub fn seed(&self) -> Llm {
708 let query = self.selection.select("seed");
709 Llm {
710 proc: self.proc.clone(),
711 selection: query,
712 graphql_client: self.graphql_client.clone(),
713 }
714 }
715 pub fn snapshot(&self) -> Llm {
719 let query = self.selection.select("snapshot");
720 Llm {
721 proc: self.proc.clone(),
722 selection: query,
723 graphql_client: self.graphql_client.clone(),
724 }
725 }
726 pub async fn send(&self, message: impl Into<String>) -> Result<AgentMessage, DaggerError> {
736 let mut query = self.selection.select("send");
737 query = query.arg("message", message.into());
738 let id: Id = query.execute(self.graphql_client.clone()).await?;
739 Ok(AgentMessage {
740 proc: self.proc.clone(),
741 selection: query
742 .root()
743 .select("node")
744 .arg("id", &id.0)
745 .inline_fragment("AgentMessage"),
746 graphql_client: self.graphql_client.clone(),
747 })
748 }
749 pub async fn send_opts<'a>(
759 &self,
760 message: impl Into<String>,
761 opts: AgentSendOpts<'a>,
762 ) -> Result<AgentMessage, DaggerError> {
763 let mut query = self.selection.select("send");
764 query = query.arg("message", message.into());
765 if let Some(reply_to) = opts.reply_to {
766 query = query.arg("replyTo", reply_to);
767 }
768 if let Some(content) = opts.content {
769 query = query.arg("content", content);
770 }
771 let id: Id = query.execute(self.graphql_client.clone()).await?;
772 Ok(AgentMessage {
773 proc: self.proc.clone(),
774 selection: query
775 .root()
776 .select("node")
777 .arg("id", &id.0)
778 .inline_fragment("AgentMessage"),
779 graphql_client: self.graphql_client.clone(),
780 })
781 }
782 pub fn message(&self, r#ref: impl Into<String>) -> AgentMessage {
790 let mut query = self.selection.select("message");
791 query = query.arg("ref", r#ref.into());
792 AgentMessage {
793 proc: self.proc.clone(),
794 selection: query,
795 graphql_client: self.graphql_client.clone(),
796 }
797 }
798 pub async fn pause(&self) -> Result<Agent, DaggerError> {
806 let query = self.selection.select("pause");
807 let id: Id = query.execute(self.graphql_client.clone()).await?;
808 Ok(Agent {
809 proc: self.proc.clone(),
810 selection: query
811 .root()
812 .select("node")
813 .arg("id", &id.0)
814 .inline_fragment("Agent"),
815 graphql_client: self.graphql_client.clone(),
816 })
817 }
818 pub async fn pause_opts(&self, opts: AgentPauseOpts) -> Result<Agent, DaggerError> {
826 let mut query = self.selection.select("pause");
827 if let Some(interrupt) = opts.interrupt {
828 query = query.arg("interrupt", interrupt);
829 }
830 let id: Id = query.execute(self.graphql_client.clone()).await?;
831 Ok(Agent {
832 proc: self.proc.clone(),
833 selection: query
834 .root()
835 .select("node")
836 .arg("id", &id.0)
837 .inline_fragment("Agent"),
838 graphql_client: self.graphql_client.clone(),
839 })
840 }
841 pub async fn resume(&self) -> Result<Agent, DaggerError> {
845 let query = self.selection.select("resume");
846 let id: Id = query.execute(self.graphql_client.clone()).await?;
847 Ok(Agent {
848 proc: self.proc.clone(),
849 selection: query
850 .root()
851 .select("node")
852 .arg("id", &id.0)
853 .inline_fragment("Agent"),
854 graphql_client: self.graphql_client.clone(),
855 })
856 }
857 pub async fn wait(&self) -> Result<Agent, DaggerError> {
860 let query = self.selection.select("wait");
861 let id: Id = query.execute(self.graphql_client.clone()).await?;
862 Ok(Agent {
863 proc: self.proc.clone(),
864 selection: query
865 .root()
866 .select("node")
867 .arg("id", &id.0)
868 .inline_fragment("Agent"),
869 graphql_client: self.graphql_client.clone(),
870 })
871 }
872 pub async fn notify(&self, subscriber: impl IntoID<Id>) -> Result<Agent, DaggerError> {
883 let mut query = self.selection.select("notify");
884 query = query.arg_lazy(
885 "subscriber",
886 Box::new(move || {
887 let subscriber = subscriber.clone();
888 Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
889 }),
890 );
891 let id: Id = query.execute(self.graphql_client.clone()).await?;
892 Ok(Agent {
893 proc: self.proc.clone(),
894 selection: query
895 .root()
896 .select("node")
897 .arg("id", &id.0)
898 .inline_fragment("Agent"),
899 graphql_client: self.graphql_client.clone(),
900 })
901 }
902 pub async fn notify_opts(
913 &self,
914 subscriber: impl IntoID<Id>,
915 opts: AgentNotifyOpts,
916 ) -> Result<Agent, DaggerError> {
917 let mut query = self.selection.select("notify");
918 query = query.arg_lazy(
919 "subscriber",
920 Box::new(move || {
921 let subscriber = subscriber.clone();
922 Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
923 }),
924 );
925 if let Some(on) = opts.on {
926 query = query.arg("on", on);
927 }
928 let id: Id = query.execute(self.graphql_client.clone()).await?;
929 Ok(Agent {
930 proc: self.proc.clone(),
931 selection: query
932 .root()
933 .select("node")
934 .arg("id", &id.0)
935 .inline_fragment("Agent"),
936 graphql_client: self.graphql_client.clone(),
937 })
938 }
939 pub async fn stop(&self) -> Result<Agent, DaggerError> {
945 let query = self.selection.select("stop");
946 let id: Id = query.execute(self.graphql_client.clone()).await?;
947 Ok(Agent {
948 proc: self.proc.clone(),
949 selection: query
950 .root()
951 .select("node")
952 .arg("id", &id.0)
953 .inline_fragment("Agent"),
954 graphql_client: self.graphql_client.clone(),
955 })
956 }
957 pub async fn stop_opts(&self, opts: AgentStopOpts) -> Result<Agent, DaggerError> {
963 let mut query = self.selection.select("stop");
964 if let Some(kill) = opts.kill {
965 query = query.arg("kill", kill);
966 }
967 let id: Id = query.execute(self.graphql_client.clone()).await?;
968 Ok(Agent {
969 proc: self.proc.clone(),
970 selection: query
971 .root()
972 .select("node")
973 .arg("id", &id.0)
974 .inline_fragment("Agent"),
975 graphql_client: self.graphql_client.clone(),
976 })
977 }
978 pub async fn reseed(&self, conversation: impl IntoID<Id>) -> Result<Agent, DaggerError> {
987 let mut query = self.selection.select("reseed");
988 query = query.arg_lazy(
989 "conversation",
990 Box::new(move || {
991 let conversation = conversation.clone();
992 Box::pin(async move { conversation.into_id().await.unwrap().quote() })
993 }),
994 );
995 let id: Id = query.execute(self.graphql_client.clone()).await?;
996 Ok(Agent {
997 proc: self.proc.clone(),
998 selection: query
999 .root()
1000 .select("node")
1001 .arg("id", &id.0)
1002 .inline_fragment("Agent"),
1003 graphql_client: self.graphql_client.clone(),
1004 })
1005 }
1006}
1007impl Node for Agent {
1008 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1009 let query = self.selection.select("id");
1010 let graphql_client = self.graphql_client.clone();
1011 async move { query.execute(graphql_client).await }
1012 }
1013}
1014#[derive(Clone)]
1015pub struct AgentMessage {
1016 pub proc: Option<Arc<DaggerSessionProc>>,
1017 pub selection: Selection,
1018 pub graphql_client: DynGraphQLClient,
1019}
1020impl IntoID<Id> for AgentMessage {
1021 fn into_id(
1022 self,
1023 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1024 Box::pin(async move { self.id().await })
1025 }
1026}
1027impl Loadable for AgentMessage {
1028 fn graphql_type() -> &'static str {
1029 "AgentMessage"
1030 }
1031 fn from_query(
1032 proc: Option<Arc<DaggerSessionProc>>,
1033 selection: Selection,
1034 graphql_client: DynGraphQLClient,
1035 ) -> Self {
1036 Self {
1037 proc,
1038 selection,
1039 graphql_client,
1040 }
1041 }
1042}
1043impl AgentMessage {
1044 pub async fn id(&self) -> Result<Id, DaggerError> {
1046 let query = self.selection.select("id");
1047 query.execute(self.graphql_client.clone()).await
1048 }
1049 pub async fn delivery(&self) -> Result<AgentMessageDelivery, DaggerError> {
1052 let query = self.selection.select("delivery");
1053 query.execute(self.graphql_client.clone()).await
1054 }
1055 pub async fn r#ref(&self) -> Result<String, DaggerError> {
1058 let query = self.selection.select("ref");
1059 query.execute(self.graphql_client.clone()).await
1060 }
1061 pub async fn response(&self) -> Result<String, DaggerError> {
1066 let query = self.selection.select("response");
1067 query.execute(self.graphql_client.clone()).await
1068 }
1069}
1070impl Node for AgentMessage {
1071 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1072 let query = self.selection.select("id");
1073 let graphql_client = self.graphql_client.clone();
1074 async move { query.execute(graphql_client).await }
1075 }
1076}
1077#[derive(Clone)]
1078pub struct Artifact {
1079 pub proc: Option<Arc<DaggerSessionProc>>,
1080 pub selection: Selection,
1081 pub graphql_client: DynGraphQLClient,
1082}
1083#[derive(Builder, Debug, PartialEq)]
1084pub struct ArtifactUriOpts {
1085 #[builder(setter(into, strip_option), default)]
1087 pub absolute: Option<bool>,
1088 #[builder(setter(into, strip_option), default)]
1090 pub dimension_keys: Option<bool>,
1091 #[builder(setter(into, strip_option), default)]
1093 pub type_assertion: Option<bool>,
1094}
1095impl IntoID<Id> for Artifact {
1096 fn into_id(
1097 self,
1098 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1099 Box::pin(async move { self.id().await })
1100 }
1101}
1102impl Loadable for Artifact {
1103 fn graphql_type() -> &'static str {
1104 "Artifact"
1105 }
1106 fn from_query(
1107 proc: Option<Arc<DaggerSessionProc>>,
1108 selection: Selection,
1109 graphql_client: DynGraphQLClient,
1110 ) -> Self {
1111 Self {
1112 proc,
1113 selection,
1114 graphql_client,
1115 }
1116 }
1117}
1118impl Artifact {
1119 pub async fn id(&self) -> Result<Id, DaggerError> {
1121 let query = self.selection.select("id");
1122 query.execute(self.graphql_client.clone()).await
1123 }
1124 pub async fn load_error(&self) -> Result<String, DaggerError> {
1126 let query = self.selection.select("loadError");
1127 query.execute(self.graphql_client.clone()).await
1128 }
1129 pub async fn arguments(&self) -> Result<Vec<FunctionArg>, DaggerError> {
1131 let query = self.selection.select("arguments");
1132 let query = query.select("id");
1133 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1134 Ok(ids
1135 .into_iter()
1136 .map(|id| FunctionArg {
1137 proc: self.proc.clone(),
1138 selection: crate::querybuilder::query()
1139 .select("node")
1140 .arg("id", &id.0)
1141 .inline_fragment("FunctionArg"),
1142 graphql_client: self.graphql_client.clone(),
1143 })
1144 .collect())
1145 }
1146 pub async fn description(&self) -> Result<String, DaggerError> {
1148 let query = self.selection.select("description");
1149 query.execute(self.graphql_client.clone()).await
1150 }
1151 pub async fn uri(&self) -> Result<String, DaggerError> {
1157 let query = self.selection.select("uri");
1158 query.execute(self.graphql_client.clone()).await
1159 }
1160 pub async fn uri_opts(&self, opts: ArtifactUriOpts) -> Result<String, DaggerError> {
1166 let mut query = self.selection.select("uri");
1167 if let Some(absolute) = opts.absolute {
1168 query = query.arg("absolute", absolute);
1169 }
1170 if let Some(dimension_keys) = opts.dimension_keys {
1171 query = query.arg("dimensionKeys", dimension_keys);
1172 }
1173 if let Some(type_assertion) = opts.type_assertion {
1174 query = query.arg("typeAssertion", type_assertion);
1175 }
1176 query.execute(self.graphql_client.clone()).await
1177 }
1178 pub async fn module_name(&self) -> Result<String, DaggerError> {
1180 let query = self.selection.select("moduleName");
1181 query.execute(self.graphql_client.clone()).await
1182 }
1183 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1185 let query = self.selection.select("path");
1186 query.execute(self.graphql_client.clone()).await
1187 }
1188 pub async fn dimension_keys(&self) -> Result<Vec<ArtifactDimensionKey>, DaggerError> {
1190 let query = self.selection.select("dimensionKeys");
1191 let query = query.select("id");
1192 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1193 Ok(ids
1194 .into_iter()
1195 .map(|id| ArtifactDimensionKey {
1196 proc: self.proc.clone(),
1197 selection: crate::querybuilder::query()
1198 .select("node")
1199 .arg("id", &id.0)
1200 .inline_fragment("ArtifactDimensionKey"),
1201 graphql_client: self.graphql_client.clone(),
1202 })
1203 .collect())
1204 }
1205 pub async fn directives(&self) -> Result<Vec<String>, DaggerError> {
1207 let query = self.selection.select("directives");
1208 query.execute(self.graphql_client.clone()).await
1209 }
1210 pub fn value(&self, arguments: Json) -> NodeClient {
1216 let mut query = self.selection.select("value");
1217 query = query.arg("arguments", arguments);
1218 NodeClient {
1219 proc: self.proc.clone(),
1220 selection: query,
1221 graphql_client: self.graphql_client.clone(),
1222 }
1223 }
1224}
1225impl Node for Artifact {
1226 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1227 let query = self.selection.select("id");
1228 let graphql_client = self.graphql_client.clone();
1229 async move { query.execute(graphql_client).await }
1230 }
1231}
1232#[derive(Clone)]
1233pub struct ArtifactDimension {
1234 pub proc: Option<Arc<DaggerSessionProc>>,
1235 pub selection: Selection,
1236 pub graphql_client: DynGraphQLClient,
1237}
1238impl IntoID<Id> for ArtifactDimension {
1239 fn into_id(
1240 self,
1241 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1242 Box::pin(async move { self.id().await })
1243 }
1244}
1245impl Loadable for ArtifactDimension {
1246 fn graphql_type() -> &'static str {
1247 "ArtifactDimension"
1248 }
1249 fn from_query(
1250 proc: Option<Arc<DaggerSessionProc>>,
1251 selection: Selection,
1252 graphql_client: DynGraphQLClient,
1253 ) -> Self {
1254 Self {
1255 proc,
1256 selection,
1257 graphql_client,
1258 }
1259 }
1260}
1261impl ArtifactDimension {
1262 pub async fn id(&self) -> Result<Id, DaggerError> {
1264 let query = self.selection.select("id");
1265 query.execute(self.graphql_client.clone()).await
1266 }
1267 pub async fn kind(&self) -> Result<ArtifactDimensionKind, DaggerError> {
1269 let query = self.selection.select("kind");
1270 query.execute(self.graphql_client.clone()).await
1271 }
1272 pub async fn collection_type(&self) -> Result<String, DaggerError> {
1274 let query = self.selection.select("collectionType");
1275 query.execute(self.graphql_client.clone()).await
1276 }
1277 pub async fn identifier(&self) -> Result<String, DaggerError> {
1279 let query = self.selection.select("identifier");
1280 query.execute(self.graphql_client.clone()).await
1281 }
1282 pub async fn name(&self) -> Result<String, DaggerError> {
1284 let query = self.selection.select("name");
1285 query.execute(self.graphql_client.clone()).await
1286 }
1287 pub async fn qualified_name(&self) -> Result<String, DaggerError> {
1289 let query = self.selection.select("qualifiedName");
1290 query.execute(self.graphql_client.clone()).await
1291 }
1292 pub async fn item_type(&self) -> Result<String, DaggerError> {
1294 let query = self.selection.select("itemType");
1295 query.execute(self.graphql_client.clone()).await
1296 }
1297 pub async fn key_name(&self) -> Result<String, DaggerError> {
1299 let query = self.selection.select("keyName");
1300 query.execute(self.graphql_client.clone()).await
1301 }
1302 pub async fn key_description(&self) -> Result<String, DaggerError> {
1304 let query = self.selection.select("keyDescription");
1305 query.execute(self.graphql_client.clone()).await
1306 }
1307}
1308impl Node for ArtifactDimension {
1309 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1310 let query = self.selection.select("id");
1311 let graphql_client = self.graphql_client.clone();
1312 async move { query.execute(graphql_client).await }
1313 }
1314}
1315#[derive(Clone)]
1316pub struct ArtifactDimensionKey {
1317 pub proc: Option<Arc<DaggerSessionProc>>,
1318 pub selection: Selection,
1319 pub graphql_client: DynGraphQLClient,
1320}
1321impl IntoID<Id> for ArtifactDimensionKey {
1322 fn into_id(
1323 self,
1324 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1325 Box::pin(async move { self.id().await })
1326 }
1327}
1328impl Loadable for ArtifactDimensionKey {
1329 fn graphql_type() -> &'static str {
1330 "ArtifactDimensionKey"
1331 }
1332 fn from_query(
1333 proc: Option<Arc<DaggerSessionProc>>,
1334 selection: Selection,
1335 graphql_client: DynGraphQLClient,
1336 ) -> Self {
1337 Self {
1338 proc,
1339 selection,
1340 graphql_client,
1341 }
1342 }
1343}
1344impl ArtifactDimensionKey {
1345 pub async fn id(&self) -> Result<Id, DaggerError> {
1347 let query = self.selection.select("id");
1348 query.execute(self.graphql_client.clone()).await
1349 }
1350 pub async fn dimension(&self) -> Result<String, DaggerError> {
1352 let query = self.selection.select("dimension");
1353 query.execute(self.graphql_client.clone()).await
1354 }
1355 pub async fn key(&self) -> Result<String, DaggerError> {
1357 let query = self.selection.select("key");
1358 query.execute(self.graphql_client.clone()).await
1359 }
1360}
1361impl Node for ArtifactDimensionKey {
1362 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1363 let query = self.selection.select("id");
1364 let graphql_client = self.graphql_client.clone();
1365 async move { query.execute(graphql_client).await }
1366 }
1367}
1368#[derive(Clone)]
1369pub struct ArtifactPath {
1370 pub proc: Option<Arc<DaggerSessionProc>>,
1371 pub selection: Selection,
1372 pub graphql_client: DynGraphQLClient,
1373}
1374impl IntoID<Id> for ArtifactPath {
1375 fn into_id(
1376 self,
1377 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1378 Box::pin(async move { self.id().await })
1379 }
1380}
1381impl Loadable for ArtifactPath {
1382 fn graphql_type() -> &'static str {
1383 "ArtifactPath"
1384 }
1385 fn from_query(
1386 proc: Option<Arc<DaggerSessionProc>>,
1387 selection: Selection,
1388 graphql_client: DynGraphQLClient,
1389 ) -> Self {
1390 Self {
1391 proc,
1392 selection,
1393 graphql_client,
1394 }
1395 }
1396}
1397impl ArtifactPath {
1398 pub async fn id(&self) -> Result<Id, DaggerError> {
1400 let query = self.selection.select("id");
1401 query.execute(self.graphql_client.clone()).await
1402 }
1403 pub async fn module_name(&self) -> Result<String, DaggerError> {
1405 let query = self.selection.select("moduleName");
1406 query.execute(self.graphql_client.clone()).await
1407 }
1408 pub async fn uri(&self) -> Result<String, DaggerError> {
1410 let query = self.selection.select("uri");
1411 query.execute(self.graphql_client.clone()).await
1412 }
1413 pub async fn description(&self) -> Result<String, DaggerError> {
1415 let query = self.selection.select("description");
1416 query.execute(self.graphql_client.clone()).await
1417 }
1418 pub async fn load_error(&self) -> Result<String, DaggerError> {
1420 let query = self.selection.select("loadError");
1421 query.execute(self.graphql_client.clone()).await
1422 }
1423 pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
1425 let query = self.selection.select("dimensions");
1426 query.execute(self.graphql_client.clone()).await
1427 }
1428}
1429impl Node for ArtifactPath {
1430 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1431 let query = self.selection.select("id");
1432 let graphql_client = self.graphql_client.clone();
1433 async move { query.execute(graphql_client).await }
1434 }
1435}
1436#[derive(Clone)]
1437pub struct ArtifactResult {
1438 pub proc: Option<Arc<DaggerSessionProc>>,
1439 pub selection: Selection,
1440 pub graphql_client: DynGraphQLClient,
1441}
1442impl IntoID<Id> for ArtifactResult {
1443 fn into_id(
1444 self,
1445 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1446 Box::pin(async move { self.id().await })
1447 }
1448}
1449impl Loadable for ArtifactResult {
1450 fn graphql_type() -> &'static str {
1451 "ArtifactResult"
1452 }
1453 fn from_query(
1454 proc: Option<Arc<DaggerSessionProc>>,
1455 selection: Selection,
1456 graphql_client: DynGraphQLClient,
1457 ) -> Self {
1458 Self {
1459 proc,
1460 selection,
1461 graphql_client,
1462 }
1463 }
1464}
1465impl ArtifactResult {
1466 pub async fn id(&self) -> Result<Id, DaggerError> {
1468 let query = self.selection.select("id");
1469 query.execute(self.graphql_client.clone()).await
1470 }
1471 pub fn artifact(&self) -> Artifact {
1473 let query = self.selection.select("artifact");
1474 Artifact {
1475 proc: self.proc.clone(),
1476 selection: query,
1477 graphql_client: self.graphql_client.clone(),
1478 }
1479 }
1480 pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1482 let query = self.selection.select("error");
1483 let query = query.select("id");
1484 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1485 Ok(id.map(|id| Error {
1486 proc: self.proc.clone(),
1487 selection: query
1488 .root()
1489 .select("node")
1490 .arg("id", &id.0)
1491 .inline_fragment("Error"),
1492 graphql_client: self.graphql_client.clone(),
1493 }))
1494 }
1495 pub async fn value(&self) -> Result<Option<NodeClient>, DaggerError> {
1497 let query = self.selection.select("value");
1498 let query = query.select("id");
1499 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1500 Ok(id.map(|id| NodeClient {
1501 proc: self.proc.clone(),
1502 selection: query
1503 .root()
1504 .select("node")
1505 .arg("id", &id.0)
1506 .inline_fragment("Node"),
1507 graphql_client: self.graphql_client.clone(),
1508 }))
1509 }
1510}
1511impl Node for ArtifactResult {
1512 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1513 let query = self.selection.select("id");
1514 let graphql_client = self.graphql_client.clone();
1515 async move { query.execute(graphql_client).await }
1516 }
1517}
1518#[derive(Clone)]
1519pub struct Artifacts {
1520 pub proc: Option<Arc<DaggerSessionProc>>,
1521 pub selection: Selection,
1522 pub graphql_client: DynGraphQLClient,
1523}
1524#[derive(Builder, Debug, PartialEq)]
1525pub struct ArtifactsPathDefinitionsOpts<'a> {
1526 #[builder(setter(into, strip_option), default)]
1528 pub absolute: Option<bool>,
1529 #[builder(setter(into, strip_option), default)]
1531 pub dimension: Option<&'a str>,
1532 #[builder(setter(into, strip_option), default)]
1534 pub type_assertion: Option<bool>,
1535}
1536#[derive(Builder, Debug, PartialEq)]
1537pub struct ArtifactsValuesOpts {
1538 #[builder(setter(into, strip_option), default)]
1540 pub arguments: Option<Json>,
1541 #[builder(setter(into, strip_option), default)]
1543 pub fail_fast: Option<bool>,
1544 #[builder(setter(into, strip_option), default)]
1546 pub max_concurrency: Option<isize>,
1547}
1548#[derive(Builder, Debug, PartialEq)]
1549pub struct ArtifactsFilterDirectivesOpts {
1550 #[builder(setter(into, strip_option), default)]
1552 pub exclude: Option<bool>,
1553}
1554#[derive(Builder, Debug, PartialEq)]
1555pub struct ArtifactsFilterParentTypesOpts {
1556 #[builder(setter(into, strip_option), default)]
1558 pub exclude: Option<bool>,
1559}
1560#[derive(Builder, Debug, PartialEq)]
1561pub struct ArtifactsFilterParentDirectivesOpts {
1562 #[builder(setter(into, strip_option), default)]
1564 pub exclude: Option<bool>,
1565}
1566#[derive(Builder, Debug, PartialEq)]
1567pub struct ArtifactsFilterTypesOpts {
1568 #[builder(setter(into, strip_option), default)]
1570 pub exclude: Option<bool>,
1571}
1572impl IntoID<Id> for Artifacts {
1573 fn into_id(
1574 self,
1575 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1576 Box::pin(async move { self.id().await })
1577 }
1578}
1579impl Loadable for Artifacts {
1580 fn graphql_type() -> &'static str {
1581 "Artifacts"
1582 }
1583 fn from_query(
1584 proc: Option<Arc<DaggerSessionProc>>,
1585 selection: Selection,
1586 graphql_client: DynGraphQLClient,
1587 ) -> Self {
1588 Self {
1589 proc,
1590 selection,
1591 graphql_client,
1592 }
1593 }
1594}
1595impl Artifacts {
1596 pub async fn id(&self) -> Result<Id, DaggerError> {
1598 let query = self.selection.select("id");
1599 query.execute(self.graphql_client.clone()).await
1600 }
1601 pub async fn as_expertise(&self) -> Result<Vec<Expertise>, DaggerError> {
1603 let query = self.selection.select("asExpertise");
1604 let query = query.select("id");
1605 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1606 Ok(ids
1607 .into_iter()
1608 .map(|id| Expertise {
1609 proc: self.proc.clone(),
1610 selection: crate::querybuilder::query()
1611 .select("node")
1612 .arg("id", &id.0)
1613 .inline_fragment("Expertise"),
1614 graphql_client: self.graphql_client.clone(),
1615 })
1616 .collect())
1617 }
1618 pub async fn as_generators(&self) -> Result<Vec<Generator>, DaggerError> {
1620 let query = self.selection.select("asGenerators");
1621 let query = query.select("id");
1622 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1623 Ok(ids
1624 .into_iter()
1625 .map(|id| Generator {
1626 proc: self.proc.clone(),
1627 selection: crate::querybuilder::query()
1628 .select("node")
1629 .arg("id", &id.0)
1630 .inline_fragment("Generator"),
1631 graphql_client: self.graphql_client.clone(),
1632 })
1633 .collect())
1634 }
1635 pub async fn as_checks(&self) -> Result<Vec<Check>, DaggerError> {
1637 let query = self.selection.select("asChecks");
1638 let query = query.select("id");
1639 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1640 Ok(ids
1641 .into_iter()
1642 .map(|id| Check {
1643 proc: self.proc.clone(),
1644 selection: crate::querybuilder::query()
1645 .select("node")
1646 .arg("id", &id.0)
1647 .inline_fragment("Check"),
1648 graphql_client: self.graphql_client.clone(),
1649 })
1650 .collect())
1651 }
1652 pub async fn as_changesets(&self) -> Result<Vec<Changeset>, DaggerError> {
1654 let query = self.selection.select("asChangesets");
1655 let query = query.select("id");
1656 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1657 Ok(ids
1658 .into_iter()
1659 .map(|id| Changeset {
1660 proc: self.proc.clone(),
1661 selection: crate::querybuilder::query()
1662 .select("node")
1663 .arg("id", &id.0)
1664 .inline_fragment("Changeset"),
1665 graphql_client: self.graphql_client.clone(),
1666 })
1667 .collect())
1668 }
1669 pub async fn as_services(&self) -> Result<Vec<Service>, DaggerError> {
1671 let query = self.selection.select("asServices");
1672 let query = query.select("id");
1673 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1674 Ok(ids
1675 .into_iter()
1676 .map(|id| Service {
1677 proc: self.proc.clone(),
1678 selection: crate::querybuilder::query()
1679 .select("node")
1680 .arg("id", &id.0)
1681 .inline_fragment("Service"),
1682 graphql_client: self.graphql_client.clone(),
1683 })
1684 .collect())
1685 }
1686 pub async fn path_definitions(&self) -> Result<Vec<ArtifactPath>, DaggerError> {
1692 let query = self.selection.select("pathDefinitions");
1693 let query = query.select("id");
1694 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1695 Ok(ids
1696 .into_iter()
1697 .map(|id| ArtifactPath {
1698 proc: self.proc.clone(),
1699 selection: crate::querybuilder::query()
1700 .select("node")
1701 .arg("id", &id.0)
1702 .inline_fragment("ArtifactPath"),
1703 graphql_client: self.graphql_client.clone(),
1704 })
1705 .collect())
1706 }
1707 pub async fn path_definitions_opts<'a>(
1713 &self,
1714 opts: ArtifactsPathDefinitionsOpts<'a>,
1715 ) -> Result<Vec<ArtifactPath>, DaggerError> {
1716 let mut query = self.selection.select("pathDefinitions");
1717 if let Some(absolute) = opts.absolute {
1718 query = query.arg("absolute", absolute);
1719 }
1720 if let Some(type_assertion) = opts.type_assertion {
1721 query = query.arg("typeAssertion", type_assertion);
1722 }
1723 if let Some(dimension) = opts.dimension {
1724 query = query.arg("dimension", dimension);
1725 }
1726 let query = query.select("id");
1727 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1728 Ok(ids
1729 .into_iter()
1730 .map(|id| ArtifactPath {
1731 proc: self.proc.clone(),
1732 selection: crate::querybuilder::query()
1733 .select("node")
1734 .arg("id", &id.0)
1735 .inline_fragment("ArtifactPath"),
1736 graphql_client: self.graphql_client.clone(),
1737 })
1738 .collect())
1739 }
1740 pub async fn dimension_definitions(&self) -> Result<Vec<ArtifactDimension>, DaggerError> {
1742 let query = self.selection.select("dimensionDefinitions");
1743 let query = query.select("id");
1744 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1745 Ok(ids
1746 .into_iter()
1747 .map(|id| ArtifactDimension {
1748 proc: self.proc.clone(),
1749 selection: crate::querybuilder::query()
1750 .select("node")
1751 .arg("id", &id.0)
1752 .inline_fragment("ArtifactDimension"),
1753 graphql_client: self.graphql_client.clone(),
1754 })
1755 .collect())
1756 }
1757 pub async fn values(&self) -> Result<Vec<ArtifactResult>, DaggerError> {
1763 let query = self.selection.select("values");
1764 let query = query.select("id");
1765 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1766 Ok(ids
1767 .into_iter()
1768 .map(|id| ArtifactResult {
1769 proc: self.proc.clone(),
1770 selection: crate::querybuilder::query()
1771 .select("node")
1772 .arg("id", &id.0)
1773 .inline_fragment("ArtifactResult"),
1774 graphql_client: self.graphql_client.clone(),
1775 })
1776 .collect())
1777 }
1778 pub async fn values_opts(
1784 &self,
1785 opts: ArtifactsValuesOpts,
1786 ) -> Result<Vec<ArtifactResult>, DaggerError> {
1787 let mut query = self.selection.select("values");
1788 if let Some(fail_fast) = opts.fail_fast {
1789 query = query.arg("failFast", fail_fast);
1790 }
1791 if let Some(arguments) = opts.arguments {
1792 query = query.arg("arguments", arguments);
1793 }
1794 if let Some(max_concurrency) = opts.max_concurrency {
1795 query = query.arg("maxConcurrency", max_concurrency);
1796 }
1797 let query = query.select("id");
1798 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1799 Ok(ids
1800 .into_iter()
1801 .map(|id| ArtifactResult {
1802 proc: self.proc.clone(),
1803 selection: crate::querybuilder::query()
1804 .select("node")
1805 .arg("id", &id.0)
1806 .inline_fragment("ArtifactResult"),
1807 graphql_client: self.graphql_client.clone(),
1808 })
1809 .collect())
1810 }
1811 pub async fn modules(&self) -> Result<Vec<Module>, DaggerError> {
1813 let query = self.selection.select("modules");
1814 let query = query.select("id");
1815 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1816 Ok(ids
1817 .into_iter()
1818 .map(|id| Module {
1819 proc: self.proc.clone(),
1820 selection: crate::querybuilder::query()
1821 .select("node")
1822 .arg("id", &id.0)
1823 .inline_fragment("Module"),
1824 graphql_client: self.graphql_client.clone(),
1825 })
1826 .collect())
1827 }
1828 pub async fn types(&self) -> Result<Vec<TypeDef>, DaggerError> {
1830 let query = self.selection.select("types");
1831 let query = query.select("id");
1832 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1833 Ok(ids
1834 .into_iter()
1835 .map(|id| TypeDef {
1836 proc: self.proc.clone(),
1837 selection: crate::querybuilder::query()
1838 .select("node")
1839 .arg("id", &id.0)
1840 .inline_fragment("TypeDef"),
1841 graphql_client: self.graphql_client.clone(),
1842 })
1843 .collect())
1844 }
1845 pub fn filter_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1851 let mut query = self.selection.select("filterDirectives");
1852 query = query.arg(
1853 "directives",
1854 directives
1855 .into_iter()
1856 .map(|i| i.into())
1857 .collect::<Vec<String>>(),
1858 );
1859 Artifacts {
1860 proc: self.proc.clone(),
1861 selection: query,
1862 graphql_client: self.graphql_client.clone(),
1863 }
1864 }
1865 pub fn filter_directives_opts(
1871 &self,
1872 directives: Vec<impl Into<String>>,
1873 opts: ArtifactsFilterDirectivesOpts,
1874 ) -> Artifacts {
1875 let mut query = self.selection.select("filterDirectives");
1876 query = query.arg(
1877 "directives",
1878 directives
1879 .into_iter()
1880 .map(|i| i.into())
1881 .collect::<Vec<String>>(),
1882 );
1883 if let Some(exclude) = opts.exclude {
1884 query = query.arg("exclude", exclude);
1885 }
1886 Artifacts {
1887 proc: self.proc.clone(),
1888 selection: query,
1889 graphql_client: self.graphql_client.clone(),
1890 }
1891 }
1892 pub fn filter_parent_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
1898 let mut query = self.selection.select("filterParentTypes");
1899 query = query.arg(
1900 "types",
1901 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1902 );
1903 Artifacts {
1904 proc: self.proc.clone(),
1905 selection: query,
1906 graphql_client: self.graphql_client.clone(),
1907 }
1908 }
1909 pub fn filter_parent_types_opts(
1915 &self,
1916 types: Vec<impl Into<String>>,
1917 opts: ArtifactsFilterParentTypesOpts,
1918 ) -> Artifacts {
1919 let mut query = self.selection.select("filterParentTypes");
1920 query = query.arg(
1921 "types",
1922 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1923 );
1924 if let Some(exclude) = opts.exclude {
1925 query = query.arg("exclude", exclude);
1926 }
1927 Artifacts {
1928 proc: self.proc.clone(),
1929 selection: query,
1930 graphql_client: self.graphql_client.clone(),
1931 }
1932 }
1933 pub fn filter_parent_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1939 let mut query = self.selection.select("filterParentDirectives");
1940 query = query.arg(
1941 "directives",
1942 directives
1943 .into_iter()
1944 .map(|i| i.into())
1945 .collect::<Vec<String>>(),
1946 );
1947 Artifacts {
1948 proc: self.proc.clone(),
1949 selection: query,
1950 graphql_client: self.graphql_client.clone(),
1951 }
1952 }
1953 pub fn filter_parent_directives_opts(
1959 &self,
1960 directives: Vec<impl Into<String>>,
1961 opts: ArtifactsFilterParentDirectivesOpts,
1962 ) -> Artifacts {
1963 let mut query = self.selection.select("filterParentDirectives");
1964 query = query.arg(
1965 "directives",
1966 directives
1967 .into_iter()
1968 .map(|i| i.into())
1969 .collect::<Vec<String>>(),
1970 );
1971 if let Some(exclude) = opts.exclude {
1972 query = query.arg("exclude", exclude);
1973 }
1974 Artifacts {
1975 proc: self.proc.clone(),
1976 selection: query,
1977 graphql_client: self.graphql_client.clone(),
1978 }
1979 }
1980 pub fn with_artifacts(&self, artifacts: impl IntoID<Id>) -> Artifacts {
1982 let mut query = self.selection.select("withArtifacts");
1983 query = query.arg_lazy(
1984 "artifacts",
1985 Box::new(move || {
1986 let artifacts = artifacts.clone();
1987 Box::pin(async move { artifacts.into_id().await.unwrap().quote() })
1988 }),
1989 );
1990 Artifacts {
1991 proc: self.proc.clone(),
1992 selection: query,
1993 graphql_client: self.graphql_client.clone(),
1994 }
1995 }
1996 pub fn without_uri(&self, uri: impl Into<String>) -> Artifacts {
1998 let mut query = self.selection.select("withoutUri");
1999 query = query.arg("uri", uri.into());
2000 Artifacts {
2001 proc: self.proc.clone(),
2002 selection: query,
2003 graphql_client: self.graphql_client.clone(),
2004 }
2005 }
2006 pub fn filter_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
2012 let mut query = self.selection.select("filterTypes");
2013 query = query.arg(
2014 "types",
2015 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2016 );
2017 Artifacts {
2018 proc: self.proc.clone(),
2019 selection: query,
2020 graphql_client: self.graphql_client.clone(),
2021 }
2022 }
2023 pub fn filter_types_opts(
2029 &self,
2030 types: Vec<impl Into<String>>,
2031 opts: ArtifactsFilterTypesOpts,
2032 ) -> Artifacts {
2033 let mut query = self.selection.select("filterTypes");
2034 query = query.arg(
2035 "types",
2036 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2037 );
2038 if let Some(exclude) = opts.exclude {
2039 query = query.arg("exclude", exclude);
2040 }
2041 Artifacts {
2042 proc: self.proc.clone(),
2043 selection: query,
2044 graphql_client: self.graphql_client.clone(),
2045 }
2046 }
2047 pub fn filter_path(&self, path: Vec<impl Into<String>>) -> Artifacts {
2049 let mut query = self.selection.select("filterPath");
2050 query = query.arg(
2051 "path",
2052 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2053 );
2054 Artifacts {
2055 proc: self.proc.clone(),
2056 selection: query,
2057 graphql_client: self.graphql_client.clone(),
2058 }
2059 }
2060 pub fn filter_path_pattern(&self, pattern: impl Into<String>) -> Artifacts {
2062 let mut query = self.selection.select("filterPathPattern");
2063 query = query.arg("pattern", pattern.into());
2064 Artifacts {
2065 proc: self.proc.clone(),
2066 selection: query,
2067 graphql_client: self.graphql_client.clone(),
2068 }
2069 }
2070 pub fn filter_dimensions(&self, dimensions: Vec<impl Into<String>>) -> Artifacts {
2072 let mut query = self.selection.select("filterDimensions");
2073 query = query.arg(
2074 "dimensions",
2075 dimensions
2076 .into_iter()
2077 .map(|i| i.into())
2078 .collect::<Vec<String>>(),
2079 );
2080 Artifacts {
2081 proc: self.proc.clone(),
2082 selection: query,
2083 graphql_client: self.graphql_client.clone(),
2084 }
2085 }
2086 pub fn filter_dimension_keys(
2088 &self,
2089 dimension: impl Into<String>,
2090 keys: Vec<impl Into<String>>,
2091 ) -> Artifacts {
2092 let mut query = self.selection.select("filterDimensionKeys");
2093 query = query.arg("dimension", dimension.into());
2094 query = query.arg(
2095 "keys",
2096 keys.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2097 );
2098 Artifacts {
2099 proc: self.proc.clone(),
2100 selection: query,
2101 graphql_client: self.graphql_client.clone(),
2102 }
2103 }
2104 pub fn filter_uri(&self, uri: impl Into<String>) -> Artifacts {
2111 let mut query = self.selection.select("filterUri");
2112 query = query.arg("uri", uri.into());
2113 Artifacts {
2114 proc: self.proc.clone(),
2115 selection: query,
2116 graphql_client: self.graphql_client.clone(),
2117 }
2118 }
2119 pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
2121 let query = self.selection.select("dimensions");
2122 query.execute(self.graphql_client.clone()).await
2123 }
2124 pub async fn dimension_keys(
2126 &self,
2127 dimension: impl Into<String>,
2128 ) -> Result<Vec<String>, DaggerError> {
2129 let mut query = self.selection.select("dimensionKeys");
2130 query = query.arg("dimension", dimension.into());
2131 query.execute(self.graphql_client.clone()).await
2132 }
2133 pub async fn dimension_items(
2135 &self,
2136 dimension: impl Into<String>,
2137 ) -> Result<Vec<Artifact>, DaggerError> {
2138 let mut query = self.selection.select("dimensionItems");
2139 query = query.arg("dimension", dimension.into());
2140 let query = query.select("id");
2141 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2142 Ok(ids
2143 .into_iter()
2144 .map(|id| Artifact {
2145 proc: self.proc.clone(),
2146 selection: crate::querybuilder::query()
2147 .select("node")
2148 .arg("id", &id.0)
2149 .inline_fragment("Artifact"),
2150 graphql_client: self.graphql_client.clone(),
2151 })
2152 .collect())
2153 }
2154 pub async fn items(&self) -> Result<Vec<Artifact>, DaggerError> {
2156 let query = self.selection.select("items");
2157 let query = query.select("id");
2158 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2159 Ok(ids
2160 .into_iter()
2161 .map(|id| Artifact {
2162 proc: self.proc.clone(),
2163 selection: crate::querybuilder::query()
2164 .select("node")
2165 .arg("id", &id.0)
2166 .inline_fragment("Artifact"),
2167 graphql_client: self.graphql_client.clone(),
2168 })
2169 .collect())
2170 }
2171 pub fn one(&self) -> Artifact {
2173 let query = self.selection.select("one");
2174 Artifact {
2175 proc: self.proc.clone(),
2176 selection: query,
2177 graphql_client: self.graphql_client.clone(),
2178 }
2179 }
2180 pub async fn uri(&self) -> Result<String, DaggerError> {
2182 let query = self.selection.select("uri");
2183 query.execute(self.graphql_client.clone()).await
2184 }
2185}
2186impl Node for Artifacts {
2187 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2188 let query = self.selection.select("id");
2189 let graphql_client = self.graphql_client.clone();
2190 async move { query.execute(graphql_client).await }
2191 }
2192}
2193#[derive(Clone)]
2194pub struct CacheVolume {
2195 pub proc: Option<Arc<DaggerSessionProc>>,
2196 pub selection: Selection,
2197 pub graphql_client: DynGraphQLClient,
2198}
2199impl IntoID<Id> for CacheVolume {
2200 fn into_id(
2201 self,
2202 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2203 Box::pin(async move { self.id().await })
2204 }
2205}
2206impl Loadable for CacheVolume {
2207 fn graphql_type() -> &'static str {
2208 "CacheVolume"
2209 }
2210 fn from_query(
2211 proc: Option<Arc<DaggerSessionProc>>,
2212 selection: Selection,
2213 graphql_client: DynGraphQLClient,
2214 ) -> Self {
2215 Self {
2216 proc,
2217 selection,
2218 graphql_client,
2219 }
2220 }
2221}
2222impl CacheVolume {
2223 pub async fn id(&self) -> Result<Id, DaggerError> {
2225 let query = self.selection.select("id");
2226 query.execute(self.graphql_client.clone()).await
2227 }
2228}
2229impl Node for CacheVolume {
2230 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2231 let query = self.selection.select("id");
2232 let graphql_client = self.graphql_client.clone();
2233 async move { query.execute(graphql_client).await }
2234 }
2235}
2236#[derive(Clone)]
2237pub struct Changeset {
2238 pub proc: Option<Arc<DaggerSessionProc>>,
2239 pub selection: Selection,
2240 pub graphql_client: DynGraphQLClient,
2241}
2242#[derive(Builder, Debug, PartialEq)]
2243pub struct ChangesetFilterOpts<'a> {
2244 #[builder(setter(into, strip_option), default)]
2246 pub exclude: Option<Vec<&'a str>>,
2247 #[builder(setter(into, strip_option), default)]
2249 pub include: Option<Vec<&'a str>>,
2250}
2251#[derive(Builder, Debug, PartialEq)]
2252pub struct ChangesetWithChangesetOpts {
2253 #[builder(setter(into, strip_option), default)]
2255 pub on_conflict: Option<ChangesetMergeConflict>,
2256}
2257#[derive(Builder, Debug, PartialEq)]
2258pub struct ChangesetWithChangesetsOpts {
2259 #[builder(setter(into, strip_option), default)]
2261 pub on_conflict: Option<ChangesetsMergeConflict>,
2262}
2263impl IntoID<Id> for Changeset {
2264 fn into_id(
2265 self,
2266 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2267 Box::pin(async move { self.id().await })
2268 }
2269}
2270impl Loadable for Changeset {
2271 fn graphql_type() -> &'static str {
2272 "Changeset"
2273 }
2274 fn from_query(
2275 proc: Option<Arc<DaggerSessionProc>>,
2276 selection: Selection,
2277 graphql_client: DynGraphQLClient,
2278 ) -> Self {
2279 Self {
2280 proc,
2281 selection,
2282 graphql_client,
2283 }
2284 }
2285}
2286impl Changeset {
2287 pub async fn id(&self) -> Result<Id, DaggerError> {
2289 let query = self.selection.select("id");
2290 query.execute(self.graphql_client.clone()).await
2291 }
2292 pub async fn sync(&self) -> Result<Changeset, DaggerError> {
2294 let query = self.selection.select("sync");
2295 let id: Id = query.execute(self.graphql_client.clone()).await?;
2296 Ok(Changeset {
2297 proc: self.proc.clone(),
2298 selection: query
2299 .root()
2300 .select("node")
2301 .arg("id", &id.0)
2302 .inline_fragment("Changeset"),
2303 graphql_client: self.graphql_client.clone(),
2304 })
2305 }
2306 pub fn filter(&self) -> Changeset {
2313 let query = self.selection.select("filter");
2314 Changeset {
2315 proc: self.proc.clone(),
2316 selection: query,
2317 graphql_client: self.graphql_client.clone(),
2318 }
2319 }
2320 pub fn filter_opts<'a>(&self, opts: ChangesetFilterOpts<'a>) -> Changeset {
2327 let mut query = self.selection.select("filter");
2328 if let Some(include) = opts.include {
2329 query = query.arg("include", include);
2330 }
2331 if let Some(exclude) = opts.exclude {
2332 query = query.arg("exclude", exclude);
2333 }
2334 Changeset {
2335 proc: self.proc.clone(),
2336 selection: query,
2337 graphql_client: self.graphql_client.clone(),
2338 }
2339 }
2340 pub fn layer(&self) -> Directory {
2342 let query = self.selection.select("layer");
2343 Directory {
2344 proc: self.proc.clone(),
2345 selection: query,
2346 graphql_client: self.graphql_client.clone(),
2347 }
2348 }
2349 pub fn as_patch(&self) -> File {
2351 let query = self.selection.select("asPatch");
2352 File {
2353 proc: self.proc.clone(),
2354 selection: query,
2355 graphql_client: self.graphql_client.clone(),
2356 }
2357 }
2358 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2364 let mut query = self.selection.select("export");
2365 query = query.arg("path", path.into());
2366 query.execute(self.graphql_client.clone()).await
2367 }
2368 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2370 let query = self.selection.select("isEmpty");
2371 query.execute(self.graphql_client.clone()).await
2372 }
2373 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2375 let query = self.selection.select("addedPaths");
2376 query.execute(self.graphql_client.clone()).await
2377 }
2378 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2380 let query = self.selection.select("modifiedPaths");
2381 query.execute(self.graphql_client.clone()).await
2382 }
2383 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2385 let query = self.selection.select("removedPaths");
2386 query.execute(self.graphql_client.clone()).await
2387 }
2388 pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
2390 let query = self.selection.select("diffStats");
2391 let query = query.select("id");
2392 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2393 Ok(ids
2394 .into_iter()
2395 .map(|id| DiffStat {
2396 proc: self.proc.clone(),
2397 selection: crate::querybuilder::query()
2398 .select("node")
2399 .arg("id", &id.0)
2400 .inline_fragment("DiffStat"),
2401 graphql_client: self.graphql_client.clone(),
2402 })
2403 .collect())
2404 }
2405 pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
2413 let mut query = self.selection.select("withChangeset");
2414 query = query.arg_lazy(
2415 "changes",
2416 Box::new(move || {
2417 let changes = changes.clone();
2418 Box::pin(async move { changes.into_id().await.unwrap().quote() })
2419 }),
2420 );
2421 Changeset {
2422 proc: self.proc.clone(),
2423 selection: query,
2424 graphql_client: self.graphql_client.clone(),
2425 }
2426 }
2427 pub fn with_changeset_opts(
2435 &self,
2436 changes: impl IntoID<Id>,
2437 opts: ChangesetWithChangesetOpts,
2438 ) -> Changeset {
2439 let mut query = self.selection.select("withChangeset");
2440 query = query.arg_lazy(
2441 "changes",
2442 Box::new(move || {
2443 let changes = changes.clone();
2444 Box::pin(async move { changes.into_id().await.unwrap().quote() })
2445 }),
2446 );
2447 if let Some(on_conflict) = opts.on_conflict {
2448 query = query.arg("onConflict", on_conflict);
2449 }
2450 Changeset {
2451 proc: self.proc.clone(),
2452 selection: query,
2453 graphql_client: self.graphql_client.clone(),
2454 }
2455 }
2456 pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
2465 let mut query = self.selection.select("withChangesets");
2466 query = query.arg("changes", changes);
2467 Changeset {
2468 proc: self.proc.clone(),
2469 selection: query,
2470 graphql_client: self.graphql_client.clone(),
2471 }
2472 }
2473 pub fn with_changesets_opts(
2482 &self,
2483 changes: Vec<Id>,
2484 opts: ChangesetWithChangesetsOpts,
2485 ) -> Changeset {
2486 let mut query = self.selection.select("withChangesets");
2487 query = query.arg("changes", changes);
2488 if let Some(on_conflict) = opts.on_conflict {
2489 query = query.arg("onConflict", on_conflict);
2490 }
2491 Changeset {
2492 proc: self.proc.clone(),
2493 selection: query,
2494 graphql_client: self.graphql_client.clone(),
2495 }
2496 }
2497 pub fn before(&self) -> Directory {
2499 let query = self.selection.select("before");
2500 Directory {
2501 proc: self.proc.clone(),
2502 selection: query,
2503 graphql_client: self.graphql_client.clone(),
2504 }
2505 }
2506 pub fn after(&self) -> Directory {
2508 let query = self.selection.select("after");
2509 Directory {
2510 proc: self.proc.clone(),
2511 selection: query,
2512 graphql_client: self.graphql_client.clone(),
2513 }
2514 }
2515}
2516impl Exportable for Changeset {
2517 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2518 let query = self.selection.select("id");
2519 let graphql_client = self.graphql_client.clone();
2520 async move { query.execute(graphql_client).await }
2521 }
2522 fn export(
2523 &self,
2524 path: impl Into<String>,
2525 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
2526 let mut query = self.selection.select("export");
2527 query = query.arg("path", path.into());
2528 let graphql_client = self.graphql_client.clone();
2529 async move { query.execute(graphql_client).await }
2530 }
2531}
2532impl Node for Changeset {
2533 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2534 let query = self.selection.select("id");
2535 let graphql_client = self.graphql_client.clone();
2536 async move { query.execute(graphql_client).await }
2537 }
2538}
2539impl Syncer for Changeset {
2540 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2541 let query = self.selection.select("id");
2542 let graphql_client = self.graphql_client.clone();
2543 async move { query.execute(graphql_client).await }
2544 }
2545 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
2546 let query = self.selection.select("sync");
2547 let proc = self.proc.clone();
2548 let graphql_client = self.graphql_client.clone();
2549 async move {
2550 let id: Id = query.execute(graphql_client.clone()).await?;
2551 Ok(Self {
2552 proc,
2553 selection: query
2554 .root()
2555 .select("node")
2556 .arg("id", &id.0)
2557 .inline_fragment("Changeset"),
2558 graphql_client,
2559 })
2560 }
2561 }
2562}
2563#[derive(Clone)]
2564pub struct Check {
2565 pub proc: Option<Arc<DaggerSessionProc>>,
2566 pub selection: Selection,
2567 pub graphql_client: DynGraphQLClient,
2568}
2569impl IntoID<Id> for Check {
2570 fn into_id(
2571 self,
2572 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2573 Box::pin(async move { self.id().await })
2574 }
2575}
2576impl Loadable for Check {
2577 fn graphql_type() -> &'static str {
2578 "Check"
2579 }
2580 fn from_query(
2581 proc: Option<Arc<DaggerSessionProc>>,
2582 selection: Selection,
2583 graphql_client: DynGraphQLClient,
2584 ) -> Self {
2585 Self {
2586 proc,
2587 selection,
2588 graphql_client,
2589 }
2590 }
2591}
2592impl Check {
2593 pub async fn id(&self) -> Result<Id, DaggerError> {
2595 let query = self.selection.select("id");
2596 query.execute(self.graphql_client.clone()).await
2597 }
2598 pub fn sync(&self) -> Check {
2600 let query = self.selection.select("sync");
2601 Check {
2602 proc: self.proc.clone(),
2603 selection: query,
2604 graphql_client: self.graphql_client.clone(),
2605 }
2606 }
2607 pub async fn pass(&self) -> Result<bool, DaggerError> {
2609 let query = self.selection.select("pass");
2610 query.execute(self.graphql_client.clone()).await
2611 }
2612 pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
2614 let query = self.selection.select("error");
2615 let query = query.select("id");
2616 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2617 Ok(id.map(|id| Error {
2618 proc: self.proc.clone(),
2619 selection: query
2620 .root()
2621 .select("node")
2622 .arg("id", &id.0)
2623 .inline_fragment("Error"),
2624 graphql_client: self.graphql_client.clone(),
2625 }))
2626 }
2627 pub async fn assertion(&self) -> Result<String, DaggerError> {
2629 let query = self.selection.select("assertion");
2630 query.execute(self.graphql_client.clone()).await
2631 }
2632 pub async fn report(&self) -> Result<Option<Directory>, DaggerError> {
2634 let query = self.selection.select("report");
2635 let query = query.select("id");
2636 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2637 Ok(id.map(|id| Directory {
2638 proc: self.proc.clone(),
2639 selection: query
2640 .root()
2641 .select("node")
2642 .arg("id", &id.0)
2643 .inline_fragment("Directory"),
2644 graphql_client: self.graphql_client.clone(),
2645 }))
2646 }
2647}
2648impl Node for Check {
2649 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2650 let query = self.selection.select("id");
2651 let graphql_client = self.graphql_client.clone();
2652 async move { query.execute(graphql_client).await }
2653 }
2654}
2655#[derive(Clone)]
2656pub struct ClientFilesyncMirror {
2657 pub proc: Option<Arc<DaggerSessionProc>>,
2658 pub selection: Selection,
2659 pub graphql_client: DynGraphQLClient,
2660}
2661impl IntoID<Id> for ClientFilesyncMirror {
2662 fn into_id(
2663 self,
2664 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2665 Box::pin(async move { self.id().await })
2666 }
2667}
2668impl Loadable for ClientFilesyncMirror {
2669 fn graphql_type() -> &'static str {
2670 "ClientFilesyncMirror"
2671 }
2672 fn from_query(
2673 proc: Option<Arc<DaggerSessionProc>>,
2674 selection: Selection,
2675 graphql_client: DynGraphQLClient,
2676 ) -> Self {
2677 Self {
2678 proc,
2679 selection,
2680 graphql_client,
2681 }
2682 }
2683}
2684impl ClientFilesyncMirror {
2685 pub async fn id(&self) -> Result<Id, DaggerError> {
2687 let query = self.selection.select("id");
2688 query.execute(self.graphql_client.clone()).await
2689 }
2690}
2691impl Node for ClientFilesyncMirror {
2692 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2693 let query = self.selection.select("id");
2694 let graphql_client = self.graphql_client.clone();
2695 async move { query.execute(graphql_client).await }
2696 }
2697}
2698#[derive(Clone)]
2699pub struct Cloud {
2700 pub proc: Option<Arc<DaggerSessionProc>>,
2701 pub selection: Selection,
2702 pub graphql_client: DynGraphQLClient,
2703}
2704impl IntoID<Id> for Cloud {
2705 fn into_id(
2706 self,
2707 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2708 Box::pin(async move { self.id().await })
2709 }
2710}
2711impl Loadable for Cloud {
2712 fn graphql_type() -> &'static str {
2713 "Cloud"
2714 }
2715 fn from_query(
2716 proc: Option<Arc<DaggerSessionProc>>,
2717 selection: Selection,
2718 graphql_client: DynGraphQLClient,
2719 ) -> Self {
2720 Self {
2721 proc,
2722 selection,
2723 graphql_client,
2724 }
2725 }
2726}
2727impl Cloud {
2728 pub async fn id(&self) -> Result<Id, DaggerError> {
2730 let query = self.selection.select("id");
2731 query.execute(self.graphql_client.clone()).await
2732 }
2733 pub async fn trace_url(&self) -> Result<String, DaggerError> {
2735 let query = self.selection.select("traceURL");
2736 query.execute(self.graphql_client.clone()).await
2737 }
2738}
2739impl Node for Cloud {
2740 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2741 let query = self.selection.select("id");
2742 let graphql_client = self.graphql_client.clone();
2743 async move { query.execute(graphql_client).await }
2744 }
2745}
2746#[derive(Clone)]
2747pub struct CollectionDelta {
2748 pub proc: Option<Arc<DaggerSessionProc>>,
2749 pub selection: Selection,
2750 pub graphql_client: DynGraphQLClient,
2751}
2752impl IntoID<Id> for CollectionDelta {
2753 fn into_id(
2754 self,
2755 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2756 Box::pin(async move { self.id().await })
2757 }
2758}
2759impl Loadable for CollectionDelta {
2760 fn graphql_type() -> &'static str {
2761 "CollectionDelta"
2762 }
2763 fn from_query(
2764 proc: Option<Arc<DaggerSessionProc>>,
2765 selection: Selection,
2766 graphql_client: DynGraphQLClient,
2767 ) -> Self {
2768 Self {
2769 proc,
2770 selection,
2771 graphql_client,
2772 }
2773 }
2774}
2775impl CollectionDelta {
2776 pub async fn id(&self) -> Result<Id, DaggerError> {
2778 let query = self.selection.select("id");
2779 query.execute(self.graphql_client.clone()).await
2780 }
2781 pub async fn added_keys(&self) -> Result<Vec<String>, DaggerError> {
2783 let query = self.selection.select("addedKeys");
2784 query.execute(self.graphql_client.clone()).await
2785 }
2786 pub async fn removed_keys(&self) -> Result<Vec<String>, DaggerError> {
2788 let query = self.selection.select("removedKeys");
2789 query.execute(self.graphql_client.clone()).await
2790 }
2791}
2792impl Node for CollectionDelta {
2793 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2794 let query = self.selection.select("id");
2795 let graphql_client = self.graphql_client.clone();
2796 async move { query.execute(graphql_client).await }
2797 }
2798}
2799#[derive(Clone)]
2800pub struct CollectionTypeDef {
2801 pub proc: Option<Arc<DaggerSessionProc>>,
2802 pub selection: Selection,
2803 pub graphql_client: DynGraphQLClient,
2804}
2805impl IntoID<Id> for CollectionTypeDef {
2806 fn into_id(
2807 self,
2808 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2809 Box::pin(async move { self.id().await })
2810 }
2811}
2812impl Loadable for CollectionTypeDef {
2813 fn graphql_type() -> &'static str {
2814 "CollectionTypeDef"
2815 }
2816 fn from_query(
2817 proc: Option<Arc<DaggerSessionProc>>,
2818 selection: Selection,
2819 graphql_client: DynGraphQLClient,
2820 ) -> Self {
2821 Self {
2822 proc,
2823 selection,
2824 graphql_client,
2825 }
2826 }
2827}
2828impl CollectionTypeDef {
2829 pub async fn id(&self) -> Result<Id, DaggerError> {
2831 let query = self.selection.select("id");
2832 query.execute(self.graphql_client.clone()).await
2833 }
2834 pub fn key_type(&self) -> TypeDef {
2836 let query = self.selection.select("keyType");
2837 TypeDef {
2838 proc: self.proc.clone(),
2839 selection: query,
2840 graphql_client: self.graphql_client.clone(),
2841 }
2842 }
2843 pub fn value_type(&self) -> TypeDef {
2845 let query = self.selection.select("valueType");
2846 TypeDef {
2847 proc: self.proc.clone(),
2848 selection: query,
2849 graphql_client: self.graphql_client.clone(),
2850 }
2851 }
2852 pub async fn batch_type(&self) -> Result<Option<TypeDef>, DaggerError> {
2854 let query = self.selection.select("batchType");
2855 let query = query.select("id");
2856 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2857 Ok(id.map(|id| TypeDef {
2858 proc: self.proc.clone(),
2859 selection: query
2860 .root()
2861 .select("node")
2862 .arg("id", &id.0)
2863 .inline_fragment("TypeDef"),
2864 graphql_client: self.graphql_client.clone(),
2865 }))
2866 }
2867}
2868impl Node for CollectionTypeDef {
2869 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2870 let query = self.selection.select("id");
2871 let graphql_client = self.graphql_client.clone();
2872 async move { query.execute(graphql_client).await }
2873 }
2874}
2875#[derive(Clone)]
2876pub struct Command {
2877 pub proc: Option<Arc<DaggerSessionProc>>,
2878 pub selection: Selection,
2879 pub graphql_client: DynGraphQLClient,
2880}
2881impl IntoID<Id> for Command {
2882 fn into_id(
2883 self,
2884 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2885 Box::pin(async move { self.id().await })
2886 }
2887}
2888impl Loadable for Command {
2889 fn graphql_type() -> &'static str {
2890 "Command"
2891 }
2892 fn from_query(
2893 proc: Option<Arc<DaggerSessionProc>>,
2894 selection: Selection,
2895 graphql_client: DynGraphQLClient,
2896 ) -> Self {
2897 Self {
2898 proc,
2899 selection,
2900 graphql_client,
2901 }
2902 }
2903}
2904impl Command {
2905 pub async fn id(&self) -> Result<Id, DaggerError> {
2907 let query = self.selection.select("id");
2908 query.execute(self.graphql_client.clone()).await
2909 }
2910 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
2912 let query = self.selection.select("args");
2913 query.execute(self.graphql_client.clone()).await
2914 }
2915 pub async fn env(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2917 let query = self.selection.select("env");
2918 let query = query.select("id");
2919 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2920 Ok(ids
2921 .into_iter()
2922 .map(|id| EnvVariable {
2923 proc: self.proc.clone(),
2924 selection: crate::querybuilder::query()
2925 .select("node")
2926 .arg("id", &id.0)
2927 .inline_fragment("EnvVariable"),
2928 graphql_client: self.graphql_client.clone(),
2929 })
2930 .collect())
2931 }
2932 pub async fn workdir(&self) -> Result<String, DaggerError> {
2934 let query = self.selection.select("workdir");
2935 query.execute(self.graphql_client.clone()).await
2936 }
2937 pub async fn privileged_nesting(&self) -> Result<bool, DaggerError> {
2939 let query = self.selection.select("privilegedNesting");
2940 query.execute(self.graphql_client.clone()).await
2941 }
2942 pub async fn insecure_root_capabilities(&self) -> Result<bool, DaggerError> {
2944 let query = self.selection.select("insecureRootCapabilities");
2945 query.execute(self.graphql_client.clone()).await
2946 }
2947}
2948impl Node for Command {
2949 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2950 let query = self.selection.select("id");
2951 let graphql_client = self.graphql_client.clone();
2952 async move { query.execute(graphql_client).await }
2953 }
2954}
2955#[derive(Clone)]
2956pub struct Container {
2957 pub proc: Option<Arc<DaggerSessionProc>>,
2958 pub selection: Selection,
2959 pub graphql_client: DynGraphQLClient,
2960}
2961#[derive(Builder, Debug, PartialEq)]
2962pub struct ContainerFromOpts<'a> {
2963 #[builder(setter(into, strip_option), default)]
2965 pub insecure_skip_tls_verify: Option<bool>,
2966 #[builder(setter(into, strip_option), default)]
2968 pub no_lock: Option<bool>,
2969 #[builder(setter(into, strip_option), default)]
2972 pub protocol: Option<RegistryProtocol>,
2973 #[builder(setter(into, strip_option), default)]
2976 pub registry_service: Option<Id>,
2977 #[builder(setter(into, strip_option), default)]
2979 pub version: Option<&'a str>,
2980}
2981#[derive(Builder, Debug, PartialEq)]
2982pub struct ContainerDirectoryOpts {
2983 #[builder(setter(into, strip_option), default)]
2985 pub expand: Option<bool>,
2986}
2987#[derive(Builder, Debug, PartialEq)]
2988pub struct ContainerFileOpts {
2989 #[builder(setter(into, strip_option), default)]
2991 pub expand: Option<bool>,
2992}
2993#[derive(Builder, Debug, PartialEq)]
2994pub struct ContainerWithWorkdirOpts {
2995 #[builder(setter(into, strip_option), default)]
2997 pub expand: Option<bool>,
2998}
2999#[derive(Builder, Debug, PartialEq)]
3000pub struct ContainerWithEnvVariableOpts {
3001 #[builder(setter(into, strip_option), default)]
3003 pub expand: Option<bool>,
3004}
3005#[derive(Builder, Debug, PartialEq)]
3006pub struct ContainerWithDockerHealthcheckOpts<'a> {
3007 #[builder(setter(into, strip_option), default)]
3009 pub interval: Option<&'a str>,
3010 #[builder(setter(into, strip_option), default)]
3012 pub retries: Option<isize>,
3013 #[builder(setter(into, strip_option), default)]
3015 pub shell: Option<bool>,
3016 #[builder(setter(into, strip_option), default)]
3018 pub start_interval: Option<&'a str>,
3019 #[builder(setter(into, strip_option), default)]
3021 pub start_period: Option<&'a str>,
3022 #[builder(setter(into, strip_option), default)]
3024 pub timeout: Option<&'a str>,
3025}
3026#[derive(Builder, Debug, PartialEq)]
3027pub struct ContainerWithEntrypointOpts {
3028 #[builder(setter(into, strip_option), default)]
3030 pub keep_default_args: Option<bool>,
3031}
3032#[derive(Builder, Debug, PartialEq)]
3033pub struct ContainerWithoutEntrypointOpts {
3034 #[builder(setter(into, strip_option), default)]
3036 pub keep_default_args: Option<bool>,
3037}
3038#[derive(Builder, Debug, PartialEq)]
3039pub struct ContainerWithMountedDirectoryOpts<'a> {
3040 #[builder(setter(into, strip_option), default)]
3042 pub expand: Option<bool>,
3043 #[builder(setter(into, strip_option), default)]
3045 pub inherit_owner: Option<bool>,
3046 #[builder(setter(into, strip_option), default)]
3050 pub owner: Option<&'a str>,
3051 #[builder(setter(into, strip_option), default)]
3053 pub read_only: Option<bool>,
3054}
3055#[derive(Builder, Debug, PartialEq)]
3056pub struct ContainerWithMountedFileOpts<'a> {
3057 #[builder(setter(into, strip_option), default)]
3059 pub expand: Option<bool>,
3060 #[builder(setter(into, strip_option), default)]
3062 pub inherit_owner: Option<bool>,
3063 #[builder(setter(into, strip_option), default)]
3067 pub owner: Option<&'a str>,
3068}
3069#[derive(Builder, Debug, PartialEq)]
3070pub struct ContainerWithMountedTempOpts {
3071 #[builder(setter(into, strip_option), default)]
3073 pub expand: Option<bool>,
3074 #[builder(setter(into, strip_option), default)]
3076 pub size: Option<isize>,
3077}
3078#[derive(Builder, Debug, PartialEq)]
3079pub struct ContainerWithMountedCacheOpts<'a> {
3080 #[builder(setter(into, strip_option), default)]
3082 pub expand: Option<bool>,
3083 #[builder(setter(into, strip_option), default)]
3085 pub inherit_owner: Option<bool>,
3086 #[builder(setter(into, strip_option), default)]
3091 pub owner: Option<&'a str>,
3092 #[builder(setter(into, strip_option), default)]
3094 pub sharing: Option<CacheSharingMode>,
3095 #[builder(setter(into, strip_option), default)]
3097 pub source: Option<Id>,
3098}
3099#[derive(Builder, Debug, PartialEq)]
3100pub struct ContainerWithMountedVolumeOpts {
3101 #[builder(setter(into, strip_option), default)]
3103 pub expand: Option<bool>,
3104 #[builder(setter(into, strip_option), default)]
3106 pub read_only: Option<bool>,
3107}
3108#[derive(Builder, Debug, PartialEq)]
3109pub struct ContainerWithMountedSecretOpts<'a> {
3110 #[builder(setter(into, strip_option), default)]
3112 pub expand: Option<bool>,
3113 #[builder(setter(into, strip_option), default)]
3115 pub inherit_owner: Option<bool>,
3116 #[builder(setter(into, strip_option), default)]
3119 pub mode: Option<isize>,
3120 #[builder(setter(into, strip_option), default)]
3124 pub owner: Option<&'a str>,
3125}
3126#[derive(Builder, Debug, PartialEq)]
3127pub struct ContainerWithUnixSocketOpts<'a> {
3128 #[builder(setter(into, strip_option), default)]
3130 pub expand: Option<bool>,
3131 #[builder(setter(into, strip_option), default)]
3133 pub inherit_owner: Option<bool>,
3134 #[builder(setter(into, strip_option), default)]
3138 pub owner: Option<&'a str>,
3139}
3140#[derive(Builder, Debug, PartialEq)]
3141pub struct ContainerWithoutUnixSocketOpts {
3142 #[builder(setter(into, strip_option), default)]
3144 pub expand: Option<bool>,
3145}
3146#[derive(Builder, Debug, PartialEq)]
3147pub struct ContainerWithoutMountOpts {
3148 #[builder(setter(into, strip_option), default)]
3150 pub expand: Option<bool>,
3151}
3152#[derive(Builder, Debug, PartialEq)]
3153pub struct ContainerWithFileOpts<'a> {
3154 #[builder(setter(into, strip_option), default)]
3156 pub expand: Option<bool>,
3157 #[builder(setter(into, strip_option), default)]
3159 pub inherit_owner: Option<bool>,
3160 #[builder(setter(into, strip_option), default)]
3164 pub owner: Option<&'a str>,
3165 #[builder(setter(into, strip_option), default)]
3167 pub permissions: Option<isize>,
3168}
3169#[derive(Builder, Debug, PartialEq)]
3170pub struct ContainerWithoutFileOpts {
3171 #[builder(setter(into, strip_option), default)]
3173 pub expand: Option<bool>,
3174}
3175#[derive(Builder, Debug, PartialEq)]
3176pub struct ContainerWithoutFilesOpts {
3177 #[builder(setter(into, strip_option), default)]
3179 pub expand: Option<bool>,
3180}
3181#[derive(Builder, Debug, PartialEq)]
3182pub struct ContainerWithFilesOpts<'a> {
3183 #[builder(setter(into, strip_option), default)]
3185 pub expand: Option<bool>,
3186 #[builder(setter(into, strip_option), default)]
3188 pub inherit_owner: Option<bool>,
3189 #[builder(setter(into, strip_option), default)]
3193 pub owner: Option<&'a str>,
3194 #[builder(setter(into, strip_option), default)]
3196 pub permissions: Option<isize>,
3197}
3198#[derive(Builder, Debug, PartialEq)]
3199pub struct ContainerWithNewFileOpts<'a> {
3200 #[builder(setter(into, strip_option), default)]
3202 pub expand: Option<bool>,
3203 #[builder(setter(into, strip_option), default)]
3205 pub inherit_owner: Option<bool>,
3206 #[builder(setter(into, strip_option), default)]
3210 pub owner: Option<&'a str>,
3211 #[builder(setter(into, strip_option), default)]
3213 pub permissions: Option<isize>,
3214}
3215#[derive(Builder, Debug, PartialEq)]
3216pub struct ContainerWithDirectoryOpts<'a> {
3217 #[builder(setter(into, strip_option), default)]
3219 pub exclude: Option<Vec<&'a str>>,
3220 #[builder(setter(into, strip_option), default)]
3222 pub expand: Option<bool>,
3223 #[builder(setter(into, strip_option), default)]
3225 pub gitignore: Option<bool>,
3226 #[builder(setter(into, strip_option), default)]
3228 pub include: Option<Vec<&'a str>>,
3229 #[builder(setter(into, strip_option), default)]
3231 pub inherit_owner: Option<bool>,
3232 #[builder(setter(into, strip_option), default)]
3236 pub owner: Option<&'a str>,
3237 #[builder(setter(into, strip_option), default)]
3238 pub permissions: Option<isize>,
3239}
3240#[derive(Builder, Debug, PartialEq)]
3241pub struct ContainerWithoutDirectoryOpts {
3242 #[builder(setter(into, strip_option), default)]
3244 pub expand: Option<bool>,
3245}
3246#[derive(Builder, Debug, PartialEq)]
3247pub struct ContainerExistsOpts {
3248 #[builder(setter(into, strip_option), default)]
3250 pub do_not_follow_symlinks: Option<bool>,
3251 #[builder(setter(into, strip_option), default)]
3253 pub expand: Option<bool>,
3254 #[builder(setter(into, strip_option), default)]
3256 pub expected_type: Option<ExistsType>,
3257}
3258#[derive(Builder, Debug, PartialEq)]
3259pub struct ContainerStatOpts {
3260 #[builder(setter(into, strip_option), default)]
3262 pub do_not_follow_symlinks: Option<bool>,
3263}
3264#[derive(Builder, Debug, PartialEq)]
3265pub struct ContainerWithExecOpts<'a> {
3266 #[builder(setter(into, strip_option), default)]
3270 pub dagger_in_dagger_new_session: Option<bool>,
3271 #[builder(setter(into, strip_option), default)]
3273 pub disable_dagger_in_dagger: Option<bool>,
3274 #[builder(setter(into, strip_option), default)]
3276 pub expand: Option<bool>,
3277 #[builder(setter(into, strip_option), default)]
3279 pub expect: Option<ReturnType>,
3280 #[builder(setter(into, strip_option), default)]
3281 pub experimental_privileged_nesting: Option<bool>,
3282 #[builder(setter(into, strip_option), default)]
3285 pub insecure_root_capabilities: Option<bool>,
3286 #[builder(setter(into, strip_option), default)]
3289 pub no_init: Option<bool>,
3290 #[builder(setter(into, strip_option), default)]
3292 pub redirect_stderr: Option<&'a str>,
3293 #[builder(setter(into, strip_option), default)]
3295 pub redirect_stdin: Option<&'a str>,
3296 #[builder(setter(into, strip_option), default)]
3298 pub redirect_stdout: Option<&'a str>,
3299 #[builder(setter(into, strip_option), default)]
3301 pub stdin: Option<&'a str>,
3302 #[builder(setter(into, strip_option), default)]
3304 pub use_entrypoint: Option<bool>,
3305}
3306#[derive(Builder, Debug, PartialEq)]
3307pub struct ContainerWithSymlinkOpts {
3308 #[builder(setter(into, strip_option), default)]
3310 pub expand: Option<bool>,
3311}
3312#[derive(Builder, Debug, PartialEq)]
3313pub struct ContainerPublishOpts {
3314 #[builder(setter(into, strip_option), default)]
3317 pub forced_compression: Option<ImageLayerCompression>,
3318 #[builder(setter(into, strip_option), default)]
3320 pub insecure_skip_tls_verify: Option<bool>,
3321 #[builder(setter(into, strip_option), default)]
3324 pub media_types: Option<ImageMediaTypes>,
3325 #[builder(setter(into, strip_option), default)]
3328 pub platform_variants: Option<Vec<Id>>,
3329 #[builder(setter(into, strip_option), default)]
3332 pub protocol: Option<RegistryProtocol>,
3333 #[builder(setter(into, strip_option), default)]
3336 pub registry_service: Option<Id>,
3337}
3338#[derive(Builder, Debug, PartialEq)]
3339pub struct ContainerExportOpts {
3340 #[builder(setter(into, strip_option), default)]
3342 pub expand: Option<bool>,
3343 #[builder(setter(into, strip_option), default)]
3346 pub forced_compression: Option<ImageLayerCompression>,
3347 #[builder(setter(into, strip_option), default)]
3350 pub media_types: Option<ImageMediaTypes>,
3351 #[builder(setter(into, strip_option), default)]
3354 pub platform_variants: Option<Vec<Id>>,
3355}
3356#[derive(Builder, Debug, PartialEq)]
3357pub struct ContainerExportImageOpts {
3358 #[builder(setter(into, strip_option), default)]
3361 pub forced_compression: Option<ImageLayerCompression>,
3362 #[builder(setter(into, strip_option), default)]
3365 pub media_types: Option<ImageMediaTypes>,
3366 #[builder(setter(into, strip_option), default)]
3369 pub platform_variants: Option<Vec<Id>>,
3370}
3371#[derive(Builder, Debug, PartialEq)]
3372pub struct ContainerAsTarballOpts {
3373 #[builder(setter(into, strip_option), default)]
3376 pub forced_compression: Option<ImageLayerCompression>,
3377 #[builder(setter(into, strip_option), default)]
3380 pub media_types: Option<ImageMediaTypes>,
3381 #[builder(setter(into, strip_option), default)]
3384 pub platform_variants: Option<Vec<Id>>,
3385}
3386#[derive(Builder, Debug, PartialEq)]
3387pub struct ContainerImportOpts<'a> {
3388 #[builder(setter(into, strip_option), default)]
3390 pub tag: Option<&'a str>,
3391}
3392#[derive(Builder, Debug, PartialEq)]
3393pub struct ContainerManifestOpts {
3394 #[builder(setter(into, strip_option), default)]
3397 pub forced_compression: Option<ImageLayerCompression>,
3398 #[builder(setter(into, strip_option), default)]
3400 pub media_types: Option<ImageMediaTypes>,
3401}
3402#[derive(Builder, Debug, PartialEq)]
3403pub struct ContainerLayerOpts {
3404 #[builder(setter(into, strip_option), default)]
3407 pub forced_compression: Option<ImageLayerCompression>,
3408 #[builder(setter(into, strip_option), default)]
3410 pub media_types: Option<ImageMediaTypes>,
3411}
3412#[derive(Builder, Debug, PartialEq)]
3413pub struct ContainerWithExposedPortOpts<'a> {
3414 #[builder(setter(into, strip_option), default)]
3416 pub description: Option<&'a str>,
3417 #[builder(setter(into, strip_option), default)]
3419 pub experimental_skip_healthcheck: Option<bool>,
3420 #[builder(setter(into, strip_option), default)]
3422 pub protocol: Option<NetworkProtocol>,
3423}
3424#[derive(Builder, Debug, PartialEq)]
3425pub struct ContainerWithoutExposedPortOpts {
3426 #[builder(setter(into, strip_option), default)]
3428 pub protocol: Option<NetworkProtocol>,
3429}
3430#[derive(Builder, Debug, PartialEq)]
3431pub struct ContainerWithDefaultTerminalCmdOpts {
3432 #[builder(setter(into, strip_option), default)]
3434 pub disable_dagger_in_dagger: Option<bool>,
3435 #[builder(setter(into, strip_option), default)]
3436 pub experimental_privileged_nesting: Option<bool>,
3437 #[builder(setter(into, strip_option), default)]
3439 pub insecure_root_capabilities: Option<bool>,
3440}
3441#[derive(Builder, Debug, PartialEq)]
3442pub struct ContainerWithShellOpts<'a> {
3443 #[builder(setter(into, strip_option), default)]
3445 pub batch: Option<Vec<&'a str>>,
3446 #[builder(setter(into, strip_option), default)]
3448 pub disable_dagger_in_dagger: Option<bool>,
3449 #[builder(setter(into, strip_option), default)]
3450 pub experimental_privileged_nesting: Option<bool>,
3451 #[builder(setter(into, strip_option), default)]
3453 pub insecure_root_capabilities: Option<bool>,
3454}
3455#[derive(Builder, Debug, PartialEq)]
3456pub struct ContainerShellOpts {
3457 #[builder(setter(into, strip_option), default)]
3459 pub batch: Option<bool>,
3460}
3461#[derive(Builder, Debug, PartialEq)]
3462pub struct ContainerWithRunOpts<'a> {
3463 #[builder(setter(into, strip_option), default)]
3465 pub disable_dagger_in_dagger: Option<bool>,
3466 #[builder(setter(into, strip_option), default)]
3467 pub experimental_privileged_nesting: Option<bool>,
3468 #[builder(setter(into, strip_option), default)]
3470 pub insecure_root_capabilities: Option<bool>,
3471 #[builder(setter(into, strip_option), default)]
3473 pub shell: Option<Vec<&'a str>>,
3474}
3475#[derive(Builder, Debug, PartialEq)]
3476pub struct ContainerTerminalOpts<'a> {
3477 #[builder(setter(into, strip_option), default)]
3479 pub cmd: Option<Vec<&'a str>>,
3480 #[builder(setter(into, strip_option), default)]
3482 pub disable_dagger_in_dagger: Option<bool>,
3483 #[builder(setter(into, strip_option), default)]
3484 pub experimental_privileged_nesting: Option<bool>,
3485 #[builder(setter(into, strip_option), default)]
3487 pub insecure_root_capabilities: Option<bool>,
3488}
3489#[derive(Builder, Debug, PartialEq)]
3490pub struct ContainerAsServiceOpts<'a> {
3491 #[builder(setter(into, strip_option), default)]
3494 pub args: Option<Vec<&'a str>>,
3495 #[builder(setter(into, strip_option), default)]
3499 pub dagger_in_dagger_new_session: Option<bool>,
3500 #[builder(setter(into, strip_option), default)]
3502 pub disable_dagger_in_dagger: Option<bool>,
3503 #[builder(setter(into, strip_option), default)]
3505 pub expand: Option<bool>,
3506 #[builder(setter(into, strip_option), default)]
3507 pub experimental_privileged_nesting: Option<bool>,
3508 #[builder(setter(into, strip_option), default)]
3510 pub insecure_root_capabilities: Option<bool>,
3511 #[builder(setter(into, strip_option), default)]
3514 pub no_init: Option<bool>,
3515 #[builder(setter(into, strip_option), default)]
3517 pub use_entrypoint: Option<bool>,
3518}
3519#[derive(Builder, Debug, PartialEq)]
3520pub struct ContainerUpOpts<'a> {
3521 #[builder(setter(into, strip_option), default)]
3524 pub args: Option<Vec<&'a str>>,
3525 #[builder(setter(into, strip_option), default)]
3529 pub dagger_in_dagger_new_session: Option<bool>,
3530 #[builder(setter(into, strip_option), default)]
3532 pub disable_dagger_in_dagger: Option<bool>,
3533 #[builder(setter(into, strip_option), default)]
3535 pub expand: Option<bool>,
3536 #[builder(setter(into, strip_option), default)]
3537 pub experimental_privileged_nesting: Option<bool>,
3538 #[builder(setter(into, strip_option), default)]
3540 pub insecure_root_capabilities: Option<bool>,
3541 #[builder(setter(into, strip_option), default)]
3544 pub no_init: Option<bool>,
3545 #[builder(setter(into, strip_option), default)]
3548 pub ports: Option<Vec<PortForward>>,
3549 #[builder(setter(into, strip_option), default)]
3551 pub random: Option<bool>,
3552 #[builder(setter(into, strip_option), default)]
3554 pub use_entrypoint: Option<bool>,
3555}
3556impl IntoID<Id> for Container {
3557 fn into_id(
3558 self,
3559 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
3560 Box::pin(async move { self.id().await })
3561 }
3562}
3563impl Loadable for Container {
3564 fn graphql_type() -> &'static str {
3565 "Container"
3566 }
3567 fn from_query(
3568 proc: Option<Arc<DaggerSessionProc>>,
3569 selection: Selection,
3570 graphql_client: DynGraphQLClient,
3571 ) -> Self {
3572 Self {
3573 proc,
3574 selection,
3575 graphql_client,
3576 }
3577 }
3578}
3579impl Container {
3580 pub async fn id(&self) -> Result<Id, DaggerError> {
3582 let query = self.selection.select("id");
3583 query.execute(self.graphql_client.clone()).await
3584 }
3585 pub async fn sync(&self) -> Result<Container, DaggerError> {
3588 let query = self.selection.select("sync");
3589 let id: Id = query.execute(self.graphql_client.clone()).await?;
3590 Ok(Container {
3591 proc: self.proc.clone(),
3592 selection: query
3593 .root()
3594 .select("node")
3595 .arg("id", &id.0)
3596 .inline_fragment("Container"),
3597 graphql_client: self.graphql_client.clone(),
3598 })
3599 }
3600 pub fn from(&self, address: impl Into<String>) -> Container {
3609 let mut query = self.selection.select("from");
3610 query = query.arg("address", address.into());
3611 Container {
3612 proc: self.proc.clone(),
3613 selection: query,
3614 graphql_client: self.graphql_client.clone(),
3615 }
3616 }
3617 pub fn from_opts<'a>(
3626 &self,
3627 address: impl Into<String>,
3628 opts: ContainerFromOpts<'a>,
3629 ) -> Container {
3630 let mut query = self.selection.select("from");
3631 query = query.arg("address", address.into());
3632 if let Some(version) = opts.version {
3633 query = query.arg("version", version);
3634 }
3635 if let Some(registry_service) = opts.registry_service {
3636 query = query.arg("registryService", registry_service);
3637 }
3638 if let Some(protocol) = opts.protocol {
3639 query = query.arg("protocol", protocol);
3640 }
3641 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
3642 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
3643 }
3644 if let Some(no_lock) = opts.no_lock {
3645 query = query.arg("noLock", no_lock);
3646 }
3647 Container {
3648 proc: self.proc.clone(),
3649 selection: query,
3650 graphql_client: self.graphql_client.clone(),
3651 }
3652 }
3653 pub fn rootfs(&self) -> Directory {
3655 let query = self.selection.select("rootfs");
3656 Directory {
3657 proc: self.proc.clone(),
3658 selection: query,
3659 graphql_client: self.graphql_client.clone(),
3660 }
3661 }
3662 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3668 let mut query = self.selection.select("withRootfs");
3669 query = query.arg_lazy(
3670 "directory",
3671 Box::new(move || {
3672 let directory = directory.clone();
3673 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3674 }),
3675 );
3676 Container {
3677 proc: self.proc.clone(),
3678 selection: query,
3679 graphql_client: self.graphql_client.clone(),
3680 }
3681 }
3682 pub fn directory(&self, path: impl Into<String>) -> Directory {
3690 let mut query = self.selection.select("directory");
3691 query = query.arg("path", path.into());
3692 Directory {
3693 proc: self.proc.clone(),
3694 selection: query,
3695 graphql_client: self.graphql_client.clone(),
3696 }
3697 }
3698 pub fn directory_opts(
3706 &self,
3707 path: impl Into<String>,
3708 opts: ContainerDirectoryOpts,
3709 ) -> Directory {
3710 let mut query = self.selection.select("directory");
3711 query = query.arg("path", path.into());
3712 if let Some(expand) = opts.expand {
3713 query = query.arg("expand", expand);
3714 }
3715 Directory {
3716 proc: self.proc.clone(),
3717 selection: query,
3718 graphql_client: self.graphql_client.clone(),
3719 }
3720 }
3721 pub fn file(&self, path: impl Into<String>) -> File {
3729 let mut query = self.selection.select("file");
3730 query = query.arg("path", path.into());
3731 File {
3732 proc: self.proc.clone(),
3733 selection: query,
3734 graphql_client: self.graphql_client.clone(),
3735 }
3736 }
3737 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3745 let mut query = self.selection.select("file");
3746 query = query.arg("path", path.into());
3747 if let Some(expand) = opts.expand {
3748 query = query.arg("expand", expand);
3749 }
3750 File {
3751 proc: self.proc.clone(),
3752 selection: query,
3753 graphql_client: self.graphql_client.clone(),
3754 }
3755 }
3756 pub async fn user(&self) -> Result<String, DaggerError> {
3758 let query = self.selection.select("user");
3759 query.execute(self.graphql_client.clone()).await
3760 }
3761 pub fn with_user(&self, name: impl Into<String>) -> Container {
3767 let mut query = self.selection.select("withUser");
3768 query = query.arg("name", name.into());
3769 Container {
3770 proc: self.proc.clone(),
3771 selection: query,
3772 graphql_client: self.graphql_client.clone(),
3773 }
3774 }
3775 pub fn without_user(&self) -> Container {
3778 let query = self.selection.select("withoutUser");
3779 Container {
3780 proc: self.proc.clone(),
3781 selection: query,
3782 graphql_client: self.graphql_client.clone(),
3783 }
3784 }
3785 pub async fn workdir(&self) -> Result<String, DaggerError> {
3787 let query = self.selection.select("workdir");
3788 query.execute(self.graphql_client.clone()).await
3789 }
3790 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3797 let mut query = self.selection.select("withWorkdir");
3798 query = query.arg("path", path.into());
3799 Container {
3800 proc: self.proc.clone(),
3801 selection: query,
3802 graphql_client: self.graphql_client.clone(),
3803 }
3804 }
3805 pub fn with_workdir_opts(
3812 &self,
3813 path: impl Into<String>,
3814 opts: ContainerWithWorkdirOpts,
3815 ) -> Container {
3816 let mut query = self.selection.select("withWorkdir");
3817 query = query.arg("path", path.into());
3818 if let Some(expand) = opts.expand {
3819 query = query.arg("expand", expand);
3820 }
3821 Container {
3822 proc: self.proc.clone(),
3823 selection: query,
3824 graphql_client: self.graphql_client.clone(),
3825 }
3826 }
3827 pub fn without_workdir(&self) -> Container {
3830 let query = self.selection.select("withoutWorkdir");
3831 Container {
3832 proc: self.proc.clone(),
3833 selection: query,
3834 graphql_client: self.graphql_client.clone(),
3835 }
3836 }
3837 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
3839 let query = self.selection.select("envVariables");
3840 let query = query.select("id");
3841 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
3842 Ok(ids
3843 .into_iter()
3844 .map(|id| EnvVariable {
3845 proc: self.proc.clone(),
3846 selection: crate::querybuilder::query()
3847 .select("node")
3848 .arg("id", &id.0)
3849 .inline_fragment("EnvVariable"),
3850 graphql_client: self.graphql_client.clone(),
3851 })
3852 .collect())
3853 }
3854 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3860 let mut query = self.selection.select("envVariable");
3861 query = query.arg("name", name.into());
3862 query.execute(self.graphql_client.clone()).await
3863 }
3864 pub fn with_env_variable(
3872 &self,
3873 name: impl Into<String>,
3874 value: impl Into<String>,
3875 ) -> Container {
3876 let mut query = self.selection.select("withEnvVariable");
3877 query = query.arg("name", name.into());
3878 query = query.arg("value", value.into());
3879 Container {
3880 proc: self.proc.clone(),
3881 selection: query,
3882 graphql_client: self.graphql_client.clone(),
3883 }
3884 }
3885 pub fn with_env_variable_opts(
3893 &self,
3894 name: impl Into<String>,
3895 value: impl Into<String>,
3896 opts: ContainerWithEnvVariableOpts,
3897 ) -> Container {
3898 let mut query = self.selection.select("withEnvVariable");
3899 query = query.arg("name", name.into());
3900 query = query.arg("value", value.into());
3901 if let Some(expand) = opts.expand {
3902 query = query.arg("expand", expand);
3903 }
3904 Container {
3905 proc: self.proc.clone(),
3906 selection: query,
3907 graphql_client: self.graphql_client.clone(),
3908 }
3909 }
3910 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
3916 let mut query = self.selection.select("withEnvFileVariables");
3917 query = query.arg_lazy(
3918 "source",
3919 Box::new(move || {
3920 let source = source.clone();
3921 Box::pin(async move { source.into_id().await.unwrap().quote() })
3922 }),
3923 );
3924 Container {
3925 proc: self.proc.clone(),
3926 selection: query,
3927 graphql_client: self.graphql_client.clone(),
3928 }
3929 }
3930 pub fn with_secret_variable(
3937 &self,
3938 name: impl Into<String>,
3939 secret: impl IntoID<Id>,
3940 ) -> Container {
3941 let mut query = self.selection.select("withSecretVariable");
3942 query = query.arg("name", name.into());
3943 query = query.arg_lazy(
3944 "secret",
3945 Box::new(move || {
3946 let secret = secret.clone();
3947 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3948 }),
3949 );
3950 Container {
3951 proc: self.proc.clone(),
3952 selection: query,
3953 graphql_client: self.graphql_client.clone(),
3954 }
3955 }
3956 pub fn with_volatile_variable(
3964 &self,
3965 name: impl Into<String>,
3966 value: impl Into<String>,
3967 ) -> Container {
3968 let mut query = self.selection.select("withVolatileVariable");
3969 query = query.arg("name", name.into());
3970 query = query.arg("value", value.into());
3971 Container {
3972 proc: self.proc.clone(),
3973 selection: query,
3974 graphql_client: self.graphql_client.clone(),
3975 }
3976 }
3977 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3983 let mut query = self.selection.select("withoutEnvVariable");
3984 query = query.arg("name", name.into());
3985 Container {
3986 proc: self.proc.clone(),
3987 selection: query,
3988 graphql_client: self.graphql_client.clone(),
3989 }
3990 }
3991 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
3997 let mut query = self.selection.select("withoutSecretVariable");
3998 query = query.arg("name", name.into());
3999 Container {
4000 proc: self.proc.clone(),
4001 selection: query,
4002 graphql_client: self.graphql_client.clone(),
4003 }
4004 }
4005 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4011 let mut query = self.selection.select("withoutVolatileVariable");
4012 query = query.arg("name", name.into());
4013 Container {
4014 proc: self.proc.clone(),
4015 selection: query,
4016 graphql_client: self.graphql_client.clone(),
4017 }
4018 }
4019 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4026 let mut query = self.selection.select("withLabel");
4027 query = query.arg("name", name.into());
4028 query = query.arg("value", value.into());
4029 Container {
4030 proc: self.proc.clone(),
4031 selection: query,
4032 graphql_client: self.graphql_client.clone(),
4033 }
4034 }
4035 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
4041 let mut query = self.selection.select("label");
4042 query = query.arg("name", name.into());
4043 query.execute(self.graphql_client.clone()).await
4044 }
4045 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
4047 let query = self.selection.select("labels");
4048 let query = query.select("id");
4049 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4050 Ok(ids
4051 .into_iter()
4052 .map(|id| Label {
4053 proc: self.proc.clone(),
4054 selection: crate::querybuilder::query()
4055 .select("node")
4056 .arg("id", &id.0)
4057 .inline_fragment("Label"),
4058 graphql_client: self.graphql_client.clone(),
4059 })
4060 .collect())
4061 }
4062 pub fn without_label(&self, name: impl Into<String>) -> Container {
4068 let mut query = self.selection.select("withoutLabel");
4069 query = query.arg("name", name.into());
4070 Container {
4071 proc: self.proc.clone(),
4072 selection: query,
4073 graphql_client: self.graphql_client.clone(),
4074 }
4075 }
4076 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4083 let mut query = self.selection.select("withDockerHealthcheck");
4084 query = query.arg(
4085 "args",
4086 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4087 );
4088 Container {
4089 proc: self.proc.clone(),
4090 selection: query,
4091 graphql_client: self.graphql_client.clone(),
4092 }
4093 }
4094 pub fn with_docker_healthcheck_opts<'a>(
4101 &self,
4102 args: Vec<impl Into<String>>,
4103 opts: ContainerWithDockerHealthcheckOpts<'a>,
4104 ) -> Container {
4105 let mut query = self.selection.select("withDockerHealthcheck");
4106 query = query.arg(
4107 "args",
4108 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4109 );
4110 if let Some(shell) = opts.shell {
4111 query = query.arg("shell", shell);
4112 }
4113 if let Some(interval) = opts.interval {
4114 query = query.arg("interval", interval);
4115 }
4116 if let Some(timeout) = opts.timeout {
4117 query = query.arg("timeout", timeout);
4118 }
4119 if let Some(start_period) = opts.start_period {
4120 query = query.arg("startPeriod", start_period);
4121 }
4122 if let Some(start_interval) = opts.start_interval {
4123 query = query.arg("startInterval", start_interval);
4124 }
4125 if let Some(retries) = opts.retries {
4126 query = query.arg("retries", retries);
4127 }
4128 Container {
4129 proc: self.proc.clone(),
4130 selection: query,
4131 graphql_client: self.graphql_client.clone(),
4132 }
4133 }
4134 pub fn without_docker_healthcheck(&self) -> Container {
4136 let query = self.selection.select("withoutDockerHealthcheck");
4137 Container {
4138 proc: self.proc.clone(),
4139 selection: query,
4140 graphql_client: self.graphql_client.clone(),
4141 }
4142 }
4143 pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
4145 let query = self.selection.select("dockerHealthcheck");
4146 let query = query.select("id");
4147 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
4148 Ok(id.map(|id| HealthcheckConfig {
4149 proc: self.proc.clone(),
4150 selection: query
4151 .root()
4152 .select("node")
4153 .arg("id", &id.0)
4154 .inline_fragment("HealthcheckConfig"),
4155 graphql_client: self.graphql_client.clone(),
4156 }))
4157 }
4158 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
4160 let query = self.selection.select("entrypoint");
4161 query.execute(self.graphql_client.clone()).await
4162 }
4163 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4170 let mut query = self.selection.select("withEntrypoint");
4171 query = query.arg(
4172 "args",
4173 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4174 );
4175 Container {
4176 proc: self.proc.clone(),
4177 selection: query,
4178 graphql_client: self.graphql_client.clone(),
4179 }
4180 }
4181 pub fn with_entrypoint_opts(
4188 &self,
4189 args: Vec<impl Into<String>>,
4190 opts: ContainerWithEntrypointOpts,
4191 ) -> Container {
4192 let mut query = self.selection.select("withEntrypoint");
4193 query = query.arg(
4194 "args",
4195 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4196 );
4197 if let Some(keep_default_args) = opts.keep_default_args {
4198 query = query.arg("keepDefaultArgs", keep_default_args);
4199 }
4200 Container {
4201 proc: self.proc.clone(),
4202 selection: query,
4203 graphql_client: self.graphql_client.clone(),
4204 }
4205 }
4206 pub fn without_entrypoint(&self) -> Container {
4212 let query = self.selection.select("withoutEntrypoint");
4213 Container {
4214 proc: self.proc.clone(),
4215 selection: query,
4216 graphql_client: self.graphql_client.clone(),
4217 }
4218 }
4219 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4225 let mut query = self.selection.select("withoutEntrypoint");
4226 if let Some(keep_default_args) = opts.keep_default_args {
4227 query = query.arg("keepDefaultArgs", keep_default_args);
4228 }
4229 Container {
4230 proc: self.proc.clone(),
4231 selection: query,
4232 graphql_client: self.graphql_client.clone(),
4233 }
4234 }
4235 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
4237 let query = self.selection.select("defaultArgs");
4238 query.execute(self.graphql_client.clone()).await
4239 }
4240 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4246 let mut query = self.selection.select("withDefaultArgs");
4247 query = query.arg(
4248 "args",
4249 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4250 );
4251 Container {
4252 proc: self.proc.clone(),
4253 selection: query,
4254 graphql_client: self.graphql_client.clone(),
4255 }
4256 }
4257 pub fn without_default_args(&self) -> Container {
4259 let query = self.selection.select("withoutDefaultArgs");
4260 Container {
4261 proc: self.proc.clone(),
4262 selection: query,
4263 graphql_client: self.graphql_client.clone(),
4264 }
4265 }
4266 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
4268 let query = self.selection.select("mounts");
4269 query.execute(self.graphql_client.clone()).await
4270 }
4271 pub fn with_mounted_directory(
4279 &self,
4280 path: impl Into<String>,
4281 source: impl IntoID<Id>,
4282 ) -> Container {
4283 let mut query = self.selection.select("withMountedDirectory");
4284 query = query.arg("path", path.into());
4285 query = query.arg_lazy(
4286 "source",
4287 Box::new(move || {
4288 let source = source.clone();
4289 Box::pin(async move { source.into_id().await.unwrap().quote() })
4290 }),
4291 );
4292 Container {
4293 proc: self.proc.clone(),
4294 selection: query,
4295 graphql_client: self.graphql_client.clone(),
4296 }
4297 }
4298 pub fn with_mounted_directory_opts<'a>(
4306 &self,
4307 path: impl Into<String>,
4308 source: impl IntoID<Id>,
4309 opts: ContainerWithMountedDirectoryOpts<'a>,
4310 ) -> Container {
4311 let mut query = self.selection.select("withMountedDirectory");
4312 query = query.arg("path", path.into());
4313 query = query.arg_lazy(
4314 "source",
4315 Box::new(move || {
4316 let source = source.clone();
4317 Box::pin(async move { source.into_id().await.unwrap().quote() })
4318 }),
4319 );
4320 if let Some(owner) = opts.owner {
4321 query = query.arg("owner", owner);
4322 }
4323 if let Some(inherit_owner) = opts.inherit_owner {
4324 query = query.arg("inheritOwner", inherit_owner);
4325 }
4326 if let Some(read_only) = opts.read_only {
4327 query = query.arg("readOnly", read_only);
4328 }
4329 if let Some(expand) = opts.expand {
4330 query = query.arg("expand", expand);
4331 }
4332 Container {
4333 proc: self.proc.clone(),
4334 selection: query,
4335 graphql_client: self.graphql_client.clone(),
4336 }
4337 }
4338 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4346 let mut query = self.selection.select("withMountedFile");
4347 query = query.arg("path", path.into());
4348 query = query.arg_lazy(
4349 "source",
4350 Box::new(move || {
4351 let source = source.clone();
4352 Box::pin(async move { source.into_id().await.unwrap().quote() })
4353 }),
4354 );
4355 Container {
4356 proc: self.proc.clone(),
4357 selection: query,
4358 graphql_client: self.graphql_client.clone(),
4359 }
4360 }
4361 pub fn with_mounted_file_opts<'a>(
4369 &self,
4370 path: impl Into<String>,
4371 source: impl IntoID<Id>,
4372 opts: ContainerWithMountedFileOpts<'a>,
4373 ) -> Container {
4374 let mut query = self.selection.select("withMountedFile");
4375 query = query.arg("path", path.into());
4376 query = query.arg_lazy(
4377 "source",
4378 Box::new(move || {
4379 let source = source.clone();
4380 Box::pin(async move { source.into_id().await.unwrap().quote() })
4381 }),
4382 );
4383 if let Some(owner) = opts.owner {
4384 query = query.arg("owner", owner);
4385 }
4386 if let Some(inherit_owner) = opts.inherit_owner {
4387 query = query.arg("inheritOwner", inherit_owner);
4388 }
4389 if let Some(expand) = opts.expand {
4390 query = query.arg("expand", expand);
4391 }
4392 Container {
4393 proc: self.proc.clone(),
4394 selection: query,
4395 graphql_client: self.graphql_client.clone(),
4396 }
4397 }
4398 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4405 let mut query = self.selection.select("withMountedTemp");
4406 query = query.arg("path", path.into());
4407 Container {
4408 proc: self.proc.clone(),
4409 selection: query,
4410 graphql_client: self.graphql_client.clone(),
4411 }
4412 }
4413 pub fn with_mounted_temp_opts(
4420 &self,
4421 path: impl Into<String>,
4422 opts: ContainerWithMountedTempOpts,
4423 ) -> Container {
4424 let mut query = self.selection.select("withMountedTemp");
4425 query = query.arg("path", path.into());
4426 if let Some(size) = opts.size {
4427 query = query.arg("size", size);
4428 }
4429 if let Some(expand) = opts.expand {
4430 query = query.arg("expand", expand);
4431 }
4432 Container {
4433 proc: self.proc.clone(),
4434 selection: query,
4435 graphql_client: self.graphql_client.clone(),
4436 }
4437 }
4438 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
4446 let mut query = self.selection.select("withMountedCache");
4447 query = query.arg("path", path.into());
4448 query = query.arg_lazy(
4449 "cache",
4450 Box::new(move || {
4451 let cache = cache.clone();
4452 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4453 }),
4454 );
4455 Container {
4456 proc: self.proc.clone(),
4457 selection: query,
4458 graphql_client: self.graphql_client.clone(),
4459 }
4460 }
4461 pub fn with_mounted_cache_opts<'a>(
4469 &self,
4470 path: impl Into<String>,
4471 cache: impl IntoID<Id>,
4472 opts: ContainerWithMountedCacheOpts<'a>,
4473 ) -> Container {
4474 let mut query = self.selection.select("withMountedCache");
4475 query = query.arg("path", path.into());
4476 query = query.arg_lazy(
4477 "cache",
4478 Box::new(move || {
4479 let cache = cache.clone();
4480 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4481 }),
4482 );
4483 if let Some(source) = opts.source {
4484 query = query.arg("source", source);
4485 }
4486 if let Some(sharing) = opts.sharing {
4487 query = query.arg("sharing", sharing);
4488 }
4489 if let Some(owner) = opts.owner {
4490 query = query.arg("owner", owner);
4491 }
4492 if let Some(inherit_owner) = opts.inherit_owner {
4493 query = query.arg("inheritOwner", inherit_owner);
4494 }
4495 if let Some(expand) = opts.expand {
4496 query = query.arg("expand", expand);
4497 }
4498 Container {
4499 proc: self.proc.clone(),
4500 selection: query,
4501 graphql_client: self.graphql_client.clone(),
4502 }
4503 }
4504 pub fn with_mounted_volume(
4512 &self,
4513 path: impl Into<String>,
4514 volume: impl IntoID<Id>,
4515 ) -> Container {
4516 let mut query = self.selection.select("withMountedVolume");
4517 query = query.arg("path", path.into());
4518 query = query.arg_lazy(
4519 "volume",
4520 Box::new(move || {
4521 let volume = volume.clone();
4522 Box::pin(async move { volume.into_id().await.unwrap().quote() })
4523 }),
4524 );
4525 Container {
4526 proc: self.proc.clone(),
4527 selection: query,
4528 graphql_client: self.graphql_client.clone(),
4529 }
4530 }
4531 pub fn with_mounted_volume_opts(
4539 &self,
4540 path: impl Into<String>,
4541 volume: impl IntoID<Id>,
4542 opts: ContainerWithMountedVolumeOpts,
4543 ) -> Container {
4544 let mut query = self.selection.select("withMountedVolume");
4545 query = query.arg("path", path.into());
4546 query = query.arg_lazy(
4547 "volume",
4548 Box::new(move || {
4549 let volume = volume.clone();
4550 Box::pin(async move { volume.into_id().await.unwrap().quote() })
4551 }),
4552 );
4553 if let Some(read_only) = opts.read_only {
4554 query = query.arg("readOnly", read_only);
4555 }
4556 if let Some(expand) = opts.expand {
4557 query = query.arg("expand", expand);
4558 }
4559 Container {
4560 proc: self.proc.clone(),
4561 selection: query,
4562 graphql_client: self.graphql_client.clone(),
4563 }
4564 }
4565 pub fn with_mounted_secret(
4573 &self,
4574 path: impl Into<String>,
4575 source: impl IntoID<Id>,
4576 ) -> Container {
4577 let mut query = self.selection.select("withMountedSecret");
4578 query = query.arg("path", path.into());
4579 query = query.arg_lazy(
4580 "source",
4581 Box::new(move || {
4582 let source = source.clone();
4583 Box::pin(async move { source.into_id().await.unwrap().quote() })
4584 }),
4585 );
4586 Container {
4587 proc: self.proc.clone(),
4588 selection: query,
4589 graphql_client: self.graphql_client.clone(),
4590 }
4591 }
4592 pub fn with_mounted_secret_opts<'a>(
4600 &self,
4601 path: impl Into<String>,
4602 source: impl IntoID<Id>,
4603 opts: ContainerWithMountedSecretOpts<'a>,
4604 ) -> Container {
4605 let mut query = self.selection.select("withMountedSecret");
4606 query = query.arg("path", path.into());
4607 query = query.arg_lazy(
4608 "source",
4609 Box::new(move || {
4610 let source = source.clone();
4611 Box::pin(async move { source.into_id().await.unwrap().quote() })
4612 }),
4613 );
4614 if let Some(owner) = opts.owner {
4615 query = query.arg("owner", owner);
4616 }
4617 if let Some(inherit_owner) = opts.inherit_owner {
4618 query = query.arg("inheritOwner", inherit_owner);
4619 }
4620 if let Some(mode) = opts.mode {
4621 query = query.arg("mode", mode);
4622 }
4623 if let Some(expand) = opts.expand {
4624 query = query.arg("expand", expand);
4625 }
4626 Container {
4627 proc: self.proc.clone(),
4628 selection: query,
4629 graphql_client: self.graphql_client.clone(),
4630 }
4631 }
4632 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4640 let mut query = self.selection.select("withUnixSocket");
4641 query = query.arg("path", path.into());
4642 query = query.arg_lazy(
4643 "source",
4644 Box::new(move || {
4645 let source = source.clone();
4646 Box::pin(async move { source.into_id().await.unwrap().quote() })
4647 }),
4648 );
4649 Container {
4650 proc: self.proc.clone(),
4651 selection: query,
4652 graphql_client: self.graphql_client.clone(),
4653 }
4654 }
4655 pub fn with_unix_socket_opts<'a>(
4663 &self,
4664 path: impl Into<String>,
4665 source: impl IntoID<Id>,
4666 opts: ContainerWithUnixSocketOpts<'a>,
4667 ) -> Container {
4668 let mut query = self.selection.select("withUnixSocket");
4669 query = query.arg("path", path.into());
4670 query = query.arg_lazy(
4671 "source",
4672 Box::new(move || {
4673 let source = source.clone();
4674 Box::pin(async move { source.into_id().await.unwrap().quote() })
4675 }),
4676 );
4677 if let Some(owner) = opts.owner {
4678 query = query.arg("owner", owner);
4679 }
4680 if let Some(inherit_owner) = opts.inherit_owner {
4681 query = query.arg("inheritOwner", inherit_owner);
4682 }
4683 if let Some(expand) = opts.expand {
4684 query = query.arg("expand", expand);
4685 }
4686 Container {
4687 proc: self.proc.clone(),
4688 selection: query,
4689 graphql_client: self.graphql_client.clone(),
4690 }
4691 }
4692 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4699 let mut query = self.selection.select("withoutUnixSocket");
4700 query = query.arg("path", path.into());
4701 Container {
4702 proc: self.proc.clone(),
4703 selection: query,
4704 graphql_client: self.graphql_client.clone(),
4705 }
4706 }
4707 pub fn without_unix_socket_opts(
4714 &self,
4715 path: impl Into<String>,
4716 opts: ContainerWithoutUnixSocketOpts,
4717 ) -> Container {
4718 let mut query = self.selection.select("withoutUnixSocket");
4719 query = query.arg("path", path.into());
4720 if let Some(expand) = opts.expand {
4721 query = query.arg("expand", expand);
4722 }
4723 Container {
4724 proc: self.proc.clone(),
4725 selection: query,
4726 graphql_client: self.graphql_client.clone(),
4727 }
4728 }
4729 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4736 let mut query = self.selection.select("withoutMount");
4737 query = query.arg("path", path.into());
4738 Container {
4739 proc: self.proc.clone(),
4740 selection: query,
4741 graphql_client: self.graphql_client.clone(),
4742 }
4743 }
4744 pub fn without_mount_opts(
4751 &self,
4752 path: impl Into<String>,
4753 opts: ContainerWithoutMountOpts,
4754 ) -> Container {
4755 let mut query = self.selection.select("withoutMount");
4756 query = query.arg("path", path.into());
4757 if let Some(expand) = opts.expand {
4758 query = query.arg("expand", expand);
4759 }
4760 Container {
4761 proc: self.proc.clone(),
4762 selection: query,
4763 graphql_client: self.graphql_client.clone(),
4764 }
4765 }
4766 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4774 let mut query = self.selection.select("withFile");
4775 query = query.arg("path", path.into());
4776 query = query.arg_lazy(
4777 "source",
4778 Box::new(move || {
4779 let source = source.clone();
4780 Box::pin(async move { source.into_id().await.unwrap().quote() })
4781 }),
4782 );
4783 Container {
4784 proc: self.proc.clone(),
4785 selection: query,
4786 graphql_client: self.graphql_client.clone(),
4787 }
4788 }
4789 pub fn with_file_opts<'a>(
4797 &self,
4798 path: impl Into<String>,
4799 source: impl IntoID<Id>,
4800 opts: ContainerWithFileOpts<'a>,
4801 ) -> Container {
4802 let mut query = self.selection.select("withFile");
4803 query = query.arg("path", path.into());
4804 query = query.arg_lazy(
4805 "source",
4806 Box::new(move || {
4807 let source = source.clone();
4808 Box::pin(async move { source.into_id().await.unwrap().quote() })
4809 }),
4810 );
4811 if let Some(permissions) = opts.permissions {
4812 query = query.arg("permissions", permissions);
4813 }
4814 if let Some(owner) = opts.owner {
4815 query = query.arg("owner", owner);
4816 }
4817 if let Some(inherit_owner) = opts.inherit_owner {
4818 query = query.arg("inheritOwner", inherit_owner);
4819 }
4820 if let Some(expand) = opts.expand {
4821 query = query.arg("expand", expand);
4822 }
4823 Container {
4824 proc: self.proc.clone(),
4825 selection: query,
4826 graphql_client: self.graphql_client.clone(),
4827 }
4828 }
4829 pub fn without_file(&self, path: impl Into<String>) -> Container {
4836 let mut query = self.selection.select("withoutFile");
4837 query = query.arg("path", path.into());
4838 Container {
4839 proc: self.proc.clone(),
4840 selection: query,
4841 graphql_client: self.graphql_client.clone(),
4842 }
4843 }
4844 pub fn without_file_opts(
4851 &self,
4852 path: impl Into<String>,
4853 opts: ContainerWithoutFileOpts,
4854 ) -> Container {
4855 let mut query = self.selection.select("withoutFile");
4856 query = query.arg("path", path.into());
4857 if let Some(expand) = opts.expand {
4858 query = query.arg("expand", expand);
4859 }
4860 Container {
4861 proc: self.proc.clone(),
4862 selection: query,
4863 graphql_client: self.graphql_client.clone(),
4864 }
4865 }
4866 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4873 let mut query = self.selection.select("withoutFiles");
4874 query = query.arg(
4875 "paths",
4876 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4877 );
4878 Container {
4879 proc: self.proc.clone(),
4880 selection: query,
4881 graphql_client: self.graphql_client.clone(),
4882 }
4883 }
4884 pub fn without_files_opts(
4891 &self,
4892 paths: Vec<impl Into<String>>,
4893 opts: ContainerWithoutFilesOpts,
4894 ) -> Container {
4895 let mut query = self.selection.select("withoutFiles");
4896 query = query.arg(
4897 "paths",
4898 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4899 );
4900 if let Some(expand) = opts.expand {
4901 query = query.arg("expand", expand);
4902 }
4903 Container {
4904 proc: self.proc.clone(),
4905 selection: query,
4906 graphql_client: self.graphql_client.clone(),
4907 }
4908 }
4909 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
4917 let mut query = self.selection.select("withFiles");
4918 query = query.arg("path", path.into());
4919 query = query.arg("sources", sources);
4920 Container {
4921 proc: self.proc.clone(),
4922 selection: query,
4923 graphql_client: self.graphql_client.clone(),
4924 }
4925 }
4926 pub fn with_files_opts<'a>(
4934 &self,
4935 path: impl Into<String>,
4936 sources: Vec<Id>,
4937 opts: ContainerWithFilesOpts<'a>,
4938 ) -> Container {
4939 let mut query = self.selection.select("withFiles");
4940 query = query.arg("path", path.into());
4941 query = query.arg("sources", sources);
4942 if let Some(permissions) = opts.permissions {
4943 query = query.arg("permissions", permissions);
4944 }
4945 if let Some(owner) = opts.owner {
4946 query = query.arg("owner", owner);
4947 }
4948 if let Some(inherit_owner) = opts.inherit_owner {
4949 query = query.arg("inheritOwner", inherit_owner);
4950 }
4951 if let Some(expand) = opts.expand {
4952 query = query.arg("expand", expand);
4953 }
4954 Container {
4955 proc: self.proc.clone(),
4956 selection: query,
4957 graphql_client: self.graphql_client.clone(),
4958 }
4959 }
4960 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4968 let mut query = self.selection.select("withNewFile");
4969 query = query.arg("path", path.into());
4970 query = query.arg("contents", contents.into());
4971 Container {
4972 proc: self.proc.clone(),
4973 selection: query,
4974 graphql_client: self.graphql_client.clone(),
4975 }
4976 }
4977 pub fn with_new_file_opts<'a>(
4985 &self,
4986 path: impl Into<String>,
4987 contents: impl Into<String>,
4988 opts: ContainerWithNewFileOpts<'a>,
4989 ) -> Container {
4990 let mut query = self.selection.select("withNewFile");
4991 query = query.arg("path", path.into());
4992 query = query.arg("contents", contents.into());
4993 if let Some(permissions) = opts.permissions {
4994 query = query.arg("permissions", permissions);
4995 }
4996 if let Some(owner) = opts.owner {
4997 query = query.arg("owner", owner);
4998 }
4999 if let Some(inherit_owner) = opts.inherit_owner {
5000 query = query.arg("inheritOwner", inherit_owner);
5001 }
5002 if let Some(expand) = opts.expand {
5003 query = query.arg("expand", expand);
5004 }
5005 Container {
5006 proc: self.proc.clone(),
5007 selection: query,
5008 graphql_client: self.graphql_client.clone(),
5009 }
5010 }
5011 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
5019 let mut query = self.selection.select("withDirectory");
5020 query = query.arg("path", path.into());
5021 query = query.arg_lazy(
5022 "source",
5023 Box::new(move || {
5024 let source = source.clone();
5025 Box::pin(async move { source.into_id().await.unwrap().quote() })
5026 }),
5027 );
5028 Container {
5029 proc: self.proc.clone(),
5030 selection: query,
5031 graphql_client: self.graphql_client.clone(),
5032 }
5033 }
5034 pub fn with_directory_opts<'a>(
5042 &self,
5043 path: impl Into<String>,
5044 source: impl IntoID<Id>,
5045 opts: ContainerWithDirectoryOpts<'a>,
5046 ) -> Container {
5047 let mut query = self.selection.select("withDirectory");
5048 query = query.arg("path", path.into());
5049 query = query.arg_lazy(
5050 "source",
5051 Box::new(move || {
5052 let source = source.clone();
5053 Box::pin(async move { source.into_id().await.unwrap().quote() })
5054 }),
5055 );
5056 if let Some(exclude) = opts.exclude {
5057 query = query.arg("exclude", exclude);
5058 }
5059 if let Some(include) = opts.include {
5060 query = query.arg("include", include);
5061 }
5062 if let Some(gitignore) = opts.gitignore {
5063 query = query.arg("gitignore", gitignore);
5064 }
5065 if let Some(owner) = opts.owner {
5066 query = query.arg("owner", owner);
5067 }
5068 if let Some(inherit_owner) = opts.inherit_owner {
5069 query = query.arg("inheritOwner", inherit_owner);
5070 }
5071 if let Some(expand) = opts.expand {
5072 query = query.arg("expand", expand);
5073 }
5074 if let Some(permissions) = opts.permissions {
5075 query = query.arg("permissions", permissions);
5076 }
5077 Container {
5078 proc: self.proc.clone(),
5079 selection: query,
5080 graphql_client: self.graphql_client.clone(),
5081 }
5082 }
5083 pub fn without_directory(&self, path: impl Into<String>) -> Container {
5090 let mut query = self.selection.select("withoutDirectory");
5091 query = query.arg("path", path.into());
5092 Container {
5093 proc: self.proc.clone(),
5094 selection: query,
5095 graphql_client: self.graphql_client.clone(),
5096 }
5097 }
5098 pub fn without_directory_opts(
5105 &self,
5106 path: impl Into<String>,
5107 opts: ContainerWithoutDirectoryOpts,
5108 ) -> Container {
5109 let mut query = self.selection.select("withoutDirectory");
5110 query = query.arg("path", path.into());
5111 if let Some(expand) = opts.expand {
5112 query = query.arg("expand", expand);
5113 }
5114 Container {
5115 proc: self.proc.clone(),
5116 selection: query,
5117 graphql_client: self.graphql_client.clone(),
5118 }
5119 }
5120 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5127 let mut query = self.selection.select("exists");
5128 query = query.arg("path", path.into());
5129 query.execute(self.graphql_client.clone()).await
5130 }
5131 pub async fn exists_opts(
5138 &self,
5139 path: impl Into<String>,
5140 opts: ContainerExistsOpts,
5141 ) -> Result<bool, DaggerError> {
5142 let mut query = self.selection.select("exists");
5143 query = query.arg("path", path.into());
5144 if let Some(expected_type) = opts.expected_type {
5145 query = query.arg("expectedType", expected_type);
5146 }
5147 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5148 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5149 }
5150 if let Some(expand) = opts.expand {
5151 query = query.arg("expand", expand);
5152 }
5153 query.execute(self.graphql_client.clone()).await
5154 }
5155 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5162 let mut query = self.selection.select("stat");
5163 query = query.arg("path", path.into());
5164 let query = query.select("id");
5165 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5166 Ok(id.map(|id| Stat {
5167 proc: self.proc.clone(),
5168 selection: query
5169 .root()
5170 .select("node")
5171 .arg("id", &id.0)
5172 .inline_fragment("Stat"),
5173 graphql_client: self.graphql_client.clone(),
5174 }))
5175 }
5176 pub async fn stat_opts(
5183 &self,
5184 path: impl Into<String>,
5185 opts: ContainerStatOpts,
5186 ) -> Result<Option<Stat>, DaggerError> {
5187 let mut query = self.selection.select("stat");
5188 query = query.arg("path", path.into());
5189 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5190 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5191 }
5192 let query = query.select("id");
5193 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5194 Ok(id.map(|id| Stat {
5195 proc: self.proc.clone(),
5196 selection: query
5197 .root()
5198 .select("node")
5199 .arg("id", &id.0)
5200 .inline_fragment("Stat"),
5201 graphql_client: self.graphql_client.clone(),
5202 }))
5203 }
5204 pub fn with_error(&self, err: impl Into<String>) -> Container {
5210 let mut query = self.selection.select("withError");
5211 query = query.arg("err", err.into());
5212 Container {
5213 proc: self.proc.clone(),
5214 selection: query,
5215 graphql_client: self.graphql_client.clone(),
5216 }
5217 }
5218 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
5229 let mut query = self.selection.select("withExec");
5230 query = query.arg(
5231 "args",
5232 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5233 );
5234 Container {
5235 proc: self.proc.clone(),
5236 selection: query,
5237 graphql_client: self.graphql_client.clone(),
5238 }
5239 }
5240 pub fn with_exec_opts<'a>(
5251 &self,
5252 args: Vec<impl Into<String>>,
5253 opts: ContainerWithExecOpts<'a>,
5254 ) -> Container {
5255 let mut query = self.selection.select("withExec");
5256 query = query.arg(
5257 "args",
5258 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5259 );
5260 if let Some(use_entrypoint) = opts.use_entrypoint {
5261 query = query.arg("useEntrypoint", use_entrypoint);
5262 }
5263 if let Some(stdin) = opts.stdin {
5264 query = query.arg("stdin", stdin);
5265 }
5266 if let Some(redirect_stdin) = opts.redirect_stdin {
5267 query = query.arg("redirectStdin", redirect_stdin);
5268 }
5269 if let Some(redirect_stdout) = opts.redirect_stdout {
5270 query = query.arg("redirectStdout", redirect_stdout);
5271 }
5272 if let Some(redirect_stderr) = opts.redirect_stderr {
5273 query = query.arg("redirectStderr", redirect_stderr);
5274 }
5275 if let Some(expect) = opts.expect {
5276 query = query.arg("expect", expect);
5277 }
5278 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5279 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5280 }
5281 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5282 query = query.arg(
5283 "experimentalPrivilegedNesting",
5284 experimental_privileged_nesting,
5285 );
5286 }
5287 if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
5288 query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
5289 }
5290 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5291 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5292 }
5293 if let Some(expand) = opts.expand {
5294 query = query.arg("expand", expand);
5295 }
5296 if let Some(no_init) = opts.no_init {
5297 query = query.arg("noInit", no_init);
5298 }
5299 Container {
5300 proc: self.proc.clone(),
5301 selection: query,
5302 graphql_client: self.graphql_client.clone(),
5303 }
5304 }
5305 pub async fn stdout(&self) -> Result<String, DaggerError> {
5308 let query = self.selection.select("stdout");
5309 query.execute(self.graphql_client.clone()).await
5310 }
5311 pub async fn stderr(&self) -> Result<String, DaggerError> {
5314 let query = self.selection.select("stderr");
5315 query.execute(self.graphql_client.clone()).await
5316 }
5317 pub async fn combined_output(&self) -> Result<String, DaggerError> {
5320 let query = self.selection.select("combinedOutput");
5321 query.execute(self.graphql_client.clone()).await
5322 }
5323 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
5326 let query = self.selection.select("exitCode");
5327 query.execute(self.graphql_client.clone()).await
5328 }
5329 pub fn with_symlink(
5337 &self,
5338 target: impl Into<String>,
5339 link_name: impl Into<String>,
5340 ) -> Container {
5341 let mut query = self.selection.select("withSymlink");
5342 query = query.arg("target", target.into());
5343 query = query.arg("linkName", link_name.into());
5344 Container {
5345 proc: self.proc.clone(),
5346 selection: query,
5347 graphql_client: self.graphql_client.clone(),
5348 }
5349 }
5350 pub fn with_symlink_opts(
5358 &self,
5359 target: impl Into<String>,
5360 link_name: impl Into<String>,
5361 opts: ContainerWithSymlinkOpts,
5362 ) -> Container {
5363 let mut query = self.selection.select("withSymlink");
5364 query = query.arg("target", target.into());
5365 query = query.arg("linkName", link_name.into());
5366 if let Some(expand) = opts.expand {
5367 query = query.arg("expand", expand);
5368 }
5369 Container {
5370 proc: self.proc.clone(),
5371 selection: query,
5372 graphql_client: self.graphql_client.clone(),
5373 }
5374 }
5375 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
5382 let mut query = self.selection.select("withAnnotation");
5383 query = query.arg("name", name.into());
5384 query = query.arg("value", value.into());
5385 Container {
5386 proc: self.proc.clone(),
5387 selection: query,
5388 graphql_client: self.graphql_client.clone(),
5389 }
5390 }
5391 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5397 let mut query = self.selection.select("withoutAnnotation");
5398 query = query.arg("name", name.into());
5399 Container {
5400 proc: self.proc.clone(),
5401 selection: query,
5402 graphql_client: self.graphql_client.clone(),
5403 }
5404 }
5405 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
5415 let mut query = self.selection.select("publish");
5416 query = query.arg("address", address.into());
5417 query.execute(self.graphql_client.clone()).await
5418 }
5419 pub async fn publish_opts(
5429 &self,
5430 address: impl Into<String>,
5431 opts: ContainerPublishOpts,
5432 ) -> Result<String, DaggerError> {
5433 let mut query = self.selection.select("publish");
5434 query = query.arg("address", address.into());
5435 if let Some(platform_variants) = opts.platform_variants {
5436 query = query.arg("platformVariants", platform_variants);
5437 }
5438 if let Some(forced_compression) = opts.forced_compression {
5439 query = query.arg("forcedCompression", forced_compression);
5440 }
5441 if let Some(media_types) = opts.media_types {
5442 query = query.arg("mediaTypes", media_types);
5443 }
5444 if let Some(registry_service) = opts.registry_service {
5445 query = query.arg("registryService", registry_service);
5446 }
5447 if let Some(protocol) = opts.protocol {
5448 query = query.arg("protocol", protocol);
5449 }
5450 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
5451 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
5452 }
5453 query.execute(self.graphql_client.clone()).await
5454 }
5455 pub async fn platform(&self) -> Result<Platform, DaggerError> {
5457 let query = self.selection.select("platform");
5458 query.execute(self.graphql_client.clone()).await
5459 }
5460 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5470 let mut query = self.selection.select("export");
5471 query = query.arg("path", path.into());
5472 query.execute(self.graphql_client.clone()).await
5473 }
5474 pub async fn export_opts(
5484 &self,
5485 path: impl Into<String>,
5486 opts: ContainerExportOpts,
5487 ) -> Result<String, DaggerError> {
5488 let mut query = self.selection.select("export");
5489 query = query.arg("path", path.into());
5490 if let Some(platform_variants) = opts.platform_variants {
5491 query = query.arg("platformVariants", platform_variants);
5492 }
5493 if let Some(forced_compression) = opts.forced_compression {
5494 query = query.arg("forcedCompression", forced_compression);
5495 }
5496 if let Some(media_types) = opts.media_types {
5497 query = query.arg("mediaTypes", media_types);
5498 }
5499 if let Some(expand) = opts.expand {
5500 query = query.arg("expand", expand);
5501 }
5502 query.execute(self.graphql_client.clone()).await
5503 }
5504 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
5511 let mut query = self.selection.select("exportImage");
5512 query = query.arg("name", name.into());
5513 query.execute(self.graphql_client.clone()).await
5514 }
5515 pub async fn export_image_opts(
5522 &self,
5523 name: impl Into<String>,
5524 opts: ContainerExportImageOpts,
5525 ) -> Result<Void, DaggerError> {
5526 let mut query = self.selection.select("exportImage");
5527 query = query.arg("name", name.into());
5528 if let Some(platform_variants) = opts.platform_variants {
5529 query = query.arg("platformVariants", platform_variants);
5530 }
5531 if let Some(forced_compression) = opts.forced_compression {
5532 query = query.arg("forcedCompression", forced_compression);
5533 }
5534 if let Some(media_types) = opts.media_types {
5535 query = query.arg("mediaTypes", media_types);
5536 }
5537 query.execute(self.graphql_client.clone()).await
5538 }
5539 pub fn as_tarball(&self) -> File {
5545 let query = self.selection.select("asTarball");
5546 File {
5547 proc: self.proc.clone(),
5548 selection: query,
5549 graphql_client: self.graphql_client.clone(),
5550 }
5551 }
5552 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
5558 let mut query = self.selection.select("asTarball");
5559 if let Some(platform_variants) = opts.platform_variants {
5560 query = query.arg("platformVariants", platform_variants);
5561 }
5562 if let Some(forced_compression) = opts.forced_compression {
5563 query = query.arg("forcedCompression", forced_compression);
5564 }
5565 if let Some(media_types) = opts.media_types {
5566 query = query.arg("mediaTypes", media_types);
5567 }
5568 File {
5569 proc: self.proc.clone(),
5570 selection: query,
5571 graphql_client: self.graphql_client.clone(),
5572 }
5573 }
5574 pub fn import(&self, source: impl IntoID<Id>) -> Container {
5581 let mut query = self.selection.select("import");
5582 query = query.arg_lazy(
5583 "source",
5584 Box::new(move || {
5585 let source = source.clone();
5586 Box::pin(async move { source.into_id().await.unwrap().quote() })
5587 }),
5588 );
5589 Container {
5590 proc: self.proc.clone(),
5591 selection: query,
5592 graphql_client: self.graphql_client.clone(),
5593 }
5594 }
5595 pub fn import_opts<'a>(
5602 &self,
5603 source: impl IntoID<Id>,
5604 opts: ContainerImportOpts<'a>,
5605 ) -> Container {
5606 let mut query = self.selection.select("import");
5607 query = query.arg_lazy(
5608 "source",
5609 Box::new(move || {
5610 let source = source.clone();
5611 Box::pin(async move { source.into_id().await.unwrap().quote() })
5612 }),
5613 );
5614 if let Some(tag) = opts.tag {
5615 query = query.arg("tag", tag);
5616 }
5617 Container {
5618 proc: self.proc.clone(),
5619 selection: query,
5620 graphql_client: self.graphql_client.clone(),
5621 }
5622 }
5623 pub fn with_registry_auth(
5631 &self,
5632 address: impl Into<String>,
5633 username: impl Into<String>,
5634 secret: impl IntoID<Id>,
5635 ) -> Container {
5636 let mut query = self.selection.select("withRegistryAuth");
5637 query = query.arg("address", address.into());
5638 query = query.arg("username", username.into());
5639 query = query.arg_lazy(
5640 "secret",
5641 Box::new(move || {
5642 let secret = secret.clone();
5643 Box::pin(async move { secret.into_id().await.unwrap().quote() })
5644 }),
5645 );
5646 Container {
5647 proc: self.proc.clone(),
5648 selection: query,
5649 graphql_client: self.graphql_client.clone(),
5650 }
5651 }
5652 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5660 let mut query = self.selection.select("withoutRegistryAuth");
5661 query = query.arg("address", address.into());
5662 Container {
5663 proc: self.proc.clone(),
5664 selection: query,
5665 graphql_client: self.graphql_client.clone(),
5666 }
5667 }
5668 pub async fn image_ref(&self) -> Result<String, DaggerError> {
5670 let query = self.selection.select("imageRef");
5671 query.execute(self.graphql_client.clone()).await
5672 }
5673 pub fn manifest(&self) -> File {
5679 let query = self.selection.select("manifest");
5680 File {
5681 proc: self.proc.clone(),
5682 selection: query,
5683 graphql_client: self.graphql_client.clone(),
5684 }
5685 }
5686 pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
5692 let mut query = self.selection.select("manifest");
5693 if let Some(forced_compression) = opts.forced_compression {
5694 query = query.arg("forcedCompression", forced_compression);
5695 }
5696 if let Some(media_types) = opts.media_types {
5697 query = query.arg("mediaTypes", media_types);
5698 }
5699 File {
5700 proc: self.proc.clone(),
5701 selection: query,
5702 graphql_client: self.graphql_client.clone(),
5703 }
5704 }
5705 pub fn layer(&self, id: impl Into<String>) -> File {
5712 let mut query = self.selection.select("layer");
5713 query = query.arg("id", id.into());
5714 File {
5715 proc: self.proc.clone(),
5716 selection: query,
5717 graphql_client: self.graphql_client.clone(),
5718 }
5719 }
5720 pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
5727 let mut query = self.selection.select("layer");
5728 query = query.arg("id", id.into());
5729 if let Some(forced_compression) = opts.forced_compression {
5730 query = query.arg("forcedCompression", forced_compression);
5731 }
5732 if let Some(media_types) = opts.media_types {
5733 query = query.arg("mediaTypes", media_types);
5734 }
5735 File {
5736 proc: self.proc.clone(),
5737 selection: query,
5738 graphql_client: self.graphql_client.clone(),
5739 }
5740 }
5741 pub fn with_exposed_port(&self, port: isize) -> Container {
5751 let mut query = self.selection.select("withExposedPort");
5752 query = query.arg("port", port);
5753 Container {
5754 proc: self.proc.clone(),
5755 selection: query,
5756 graphql_client: self.graphql_client.clone(),
5757 }
5758 }
5759 pub fn with_exposed_port_opts<'a>(
5769 &self,
5770 port: isize,
5771 opts: ContainerWithExposedPortOpts<'a>,
5772 ) -> Container {
5773 let mut query = self.selection.select("withExposedPort");
5774 query = query.arg("port", port);
5775 if let Some(protocol) = opts.protocol {
5776 query = query.arg("protocol", protocol);
5777 }
5778 if let Some(description) = opts.description {
5779 query = query.arg("description", description);
5780 }
5781 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
5782 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
5783 }
5784 Container {
5785 proc: self.proc.clone(),
5786 selection: query,
5787 graphql_client: self.graphql_client.clone(),
5788 }
5789 }
5790 pub fn without_exposed_port(&self, port: isize) -> Container {
5797 let mut query = self.selection.select("withoutExposedPort");
5798 query = query.arg("port", port);
5799 Container {
5800 proc: self.proc.clone(),
5801 selection: query,
5802 graphql_client: self.graphql_client.clone(),
5803 }
5804 }
5805 pub fn without_exposed_port_opts(
5812 &self,
5813 port: isize,
5814 opts: ContainerWithoutExposedPortOpts,
5815 ) -> Container {
5816 let mut query = self.selection.select("withoutExposedPort");
5817 query = query.arg("port", port);
5818 if let Some(protocol) = opts.protocol {
5819 query = query.arg("protocol", protocol);
5820 }
5821 Container {
5822 proc: self.proc.clone(),
5823 selection: query,
5824 graphql_client: self.graphql_client.clone(),
5825 }
5826 }
5827 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
5830 let query = self.selection.select("exposedPorts");
5831 let query = query.select("id");
5832 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5833 Ok(ids
5834 .into_iter()
5835 .map(|id| Port {
5836 proc: self.proc.clone(),
5837 selection: crate::querybuilder::query()
5838 .select("node")
5839 .arg("id", &id.0)
5840 .inline_fragment("Port"),
5841 graphql_client: self.graphql_client.clone(),
5842 })
5843 .collect())
5844 }
5845 pub fn with_service_binding(
5855 &self,
5856 alias: impl Into<String>,
5857 service: impl IntoID<Id>,
5858 ) -> Container {
5859 let mut query = self.selection.select("withServiceBinding");
5860 query = query.arg("alias", alias.into());
5861 query = query.arg_lazy(
5862 "service",
5863 Box::new(move || {
5864 let service = service.clone();
5865 Box::pin(async move { service.into_id().await.unwrap().quote() })
5866 }),
5867 );
5868 Container {
5869 proc: self.proc.clone(),
5870 selection: query,
5871 graphql_client: self.graphql_client.clone(),
5872 }
5873 }
5874 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
5881 let mut query = self.selection.select("withDefaultTerminalCmd");
5882 query = query.arg(
5883 "args",
5884 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5885 );
5886 Container {
5887 proc: self.proc.clone(),
5888 selection: query,
5889 graphql_client: self.graphql_client.clone(),
5890 }
5891 }
5892 pub fn with_default_terminal_cmd_opts(
5899 &self,
5900 args: Vec<impl Into<String>>,
5901 opts: ContainerWithDefaultTerminalCmdOpts,
5902 ) -> Container {
5903 let mut query = self.selection.select("withDefaultTerminalCmd");
5904 query = query.arg(
5905 "args",
5906 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5907 );
5908 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5909 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5910 }
5911 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5912 query = query.arg(
5913 "experimentalPrivilegedNesting",
5914 experimental_privileged_nesting,
5915 );
5916 }
5917 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5918 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5919 }
5920 Container {
5921 proc: self.proc.clone(),
5922 selection: query,
5923 graphql_client: self.graphql_client.clone(),
5924 }
5925 }
5926 pub fn with_shell(&self, interactive: Vec<impl Into<String>>) -> Container {
5933 let mut query = self.selection.select("withShell");
5934 query = query.arg(
5935 "interactive",
5936 interactive
5937 .into_iter()
5938 .map(|i| i.into())
5939 .collect::<Vec<String>>(),
5940 );
5941 Container {
5942 proc: self.proc.clone(),
5943 selection: query,
5944 graphql_client: self.graphql_client.clone(),
5945 }
5946 }
5947 pub fn with_shell_opts<'a>(
5954 &self,
5955 interactive: Vec<impl Into<String>>,
5956 opts: ContainerWithShellOpts<'a>,
5957 ) -> Container {
5958 let mut query = self.selection.select("withShell");
5959 query = query.arg(
5960 "interactive",
5961 interactive
5962 .into_iter()
5963 .map(|i| i.into())
5964 .collect::<Vec<String>>(),
5965 );
5966 if let Some(batch) = opts.batch {
5967 query = query.arg("batch", batch);
5968 }
5969 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5970 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5971 }
5972 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5973 query = query.arg(
5974 "experimentalPrivilegedNesting",
5975 experimental_privileged_nesting,
5976 );
5977 }
5978 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5979 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5980 }
5981 Container {
5982 proc: self.proc.clone(),
5983 selection: query,
5984 graphql_client: self.graphql_client.clone(),
5985 }
5986 }
5987 pub fn shell(&self) -> Command {
5993 let query = self.selection.select("shell");
5994 Command {
5995 proc: self.proc.clone(),
5996 selection: query,
5997 graphql_client: self.graphql_client.clone(),
5998 }
5999 }
6000 pub fn shell_opts(&self, opts: ContainerShellOpts) -> Command {
6006 let mut query = self.selection.select("shell");
6007 if let Some(batch) = opts.batch {
6008 query = query.arg("batch", batch);
6009 }
6010 Command {
6011 proc: self.proc.clone(),
6012 selection: query,
6013 graphql_client: self.graphql_client.clone(),
6014 }
6015 }
6016 pub fn with_run(&self, command: impl Into<String>) -> Container {
6023 let mut query = self.selection.select("withRun");
6024 query = query.arg("command", command.into());
6025 Container {
6026 proc: self.proc.clone(),
6027 selection: query,
6028 graphql_client: self.graphql_client.clone(),
6029 }
6030 }
6031 pub fn with_run_opts<'a>(
6038 &self,
6039 command: impl Into<String>,
6040 opts: ContainerWithRunOpts<'a>,
6041 ) -> Container {
6042 let mut query = self.selection.select("withRun");
6043 query = query.arg("command", command.into());
6044 if let Some(shell) = opts.shell {
6045 query = query.arg("shell", shell);
6046 }
6047 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6048 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6049 }
6050 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6051 query = query.arg(
6052 "experimentalPrivilegedNesting",
6053 experimental_privileged_nesting,
6054 );
6055 }
6056 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6057 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6058 }
6059 Container {
6060 proc: self.proc.clone(),
6061 selection: query,
6062 graphql_client: self.graphql_client.clone(),
6063 }
6064 }
6065 pub fn terminal(&self) -> Container {
6071 let query = self.selection.select("terminal");
6072 Container {
6073 proc: self.proc.clone(),
6074 selection: query,
6075 graphql_client: self.graphql_client.clone(),
6076 }
6077 }
6078 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
6084 let mut query = self.selection.select("terminal");
6085 if let Some(cmd) = opts.cmd {
6086 query = query.arg("cmd", cmd);
6087 }
6088 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6089 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6090 }
6091 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6092 query = query.arg(
6093 "experimentalPrivilegedNesting",
6094 experimental_privileged_nesting,
6095 );
6096 }
6097 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6098 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6099 }
6100 Container {
6101 proc: self.proc.clone(),
6102 selection: query,
6103 graphql_client: self.graphql_client.clone(),
6104 }
6105 }
6106 pub fn with_gpu(&self) -> Container {
6109 let query = self.selection.select("withGPU");
6110 Container {
6111 proc: self.proc.clone(),
6112 selection: query,
6113 graphql_client: self.graphql_client.clone(),
6114 }
6115 }
6116 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
6123 let mut query = self.selection.select("experimentalWithGPU");
6124 query = query.arg(
6125 "devices",
6126 devices
6127 .into_iter()
6128 .map(|i| i.into())
6129 .collect::<Vec<String>>(),
6130 );
6131 Container {
6132 proc: self.proc.clone(),
6133 selection: query,
6134 graphql_client: self.graphql_client.clone(),
6135 }
6136 }
6137 pub fn experimental_with_all_gp_us(&self) -> Container {
6140 let query = self.selection.select("experimentalWithAllGPUs");
6141 Container {
6142 proc: self.proc.clone(),
6143 selection: query,
6144 graphql_client: self.graphql_client.clone(),
6145 }
6146 }
6147 pub fn as_service(&self) -> Service {
6154 let query = self.selection.select("asService");
6155 Service {
6156 proc: self.proc.clone(),
6157 selection: query,
6158 graphql_client: self.graphql_client.clone(),
6159 }
6160 }
6161 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
6168 let mut query = self.selection.select("asService");
6169 if let Some(args) = opts.args {
6170 query = query.arg("args", args);
6171 }
6172 if let Some(use_entrypoint) = opts.use_entrypoint {
6173 query = query.arg("useEntrypoint", use_entrypoint);
6174 }
6175 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6176 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6177 }
6178 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6179 query = query.arg(
6180 "experimentalPrivilegedNesting",
6181 experimental_privileged_nesting,
6182 );
6183 }
6184 if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6185 query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6186 }
6187 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6188 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6189 }
6190 if let Some(expand) = opts.expand {
6191 query = query.arg("expand", expand);
6192 }
6193 if let Some(no_init) = opts.no_init {
6194 query = query.arg("noInit", no_init);
6195 }
6196 Service {
6197 proc: self.proc.clone(),
6198 selection: query,
6199 graphql_client: self.graphql_client.clone(),
6200 }
6201 }
6202 pub async fn up(&self) -> Result<Void, DaggerError> {
6209 let query = self.selection.select("up");
6210 query.execute(self.graphql_client.clone()).await
6211 }
6212 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
6219 let mut query = self.selection.select("up");
6220 if let Some(random) = opts.random {
6221 query = query.arg("random", random);
6222 }
6223 if let Some(ports) = opts.ports {
6224 query = query.arg("ports", ports);
6225 }
6226 if let Some(args) = opts.args {
6227 query = query.arg("args", args);
6228 }
6229 if let Some(use_entrypoint) = opts.use_entrypoint {
6230 query = query.arg("useEntrypoint", use_entrypoint);
6231 }
6232 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6233 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6234 }
6235 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6236 query = query.arg(
6237 "experimentalPrivilegedNesting",
6238 experimental_privileged_nesting,
6239 );
6240 }
6241 if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6242 query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6243 }
6244 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6245 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6246 }
6247 if let Some(expand) = opts.expand {
6248 query = query.arg("expand", expand);
6249 }
6250 if let Some(no_init) = opts.no_init {
6251 query = query.arg("noInit", no_init);
6252 }
6253 query.execute(self.graphql_client.clone()).await
6254 }
6255}
6256impl Exportable for Container {
6257 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6258 let query = self.selection.select("id");
6259 let graphql_client = self.graphql_client.clone();
6260 async move { query.execute(graphql_client).await }
6261 }
6262 fn export(
6263 &self,
6264 path: impl Into<String>,
6265 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
6266 let mut query = self.selection.select("export");
6267 query = query.arg("path", path.into());
6268 let graphql_client = self.graphql_client.clone();
6269 async move { query.execute(graphql_client).await }
6270 }
6271}
6272impl Node for Container {
6273 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6274 let query = self.selection.select("id");
6275 let graphql_client = self.graphql_client.clone();
6276 async move { query.execute(graphql_client).await }
6277 }
6278}
6279impl Syncer for Container {
6280 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6281 let query = self.selection.select("id");
6282 let graphql_client = self.graphql_client.clone();
6283 async move { query.execute(graphql_client).await }
6284 }
6285 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
6286 let query = self.selection.select("sync");
6287 let proc = self.proc.clone();
6288 let graphql_client = self.graphql_client.clone();
6289 async move {
6290 let id: Id = query.execute(graphql_client.clone()).await?;
6291 Ok(Self {
6292 proc,
6293 selection: query
6294 .root()
6295 .select("node")
6296 .arg("id", &id.0)
6297 .inline_fragment("Container"),
6298 graphql_client,
6299 })
6300 }
6301 }
6302}
6303#[derive(Clone)]
6304pub struct CurrentModule {
6305 pub proc: Option<Arc<DaggerSessionProc>>,
6306 pub selection: Selection,
6307 pub graphql_client: DynGraphQLClient,
6308}
6309#[derive(Builder, Debug, PartialEq)]
6310pub struct CurrentModuleWorkdirOpts<'a> {
6311 #[builder(setter(into, strip_option), default)]
6313 pub exclude: Option<Vec<&'a str>>,
6314 #[builder(setter(into, strip_option), default)]
6316 pub gitignore: Option<bool>,
6317 #[builder(setter(into, strip_option), default)]
6319 pub include: Option<Vec<&'a str>>,
6320}
6321impl IntoID<Id> for CurrentModule {
6322 fn into_id(
6323 self,
6324 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6325 Box::pin(async move { self.id().await })
6326 }
6327}
6328impl Loadable for CurrentModule {
6329 fn graphql_type() -> &'static str {
6330 "CurrentModule"
6331 }
6332 fn from_query(
6333 proc: Option<Arc<DaggerSessionProc>>,
6334 selection: Selection,
6335 graphql_client: DynGraphQLClient,
6336 ) -> Self {
6337 Self {
6338 proc,
6339 selection,
6340 graphql_client,
6341 }
6342 }
6343}
6344impl CurrentModule {
6345 pub async fn id(&self) -> Result<Id, DaggerError> {
6347 let query = self.selection.select("id");
6348 query.execute(self.graphql_client.clone()).await
6349 }
6350 pub fn context_directory(&self) -> Directory {
6353 let query = self.selection.select("contextDirectory");
6354 Directory {
6355 proc: self.proc.clone(),
6356 selection: query,
6357 graphql_client: self.graphql_client.clone(),
6358 }
6359 }
6360 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
6362 let query = self.selection.select("dependencies");
6363 let query = query.select("id");
6364 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6365 Ok(ids
6366 .into_iter()
6367 .map(|id| Module {
6368 proc: self.proc.clone(),
6369 selection: crate::querybuilder::query()
6370 .select("node")
6371 .arg("id", &id.0)
6372 .inline_fragment("Module"),
6373 graphql_client: self.graphql_client.clone(),
6374 })
6375 .collect())
6376 }
6377 pub fn generated_context_directory(&self) -> Directory {
6379 let query = self.selection.select("generatedContextDirectory");
6380 Directory {
6381 proc: self.proc.clone(),
6382 selection: query,
6383 graphql_client: self.graphql_client.clone(),
6384 }
6385 }
6386 pub async fn name(&self) -> Result<String, DaggerError> {
6388 let query = self.selection.select("name");
6389 query.execute(self.graphql_client.clone()).await
6390 }
6391 pub fn source(&self) -> Directory {
6393 let query = self.selection.select("source");
6394 Directory {
6395 proc: self.proc.clone(),
6396 selection: query,
6397 graphql_client: self.graphql_client.clone(),
6398 }
6399 }
6400 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6402 let query = self.selection.select("sourceSubpath");
6403 query.execute(self.graphql_client.clone()).await
6404 }
6405 pub fn workdir(&self, path: impl Into<String>) -> Directory {
6412 let mut query = self.selection.select("workdir");
6413 query = query.arg("path", path.into());
6414 Directory {
6415 proc: self.proc.clone(),
6416 selection: query,
6417 graphql_client: self.graphql_client.clone(),
6418 }
6419 }
6420 pub fn workdir_opts<'a>(
6427 &self,
6428 path: impl Into<String>,
6429 opts: CurrentModuleWorkdirOpts<'a>,
6430 ) -> Directory {
6431 let mut query = self.selection.select("workdir");
6432 query = query.arg("path", path.into());
6433 if let Some(exclude) = opts.exclude {
6434 query = query.arg("exclude", exclude);
6435 }
6436 if let Some(include) = opts.include {
6437 query = query.arg("include", include);
6438 }
6439 if let Some(gitignore) = opts.gitignore {
6440 query = query.arg("gitignore", gitignore);
6441 }
6442 Directory {
6443 proc: self.proc.clone(),
6444 selection: query,
6445 graphql_client: self.graphql_client.clone(),
6446 }
6447 }
6448 pub fn workdir_file(&self, path: impl Into<String>) -> File {
6454 let mut query = self.selection.select("workdirFile");
6455 query = query.arg("path", path.into());
6456 File {
6457 proc: self.proc.clone(),
6458 selection: query,
6459 graphql_client: self.graphql_client.clone(),
6460 }
6461 }
6462}
6463impl Node for CurrentModule {
6464 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6465 let query = self.selection.select("id");
6466 let graphql_client = self.graphql_client.clone();
6467 async move { query.execute(graphql_client).await }
6468 }
6469}
6470#[derive(Clone)]
6471pub struct DiffStat {
6472 pub proc: Option<Arc<DaggerSessionProc>>,
6473 pub selection: Selection,
6474 pub graphql_client: DynGraphQLClient,
6475}
6476impl IntoID<Id> for DiffStat {
6477 fn into_id(
6478 self,
6479 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6480 Box::pin(async move { self.id().await })
6481 }
6482}
6483impl Loadable for DiffStat {
6484 fn graphql_type() -> &'static str {
6485 "DiffStat"
6486 }
6487 fn from_query(
6488 proc: Option<Arc<DaggerSessionProc>>,
6489 selection: Selection,
6490 graphql_client: DynGraphQLClient,
6491 ) -> Self {
6492 Self {
6493 proc,
6494 selection,
6495 graphql_client,
6496 }
6497 }
6498}
6499impl DiffStat {
6500 pub async fn id(&self) -> Result<Id, DaggerError> {
6502 let query = self.selection.select("id");
6503 query.execute(self.graphql_client.clone()).await
6504 }
6505 pub async fn path(&self) -> Result<String, DaggerError> {
6507 let query = self.selection.select("path");
6508 query.execute(self.graphql_client.clone()).await
6509 }
6510 pub async fn old_path(&self) -> Result<String, DaggerError> {
6512 let query = self.selection.select("oldPath");
6513 query.execute(self.graphql_client.clone()).await
6514 }
6515 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6517 let query = self.selection.select("kind");
6518 query.execute(self.graphql_client.clone()).await
6519 }
6520 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6522 let query = self.selection.select("addedLines");
6523 query.execute(self.graphql_client.clone()).await
6524 }
6525 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6527 let query = self.selection.select("removedLines");
6528 query.execute(self.graphql_client.clone()).await
6529 }
6530}
6531impl Node for DiffStat {
6532 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6533 let query = self.selection.select("id");
6534 let graphql_client = self.graphql_client.clone();
6535 async move { query.execute(graphql_client).await }
6536 }
6537}
6538#[derive(Clone)]
6539pub struct Directory {
6540 pub proc: Option<Arc<DaggerSessionProc>>,
6541 pub selection: Selection,
6542 pub graphql_client: DynGraphQLClient,
6543}
6544#[derive(Builder, Debug, PartialEq)]
6545pub struct DirectoryEntriesOpts<'a> {
6546 #[builder(setter(into, strip_option), default)]
6548 pub path: Option<&'a str>,
6549}
6550#[derive(Builder, Debug, PartialEq)]
6551pub struct DirectorySearchOpts<'a> {
6552 #[builder(setter(into, strip_option), default)]
6554 pub dotall: Option<bool>,
6555 #[builder(setter(into, strip_option), default)]
6557 pub files_only: Option<bool>,
6558 #[builder(setter(into, strip_option), default)]
6560 pub globs: Option<Vec<&'a str>>,
6561 #[builder(setter(into, strip_option), default)]
6563 pub insensitive: Option<bool>,
6564 #[builder(setter(into, strip_option), default)]
6566 pub limit: Option<isize>,
6567 #[builder(setter(into, strip_option), default)]
6569 pub literal: Option<bool>,
6570 #[builder(setter(into, strip_option), default)]
6572 pub multiline: Option<bool>,
6573 #[builder(setter(into, strip_option), default)]
6575 pub paths: Option<Vec<&'a str>>,
6576 #[builder(setter(into, strip_option), default)]
6578 pub skip_hidden: Option<bool>,
6579 #[builder(setter(into, strip_option), default)]
6581 pub skip_ignored: Option<bool>,
6582}
6583#[derive(Builder, Debug, PartialEq)]
6584pub struct DirectoryWithFileOpts<'a> {
6585 #[builder(setter(into, strip_option), default)]
6589 pub owner: Option<&'a str>,
6590 #[builder(setter(into, strip_option), default)]
6592 pub permissions: Option<isize>,
6593}
6594#[derive(Builder, Debug, PartialEq)]
6595pub struct DirectoryWithFilesOpts {
6596 #[builder(setter(into, strip_option), default)]
6598 pub permissions: Option<isize>,
6599}
6600#[derive(Builder, Debug, PartialEq)]
6601pub struct DirectoryWithNewFileOpts {
6602 #[builder(setter(into, strip_option), default)]
6604 pub permissions: Option<isize>,
6605}
6606#[derive(Builder, Debug, PartialEq)]
6607pub struct DirectoryExistsOpts {
6608 #[builder(setter(into, strip_option), default)]
6610 pub do_not_follow_symlinks: Option<bool>,
6611 #[builder(setter(into, strip_option), default)]
6613 pub expected_type: Option<ExistsType>,
6614}
6615#[derive(Builder, Debug, PartialEq)]
6616pub struct DirectoryStatOpts {
6617 #[builder(setter(into, strip_option), default)]
6619 pub do_not_follow_symlinks: Option<bool>,
6620}
6621#[derive(Builder, Debug, PartialEq)]
6622pub struct DirectoryWithDirectoryOpts<'a> {
6623 #[builder(setter(into, strip_option), default)]
6625 pub exclude: Option<Vec<&'a str>>,
6626 #[builder(setter(into, strip_option), default)]
6628 pub gitignore: Option<bool>,
6629 #[builder(setter(into, strip_option), default)]
6631 pub include: Option<Vec<&'a str>>,
6632 #[builder(setter(into, strip_option), default)]
6636 pub owner: Option<&'a str>,
6637 #[builder(setter(into, strip_option), default)]
6639 pub permissions: Option<isize>,
6640}
6641#[derive(Builder, Debug, PartialEq)]
6642pub struct DirectoryFilterOpts<'a> {
6643 #[builder(setter(into, strip_option), default)]
6645 pub exclude: Option<Vec<&'a str>>,
6646 #[builder(setter(into, strip_option), default)]
6648 pub gitignore: Option<bool>,
6649 #[builder(setter(into, strip_option), default)]
6651 pub include: Option<Vec<&'a str>>,
6652}
6653#[derive(Builder, Debug, PartialEq)]
6654pub struct DirectoryWithNewDirectoryOpts {
6655 #[builder(setter(into, strip_option), default)]
6657 pub permissions: Option<isize>,
6658}
6659#[derive(Builder, Debug, PartialEq)]
6660pub struct DirectoryExportOpts {
6661 #[builder(setter(into, strip_option), default)]
6663 pub wipe: Option<bool>,
6664}
6665#[derive(Builder, Debug, PartialEq)]
6666pub struct DirectoryDockerBuildOpts<'a> {
6667 #[builder(setter(into, strip_option), default)]
6669 pub build_args: Option<Vec<BuildArg>>,
6670 #[builder(setter(into, strip_option), default)]
6672 pub dockerfile: Option<&'a str>,
6673 #[builder(setter(into, strip_option), default)]
6676 pub no_init: Option<bool>,
6677 #[builder(setter(into, strip_option), default)]
6679 pub platform: Option<Platform>,
6680 #[builder(setter(into, strip_option), default)]
6683 pub secrets: Option<Vec<Id>>,
6684 #[builder(setter(into, strip_option), default)]
6688 pub ssh: Option<Id>,
6689 #[builder(setter(into, strip_option), default)]
6691 pub target: Option<&'a str>,
6692}
6693#[derive(Builder, Debug, PartialEq)]
6694pub struct DirectoryWithPatchOpts {
6695 #[builder(setter(into, strip_option), default)]
6697 pub on_conflict: Option<PatchConflict>,
6698}
6699#[derive(Builder, Debug, PartialEq)]
6700pub struct DirectoryWithPatchFileOpts {
6701 #[builder(setter(into, strip_option), default)]
6703 pub on_conflict: Option<PatchConflict>,
6704}
6705#[derive(Builder, Debug, PartialEq)]
6706pub struct DirectoryAsWorkspaceOpts<'a> {
6707 #[builder(setter(into, strip_option), default)]
6709 pub cwd: Option<&'a str>,
6710}
6711#[derive(Builder, Debug, PartialEq)]
6712pub struct DirectoryTerminalOpts<'a> {
6713 #[builder(setter(into, strip_option), default)]
6715 pub cmd: Option<Vec<&'a str>>,
6716 #[builder(setter(into, strip_option), default)]
6718 pub container: Option<Id>,
6719 #[builder(setter(into, strip_option), default)]
6721 pub disable_dagger_in_dagger: Option<bool>,
6722 #[builder(setter(into, strip_option), default)]
6723 pub experimental_privileged_nesting: Option<bool>,
6724 #[builder(setter(into, strip_option), default)]
6726 pub insecure_root_capabilities: Option<bool>,
6727}
6728#[derive(Builder, Debug, PartialEq)]
6729pub struct DirectoryAsModuleOpts<'a> {
6730 #[builder(setter(into, strip_option), default)]
6733 pub source_root_path: Option<&'a str>,
6734}
6735#[derive(Builder, Debug, PartialEq)]
6736pub struct DirectoryAsModuleSourceOpts<'a> {
6737 #[builder(setter(into, strip_option), default)]
6740 pub source_root_path: Option<&'a str>,
6741}
6742impl IntoID<Id> for Directory {
6743 fn into_id(
6744 self,
6745 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6746 Box::pin(async move { self.id().await })
6747 }
6748}
6749impl Loadable for Directory {
6750 fn graphql_type() -> &'static str {
6751 "Directory"
6752 }
6753 fn from_query(
6754 proc: Option<Arc<DaggerSessionProc>>,
6755 selection: Selection,
6756 graphql_client: DynGraphQLClient,
6757 ) -> Self {
6758 Self {
6759 proc,
6760 selection,
6761 graphql_client,
6762 }
6763 }
6764}
6765impl Directory {
6766 pub async fn id(&self) -> Result<Id, DaggerError> {
6768 let query = self.selection.select("id");
6769 query.execute(self.graphql_client.clone()).await
6770 }
6771 pub async fn sync(&self) -> Result<Directory, DaggerError> {
6773 let query = self.selection.select("sync");
6774 let id: Id = query.execute(self.graphql_client.clone()).await?;
6775 Ok(Directory {
6776 proc: self.proc.clone(),
6777 selection: query
6778 .root()
6779 .select("node")
6780 .arg("id", &id.0)
6781 .inline_fragment("Directory"),
6782 graphql_client: self.graphql_client.clone(),
6783 })
6784 }
6785 pub async fn name(&self) -> Result<String, DaggerError> {
6787 let query = self.selection.select("name");
6788 query.execute(self.graphql_client.clone()).await
6789 }
6790 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6796 let query = self.selection.select("entries");
6797 query.execute(self.graphql_client.clone()).await
6798 }
6799 pub async fn entries_opts<'a>(
6805 &self,
6806 opts: DirectoryEntriesOpts<'a>,
6807 ) -> Result<Vec<String>, DaggerError> {
6808 let mut query = self.selection.select("entries");
6809 if let Some(path) = opts.path {
6810 query = query.arg("path", path);
6811 }
6812 query.execute(self.graphql_client.clone()).await
6813 }
6814 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6820 let mut query = self.selection.select("glob");
6821 query = query.arg("pattern", pattern.into());
6822 query.execute(self.graphql_client.clone()).await
6823 }
6824 pub async fn search(
6832 &self,
6833 pattern: impl Into<String>,
6834 ) -> Result<Vec<SearchResult>, DaggerError> {
6835 let mut query = self.selection.select("search");
6836 query = query.arg("pattern", pattern.into());
6837 let query = query.select("id");
6838 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6839 Ok(ids
6840 .into_iter()
6841 .map(|id| SearchResult {
6842 proc: self.proc.clone(),
6843 selection: crate::querybuilder::query()
6844 .select("node")
6845 .arg("id", &id.0)
6846 .inline_fragment("SearchResult"),
6847 graphql_client: self.graphql_client.clone(),
6848 })
6849 .collect())
6850 }
6851 pub async fn search_opts<'a>(
6859 &self,
6860 pattern: impl Into<String>,
6861 opts: DirectorySearchOpts<'a>,
6862 ) -> Result<Vec<SearchResult>, DaggerError> {
6863 let mut query = self.selection.select("search");
6864 query = query.arg("pattern", pattern.into());
6865 if let Some(paths) = opts.paths {
6866 query = query.arg("paths", paths);
6867 }
6868 if let Some(globs) = opts.globs {
6869 query = query.arg("globs", globs);
6870 }
6871 if let Some(literal) = opts.literal {
6872 query = query.arg("literal", literal);
6873 }
6874 if let Some(multiline) = opts.multiline {
6875 query = query.arg("multiline", multiline);
6876 }
6877 if let Some(dotall) = opts.dotall {
6878 query = query.arg("dotall", dotall);
6879 }
6880 if let Some(insensitive) = opts.insensitive {
6881 query = query.arg("insensitive", insensitive);
6882 }
6883 if let Some(skip_ignored) = opts.skip_ignored {
6884 query = query.arg("skipIgnored", skip_ignored);
6885 }
6886 if let Some(skip_hidden) = opts.skip_hidden {
6887 query = query.arg("skipHidden", skip_hidden);
6888 }
6889 if let Some(files_only) = opts.files_only {
6890 query = query.arg("filesOnly", files_only);
6891 }
6892 if let Some(limit) = opts.limit {
6893 query = query.arg("limit", limit);
6894 }
6895 let query = query.select("id");
6896 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6897 Ok(ids
6898 .into_iter()
6899 .map(|id| SearchResult {
6900 proc: self.proc.clone(),
6901 selection: crate::querybuilder::query()
6902 .select("node")
6903 .arg("id", &id.0)
6904 .inline_fragment("SearchResult"),
6905 graphql_client: self.graphql_client.clone(),
6906 })
6907 .collect())
6908 }
6909 pub async fn digest(&self) -> Result<String, DaggerError> {
6911 let query = self.selection.select("digest");
6912 query.execute(self.graphql_client.clone()).await
6913 }
6914 pub fn file(&self, path: impl Into<String>) -> File {
6920 let mut query = self.selection.select("file");
6921 query = query.arg("path", path.into());
6922 File {
6923 proc: self.proc.clone(),
6924 selection: query,
6925 graphql_client: self.graphql_client.clone(),
6926 }
6927 }
6928 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6936 let mut query = self.selection.select("withFile");
6937 query = query.arg("path", path.into());
6938 query = query.arg_lazy(
6939 "source",
6940 Box::new(move || {
6941 let source = source.clone();
6942 Box::pin(async move { source.into_id().await.unwrap().quote() })
6943 }),
6944 );
6945 Directory {
6946 proc: self.proc.clone(),
6947 selection: query,
6948 graphql_client: self.graphql_client.clone(),
6949 }
6950 }
6951 pub fn with_file_opts<'a>(
6959 &self,
6960 path: impl Into<String>,
6961 source: impl IntoID<Id>,
6962 opts: DirectoryWithFileOpts<'a>,
6963 ) -> Directory {
6964 let mut query = self.selection.select("withFile");
6965 query = query.arg("path", path.into());
6966 query = query.arg_lazy(
6967 "source",
6968 Box::new(move || {
6969 let source = source.clone();
6970 Box::pin(async move { source.into_id().await.unwrap().quote() })
6971 }),
6972 );
6973 if let Some(permissions) = opts.permissions {
6974 query = query.arg("permissions", permissions);
6975 }
6976 if let Some(owner) = opts.owner {
6977 query = query.arg("owner", owner);
6978 }
6979 Directory {
6980 proc: self.proc.clone(),
6981 selection: query,
6982 graphql_client: self.graphql_client.clone(),
6983 }
6984 }
6985 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
6993 let mut query = self.selection.select("withFiles");
6994 query = query.arg("path", path.into());
6995 query = query.arg("sources", sources);
6996 Directory {
6997 proc: self.proc.clone(),
6998 selection: query,
6999 graphql_client: self.graphql_client.clone(),
7000 }
7001 }
7002 pub fn with_files_opts(
7010 &self,
7011 path: impl Into<String>,
7012 sources: Vec<Id>,
7013 opts: DirectoryWithFilesOpts,
7014 ) -> Directory {
7015 let mut query = self.selection.select("withFiles");
7016 query = query.arg("path", path.into());
7017 query = query.arg("sources", sources);
7018 if let Some(permissions) = opts.permissions {
7019 query = query.arg("permissions", permissions);
7020 }
7021 Directory {
7022 proc: self.proc.clone(),
7023 selection: query,
7024 graphql_client: self.graphql_client.clone(),
7025 }
7026 }
7027 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7035 let mut query = self.selection.select("withNewFile");
7036 query = query.arg("path", path.into());
7037 query = query.arg("contents", contents.into());
7038 Directory {
7039 proc: self.proc.clone(),
7040 selection: query,
7041 graphql_client: self.graphql_client.clone(),
7042 }
7043 }
7044 pub fn with_new_file_opts(
7052 &self,
7053 path: impl Into<String>,
7054 contents: impl Into<String>,
7055 opts: DirectoryWithNewFileOpts,
7056 ) -> Directory {
7057 let mut query = self.selection.select("withNewFile");
7058 query = query.arg("path", path.into());
7059 query = query.arg("contents", contents.into());
7060 if let Some(permissions) = opts.permissions {
7061 query = query.arg("permissions", permissions);
7062 }
7063 Directory {
7064 proc: self.proc.clone(),
7065 selection: query,
7066 graphql_client: self.graphql_client.clone(),
7067 }
7068 }
7069 pub fn without_file(&self, path: impl Into<String>) -> Directory {
7075 let mut query = self.selection.select("withoutFile");
7076 query = query.arg("path", path.into());
7077 Directory {
7078 proc: self.proc.clone(),
7079 selection: query,
7080 graphql_client: self.graphql_client.clone(),
7081 }
7082 }
7083 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7089 let mut query = self.selection.select("withoutFiles");
7090 query = query.arg(
7091 "paths",
7092 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7093 );
7094 Directory {
7095 proc: self.proc.clone(),
7096 selection: query,
7097 graphql_client: self.graphql_client.clone(),
7098 }
7099 }
7100 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
7107 let mut query = self.selection.select("exists");
7108 query = query.arg("path", path.into());
7109 query.execute(self.graphql_client.clone()).await
7110 }
7111 pub async fn exists_opts(
7118 &self,
7119 path: impl Into<String>,
7120 opts: DirectoryExistsOpts,
7121 ) -> Result<bool, DaggerError> {
7122 let mut query = self.selection.select("exists");
7123 query = query.arg("path", path.into());
7124 if let Some(expected_type) = opts.expected_type {
7125 query = query.arg("expectedType", expected_type);
7126 }
7127 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7128 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7129 }
7130 query.execute(self.graphql_client.clone()).await
7131 }
7132 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
7139 let mut query = self.selection.select("stat");
7140 query = query.arg("path", path.into());
7141 let query = query.select("id");
7142 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7143 Ok(id.map(|id| Stat {
7144 proc: self.proc.clone(),
7145 selection: query
7146 .root()
7147 .select("node")
7148 .arg("id", &id.0)
7149 .inline_fragment("Stat"),
7150 graphql_client: self.graphql_client.clone(),
7151 }))
7152 }
7153 pub async fn stat_opts(
7160 &self,
7161 path: impl Into<String>,
7162 opts: DirectoryStatOpts,
7163 ) -> Result<Option<Stat>, DaggerError> {
7164 let mut query = self.selection.select("stat");
7165 query = query.arg("path", path.into());
7166 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7167 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7168 }
7169 let query = query.select("id");
7170 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7171 Ok(id.map(|id| Stat {
7172 proc: self.proc.clone(),
7173 selection: query
7174 .root()
7175 .select("node")
7176 .arg("id", &id.0)
7177 .inline_fragment("Stat"),
7178 graphql_client: self.graphql_client.clone(),
7179 }))
7180 }
7181 pub fn directory(&self, path: impl Into<String>) -> Directory {
7187 let mut query = self.selection.select("directory");
7188 query = query.arg("path", path.into());
7189 Directory {
7190 proc: self.proc.clone(),
7191 selection: query,
7192 graphql_client: self.graphql_client.clone(),
7193 }
7194 }
7195 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
7203 let mut query = self.selection.select("withDirectory");
7204 query = query.arg("path", path.into());
7205 query = query.arg_lazy(
7206 "source",
7207 Box::new(move || {
7208 let source = source.clone();
7209 Box::pin(async move { source.into_id().await.unwrap().quote() })
7210 }),
7211 );
7212 Directory {
7213 proc: self.proc.clone(),
7214 selection: query,
7215 graphql_client: self.graphql_client.clone(),
7216 }
7217 }
7218 pub fn with_directory_opts<'a>(
7226 &self,
7227 path: impl Into<String>,
7228 source: impl IntoID<Id>,
7229 opts: DirectoryWithDirectoryOpts<'a>,
7230 ) -> Directory {
7231 let mut query = self.selection.select("withDirectory");
7232 query = query.arg("path", path.into());
7233 query = query.arg_lazy(
7234 "source",
7235 Box::new(move || {
7236 let source = source.clone();
7237 Box::pin(async move { source.into_id().await.unwrap().quote() })
7238 }),
7239 );
7240 if let Some(exclude) = opts.exclude {
7241 query = query.arg("exclude", exclude);
7242 }
7243 if let Some(include) = opts.include {
7244 query = query.arg("include", include);
7245 }
7246 if let Some(gitignore) = opts.gitignore {
7247 query = query.arg("gitignore", gitignore);
7248 }
7249 if let Some(owner) = opts.owner {
7250 query = query.arg("owner", owner);
7251 }
7252 if let Some(permissions) = opts.permissions {
7253 query = query.arg("permissions", permissions);
7254 }
7255 Directory {
7256 proc: self.proc.clone(),
7257 selection: query,
7258 graphql_client: self.graphql_client.clone(),
7259 }
7260 }
7261 pub fn filter(&self) -> Directory {
7267 let query = self.selection.select("filter");
7268 Directory {
7269 proc: self.proc.clone(),
7270 selection: query,
7271 graphql_client: self.graphql_client.clone(),
7272 }
7273 }
7274 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
7280 let mut query = self.selection.select("filter");
7281 if let Some(exclude) = opts.exclude {
7282 query = query.arg("exclude", exclude);
7283 }
7284 if let Some(include) = opts.include {
7285 query = query.arg("include", include);
7286 }
7287 if let Some(gitignore) = opts.gitignore {
7288 query = query.arg("gitignore", gitignore);
7289 }
7290 Directory {
7291 proc: self.proc.clone(),
7292 selection: query,
7293 graphql_client: self.graphql_client.clone(),
7294 }
7295 }
7296 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
7303 let mut query = self.selection.select("withNewDirectory");
7304 query = query.arg("path", path.into());
7305 Directory {
7306 proc: self.proc.clone(),
7307 selection: query,
7308 graphql_client: self.graphql_client.clone(),
7309 }
7310 }
7311 pub fn with_new_directory_opts(
7318 &self,
7319 path: impl Into<String>,
7320 opts: DirectoryWithNewDirectoryOpts,
7321 ) -> Directory {
7322 let mut query = self.selection.select("withNewDirectory");
7323 query = query.arg("path", path.into());
7324 if let Some(permissions) = opts.permissions {
7325 query = query.arg("permissions", permissions);
7326 }
7327 Directory {
7328 proc: self.proc.clone(),
7329 selection: query,
7330 graphql_client: self.graphql_client.clone(),
7331 }
7332 }
7333 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7339 let mut query = self.selection.select("withoutDirectory");
7340 query = query.arg("path", path.into());
7341 Directory {
7342 proc: self.proc.clone(),
7343 selection: query,
7344 graphql_client: self.graphql_client.clone(),
7345 }
7346 }
7347 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
7353 let mut query = self.selection.select("diff");
7354 query = query.arg_lazy(
7355 "other",
7356 Box::new(move || {
7357 let other = other.clone();
7358 Box::pin(async move { other.into_id().await.unwrap().quote() })
7359 }),
7360 );
7361 Directory {
7362 proc: self.proc.clone(),
7363 selection: query,
7364 graphql_client: self.graphql_client.clone(),
7365 }
7366 }
7367 pub async fn find_up(
7374 &self,
7375 name: impl Into<String>,
7376 start: impl Into<String>,
7377 ) -> Result<String, DaggerError> {
7378 let mut query = self.selection.select("findUp");
7379 query = query.arg("name", name.into());
7380 query = query.arg("start", start.into());
7381 query.execute(self.graphql_client.clone()).await
7382 }
7383 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
7390 let mut query = self.selection.select("changes");
7391 query = query.arg_lazy(
7392 "from",
7393 Box::new(move || {
7394 let from = from.clone();
7395 Box::pin(async move { from.into_id().await.unwrap().quote() })
7396 }),
7397 );
7398 Changeset {
7399 proc: self.proc.clone(),
7400 selection: query,
7401 graphql_client: self.graphql_client.clone(),
7402 }
7403 }
7404 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
7410 let mut query = self.selection.select("withChanges");
7411 query = query.arg_lazy(
7412 "changes",
7413 Box::new(move || {
7414 let changes = changes.clone();
7415 Box::pin(async move { changes.into_id().await.unwrap().quote() })
7416 }),
7417 );
7418 Directory {
7419 proc: self.proc.clone(),
7420 selection: query,
7421 graphql_client: self.graphql_client.clone(),
7422 }
7423 }
7424 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7431 let mut query = self.selection.select("export");
7432 query = query.arg("path", path.into());
7433 query.execute(self.graphql_client.clone()).await
7434 }
7435 pub async fn export_opts(
7442 &self,
7443 path: impl Into<String>,
7444 opts: DirectoryExportOpts,
7445 ) -> Result<String, DaggerError> {
7446 let mut query = self.selection.select("export");
7447 query = query.arg("path", path.into());
7448 if let Some(wipe) = opts.wipe {
7449 query = query.arg("wipe", wipe);
7450 }
7451 query.execute(self.graphql_client.clone()).await
7452 }
7453 pub fn docker_build(&self) -> Container {
7459 let query = self.selection.select("dockerBuild");
7460 Container {
7461 proc: self.proc.clone(),
7462 selection: query,
7463 graphql_client: self.graphql_client.clone(),
7464 }
7465 }
7466 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
7472 let mut query = self.selection.select("dockerBuild");
7473 if let Some(dockerfile) = opts.dockerfile {
7474 query = query.arg("dockerfile", dockerfile);
7475 }
7476 if let Some(platform) = opts.platform {
7477 query = query.arg("platform", platform);
7478 }
7479 if let Some(build_args) = opts.build_args {
7480 query = query.arg("buildArgs", build_args);
7481 }
7482 if let Some(target) = opts.target {
7483 query = query.arg("target", target);
7484 }
7485 if let Some(secrets) = opts.secrets {
7486 query = query.arg("secrets", secrets);
7487 }
7488 if let Some(no_init) = opts.no_init {
7489 query = query.arg("noInit", no_init);
7490 }
7491 if let Some(ssh) = opts.ssh {
7492 query = query.arg("ssh", ssh);
7493 }
7494 Container {
7495 proc: self.proc.clone(),
7496 selection: query,
7497 graphql_client: self.graphql_client.clone(),
7498 }
7499 }
7500 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7508 let mut query = self.selection.select("withTimestamps");
7509 query = query.arg("timestamp", timestamp);
7510 Directory {
7511 proc: self.proc.clone(),
7512 selection: query,
7513 graphql_client: self.graphql_client.clone(),
7514 }
7515 }
7516 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
7523 let mut query = self.selection.select("withPatch");
7524 query = query.arg("patch", patch.into());
7525 Directory {
7526 proc: self.proc.clone(),
7527 selection: query,
7528 graphql_client: self.graphql_client.clone(),
7529 }
7530 }
7531 pub fn with_patch_opts(
7538 &self,
7539 patch: impl Into<String>,
7540 opts: DirectoryWithPatchOpts,
7541 ) -> Directory {
7542 let mut query = self.selection.select("withPatch");
7543 query = query.arg("patch", patch.into());
7544 if let Some(on_conflict) = opts.on_conflict {
7545 query = query.arg("onConflict", on_conflict);
7546 }
7547 Directory {
7548 proc: self.proc.clone(),
7549 selection: query,
7550 graphql_client: self.graphql_client.clone(),
7551 }
7552 }
7553 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
7560 let mut query = self.selection.select("withPatchFile");
7561 query = query.arg_lazy(
7562 "patch",
7563 Box::new(move || {
7564 let patch = patch.clone();
7565 Box::pin(async move { patch.into_id().await.unwrap().quote() })
7566 }),
7567 );
7568 Directory {
7569 proc: self.proc.clone(),
7570 selection: query,
7571 graphql_client: self.graphql_client.clone(),
7572 }
7573 }
7574 pub fn with_patch_file_opts(
7581 &self,
7582 patch: impl IntoID<Id>,
7583 opts: DirectoryWithPatchFileOpts,
7584 ) -> Directory {
7585 let mut query = self.selection.select("withPatchFile");
7586 query = query.arg_lazy(
7587 "patch",
7588 Box::new(move || {
7589 let patch = patch.clone();
7590 Box::pin(async move { patch.into_id().await.unwrap().quote() })
7591 }),
7592 );
7593 if let Some(on_conflict) = opts.on_conflict {
7594 query = query.arg("onConflict", on_conflict);
7595 }
7596 Directory {
7597 proc: self.proc.clone(),
7598 selection: query,
7599 graphql_client: self.graphql_client.clone(),
7600 }
7601 }
7602 pub fn as_git(&self) -> GitRepository {
7604 let query = self.selection.select("asGit");
7605 GitRepository {
7606 proc: self.proc.clone(),
7607 selection: query,
7608 graphql_client: self.graphql_client.clone(),
7609 }
7610 }
7611 pub fn as_workspace(&self) -> Workspace {
7617 let query = self.selection.select("asWorkspace");
7618 Workspace {
7619 proc: self.proc.clone(),
7620 selection: query,
7621 graphql_client: self.graphql_client.clone(),
7622 }
7623 }
7624 pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
7630 let mut query = self.selection.select("asWorkspace");
7631 if let Some(cwd) = opts.cwd {
7632 query = query.arg("cwd", cwd);
7633 }
7634 Workspace {
7635 proc: self.proc.clone(),
7636 selection: query,
7637 graphql_client: self.graphql_client.clone(),
7638 }
7639 }
7640 pub fn terminal(&self) -> Directory {
7646 let query = self.selection.select("terminal");
7647 Directory {
7648 proc: self.proc.clone(),
7649 selection: query,
7650 graphql_client: self.graphql_client.clone(),
7651 }
7652 }
7653 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
7659 let mut query = self.selection.select("terminal");
7660 if let Some(container) = opts.container {
7661 query = query.arg("container", container);
7662 }
7663 if let Some(cmd) = opts.cmd {
7664 query = query.arg("cmd", cmd);
7665 }
7666 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
7667 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
7668 }
7669 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
7670 query = query.arg(
7671 "experimentalPrivilegedNesting",
7672 experimental_privileged_nesting,
7673 );
7674 }
7675 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
7676 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
7677 }
7678 Directory {
7679 proc: self.proc.clone(),
7680 selection: query,
7681 graphql_client: self.graphql_client.clone(),
7682 }
7683 }
7684 pub fn with_symlink(
7691 &self,
7692 target: impl Into<String>,
7693 link_name: impl Into<String>,
7694 ) -> Directory {
7695 let mut query = self.selection.select("withSymlink");
7696 query = query.arg("target", target.into());
7697 query = query.arg("linkName", link_name.into());
7698 Directory {
7699 proc: self.proc.clone(),
7700 selection: query,
7701 graphql_client: self.graphql_client.clone(),
7702 }
7703 }
7704 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
7715 let mut query = self.selection.select("chown");
7716 query = query.arg("path", path.into());
7717 query = query.arg("owner", owner.into());
7718 Directory {
7719 proc: self.proc.clone(),
7720 selection: query,
7721 graphql_client: self.graphql_client.clone(),
7722 }
7723 }
7724 pub fn with_error(&self, err: impl Into<String>) -> Directory {
7730 let mut query = self.selection.select("withError");
7731 query = query.arg("err", err.into());
7732 Directory {
7733 proc: self.proc.clone(),
7734 selection: query,
7735 graphql_client: self.graphql_client.clone(),
7736 }
7737 }
7738 pub fn as_module(&self) -> Module {
7744 let query = self.selection.select("asModule");
7745 Module {
7746 proc: self.proc.clone(),
7747 selection: query,
7748 graphql_client: self.graphql_client.clone(),
7749 }
7750 }
7751 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
7757 let mut query = self.selection.select("asModule");
7758 if let Some(source_root_path) = opts.source_root_path {
7759 query = query.arg("sourceRootPath", source_root_path);
7760 }
7761 Module {
7762 proc: self.proc.clone(),
7763 selection: query,
7764 graphql_client: self.graphql_client.clone(),
7765 }
7766 }
7767 pub fn as_module_source(&self) -> ModuleSource {
7773 let query = self.selection.select("asModuleSource");
7774 ModuleSource {
7775 proc: self.proc.clone(),
7776 selection: query,
7777 graphql_client: self.graphql_client.clone(),
7778 }
7779 }
7780 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
7786 let mut query = self.selection.select("asModuleSource");
7787 if let Some(source_root_path) = opts.source_root_path {
7788 query = query.arg("sourceRootPath", source_root_path);
7789 }
7790 ModuleSource {
7791 proc: self.proc.clone(),
7792 selection: query,
7793 graphql_client: self.graphql_client.clone(),
7794 }
7795 }
7796}
7797impl Exportable for Directory {
7798 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7799 let query = self.selection.select("id");
7800 let graphql_client = self.graphql_client.clone();
7801 async move { query.execute(graphql_client).await }
7802 }
7803 fn export(
7804 &self,
7805 path: impl Into<String>,
7806 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7807 let mut query = self.selection.select("export");
7808 query = query.arg("path", path.into());
7809 let graphql_client = self.graphql_client.clone();
7810 async move { query.execute(graphql_client).await }
7811 }
7812}
7813impl Node for Directory {
7814 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7815 let query = self.selection.select("id");
7816 let graphql_client = self.graphql_client.clone();
7817 async move { query.execute(graphql_client).await }
7818 }
7819}
7820impl Syncer for Directory {
7821 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7822 let query = self.selection.select("id");
7823 let graphql_client = self.graphql_client.clone();
7824 async move { query.execute(graphql_client).await }
7825 }
7826 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7827 let query = self.selection.select("sync");
7828 let proc = self.proc.clone();
7829 let graphql_client = self.graphql_client.clone();
7830 async move {
7831 let id: Id = query.execute(graphql_client.clone()).await?;
7832 Ok(Self {
7833 proc,
7834 selection: query
7835 .root()
7836 .select("node")
7837 .arg("id", &id.0)
7838 .inline_fragment("Directory"),
7839 graphql_client,
7840 })
7841 }
7842 }
7843}
7844#[derive(Clone)]
7845pub struct Engine {
7846 pub proc: Option<Arc<DaggerSessionProc>>,
7847 pub selection: Selection,
7848 pub graphql_client: DynGraphQLClient,
7849}
7850impl IntoID<Id> for Engine {
7851 fn into_id(
7852 self,
7853 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7854 Box::pin(async move { self.id().await })
7855 }
7856}
7857impl Loadable for Engine {
7858 fn graphql_type() -> &'static str {
7859 "Engine"
7860 }
7861 fn from_query(
7862 proc: Option<Arc<DaggerSessionProc>>,
7863 selection: Selection,
7864 graphql_client: DynGraphQLClient,
7865 ) -> Self {
7866 Self {
7867 proc,
7868 selection,
7869 graphql_client,
7870 }
7871 }
7872}
7873impl Engine {
7874 pub async fn id(&self) -> Result<Id, DaggerError> {
7876 let query = self.selection.select("id");
7877 query.execute(self.graphql_client.clone()).await
7878 }
7879 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7881 let query = self.selection.select("clients");
7882 query.execute(self.graphql_client.clone()).await
7883 }
7884 pub async fn name(&self) -> Result<String, DaggerError> {
7886 let query = self.selection.select("name");
7887 query.execute(self.graphql_client.clone()).await
7888 }
7889 pub fn local_cache(&self) -> EngineCache {
7891 let query = self.selection.select("localCache");
7892 EngineCache {
7893 proc: self.proc.clone(),
7894 selection: query,
7895 graphql_client: self.graphql_client.clone(),
7896 }
7897 }
7898}
7899impl Node for Engine {
7900 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7901 let query = self.selection.select("id");
7902 let graphql_client = self.graphql_client.clone();
7903 async move { query.execute(graphql_client).await }
7904 }
7905}
7906#[derive(Clone)]
7907pub struct EngineCache {
7908 pub proc: Option<Arc<DaggerSessionProc>>,
7909 pub selection: Selection,
7910 pub graphql_client: DynGraphQLClient,
7911}
7912#[derive(Builder, Debug, PartialEq)]
7913pub struct EngineCacheEntrySetOpts<'a> {
7914 #[builder(setter(into, strip_option), default)]
7915 pub key: Option<&'a str>,
7916}
7917#[derive(Builder, Debug, PartialEq)]
7918pub struct EngineCachePruneOpts<'a> {
7919 #[builder(setter(into, strip_option), default)]
7921 pub max_estimated_bytes: Option<isize>,
7922 #[builder(setter(into, strip_option), default)]
7924 pub max_used_space: Option<&'a str>,
7925 #[builder(setter(into, strip_option), default)]
7927 pub min_free_space: Option<&'a str>,
7928 #[builder(setter(into, strip_option), default)]
7930 pub reserved_space: Option<&'a str>,
7931 #[builder(setter(into, strip_option), default)]
7933 pub target_estimated_bytes: Option<isize>,
7934 #[builder(setter(into, strip_option), default)]
7936 pub target_space: Option<&'a str>,
7937 #[builder(setter(into, strip_option), default)]
7939 pub use_default_policy: Option<bool>,
7940}
7941impl IntoID<Id> for EngineCache {
7942 fn into_id(
7943 self,
7944 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7945 Box::pin(async move { self.id().await })
7946 }
7947}
7948impl Loadable for EngineCache {
7949 fn graphql_type() -> &'static str {
7950 "EngineCache"
7951 }
7952 fn from_query(
7953 proc: Option<Arc<DaggerSessionProc>>,
7954 selection: Selection,
7955 graphql_client: DynGraphQLClient,
7956 ) -> Self {
7957 Self {
7958 proc,
7959 selection,
7960 graphql_client,
7961 }
7962 }
7963}
7964impl EngineCache {
7965 pub async fn id(&self) -> Result<Id, DaggerError> {
7967 let query = self.selection.select("id");
7968 query.execute(self.graphql_client.clone()).await
7969 }
7970 pub fn entry_set(&self) -> EngineCacheEntrySet {
7976 let query = self.selection.select("entrySet");
7977 EngineCacheEntrySet {
7978 proc: self.proc.clone(),
7979 selection: query,
7980 graphql_client: self.graphql_client.clone(),
7981 }
7982 }
7983 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
7989 let mut query = self.selection.select("entrySet");
7990 if let Some(key) = opts.key {
7991 query = query.arg("key", key);
7992 }
7993 EngineCacheEntrySet {
7994 proc: self.proc.clone(),
7995 selection: query,
7996 graphql_client: self.graphql_client.clone(),
7997 }
7998 }
7999 pub async fn prune(&self) -> Result<Void, DaggerError> {
8005 let query = self.selection.select("prune");
8006 query.execute(self.graphql_client.clone()).await
8007 }
8008 pub async fn prune_opts<'a>(
8014 &self,
8015 opts: EngineCachePruneOpts<'a>,
8016 ) -> Result<Void, DaggerError> {
8017 let mut query = self.selection.select("prune");
8018 if let Some(use_default_policy) = opts.use_default_policy {
8019 query = query.arg("useDefaultPolicy", use_default_policy);
8020 }
8021 if let Some(max_used_space) = opts.max_used_space {
8022 query = query.arg("maxUsedSpace", max_used_space);
8023 }
8024 if let Some(reserved_space) = opts.reserved_space {
8025 query = query.arg("reservedSpace", reserved_space);
8026 }
8027 if let Some(min_free_space) = opts.min_free_space {
8028 query = query.arg("minFreeSpace", min_free_space);
8029 }
8030 if let Some(target_space) = opts.target_space {
8031 query = query.arg("targetSpace", target_space);
8032 }
8033 if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
8034 query = query.arg("maxEstimatedBytes", max_estimated_bytes);
8035 }
8036 if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
8037 query = query.arg("targetEstimatedBytes", target_estimated_bytes);
8038 }
8039 query.execute(self.graphql_client.clone()).await
8040 }
8041 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
8043 let query = self.selection.select("maxUsedSpace");
8044 query.execute(self.graphql_client.clone()).await
8045 }
8046 pub async fn target_space(&self) -> Result<isize, DaggerError> {
8048 let query = self.selection.select("targetSpace");
8049 query.execute(self.graphql_client.clone()).await
8050 }
8051 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
8053 let query = self.selection.select("reservedSpace");
8054 query.execute(self.graphql_client.clone()).await
8055 }
8056 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
8058 let query = self.selection.select("minFreeSpace");
8059 query.execute(self.graphql_client.clone()).await
8060 }
8061}
8062impl Node for EngineCache {
8063 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8064 let query = self.selection.select("id");
8065 let graphql_client = self.graphql_client.clone();
8066 async move { query.execute(graphql_client).await }
8067 }
8068}
8069#[derive(Clone)]
8070pub struct EngineCacheEntry {
8071 pub proc: Option<Arc<DaggerSessionProc>>,
8072 pub selection: Selection,
8073 pub graphql_client: DynGraphQLClient,
8074}
8075impl IntoID<Id> for EngineCacheEntry {
8076 fn into_id(
8077 self,
8078 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8079 Box::pin(async move { self.id().await })
8080 }
8081}
8082impl Loadable for EngineCacheEntry {
8083 fn graphql_type() -> &'static str {
8084 "EngineCacheEntry"
8085 }
8086 fn from_query(
8087 proc: Option<Arc<DaggerSessionProc>>,
8088 selection: Selection,
8089 graphql_client: DynGraphQLClient,
8090 ) -> Self {
8091 Self {
8092 proc,
8093 selection,
8094 graphql_client,
8095 }
8096 }
8097}
8098impl EngineCacheEntry {
8099 pub async fn id(&self) -> Result<Id, DaggerError> {
8101 let query = self.selection.select("id");
8102 query.execute(self.graphql_client.clone()).await
8103 }
8104 pub async fn description(&self) -> Result<String, DaggerError> {
8106 let query = self.selection.select("description");
8107 query.execute(self.graphql_client.clone()).await
8108 }
8109 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8111 let query = self.selection.select("diskSpaceBytes");
8112 query.execute(self.graphql_client.clone()).await
8113 }
8114 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
8116 let query = self.selection.select("createdTimeUnixNano");
8117 query.execute(self.graphql_client.clone()).await
8118 }
8119 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
8121 let query = self.selection.select("mostRecentUseTimeUnixNano");
8122 query.execute(self.graphql_client.clone()).await
8123 }
8124 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
8126 let query = self.selection.select("activelyUsed");
8127 query.execute(self.graphql_client.clone()).await
8128 }
8129 pub async fn record_type(&self) -> Result<String, DaggerError> {
8131 let query = self.selection.select("recordType");
8132 query.execute(self.graphql_client.clone()).await
8133 }
8134 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
8136 let query = self.selection.select("recordTypes");
8137 query.execute(self.graphql_client.clone()).await
8138 }
8139 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
8141 let query = self.selection.select("dagqlCall");
8142 query.execute(self.graphql_client.clone()).await
8143 }
8144}
8145impl Node for EngineCacheEntry {
8146 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8147 let query = self.selection.select("id");
8148 let graphql_client = self.graphql_client.clone();
8149 async move { query.execute(graphql_client).await }
8150 }
8151}
8152#[derive(Clone)]
8153pub struct EngineCacheEntrySet {
8154 pub proc: Option<Arc<DaggerSessionProc>>,
8155 pub selection: Selection,
8156 pub graphql_client: DynGraphQLClient,
8157}
8158impl IntoID<Id> for EngineCacheEntrySet {
8159 fn into_id(
8160 self,
8161 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8162 Box::pin(async move { self.id().await })
8163 }
8164}
8165impl Loadable for EngineCacheEntrySet {
8166 fn graphql_type() -> &'static str {
8167 "EngineCacheEntrySet"
8168 }
8169 fn from_query(
8170 proc: Option<Arc<DaggerSessionProc>>,
8171 selection: Selection,
8172 graphql_client: DynGraphQLClient,
8173 ) -> Self {
8174 Self {
8175 proc,
8176 selection,
8177 graphql_client,
8178 }
8179 }
8180}
8181impl EngineCacheEntrySet {
8182 pub async fn id(&self) -> Result<Id, DaggerError> {
8184 let query = self.selection.select("id");
8185 query.execute(self.graphql_client.clone()).await
8186 }
8187 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
8189 let query = self.selection.select("entries");
8190 let query = query.select("id");
8191 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8192 Ok(ids
8193 .into_iter()
8194 .map(|id| EngineCacheEntry {
8195 proc: self.proc.clone(),
8196 selection: crate::querybuilder::query()
8197 .select("node")
8198 .arg("id", &id.0)
8199 .inline_fragment("EngineCacheEntry"),
8200 graphql_client: self.graphql_client.clone(),
8201 })
8202 .collect())
8203 }
8204 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
8206 let query = self.selection.select("entryCount");
8207 query.execute(self.graphql_client.clone()).await
8208 }
8209 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8211 let query = self.selection.select("diskSpaceBytes");
8212 query.execute(self.graphql_client.clone()).await
8213 }
8214}
8215impl Node for EngineCacheEntrySet {
8216 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8217 let query = self.selection.select("id");
8218 let graphql_client = self.graphql_client.clone();
8219 async move { query.execute(graphql_client).await }
8220 }
8221}
8222#[derive(Clone)]
8223pub struct EnumTypeDef {
8224 pub proc: Option<Arc<DaggerSessionProc>>,
8225 pub selection: Selection,
8226 pub graphql_client: DynGraphQLClient,
8227}
8228impl IntoID<Id> for EnumTypeDef {
8229 fn into_id(
8230 self,
8231 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8232 Box::pin(async move { self.id().await })
8233 }
8234}
8235impl Loadable for EnumTypeDef {
8236 fn graphql_type() -> &'static str {
8237 "EnumTypeDef"
8238 }
8239 fn from_query(
8240 proc: Option<Arc<DaggerSessionProc>>,
8241 selection: Selection,
8242 graphql_client: DynGraphQLClient,
8243 ) -> Self {
8244 Self {
8245 proc,
8246 selection,
8247 graphql_client,
8248 }
8249 }
8250}
8251impl EnumTypeDef {
8252 pub async fn id(&self) -> Result<Id, DaggerError> {
8254 let query = self.selection.select("id");
8255 query.execute(self.graphql_client.clone()).await
8256 }
8257 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8259 let query = self.selection.select("values");
8260 let query = query.select("id");
8261 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8262 Ok(ids
8263 .into_iter()
8264 .map(|id| EnumValueTypeDef {
8265 proc: self.proc.clone(),
8266 selection: crate::querybuilder::query()
8267 .select("node")
8268 .arg("id", &id.0)
8269 .inline_fragment("EnumValueTypeDef"),
8270 graphql_client: self.graphql_client.clone(),
8271 })
8272 .collect())
8273 }
8274 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8276 let query = self.selection.select("members");
8277 let query = query.select("id");
8278 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8279 Ok(ids
8280 .into_iter()
8281 .map(|id| EnumValueTypeDef {
8282 proc: self.proc.clone(),
8283 selection: crate::querybuilder::query()
8284 .select("node")
8285 .arg("id", &id.0)
8286 .inline_fragment("EnumValueTypeDef"),
8287 graphql_client: self.graphql_client.clone(),
8288 })
8289 .collect())
8290 }
8291 pub async fn name(&self) -> Result<String, DaggerError> {
8293 let query = self.selection.select("name");
8294 query.execute(self.graphql_client.clone()).await
8295 }
8296 pub async fn description(&self) -> Result<String, DaggerError> {
8298 let query = self.selection.select("description");
8299 query.execute(self.graphql_client.clone()).await
8300 }
8301 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8303 let query = self.selection.select("sourceMap");
8304 let query = query.select("id");
8305 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8306 Ok(id.map(|id| SourceMap {
8307 proc: self.proc.clone(),
8308 selection: query
8309 .root()
8310 .select("node")
8311 .arg("id", &id.0)
8312 .inline_fragment("SourceMap"),
8313 graphql_client: self.graphql_client.clone(),
8314 }))
8315 }
8316 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8318 let query = self.selection.select("sourceModuleName");
8319 query.execute(self.graphql_client.clone()).await
8320 }
8321}
8322impl Node for EnumTypeDef {
8323 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8324 let query = self.selection.select("id");
8325 let graphql_client = self.graphql_client.clone();
8326 async move { query.execute(graphql_client).await }
8327 }
8328}
8329#[derive(Clone)]
8330pub struct EnumValueTypeDef {
8331 pub proc: Option<Arc<DaggerSessionProc>>,
8332 pub selection: Selection,
8333 pub graphql_client: DynGraphQLClient,
8334}
8335impl IntoID<Id> for EnumValueTypeDef {
8336 fn into_id(
8337 self,
8338 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8339 Box::pin(async move { self.id().await })
8340 }
8341}
8342impl Loadable for EnumValueTypeDef {
8343 fn graphql_type() -> &'static str {
8344 "EnumValueTypeDef"
8345 }
8346 fn from_query(
8347 proc: Option<Arc<DaggerSessionProc>>,
8348 selection: Selection,
8349 graphql_client: DynGraphQLClient,
8350 ) -> Self {
8351 Self {
8352 proc,
8353 selection,
8354 graphql_client,
8355 }
8356 }
8357}
8358impl EnumValueTypeDef {
8359 pub async fn id(&self) -> Result<Id, DaggerError> {
8361 let query = self.selection.select("id");
8362 query.execute(self.graphql_client.clone()).await
8363 }
8364 pub async fn name(&self) -> Result<String, DaggerError> {
8366 let query = self.selection.select("name");
8367 query.execute(self.graphql_client.clone()).await
8368 }
8369 pub async fn value(&self) -> Result<String, DaggerError> {
8371 let query = self.selection.select("value");
8372 query.execute(self.graphql_client.clone()).await
8373 }
8374 pub async fn description(&self) -> Result<String, DaggerError> {
8376 let query = self.selection.select("description");
8377 query.execute(self.graphql_client.clone()).await
8378 }
8379 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8381 let query = self.selection.select("sourceMap");
8382 let query = query.select("id");
8383 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8384 Ok(id.map(|id| SourceMap {
8385 proc: self.proc.clone(),
8386 selection: query
8387 .root()
8388 .select("node")
8389 .arg("id", &id.0)
8390 .inline_fragment("SourceMap"),
8391 graphql_client: self.graphql_client.clone(),
8392 }))
8393 }
8394 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8396 let query = self.selection.select("deprecated");
8397 query.execute(self.graphql_client.clone()).await
8398 }
8399}
8400impl Node for EnumValueTypeDef {
8401 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8402 let query = self.selection.select("id");
8403 let graphql_client = self.graphql_client.clone();
8404 async move { query.execute(graphql_client).await }
8405 }
8406}
8407#[derive(Clone)]
8408pub struct EnvFile {
8409 pub proc: Option<Arc<DaggerSessionProc>>,
8410 pub selection: Selection,
8411 pub graphql_client: DynGraphQLClient,
8412}
8413#[derive(Builder, Debug, PartialEq)]
8414pub struct EnvFileVariablesOpts {
8415 #[builder(setter(into, strip_option), default)]
8417 pub raw: Option<bool>,
8418}
8419#[derive(Builder, Debug, PartialEq)]
8420pub struct EnvFileGetOpts {
8421 #[builder(setter(into, strip_option), default)]
8423 pub raw: Option<bool>,
8424}
8425impl IntoID<Id> for EnvFile {
8426 fn into_id(
8427 self,
8428 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8429 Box::pin(async move { self.id().await })
8430 }
8431}
8432impl Loadable for EnvFile {
8433 fn graphql_type() -> &'static str {
8434 "EnvFile"
8435 }
8436 fn from_query(
8437 proc: Option<Arc<DaggerSessionProc>>,
8438 selection: Selection,
8439 graphql_client: DynGraphQLClient,
8440 ) -> Self {
8441 Self {
8442 proc,
8443 selection,
8444 graphql_client,
8445 }
8446 }
8447}
8448impl EnvFile {
8449 pub async fn id(&self) -> Result<Id, DaggerError> {
8451 let query = self.selection.select("id");
8452 query.execute(self.graphql_client.clone()).await
8453 }
8454 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8460 let query = self.selection.select("variables");
8461 let query = query.select("id");
8462 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8463 Ok(ids
8464 .into_iter()
8465 .map(|id| EnvVariable {
8466 proc: self.proc.clone(),
8467 selection: crate::querybuilder::query()
8468 .select("node")
8469 .arg("id", &id.0)
8470 .inline_fragment("EnvVariable"),
8471 graphql_client: self.graphql_client.clone(),
8472 })
8473 .collect())
8474 }
8475 pub async fn variables_opts(
8481 &self,
8482 opts: EnvFileVariablesOpts,
8483 ) -> Result<Vec<EnvVariable>, DaggerError> {
8484 let mut query = self.selection.select("variables");
8485 if let Some(raw) = opts.raw {
8486 query = query.arg("raw", raw);
8487 }
8488 let query = query.select("id");
8489 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8490 Ok(ids
8491 .into_iter()
8492 .map(|id| EnvVariable {
8493 proc: self.proc.clone(),
8494 selection: crate::querybuilder::query()
8495 .select("node")
8496 .arg("id", &id.0)
8497 .inline_fragment("EnvVariable"),
8498 graphql_client: self.graphql_client.clone(),
8499 })
8500 .collect())
8501 }
8502 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8509 let mut query = self.selection.select("withVariable");
8510 query = query.arg("name", name.into());
8511 query = query.arg("value", value.into());
8512 EnvFile {
8513 proc: self.proc.clone(),
8514 selection: query,
8515 graphql_client: self.graphql_client.clone(),
8516 }
8517 }
8518 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8524 let mut query = self.selection.select("withoutVariable");
8525 query = query.arg("name", name.into());
8526 EnvFile {
8527 proc: self.proc.clone(),
8528 selection: query,
8529 graphql_client: self.graphql_client.clone(),
8530 }
8531 }
8532 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8539 let mut query = self.selection.select("get");
8540 query = query.arg("name", name.into());
8541 query.execute(self.graphql_client.clone()).await
8542 }
8543 pub async fn get_opts(
8550 &self,
8551 name: impl Into<String>,
8552 opts: EnvFileGetOpts,
8553 ) -> Result<String, DaggerError> {
8554 let mut query = self.selection.select("get");
8555 query = query.arg("name", name.into());
8556 if let Some(raw) = opts.raw {
8557 query = query.arg("raw", raw);
8558 }
8559 query.execute(self.graphql_client.clone()).await
8560 }
8561 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8567 let mut query = self.selection.select("exists");
8568 query = query.arg("name", name.into());
8569 query.execute(self.graphql_client.clone()).await
8570 }
8571 pub fn as_file(&self) -> File {
8573 let query = self.selection.select("asFile");
8574 File {
8575 proc: self.proc.clone(),
8576 selection: query,
8577 graphql_client: self.graphql_client.clone(),
8578 }
8579 }
8580 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8586 let mut query = self.selection.select("namespace");
8587 query = query.arg("prefix", prefix.into());
8588 EnvFile {
8589 proc: self.proc.clone(),
8590 selection: query,
8591 graphql_client: self.graphql_client.clone(),
8592 }
8593 }
8594}
8595impl Node for EnvFile {
8596 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8597 let query = self.selection.select("id");
8598 let graphql_client = self.graphql_client.clone();
8599 async move { query.execute(graphql_client).await }
8600 }
8601}
8602#[derive(Clone)]
8603pub struct EnvVariable {
8604 pub proc: Option<Arc<DaggerSessionProc>>,
8605 pub selection: Selection,
8606 pub graphql_client: DynGraphQLClient,
8607}
8608impl IntoID<Id> for EnvVariable {
8609 fn into_id(
8610 self,
8611 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8612 Box::pin(async move { self.id().await })
8613 }
8614}
8615impl Loadable for EnvVariable {
8616 fn graphql_type() -> &'static str {
8617 "EnvVariable"
8618 }
8619 fn from_query(
8620 proc: Option<Arc<DaggerSessionProc>>,
8621 selection: Selection,
8622 graphql_client: DynGraphQLClient,
8623 ) -> Self {
8624 Self {
8625 proc,
8626 selection,
8627 graphql_client,
8628 }
8629 }
8630}
8631impl EnvVariable {
8632 pub async fn id(&self) -> Result<Id, DaggerError> {
8634 let query = self.selection.select("id");
8635 query.execute(self.graphql_client.clone()).await
8636 }
8637 pub async fn name(&self) -> Result<String, DaggerError> {
8639 let query = self.selection.select("name");
8640 query.execute(self.graphql_client.clone()).await
8641 }
8642 pub async fn value(&self) -> Result<String, DaggerError> {
8644 let query = self.selection.select("value");
8645 query.execute(self.graphql_client.clone()).await
8646 }
8647}
8648impl Node for EnvVariable {
8649 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8650 let query = self.selection.select("id");
8651 let graphql_client = self.graphql_client.clone();
8652 async move { query.execute(graphql_client).await }
8653 }
8654}
8655#[derive(Clone)]
8656pub struct Error {
8657 pub proc: Option<Arc<DaggerSessionProc>>,
8658 pub selection: Selection,
8659 pub graphql_client: DynGraphQLClient,
8660}
8661impl IntoID<Id> for Error {
8662 fn into_id(
8663 self,
8664 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8665 Box::pin(async move { self.id().await })
8666 }
8667}
8668impl Loadable for Error {
8669 fn graphql_type() -> &'static str {
8670 "Error"
8671 }
8672 fn from_query(
8673 proc: Option<Arc<DaggerSessionProc>>,
8674 selection: Selection,
8675 graphql_client: DynGraphQLClient,
8676 ) -> Self {
8677 Self {
8678 proc,
8679 selection,
8680 graphql_client,
8681 }
8682 }
8683}
8684impl Error {
8685 pub async fn id(&self) -> Result<Id, DaggerError> {
8687 let query = self.selection.select("id");
8688 query.execute(self.graphql_client.clone()).await
8689 }
8690 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8697 let mut query = self.selection.select("withValue");
8698 query = query.arg("name", name.into());
8699 query = query.arg("value", value);
8700 Error {
8701 proc: self.proc.clone(),
8702 selection: query,
8703 graphql_client: self.graphql_client.clone(),
8704 }
8705 }
8706 pub async fn message(&self) -> Result<String, DaggerError> {
8708 let query = self.selection.select("message");
8709 query.execute(self.graphql_client.clone()).await
8710 }
8711 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8713 let query = self.selection.select("values");
8714 let query = query.select("id");
8715 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8716 Ok(ids
8717 .into_iter()
8718 .map(|id| ErrorValue {
8719 proc: self.proc.clone(),
8720 selection: crate::querybuilder::query()
8721 .select("node")
8722 .arg("id", &id.0)
8723 .inline_fragment("ErrorValue"),
8724 graphql_client: self.graphql_client.clone(),
8725 })
8726 .collect())
8727 }
8728}
8729impl Node for Error {
8730 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8731 let query = self.selection.select("id");
8732 let graphql_client = self.graphql_client.clone();
8733 async move { query.execute(graphql_client).await }
8734 }
8735}
8736#[derive(Clone)]
8737pub struct ErrorValue {
8738 pub proc: Option<Arc<DaggerSessionProc>>,
8739 pub selection: Selection,
8740 pub graphql_client: DynGraphQLClient,
8741}
8742impl IntoID<Id> for ErrorValue {
8743 fn into_id(
8744 self,
8745 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8746 Box::pin(async move { self.id().await })
8747 }
8748}
8749impl Loadable for ErrorValue {
8750 fn graphql_type() -> &'static str {
8751 "ErrorValue"
8752 }
8753 fn from_query(
8754 proc: Option<Arc<DaggerSessionProc>>,
8755 selection: Selection,
8756 graphql_client: DynGraphQLClient,
8757 ) -> Self {
8758 Self {
8759 proc,
8760 selection,
8761 graphql_client,
8762 }
8763 }
8764}
8765impl ErrorValue {
8766 pub async fn id(&self) -> Result<Id, DaggerError> {
8768 let query = self.selection.select("id");
8769 query.execute(self.graphql_client.clone()).await
8770 }
8771 pub async fn name(&self) -> Result<String, DaggerError> {
8773 let query = self.selection.select("name");
8774 query.execute(self.graphql_client.clone()).await
8775 }
8776 pub async fn value(&self) -> Result<Json, DaggerError> {
8778 let query = self.selection.select("value");
8779 query.execute(self.graphql_client.clone()).await
8780 }
8781}
8782impl Node for ErrorValue {
8783 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8784 let query = self.selection.select("id");
8785 let graphql_client = self.graphql_client.clone();
8786 async move { query.execute(graphql_client).await }
8787 }
8788}
8789#[derive(Clone)]
8790pub struct Expertise {
8791 pub proc: Option<Arc<DaggerSessionProc>>,
8792 pub selection: Selection,
8793 pub graphql_client: DynGraphQLClient,
8794}
8795impl IntoID<Id> for Expertise {
8796 fn into_id(
8797 self,
8798 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8799 Box::pin(async move { self.id().await })
8800 }
8801}
8802impl Loadable for Expertise {
8803 fn graphql_type() -> &'static str {
8804 "Expertise"
8805 }
8806 fn from_query(
8807 proc: Option<Arc<DaggerSessionProc>>,
8808 selection: Selection,
8809 graphql_client: DynGraphQLClient,
8810 ) -> Self {
8811 Self {
8812 proc,
8813 selection,
8814 graphql_client,
8815 }
8816 }
8817}
8818impl Expertise {
8819 pub async fn id(&self) -> Result<Id, DaggerError> {
8821 let query = self.selection.select("id");
8822 query.execute(self.graphql_client.clone()).await
8823 }
8824 pub async fn name(&self) -> Result<String, DaggerError> {
8826 let query = self.selection.select("name");
8827 query.execute(self.graphql_client.clone()).await
8828 }
8829 pub async fn description(&self) -> Result<String, DaggerError> {
8831 let query = self.selection.select("description");
8832 query.execute(self.graphql_client.clone()).await
8833 }
8834 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8836 let query = self.selection.select("path");
8837 query.execute(self.graphql_client.clone()).await
8838 }
8839 pub fn original_module(&self) -> Module {
8841 let query = self.selection.select("originalModule");
8842 Module {
8843 proc: self.proc.clone(),
8844 selection: query,
8845 graphql_client: self.graphql_client.clone(),
8846 }
8847 }
8848}
8849impl Node for Expertise {
8850 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8851 let query = self.selection.select("id");
8852 let graphql_client = self.graphql_client.clone();
8853 async move { query.execute(graphql_client).await }
8854 }
8855}
8856#[derive(Clone)]
8857pub struct FieldTypeDef {
8858 pub proc: Option<Arc<DaggerSessionProc>>,
8859 pub selection: Selection,
8860 pub graphql_client: DynGraphQLClient,
8861}
8862impl IntoID<Id> for FieldTypeDef {
8863 fn into_id(
8864 self,
8865 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8866 Box::pin(async move { self.id().await })
8867 }
8868}
8869impl Loadable for FieldTypeDef {
8870 fn graphql_type() -> &'static str {
8871 "FieldTypeDef"
8872 }
8873 fn from_query(
8874 proc: Option<Arc<DaggerSessionProc>>,
8875 selection: Selection,
8876 graphql_client: DynGraphQLClient,
8877 ) -> Self {
8878 Self {
8879 proc,
8880 selection,
8881 graphql_client,
8882 }
8883 }
8884}
8885impl FieldTypeDef {
8886 pub async fn id(&self) -> Result<Id, DaggerError> {
8888 let query = self.selection.select("id");
8889 query.execute(self.graphql_client.clone()).await
8890 }
8891 pub fn type_def(&self) -> TypeDef {
8893 let query = self.selection.select("typeDef");
8894 TypeDef {
8895 proc: self.proc.clone(),
8896 selection: query,
8897 graphql_client: self.graphql_client.clone(),
8898 }
8899 }
8900 pub async fn name(&self) -> Result<String, DaggerError> {
8902 let query = self.selection.select("name");
8903 query.execute(self.graphql_client.clone()).await
8904 }
8905 pub async fn description(&self) -> Result<String, DaggerError> {
8907 let query = self.selection.select("description");
8908 query.execute(self.graphql_client.clone()).await
8909 }
8910 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8912 let query = self.selection.select("sourceMap");
8913 let query = query.select("id");
8914 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8915 Ok(id.map(|id| SourceMap {
8916 proc: self.proc.clone(),
8917 selection: query
8918 .root()
8919 .select("node")
8920 .arg("id", &id.0)
8921 .inline_fragment("SourceMap"),
8922 graphql_client: self.graphql_client.clone(),
8923 }))
8924 }
8925 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8927 let query = self.selection.select("deprecated");
8928 query.execute(self.graphql_client.clone()).await
8929 }
8930}
8931impl Node for FieldTypeDef {
8932 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8933 let query = self.selection.select("id");
8934 let graphql_client = self.graphql_client.clone();
8935 async move { query.execute(graphql_client).await }
8936 }
8937}
8938#[derive(Clone)]
8939pub struct File {
8940 pub proc: Option<Arc<DaggerSessionProc>>,
8941 pub selection: Selection,
8942 pub graphql_client: DynGraphQLClient,
8943}
8944#[derive(Builder, Debug, PartialEq)]
8945pub struct FileContentsOpts {
8946 #[builder(setter(into, strip_option), default)]
8948 pub limit_lines: Option<isize>,
8949 #[builder(setter(into, strip_option), default)]
8951 pub offset_lines: Option<isize>,
8952}
8953#[derive(Builder, Debug, PartialEq)]
8954pub struct FileDigestOpts {
8955 #[builder(setter(into, strip_option), default)]
8957 pub exclude_metadata: Option<bool>,
8958}
8959#[derive(Builder, Debug, PartialEq)]
8960pub struct FileSearchOpts<'a> {
8961 #[builder(setter(into, strip_option), default)]
8963 pub dotall: Option<bool>,
8964 #[builder(setter(into, strip_option), default)]
8966 pub files_only: Option<bool>,
8967 #[builder(setter(into, strip_option), default)]
8968 pub globs: Option<Vec<&'a str>>,
8969 #[builder(setter(into, strip_option), default)]
8971 pub insensitive: Option<bool>,
8972 #[builder(setter(into, strip_option), default)]
8974 pub limit: Option<isize>,
8975 #[builder(setter(into, strip_option), default)]
8977 pub literal: Option<bool>,
8978 #[builder(setter(into, strip_option), default)]
8980 pub multiline: Option<bool>,
8981 #[builder(setter(into, strip_option), default)]
8982 pub paths: Option<Vec<&'a str>>,
8983 #[builder(setter(into, strip_option), default)]
8985 pub skip_hidden: Option<bool>,
8986 #[builder(setter(into, strip_option), default)]
8988 pub skip_ignored: Option<bool>,
8989}
8990#[derive(Builder, Debug, PartialEq)]
8991pub struct FileWithReplacedOpts {
8992 #[builder(setter(into, strip_option), default)]
8994 pub all: Option<bool>,
8995 #[builder(setter(into, strip_option), default)]
8997 pub first_from: Option<isize>,
8998}
8999#[derive(Builder, Debug, PartialEq)]
9000pub struct FileExportOpts {
9001 #[builder(setter(into, strip_option), default)]
9003 pub allow_parent_dir_path: Option<bool>,
9004}
9005#[derive(Builder, Debug, PartialEq)]
9006pub struct FileAsEnvFileOpts {
9007 #[builder(setter(into, strip_option), default)]
9009 pub expand: Option<bool>,
9010}
9011impl IntoID<Id> for File {
9012 fn into_id(
9013 self,
9014 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9015 Box::pin(async move { self.id().await })
9016 }
9017}
9018impl Loadable for File {
9019 fn graphql_type() -> &'static str {
9020 "File"
9021 }
9022 fn from_query(
9023 proc: Option<Arc<DaggerSessionProc>>,
9024 selection: Selection,
9025 graphql_client: DynGraphQLClient,
9026 ) -> Self {
9027 Self {
9028 proc,
9029 selection,
9030 graphql_client,
9031 }
9032 }
9033}
9034impl File {
9035 pub async fn id(&self) -> Result<Id, DaggerError> {
9037 let query = self.selection.select("id");
9038 query.execute(self.graphql_client.clone()).await
9039 }
9040 pub async fn sync(&self) -> Result<File, DaggerError> {
9042 let query = self.selection.select("sync");
9043 let id: Id = query.execute(self.graphql_client.clone()).await?;
9044 Ok(File {
9045 proc: self.proc.clone(),
9046 selection: query
9047 .root()
9048 .select("node")
9049 .arg("id", &id.0)
9050 .inline_fragment("File"),
9051 graphql_client: self.graphql_client.clone(),
9052 })
9053 }
9054 pub async fn contents(&self) -> Result<String, DaggerError> {
9060 let query = self.selection.select("contents");
9061 query.execute(self.graphql_client.clone()).await
9062 }
9063 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9069 let mut query = self.selection.select("contents");
9070 if let Some(offset_lines) = opts.offset_lines {
9071 query = query.arg("offsetLines", offset_lines);
9072 }
9073 if let Some(limit_lines) = opts.limit_lines {
9074 query = query.arg("limitLines", limit_lines);
9075 }
9076 query.execute(self.graphql_client.clone()).await
9077 }
9078 pub async fn size(&self) -> Result<isize, DaggerError> {
9080 let query = self.selection.select("size");
9081 query.execute(self.graphql_client.clone()).await
9082 }
9083 pub async fn name(&self) -> Result<String, DaggerError> {
9085 let query = self.selection.select("name");
9086 query.execute(self.graphql_client.clone()).await
9087 }
9088 pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
9090 let query = self.selection.select("stat");
9091 let query = query.select("id");
9092 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9093 Ok(id.map(|id| Stat {
9094 proc: self.proc.clone(),
9095 selection: query
9096 .root()
9097 .select("node")
9098 .arg("id", &id.0)
9099 .inline_fragment("Stat"),
9100 graphql_client: self.graphql_client.clone(),
9101 }))
9102 }
9103 pub async fn digest(&self) -> Result<String, DaggerError> {
9109 let query = self.selection.select("digest");
9110 query.execute(self.graphql_client.clone()).await
9111 }
9112 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9118 let mut query = self.selection.select("digest");
9119 if let Some(exclude_metadata) = opts.exclude_metadata {
9120 query = query.arg("excludeMetadata", exclude_metadata);
9121 }
9122 query.execute(self.graphql_client.clone()).await
9123 }
9124 pub fn with_name(&self, name: impl Into<String>) -> File {
9130 let mut query = self.selection.select("withName");
9131 query = query.arg("name", name.into());
9132 File {
9133 proc: self.proc.clone(),
9134 selection: query,
9135 graphql_client: self.graphql_client.clone(),
9136 }
9137 }
9138 pub async fn search(
9146 &self,
9147 pattern: impl Into<String>,
9148 ) -> Result<Vec<SearchResult>, DaggerError> {
9149 let mut query = self.selection.select("search");
9150 query = query.arg("pattern", pattern.into());
9151 let query = query.select("id");
9152 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9153 Ok(ids
9154 .into_iter()
9155 .map(|id| SearchResult {
9156 proc: self.proc.clone(),
9157 selection: crate::querybuilder::query()
9158 .select("node")
9159 .arg("id", &id.0)
9160 .inline_fragment("SearchResult"),
9161 graphql_client: self.graphql_client.clone(),
9162 })
9163 .collect())
9164 }
9165 pub async fn search_opts<'a>(
9173 &self,
9174 pattern: impl Into<String>,
9175 opts: FileSearchOpts<'a>,
9176 ) -> Result<Vec<SearchResult>, DaggerError> {
9177 let mut query = self.selection.select("search");
9178 query = query.arg("pattern", pattern.into());
9179 if let Some(literal) = opts.literal {
9180 query = query.arg("literal", literal);
9181 }
9182 if let Some(multiline) = opts.multiline {
9183 query = query.arg("multiline", multiline);
9184 }
9185 if let Some(dotall) = opts.dotall {
9186 query = query.arg("dotall", dotall);
9187 }
9188 if let Some(insensitive) = opts.insensitive {
9189 query = query.arg("insensitive", insensitive);
9190 }
9191 if let Some(skip_ignored) = opts.skip_ignored {
9192 query = query.arg("skipIgnored", skip_ignored);
9193 }
9194 if let Some(skip_hidden) = opts.skip_hidden {
9195 query = query.arg("skipHidden", skip_hidden);
9196 }
9197 if let Some(files_only) = opts.files_only {
9198 query = query.arg("filesOnly", files_only);
9199 }
9200 if let Some(limit) = opts.limit {
9201 query = query.arg("limit", limit);
9202 }
9203 if let Some(paths) = opts.paths {
9204 query = query.arg("paths", paths);
9205 }
9206 if let Some(globs) = opts.globs {
9207 query = query.arg("globs", globs);
9208 }
9209 let query = query.select("id");
9210 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9211 Ok(ids
9212 .into_iter()
9213 .map(|id| SearchResult {
9214 proc: self.proc.clone(),
9215 selection: crate::querybuilder::query()
9216 .select("node")
9217 .arg("id", &id.0)
9218 .inline_fragment("SearchResult"),
9219 graphql_client: self.graphql_client.clone(),
9220 })
9221 .collect())
9222 }
9223 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9235 let mut query = self.selection.select("withReplaced");
9236 query = query.arg("search", search.into());
9237 query = query.arg("replacement", replacement.into());
9238 File {
9239 proc: self.proc.clone(),
9240 selection: query,
9241 graphql_client: self.graphql_client.clone(),
9242 }
9243 }
9244 pub fn with_replaced_opts(
9256 &self,
9257 search: impl Into<String>,
9258 replacement: impl Into<String>,
9259 opts: FileWithReplacedOpts,
9260 ) -> File {
9261 let mut query = self.selection.select("withReplaced");
9262 query = query.arg("search", search.into());
9263 query = query.arg("replacement", replacement.into());
9264 if let Some(all) = opts.all {
9265 query = query.arg("all", all);
9266 }
9267 if let Some(first_from) = opts.first_from {
9268 query = query.arg("firstFrom", first_from);
9269 }
9270 File {
9271 proc: self.proc.clone(),
9272 selection: query,
9273 graphql_client: self.graphql_client.clone(),
9274 }
9275 }
9276 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9283 let mut query = self.selection.select("export");
9284 query = query.arg("path", path.into());
9285 query.execute(self.graphql_client.clone()).await
9286 }
9287 pub async fn export_opts(
9294 &self,
9295 path: impl Into<String>,
9296 opts: FileExportOpts,
9297 ) -> Result<String, DaggerError> {
9298 let mut query = self.selection.select("export");
9299 query = query.arg("path", path.into());
9300 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9301 query = query.arg("allowParentDirPath", allow_parent_dir_path);
9302 }
9303 query.execute(self.graphql_client.clone()).await
9304 }
9305 pub fn with_timestamps(&self, timestamp: isize) -> File {
9313 let mut query = self.selection.select("withTimestamps");
9314 query = query.arg("timestamp", timestamp);
9315 File {
9316 proc: self.proc.clone(),
9317 selection: query,
9318 graphql_client: self.graphql_client.clone(),
9319 }
9320 }
9321 pub fn chown(&self, owner: impl Into<String>) -> File {
9331 let mut query = self.selection.select("chown");
9332 query = query.arg("owner", owner.into());
9333 File {
9334 proc: self.proc.clone(),
9335 selection: query,
9336 graphql_client: self.graphql_client.clone(),
9337 }
9338 }
9339 pub fn as_git_bundle(&self) -> GitBundle {
9341 let query = self.selection.select("asGitBundle");
9342 GitBundle {
9343 proc: self.proc.clone(),
9344 selection: query,
9345 graphql_client: self.graphql_client.clone(),
9346 }
9347 }
9348 pub fn as_json(&self) -> JsonValue {
9350 let query = self.selection.select("asJSON");
9351 JsonValue {
9352 proc: self.proc.clone(),
9353 selection: query,
9354 graphql_client: self.graphql_client.clone(),
9355 }
9356 }
9357 pub fn as_env_file(&self) -> EnvFile {
9363 let query = self.selection.select("asEnvFile");
9364 EnvFile {
9365 proc: self.proc.clone(),
9366 selection: query,
9367 graphql_client: self.graphql_client.clone(),
9368 }
9369 }
9370 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9376 let mut query = self.selection.select("asEnvFile");
9377 if let Some(expand) = opts.expand {
9378 query = query.arg("expand", expand);
9379 }
9380 EnvFile {
9381 proc: self.proc.clone(),
9382 selection: query,
9383 graphql_client: self.graphql_client.clone(),
9384 }
9385 }
9386}
9387impl Exportable for File {
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 fn export(
9394 &self,
9395 path: impl Into<String>,
9396 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9397 let mut query = self.selection.select("export");
9398 query = query.arg("path", path.into());
9399 let graphql_client = self.graphql_client.clone();
9400 async move { query.execute(graphql_client).await }
9401 }
9402}
9403impl Node for File {
9404 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9405 let query = self.selection.select("id");
9406 let graphql_client = self.graphql_client.clone();
9407 async move { query.execute(graphql_client).await }
9408 }
9409}
9410impl Syncer for File {
9411 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9412 let query = self.selection.select("id");
9413 let graphql_client = self.graphql_client.clone();
9414 async move { query.execute(graphql_client).await }
9415 }
9416 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
9417 let query = self.selection.select("sync");
9418 let proc = self.proc.clone();
9419 let graphql_client = self.graphql_client.clone();
9420 async move {
9421 let id: Id = query.execute(graphql_client.clone()).await?;
9422 Ok(Self {
9423 proc,
9424 selection: query
9425 .root()
9426 .select("node")
9427 .arg("id", &id.0)
9428 .inline_fragment("File"),
9429 graphql_client,
9430 })
9431 }
9432 }
9433}
9434#[derive(Clone)]
9435pub struct Function {
9436 pub proc: Option<Arc<DaggerSessionProc>>,
9437 pub selection: Selection,
9438 pub graphql_client: DynGraphQLClient,
9439}
9440#[derive(Builder, Debug, PartialEq)]
9441pub struct FunctionWithDeprecatedOpts<'a> {
9442 #[builder(setter(into, strip_option), default)]
9444 pub reason: Option<&'a str>,
9445}
9446#[derive(Builder, Debug, PartialEq)]
9447pub struct FunctionWithArgOpts<'a> {
9448 #[builder(setter(into, strip_option), default)]
9449 pub default_address: Option<&'a str>,
9450 #[builder(setter(into, strip_option), default)]
9452 pub default_path: Option<&'a str>,
9453 #[builder(setter(into, strip_option), default)]
9455 pub default_value: Option<Json>,
9456 #[builder(setter(into, strip_option), default)]
9458 pub deprecated: Option<&'a str>,
9459 #[builder(setter(into, strip_option), default)]
9461 pub description: Option<&'a str>,
9462 #[builder(setter(into, strip_option), default)]
9464 pub ignore: Option<Vec<&'a str>>,
9465 #[builder(setter(into, strip_option), default)]
9467 pub source_map: Option<Id>,
9468}
9469#[derive(Builder, Debug, PartialEq)]
9470pub struct FunctionWithCachePolicyOpts<'a> {
9471 #[builder(setter(into, strip_option), default)]
9473 pub time_to_live: Option<&'a str>,
9474}
9475impl IntoID<Id> for Function {
9476 fn into_id(
9477 self,
9478 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9479 Box::pin(async move { self.id().await })
9480 }
9481}
9482impl Loadable for Function {
9483 fn graphql_type() -> &'static str {
9484 "Function"
9485 }
9486 fn from_query(
9487 proc: Option<Arc<DaggerSessionProc>>,
9488 selection: Selection,
9489 graphql_client: DynGraphQLClient,
9490 ) -> Self {
9491 Self {
9492 proc,
9493 selection,
9494 graphql_client,
9495 }
9496 }
9497}
9498impl Function {
9499 pub async fn id(&self) -> Result<Id, DaggerError> {
9501 let query = self.selection.select("id");
9502 query.execute(self.graphql_client.clone()).await
9503 }
9504 pub fn with_description(&self, description: impl Into<String>) -> Function {
9510 let mut query = self.selection.select("withDescription");
9511 query = query.arg("description", description.into());
9512 Function {
9513 proc: self.proc.clone(),
9514 selection: query,
9515 graphql_client: self.graphql_client.clone(),
9516 }
9517 }
9518 pub fn with_deprecated(&self) -> Function {
9524 let query = self.selection.select("withDeprecated");
9525 Function {
9526 proc: self.proc.clone(),
9527 selection: query,
9528 graphql_client: self.graphql_client.clone(),
9529 }
9530 }
9531 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9537 let mut query = self.selection.select("withDeprecated");
9538 if let Some(reason) = opts.reason {
9539 query = query.arg("reason", reason);
9540 }
9541 Function {
9542 proc: self.proc.clone(),
9543 selection: query,
9544 graphql_client: self.graphql_client.clone(),
9545 }
9546 }
9547 pub fn with_check(&self) -> Function {
9549 let query = self.selection.select("withCheck");
9550 Function {
9551 proc: self.proc.clone(),
9552 selection: query,
9553 graphql_client: self.graphql_client.clone(),
9554 }
9555 }
9556 pub fn with_generator(&self) -> Function {
9558 let query = self.selection.select("withGenerator");
9559 Function {
9560 proc: self.proc.clone(),
9561 selection: query,
9562 graphql_client: self.graphql_client.clone(),
9563 }
9564 }
9565 pub fn with_up(&self) -> Function {
9567 let query = self.selection.select("withUp");
9568 Function {
9569 proc: self.proc.clone(),
9570 selection: query,
9571 graphql_client: self.graphql_client.clone(),
9572 }
9573 }
9574 pub fn with_agent(&self) -> Function {
9576 let query = self.selection.select("withAgent");
9577 Function {
9578 proc: self.proc.clone(),
9579 selection: query,
9580 graphql_client: self.graphql_client.clone(),
9581 }
9582 }
9583 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9589 let mut query = self.selection.select("withSourceMap");
9590 query = query.arg_lazy(
9591 "sourceMap",
9592 Box::new(move || {
9593 let source_map = source_map.clone();
9594 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9595 }),
9596 );
9597 Function {
9598 proc: self.proc.clone(),
9599 selection: query,
9600 graphql_client: self.graphql_client.clone(),
9601 }
9602 }
9603 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9611 let mut query = self.selection.select("withArg");
9612 query = query.arg("name", name.into());
9613 query = query.arg_lazy(
9614 "typeDef",
9615 Box::new(move || {
9616 let type_def = type_def.clone();
9617 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9618 }),
9619 );
9620 Function {
9621 proc: self.proc.clone(),
9622 selection: query,
9623 graphql_client: self.graphql_client.clone(),
9624 }
9625 }
9626 pub fn with_arg_opts<'a>(
9634 &self,
9635 name: impl Into<String>,
9636 type_def: impl IntoID<Id>,
9637 opts: FunctionWithArgOpts<'a>,
9638 ) -> Function {
9639 let mut query = self.selection.select("withArg");
9640 query = query.arg("name", name.into());
9641 query = query.arg_lazy(
9642 "typeDef",
9643 Box::new(move || {
9644 let type_def = type_def.clone();
9645 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9646 }),
9647 );
9648 if let Some(description) = opts.description {
9649 query = query.arg("description", description);
9650 }
9651 if let Some(default_value) = opts.default_value {
9652 query = query.arg("defaultValue", default_value);
9653 }
9654 if let Some(default_path) = opts.default_path {
9655 query = query.arg("defaultPath", default_path);
9656 }
9657 if let Some(ignore) = opts.ignore {
9658 query = query.arg("ignore", ignore);
9659 }
9660 if let Some(source_map) = opts.source_map {
9661 query = query.arg("sourceMap", source_map);
9662 }
9663 if let Some(deprecated) = opts.deprecated {
9664 query = query.arg("deprecated", deprecated);
9665 }
9666 if let Some(default_address) = opts.default_address {
9667 query = query.arg("defaultAddress", default_address);
9668 }
9669 Function {
9670 proc: self.proc.clone(),
9671 selection: query,
9672 graphql_client: self.graphql_client.clone(),
9673 }
9674 }
9675 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9682 let mut query = self.selection.select("withCachePolicy");
9683 query = query.arg("policy", policy);
9684 Function {
9685 proc: self.proc.clone(),
9686 selection: query,
9687 graphql_client: self.graphql_client.clone(),
9688 }
9689 }
9690 pub fn with_cache_policy_opts<'a>(
9697 &self,
9698 policy: FunctionCachePolicy,
9699 opts: FunctionWithCachePolicyOpts<'a>,
9700 ) -> Function {
9701 let mut query = self.selection.select("withCachePolicy");
9702 query = query.arg("policy", policy);
9703 if let Some(time_to_live) = opts.time_to_live {
9704 query = query.arg("timeToLive", time_to_live);
9705 }
9706 Function {
9707 proc: self.proc.clone(),
9708 selection: query,
9709 graphql_client: self.graphql_client.clone(),
9710 }
9711 }
9712 pub async fn name(&self) -> Result<String, DaggerError> {
9714 let query = self.selection.select("name");
9715 query.execute(self.graphql_client.clone()).await
9716 }
9717 pub async fn description(&self) -> Result<String, DaggerError> {
9719 let query = self.selection.select("description");
9720 query.execute(self.graphql_client.clone()).await
9721 }
9722 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9724 let query = self.selection.select("deprecated");
9725 query.execute(self.graphql_client.clone()).await
9726 }
9727 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9729 let query = self.selection.select("sourceMap");
9730 let query = query.select("id");
9731 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9732 Ok(id.map(|id| SourceMap {
9733 proc: self.proc.clone(),
9734 selection: query
9735 .root()
9736 .select("node")
9737 .arg("id", &id.0)
9738 .inline_fragment("SourceMap"),
9739 graphql_client: self.graphql_client.clone(),
9740 }))
9741 }
9742 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9744 let query = self.selection.select("sourceModuleName");
9745 query.execute(self.graphql_client.clone()).await
9746 }
9747 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9749 let query = self.selection.select("args");
9750 let query = query.select("id");
9751 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9752 Ok(ids
9753 .into_iter()
9754 .map(|id| FunctionArg {
9755 proc: self.proc.clone(),
9756 selection: crate::querybuilder::query()
9757 .select("node")
9758 .arg("id", &id.0)
9759 .inline_fragment("FunctionArg"),
9760 graphql_client: self.graphql_client.clone(),
9761 })
9762 .collect())
9763 }
9764 pub fn return_type(&self) -> TypeDef {
9766 let query = self.selection.select("returnType");
9767 TypeDef {
9768 proc: self.proc.clone(),
9769 selection: query,
9770 graphql_client: self.graphql_client.clone(),
9771 }
9772 }
9773}
9774impl Node for Function {
9775 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9776 let query = self.selection.select("id");
9777 let graphql_client = self.graphql_client.clone();
9778 async move { query.execute(graphql_client).await }
9779 }
9780}
9781#[derive(Clone)]
9782pub struct FunctionArg {
9783 pub proc: Option<Arc<DaggerSessionProc>>,
9784 pub selection: Selection,
9785 pub graphql_client: DynGraphQLClient,
9786}
9787impl IntoID<Id> for FunctionArg {
9788 fn into_id(
9789 self,
9790 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9791 Box::pin(async move { self.id().await })
9792 }
9793}
9794impl Loadable for FunctionArg {
9795 fn graphql_type() -> &'static str {
9796 "FunctionArg"
9797 }
9798 fn from_query(
9799 proc: Option<Arc<DaggerSessionProc>>,
9800 selection: Selection,
9801 graphql_client: DynGraphQLClient,
9802 ) -> Self {
9803 Self {
9804 proc,
9805 selection,
9806 graphql_client,
9807 }
9808 }
9809}
9810impl FunctionArg {
9811 pub async fn id(&self) -> Result<Id, DaggerError> {
9813 let query = self.selection.select("id");
9814 query.execute(self.graphql_client.clone()).await
9815 }
9816 pub async fn name(&self) -> Result<String, DaggerError> {
9818 let query = self.selection.select("name");
9819 query.execute(self.graphql_client.clone()).await
9820 }
9821 pub async fn description(&self) -> Result<String, DaggerError> {
9823 let query = self.selection.select("description");
9824 query.execute(self.graphql_client.clone()).await
9825 }
9826 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9828 let query = self.selection.select("sourceMap");
9829 let query = query.select("id");
9830 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9831 Ok(id.map(|id| SourceMap {
9832 proc: self.proc.clone(),
9833 selection: query
9834 .root()
9835 .select("node")
9836 .arg("id", &id.0)
9837 .inline_fragment("SourceMap"),
9838 graphql_client: self.graphql_client.clone(),
9839 }))
9840 }
9841 pub async fn default_value(&self) -> Result<Json, DaggerError> {
9843 let query = self.selection.select("defaultValue");
9844 query.execute(self.graphql_client.clone()).await
9845 }
9846 pub async fn default_path(&self) -> Result<String, DaggerError> {
9848 let query = self.selection.select("defaultPath");
9849 query.execute(self.graphql_client.clone()).await
9850 }
9851 pub async fn default_address(&self) -> Result<String, DaggerError> {
9853 let query = self.selection.select("defaultAddress");
9854 query.execute(self.graphql_client.clone()).await
9855 }
9856 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9858 let query = self.selection.select("ignore");
9859 query.execute(self.graphql_client.clone()).await
9860 }
9861 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9863 let query = self.selection.select("deprecated");
9864 query.execute(self.graphql_client.clone()).await
9865 }
9866 pub fn type_def(&self) -> TypeDef {
9868 let query = self.selection.select("typeDef");
9869 TypeDef {
9870 proc: self.proc.clone(),
9871 selection: query,
9872 graphql_client: self.graphql_client.clone(),
9873 }
9874 }
9875}
9876impl Node for FunctionArg {
9877 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9878 let query = self.selection.select("id");
9879 let graphql_client = self.graphql_client.clone();
9880 async move { query.execute(graphql_client).await }
9881 }
9882}
9883#[derive(Clone)]
9884pub struct FunctionCall {
9885 pub proc: Option<Arc<DaggerSessionProc>>,
9886 pub selection: Selection,
9887 pub graphql_client: DynGraphQLClient,
9888}
9889impl IntoID<Id> for FunctionCall {
9890 fn into_id(
9891 self,
9892 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9893 Box::pin(async move { self.id().await })
9894 }
9895}
9896impl Loadable for FunctionCall {
9897 fn graphql_type() -> &'static str {
9898 "FunctionCall"
9899 }
9900 fn from_query(
9901 proc: Option<Arc<DaggerSessionProc>>,
9902 selection: Selection,
9903 graphql_client: DynGraphQLClient,
9904 ) -> Self {
9905 Self {
9906 proc,
9907 selection,
9908 graphql_client,
9909 }
9910 }
9911}
9912impl FunctionCall {
9913 pub async fn id(&self) -> Result<Id, DaggerError> {
9915 let query = self.selection.select("id");
9916 query.execute(self.graphql_client.clone()).await
9917 }
9918 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9924 let mut query = self.selection.select("returnValue");
9925 query = query.arg("value", value);
9926 query.execute(self.graphql_client.clone()).await
9927 }
9928 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9934 let mut query = self.selection.select("returnError");
9935 query = query.arg_lazy(
9936 "error",
9937 Box::new(move || {
9938 let error = error.clone();
9939 Box::pin(async move { error.into_id().await.unwrap().quote() })
9940 }),
9941 );
9942 query.execute(self.graphql_client.clone()).await
9943 }
9944 pub async fn name(&self) -> Result<String, DaggerError> {
9946 let query = self.selection.select("name");
9947 query.execute(self.graphql_client.clone()).await
9948 }
9949 pub async fn parent_name(&self) -> Result<String, DaggerError> {
9951 let query = self.selection.select("parentName");
9952 query.execute(self.graphql_client.clone()).await
9953 }
9954 pub async fn parent(&self) -> Result<Json, DaggerError> {
9956 let query = self.selection.select("parent");
9957 query.execute(self.graphql_client.clone()).await
9958 }
9959 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9961 let query = self.selection.select("inputArgs");
9962 let query = query.select("id");
9963 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9964 Ok(ids
9965 .into_iter()
9966 .map(|id| FunctionCallArgValue {
9967 proc: self.proc.clone(),
9968 selection: crate::querybuilder::query()
9969 .select("node")
9970 .arg("id", &id.0)
9971 .inline_fragment("FunctionCallArgValue"),
9972 graphql_client: self.graphql_client.clone(),
9973 })
9974 .collect())
9975 }
9976}
9977impl Node for FunctionCall {
9978 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9979 let query = self.selection.select("id");
9980 let graphql_client = self.graphql_client.clone();
9981 async move { query.execute(graphql_client).await }
9982 }
9983}
9984#[derive(Clone)]
9985pub struct FunctionCallArgValue {
9986 pub proc: Option<Arc<DaggerSessionProc>>,
9987 pub selection: Selection,
9988 pub graphql_client: DynGraphQLClient,
9989}
9990impl IntoID<Id> for FunctionCallArgValue {
9991 fn into_id(
9992 self,
9993 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9994 Box::pin(async move { self.id().await })
9995 }
9996}
9997impl Loadable for FunctionCallArgValue {
9998 fn graphql_type() -> &'static str {
9999 "FunctionCallArgValue"
10000 }
10001 fn from_query(
10002 proc: Option<Arc<DaggerSessionProc>>,
10003 selection: Selection,
10004 graphql_client: DynGraphQLClient,
10005 ) -> Self {
10006 Self {
10007 proc,
10008 selection,
10009 graphql_client,
10010 }
10011 }
10012}
10013impl FunctionCallArgValue {
10014 pub async fn id(&self) -> Result<Id, DaggerError> {
10016 let query = self.selection.select("id");
10017 query.execute(self.graphql_client.clone()).await
10018 }
10019 pub async fn name(&self) -> Result<String, DaggerError> {
10021 let query = self.selection.select("name");
10022 query.execute(self.graphql_client.clone()).await
10023 }
10024 pub async fn value(&self) -> Result<Json, DaggerError> {
10026 let query = self.selection.select("value");
10027 query.execute(self.graphql_client.clone()).await
10028 }
10029}
10030impl Node for FunctionCallArgValue {
10031 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10032 let query = self.selection.select("id");
10033 let graphql_client = self.graphql_client.clone();
10034 async move { query.execute(graphql_client).await }
10035 }
10036}
10037#[derive(Clone)]
10038pub struct GeneratedCode {
10039 pub proc: Option<Arc<DaggerSessionProc>>,
10040 pub selection: Selection,
10041 pub graphql_client: DynGraphQLClient,
10042}
10043impl IntoID<Id> for GeneratedCode {
10044 fn into_id(
10045 self,
10046 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10047 Box::pin(async move { self.id().await })
10048 }
10049}
10050impl Loadable for GeneratedCode {
10051 fn graphql_type() -> &'static str {
10052 "GeneratedCode"
10053 }
10054 fn from_query(
10055 proc: Option<Arc<DaggerSessionProc>>,
10056 selection: Selection,
10057 graphql_client: DynGraphQLClient,
10058 ) -> Self {
10059 Self {
10060 proc,
10061 selection,
10062 graphql_client,
10063 }
10064 }
10065}
10066impl GeneratedCode {
10067 pub async fn id(&self) -> Result<Id, DaggerError> {
10069 let query = self.selection.select("id");
10070 query.execute(self.graphql_client.clone()).await
10071 }
10072 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10074 let mut query = self.selection.select("withVCSGeneratedPaths");
10075 query = query.arg(
10076 "paths",
10077 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10078 );
10079 GeneratedCode {
10080 proc: self.proc.clone(),
10081 selection: query,
10082 graphql_client: self.graphql_client.clone(),
10083 }
10084 }
10085 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10087 let mut query = self.selection.select("withVCSIgnoredPaths");
10088 query = query.arg(
10089 "paths",
10090 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10091 );
10092 GeneratedCode {
10093 proc: self.proc.clone(),
10094 selection: query,
10095 graphql_client: self.graphql_client.clone(),
10096 }
10097 }
10098 pub fn code(&self) -> Directory {
10100 let query = self.selection.select("code");
10101 Directory {
10102 proc: self.proc.clone(),
10103 selection: query,
10104 graphql_client: self.graphql_client.clone(),
10105 }
10106 }
10107 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10109 let query = self.selection.select("vcsGeneratedPaths");
10110 query.execute(self.graphql_client.clone()).await
10111 }
10112 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10114 let query = self.selection.select("vcsIgnoredPaths");
10115 query.execute(self.graphql_client.clone()).await
10116 }
10117}
10118impl Node for GeneratedCode {
10119 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10120 let query = self.selection.select("id");
10121 let graphql_client = self.graphql_client.clone();
10122 async move { query.execute(graphql_client).await }
10123 }
10124}
10125#[derive(Clone)]
10126pub struct Generator {
10127 pub proc: Option<Arc<DaggerSessionProc>>,
10128 pub selection: Selection,
10129 pub graphql_client: DynGraphQLClient,
10130}
10131impl IntoID<Id> for Generator {
10132 fn into_id(
10133 self,
10134 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10135 Box::pin(async move { self.id().await })
10136 }
10137}
10138impl Loadable for Generator {
10139 fn graphql_type() -> &'static str {
10140 "Generator"
10141 }
10142 fn from_query(
10143 proc: Option<Arc<DaggerSessionProc>>,
10144 selection: Selection,
10145 graphql_client: DynGraphQLClient,
10146 ) -> Self {
10147 Self {
10148 proc,
10149 selection,
10150 graphql_client,
10151 }
10152 }
10153}
10154impl Generator {
10155 pub async fn id(&self) -> Result<Id, DaggerError> {
10157 let query = self.selection.select("id");
10158 query.execute(self.graphql_client.clone()).await
10159 }
10160 pub fn changeset(&self) -> Changeset {
10162 let query = self.selection.select("changeset");
10163 Changeset {
10164 proc: self.proc.clone(),
10165 selection: query,
10166 graphql_client: self.graphql_client.clone(),
10167 }
10168 }
10169 pub fn sync(&self) -> Generator {
10171 let query = self.selection.select("sync");
10172 Generator {
10173 proc: self.proc.clone(),
10174 selection: query,
10175 graphql_client: self.graphql_client.clone(),
10176 }
10177 }
10178 pub fn stale(&self) -> Check {
10180 let query = self.selection.select("stale");
10181 Check {
10182 proc: self.proc.clone(),
10183 selection: query,
10184 graphql_client: self.graphql_client.clone(),
10185 }
10186 }
10187}
10188impl Node for Generator {
10189 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10190 let query = self.selection.select("id");
10191 let graphql_client = self.graphql_client.clone();
10192 async move { query.execute(graphql_client).await }
10193 }
10194}
10195#[derive(Clone)]
10196pub struct GitBundle {
10197 pub proc: Option<Arc<DaggerSessionProc>>,
10198 pub selection: Selection,
10199 pub graphql_client: DynGraphQLClient,
10200}
10201impl IntoID<Id> for GitBundle {
10202 fn into_id(
10203 self,
10204 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10205 Box::pin(async move { self.id().await })
10206 }
10207}
10208impl Loadable for GitBundle {
10209 fn graphql_type() -> &'static str {
10210 "GitBundle"
10211 }
10212 fn from_query(
10213 proc: Option<Arc<DaggerSessionProc>>,
10214 selection: Selection,
10215 graphql_client: DynGraphQLClient,
10216 ) -> Self {
10217 Self {
10218 proc,
10219 selection,
10220 graphql_client,
10221 }
10222 }
10223}
10224impl GitBundle {
10225 pub async fn id(&self) -> Result<Id, DaggerError> {
10227 let query = self.selection.select("id");
10228 query.execute(self.graphql_client.clone()).await
10229 }
10230 pub fn validate(&self) -> GitBundle {
10232 let query = self.selection.select("validate");
10233 GitBundle {
10234 proc: self.proc.clone(),
10235 selection: query,
10236 graphql_client: self.graphql_client.clone(),
10237 }
10238 }
10239 pub fn as_file(&self) -> File {
10241 let query = self.selection.select("asFile");
10242 File {
10243 proc: self.proc.clone(),
10244 selection: query,
10245 graphql_client: self.graphql_client.clone(),
10246 }
10247 }
10248 pub async fn version(&self) -> Result<isize, DaggerError> {
10250 let query = self.selection.select("version");
10251 query.execute(self.graphql_client.clone()).await
10252 }
10253 pub async fn object_format(&self) -> Result<String, DaggerError> {
10255 let query = self.selection.select("objectFormat");
10256 query.execute(self.graphql_client.clone()).await
10257 }
10258 pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
10260 let query = self.selection.select("refs");
10261 let query = query.select("id");
10262 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10263 Ok(ids
10264 .into_iter()
10265 .map(|id| GitBundleRef {
10266 proc: self.proc.clone(),
10267 selection: crate::querybuilder::query()
10268 .select("node")
10269 .arg("id", &id.0)
10270 .inline_fragment("GitBundleRef"),
10271 graphql_client: self.graphql_client.clone(),
10272 })
10273 .collect())
10274 }
10275 pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
10277 let query = self.selection.select("prerequisiteSHAs");
10278 query.execute(self.graphql_client.clone()).await
10279 }
10280}
10281impl Node for GitBundle {
10282 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10283 let query = self.selection.select("id");
10284 let graphql_client = self.graphql_client.clone();
10285 async move { query.execute(graphql_client).await }
10286 }
10287}
10288#[derive(Clone)]
10289pub struct GitBundleRef {
10290 pub proc: Option<Arc<DaggerSessionProc>>,
10291 pub selection: Selection,
10292 pub graphql_client: DynGraphQLClient,
10293}
10294impl IntoID<Id> for GitBundleRef {
10295 fn into_id(
10296 self,
10297 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10298 Box::pin(async move { self.id().await })
10299 }
10300}
10301impl Loadable for GitBundleRef {
10302 fn graphql_type() -> &'static str {
10303 "GitBundleRef"
10304 }
10305 fn from_query(
10306 proc: Option<Arc<DaggerSessionProc>>,
10307 selection: Selection,
10308 graphql_client: DynGraphQLClient,
10309 ) -> Self {
10310 Self {
10311 proc,
10312 selection,
10313 graphql_client,
10314 }
10315 }
10316}
10317impl GitBundleRef {
10318 pub async fn id(&self) -> Result<Id, DaggerError> {
10320 let query = self.selection.select("id");
10321 query.execute(self.graphql_client.clone()).await
10322 }
10323 pub async fn name(&self) -> Result<String, DaggerError> {
10325 let query = self.selection.select("name");
10326 query.execute(self.graphql_client.clone()).await
10327 }
10328 pub async fn sha(&self) -> Result<String, DaggerError> {
10330 let query = self.selection.select("sha");
10331 query.execute(self.graphql_client.clone()).await
10332 }
10333}
10334impl Node for GitBundleRef {
10335 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10336 let query = self.selection.select("id");
10337 let graphql_client = self.graphql_client.clone();
10338 async move { query.execute(graphql_client).await }
10339 }
10340}
10341#[derive(Clone)]
10342pub struct GitCommit {
10343 pub proc: Option<Arc<DaggerSessionProc>>,
10344 pub selection: Selection,
10345 pub graphql_client: DynGraphQLClient,
10346}
10347#[derive(Builder, Debug, PartialEq)]
10348pub struct GitCommitReleaseTagOpts {
10349 #[builder(setter(into, strip_option), default)]
10351 pub include_pre_release: Option<bool>,
10352}
10353#[derive(Builder, Debug, PartialEq)]
10354pub struct GitCommitAncestorReleaseTagOpts {
10355 #[builder(setter(into, strip_option), default)]
10357 pub include_pre_release: Option<bool>,
10358}
10359#[derive(Builder, Debug, PartialEq)]
10360pub struct GitCommitTreeOpts {
10361 #[builder(setter(into, strip_option), default)]
10363 pub depth: Option<isize>,
10364 #[builder(setter(into, strip_option), default)]
10366 pub discard_git_dir: Option<bool>,
10367 #[builder(setter(into, strip_option), default)]
10369 pub include_tags: Option<bool>,
10370}
10371#[derive(Builder, Debug, PartialEq)]
10372pub struct GitCommitChangesOpts {
10373 #[builder(setter(into, strip_option), default)]
10375 pub against: Option<Id>,
10376}
10377impl IntoID<Id> for GitCommit {
10378 fn into_id(
10379 self,
10380 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10381 Box::pin(async move { self.id().await })
10382 }
10383}
10384impl Loadable for GitCommit {
10385 fn graphql_type() -> &'static str {
10386 "GitCommit"
10387 }
10388 fn from_query(
10389 proc: Option<Arc<DaggerSessionProc>>,
10390 selection: Selection,
10391 graphql_client: DynGraphQLClient,
10392 ) -> Self {
10393 Self {
10394 proc,
10395 selection,
10396 graphql_client,
10397 }
10398 }
10399}
10400impl GitCommit {
10401 pub async fn id(&self) -> Result<Id, DaggerError> {
10403 let query = self.selection.select("id");
10404 query.execute(self.graphql_client.clone()).await
10405 }
10406 pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10412 let query = self.selection.select("releaseTag");
10413 let query = query.select("id");
10414 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10415 Ok(id.map(|id| GitRef {
10416 proc: self.proc.clone(),
10417 selection: query
10418 .root()
10419 .select("node")
10420 .arg("id", &id.0)
10421 .inline_fragment("GitRef"),
10422 graphql_client: self.graphql_client.clone(),
10423 }))
10424 }
10425 pub async fn release_tag_opts(
10431 &self,
10432 opts: GitCommitReleaseTagOpts,
10433 ) -> Result<Option<GitRef>, DaggerError> {
10434 let mut query = self.selection.select("releaseTag");
10435 if let Some(include_pre_release) = opts.include_pre_release {
10436 query = query.arg("includePreRelease", include_pre_release);
10437 }
10438 let query = query.select("id");
10439 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10440 Ok(id.map(|id| GitRef {
10441 proc: self.proc.clone(),
10442 selection: query
10443 .root()
10444 .select("node")
10445 .arg("id", &id.0)
10446 .inline_fragment("GitRef"),
10447 graphql_client: self.graphql_client.clone(),
10448 }))
10449 }
10450 pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10456 let query = self.selection.select("ancestorReleaseTag");
10457 let query = query.select("id");
10458 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10459 Ok(id.map(|id| GitRef {
10460 proc: self.proc.clone(),
10461 selection: query
10462 .root()
10463 .select("node")
10464 .arg("id", &id.0)
10465 .inline_fragment("GitRef"),
10466 graphql_client: self.graphql_client.clone(),
10467 }))
10468 }
10469 pub async fn ancestor_release_tag_opts(
10475 &self,
10476 opts: GitCommitAncestorReleaseTagOpts,
10477 ) -> Result<Option<GitRef>, DaggerError> {
10478 let mut query = self.selection.select("ancestorReleaseTag");
10479 if let Some(include_pre_release) = opts.include_pre_release {
10480 query = query.arg("includePreRelease", include_pre_release);
10481 }
10482 let query = query.select("id");
10483 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10484 Ok(id.map(|id| GitRef {
10485 proc: self.proc.clone(),
10486 selection: query
10487 .root()
10488 .select("node")
10489 .arg("id", &id.0)
10490 .inline_fragment("GitRef"),
10491 graphql_client: self.graphql_client.clone(),
10492 }))
10493 }
10494 pub fn tree(&self) -> Directory {
10500 let query = self.selection.select("tree");
10501 Directory {
10502 proc: self.proc.clone(),
10503 selection: query,
10504 graphql_client: self.graphql_client.clone(),
10505 }
10506 }
10507 pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
10513 let mut query = self.selection.select("tree");
10514 if let Some(discard_git_dir) = opts.discard_git_dir {
10515 query = query.arg("discardGitDir", discard_git_dir);
10516 }
10517 if let Some(depth) = opts.depth {
10518 query = query.arg("depth", depth);
10519 }
10520 if let Some(include_tags) = opts.include_tags {
10521 query = query.arg("includeTags", include_tags);
10522 }
10523 Directory {
10524 proc: self.proc.clone(),
10525 selection: query,
10526 graphql_client: self.graphql_client.clone(),
10527 }
10528 }
10529 pub fn changes(&self) -> Changeset {
10536 let query = self.selection.select("changes");
10537 Changeset {
10538 proc: self.proc.clone(),
10539 selection: query,
10540 graphql_client: self.graphql_client.clone(),
10541 }
10542 }
10543 pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
10550 let mut query = self.selection.select("changes");
10551 if let Some(against) = opts.against {
10552 query = query.arg("against", against);
10553 }
10554 Changeset {
10555 proc: self.proc.clone(),
10556 selection: query,
10557 graphql_client: self.graphql_client.clone(),
10558 }
10559 }
10560 pub async fn sha(&self) -> Result<String, DaggerError> {
10562 let query = self.selection.select("sha");
10563 query.execute(self.graphql_client.clone()).await
10564 }
10565 pub async fn short_sha(&self) -> Result<String, DaggerError> {
10567 let query = self.selection.select("shortSha");
10568 query.execute(self.graphql_client.clone()).await
10569 }
10570 pub async fn authored_date(&self) -> Result<String, DaggerError> {
10572 let query = self.selection.select("authoredDate");
10573 query.execute(self.graphql_client.clone()).await
10574 }
10575 pub async fn committed_date(&self) -> Result<String, DaggerError> {
10577 let query = self.selection.select("committedDate");
10578 query.execute(self.graphql_client.clone()).await
10579 }
10580 pub async fn author_name(&self) -> Result<String, DaggerError> {
10582 let query = self.selection.select("authorName");
10583 query.execute(self.graphql_client.clone()).await
10584 }
10585 pub async fn author_email(&self) -> Result<String, DaggerError> {
10587 let query = self.selection.select("authorEmail");
10588 query.execute(self.graphql_client.clone()).await
10589 }
10590 pub async fn committer_name(&self) -> Result<String, DaggerError> {
10592 let query = self.selection.select("committerName");
10593 query.execute(self.graphql_client.clone()).await
10594 }
10595 pub async fn committer_email(&self) -> Result<String, DaggerError> {
10597 let query = self.selection.select("committerEmail");
10598 query.execute(self.graphql_client.clone()).await
10599 }
10600 pub async fn message(&self) -> Result<String, DaggerError> {
10602 let query = self.selection.select("message");
10603 query.execute(self.graphql_client.clone()).await
10604 }
10605 pub async fn message_headline(&self) -> Result<String, DaggerError> {
10607 let query = self.selection.select("messageHeadline");
10608 query.execute(self.graphql_client.clone()).await
10609 }
10610 pub async fn message_body(&self) -> Result<String, DaggerError> {
10612 let query = self.selection.select("messageBody");
10613 query.execute(self.graphql_client.clone()).await
10614 }
10615 pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
10617 let query = self.selection.select("parentShas");
10618 query.execute(self.graphql_client.clone()).await
10619 }
10620}
10621impl Node for GitCommit {
10622 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10623 let query = self.selection.select("id");
10624 let graphql_client = self.graphql_client.clone();
10625 async move { query.execute(graphql_client).await }
10626 }
10627}
10628#[derive(Clone)]
10629pub struct GitPushResult {
10630 pub proc: Option<Arc<DaggerSessionProc>>,
10631 pub selection: Selection,
10632 pub graphql_client: DynGraphQLClient,
10633}
10634impl IntoID<Id> for GitPushResult {
10635 fn into_id(
10636 self,
10637 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10638 Box::pin(async move { self.id().await })
10639 }
10640}
10641impl Loadable for GitPushResult {
10642 fn graphql_type() -> &'static str {
10643 "GitPushResult"
10644 }
10645 fn from_query(
10646 proc: Option<Arc<DaggerSessionProc>>,
10647 selection: Selection,
10648 graphql_client: DynGraphQLClient,
10649 ) -> Self {
10650 Self {
10651 proc,
10652 selection,
10653 graphql_client,
10654 }
10655 }
10656}
10657impl GitPushResult {
10658 pub async fn id(&self) -> Result<Id, DaggerError> {
10660 let query = self.selection.select("id");
10661 query.execute(self.graphql_client.clone()).await
10662 }
10663 pub async fn r#ref(&self) -> Result<String, DaggerError> {
10665 let query = self.selection.select("ref");
10666 query.execute(self.graphql_client.clone()).await
10667 }
10668 pub async fn previous_sha(&self) -> Result<String, DaggerError> {
10670 let query = self.selection.select("previousSHA");
10671 query.execute(self.graphql_client.clone()).await
10672 }
10673 pub async fn sha(&self) -> Result<String, DaggerError> {
10675 let query = self.selection.select("sha");
10676 query.execute(self.graphql_client.clone()).await
10677 }
10678 pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
10680 let query = self.selection.select("disposition");
10681 query.execute(self.graphql_client.clone()).await
10682 }
10683}
10684impl Node for GitPushResult {
10685 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10686 let query = self.selection.select("id");
10687 let graphql_client = self.graphql_client.clone();
10688 async move { query.execute(graphql_client).await }
10689 }
10690}
10691#[derive(Clone)]
10692pub struct GitRef {
10693 pub proc: Option<Arc<DaggerSessionProc>>,
10694 pub selection: Selection,
10695 pub graphql_client: DynGraphQLClient,
10696}
10697#[derive(Builder, Debug, PartialEq)]
10698pub struct GitRefPushOpts<'a> {
10699 #[builder(setter(into, strip_option), default)]
10701 pub branch: Option<&'a str>,
10702 #[builder(setter(into, strip_option), default)]
10704 pub expected_remote_sha: Option<&'a str>,
10705 #[builder(setter(into, strip_option), default)]
10707 pub remote: Option<&'a str>,
10708 #[builder(setter(into, strip_option), default)]
10710 pub to: Option<Id>,
10711}
10712#[derive(Builder, Debug, PartialEq)]
10713pub struct GitRefTreeOpts {
10714 #[builder(setter(into, strip_option), default)]
10716 pub depth: Option<isize>,
10717 #[builder(setter(into, strip_option), default)]
10719 pub discard_git_dir: Option<bool>,
10720 #[builder(setter(into, strip_option), default)]
10722 pub include_tags: Option<bool>,
10723}
10724#[derive(Builder, Debug, PartialEq)]
10725pub struct GitRefLogOpts<'a> {
10726 #[builder(setter(into, strip_option), default)]
10728 pub base: Option<Id>,
10729 #[builder(setter(into, strip_option), default)]
10731 pub limit: Option<isize>,
10732 #[builder(setter(into, strip_option), default)]
10734 pub paths: Option<Vec<&'a str>>,
10735}
10736#[derive(Builder, Debug, PartialEq)]
10737pub struct GitRefWithCommitOpts<'a> {
10738 #[builder(setter(into, strip_option), default)]
10740 pub allow_empty: Option<bool>,
10741 #[builder(setter(into, strip_option), default)]
10743 pub committer_date: Option<&'a str>,
10744 #[builder(setter(into, strip_option), default)]
10746 pub committer_email: Option<&'a str>,
10747 #[builder(setter(into, strip_option), default)]
10749 pub committer_name: Option<&'a str>,
10750 #[builder(setter(into, strip_option), default)]
10752 pub signoff: Option<bool>,
10753}
10754#[derive(Builder, Debug, PartialEq)]
10755pub struct GitRefAsWorkspaceOpts<'a> {
10756 #[builder(setter(into, strip_option), default)]
10758 pub cwd: Option<&'a str>,
10759}
10760impl IntoID<Id> for GitRef {
10761 fn into_id(
10762 self,
10763 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10764 Box::pin(async move { self.id().await })
10765 }
10766}
10767impl Loadable for GitRef {
10768 fn graphql_type() -> &'static str {
10769 "GitRef"
10770 }
10771 fn from_query(
10772 proc: Option<Arc<DaggerSessionProc>>,
10773 selection: Selection,
10774 graphql_client: DynGraphQLClient,
10775 ) -> Self {
10776 Self {
10777 proc,
10778 selection,
10779 graphql_client,
10780 }
10781 }
10782}
10783impl GitRef {
10784 pub async fn id(&self) -> Result<Id, DaggerError> {
10786 let query = self.selection.select("id");
10787 query.execute(self.graphql_client.clone()).await
10788 }
10789 pub fn push(&self) -> GitPushResult {
10797 let query = self.selection.select("push");
10798 GitPushResult {
10799 proc: self.proc.clone(),
10800 selection: query,
10801 graphql_client: self.graphql_client.clone(),
10802 }
10803 }
10804 pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
10812 let mut query = self.selection.select("push");
10813 if let Some(to) = opts.to {
10814 query = query.arg("to", to);
10815 }
10816 if let Some(remote) = opts.remote {
10817 query = query.arg("remote", remote);
10818 }
10819 if let Some(branch) = opts.branch {
10820 query = query.arg("branch", branch);
10821 }
10822 if let Some(expected_remote_sha) = opts.expected_remote_sha {
10823 query = query.arg("expectedRemoteSHA", expected_remote_sha);
10824 }
10825 GitPushResult {
10826 proc: self.proc.clone(),
10827 selection: query,
10828 graphql_client: self.graphql_client.clone(),
10829 }
10830 }
10831 pub fn target_commit(&self) -> GitCommit {
10833 let query = self.selection.select("targetCommit");
10834 GitCommit {
10835 proc: self.proc.clone(),
10836 selection: query,
10837 graphql_client: self.graphql_client.clone(),
10838 }
10839 }
10840 pub async fn commit_sha(&self) -> Result<String, DaggerError> {
10842 let query = self.selection.select("commitSHA");
10843 query.execute(self.graphql_client.clone()).await
10844 }
10845 pub fn tree(&self) -> Directory {
10851 let query = self.selection.select("tree");
10852 Directory {
10853 proc: self.proc.clone(),
10854 selection: query,
10855 graphql_client: self.graphql_client.clone(),
10856 }
10857 }
10858 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10864 let mut query = self.selection.select("tree");
10865 if let Some(discard_git_dir) = opts.discard_git_dir {
10866 query = query.arg("discardGitDir", discard_git_dir);
10867 }
10868 if let Some(depth) = opts.depth {
10869 query = query.arg("depth", depth);
10870 }
10871 if let Some(include_tags) = opts.include_tags {
10872 query = query.arg("includeTags", include_tags);
10873 }
10874 Directory {
10875 proc: self.proc.clone(),
10876 selection: query,
10877 graphql_client: self.graphql_client.clone(),
10878 }
10879 }
10880 pub async fn commit(&self) -> Result<String, DaggerError> {
10882 let query = self.selection.select("commit");
10883 query.execute(self.graphql_client.clone()).await
10884 }
10885 pub async fn name(&self) -> Result<String, DaggerError> {
10887 let query = self.selection.select("name");
10888 query.execute(self.graphql_client.clone()).await
10889 }
10890 pub async fn r#ref(&self) -> Result<String, DaggerError> {
10892 let query = self.selection.select("ref");
10893 query.execute(self.graphql_client.clone()).await
10894 }
10895 pub async fn contains(&self, other: impl IntoID<Id>) -> Result<bool, DaggerError> {
10902 let mut query = self.selection.select("contains");
10903 query = query.arg_lazy(
10904 "other",
10905 Box::new(move || {
10906 let other = other.clone();
10907 Box::pin(async move { other.into_id().await.unwrap().quote() })
10908 }),
10909 );
10910 query.execute(self.graphql_client.clone()).await
10911 }
10912 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10918 let mut query = self.selection.select("commonAncestor");
10919 query = query.arg_lazy(
10920 "other",
10921 Box::new(move || {
10922 let other = other.clone();
10923 Box::pin(async move { other.into_id().await.unwrap().quote() })
10924 }),
10925 );
10926 GitRef {
10927 proc: self.proc.clone(),
10928 selection: query,
10929 graphql_client: self.graphql_client.clone(),
10930 }
10931 }
10932 pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
10938 let query = self.selection.select("log");
10939 let query = query.select("id");
10940 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10941 Ok(ids
10942 .into_iter()
10943 .map(|id| GitCommit {
10944 proc: self.proc.clone(),
10945 selection: crate::querybuilder::query()
10946 .select("node")
10947 .arg("id", &id.0)
10948 .inline_fragment("GitCommit"),
10949 graphql_client: self.graphql_client.clone(),
10950 })
10951 .collect())
10952 }
10953 pub async fn log_opts<'a>(
10959 &self,
10960 opts: GitRefLogOpts<'a>,
10961 ) -> Result<Vec<GitCommit>, DaggerError> {
10962 let mut query = self.selection.select("log");
10963 if let Some(limit) = opts.limit {
10964 query = query.arg("limit", limit);
10965 }
10966 if let Some(paths) = opts.paths {
10967 query = query.arg("paths", paths);
10968 }
10969 if let Some(base) = opts.base {
10970 query = query.arg("base", base);
10971 }
10972 let query = query.select("id");
10973 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10974 Ok(ids
10975 .into_iter()
10976 .map(|id| GitCommit {
10977 proc: self.proc.clone(),
10978 selection: crate::querybuilder::query()
10979 .select("node")
10980 .arg("id", &id.0)
10981 .inline_fragment("GitCommit"),
10982 graphql_client: self.graphql_client.clone(),
10983 })
10984 .collect())
10985 }
10986 pub fn with_commit(
10999 &self,
11000 changes: impl IntoID<Id>,
11001 message: impl Into<String>,
11002 date: impl Into<String>,
11003 author_name: impl Into<String>,
11004 author_email: impl Into<String>,
11005 ) -> GitRef {
11006 let mut query = self.selection.select("withCommit");
11007 query = query.arg_lazy(
11008 "changes",
11009 Box::new(move || {
11010 let changes = changes.clone();
11011 Box::pin(async move { changes.into_id().await.unwrap().quote() })
11012 }),
11013 );
11014 query = query.arg("message", message.into());
11015 query = query.arg("date", date.into());
11016 query = query.arg("authorName", author_name.into());
11017 query = query.arg("authorEmail", author_email.into());
11018 GitRef {
11019 proc: self.proc.clone(),
11020 selection: query,
11021 graphql_client: self.graphql_client.clone(),
11022 }
11023 }
11024 pub fn with_commit_opts<'a>(
11037 &self,
11038 changes: impl IntoID<Id>,
11039 message: impl Into<String>,
11040 date: impl Into<String>,
11041 author_name: impl Into<String>,
11042 author_email: impl Into<String>,
11043 opts: GitRefWithCommitOpts<'a>,
11044 ) -> GitRef {
11045 let mut query = self.selection.select("withCommit");
11046 query = query.arg_lazy(
11047 "changes",
11048 Box::new(move || {
11049 let changes = changes.clone();
11050 Box::pin(async move { changes.into_id().await.unwrap().quote() })
11051 }),
11052 );
11053 query = query.arg("message", message.into());
11054 query = query.arg("date", date.into());
11055 query = query.arg("authorName", author_name.into());
11056 query = query.arg("authorEmail", author_email.into());
11057 if let Some(committer_name) = opts.committer_name {
11058 query = query.arg("committerName", committer_name);
11059 }
11060 if let Some(committer_email) = opts.committer_email {
11061 query = query.arg("committerEmail", committer_email);
11062 }
11063 if let Some(committer_date) = opts.committer_date {
11064 query = query.arg("committerDate", committer_date);
11065 }
11066 if let Some(allow_empty) = opts.allow_empty {
11067 query = query.arg("allowEmpty", allow_empty);
11068 }
11069 if let Some(signoff) = opts.signoff {
11070 query = query.arg("signoff", signoff);
11071 }
11072 GitRef {
11073 proc: self.proc.clone(),
11074 selection: query,
11075 graphql_client: self.graphql_client.clone(),
11076 }
11077 }
11078 pub fn as_repository(&self) -> GitRepository {
11081 let query = self.selection.select("asRepository");
11082 GitRepository {
11083 proc: self.proc.clone(),
11084 selection: query,
11085 graphql_client: self.graphql_client.clone(),
11086 }
11087 }
11088 pub fn as_workspace(&self) -> Workspace {
11094 let query = self.selection.select("asWorkspace");
11095 Workspace {
11096 proc: self.proc.clone(),
11097 selection: query,
11098 graphql_client: self.graphql_client.clone(),
11099 }
11100 }
11101 pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
11107 let mut query = self.selection.select("asWorkspace");
11108 if let Some(cwd) = opts.cwd {
11109 query = query.arg("cwd", cwd);
11110 }
11111 Workspace {
11112 proc: self.proc.clone(),
11113 selection: query,
11114 graphql_client: self.graphql_client.clone(),
11115 }
11116 }
11117}
11118impl Node for GitRef {
11119 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11120 let query = self.selection.select("id");
11121 let graphql_client = self.graphql_client.clone();
11122 async move { query.execute(graphql_client).await }
11123 }
11124}
11125#[derive(Clone)]
11126pub struct GitRemote {
11127 pub proc: Option<Arc<DaggerSessionProc>>,
11128 pub selection: Selection,
11129 pub graphql_client: DynGraphQLClient,
11130}
11131impl IntoID<Id> for GitRemote {
11132 fn into_id(
11133 self,
11134 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11135 Box::pin(async move { self.id().await })
11136 }
11137}
11138impl Loadable for GitRemote {
11139 fn graphql_type() -> &'static str {
11140 "GitRemote"
11141 }
11142 fn from_query(
11143 proc: Option<Arc<DaggerSessionProc>>,
11144 selection: Selection,
11145 graphql_client: DynGraphQLClient,
11146 ) -> Self {
11147 Self {
11148 proc,
11149 selection,
11150 graphql_client,
11151 }
11152 }
11153}
11154impl GitRemote {
11155 pub async fn id(&self) -> Result<Id, DaggerError> {
11157 let query = self.selection.select("id");
11158 query.execute(self.graphql_client.clone()).await
11159 }
11160 pub fn repository(&self) -> GitRepository {
11163 let query = self.selection.select("repository");
11164 GitRepository {
11165 proc: self.proc.clone(),
11166 selection: query,
11167 graphql_client: self.graphql_client.clone(),
11168 }
11169 }
11170 pub async fn name(&self) -> Result<String, DaggerError> {
11172 let query = self.selection.select("name");
11173 query.execute(self.graphql_client.clone()).await
11174 }
11175}
11176impl Node for GitRemote {
11177 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11178 let query = self.selection.select("id");
11179 let graphql_client = self.graphql_client.clone();
11180 async move { query.execute(graphql_client).await }
11181 }
11182}
11183#[derive(Clone)]
11184pub struct GitRepository {
11185 pub proc: Option<Arc<DaggerSessionProc>>,
11186 pub selection: Selection,
11187 pub graphql_client: DynGraphQLClient,
11188}
11189#[derive(Builder, Debug, PartialEq)]
11190pub struct GitRepositoryHeadOpts {
11191 #[builder(setter(into, strip_option), default)]
11193 pub no_lock: Option<bool>,
11194}
11195#[derive(Builder, Debug, PartialEq)]
11196pub struct GitRepositoryRefOpts {
11197 #[builder(setter(into, strip_option), default)]
11199 pub no_lock: Option<bool>,
11200}
11201#[derive(Builder, Debug, PartialEq)]
11202pub struct GitRepositoryBranchOpts {
11203 #[builder(setter(into, strip_option), default)]
11205 pub no_lock: Option<bool>,
11206}
11207#[derive(Builder, Debug, PartialEq)]
11208pub struct GitRepositoryTagOpts {
11209 #[builder(setter(into, strip_option), default)]
11211 pub no_lock: Option<bool>,
11212}
11213#[derive(Builder, Debug, PartialEq)]
11214pub struct GitRepositoryLatestOpts<'a> {
11215 #[builder(setter(into, strip_option), default)]
11217 pub no_lock: Option<bool>,
11218 #[builder(setter(into, strip_option), default)]
11220 pub version: Option<&'a str>,
11221}
11222#[derive(Builder, Debug, PartialEq)]
11223pub struct GitRepositoryTagsOpts<'a> {
11224 #[builder(setter(into, strip_option), default)]
11226 pub patterns: Option<Vec<&'a str>>,
11227}
11228#[derive(Builder, Debug, PartialEq)]
11229pub struct GitRepositoryBranchesOpts<'a> {
11230 #[builder(setter(into, strip_option), default)]
11232 pub patterns: Option<Vec<&'a str>>,
11233}
11234#[derive(Builder, Debug, PartialEq)]
11235pub struct GitRepositoryBundleOpts {
11236 #[builder(setter(into, strip_option), default)]
11238 pub base: Option<Id>,
11239}
11240#[derive(Builder, Debug, PartialEq)]
11241pub struct GitRepositoryWithBundleOpts<'a> {
11242 #[builder(setter(into, strip_option), default)]
11244 pub prerequisite_ref: Option<&'a str>,
11245}
11246#[derive(Builder, Debug, PartialEq)]
11247pub struct GitRepositoryWithRemoteOpts<'a> {
11248 #[builder(setter(into, strip_option), default)]
11250 pub push_url: Option<&'a str>,
11251}
11252#[derive(Builder, Debug, PartialEq)]
11253pub struct GitRepositoryAsWorkspaceOpts<'a> {
11254 #[builder(setter(into, strip_option), default)]
11256 pub cwd: Option<&'a str>,
11257}
11258impl IntoID<Id> for GitRepository {
11259 fn into_id(
11260 self,
11261 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11262 Box::pin(async move { self.id().await })
11263 }
11264}
11265impl Loadable for GitRepository {
11266 fn graphql_type() -> &'static str {
11267 "GitRepository"
11268 }
11269 fn from_query(
11270 proc: Option<Arc<DaggerSessionProc>>,
11271 selection: Selection,
11272 graphql_client: DynGraphQLClient,
11273 ) -> Self {
11274 Self {
11275 proc,
11276 selection,
11277 graphql_client,
11278 }
11279 }
11280}
11281impl GitRepository {
11282 pub async fn id(&self) -> Result<Id, DaggerError> {
11284 let query = self.selection.select("id");
11285 query.execute(self.graphql_client.clone()).await
11286 }
11287 pub fn head(&self) -> GitRef {
11293 let query = self.selection.select("head");
11294 GitRef {
11295 proc: self.proc.clone(),
11296 selection: query,
11297 graphql_client: self.graphql_client.clone(),
11298 }
11299 }
11300 pub fn head_opts(&self, opts: GitRepositoryHeadOpts) -> GitRef {
11306 let mut query = self.selection.select("head");
11307 if let Some(no_lock) = opts.no_lock {
11308 query = query.arg("noLock", no_lock);
11309 }
11310 GitRef {
11311 proc: self.proc.clone(),
11312 selection: query,
11313 graphql_client: self.graphql_client.clone(),
11314 }
11315 }
11316 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
11329 let mut query = self.selection.select("ref");
11330 query = query.arg("name", name.into());
11331 GitRef {
11332 proc: self.proc.clone(),
11333 selection: query,
11334 graphql_client: self.graphql_client.clone(),
11335 }
11336 }
11337 pub fn r#ref_opts(&self, name: impl Into<String>, opts: GitRepositoryRefOpts) -> GitRef {
11350 let mut query = self.selection.select("ref");
11351 query = query.arg("name", name.into());
11352 if let Some(no_lock) = opts.no_lock {
11353 query = query.arg("noLock", no_lock);
11354 }
11355 GitRef {
11356 proc: self.proc.clone(),
11357 selection: query,
11358 graphql_client: self.graphql_client.clone(),
11359 }
11360 }
11361 pub fn branch(&self, name: impl Into<String>) -> GitRef {
11368 let mut query = self.selection.select("branch");
11369 query = query.arg("name", name.into());
11370 GitRef {
11371 proc: self.proc.clone(),
11372 selection: query,
11373 graphql_client: self.graphql_client.clone(),
11374 }
11375 }
11376 pub fn branch_opts(&self, name: impl Into<String>, opts: GitRepositoryBranchOpts) -> GitRef {
11383 let mut query = self.selection.select("branch");
11384 query = query.arg("name", name.into());
11385 if let Some(no_lock) = opts.no_lock {
11386 query = query.arg("noLock", no_lock);
11387 }
11388 GitRef {
11389 proc: self.proc.clone(),
11390 selection: query,
11391 graphql_client: self.graphql_client.clone(),
11392 }
11393 }
11394 pub fn tag(&self, name: impl Into<String>) -> GitRef {
11401 let mut query = self.selection.select("tag");
11402 query = query.arg("name", name.into());
11403 GitRef {
11404 proc: self.proc.clone(),
11405 selection: query,
11406 graphql_client: self.graphql_client.clone(),
11407 }
11408 }
11409 pub fn tag_opts(&self, name: impl Into<String>, opts: GitRepositoryTagOpts) -> GitRef {
11416 let mut query = self.selection.select("tag");
11417 query = query.arg("name", name.into());
11418 if let Some(no_lock) = opts.no_lock {
11419 query = query.arg("noLock", no_lock);
11420 }
11421 GitRef {
11422 proc: self.proc.clone(),
11423 selection: query,
11424 graphql_client: self.graphql_client.clone(),
11425 }
11426 }
11427 pub fn commit(&self, id: impl Into<String>) -> GitCommit {
11435 let mut query = self.selection.select("commit");
11436 query = query.arg("id", id.into());
11437 GitCommit {
11438 proc: self.proc.clone(),
11439 selection: query,
11440 graphql_client: self.graphql_client.clone(),
11441 }
11442 }
11443 pub fn latest(&self) -> GitRef {
11450 let query = self.selection.select("latest");
11451 GitRef {
11452 proc: self.proc.clone(),
11453 selection: query,
11454 graphql_client: self.graphql_client.clone(),
11455 }
11456 }
11457 pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
11464 let mut query = self.selection.select("latest");
11465 if let Some(version) = opts.version {
11466 query = query.arg("version", version);
11467 }
11468 if let Some(no_lock) = opts.no_lock {
11469 query = query.arg("noLock", no_lock);
11470 }
11471 GitRef {
11472 proc: self.proc.clone(),
11473 selection: query,
11474 graphql_client: self.graphql_client.clone(),
11475 }
11476 }
11477 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
11483 let query = self.selection.select("tags");
11484 query.execute(self.graphql_client.clone()).await
11485 }
11486 pub async fn tags_opts<'a>(
11492 &self,
11493 opts: GitRepositoryTagsOpts<'a>,
11494 ) -> Result<Vec<String>, DaggerError> {
11495 let mut query = self.selection.select("tags");
11496 if let Some(patterns) = opts.patterns {
11497 query = query.arg("patterns", patterns);
11498 }
11499 query.execute(self.graphql_client.clone()).await
11500 }
11501 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
11507 let query = self.selection.select("branches");
11508 query.execute(self.graphql_client.clone()).await
11509 }
11510 pub async fn branches_opts<'a>(
11516 &self,
11517 opts: GitRepositoryBranchesOpts<'a>,
11518 ) -> Result<Vec<String>, DaggerError> {
11519 let mut query = self.selection.select("branches");
11520 if let Some(patterns) = opts.patterns {
11521 query = query.arg("patterns", patterns);
11522 }
11523 query.execute(self.graphql_client.clone()).await
11524 }
11525 pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
11532 let mut query = self.selection.select("bundle");
11533 query = query.arg(
11534 "refs",
11535 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11536 );
11537 GitBundle {
11538 proc: self.proc.clone(),
11539 selection: query,
11540 graphql_client: self.graphql_client.clone(),
11541 }
11542 }
11543 pub fn bundle_opts(
11550 &self,
11551 refs: Vec<impl Into<String>>,
11552 opts: GitRepositoryBundleOpts,
11553 ) -> GitBundle {
11554 let mut query = self.selection.select("bundle");
11555 query = query.arg(
11556 "refs",
11557 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11558 );
11559 if let Some(base) = opts.base {
11560 query = query.arg("base", base);
11561 }
11562 GitBundle {
11563 proc: self.proc.clone(),
11564 selection: query,
11565 graphql_client: self.graphql_client.clone(),
11566 }
11567 }
11568 pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
11575 let mut query = self.selection.select("withBundle");
11576 query = query.arg_lazy(
11577 "bundle",
11578 Box::new(move || {
11579 let bundle = bundle.clone();
11580 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11581 }),
11582 );
11583 GitRepository {
11584 proc: self.proc.clone(),
11585 selection: query,
11586 graphql_client: self.graphql_client.clone(),
11587 }
11588 }
11589 pub fn with_bundle_opts<'a>(
11596 &self,
11597 bundle: impl IntoID<Id>,
11598 opts: GitRepositoryWithBundleOpts<'a>,
11599 ) -> GitRepository {
11600 let mut query = self.selection.select("withBundle");
11601 query = query.arg_lazy(
11602 "bundle",
11603 Box::new(move || {
11604 let bundle = bundle.clone();
11605 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11606 }),
11607 );
11608 if let Some(prerequisite_ref) = opts.prerequisite_ref {
11609 query = query.arg("prerequisiteRef", prerequisite_ref);
11610 }
11611 GitRepository {
11612 proc: self.proc.clone(),
11613 selection: query,
11614 graphql_client: self.graphql_client.clone(),
11615 }
11616 }
11617 pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
11627 let mut query = self.selection.select("withRemote");
11628 query = query.arg("name", name.into());
11629 query = query.arg("url", url.into());
11630 GitRepository {
11631 proc: self.proc.clone(),
11632 selection: query,
11633 graphql_client: self.graphql_client.clone(),
11634 }
11635 }
11636 pub fn with_remote_opts<'a>(
11646 &self,
11647 name: impl Into<String>,
11648 url: impl Into<String>,
11649 opts: GitRepositoryWithRemoteOpts<'a>,
11650 ) -> GitRepository {
11651 let mut query = self.selection.select("withRemote");
11652 query = query.arg("name", name.into());
11653 query = query.arg("url", url.into());
11654 if let Some(push_url) = opts.push_url {
11655 query = query.arg("pushUrl", push_url);
11656 }
11657 GitRepository {
11658 proc: self.proc.clone(),
11659 selection: query,
11660 graphql_client: self.graphql_client.clone(),
11661 }
11662 }
11663 pub async fn remotes(&self) -> Result<Vec<GitRemote>, DaggerError> {
11665 let query = self.selection.select("remotes");
11666 let query = query.select("id");
11667 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11668 Ok(ids
11669 .into_iter()
11670 .map(|id| GitRemote {
11671 proc: self.proc.clone(),
11672 selection: crate::querybuilder::query()
11673 .select("node")
11674 .arg("id", &id.0)
11675 .inline_fragment("GitRemote"),
11676 graphql_client: self.graphql_client.clone(),
11677 })
11678 .collect())
11679 }
11680 pub fn remote(&self, name: impl Into<String>) -> GitRemote {
11686 let mut query = self.selection.select("remote");
11687 query = query.arg("name", name.into());
11688 GitRemote {
11689 proc: self.proc.clone(),
11690 selection: query,
11691 graphql_client: self.graphql_client.clone(),
11692 }
11693 }
11694 pub async fn default_remote(&self) -> Result<Option<GitRemote>, DaggerError> {
11697 let query = self.selection.select("defaultRemote");
11698 let query = query.select("id");
11699 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11700 Ok(id.map(|id| GitRemote {
11701 proc: self.proc.clone(),
11702 selection: query
11703 .root()
11704 .select("node")
11705 .arg("id", &id.0)
11706 .inline_fragment("GitRemote"),
11707 graphql_client: self.graphql_client.clone(),
11708 }))
11709 }
11710 pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
11719 let mut query = self.selection.select("withContents");
11720 query = query.arg_lazy(
11721 "directory",
11722 Box::new(move || {
11723 let directory = directory.clone();
11724 Box::pin(async move { directory.into_id().await.unwrap().quote() })
11725 }),
11726 );
11727 GitRepository {
11728 proc: self.proc.clone(),
11729 selection: query,
11730 graphql_client: self.graphql_client.clone(),
11731 }
11732 }
11733 pub fn uncommitted(&self) -> Changeset {
11735 let query = self.selection.select("uncommitted");
11736 Changeset {
11737 proc: self.proc.clone(),
11738 selection: query,
11739 graphql_client: self.graphql_client.clone(),
11740 }
11741 }
11742 pub fn as_workspace(&self) -> Workspace {
11749 let query = self.selection.select("asWorkspace");
11750 Workspace {
11751 proc: self.proc.clone(),
11752 selection: query,
11753 graphql_client: self.graphql_client.clone(),
11754 }
11755 }
11756 pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
11763 let mut query = self.selection.select("asWorkspace");
11764 if let Some(cwd) = opts.cwd {
11765 query = query.arg("cwd", cwd);
11766 }
11767 Workspace {
11768 proc: self.proc.clone(),
11769 selection: query,
11770 graphql_client: self.graphql_client.clone(),
11771 }
11772 }
11773 pub async fn url(&self) -> Result<String, DaggerError> {
11775 let query = self.selection.select("url");
11776 query.execute(self.graphql_client.clone()).await
11777 }
11778}
11779impl Node for GitRepository {
11780 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11781 let query = self.selection.select("id");
11782 let graphql_client = self.graphql_client.clone();
11783 async move { query.execute(graphql_client).await }
11784 }
11785}
11786#[derive(Clone)]
11787pub struct HttpState {
11788 pub proc: Option<Arc<DaggerSessionProc>>,
11789 pub selection: Selection,
11790 pub graphql_client: DynGraphQLClient,
11791}
11792impl IntoID<Id> for HttpState {
11793 fn into_id(
11794 self,
11795 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11796 Box::pin(async move { self.id().await })
11797 }
11798}
11799impl Loadable for HttpState {
11800 fn graphql_type() -> &'static str {
11801 "HTTPState"
11802 }
11803 fn from_query(
11804 proc: Option<Arc<DaggerSessionProc>>,
11805 selection: Selection,
11806 graphql_client: DynGraphQLClient,
11807 ) -> Self {
11808 Self {
11809 proc,
11810 selection,
11811 graphql_client,
11812 }
11813 }
11814}
11815impl HttpState {
11816 pub async fn id(&self) -> Result<Id, DaggerError> {
11818 let query = self.selection.select("id");
11819 query.execute(self.graphql_client.clone()).await
11820 }
11821}
11822impl Node for HttpState {
11823 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11824 let query = self.selection.select("id");
11825 let graphql_client = self.graphql_client.clone();
11826 async move { query.execute(graphql_client).await }
11827 }
11828}
11829#[derive(Clone)]
11830pub struct HealthcheckConfig {
11831 pub proc: Option<Arc<DaggerSessionProc>>,
11832 pub selection: Selection,
11833 pub graphql_client: DynGraphQLClient,
11834}
11835impl IntoID<Id> for HealthcheckConfig {
11836 fn into_id(
11837 self,
11838 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11839 Box::pin(async move { self.id().await })
11840 }
11841}
11842impl Loadable for HealthcheckConfig {
11843 fn graphql_type() -> &'static str {
11844 "HealthcheckConfig"
11845 }
11846 fn from_query(
11847 proc: Option<Arc<DaggerSessionProc>>,
11848 selection: Selection,
11849 graphql_client: DynGraphQLClient,
11850 ) -> Self {
11851 Self {
11852 proc,
11853 selection,
11854 graphql_client,
11855 }
11856 }
11857}
11858impl HealthcheckConfig {
11859 pub async fn id(&self) -> Result<Id, DaggerError> {
11861 let query = self.selection.select("id");
11862 query.execute(self.graphql_client.clone()).await
11863 }
11864 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
11866 let query = self.selection.select("args");
11867 query.execute(self.graphql_client.clone()).await
11868 }
11869 pub async fn shell(&self) -> Result<bool, DaggerError> {
11871 let query = self.selection.select("shell");
11872 query.execute(self.graphql_client.clone()).await
11873 }
11874 pub async fn timeout(&self) -> Result<String, DaggerError> {
11876 let query = self.selection.select("timeout");
11877 query.execute(self.graphql_client.clone()).await
11878 }
11879 pub async fn interval(&self) -> Result<String, DaggerError> {
11881 let query = self.selection.select("interval");
11882 query.execute(self.graphql_client.clone()).await
11883 }
11884 pub async fn start_period(&self) -> Result<String, DaggerError> {
11886 let query = self.selection.select("startPeriod");
11887 query.execute(self.graphql_client.clone()).await
11888 }
11889 pub async fn start_interval(&self) -> Result<String, DaggerError> {
11891 let query = self.selection.select("startInterval");
11892 query.execute(self.graphql_client.clone()).await
11893 }
11894 pub async fn retries(&self) -> Result<isize, DaggerError> {
11896 let query = self.selection.select("retries");
11897 query.execute(self.graphql_client.clone()).await
11898 }
11899}
11900impl Node for HealthcheckConfig {
11901 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11902 let query = self.selection.select("id");
11903 let graphql_client = self.graphql_client.clone();
11904 async move { query.execute(graphql_client).await }
11905 }
11906}
11907#[derive(Clone)]
11908pub struct Host {
11909 pub proc: Option<Arc<DaggerSessionProc>>,
11910 pub selection: Selection,
11911 pub graphql_client: DynGraphQLClient,
11912}
11913#[derive(Builder, Debug, PartialEq)]
11914pub struct HostDirectoryOpts<'a> {
11915 #[builder(setter(into, strip_option), default)]
11917 pub exclude: Option<Vec<&'a str>>,
11918 #[builder(setter(into, strip_option), default)]
11920 pub gitignore: Option<bool>,
11921 #[builder(setter(into, strip_option), default)]
11923 pub include: Option<Vec<&'a str>>,
11924 #[builder(setter(into, strip_option), default)]
11926 pub no_cache: Option<bool>,
11927}
11928#[derive(Builder, Debug, PartialEq)]
11929pub struct HostFileOpts {
11930 #[builder(setter(into, strip_option), default)]
11932 pub no_cache: Option<bool>,
11933}
11934#[derive(Builder, Debug, PartialEq)]
11935pub struct HostFindUpOpts {
11936 #[builder(setter(into, strip_option), default)]
11937 pub no_cache: Option<bool>,
11938}
11939#[derive(Builder, Debug, PartialEq)]
11940pub struct HostTunnelOpts {
11941 #[builder(setter(into, strip_option), default)]
11944 pub native: Option<bool>,
11945 #[builder(setter(into, strip_option), default)]
11950 pub ports: Option<Vec<PortForward>>,
11951}
11952#[derive(Builder, Debug, PartialEq)]
11953pub struct HostServiceOpts<'a> {
11954 #[builder(setter(into, strip_option), default)]
11956 pub host: Option<&'a str>,
11957}
11958impl IntoID<Id> for Host {
11959 fn into_id(
11960 self,
11961 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11962 Box::pin(async move { self.id().await })
11963 }
11964}
11965impl Loadable for Host {
11966 fn graphql_type() -> &'static str {
11967 "Host"
11968 }
11969 fn from_query(
11970 proc: Option<Arc<DaggerSessionProc>>,
11971 selection: Selection,
11972 graphql_client: DynGraphQLClient,
11973 ) -> Self {
11974 Self {
11975 proc,
11976 selection,
11977 graphql_client,
11978 }
11979 }
11980}
11981impl Host {
11982 pub async fn id(&self) -> Result<Id, DaggerError> {
11984 let query = self.selection.select("id");
11985 query.execute(self.graphql_client.clone()).await
11986 }
11987 pub fn directory(&self, path: impl Into<String>) -> Directory {
11994 let mut query = self.selection.select("directory");
11995 query = query.arg("path", path.into());
11996 Directory {
11997 proc: self.proc.clone(),
11998 selection: query,
11999 graphql_client: self.graphql_client.clone(),
12000 }
12001 }
12002 pub fn directory_opts<'a>(
12009 &self,
12010 path: impl Into<String>,
12011 opts: HostDirectoryOpts<'a>,
12012 ) -> Directory {
12013 let mut query = self.selection.select("directory");
12014 query = query.arg("path", path.into());
12015 if let Some(exclude) = opts.exclude {
12016 query = query.arg("exclude", exclude);
12017 }
12018 if let Some(include) = opts.include {
12019 query = query.arg("include", include);
12020 }
12021 if let Some(no_cache) = opts.no_cache {
12022 query = query.arg("noCache", no_cache);
12023 }
12024 if let Some(gitignore) = opts.gitignore {
12025 query = query.arg("gitignore", gitignore);
12026 }
12027 Directory {
12028 proc: self.proc.clone(),
12029 selection: query,
12030 graphql_client: self.graphql_client.clone(),
12031 }
12032 }
12033 pub fn file(&self, path: impl Into<String>) -> File {
12040 let mut query = self.selection.select("file");
12041 query = query.arg("path", path.into());
12042 File {
12043 proc: self.proc.clone(),
12044 selection: query,
12045 graphql_client: self.graphql_client.clone(),
12046 }
12047 }
12048 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
12055 let mut query = self.selection.select("file");
12056 query = query.arg("path", path.into());
12057 if let Some(no_cache) = opts.no_cache {
12058 query = query.arg("noCache", no_cache);
12059 }
12060 File {
12061 proc: self.proc.clone(),
12062 selection: query,
12063 graphql_client: self.graphql_client.clone(),
12064 }
12065 }
12066 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
12073 let mut query = self.selection.select("findUp");
12074 query = query.arg("name", name.into());
12075 query.execute(self.graphql_client.clone()).await
12076 }
12077 pub async fn find_up_opts(
12084 &self,
12085 name: impl Into<String>,
12086 opts: HostFindUpOpts,
12087 ) -> Result<String, DaggerError> {
12088 let mut query = self.selection.select("findUp");
12089 query = query.arg("name", name.into());
12090 if let Some(no_cache) = opts.no_cache {
12091 query = query.arg("noCache", no_cache);
12092 }
12093 query.execute(self.graphql_client.clone()).await
12094 }
12095 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
12101 let mut query = self.selection.select("unixSocket");
12102 query = query.arg("path", path.into());
12103 Socket {
12104 proc: self.proc.clone(),
12105 selection: query,
12106 graphql_client: self.graphql_client.clone(),
12107 }
12108 }
12109 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
12116 let mut query = self.selection.select("tunnel");
12117 query = query.arg_lazy(
12118 "service",
12119 Box::new(move || {
12120 let service = service.clone();
12121 Box::pin(async move { service.into_id().await.unwrap().quote() })
12122 }),
12123 );
12124 Service {
12125 proc: self.proc.clone(),
12126 selection: query,
12127 graphql_client: self.graphql_client.clone(),
12128 }
12129 }
12130 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
12137 let mut query = self.selection.select("tunnel");
12138 query = query.arg_lazy(
12139 "service",
12140 Box::new(move || {
12141 let service = service.clone();
12142 Box::pin(async move { service.into_id().await.unwrap().quote() })
12143 }),
12144 );
12145 if let Some(native) = opts.native {
12146 query = query.arg("native", native);
12147 }
12148 if let Some(ports) = opts.ports {
12149 query = query.arg("ports", ports);
12150 }
12151 Service {
12152 proc: self.proc.clone(),
12153 selection: query,
12154 graphql_client: self.graphql_client.clone(),
12155 }
12156 }
12157 pub fn service(&self, ports: Vec<PortForward>) -> Service {
12168 let mut query = self.selection.select("service");
12169 query = query.arg("ports", ports);
12170 Service {
12171 proc: self.proc.clone(),
12172 selection: query,
12173 graphql_client: self.graphql_client.clone(),
12174 }
12175 }
12176 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
12187 let mut query = self.selection.select("service");
12188 query = query.arg("ports", ports);
12189 if let Some(host) = opts.host {
12190 query = query.arg("host", host);
12191 }
12192 Service {
12193 proc: self.proc.clone(),
12194 selection: query,
12195 graphql_client: self.graphql_client.clone(),
12196 }
12197 }
12198 pub fn container_image(&self, name: impl Into<String>) -> Container {
12204 let mut query = self.selection.select("containerImage");
12205 query = query.arg("name", name.into());
12206 Container {
12207 proc: self.proc.clone(),
12208 selection: query,
12209 graphql_client: self.graphql_client.clone(),
12210 }
12211 }
12212}
12213impl Node for Host {
12214 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12215 let query = self.selection.select("id");
12216 let graphql_client = self.graphql_client.clone();
12217 async move { query.execute(graphql_client).await }
12218 }
12219}
12220#[derive(Clone)]
12221pub struct InputTypeDef {
12222 pub proc: Option<Arc<DaggerSessionProc>>,
12223 pub selection: Selection,
12224 pub graphql_client: DynGraphQLClient,
12225}
12226impl IntoID<Id> for InputTypeDef {
12227 fn into_id(
12228 self,
12229 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12230 Box::pin(async move { self.id().await })
12231 }
12232}
12233impl Loadable for InputTypeDef {
12234 fn graphql_type() -> &'static str {
12235 "InputTypeDef"
12236 }
12237 fn from_query(
12238 proc: Option<Arc<DaggerSessionProc>>,
12239 selection: Selection,
12240 graphql_client: DynGraphQLClient,
12241 ) -> Self {
12242 Self {
12243 proc,
12244 selection,
12245 graphql_client,
12246 }
12247 }
12248}
12249impl InputTypeDef {
12250 pub async fn id(&self) -> Result<Id, DaggerError> {
12252 let query = self.selection.select("id");
12253 query.execute(self.graphql_client.clone()).await
12254 }
12255 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12257 let query = self.selection.select("fields");
12258 let query = query.select("id");
12259 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12260 Ok(ids
12261 .into_iter()
12262 .map(|id| FieldTypeDef {
12263 proc: self.proc.clone(),
12264 selection: crate::querybuilder::query()
12265 .select("node")
12266 .arg("id", &id.0)
12267 .inline_fragment("FieldTypeDef"),
12268 graphql_client: self.graphql_client.clone(),
12269 })
12270 .collect())
12271 }
12272 pub async fn name(&self) -> Result<String, DaggerError> {
12274 let query = self.selection.select("name");
12275 query.execute(self.graphql_client.clone()).await
12276 }
12277}
12278impl Node for InputTypeDef {
12279 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12280 let query = self.selection.select("id");
12281 let graphql_client = self.graphql_client.clone();
12282 async move { query.execute(graphql_client).await }
12283 }
12284}
12285#[derive(Clone)]
12286pub struct InterfaceTypeDef {
12287 pub proc: Option<Arc<DaggerSessionProc>>,
12288 pub selection: Selection,
12289 pub graphql_client: DynGraphQLClient,
12290}
12291impl IntoID<Id> for InterfaceTypeDef {
12292 fn into_id(
12293 self,
12294 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12295 Box::pin(async move { self.id().await })
12296 }
12297}
12298impl Loadable for InterfaceTypeDef {
12299 fn graphql_type() -> &'static str {
12300 "InterfaceTypeDef"
12301 }
12302 fn from_query(
12303 proc: Option<Arc<DaggerSessionProc>>,
12304 selection: Selection,
12305 graphql_client: DynGraphQLClient,
12306 ) -> Self {
12307 Self {
12308 proc,
12309 selection,
12310 graphql_client,
12311 }
12312 }
12313}
12314impl InterfaceTypeDef {
12315 pub async fn id(&self) -> Result<Id, DaggerError> {
12317 let query = self.selection.select("id");
12318 query.execute(self.graphql_client.clone()).await
12319 }
12320 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12322 let query = self.selection.select("functions");
12323 let query = query.select("id");
12324 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12325 Ok(ids
12326 .into_iter()
12327 .map(|id| Function {
12328 proc: self.proc.clone(),
12329 selection: crate::querybuilder::query()
12330 .select("node")
12331 .arg("id", &id.0)
12332 .inline_fragment("Function"),
12333 graphql_client: self.graphql_client.clone(),
12334 })
12335 .collect())
12336 }
12337 pub async fn name(&self) -> Result<String, DaggerError> {
12339 let query = self.selection.select("name");
12340 query.execute(self.graphql_client.clone()).await
12341 }
12342 pub async fn description(&self) -> Result<String, DaggerError> {
12344 let query = self.selection.select("description");
12345 query.execute(self.graphql_client.clone()).await
12346 }
12347 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12349 let query = self.selection.select("sourceMap");
12350 let query = query.select("id");
12351 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12352 Ok(id.map(|id| SourceMap {
12353 proc: self.proc.clone(),
12354 selection: query
12355 .root()
12356 .select("node")
12357 .arg("id", &id.0)
12358 .inline_fragment("SourceMap"),
12359 graphql_client: self.graphql_client.clone(),
12360 }))
12361 }
12362 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12364 let query = self.selection.select("sourceModuleName");
12365 query.execute(self.graphql_client.clone()).await
12366 }
12367}
12368impl Node for InterfaceTypeDef {
12369 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12370 let query = self.selection.select("id");
12371 let graphql_client = self.graphql_client.clone();
12372 async move { query.execute(graphql_client).await }
12373 }
12374}
12375#[derive(Clone)]
12376pub struct JsonValue {
12377 pub proc: Option<Arc<DaggerSessionProc>>,
12378 pub selection: Selection,
12379 pub graphql_client: DynGraphQLClient,
12380}
12381#[derive(Builder, Debug, PartialEq)]
12382pub struct JsonValueContentsOpts<'a> {
12383 #[builder(setter(into, strip_option), default)]
12385 pub indent: Option<&'a str>,
12386 #[builder(setter(into, strip_option), default)]
12388 pub pretty: Option<bool>,
12389}
12390impl IntoID<Id> for JsonValue {
12391 fn into_id(
12392 self,
12393 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12394 Box::pin(async move { self.id().await })
12395 }
12396}
12397impl Loadable for JsonValue {
12398 fn graphql_type() -> &'static str {
12399 "JSONValue"
12400 }
12401 fn from_query(
12402 proc: Option<Arc<DaggerSessionProc>>,
12403 selection: Selection,
12404 graphql_client: DynGraphQLClient,
12405 ) -> Self {
12406 Self {
12407 proc,
12408 selection,
12409 graphql_client,
12410 }
12411 }
12412}
12413impl JsonValue {
12414 pub async fn id(&self) -> Result<Id, DaggerError> {
12416 let query = self.selection.select("id");
12417 query.execute(self.graphql_client.clone()).await
12418 }
12419 pub async fn contents(&self) -> Result<Json, DaggerError> {
12425 let query = self.selection.select("contents");
12426 query.execute(self.graphql_client.clone()).await
12427 }
12428 pub async fn contents_opts<'a>(
12434 &self,
12435 opts: JsonValueContentsOpts<'a>,
12436 ) -> Result<Json, DaggerError> {
12437 let mut query = self.selection.select("contents");
12438 if let Some(pretty) = opts.pretty {
12439 query = query.arg("pretty", pretty);
12440 }
12441 if let Some(indent) = opts.indent {
12442 query = query.arg("indent", indent);
12443 }
12444 query.execute(self.graphql_client.clone()).await
12445 }
12446 pub fn with_contents(&self, contents: Json) -> JsonValue {
12452 let mut query = self.selection.select("withContents");
12453 query = query.arg("contents", contents);
12454 JsonValue {
12455 proc: self.proc.clone(),
12456 selection: query,
12457 graphql_client: self.graphql_client.clone(),
12458 }
12459 }
12460 pub fn new_integer(&self, value: isize) -> JsonValue {
12466 let mut query = self.selection.select("newInteger");
12467 query = query.arg("value", value);
12468 JsonValue {
12469 proc: self.proc.clone(),
12470 selection: query,
12471 graphql_client: self.graphql_client.clone(),
12472 }
12473 }
12474 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
12476 let query = self.selection.select("asInteger");
12477 query.execute(self.graphql_client.clone()).await
12478 }
12479 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
12485 let mut query = self.selection.select("newString");
12486 query = query.arg("value", value.into());
12487 JsonValue {
12488 proc: self.proc.clone(),
12489 selection: query,
12490 graphql_client: self.graphql_client.clone(),
12491 }
12492 }
12493 pub async fn as_string(&self) -> Result<String, DaggerError> {
12495 let query = self.selection.select("asString");
12496 query.execute(self.graphql_client.clone()).await
12497 }
12498 pub fn new_boolean(&self, value: bool) -> JsonValue {
12504 let mut query = self.selection.select("newBoolean");
12505 query = query.arg("value", value);
12506 JsonValue {
12507 proc: self.proc.clone(),
12508 selection: query,
12509 graphql_client: self.graphql_client.clone(),
12510 }
12511 }
12512 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
12514 let query = self.selection.select("asBoolean");
12515 query.execute(self.graphql_client.clone()).await
12516 }
12517 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
12519 let query = self.selection.select("asArray");
12520 let query = query.select("id");
12521 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12522 Ok(ids
12523 .into_iter()
12524 .map(|id| JsonValue {
12525 proc: self.proc.clone(),
12526 selection: crate::querybuilder::query()
12527 .select("node")
12528 .arg("id", &id.0)
12529 .inline_fragment("JSONValue"),
12530 graphql_client: self.graphql_client.clone(),
12531 })
12532 .collect())
12533 }
12534 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
12536 let query = self.selection.select("fields");
12537 query.execute(self.graphql_client.clone()).await
12538 }
12539 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
12545 let mut query = self.selection.select("field");
12546 query = query.arg(
12547 "path",
12548 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12549 );
12550 JsonValue {
12551 proc: self.proc.clone(),
12552 selection: query,
12553 graphql_client: self.graphql_client.clone(),
12554 }
12555 }
12556 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
12563 let mut query = self.selection.select("withField");
12564 query = query.arg(
12565 "path",
12566 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12567 );
12568 query = query.arg_lazy(
12569 "value",
12570 Box::new(move || {
12571 let value = value.clone();
12572 Box::pin(async move { value.into_id().await.unwrap().quote() })
12573 }),
12574 );
12575 JsonValue {
12576 proc: self.proc.clone(),
12577 selection: query,
12578 graphql_client: self.graphql_client.clone(),
12579 }
12580 }
12581}
12582impl Node for JsonValue {
12583 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12584 let query = self.selection.select("id");
12585 let graphql_client = self.graphql_client.clone();
12586 async move { query.execute(graphql_client).await }
12587 }
12588}
12589#[derive(Clone)]
12590pub struct Llm {
12591 pub proc: Option<Arc<DaggerSessionProc>>,
12592 pub selection: Selection,
12593 pub graphql_client: DynGraphQLClient,
12594}
12595#[derive(Builder, Debug, PartialEq)]
12596pub struct LlmArtifactsOpts<'a> {
12597 #[builder(setter(into, strip_option), default)]
12599 pub include: Option<Vec<&'a str>>,
12600}
12601#[derive(Builder, Debug, PartialEq)]
12602pub struct LlmWithModelOpts<'a> {
12603 #[builder(setter(into, strip_option), default)]
12605 pub provider: Option<&'a str>,
12606}
12607#[derive(Builder, Debug, PartialEq)]
12608pub struct LlmWithPromptOpts {
12609 #[builder(setter(into, strip_option), default)]
12611 pub origin: Option<LlmMessageOriginInput>,
12612}
12613#[derive(Builder, Debug, PartialEq)]
12614pub struct LlmWithContentOpts {
12615 #[builder(setter(into, strip_option), default)]
12617 pub origin: Option<LlmMessageOriginInput>,
12618}
12619#[derive(Builder, Debug, PartialEq)]
12620pub struct LlmWithContentFileOpts<'a> {
12621 #[builder(setter(into, strip_option), default)]
12623 pub mime_type: Option<&'a str>,
12624}
12625#[derive(Builder, Debug, PartialEq)]
12626pub struct LlmWithResponseOpts {
12627 #[builder(setter(into, strip_option), default)]
12629 pub cached_token_reads: Option<isize>,
12630 #[builder(setter(into, strip_option), default)]
12632 pub cached_token_writes: Option<isize>,
12633 #[builder(setter(into, strip_option), default)]
12635 pub input_tokens: Option<isize>,
12636 #[builder(setter(into, strip_option), default)]
12638 pub output_tokens: Option<isize>,
12639 #[builder(setter(into, strip_option), default)]
12641 pub total_tokens: Option<isize>,
12642}
12643#[derive(Builder, Debug, PartialEq)]
12644pub struct LlmWithToolResultOpts {
12645 #[builder(setter(into, strip_option), default)]
12647 pub blocks: Option<Vec<LlmContentBlockInput>>,
12648}
12649#[derive(Builder, Debug, PartialEq)]
12650pub struct LlmWithToolsOpts<'a> {
12651 #[builder(setter(into, strip_option), default)]
12653 pub except: Option<Vec<&'a str>>,
12654 #[builder(setter(into, strip_option), default)]
12656 pub version: Option<isize>,
12657}
12658#[derive(Builder, Debug, PartialEq)]
12659pub struct LlmLoopOpts {
12660 #[builder(setter(into, strip_option), default)]
12662 pub max_steps: Option<isize>,
12663 #[builder(setter(into, strip_option), default)]
12665 pub max_tokens: Option<isize>,
12666}
12667#[derive(Builder, Debug, PartialEq)]
12668pub struct LlmStepOpts {
12669 #[builder(setter(into, strip_option), default)]
12671 pub max_tokens: Option<isize>,
12672}
12673#[derive(Builder, Debug, PartialEq)]
12674pub struct LlmSpawnOpts<'a> {
12675 #[builder(setter(into, strip_option), default)]
12677 pub error: Option<&'a str>,
12678 #[builder(setter(into, strip_option), default)]
12680 pub handle: Option<&'a str>,
12681 #[builder(setter(into, strip_option), default)]
12683 pub name: Option<&'a str>,
12684 #[builder(setter(into, strip_option), default)]
12686 pub parent_handle: Option<&'a str>,
12687 #[builder(setter(into, strip_option), default)]
12690 pub state: Option<AgentState>,
12691}
12692impl IntoID<Id> for Llm {
12693 fn into_id(
12694 self,
12695 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12696 Box::pin(async move { self.id().await })
12697 }
12698}
12699impl Loadable for Llm {
12700 fn graphql_type() -> &'static str {
12701 "LLM"
12702 }
12703 fn from_query(
12704 proc: Option<Arc<DaggerSessionProc>>,
12705 selection: Selection,
12706 graphql_client: DynGraphQLClient,
12707 ) -> Self {
12708 Self {
12709 proc,
12710 selection,
12711 graphql_client,
12712 }
12713 }
12714}
12715impl Llm {
12716 pub async fn id(&self) -> Result<Id, DaggerError> {
12718 let query = self.selection.select("id");
12719 query.execute(self.graphql_client.clone()).await
12720 }
12721 pub fn compose(&self, expertise: Vec<Id>) -> Llm {
12727 let mut query = self.selection.select("compose");
12728 query = query.arg("expertise", expertise);
12729 Llm {
12730 proc: self.proc.clone(),
12731 selection: query,
12732 graphql_client: self.graphql_client.clone(),
12733 }
12734 }
12735 pub fn recompose(&self, expertise: Vec<Id>) -> Llm {
12743 let mut query = self.selection.select("recompose");
12744 query = query.arg("expertise", expertise);
12745 Llm {
12746 proc: self.proc.clone(),
12747 selection: query,
12748 graphql_client: self.graphql_client.clone(),
12749 }
12750 }
12751 pub async fn model(&self) -> Result<String, DaggerError> {
12753 let query = self.selection.select("model");
12754 query.execute(self.graphql_client.clone()).await
12755 }
12756 pub async fn provider(&self) -> Result<String, DaggerError> {
12758 let query = self.selection.select("provider");
12759 query.execute(self.graphql_client.clone()).await
12760 }
12761 pub async fn context_window(&self) -> Result<isize, DaggerError> {
12763 let query = self.selection.select("contextWindow");
12764 query.execute(self.graphql_client.clone()).await
12765 }
12766 pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
12768 let query = self.selection.select("messages");
12769 let query = query.select("id");
12770 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12771 Ok(ids
12772 .into_iter()
12773 .map(|id| LlmMessage {
12774 proc: self.proc.clone(),
12775 selection: crate::querybuilder::query()
12776 .select("node")
12777 .arg("id", &id.0)
12778 .inline_fragment("LLMMessage"),
12779 graphql_client: self.graphql_client.clone(),
12780 })
12781 .collect())
12782 }
12783 pub async fn transcript(&self) -> Result<String, DaggerError> {
12785 let query = self.selection.select("transcript");
12786 query.execute(self.graphql_client.clone()).await
12787 }
12788 pub fn without_message_history(&self) -> Llm {
12790 let query = self.selection.select("withoutMessageHistory");
12791 Llm {
12792 proc: self.proc.clone(),
12793 selection: query,
12794 graphql_client: self.graphql_client.clone(),
12795 }
12796 }
12797 pub fn without_system_prompts(&self) -> Llm {
12799 let query = self.selection.select("withoutSystemPrompts");
12800 Llm {
12801 proc: self.proc.clone(),
12802 selection: query,
12803 graphql_client: self.graphql_client.clone(),
12804 }
12805 }
12806 pub async fn last_reply(&self) -> Result<String, DaggerError> {
12808 let query = self.selection.select("lastReply");
12809 query.execute(self.graphql_client.clone()).await
12810 }
12811 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
12817 let mut query = self.selection.select("withWorkspace");
12818 query = query.arg_lazy(
12819 "workspace",
12820 Box::new(move || {
12821 let workspace = workspace.clone();
12822 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
12823 }),
12824 );
12825 Llm {
12826 proc: self.proc.clone(),
12827 selection: query,
12828 graphql_client: self.graphql_client.clone(),
12829 }
12830 }
12831 pub fn workspace(&self) -> Workspace {
12833 let query = self.selection.select("workspace");
12834 Workspace {
12835 proc: self.proc.clone(),
12836 selection: query,
12837 graphql_client: self.graphql_client.clone(),
12838 }
12839 }
12840 pub fn artifacts(&self) -> Artifacts {
12849 let query = self.selection.select("artifacts");
12850 Artifacts {
12851 proc: self.proc.clone(),
12852 selection: query,
12853 graphql_client: self.graphql_client.clone(),
12854 }
12855 }
12856 pub fn artifacts_opts<'a>(&self, opts: LlmArtifactsOpts<'a>) -> Artifacts {
12865 let mut query = self.selection.select("artifacts");
12866 if let Some(include) = opts.include {
12867 query = query.arg("include", include);
12868 }
12869 Artifacts {
12870 proc: self.proc.clone(),
12871 selection: query,
12872 graphql_client: self.graphql_client.clone(),
12873 }
12874 }
12875 pub fn with_model(&self, model: impl Into<String>) -> Llm {
12882 let mut query = self.selection.select("withModel");
12883 query = query.arg("model", model.into());
12884 Llm {
12885 proc: self.proc.clone(),
12886 selection: query,
12887 graphql_client: self.graphql_client.clone(),
12888 }
12889 }
12890 pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
12897 let mut query = self.selection.select("withModel");
12898 query = query.arg("model", model.into());
12899 if let Some(provider) = opts.provider {
12900 query = query.arg("provider", provider);
12901 }
12902 Llm {
12903 proc: self.proc.clone(),
12904 selection: query,
12905 graphql_client: self.graphql_client.clone(),
12906 }
12907 }
12908 pub fn with_small_model(&self) -> Llm {
12910 let query = self.selection.select("withSmallModel");
12911 Llm {
12912 proc: self.proc.clone(),
12913 selection: query,
12914 graphql_client: self.graphql_client.clone(),
12915 }
12916 }
12917 pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
12919 let query = self.selection.select("reasoningEffort");
12920 query.execute(self.graphql_client.clone()).await
12921 }
12922 pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
12928 let mut query = self.selection.select("withReasoningEffort");
12929 query = query.arg("effort", effort.into());
12930 Llm {
12931 proc: self.proc.clone(),
12932 selection: query,
12933 graphql_client: self.graphql_client.clone(),
12934 }
12935 }
12936 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
12943 let mut query = self.selection.select("withPrompt");
12944 query = query.arg("prompt", prompt.into());
12945 Llm {
12946 proc: self.proc.clone(),
12947 selection: query,
12948 graphql_client: self.graphql_client.clone(),
12949 }
12950 }
12951 pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
12958 let mut query = self.selection.select("withPrompt");
12959 query = query.arg("prompt", prompt.into());
12960 if let Some(origin) = opts.origin {
12961 query = query.arg("origin", origin);
12962 }
12963 Llm {
12964 proc: self.proc.clone(),
12965 selection: query,
12966 graphql_client: self.graphql_client.clone(),
12967 }
12968 }
12969 pub fn with_content(&self, content: Vec<LlmContentBlockInput>) -> Llm {
12976 let mut query = self.selection.select("withContent");
12977 query = query.arg("content", content);
12978 Llm {
12979 proc: self.proc.clone(),
12980 selection: query,
12981 graphql_client: self.graphql_client.clone(),
12982 }
12983 }
12984 pub fn with_content_opts(
12991 &self,
12992 content: Vec<LlmContentBlockInput>,
12993 opts: LlmWithContentOpts,
12994 ) -> Llm {
12995 let mut query = self.selection.select("withContent");
12996 query = query.arg("content", content);
12997 if let Some(origin) = opts.origin {
12998 query = query.arg("origin", origin);
12999 }
13000 Llm {
13001 proc: self.proc.clone(),
13002 selection: query,
13003 graphql_client: self.graphql_client.clone(),
13004 }
13005 }
13006 pub fn with_content_file(&self, file: impl IntoID<Id>) -> Llm {
13013 let mut query = self.selection.select("withContentFile");
13014 query = query.arg_lazy(
13015 "file",
13016 Box::new(move || {
13017 let file = file.clone();
13018 Box::pin(async move { file.into_id().await.unwrap().quote() })
13019 }),
13020 );
13021 Llm {
13022 proc: self.proc.clone(),
13023 selection: query,
13024 graphql_client: self.graphql_client.clone(),
13025 }
13026 }
13027 pub fn with_content_file_opts<'a>(
13034 &self,
13035 file: impl IntoID<Id>,
13036 opts: LlmWithContentFileOpts<'a>,
13037 ) -> Llm {
13038 let mut query = self.selection.select("withContentFile");
13039 query = query.arg_lazy(
13040 "file",
13041 Box::new(move || {
13042 let file = file.clone();
13043 Box::pin(async move { file.into_id().await.unwrap().quote() })
13044 }),
13045 );
13046 if let Some(mime_type) = opts.mime_type {
13047 query = query.arg("mimeType", mime_type);
13048 }
13049 Llm {
13050 proc: self.proc.clone(),
13051 selection: query,
13052 graphql_client: self.graphql_client.clone(),
13053 }
13054 }
13055 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
13061 let mut query = self.selection.select("withPromptFile");
13062 query = query.arg_lazy(
13063 "file",
13064 Box::new(move || {
13065 let file = file.clone();
13066 Box::pin(async move { file.into_id().await.unwrap().quote() })
13067 }),
13068 );
13069 Llm {
13070 proc: self.proc.clone(),
13071 selection: query,
13072 graphql_client: self.graphql_client.clone(),
13073 }
13074 }
13075 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
13081 let mut query = self.selection.select("withSystemPrompt");
13082 query = query.arg("prompt", prompt.into());
13083 Llm {
13084 proc: self.proc.clone(),
13085 selection: query,
13086 graphql_client: self.graphql_client.clone(),
13087 }
13088 }
13089 pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13096 let mut query = self.selection.select("withResponse");
13097 query = query.arg("content", content);
13098 Llm {
13099 proc: self.proc.clone(),
13100 selection: query,
13101 graphql_client: self.graphql_client.clone(),
13102 }
13103 }
13104 pub fn with_response_opts(
13111 &self,
13112 content: Vec<LlmContentBlockInput>,
13113 opts: LlmWithResponseOpts,
13114 ) -> Llm {
13115 let mut query = self.selection.select("withResponse");
13116 query = query.arg("content", content);
13117 if let Some(input_tokens) = opts.input_tokens {
13118 query = query.arg("inputTokens", input_tokens);
13119 }
13120 if let Some(output_tokens) = opts.output_tokens {
13121 query = query.arg("outputTokens", output_tokens);
13122 }
13123 if let Some(cached_token_reads) = opts.cached_token_reads {
13124 query = query.arg("cachedTokenReads", cached_token_reads);
13125 }
13126 if let Some(cached_token_writes) = opts.cached_token_writes {
13127 query = query.arg("cachedTokenWrites", cached_token_writes);
13128 }
13129 if let Some(total_tokens) = opts.total_tokens {
13130 query = query.arg("totalTokens", total_tokens);
13131 }
13132 Llm {
13133 proc: self.proc.clone(),
13134 selection: query,
13135 graphql_client: self.graphql_client.clone(),
13136 }
13137 }
13138 pub fn with_tool_result(
13147 &self,
13148 call_id: impl Into<String>,
13149 content: impl Into<String>,
13150 errored: bool,
13151 ) -> Llm {
13152 let mut query = self.selection.select("withToolResult");
13153 query = query.arg("callId", call_id.into());
13154 query = query.arg("content", content.into());
13155 query = query.arg("errored", errored);
13156 Llm {
13157 proc: self.proc.clone(),
13158 selection: query,
13159 graphql_client: self.graphql_client.clone(),
13160 }
13161 }
13162 pub fn with_tool_result_opts(
13171 &self,
13172 call_id: impl Into<String>,
13173 content: impl Into<String>,
13174 errored: bool,
13175 opts: LlmWithToolResultOpts,
13176 ) -> Llm {
13177 let mut query = self.selection.select("withToolResult");
13178 query = query.arg("callId", call_id.into());
13179 query = query.arg("content", content.into());
13180 query = query.arg("errored", errored);
13181 if let Some(blocks) = opts.blocks {
13182 query = query.arg("blocks", blocks);
13183 }
13184 Llm {
13185 proc: self.proc.clone(),
13186 selection: query,
13187 graphql_client: self.graphql_client.clone(),
13188 }
13189 }
13190 pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
13197 let mut query = self.selection.select("withTools");
13198 query = query.arg_lazy(
13199 "object",
13200 Box::new(move || {
13201 let object = object.clone();
13202 Box::pin(async move { object.into_id().await.unwrap().quote() })
13203 }),
13204 );
13205 Llm {
13206 proc: self.proc.clone(),
13207 selection: query,
13208 graphql_client: self.graphql_client.clone(),
13209 }
13210 }
13211 pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
13218 let mut query = self.selection.select("withTools");
13219 query = query.arg_lazy(
13220 "object",
13221 Box::new(move || {
13222 let object = object.clone();
13223 Box::pin(async move { object.into_id().await.unwrap().quote() })
13224 }),
13225 );
13226 if let Some(except) = opts.except {
13227 query = query.arg("except", except);
13228 }
13229 if let Some(version) = opts.version {
13230 query = query.arg("version", version);
13231 }
13232 Llm {
13233 proc: self.proc.clone(),
13234 selection: query,
13235 graphql_client: self.graphql_client.clone(),
13236 }
13237 }
13238 pub fn without_default_system_prompt(&self) -> Llm {
13240 let query = self.selection.select("withoutDefaultSystemPrompt");
13241 Llm {
13242 proc: self.proc.clone(),
13243 selection: query,
13244 graphql_client: self.graphql_client.clone(),
13245 }
13246 }
13247 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
13254 let mut query = self.selection.select("withMCPServer");
13255 query = query.arg("name", name.into());
13256 query = query.arg_lazy(
13257 "service",
13258 Box::new(move || {
13259 let service = service.clone();
13260 Box::pin(async move { service.into_id().await.unwrap().quote() })
13261 }),
13262 );
13263 Llm {
13264 proc: self.proc.clone(),
13265 selection: query,
13266 graphql_client: self.graphql_client.clone(),
13267 }
13268 }
13269 pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
13275 let mut query = self.selection.select("withSkills");
13276 query = query.arg_lazy(
13277 "directory",
13278 Box::new(move || {
13279 let directory = directory.clone();
13280 Box::pin(async move { directory.into_id().await.unwrap().quote() })
13281 }),
13282 );
13283 Llm {
13284 proc: self.proc.clone(),
13285 selection: query,
13286 graphql_client: self.graphql_client.clone(),
13287 }
13288 }
13289 pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
13291 let query = self.selection.select("skills");
13292 let query = query.select("id");
13293 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13294 Ok(ids
13295 .into_iter()
13296 .map(|id| LlmSkill {
13297 proc: self.proc.clone(),
13298 selection: crate::querybuilder::query()
13299 .select("node")
13300 .arg("id", &id.0)
13301 .inline_fragment("LLMSkill"),
13302 graphql_client: self.graphql_client.clone(),
13303 })
13304 .collect())
13305 }
13306 pub async fn sync(&self) -> Result<Llm, DaggerError> {
13308 let query = self.selection.select("sync");
13309 let id: Id = query.execute(self.graphql_client.clone()).await?;
13310 Ok(Llm {
13311 proc: self.proc.clone(),
13312 selection: query
13313 .root()
13314 .select("node")
13315 .arg("id", &id.0)
13316 .inline_fragment("LLM"),
13317 graphql_client: self.graphql_client.clone(),
13318 })
13319 }
13320 pub fn r#loop(&self) -> Llm {
13326 let query = self.selection.select("loop");
13327 Llm {
13328 proc: self.proc.clone(),
13329 selection: query,
13330 graphql_client: self.graphql_client.clone(),
13331 }
13332 }
13333 pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
13339 let mut query = self.selection.select("loop");
13340 if let Some(max_steps) = opts.max_steps {
13341 query = query.arg("maxSteps", max_steps);
13342 }
13343 if let Some(max_tokens) = opts.max_tokens {
13344 query = query.arg("maxTokens", max_tokens);
13345 }
13346 Llm {
13347 proc: self.proc.clone(),
13348 selection: query,
13349 graphql_client: self.graphql_client.clone(),
13350 }
13351 }
13352 pub fn step(&self) -> Llm {
13358 let query = self.selection.select("step");
13359 Llm {
13360 proc: self.proc.clone(),
13361 selection: query,
13362 graphql_client: self.graphql_client.clone(),
13363 }
13364 }
13365 pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
13371 let mut query = self.selection.select("step");
13372 if let Some(max_tokens) = opts.max_tokens {
13373 query = query.arg("maxTokens", max_tokens);
13374 }
13375 Llm {
13376 proc: self.proc.clone(),
13377 selection: query,
13378 graphql_client: self.graphql_client.clone(),
13379 }
13380 }
13381 pub async fn spawn(&self) -> Result<Agent, DaggerError> {
13390 let query = self.selection.select("spawn");
13391 let id: Id = query.execute(self.graphql_client.clone()).await?;
13392 Ok(Agent {
13393 proc: self.proc.clone(),
13394 selection: query
13395 .root()
13396 .select("node")
13397 .arg("id", &id.0)
13398 .inline_fragment("Agent"),
13399 graphql_client: self.graphql_client.clone(),
13400 })
13401 }
13402 pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
13411 let mut query = self.selection.select("spawn");
13412 if let Some(name) = opts.name {
13413 query = query.arg("name", name);
13414 }
13415 if let Some(handle) = opts.handle {
13416 query = query.arg("handle", handle);
13417 }
13418 if let Some(state) = opts.state {
13419 query = query.arg("state", state);
13420 }
13421 if let Some(parent_handle) = opts.parent_handle {
13422 query = query.arg("parentHandle", parent_handle);
13423 }
13424 if let Some(error) = opts.error {
13425 query = query.arg("error", error);
13426 }
13427 let id: Id = query.execute(self.graphql_client.clone()).await?;
13428 Ok(Agent {
13429 proc: self.proc.clone(),
13430 selection: query
13431 .root()
13432 .select("node")
13433 .arg("id", &id.0)
13434 .inline_fragment("Agent"),
13435 graphql_client: self.graphql_client.clone(),
13436 })
13437 }
13438 pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
13446 let mut query = self.selection.select("agent");
13447 query = query.arg("handle", handle.into());
13448 query = query.arg("name", name.into());
13449 Agent {
13450 proc: self.proc.clone(),
13451 selection: query,
13452 graphql_client: self.graphql_client.clone(),
13453 }
13454 }
13455 pub async fn has_pending(&self) -> Result<bool, DaggerError> {
13457 let query = self.selection.select("hasPending");
13458 query.execute(self.graphql_client.clone()).await
13459 }
13460 pub fn fork(&self, label: impl Into<String>) -> Llm {
13466 let mut query = self.selection.select("fork");
13467 query = query.arg("label", label.into());
13468 Llm {
13469 proc: self.proc.clone(),
13470 selection: query,
13471 graphql_client: self.graphql_client.clone(),
13472 }
13473 }
13474 pub async fn tools(&self) -> Result<String, DaggerError> {
13476 let query = self.selection.select("tools");
13477 query.execute(self.graphql_client.clone()).await
13478 }
13479 pub fn token_usage(&self) -> LlmTokenUsage {
13481 let query = self.selection.select("tokenUsage");
13482 LlmTokenUsage {
13483 proc: self.proc.clone(),
13484 selection: query,
13485 graphql_client: self.graphql_client.clone(),
13486 }
13487 }
13488 pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
13490 let query = self.selection.select("contextTokens");
13491 query.execute(self.graphql_client.clone()).await
13492 }
13493}
13494impl Node for Llm {
13495 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13496 let query = self.selection.select("id");
13497 let graphql_client = self.graphql_client.clone();
13498 async move { query.execute(graphql_client).await }
13499 }
13500}
13501impl Syncer for Llm {
13502 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13503 let query = self.selection.select("id");
13504 let graphql_client = self.graphql_client.clone();
13505 async move { query.execute(graphql_client).await }
13506 }
13507 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13508 let query = self.selection.select("sync");
13509 let proc = self.proc.clone();
13510 let graphql_client = self.graphql_client.clone();
13511 async move {
13512 let id: Id = query.execute(graphql_client.clone()).await?;
13513 Ok(Self {
13514 proc,
13515 selection: query
13516 .root()
13517 .select("node")
13518 .arg("id", &id.0)
13519 .inline_fragment("LLM"),
13520 graphql_client,
13521 })
13522 }
13523 }
13524}
13525#[derive(Clone)]
13526pub struct LlmContent {
13527 pub proc: Option<Arc<DaggerSessionProc>>,
13528 pub selection: Selection,
13529 pub graphql_client: DynGraphQLClient,
13530}
13531#[derive(Builder, Debug, PartialEq)]
13532pub struct LlmContentWithFileOpts<'a> {
13533 #[builder(setter(into, strip_option), default)]
13535 pub mime_type: Option<&'a str>,
13536}
13537impl IntoID<Id> for LlmContent {
13538 fn into_id(
13539 self,
13540 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13541 Box::pin(async move { self.id().await })
13542 }
13543}
13544impl Loadable for LlmContent {
13545 fn graphql_type() -> &'static str {
13546 "LLMContent"
13547 }
13548 fn from_query(
13549 proc: Option<Arc<DaggerSessionProc>>,
13550 selection: Selection,
13551 graphql_client: DynGraphQLClient,
13552 ) -> Self {
13553 Self {
13554 proc,
13555 selection,
13556 graphql_client,
13557 }
13558 }
13559}
13560impl LlmContent {
13561 pub async fn id(&self) -> Result<Id, DaggerError> {
13563 let query = self.selection.select("id");
13564 query.execute(self.graphql_client.clone()).await
13565 }
13566 pub fn with_text(&self, text: impl Into<String>) -> LlmContent {
13572 let mut query = self.selection.select("withText");
13573 query = query.arg("text", text.into());
13574 LlmContent {
13575 proc: self.proc.clone(),
13576 selection: query,
13577 graphql_client: self.graphql_client.clone(),
13578 }
13579 }
13580 pub fn with_file(&self, file: impl IntoID<Id>) -> LlmContent {
13587 let mut query = self.selection.select("withFile");
13588 query = query.arg_lazy(
13589 "file",
13590 Box::new(move || {
13591 let file = file.clone();
13592 Box::pin(async move { file.into_id().await.unwrap().quote() })
13593 }),
13594 );
13595 LlmContent {
13596 proc: self.proc.clone(),
13597 selection: query,
13598 graphql_client: self.graphql_client.clone(),
13599 }
13600 }
13601 pub fn with_file_opts<'a>(
13608 &self,
13609 file: impl IntoID<Id>,
13610 opts: LlmContentWithFileOpts<'a>,
13611 ) -> LlmContent {
13612 let mut query = self.selection.select("withFile");
13613 query = query.arg_lazy(
13614 "file",
13615 Box::new(move || {
13616 let file = file.clone();
13617 Box::pin(async move { file.into_id().await.unwrap().quote() })
13618 }),
13619 );
13620 if let Some(mime_type) = opts.mime_type {
13621 query = query.arg("mimeType", mime_type);
13622 }
13623 LlmContent {
13624 proc: self.proc.clone(),
13625 selection: query,
13626 graphql_client: self.graphql_client.clone(),
13627 }
13628 }
13629 pub fn with_data(&self, data: Bytes, mime_type: impl Into<String>) -> LlmContent {
13637 let mut query = self.selection.select("withData");
13638 query = query.arg("data", data);
13639 query = query.arg("mimeType", mime_type.into());
13640 LlmContent {
13641 proc: self.proc.clone(),
13642 selection: query,
13643 graphql_client: self.graphql_client.clone(),
13644 }
13645 }
13646 pub async fn blocks(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13648 let query = self.selection.select("blocks");
13649 let query = query.select("id");
13650 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13651 Ok(ids
13652 .into_iter()
13653 .map(|id| LlmContentBlock {
13654 proc: self.proc.clone(),
13655 selection: crate::querybuilder::query()
13656 .select("node")
13657 .arg("id", &id.0)
13658 .inline_fragment("LLMContentBlock"),
13659 graphql_client: self.graphql_client.clone(),
13660 })
13661 .collect())
13662 }
13663}
13664impl Node for LlmContent {
13665 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13666 let query = self.selection.select("id");
13667 let graphql_client = self.graphql_client.clone();
13668 async move { query.execute(graphql_client).await }
13669 }
13670}
13671#[derive(Clone)]
13672pub struct LlmContentBlock {
13673 pub proc: Option<Arc<DaggerSessionProc>>,
13674 pub selection: Selection,
13675 pub graphql_client: DynGraphQLClient,
13676}
13677impl IntoID<Id> for LlmContentBlock {
13678 fn into_id(
13679 self,
13680 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13681 Box::pin(async move { self.id().await })
13682 }
13683}
13684impl Loadable for LlmContentBlock {
13685 fn graphql_type() -> &'static str {
13686 "LLMContentBlock"
13687 }
13688 fn from_query(
13689 proc: Option<Arc<DaggerSessionProc>>,
13690 selection: Selection,
13691 graphql_client: DynGraphQLClient,
13692 ) -> Self {
13693 Self {
13694 proc,
13695 selection,
13696 graphql_client,
13697 }
13698 }
13699}
13700impl LlmContentBlock {
13701 pub async fn id(&self) -> Result<Id, DaggerError> {
13703 let query = self.selection.select("id");
13704 query.execute(self.graphql_client.clone()).await
13705 }
13706 pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
13708 let query = self.selection.select("kind");
13709 query.execute(self.graphql_client.clone()).await
13710 }
13711 pub async fn text(&self) -> Result<String, DaggerError> {
13713 let query = self.selection.select("text");
13714 query.execute(self.graphql_client.clone()).await
13715 }
13716 pub async fn call_id(&self) -> Result<String, DaggerError> {
13718 let query = self.selection.select("callId");
13719 query.execute(self.graphql_client.clone()).await
13720 }
13721 pub async fn tool_name(&self) -> Result<String, DaggerError> {
13723 let query = self.selection.select("toolName");
13724 query.execute(self.graphql_client.clone()).await
13725 }
13726 pub async fn arguments(&self) -> Result<Json, DaggerError> {
13728 let query = self.selection.select("arguments");
13729 query.execute(self.graphql_client.clone()).await
13730 }
13731 pub async fn errored(&self) -> Result<bool, DaggerError> {
13733 let query = self.selection.select("errored");
13734 query.execute(self.graphql_client.clone()).await
13735 }
13736 pub async fn mime_type(&self) -> Result<String, DaggerError> {
13738 let query = self.selection.select("mimeType");
13739 query.execute(self.graphql_client.clone()).await
13740 }
13741 pub async fn data(&self) -> Result<Bytes, DaggerError> {
13743 let query = self.selection.select("data");
13744 query.execute(self.graphql_client.clone()).await
13745 }
13746 pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13748 let query = self.selection.select("content");
13749 let query = query.select("id");
13750 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13751 Ok(ids
13752 .into_iter()
13753 .map(|id| LlmContentBlock {
13754 proc: self.proc.clone(),
13755 selection: crate::querybuilder::query()
13756 .select("node")
13757 .arg("id", &id.0)
13758 .inline_fragment("LLMContentBlock"),
13759 graphql_client: self.graphql_client.clone(),
13760 })
13761 .collect())
13762 }
13763 pub async fn signature(&self) -> Result<String, DaggerError> {
13765 let query = self.selection.select("signature");
13766 query.execute(self.graphql_client.clone()).await
13767 }
13768}
13769impl Node for LlmContentBlock {
13770 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13771 let query = self.selection.select("id");
13772 let graphql_client = self.graphql_client.clone();
13773 async move { query.execute(graphql_client).await }
13774 }
13775}
13776#[derive(Clone)]
13777pub struct LlmMessage {
13778 pub proc: Option<Arc<DaggerSessionProc>>,
13779 pub selection: Selection,
13780 pub graphql_client: DynGraphQLClient,
13781}
13782impl IntoID<Id> for LlmMessage {
13783 fn into_id(
13784 self,
13785 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13786 Box::pin(async move { self.id().await })
13787 }
13788}
13789impl Loadable for LlmMessage {
13790 fn graphql_type() -> &'static str {
13791 "LLMMessage"
13792 }
13793 fn from_query(
13794 proc: Option<Arc<DaggerSessionProc>>,
13795 selection: Selection,
13796 graphql_client: DynGraphQLClient,
13797 ) -> Self {
13798 Self {
13799 proc,
13800 selection,
13801 graphql_client,
13802 }
13803 }
13804}
13805impl LlmMessage {
13806 pub async fn id(&self) -> Result<Id, DaggerError> {
13808 let query = self.selection.select("id");
13809 query.execute(self.graphql_client.clone()).await
13810 }
13811 pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
13814 let query = self.selection.select("origin");
13815 let query = query.select("id");
13816 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
13817 Ok(id.map(|id| LlmMessageOrigin {
13818 proc: self.proc.clone(),
13819 selection: query
13820 .root()
13821 .select("node")
13822 .arg("id", &id.0)
13823 .inline_fragment("LLMMessageOrigin"),
13824 graphql_client: self.graphql_client.clone(),
13825 }))
13826 }
13827 pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
13829 let query = self.selection.select("role");
13830 query.execute(self.graphql_client.clone()).await
13831 }
13832 pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13834 let query = self.selection.select("content");
13835 let query = query.select("id");
13836 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13837 Ok(ids
13838 .into_iter()
13839 .map(|id| LlmContentBlock {
13840 proc: self.proc.clone(),
13841 selection: crate::querybuilder::query()
13842 .select("node")
13843 .arg("id", &id.0)
13844 .inline_fragment("LLMContentBlock"),
13845 graphql_client: self.graphql_client.clone(),
13846 })
13847 .collect())
13848 }
13849 pub fn token_usage(&self) -> LlmTokenUsage {
13851 let query = self.selection.select("tokenUsage");
13852 LlmTokenUsage {
13853 proc: self.proc.clone(),
13854 selection: query,
13855 graphql_client: self.graphql_client.clone(),
13856 }
13857 }
13858}
13859impl Node for LlmMessage {
13860 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13861 let query = self.selection.select("id");
13862 let graphql_client = self.graphql_client.clone();
13863 async move { query.execute(graphql_client).await }
13864 }
13865}
13866#[derive(Clone)]
13867pub struct LlmMessageOrigin {
13868 pub proc: Option<Arc<DaggerSessionProc>>,
13869 pub selection: Selection,
13870 pub graphql_client: DynGraphQLClient,
13871}
13872impl IntoID<Id> for LlmMessageOrigin {
13873 fn into_id(
13874 self,
13875 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13876 Box::pin(async move { self.id().await })
13877 }
13878}
13879impl Loadable for LlmMessageOrigin {
13880 fn graphql_type() -> &'static str {
13881 "LLMMessageOrigin"
13882 }
13883 fn from_query(
13884 proc: Option<Arc<DaggerSessionProc>>,
13885 selection: Selection,
13886 graphql_client: DynGraphQLClient,
13887 ) -> Self {
13888 Self {
13889 proc,
13890 selection,
13891 graphql_client,
13892 }
13893 }
13894}
13895impl LlmMessageOrigin {
13896 pub async fn id(&self) -> Result<Id, DaggerError> {
13898 let query = self.selection.select("id");
13899 query.execute(self.graphql_client.clone()).await
13900 }
13901 pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
13903 let query = self.selection.select("kind");
13904 query.execute(self.graphql_client.clone()).await
13905 }
13906 pub async fn agent_name(&self) -> Result<String, DaggerError> {
13908 let query = self.selection.select("agentName");
13909 query.execute(self.graphql_client.clone()).await
13910 }
13911 pub async fn r#ref(&self) -> Result<String, DaggerError> {
13913 let query = self.selection.select("ref");
13914 query.execute(self.graphql_client.clone()).await
13915 }
13916 pub async fn reply_to(&self) -> Result<String, DaggerError> {
13918 let query = self.selection.select("replyTo");
13919 query.execute(self.graphql_client.clone()).await
13920 }
13921}
13922impl Node for LlmMessageOrigin {
13923 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13924 let query = self.selection.select("id");
13925 let graphql_client = self.graphql_client.clone();
13926 async move { query.execute(graphql_client).await }
13927 }
13928}
13929#[derive(Clone)]
13930pub struct LlmSkill {
13931 pub proc: Option<Arc<DaggerSessionProc>>,
13932 pub selection: Selection,
13933 pub graphql_client: DynGraphQLClient,
13934}
13935impl IntoID<Id> for LlmSkill {
13936 fn into_id(
13937 self,
13938 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13939 Box::pin(async move { self.id().await })
13940 }
13941}
13942impl Loadable for LlmSkill {
13943 fn graphql_type() -> &'static str {
13944 "LLMSkill"
13945 }
13946 fn from_query(
13947 proc: Option<Arc<DaggerSessionProc>>,
13948 selection: Selection,
13949 graphql_client: DynGraphQLClient,
13950 ) -> Self {
13951 Self {
13952 proc,
13953 selection,
13954 graphql_client,
13955 }
13956 }
13957}
13958impl LlmSkill {
13959 pub async fn id(&self) -> Result<Id, DaggerError> {
13961 let query = self.selection.select("id");
13962 query.execute(self.graphql_client.clone()).await
13963 }
13964 pub async fn name(&self) -> Result<String, DaggerError> {
13966 let query = self.selection.select("name");
13967 query.execute(self.graphql_client.clone()).await
13968 }
13969 pub async fn description(&self) -> Result<String, DaggerError> {
13971 let query = self.selection.select("description");
13972 query.execute(self.graphql_client.clone()).await
13973 }
13974}
13975impl Node for LlmSkill {
13976 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13977 let query = self.selection.select("id");
13978 let graphql_client = self.graphql_client.clone();
13979 async move { query.execute(graphql_client).await }
13980 }
13981}
13982#[derive(Clone)]
13983pub struct LlmTokenUsage {
13984 pub proc: Option<Arc<DaggerSessionProc>>,
13985 pub selection: Selection,
13986 pub graphql_client: DynGraphQLClient,
13987}
13988impl IntoID<Id> for LlmTokenUsage {
13989 fn into_id(
13990 self,
13991 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13992 Box::pin(async move { self.id().await })
13993 }
13994}
13995impl Loadable for LlmTokenUsage {
13996 fn graphql_type() -> &'static str {
13997 "LLMTokenUsage"
13998 }
13999 fn from_query(
14000 proc: Option<Arc<DaggerSessionProc>>,
14001 selection: Selection,
14002 graphql_client: DynGraphQLClient,
14003 ) -> Self {
14004 Self {
14005 proc,
14006 selection,
14007 graphql_client,
14008 }
14009 }
14010}
14011impl LlmTokenUsage {
14012 pub async fn id(&self) -> Result<Id, DaggerError> {
14014 let query = self.selection.select("id");
14015 query.execute(self.graphql_client.clone()).await
14016 }
14017 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
14019 let query = self.selection.select("inputTokens");
14020 query.execute(self.graphql_client.clone()).await
14021 }
14022 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
14024 let query = self.selection.select("outputTokens");
14025 query.execute(self.graphql_client.clone()).await
14026 }
14027 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
14029 let query = self.selection.select("cachedTokenReads");
14030 query.execute(self.graphql_client.clone()).await
14031 }
14032 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
14034 let query = self.selection.select("cachedTokenWrites");
14035 query.execute(self.graphql_client.clone()).await
14036 }
14037 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
14039 let query = self.selection.select("totalTokens");
14040 query.execute(self.graphql_client.clone()).await
14041 }
14042}
14043impl Node for LlmTokenUsage {
14044 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14045 let query = self.selection.select("id");
14046 let graphql_client = self.graphql_client.clone();
14047 async move { query.execute(graphql_client).await }
14048 }
14049}
14050#[derive(Clone)]
14051pub struct Label {
14052 pub proc: Option<Arc<DaggerSessionProc>>,
14053 pub selection: Selection,
14054 pub graphql_client: DynGraphQLClient,
14055}
14056impl IntoID<Id> for Label {
14057 fn into_id(
14058 self,
14059 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14060 Box::pin(async move { self.id().await })
14061 }
14062}
14063impl Loadable for Label {
14064 fn graphql_type() -> &'static str {
14065 "Label"
14066 }
14067 fn from_query(
14068 proc: Option<Arc<DaggerSessionProc>>,
14069 selection: Selection,
14070 graphql_client: DynGraphQLClient,
14071 ) -> Self {
14072 Self {
14073 proc,
14074 selection,
14075 graphql_client,
14076 }
14077 }
14078}
14079impl Label {
14080 pub async fn id(&self) -> Result<Id, DaggerError> {
14082 let query = self.selection.select("id");
14083 query.execute(self.graphql_client.clone()).await
14084 }
14085 pub async fn name(&self) -> Result<String, DaggerError> {
14087 let query = self.selection.select("name");
14088 query.execute(self.graphql_client.clone()).await
14089 }
14090 pub async fn value(&self) -> Result<String, DaggerError> {
14092 let query = self.selection.select("value");
14093 query.execute(self.graphql_client.clone()).await
14094 }
14095}
14096impl Node for Label {
14097 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14098 let query = self.selection.select("id");
14099 let graphql_client = self.graphql_client.clone();
14100 async move { query.execute(graphql_client).await }
14101 }
14102}
14103#[derive(Clone)]
14104pub struct ListTypeDef {
14105 pub proc: Option<Arc<DaggerSessionProc>>,
14106 pub selection: Selection,
14107 pub graphql_client: DynGraphQLClient,
14108}
14109impl IntoID<Id> for ListTypeDef {
14110 fn into_id(
14111 self,
14112 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14113 Box::pin(async move { self.id().await })
14114 }
14115}
14116impl Loadable for ListTypeDef {
14117 fn graphql_type() -> &'static str {
14118 "ListTypeDef"
14119 }
14120 fn from_query(
14121 proc: Option<Arc<DaggerSessionProc>>,
14122 selection: Selection,
14123 graphql_client: DynGraphQLClient,
14124 ) -> Self {
14125 Self {
14126 proc,
14127 selection,
14128 graphql_client,
14129 }
14130 }
14131}
14132impl ListTypeDef {
14133 pub async fn id(&self) -> Result<Id, DaggerError> {
14135 let query = self.selection.select("id");
14136 query.execute(self.graphql_client.clone()).await
14137 }
14138 pub fn element_type_def(&self) -> TypeDef {
14140 let query = self.selection.select("elementTypeDef");
14141 TypeDef {
14142 proc: self.proc.clone(),
14143 selection: query,
14144 graphql_client: self.graphql_client.clone(),
14145 }
14146 }
14147}
14148impl Node for ListTypeDef {
14149 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14150 let query = self.selection.select("id");
14151 let graphql_client = self.graphql_client.clone();
14152 async move { query.execute(graphql_client).await }
14153 }
14154}
14155#[derive(Clone)]
14156pub struct Module {
14157 pub proc: Option<Arc<DaggerSessionProc>>,
14158 pub selection: Selection,
14159 pub graphql_client: DynGraphQLClient,
14160}
14161#[derive(Builder, Debug, PartialEq)]
14162pub struct ModuleServeOpts {
14163 #[builder(setter(into, strip_option), default)]
14165 pub entrypoint: Option<bool>,
14166 #[builder(setter(into, strip_option), default)]
14168 pub include_dependencies: Option<bool>,
14169}
14170impl IntoID<Id> for Module {
14171 fn into_id(
14172 self,
14173 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14174 Box::pin(async move { self.id().await })
14175 }
14176}
14177impl Loadable for Module {
14178 fn graphql_type() -> &'static str {
14179 "Module"
14180 }
14181 fn from_query(
14182 proc: Option<Arc<DaggerSessionProc>>,
14183 selection: Selection,
14184 graphql_client: DynGraphQLClient,
14185 ) -> Self {
14186 Self {
14187 proc,
14188 selection,
14189 graphql_client,
14190 }
14191 }
14192}
14193impl Module {
14194 pub async fn id(&self) -> Result<Id, DaggerError> {
14196 let query = self.selection.select("id");
14197 query.execute(self.graphql_client.clone()).await
14198 }
14199 pub async fn context_source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14201 let query = self.selection.select("contextSource");
14202 let query = query.select("id");
14203 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14204 Ok(id.map(|id| ModuleSource {
14205 proc: self.proc.clone(),
14206 selection: query
14207 .root()
14208 .select("node")
14209 .arg("id", &id.0)
14210 .inline_fragment("ModuleSource"),
14211 graphql_client: self.graphql_client.clone(),
14212 }))
14213 }
14214 pub async fn sync(&self) -> Result<Module, DaggerError> {
14216 let query = self.selection.select("sync");
14217 let id: Id = query.execute(self.graphql_client.clone()).await?;
14218 Ok(Module {
14219 proc: self.proc.clone(),
14220 selection: query
14221 .root()
14222 .select("node")
14223 .arg("id", &id.0)
14224 .inline_fragment("Module"),
14225 graphql_client: self.graphql_client.clone(),
14226 })
14227 }
14228 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
14230 let query = self.selection.select("dependencies");
14231 let query = query.select("id");
14232 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14233 Ok(ids
14234 .into_iter()
14235 .map(|id| Module {
14236 proc: self.proc.clone(),
14237 selection: crate::querybuilder::query()
14238 .select("node")
14239 .arg("id", &id.0)
14240 .inline_fragment("Module"),
14241 graphql_client: self.graphql_client.clone(),
14242 })
14243 .collect())
14244 }
14245 pub fn introspection_schema_json(&self) -> File {
14249 let query = self.selection.select("introspectionSchemaJSON");
14250 File {
14251 proc: self.proc.clone(),
14252 selection: query,
14253 graphql_client: self.graphql_client.clone(),
14254 }
14255 }
14256 pub fn generated_context_directory(&self) -> Directory {
14258 let query = self.selection.select("generatedContextDirectory");
14259 Directory {
14260 proc: self.proc.clone(),
14261 selection: query,
14262 graphql_client: self.graphql_client.clone(),
14263 }
14264 }
14265 pub fn user_defaults(&self) -> EnvFile {
14267 let query = self.selection.select("userDefaults");
14268 EnvFile {
14269 proc: self.proc.clone(),
14270 selection: query,
14271 graphql_client: self.graphql_client.clone(),
14272 }
14273 }
14274 pub fn with_description(&self, description: impl Into<String>) -> Module {
14280 let mut query = self.selection.select("withDescription");
14281 query = query.arg("description", description.into());
14282 Module {
14283 proc: self.proc.clone(),
14284 selection: query,
14285 graphql_client: self.graphql_client.clone(),
14286 }
14287 }
14288 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
14290 let mut query = self.selection.select("withObject");
14291 query = query.arg_lazy(
14292 "object",
14293 Box::new(move || {
14294 let object = object.clone();
14295 Box::pin(async move { object.into_id().await.unwrap().quote() })
14296 }),
14297 );
14298 Module {
14299 proc: self.proc.clone(),
14300 selection: query,
14301 graphql_client: self.graphql_client.clone(),
14302 }
14303 }
14304 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
14306 let mut query = self.selection.select("withInterface");
14307 query = query.arg_lazy(
14308 "iface",
14309 Box::new(move || {
14310 let iface = iface.clone();
14311 Box::pin(async move { iface.into_id().await.unwrap().quote() })
14312 }),
14313 );
14314 Module {
14315 proc: self.proc.clone(),
14316 selection: query,
14317 graphql_client: self.graphql_client.clone(),
14318 }
14319 }
14320 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
14322 let mut query = self.selection.select("withEnum");
14323 query = query.arg_lazy(
14324 "enum",
14325 Box::new(move || {
14326 let r#enum = r#enum.clone();
14327 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
14328 }),
14329 );
14330 Module {
14331 proc: self.proc.clone(),
14332 selection: query,
14333 graphql_client: self.graphql_client.clone(),
14334 }
14335 }
14336 pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
14338 let query = self.selection.select("runtime");
14339 let query = query.select("id");
14340 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14341 Ok(id.map(|id| Container {
14342 proc: self.proc.clone(),
14343 selection: query
14344 .root()
14345 .select("node")
14346 .arg("id", &id.0)
14347 .inline_fragment("Container"),
14348 graphql_client: self.graphql_client.clone(),
14349 }))
14350 }
14351 pub async fn serve(&self) -> Result<Void, DaggerError> {
14358 let query = self.selection.select("serve");
14359 query.execute(self.graphql_client.clone()).await
14360 }
14361 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
14368 let mut query = self.selection.select("serve");
14369 if let Some(include_dependencies) = opts.include_dependencies {
14370 query = query.arg("includeDependencies", include_dependencies);
14371 }
14372 if let Some(entrypoint) = opts.entrypoint {
14373 query = query.arg("entrypoint", entrypoint);
14374 }
14375 query.execute(self.graphql_client.clone()).await
14376 }
14377 pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14379 let query = self.selection.select("source");
14380 let query = query.select("id");
14381 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14382 Ok(id.map(|id| ModuleSource {
14383 proc: self.proc.clone(),
14384 selection: query
14385 .root()
14386 .select("node")
14387 .arg("id", &id.0)
14388 .inline_fragment("ModuleSource"),
14389 graphql_client: self.graphql_client.clone(),
14390 }))
14391 }
14392 pub async fn name(&self) -> Result<String, DaggerError> {
14394 let query = self.selection.select("name");
14395 query.execute(self.graphql_client.clone()).await
14396 }
14397 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
14399 let query = self.selection.select("sdk");
14400 let query = query.select("id");
14401 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14402 Ok(id.map(|id| SdkConfig {
14403 proc: self.proc.clone(),
14404 selection: query
14405 .root()
14406 .select("node")
14407 .arg("id", &id.0)
14408 .inline_fragment("SDKConfig"),
14409 graphql_client: self.graphql_client.clone(),
14410 }))
14411 }
14412 pub async fn description(&self) -> Result<String, DaggerError> {
14414 let query = self.selection.select("description");
14415 query.execute(self.graphql_client.clone()).await
14416 }
14417 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
14419 let query = self.selection.select("objects");
14420 let query = query.select("id");
14421 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14422 Ok(ids
14423 .into_iter()
14424 .map(|id| TypeDef {
14425 proc: self.proc.clone(),
14426 selection: crate::querybuilder::query()
14427 .select("node")
14428 .arg("id", &id.0)
14429 .inline_fragment("TypeDef"),
14430 graphql_client: self.graphql_client.clone(),
14431 })
14432 .collect())
14433 }
14434 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
14436 let query = self.selection.select("interfaces");
14437 let query = query.select("id");
14438 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14439 Ok(ids
14440 .into_iter()
14441 .map(|id| TypeDef {
14442 proc: self.proc.clone(),
14443 selection: crate::querybuilder::query()
14444 .select("node")
14445 .arg("id", &id.0)
14446 .inline_fragment("TypeDef"),
14447 graphql_client: self.graphql_client.clone(),
14448 })
14449 .collect())
14450 }
14451 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
14453 let query = self.selection.select("enums");
14454 let query = query.select("id");
14455 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14456 Ok(ids
14457 .into_iter()
14458 .map(|id| TypeDef {
14459 proc: self.proc.clone(),
14460 selection: crate::querybuilder::query()
14461 .select("node")
14462 .arg("id", &id.0)
14463 .inline_fragment("TypeDef"),
14464 graphql_client: self.graphql_client.clone(),
14465 })
14466 .collect())
14467 }
14468}
14469impl Node for Module {
14470 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14471 let query = self.selection.select("id");
14472 let graphql_client = self.graphql_client.clone();
14473 async move { query.execute(graphql_client).await }
14474 }
14475}
14476impl Syncer for Module {
14477 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14478 let query = self.selection.select("id");
14479 let graphql_client = self.graphql_client.clone();
14480 async move { query.execute(graphql_client).await }
14481 }
14482 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
14483 let query = self.selection.select("sync");
14484 let proc = self.proc.clone();
14485 let graphql_client = self.graphql_client.clone();
14486 async move {
14487 let id: Id = query.execute(graphql_client.clone()).await?;
14488 Ok(Self {
14489 proc,
14490 selection: query
14491 .root()
14492 .select("node")
14493 .arg("id", &id.0)
14494 .inline_fragment("Module"),
14495 graphql_client,
14496 })
14497 }
14498 }
14499}
14500#[derive(Clone)]
14501pub struct ModuleConfigClient {
14502 pub proc: Option<Arc<DaggerSessionProc>>,
14503 pub selection: Selection,
14504 pub graphql_client: DynGraphQLClient,
14505}
14506impl IntoID<Id> for ModuleConfigClient {
14507 fn into_id(
14508 self,
14509 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14510 Box::pin(async move { self.id().await })
14511 }
14512}
14513impl Loadable for ModuleConfigClient {
14514 fn graphql_type() -> &'static str {
14515 "ModuleConfigClient"
14516 }
14517 fn from_query(
14518 proc: Option<Arc<DaggerSessionProc>>,
14519 selection: Selection,
14520 graphql_client: DynGraphQLClient,
14521 ) -> Self {
14522 Self {
14523 proc,
14524 selection,
14525 graphql_client,
14526 }
14527 }
14528}
14529impl ModuleConfigClient {
14530 pub async fn id(&self) -> Result<Id, DaggerError> {
14532 let query = self.selection.select("id");
14533 query.execute(self.graphql_client.clone()).await
14534 }
14535 pub async fn generator(&self) -> Result<String, DaggerError> {
14537 let query = self.selection.select("generator");
14538 query.execute(self.graphql_client.clone()).await
14539 }
14540 pub async fn directory(&self) -> Result<String, DaggerError> {
14542 let query = self.selection.select("directory");
14543 query.execute(self.graphql_client.clone()).await
14544 }
14545}
14546impl Node for ModuleConfigClient {
14547 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14548 let query = self.selection.select("id");
14549 let graphql_client = self.graphql_client.clone();
14550 async move { query.execute(graphql_client).await }
14551 }
14552}
14553#[derive(Clone)]
14554pub struct ModuleSource {
14555 pub proc: Option<Arc<DaggerSessionProc>>,
14556 pub selection: Selection,
14557 pub graphql_client: DynGraphQLClient,
14558}
14559impl IntoID<Id> for ModuleSource {
14560 fn into_id(
14561 self,
14562 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14563 Box::pin(async move { self.id().await })
14564 }
14565}
14566impl Loadable for ModuleSource {
14567 fn graphql_type() -> &'static str {
14568 "ModuleSource"
14569 }
14570 fn from_query(
14571 proc: Option<Arc<DaggerSessionProc>>,
14572 selection: Selection,
14573 graphql_client: DynGraphQLClient,
14574 ) -> Self {
14575 Self {
14576 proc,
14577 selection,
14578 graphql_client,
14579 }
14580 }
14581}
14582impl ModuleSource {
14583 pub async fn id(&self) -> Result<Id, DaggerError> {
14585 let query = self.selection.select("id");
14586 query.execute(self.graphql_client.clone()).await
14587 }
14588 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
14590 let query = self.selection.select("sync");
14591 let id: Id = query.execute(self.graphql_client.clone()).await?;
14592 Ok(ModuleSource {
14593 proc: self.proc.clone(),
14594 selection: query
14595 .root()
14596 .select("node")
14597 .arg("id", &id.0)
14598 .inline_fragment("ModuleSource"),
14599 graphql_client: self.graphql_client.clone(),
14600 })
14601 }
14602 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
14604 let query = self.selection.select("sourceSubpath");
14605 query.execute(self.graphql_client.clone()).await
14606 }
14607 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
14609 let query = self.selection.select("originalSubpath");
14610 query.execute(self.graphql_client.clone()).await
14611 }
14612 pub async fn digest(&self) -> Result<String, DaggerError> {
14614 let query = self.selection.select("digest");
14615 query.execute(self.graphql_client.clone()).await
14616 }
14617 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
14623 let mut query = self.selection.select("withSourceSubpath");
14624 query = query.arg("path", path.into());
14625 ModuleSource {
14626 proc: self.proc.clone(),
14627 selection: query,
14628 graphql_client: self.graphql_client.clone(),
14629 }
14630 }
14631 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
14637 let mut query = self.selection.select("withName");
14638 query = query.arg("name", name.into());
14639 ModuleSource {
14640 proc: self.proc.clone(),
14641 selection: query,
14642 graphql_client: self.graphql_client.clone(),
14643 }
14644 }
14645 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
14651 let mut query = self.selection.select("withIncludes");
14652 query = query.arg(
14653 "patterns",
14654 patterns
14655 .into_iter()
14656 .map(|i| i.into())
14657 .collect::<Vec<String>>(),
14658 );
14659 ModuleSource {
14660 proc: self.proc.clone(),
14661 selection: query,
14662 graphql_client: self.graphql_client.clone(),
14663 }
14664 }
14665 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
14671 let mut query = self.selection.select("withSDK");
14672 query = query.arg("source", source.into());
14673 ModuleSource {
14674 proc: self.proc.clone(),
14675 selection: query,
14676 graphql_client: self.graphql_client.clone(),
14677 }
14678 }
14679 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
14685 let mut query = self.selection.select("withEngineVersion");
14686 query = query.arg("version", version.into());
14687 ModuleSource {
14688 proc: self.proc.clone(),
14689 selection: query,
14690 graphql_client: self.graphql_client.clone(),
14691 }
14692 }
14693 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
14699 let mut query = self.selection.select("withDependencies");
14700 query = query.arg("dependencies", dependencies);
14701 ModuleSource {
14702 proc: self.proc.clone(),
14703 selection: query,
14704 graphql_client: self.graphql_client.clone(),
14705 }
14706 }
14707 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14713 let mut query = self.selection.select("withUpdateDependencies");
14714 query = query.arg(
14715 "dependencies",
14716 dependencies
14717 .into_iter()
14718 .map(|i| i.into())
14719 .collect::<Vec<String>>(),
14720 );
14721 ModuleSource {
14722 proc: self.proc.clone(),
14723 selection: query,
14724 graphql_client: self.graphql_client.clone(),
14725 }
14726 }
14727 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14733 let mut query = self.selection.select("withoutDependencies");
14734 query = query.arg(
14735 "dependencies",
14736 dependencies
14737 .into_iter()
14738 .map(|i| i.into())
14739 .collect::<Vec<String>>(),
14740 );
14741 ModuleSource {
14742 proc: self.proc.clone(),
14743 selection: query,
14744 graphql_client: self.graphql_client.clone(),
14745 }
14746 }
14747 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
14753 let mut query = self.selection.select("withBlueprint");
14754 query = query.arg_lazy(
14755 "blueprint",
14756 Box::new(move || {
14757 let blueprint = blueprint.clone();
14758 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
14759 }),
14760 );
14761 ModuleSource {
14762 proc: self.proc.clone(),
14763 selection: query,
14764 graphql_client: self.graphql_client.clone(),
14765 }
14766 }
14767 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
14773 let mut query = self.selection.select("withToolchains");
14774 query = query.arg("toolchains", toolchains);
14775 ModuleSource {
14776 proc: self.proc.clone(),
14777 selection: query,
14778 graphql_client: self.graphql_client.clone(),
14779 }
14780 }
14781 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14787 let mut query = self.selection.select("withUpdateToolchains");
14788 query = query.arg(
14789 "toolchains",
14790 toolchains
14791 .into_iter()
14792 .map(|i| i.into())
14793 .collect::<Vec<String>>(),
14794 );
14795 ModuleSource {
14796 proc: self.proc.clone(),
14797 selection: query,
14798 graphql_client: self.graphql_client.clone(),
14799 }
14800 }
14801 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
14807 let mut query = self.selection.select("withoutToolchains");
14808 query = query.arg(
14809 "toolchains",
14810 toolchains
14811 .into_iter()
14812 .map(|i| i.into())
14813 .collect::<Vec<String>>(),
14814 );
14815 ModuleSource {
14816 proc: self.proc.clone(),
14817 selection: query,
14818 graphql_client: self.graphql_client.clone(),
14819 }
14820 }
14821 pub fn with_update_blueprint(&self) -> ModuleSource {
14823 let query = self.selection.select("withUpdateBlueprint");
14824 ModuleSource {
14825 proc: self.proc.clone(),
14826 selection: query,
14827 graphql_client: self.graphql_client.clone(),
14828 }
14829 }
14830 pub fn without_blueprint(&self) -> ModuleSource {
14832 let query = self.selection.select("withoutBlueprint");
14833 ModuleSource {
14834 proc: self.proc.clone(),
14835 selection: query,
14836 graphql_client: self.graphql_client.clone(),
14837 }
14838 }
14839 pub fn with_experimental_features(
14845 &self,
14846 features: Vec<ModuleSourceExperimentalFeature>,
14847 ) -> ModuleSource {
14848 let mut query = self.selection.select("withExperimentalFeatures");
14849 query = query.arg("features", features);
14850 ModuleSource {
14851 proc: self.proc.clone(),
14852 selection: query,
14853 graphql_client: self.graphql_client.clone(),
14854 }
14855 }
14856 pub fn without_experimental_features(
14862 &self,
14863 features: Vec<ModuleSourceExperimentalFeature>,
14864 ) -> ModuleSource {
14865 let mut query = self.selection.select("withoutExperimentalFeatures");
14866 query = query.arg("features", features);
14867 ModuleSource {
14868 proc: self.proc.clone(),
14869 selection: query,
14870 graphql_client: self.graphql_client.clone(),
14871 }
14872 }
14873 pub fn generated_context_directory(&self) -> Directory {
14875 let query = self.selection.select("generatedContextDirectory");
14876 Directory {
14877 proc: self.proc.clone(),
14878 selection: query,
14879 graphql_client: self.graphql_client.clone(),
14880 }
14881 }
14882 pub fn updated_config_directory(&self) -> Directory {
14885 let query = self.selection.select("updatedConfigDirectory");
14886 Directory {
14887 proc: self.proc.clone(),
14888 selection: query,
14889 graphql_client: self.graphql_client.clone(),
14890 }
14891 }
14892 pub fn generated_context_changeset(&self) -> Changeset {
14894 let query = self.selection.select("generatedContextChangeset");
14895 Changeset {
14896 proc: self.proc.clone(),
14897 selection: query,
14898 graphql_client: self.graphql_client.clone(),
14899 }
14900 }
14901 pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
14908 let mut query = self.selection.select("generate");
14909 query = query.arg_lazy(
14910 "workspace",
14911 Box::new(move || {
14912 let workspace = workspace.clone();
14913 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
14914 }),
14915 );
14916 Workspace {
14917 proc: self.proc.clone(),
14918 selection: query,
14919 graphql_client: self.graphql_client.clone(),
14920 }
14921 }
14922 pub async fn as_string(&self) -> Result<String, DaggerError> {
14924 let query = self.selection.select("asString");
14925 query.execute(self.graphql_client.clone()).await
14926 }
14927 pub async fn pin(&self) -> Result<String, DaggerError> {
14929 let query = self.selection.select("pin");
14930 query.execute(self.graphql_client.clone()).await
14931 }
14932 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
14934 let query = self.selection.select("localContextDirectoryPath");
14935 query.execute(self.graphql_client.clone()).await
14936 }
14937 pub fn as_module(&self) -> Module {
14939 let query = self.selection.select("asModule");
14940 Module {
14941 proc: self.proc.clone(),
14942 selection: query,
14943 graphql_client: self.graphql_client.clone(),
14944 }
14945 }
14946 pub fn introspection_schema_json(&self) -> File {
14950 let query = self.selection.select("introspectionSchemaJSON");
14951 File {
14952 proc: self.proc.clone(),
14953 selection: query,
14954 graphql_client: self.graphql_client.clone(),
14955 }
14956 }
14957 pub fn client_schema_introspection_json(&self) -> File {
14960 let query = self.selection.select("clientSchemaIntrospectionJSON");
14961 File {
14962 proc: self.proc.clone(),
14963 selection: query,
14964 graphql_client: self.graphql_client.clone(),
14965 }
14966 }
14967 pub fn directory(&self, path: impl Into<String>) -> Directory {
14973 let mut query = self.selection.select("directory");
14974 query = query.arg("path", path.into());
14975 Directory {
14976 proc: self.proc.clone(),
14977 selection: query,
14978 graphql_client: self.graphql_client.clone(),
14979 }
14980 }
14981 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
14983 let query = self.selection.select("cloneRef");
14984 query.execute(self.graphql_client.clone()).await
14985 }
14986 pub async fn html_url(&self) -> Result<String, DaggerError> {
14988 let query = self.selection.select("htmlURL");
14989 query.execute(self.graphql_client.clone()).await
14990 }
14991 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
14993 let query = self.selection.select("htmlRepoURL");
14994 query.execute(self.graphql_client.clone()).await
14995 }
14996 pub async fn version(&self) -> Result<String, DaggerError> {
14998 let query = self.selection.select("version");
14999 query.execute(self.graphql_client.clone()).await
15000 }
15001 pub async fn commit(&self) -> Result<String, DaggerError> {
15003 let query = self.selection.select("commit");
15004 query.execute(self.graphql_client.clone()).await
15005 }
15006 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
15008 let query = self.selection.select("repoRootPath");
15009 query.execute(self.graphql_client.clone()).await
15010 }
15011 pub fn with_client(
15018 &self,
15019 generator: impl Into<String>,
15020 output_dir: impl Into<String>,
15021 ) -> ModuleSource {
15022 let mut query = self.selection.select("withClient");
15023 query = query.arg("generator", generator.into());
15024 query = query.arg("outputDir", output_dir.into());
15025 ModuleSource {
15026 proc: self.proc.clone(),
15027 selection: query,
15028 graphql_client: self.graphql_client.clone(),
15029 }
15030 }
15031 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
15037 let mut query = self.selection.select("withUpdatedClients");
15038 query = query.arg(
15039 "clients",
15040 clients
15041 .into_iter()
15042 .map(|i| i.into())
15043 .collect::<Vec<String>>(),
15044 );
15045 ModuleSource {
15046 proc: self.proc.clone(),
15047 selection: query,
15048 graphql_client: self.graphql_client.clone(),
15049 }
15050 }
15051 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
15057 let mut query = self.selection.select("withoutClient");
15058 query = query.arg("path", path.into());
15059 ModuleSource {
15060 proc: self.proc.clone(),
15061 selection: query,
15062 graphql_client: self.graphql_client.clone(),
15063 }
15064 }
15065 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
15067 let query = self.selection.select("configExists");
15068 query.execute(self.graphql_client.clone()).await
15069 }
15070 pub async fn module_name(&self) -> Result<String, DaggerError> {
15072 let query = self.selection.select("moduleName");
15073 query.execute(self.graphql_client.clone()).await
15074 }
15075 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
15077 let query = self.selection.select("moduleOriginalName");
15078 query.execute(self.graphql_client.clone()).await
15079 }
15080 pub async fn engine_version(&self) -> Result<String, DaggerError> {
15082 let query = self.selection.select("engineVersion");
15083 query.execute(self.graphql_client.clone()).await
15084 }
15085 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
15087 let query = self.selection.select("sdk");
15088 let query = query.select("id");
15089 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15090 Ok(id.map(|id| SdkConfig {
15091 proc: self.proc.clone(),
15092 selection: query
15093 .root()
15094 .select("node")
15095 .arg("id", &id.0)
15096 .inline_fragment("SDKConfig"),
15097 graphql_client: self.graphql_client.clone(),
15098 }))
15099 }
15100 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15102 let query = self.selection.select("dependencies");
15103 let query = query.select("id");
15104 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15105 Ok(ids
15106 .into_iter()
15107 .map(|id| ModuleSource {
15108 proc: self.proc.clone(),
15109 selection: crate::querybuilder::query()
15110 .select("node")
15111 .arg("id", &id.0)
15112 .inline_fragment("ModuleSource"),
15113 graphql_client: self.graphql_client.clone(),
15114 })
15115 .collect())
15116 }
15117 pub fn blueprint(&self) -> ModuleSource {
15119 let query = self.selection.select("blueprint");
15120 ModuleSource {
15121 proc: self.proc.clone(),
15122 selection: query,
15123 graphql_client: self.graphql_client.clone(),
15124 }
15125 }
15126 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15128 let query = self.selection.select("toolchains");
15129 let query = query.select("id");
15130 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15131 Ok(ids
15132 .into_iter()
15133 .map(|id| ModuleSource {
15134 proc: self.proc.clone(),
15135 selection: crate::querybuilder::query()
15136 .select("node")
15137 .arg("id", &id.0)
15138 .inline_fragment("ModuleSource"),
15139 graphql_client: self.graphql_client.clone(),
15140 })
15141 .collect())
15142 }
15143 pub fn user_defaults(&self) -> EnvFile {
15145 let query = self.selection.select("userDefaults");
15146 EnvFile {
15147 proc: self.proc.clone(),
15148 selection: query,
15149 graphql_client: self.graphql_client.clone(),
15150 }
15151 }
15152 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
15154 let query = self.selection.select("configClients");
15155 let query = query.select("id");
15156 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15157 Ok(ids
15158 .into_iter()
15159 .map(|id| ModuleConfigClient {
15160 proc: self.proc.clone(),
15161 selection: crate::querybuilder::query()
15162 .select("node")
15163 .arg("id", &id.0)
15164 .inline_fragment("ModuleConfigClient"),
15165 graphql_client: self.graphql_client.clone(),
15166 })
15167 .collect())
15168 }
15169 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
15171 let query = self.selection.select("sourceRootSubpath");
15172 query.execute(self.graphql_client.clone()).await
15173 }
15174 pub fn context_directory(&self) -> Directory {
15176 let query = self.selection.select("contextDirectory");
15177 Directory {
15178 proc: self.proc.clone(),
15179 selection: query,
15180 graphql_client: self.graphql_client.clone(),
15181 }
15182 }
15183 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
15185 let query = self.selection.select("kind");
15186 query.execute(self.graphql_client.clone()).await
15187 }
15188}
15189impl Node for ModuleSource {
15190 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15191 let query = self.selection.select("id");
15192 let graphql_client = self.graphql_client.clone();
15193 async move { query.execute(graphql_client).await }
15194 }
15195}
15196impl Syncer for ModuleSource {
15197 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15198 let query = self.selection.select("id");
15199 let graphql_client = self.graphql_client.clone();
15200 async move { query.execute(graphql_client).await }
15201 }
15202 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15203 let query = self.selection.select("sync");
15204 let proc = self.proc.clone();
15205 let graphql_client = self.graphql_client.clone();
15206 async move {
15207 let id: Id = query.execute(graphql_client.clone()).await?;
15208 Ok(Self {
15209 proc,
15210 selection: query
15211 .root()
15212 .select("node")
15213 .arg("id", &id.0)
15214 .inline_fragment("ModuleSource"),
15215 graphql_client,
15216 })
15217 }
15218 }
15219}
15220#[derive(Clone)]
15221pub struct ObjectTypeDef {
15222 pub proc: Option<Arc<DaggerSessionProc>>,
15223 pub selection: Selection,
15224 pub graphql_client: DynGraphQLClient,
15225}
15226impl IntoID<Id> for ObjectTypeDef {
15227 fn into_id(
15228 self,
15229 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15230 Box::pin(async move { self.id().await })
15231 }
15232}
15233impl Loadable for ObjectTypeDef {
15234 fn graphql_type() -> &'static str {
15235 "ObjectTypeDef"
15236 }
15237 fn from_query(
15238 proc: Option<Arc<DaggerSessionProc>>,
15239 selection: Selection,
15240 graphql_client: DynGraphQLClient,
15241 ) -> Self {
15242 Self {
15243 proc,
15244 selection,
15245 graphql_client,
15246 }
15247 }
15248}
15249impl ObjectTypeDef {
15250 pub async fn id(&self) -> Result<Id, DaggerError> {
15252 let query = self.selection.select("id");
15253 query.execute(self.graphql_client.clone()).await
15254 }
15255 pub async fn name(&self) -> Result<String, DaggerError> {
15257 let query = self.selection.select("name");
15258 query.execute(self.graphql_client.clone()).await
15259 }
15260 pub async fn description(&self) -> Result<String, DaggerError> {
15262 let query = self.selection.select("description");
15263 query.execute(self.graphql_client.clone()).await
15264 }
15265 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
15267 let query = self.selection.select("sourceMap");
15268 let query = query.select("id");
15269 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15270 Ok(id.map(|id| SourceMap {
15271 proc: self.proc.clone(),
15272 selection: query
15273 .root()
15274 .select("node")
15275 .arg("id", &id.0)
15276 .inline_fragment("SourceMap"),
15277 graphql_client: self.graphql_client.clone(),
15278 }))
15279 }
15280 pub async fn deprecated(&self) -> Result<String, DaggerError> {
15282 let query = self.selection.select("deprecated");
15283 query.execute(self.graphql_client.clone()).await
15284 }
15285 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15287 let query = self.selection.select("sourceModuleName");
15288 query.execute(self.graphql_client.clone()).await
15289 }
15290 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
15292 let query = self.selection.select("fields");
15293 let query = query.select("id");
15294 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15295 Ok(ids
15296 .into_iter()
15297 .map(|id| FieldTypeDef {
15298 proc: self.proc.clone(),
15299 selection: crate::querybuilder::query()
15300 .select("node")
15301 .arg("id", &id.0)
15302 .inline_fragment("FieldTypeDef"),
15303 graphql_client: self.graphql_client.clone(),
15304 })
15305 .collect())
15306 }
15307 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
15309 let query = self.selection.select("functions");
15310 let query = query.select("id");
15311 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15312 Ok(ids
15313 .into_iter()
15314 .map(|id| Function {
15315 proc: self.proc.clone(),
15316 selection: crate::querybuilder::query()
15317 .select("node")
15318 .arg("id", &id.0)
15319 .inline_fragment("Function"),
15320 graphql_client: self.graphql_client.clone(),
15321 })
15322 .collect())
15323 }
15324 pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
15326 let query = self.selection.select("constructor");
15327 let query = query.select("id");
15328 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15329 Ok(id.map(|id| Function {
15330 proc: self.proc.clone(),
15331 selection: query
15332 .root()
15333 .select("node")
15334 .arg("id", &id.0)
15335 .inline_fragment("Function"),
15336 graphql_client: self.graphql_client.clone(),
15337 }))
15338 }
15339}
15340impl Node for ObjectTypeDef {
15341 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15342 let query = self.selection.select("id");
15343 let graphql_client = self.graphql_client.clone();
15344 async move { query.execute(graphql_client).await }
15345 }
15346}
15347#[derive(Clone)]
15348pub struct Port {
15349 pub proc: Option<Arc<DaggerSessionProc>>,
15350 pub selection: Selection,
15351 pub graphql_client: DynGraphQLClient,
15352}
15353impl IntoID<Id> for Port {
15354 fn into_id(
15355 self,
15356 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15357 Box::pin(async move { self.id().await })
15358 }
15359}
15360impl Loadable for Port {
15361 fn graphql_type() -> &'static str {
15362 "Port"
15363 }
15364 fn from_query(
15365 proc: Option<Arc<DaggerSessionProc>>,
15366 selection: Selection,
15367 graphql_client: DynGraphQLClient,
15368 ) -> Self {
15369 Self {
15370 proc,
15371 selection,
15372 graphql_client,
15373 }
15374 }
15375}
15376impl Port {
15377 pub async fn id(&self) -> Result<Id, DaggerError> {
15379 let query = self.selection.select("id");
15380 query.execute(self.graphql_client.clone()).await
15381 }
15382 pub async fn port(&self) -> Result<isize, DaggerError> {
15384 let query = self.selection.select("port");
15385 query.execute(self.graphql_client.clone()).await
15386 }
15387 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
15389 let query = self.selection.select("protocol");
15390 query.execute(self.graphql_client.clone()).await
15391 }
15392 pub async fn description(&self) -> Result<String, DaggerError> {
15394 let query = self.selection.select("description");
15395 query.execute(self.graphql_client.clone()).await
15396 }
15397 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
15399 let query = self.selection.select("experimentalSkipHealthcheck");
15400 query.execute(self.graphql_client.clone()).await
15401 }
15402}
15403impl Node for Port {
15404 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15405 let query = self.selection.select("id");
15406 let graphql_client = self.graphql_client.clone();
15407 async move { query.execute(graphql_client).await }
15408 }
15409}
15410#[derive(Clone)]
15411pub struct Query {
15412 pub proc: Option<Arc<DaggerSessionProc>>,
15413 pub selection: Selection,
15414 pub graphql_client: DynGraphQLClient,
15415}
15416#[derive(Builder, Debug, PartialEq)]
15417pub struct QueryFileOpts {
15418 #[builder(setter(into, strip_option), default)]
15420 pub permissions: Option<isize>,
15421}
15422#[derive(Builder, Debug, PartialEq)]
15423pub struct QueryBlobOpts {
15424 #[builder(setter(into, strip_option), default)]
15426 pub permissions: Option<isize>,
15427}
15428#[derive(Builder, Debug, PartialEq)]
15429pub struct QueryGitOpts<'a> {
15430 #[builder(setter(into, strip_option), default)]
15432 pub experimental_service_host: Option<Id>,
15433 #[builder(setter(into, strip_option), default)]
15435 pub http_auth_header: Option<Id>,
15436 #[builder(setter(into, strip_option), default)]
15438 pub http_auth_token: Option<Id>,
15439 #[builder(setter(into, strip_option), default)]
15441 pub http_auth_username: Option<&'a str>,
15442 #[builder(setter(into, strip_option), default)]
15444 pub keep_git_dir: Option<bool>,
15445 #[builder(setter(into, strip_option), default)]
15447 pub ssh_auth_socket: Option<Id>,
15448 #[builder(setter(into, strip_option), default)]
15450 pub ssh_known_hosts: Option<&'a str>,
15451}
15452#[derive(Builder, Debug, PartialEq)]
15453pub struct QueryContainerOpts {
15454 #[builder(setter(into, strip_option), default)]
15456 pub platform: Option<Platform>,
15457}
15458#[derive(Builder, Debug, PartialEq)]
15459pub struct QueryCacheVolumeOpts<'a> {
15460 #[builder(setter(into, strip_option), default)]
15464 pub owner: Option<&'a str>,
15465 #[builder(setter(into, strip_option), default)]
15467 pub sharing: Option<CacheSharingMode>,
15468 #[builder(setter(into, strip_option), default)]
15470 pub source: Option<Id>,
15471}
15472#[derive(Builder, Debug, PartialEq)]
15473pub struct QueryEngineVolumeOpts<'a> {
15474 #[builder(setter(into, strip_option), default)]
15476 pub subdir: Option<&'a str>,
15477}
15478#[derive(Builder, Debug, PartialEq)]
15479pub struct QuerySshfsVolumeOpts<'a> {
15480 #[builder(setter(into, strip_option), default)]
15482 pub cache_key: Option<&'a str>,
15483 #[builder(setter(into, strip_option), default)]
15485 pub experimental_service_host: Option<Id>,
15486 #[builder(setter(into, strip_option), default)]
15488 pub insecure_skip_host_key_check: Option<bool>,
15489 #[builder(setter(into, strip_option), default)]
15491 pub known_hosts: Option<Id>,
15492}
15493#[derive(Builder, Debug, PartialEq)]
15494pub struct QuerySecretOpts<'a> {
15495 #[builder(setter(into, strip_option), default)]
15499 pub cache_key: Option<&'a str>,
15500}
15501#[derive(Builder, Debug, PartialEq)]
15502pub struct QueryHttpOpts<'a> {
15503 #[builder(setter(into, strip_option), default)]
15505 pub auth_header: Option<Id>,
15506 #[builder(setter(into, strip_option), default)]
15508 pub checksum: Option<&'a str>,
15509 #[builder(setter(into, strip_option), default)]
15511 pub experimental_service_host: Option<Id>,
15512 #[builder(setter(into, strip_option), default)]
15514 pub name: Option<&'a str>,
15515 #[builder(setter(into, strip_option), default)]
15517 pub permissions: Option<isize>,
15518}
15519#[derive(Builder, Debug, PartialEq)]
15520pub struct QueryModuleSourceOpts<'a> {
15521 #[builder(setter(into, strip_option), default)]
15523 pub allow_not_exists: Option<bool>,
15524 #[builder(setter(into, strip_option), default)]
15526 pub disable_find_up: Option<bool>,
15527 #[builder(setter(into, strip_option), default)]
15529 pub ref_pin: Option<&'a str>,
15530 #[builder(setter(into, strip_option), default)]
15532 pub require_kind: Option<ModuleSourceKind>,
15533 #[builder(setter(into, strip_option), default)]
15535 pub version: Option<&'a str>,
15536}
15537#[derive(Builder, Debug, PartialEq)]
15538pub struct QueryCurrentTypeDefsOpts {
15539 #[builder(setter(into, strip_option), default)]
15542 pub hide_core: Option<bool>,
15543 #[builder(setter(into, strip_option), default)]
15545 pub return_all_types: Option<bool>,
15546}
15547#[derive(Builder, Debug, PartialEq)]
15548pub struct QueryServeModuleOpts<'a> {
15549 #[builder(setter(into, strip_option), default)]
15551 pub ref_pin: Option<&'a str>,
15552}
15553#[derive(Builder, Debug, PartialEq)]
15554pub struct QueryLlmOpts<'a> {
15555 #[builder(setter(into, strip_option), default)]
15557 pub model: Option<&'a str>,
15558 #[builder(setter(into, strip_option), default)]
15560 pub provider: Option<&'a str>,
15561}
15562#[derive(Builder, Debug, PartialEq)]
15563pub struct QueryEnvFileOpts {
15564 #[builder(setter(into, strip_option), default)]
15566 pub expand: Option<bool>,
15567}
15568impl IntoID<Id> for Query {
15569 fn into_id(
15570 self,
15571 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15572 Box::pin(async move { self.id().await })
15573 }
15574}
15575impl Loadable for Query {
15576 fn graphql_type() -> &'static str {
15577 "Query"
15578 }
15579 fn from_query(
15580 proc: Option<Arc<DaggerSessionProc>>,
15581 selection: Selection,
15582 graphql_client: DynGraphQLClient,
15583 ) -> Self {
15584 Self {
15585 proc,
15586 selection,
15587 graphql_client,
15588 }
15589 }
15590}
15591impl Query {
15592 pub async fn id(&self) -> Result<Id, DaggerError> {
15594 let query = self.selection.select("id");
15595 query.execute(self.graphql_client.clone()).await
15596 }
15597 pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
15599 let mut query = self.selection.select("node");
15600 query = query.arg_lazy(
15601 "id",
15602 Box::new(move || {
15603 let id = id.clone();
15604 Box::pin(async move { id.into_id().await.unwrap().quote() })
15605 }),
15606 );
15607 let query = query.select("id");
15608 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15609 Ok(id.map(|id| NodeClient {
15610 proc: self.proc.clone(),
15611 selection: query
15612 .root()
15613 .select("node")
15614 .arg("id", &id.0)
15615 .inline_fragment("Node"),
15616 graphql_client: self.graphql_client.clone(),
15617 }))
15618 }
15619 pub async fn version(&self) -> Result<String, DaggerError> {
15621 let query = self.selection.select("version");
15622 query.execute(self.graphql_client.clone()).await
15623 }
15624 pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
15626 let query = self.selection.select("currentTimestamp");
15627 query.execute(self.graphql_client.clone()).await
15628 }
15629 pub async fn set_session_title(&self, title: impl Into<String>) -> Result<Void, DaggerError> {
15636 let mut query = self.selection.select("setSessionTitle");
15637 query = query.arg("title", title.into());
15638 query.execute(self.graphql_client.clone()).await
15639 }
15640 pub fn directory(&self) -> Directory {
15642 let query = self.selection.select("directory");
15643 Directory {
15644 proc: self.proc.clone(),
15645 selection: query,
15646 graphql_client: self.graphql_client.clone(),
15647 }
15648 }
15649 pub fn changeset(&self) -> Changeset {
15651 let query = self.selection.select("changeset");
15652 Changeset {
15653 proc: self.proc.clone(),
15654 selection: query,
15655 graphql_client: self.graphql_client.clone(),
15656 }
15657 }
15658 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
15666 let mut query = self.selection.select("file");
15667 query = query.arg("name", name.into());
15668 query = query.arg("contents", contents.into());
15669 File {
15670 proc: self.proc.clone(),
15671 selection: query,
15672 graphql_client: self.graphql_client.clone(),
15673 }
15674 }
15675 pub fn file_opts(
15683 &self,
15684 name: impl Into<String>,
15685 contents: impl Into<String>,
15686 opts: QueryFileOpts,
15687 ) -> File {
15688 let mut query = self.selection.select("file");
15689 query = query.arg("name", name.into());
15690 query = query.arg("contents", contents.into());
15691 if let Some(permissions) = opts.permissions {
15692 query = query.arg("permissions", permissions);
15693 }
15694 File {
15695 proc: self.proc.clone(),
15696 selection: query,
15697 graphql_client: self.graphql_client.clone(),
15698 }
15699 }
15700 pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
15708 let mut query = self.selection.select("blob");
15709 query = query.arg("name", name.into());
15710 query = query.arg("contents", contents);
15711 File {
15712 proc: self.proc.clone(),
15713 selection: query,
15714 graphql_client: self.graphql_client.clone(),
15715 }
15716 }
15717 pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
15725 let mut query = self.selection.select("blob");
15726 query = query.arg("name", name.into());
15727 query = query.arg("contents", contents);
15728 if let Some(permissions) = opts.permissions {
15729 query = query.arg("permissions", permissions);
15730 }
15731 File {
15732 proc: self.proc.clone(),
15733 selection: query,
15734 graphql_client: self.graphql_client.clone(),
15735 }
15736 }
15737 pub fn git(&self, url: impl Into<String>) -> GitRepository {
15748 let mut query = self.selection.select("git");
15749 query = query.arg("url", url.into());
15750 GitRepository {
15751 proc: self.proc.clone(),
15752 selection: query,
15753 graphql_client: self.graphql_client.clone(),
15754 }
15755 }
15756 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
15767 let mut query = self.selection.select("git");
15768 query = query.arg("url", url.into());
15769 if let Some(keep_git_dir) = opts.keep_git_dir {
15770 query = query.arg("keepGitDir", keep_git_dir);
15771 }
15772 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
15773 query = query.arg("sshKnownHosts", ssh_known_hosts);
15774 }
15775 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
15776 query = query.arg("sshAuthSocket", ssh_auth_socket);
15777 }
15778 if let Some(http_auth_username) = opts.http_auth_username {
15779 query = query.arg("httpAuthUsername", http_auth_username);
15780 }
15781 if let Some(http_auth_token) = opts.http_auth_token {
15782 query = query.arg("httpAuthToken", http_auth_token);
15783 }
15784 if let Some(http_auth_header) = opts.http_auth_header {
15785 query = query.arg("httpAuthHeader", http_auth_header);
15786 }
15787 if let Some(experimental_service_host) = opts.experimental_service_host {
15788 query = query.arg("experimentalServiceHost", experimental_service_host);
15789 }
15790 GitRepository {
15791 proc: self.proc.clone(),
15792 selection: query,
15793 graphql_client: self.graphql_client.clone(),
15794 }
15795 }
15796 pub fn container(&self) -> Container {
15803 let query = self.selection.select("container");
15804 Container {
15805 proc: self.proc.clone(),
15806 selection: query,
15807 graphql_client: self.graphql_client.clone(),
15808 }
15809 }
15810 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
15817 let mut query = self.selection.select("container");
15818 if let Some(platform) = opts.platform {
15819 query = query.arg("platform", platform);
15820 }
15821 Container {
15822 proc: self.proc.clone(),
15823 selection: query,
15824 graphql_client: self.graphql_client.clone(),
15825 }
15826 }
15827 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
15834 let mut query = self.selection.select("cacheVolume");
15835 query = query.arg("key", key.into());
15836 CacheVolume {
15837 proc: self.proc.clone(),
15838 selection: query,
15839 graphql_client: self.graphql_client.clone(),
15840 }
15841 }
15842 pub fn cache_volume_opts<'a>(
15849 &self,
15850 key: impl Into<String>,
15851 opts: QueryCacheVolumeOpts<'a>,
15852 ) -> CacheVolume {
15853 let mut query = self.selection.select("cacheVolume");
15854 query = query.arg("key", key.into());
15855 if let Some(source) = opts.source {
15856 query = query.arg("source", source);
15857 }
15858 if let Some(sharing) = opts.sharing {
15859 query = query.arg("sharing", sharing);
15860 }
15861 if let Some(owner) = opts.owner {
15862 query = query.arg("owner", owner);
15863 }
15864 CacheVolume {
15865 proc: self.proc.clone(),
15866 selection: query,
15867 graphql_client: self.graphql_client.clone(),
15868 }
15869 }
15870 pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
15877 let mut query = self.selection.select("engineVolume");
15878 query = query.arg("name", name.into());
15879 Volume {
15880 proc: self.proc.clone(),
15881 selection: query,
15882 graphql_client: self.graphql_client.clone(),
15883 }
15884 }
15885 pub fn engine_volume_opts<'a>(
15892 &self,
15893 name: impl Into<String>,
15894 opts: QueryEngineVolumeOpts<'a>,
15895 ) -> Volume {
15896 let mut query = self.selection.select("engineVolume");
15897 query = query.arg("name", name.into());
15898 if let Some(subdir) = opts.subdir {
15899 query = query.arg("subdir", subdir);
15900 }
15901 Volume {
15902 proc: self.proc.clone(),
15903 selection: query,
15904 graphql_client: self.graphql_client.clone(),
15905 }
15906 }
15907 pub fn sshfs_volume(
15915 &self,
15916 endpoint: impl Into<String>,
15917 private_key: impl IntoID<Id>,
15918 ) -> Volume {
15919 let mut query = self.selection.select("sshfsVolume");
15920 query = query.arg("endpoint", endpoint.into());
15921 query = query.arg_lazy(
15922 "privateKey",
15923 Box::new(move || {
15924 let private_key = private_key.clone();
15925 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15926 }),
15927 );
15928 Volume {
15929 proc: self.proc.clone(),
15930 selection: query,
15931 graphql_client: self.graphql_client.clone(),
15932 }
15933 }
15934 pub fn sshfs_volume_opts<'a>(
15942 &self,
15943 endpoint: impl Into<String>,
15944 private_key: impl IntoID<Id>,
15945 opts: QuerySshfsVolumeOpts<'a>,
15946 ) -> Volume {
15947 let mut query = self.selection.select("sshfsVolume");
15948 query = query.arg("endpoint", endpoint.into());
15949 query = query.arg_lazy(
15950 "privateKey",
15951 Box::new(move || {
15952 let private_key = private_key.clone();
15953 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
15954 }),
15955 );
15956 if let Some(known_hosts) = opts.known_hosts {
15957 query = query.arg("knownHosts", known_hosts);
15958 }
15959 if let Some(cache_key) = opts.cache_key {
15960 query = query.arg("cacheKey", cache_key);
15961 }
15962 if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
15963 query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
15964 }
15965 if let Some(experimental_service_host) = opts.experimental_service_host {
15966 query = query.arg("experimentalServiceHost", experimental_service_host);
15967 }
15968 Volume {
15969 proc: self.proc.clone(),
15970 selection: query,
15971 graphql_client: self.graphql_client.clone(),
15972 }
15973 }
15974 pub fn secret(&self, uri: impl Into<String>) -> Secret {
15981 let mut query = self.selection.select("secret");
15982 query = query.arg("uri", uri.into());
15983 Secret {
15984 proc: self.proc.clone(),
15985 selection: query,
15986 graphql_client: self.graphql_client.clone(),
15987 }
15988 }
15989 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
15996 let mut query = self.selection.select("secret");
15997 query = query.arg("uri", uri.into());
15998 if let Some(cache_key) = opts.cache_key {
15999 query = query.arg("cacheKey", cache_key);
16000 }
16001 Secret {
16002 proc: self.proc.clone(),
16003 selection: query,
16004 graphql_client: self.graphql_client.clone(),
16005 }
16006 }
16007 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
16015 let mut query = self.selection.select("setSecret");
16016 query = query.arg("name", name.into());
16017 query = query.arg("plaintext", plaintext.into());
16018 Secret {
16019 proc: self.proc.clone(),
16020 selection: query,
16021 graphql_client: self.graphql_client.clone(),
16022 }
16023 }
16024 pub fn host(&self) -> Host {
16026 let query = self.selection.select("host");
16027 Host {
16028 proc: self.proc.clone(),
16029 selection: query,
16030 graphql_client: self.graphql_client.clone(),
16031 }
16032 }
16033 pub fn http(&self, url: impl Into<String>) -> File {
16040 let mut query = self.selection.select("http");
16041 query = query.arg("url", url.into());
16042 File {
16043 proc: self.proc.clone(),
16044 selection: query,
16045 graphql_client: self.graphql_client.clone(),
16046 }
16047 }
16048 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
16055 let mut query = self.selection.select("http");
16056 query = query.arg("url", url.into());
16057 if let Some(name) = opts.name {
16058 query = query.arg("name", name);
16059 }
16060 if let Some(permissions) = opts.permissions {
16061 query = query.arg("permissions", permissions);
16062 }
16063 if let Some(checksum) = opts.checksum {
16064 query = query.arg("checksum", checksum);
16065 }
16066 if let Some(auth_header) = opts.auth_header {
16067 query = query.arg("authHeader", auth_header);
16068 }
16069 if let Some(experimental_service_host) = opts.experimental_service_host {
16070 query = query.arg("experimentalServiceHost", experimental_service_host);
16071 }
16072 File {
16073 proc: self.proc.clone(),
16074 selection: query,
16075 graphql_client: self.graphql_client.clone(),
16076 }
16077 }
16078 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
16080 let query = self.selection.select("defaultPlatform");
16081 query.execute(self.graphql_client.clone()).await
16082 }
16083 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
16090 let mut query = self.selection.select("moduleSource");
16091 query = query.arg("refString", ref_string.into());
16092 ModuleSource {
16093 proc: self.proc.clone(),
16094 selection: query,
16095 graphql_client: self.graphql_client.clone(),
16096 }
16097 }
16098 pub fn module_source_opts<'a>(
16105 &self,
16106 ref_string: impl Into<String>,
16107 opts: QueryModuleSourceOpts<'a>,
16108 ) -> ModuleSource {
16109 let mut query = self.selection.select("moduleSource");
16110 query = query.arg("refString", ref_string.into());
16111 if let Some(version) = opts.version {
16112 query = query.arg("version", version);
16113 }
16114 if let Some(ref_pin) = opts.ref_pin {
16115 query = query.arg("refPin", ref_pin);
16116 }
16117 if let Some(disable_find_up) = opts.disable_find_up {
16118 query = query.arg("disableFindUp", disable_find_up);
16119 }
16120 if let Some(allow_not_exists) = opts.allow_not_exists {
16121 query = query.arg("allowNotExists", allow_not_exists);
16122 }
16123 if let Some(require_kind) = opts.require_kind {
16124 query = query.arg("requireKind", require_kind);
16125 }
16126 ModuleSource {
16127 proc: self.proc.clone(),
16128 selection: query,
16129 graphql_client: self.graphql_client.clone(),
16130 }
16131 }
16132 pub fn module(&self) -> Module {
16134 let query = self.selection.select("module");
16135 Module {
16136 proc: self.proc.clone(),
16137 selection: query,
16138 graphql_client: self.graphql_client.clone(),
16139 }
16140 }
16141 pub fn type_def(&self) -> TypeDef {
16143 let query = self.selection.select("typeDef");
16144 TypeDef {
16145 proc: self.proc.clone(),
16146 selection: query,
16147 graphql_client: self.graphql_client.clone(),
16148 }
16149 }
16150 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
16152 let mut query = self.selection.select("generatedCode");
16153 query = query.arg_lazy(
16154 "code",
16155 Box::new(move || {
16156 let code = code.clone();
16157 Box::pin(async move { code.into_id().await.unwrap().quote() })
16158 }),
16159 );
16160 GeneratedCode {
16161 proc: self.proc.clone(),
16162 selection: query,
16163 graphql_client: self.graphql_client.clone(),
16164 }
16165 }
16166 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
16173 let mut query = self.selection.select("function");
16174 query = query.arg("name", name.into());
16175 query = query.arg_lazy(
16176 "returnType",
16177 Box::new(move || {
16178 let return_type = return_type.clone();
16179 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
16180 }),
16181 );
16182 Function {
16183 proc: self.proc.clone(),
16184 selection: query,
16185 graphql_client: self.graphql_client.clone(),
16186 }
16187 }
16188 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
16196 let mut query = self.selection.select("sourceMap");
16197 query = query.arg("filename", filename.into());
16198 query = query.arg("line", line);
16199 query = query.arg("column", column);
16200 SourceMap {
16201 proc: self.proc.clone(),
16202 selection: query,
16203 graphql_client: self.graphql_client.clone(),
16204 }
16205 }
16206 pub fn current_module(&self) -> CurrentModule {
16208 let query = self.selection.select("currentModule");
16209 CurrentModule {
16210 proc: self.proc.clone(),
16211 selection: query,
16212 graphql_client: self.graphql_client.clone(),
16213 }
16214 }
16215 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
16221 let query = self.selection.select("currentTypeDefs");
16222 let query = query.select("id");
16223 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16224 Ok(ids
16225 .into_iter()
16226 .map(|id| TypeDef {
16227 proc: self.proc.clone(),
16228 selection: crate::querybuilder::query()
16229 .select("node")
16230 .arg("id", &id.0)
16231 .inline_fragment("TypeDef"),
16232 graphql_client: self.graphql_client.clone(),
16233 })
16234 .collect())
16235 }
16236 pub async fn current_type_defs_opts(
16242 &self,
16243 opts: QueryCurrentTypeDefsOpts,
16244 ) -> Result<Vec<TypeDef>, DaggerError> {
16245 let mut query = self.selection.select("currentTypeDefs");
16246 if let Some(return_all_types) = opts.return_all_types {
16247 query = query.arg("returnAllTypes", return_all_types);
16248 }
16249 if let Some(hide_core) = opts.hide_core {
16250 query = query.arg("hideCore", hide_core);
16251 }
16252 let query = query.select("id");
16253 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16254 Ok(ids
16255 .into_iter()
16256 .map(|id| TypeDef {
16257 proc: self.proc.clone(),
16258 selection: crate::querybuilder::query()
16259 .select("node")
16260 .arg("id", &id.0)
16261 .inline_fragment("TypeDef"),
16262 graphql_client: self.graphql_client.clone(),
16263 })
16264 .collect())
16265 }
16266 pub fn current_function_call(&self) -> FunctionCall {
16269 let query = self.selection.select("currentFunctionCall");
16270 FunctionCall {
16271 proc: self.proc.clone(),
16272 selection: query,
16273 graphql_client: self.graphql_client.clone(),
16274 }
16275 }
16276 pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
16288 let mut query = self.selection.select("serveModule");
16289 query = query.arg("address", address.into());
16290 query.execute(self.graphql_client.clone()).await
16291 }
16292 pub async fn serve_module_opts<'a>(
16304 &self,
16305 address: impl Into<String>,
16306 opts: QueryServeModuleOpts<'a>,
16307 ) -> Result<Void, DaggerError> {
16308 let mut query = self.selection.select("serveModule");
16309 query = query.arg("address", address.into());
16310 if let Some(ref_pin) = opts.ref_pin {
16311 query = query.arg("refPin", ref_pin);
16312 }
16313 query.execute(self.graphql_client.clone()).await
16314 }
16315 pub fn current_node(&self) -> NodeClient {
16317 let query = self.selection.select("currentNode");
16318 NodeClient {
16319 proc: self.proc.clone(),
16320 selection: query,
16321 graphql_client: self.graphql_client.clone(),
16322 }
16323 }
16324 pub fn error(&self, message: impl Into<String>) -> Error {
16330 let mut query = self.selection.select("error");
16331 query = query.arg("message", message.into());
16332 Error {
16333 proc: self.proc.clone(),
16334 selection: query,
16335 graphql_client: self.graphql_client.clone(),
16336 }
16337 }
16338 pub fn engine(&self) -> Engine {
16340 let query = self.selection.select("engine");
16341 Engine {
16342 proc: self.proc.clone(),
16343 selection: query,
16344 graphql_client: self.graphql_client.clone(),
16345 }
16346 }
16347 pub fn cloud(&self) -> Cloud {
16349 let query = self.selection.select("cloud");
16350 Cloud {
16351 proc: self.proc.clone(),
16352 selection: query,
16353 graphql_client: self.graphql_client.clone(),
16354 }
16355 }
16356 pub fn llm(&self) -> Llm {
16362 let query = self.selection.select("llm");
16363 Llm {
16364 proc: self.proc.clone(),
16365 selection: query,
16366 graphql_client: self.graphql_client.clone(),
16367 }
16368 }
16369 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
16375 let mut query = self.selection.select("llm");
16376 if let Some(model) = opts.model {
16377 query = query.arg("model", model);
16378 }
16379 if let Some(provider) = opts.provider {
16380 query = query.arg("provider", provider);
16381 }
16382 Llm {
16383 proc: self.proc.clone(),
16384 selection: query,
16385 graphql_client: self.graphql_client.clone(),
16386 }
16387 }
16388 pub fn llm_content(&self) -> LlmContent {
16391 let query = self.selection.select("llmContent");
16392 LlmContent {
16393 proc: self.proc.clone(),
16394 selection: query,
16395 graphql_client: self.graphql_client.clone(),
16396 }
16397 }
16398 pub fn json(&self) -> JsonValue {
16400 let query = self.selection.select("json");
16401 JsonValue {
16402 proc: self.proc.clone(),
16403 selection: query,
16404 graphql_client: self.graphql_client.clone(),
16405 }
16406 }
16407 pub fn schema(&self, json: Json) -> Schema {
16413 let mut query = self.selection.select("schema");
16414 query = query.arg("json", json);
16415 Schema {
16416 proc: self.proc.clone(),
16417 selection: query,
16418 graphql_client: self.graphql_client.clone(),
16419 }
16420 }
16421 pub fn env_file(&self) -> EnvFile {
16427 let query = self.selection.select("envFile");
16428 EnvFile {
16429 proc: self.proc.clone(),
16430 selection: query,
16431 graphql_client: self.graphql_client.clone(),
16432 }
16433 }
16434 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
16440 let mut query = self.selection.select("envFile");
16441 if let Some(expand) = opts.expand {
16442 query = query.arg("expand", expand);
16443 }
16444 EnvFile {
16445 proc: self.proc.clone(),
16446 selection: query,
16447 graphql_client: self.graphql_client.clone(),
16448 }
16449 }
16450 pub fn address(&self, value: impl Into<String>) -> Address {
16452 let mut query = self.selection.select("address");
16453 query = query.arg("value", value.into());
16454 Address {
16455 proc: self.proc.clone(),
16456 selection: query,
16457 graphql_client: self.graphql_client.clone(),
16458 }
16459 }
16460 pub fn current_workspace(&self) -> Workspace {
16462 let query = self.selection.select("currentWorkspace");
16463 Workspace {
16464 proc: self.proc.clone(),
16465 selection: query,
16466 graphql_client: self.graphql_client.clone(),
16467 }
16468 }
16469}
16470impl Node for Query {
16471 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16472 let query = self.selection.select("id");
16473 let graphql_client = self.graphql_client.clone();
16474 async move { query.execute(graphql_client).await }
16475 }
16476}
16477#[derive(Clone)]
16478pub struct RemoteGitMirror {
16479 pub proc: Option<Arc<DaggerSessionProc>>,
16480 pub selection: Selection,
16481 pub graphql_client: DynGraphQLClient,
16482}
16483impl IntoID<Id> for RemoteGitMirror {
16484 fn into_id(
16485 self,
16486 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16487 Box::pin(async move { self.id().await })
16488 }
16489}
16490impl Loadable for RemoteGitMirror {
16491 fn graphql_type() -> &'static str {
16492 "RemoteGitMirror"
16493 }
16494 fn from_query(
16495 proc: Option<Arc<DaggerSessionProc>>,
16496 selection: Selection,
16497 graphql_client: DynGraphQLClient,
16498 ) -> Self {
16499 Self {
16500 proc,
16501 selection,
16502 graphql_client,
16503 }
16504 }
16505}
16506impl RemoteGitMirror {
16507 pub async fn id(&self) -> Result<Id, DaggerError> {
16509 let query = self.selection.select("id");
16510 query.execute(self.graphql_client.clone()).await
16511 }
16512}
16513impl Node for RemoteGitMirror {
16514 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16515 let query = self.selection.select("id");
16516 let graphql_client = self.graphql_client.clone();
16517 async move { query.execute(graphql_client).await }
16518 }
16519}
16520#[derive(Clone)]
16521pub struct SdkConfig {
16522 pub proc: Option<Arc<DaggerSessionProc>>,
16523 pub selection: Selection,
16524 pub graphql_client: DynGraphQLClient,
16525}
16526impl IntoID<Id> for SdkConfig {
16527 fn into_id(
16528 self,
16529 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16530 Box::pin(async move { self.id().await })
16531 }
16532}
16533impl Loadable for SdkConfig {
16534 fn graphql_type() -> &'static str {
16535 "SDKConfig"
16536 }
16537 fn from_query(
16538 proc: Option<Arc<DaggerSessionProc>>,
16539 selection: Selection,
16540 graphql_client: DynGraphQLClient,
16541 ) -> Self {
16542 Self {
16543 proc,
16544 selection,
16545 graphql_client,
16546 }
16547 }
16548}
16549impl SdkConfig {
16550 pub async fn id(&self) -> Result<Id, DaggerError> {
16552 let query = self.selection.select("id");
16553 query.execute(self.graphql_client.clone()).await
16554 }
16555 pub async fn source(&self) -> Result<String, DaggerError> {
16557 let query = self.selection.select("source");
16558 query.execute(self.graphql_client.clone()).await
16559 }
16560 pub async fn debug(&self) -> Result<bool, DaggerError> {
16562 let query = self.selection.select("debug");
16563 query.execute(self.graphql_client.clone()).await
16564 }
16565}
16566impl Node for SdkConfig {
16567 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16568 let query = self.selection.select("id");
16569 let graphql_client = self.graphql_client.clone();
16570 async move { query.execute(graphql_client).await }
16571 }
16572}
16573#[derive(Clone)]
16574pub struct ScalarTypeDef {
16575 pub proc: Option<Arc<DaggerSessionProc>>,
16576 pub selection: Selection,
16577 pub graphql_client: DynGraphQLClient,
16578}
16579impl IntoID<Id> for ScalarTypeDef {
16580 fn into_id(
16581 self,
16582 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16583 Box::pin(async move { self.id().await })
16584 }
16585}
16586impl Loadable for ScalarTypeDef {
16587 fn graphql_type() -> &'static str {
16588 "ScalarTypeDef"
16589 }
16590 fn from_query(
16591 proc: Option<Arc<DaggerSessionProc>>,
16592 selection: Selection,
16593 graphql_client: DynGraphQLClient,
16594 ) -> Self {
16595 Self {
16596 proc,
16597 selection,
16598 graphql_client,
16599 }
16600 }
16601}
16602impl ScalarTypeDef {
16603 pub async fn id(&self) -> Result<Id, DaggerError> {
16605 let query = self.selection.select("id");
16606 query.execute(self.graphql_client.clone()).await
16607 }
16608 pub async fn name(&self) -> Result<String, DaggerError> {
16610 let query = self.selection.select("name");
16611 query.execute(self.graphql_client.clone()).await
16612 }
16613 pub async fn description(&self) -> Result<String, DaggerError> {
16615 let query = self.selection.select("description");
16616 query.execute(self.graphql_client.clone()).await
16617 }
16618 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
16620 let query = self.selection.select("sourceModuleName");
16621 query.execute(self.graphql_client.clone()).await
16622 }
16623}
16624impl Node for ScalarTypeDef {
16625 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16626 let query = self.selection.select("id");
16627 let graphql_client = self.graphql_client.clone();
16628 async move { query.execute(graphql_client).await }
16629 }
16630}
16631#[derive(Clone)]
16632pub struct Schema {
16633 pub proc: Option<Arc<DaggerSessionProc>>,
16634 pub selection: Selection,
16635 pub graphql_client: DynGraphQLClient,
16636}
16637impl IntoID<Id> for Schema {
16638 fn into_id(
16639 self,
16640 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16641 Box::pin(async move { self.id().await })
16642 }
16643}
16644impl Loadable for Schema {
16645 fn graphql_type() -> &'static str {
16646 "Schema"
16647 }
16648 fn from_query(
16649 proc: Option<Arc<DaggerSessionProc>>,
16650 selection: Selection,
16651 graphql_client: DynGraphQLClient,
16652 ) -> Self {
16653 Self {
16654 proc,
16655 selection,
16656 graphql_client,
16657 }
16658 }
16659}
16660impl Schema {
16661 pub async fn id(&self) -> Result<Id, DaggerError> {
16663 let query = self.selection.select("id");
16664 query.execute(self.graphql_client.clone()).await
16665 }
16666 pub async fn contents(&self) -> Result<Json, DaggerError> {
16668 let query = self.selection.select("contents");
16669 query.execute(self.graphql_client.clone()).await
16670 }
16671 pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
16678 let mut query = self.selection.select("merge");
16679 query = query.arg("moduleTypes", module_types);
16680 query = query.arg("moduleName", module_name.into());
16681 Schema {
16682 proc: self.proc.clone(),
16683 selection: query,
16684 graphql_client: self.graphql_client.clone(),
16685 }
16686 }
16687}
16688impl Node for Schema {
16689 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16690 let query = self.selection.select("id");
16691 let graphql_client = self.graphql_client.clone();
16692 async move { query.execute(graphql_client).await }
16693 }
16694}
16695#[derive(Clone)]
16696pub struct SearchResult {
16697 pub proc: Option<Arc<DaggerSessionProc>>,
16698 pub selection: Selection,
16699 pub graphql_client: DynGraphQLClient,
16700}
16701impl IntoID<Id> for SearchResult {
16702 fn into_id(
16703 self,
16704 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16705 Box::pin(async move { self.id().await })
16706 }
16707}
16708impl Loadable for SearchResult {
16709 fn graphql_type() -> &'static str {
16710 "SearchResult"
16711 }
16712 fn from_query(
16713 proc: Option<Arc<DaggerSessionProc>>,
16714 selection: Selection,
16715 graphql_client: DynGraphQLClient,
16716 ) -> Self {
16717 Self {
16718 proc,
16719 selection,
16720 graphql_client,
16721 }
16722 }
16723}
16724impl SearchResult {
16725 pub async fn id(&self) -> Result<Id, DaggerError> {
16727 let query = self.selection.select("id");
16728 query.execute(self.graphql_client.clone()).await
16729 }
16730 pub async fn file_path(&self) -> Result<String, DaggerError> {
16732 let query = self.selection.select("filePath");
16733 query.execute(self.graphql_client.clone()).await
16734 }
16735 pub async fn line_number(&self) -> Result<isize, DaggerError> {
16737 let query = self.selection.select("lineNumber");
16738 query.execute(self.graphql_client.clone()).await
16739 }
16740 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
16742 let query = self.selection.select("absoluteOffset");
16743 query.execute(self.graphql_client.clone()).await
16744 }
16745 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
16747 let query = self.selection.select("matchedLines");
16748 query.execute(self.graphql_client.clone()).await
16749 }
16750 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
16752 let query = self.selection.select("submatches");
16753 let query = query.select("id");
16754 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16755 Ok(ids
16756 .into_iter()
16757 .map(|id| SearchSubmatch {
16758 proc: self.proc.clone(),
16759 selection: crate::querybuilder::query()
16760 .select("node")
16761 .arg("id", &id.0)
16762 .inline_fragment("SearchSubmatch"),
16763 graphql_client: self.graphql_client.clone(),
16764 })
16765 .collect())
16766 }
16767}
16768impl Node for SearchResult {
16769 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16770 let query = self.selection.select("id");
16771 let graphql_client = self.graphql_client.clone();
16772 async move { query.execute(graphql_client).await }
16773 }
16774}
16775#[derive(Clone)]
16776pub struct SearchSubmatch {
16777 pub proc: Option<Arc<DaggerSessionProc>>,
16778 pub selection: Selection,
16779 pub graphql_client: DynGraphQLClient,
16780}
16781impl IntoID<Id> for SearchSubmatch {
16782 fn into_id(
16783 self,
16784 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16785 Box::pin(async move { self.id().await })
16786 }
16787}
16788impl Loadable for SearchSubmatch {
16789 fn graphql_type() -> &'static str {
16790 "SearchSubmatch"
16791 }
16792 fn from_query(
16793 proc: Option<Arc<DaggerSessionProc>>,
16794 selection: Selection,
16795 graphql_client: DynGraphQLClient,
16796 ) -> Self {
16797 Self {
16798 proc,
16799 selection,
16800 graphql_client,
16801 }
16802 }
16803}
16804impl SearchSubmatch {
16805 pub async fn id(&self) -> Result<Id, DaggerError> {
16807 let query = self.selection.select("id");
16808 query.execute(self.graphql_client.clone()).await
16809 }
16810 pub async fn text(&self) -> Result<String, DaggerError> {
16812 let query = self.selection.select("text");
16813 query.execute(self.graphql_client.clone()).await
16814 }
16815 pub async fn start(&self) -> Result<isize, DaggerError> {
16817 let query = self.selection.select("start");
16818 query.execute(self.graphql_client.clone()).await
16819 }
16820 pub async fn end(&self) -> Result<isize, DaggerError> {
16822 let query = self.selection.select("end");
16823 query.execute(self.graphql_client.clone()).await
16824 }
16825}
16826impl Node for SearchSubmatch {
16827 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16828 let query = self.selection.select("id");
16829 let graphql_client = self.graphql_client.clone();
16830 async move { query.execute(graphql_client).await }
16831 }
16832}
16833#[derive(Clone)]
16834pub struct Secret {
16835 pub proc: Option<Arc<DaggerSessionProc>>,
16836 pub selection: Selection,
16837 pub graphql_client: DynGraphQLClient,
16838}
16839impl IntoID<Id> for Secret {
16840 fn into_id(
16841 self,
16842 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16843 Box::pin(async move { self.id().await })
16844 }
16845}
16846impl Loadable for Secret {
16847 fn graphql_type() -> &'static str {
16848 "Secret"
16849 }
16850 fn from_query(
16851 proc: Option<Arc<DaggerSessionProc>>,
16852 selection: Selection,
16853 graphql_client: DynGraphQLClient,
16854 ) -> Self {
16855 Self {
16856 proc,
16857 selection,
16858 graphql_client,
16859 }
16860 }
16861}
16862impl Secret {
16863 pub async fn id(&self) -> Result<Id, DaggerError> {
16865 let query = self.selection.select("id");
16866 query.execute(self.graphql_client.clone()).await
16867 }
16868 pub async fn name(&self) -> Result<String, DaggerError> {
16870 let query = self.selection.select("name");
16871 query.execute(self.graphql_client.clone()).await
16872 }
16873 pub async fn uri(&self) -> Result<String, DaggerError> {
16875 let query = self.selection.select("uri");
16876 query.execute(self.graphql_client.clone()).await
16877 }
16878 pub async fn plaintext(&self) -> Result<String, DaggerError> {
16880 let query = self.selection.select("plaintext");
16881 query.execute(self.graphql_client.clone()).await
16882 }
16883}
16884impl Node for Secret {
16885 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16886 let query = self.selection.select("id");
16887 let graphql_client = self.graphql_client.clone();
16888 async move { query.execute(graphql_client).await }
16889 }
16890}
16891#[derive(Clone)]
16892pub struct Service {
16893 pub proc: Option<Arc<DaggerSessionProc>>,
16894 pub selection: Selection,
16895 pub graphql_client: DynGraphQLClient,
16896}
16897#[derive(Builder, Debug, PartialEq)]
16898pub struct ServicePortsOpts {
16899 #[builder(setter(into, strip_option), default)]
16901 pub declared: Option<bool>,
16902}
16903#[derive(Builder, Debug, PartialEq)]
16904pub struct ServiceEndpointOpts<'a> {
16905 #[builder(setter(into, strip_option), default)]
16907 pub port: Option<isize>,
16908 #[builder(setter(into, strip_option), default)]
16910 pub scheme: Option<&'a str>,
16911}
16912#[derive(Builder, Debug, PartialEq)]
16913pub struct ServiceUpOpts {
16914 #[builder(setter(into, strip_option), default)]
16917 pub ports: Option<Vec<PortForward>>,
16918 #[builder(setter(into, strip_option), default)]
16920 pub random: Option<bool>,
16921}
16922#[derive(Builder, Debug, PartialEq)]
16923pub struct ServiceStopOpts {
16924 #[builder(setter(into, strip_option), default)]
16926 pub kill: Option<bool>,
16927}
16928#[derive(Builder, Debug, PartialEq)]
16929pub struct ServiceTerminalOpts<'a> {
16930 #[builder(setter(into, strip_option), default)]
16931 pub cmd: Option<Vec<&'a str>>,
16932}
16933impl IntoID<Id> for Service {
16934 fn into_id(
16935 self,
16936 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16937 Box::pin(async move { self.id().await })
16938 }
16939}
16940impl Loadable for Service {
16941 fn graphql_type() -> &'static str {
16942 "Service"
16943 }
16944 fn from_query(
16945 proc: Option<Arc<DaggerSessionProc>>,
16946 selection: Selection,
16947 graphql_client: DynGraphQLClient,
16948 ) -> Self {
16949 Self {
16950 proc,
16951 selection,
16952 graphql_client,
16953 }
16954 }
16955}
16956impl Service {
16957 pub async fn id(&self) -> Result<Id, DaggerError> {
16959 let query = self.selection.select("id");
16960 query.execute(self.graphql_client.clone()).await
16961 }
16962 pub async fn sync(&self) -> Result<Service, DaggerError> {
16964 let query = self.selection.select("sync");
16965 let id: Id = query.execute(self.graphql_client.clone()).await?;
16966 Ok(Service {
16967 proc: self.proc.clone(),
16968 selection: query
16969 .root()
16970 .select("node")
16971 .arg("id", &id.0)
16972 .inline_fragment("Service"),
16973 graphql_client: self.graphql_client.clone(),
16974 })
16975 }
16976 pub async fn hostname(&self) -> Result<String, DaggerError> {
16978 let query = self.selection.select("hostname");
16979 query.execute(self.graphql_client.clone()).await
16980 }
16981 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
16987 let mut query = self.selection.select("withHostname");
16988 query = query.arg("hostname", hostname.into());
16989 Service {
16990 proc: self.proc.clone(),
16991 selection: query,
16992 graphql_client: self.graphql_client.clone(),
16993 }
16994 }
16995 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
17001 let query = self.selection.select("ports");
17002 let query = query.select("id");
17003 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17004 Ok(ids
17005 .into_iter()
17006 .map(|id| Port {
17007 proc: self.proc.clone(),
17008 selection: crate::querybuilder::query()
17009 .select("node")
17010 .arg("id", &id.0)
17011 .inline_fragment("Port"),
17012 graphql_client: self.graphql_client.clone(),
17013 })
17014 .collect())
17015 }
17016 pub async fn ports_opts(&self, opts: ServicePortsOpts) -> Result<Vec<Port>, DaggerError> {
17022 let mut query = self.selection.select("ports");
17023 if let Some(declared) = opts.declared {
17024 query = query.arg("declared", declared);
17025 }
17026 let query = query.select("id");
17027 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17028 Ok(ids
17029 .into_iter()
17030 .map(|id| Port {
17031 proc: self.proc.clone(),
17032 selection: crate::querybuilder::query()
17033 .select("node")
17034 .arg("id", &id.0)
17035 .inline_fragment("Port"),
17036 graphql_client: self.graphql_client.clone(),
17037 })
17038 .collect())
17039 }
17040 pub async fn endpoint(&self) -> Result<String, DaggerError> {
17048 let query = self.selection.select("endpoint");
17049 query.execute(self.graphql_client.clone()).await
17050 }
17051 pub async fn endpoint_opts<'a>(
17059 &self,
17060 opts: ServiceEndpointOpts<'a>,
17061 ) -> Result<String, DaggerError> {
17062 let mut query = self.selection.select("endpoint");
17063 if let Some(port) = opts.port {
17064 query = query.arg("port", port);
17065 }
17066 if let Some(scheme) = opts.scheme {
17067 query = query.arg("scheme", scheme);
17068 }
17069 query.execute(self.graphql_client.clone()).await
17070 }
17071 pub async fn start(&self) -> Result<Service, DaggerError> {
17074 let query = self.selection.select("start");
17075 let id: Id = query.execute(self.graphql_client.clone()).await?;
17076 Ok(Service {
17077 proc: self.proc.clone(),
17078 selection: query
17079 .root()
17080 .select("node")
17081 .arg("id", &id.0)
17082 .inline_fragment("Service"),
17083 graphql_client: self.graphql_client.clone(),
17084 })
17085 }
17086 pub async fn up(&self) -> Result<Void, DaggerError> {
17092 let query = self.selection.select("up");
17093 query.execute(self.graphql_client.clone()).await
17094 }
17095 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
17101 let mut query = self.selection.select("up");
17102 if let Some(ports) = opts.ports {
17103 query = query.arg("ports", ports);
17104 }
17105 if let Some(random) = opts.random {
17106 query = query.arg("random", random);
17107 }
17108 query.execute(self.graphql_client.clone()).await
17109 }
17110 pub async fn stop(&self) -> Result<Service, DaggerError> {
17116 let query = self.selection.select("stop");
17117 let id: Id = query.execute(self.graphql_client.clone()).await?;
17118 Ok(Service {
17119 proc: self.proc.clone(),
17120 selection: query
17121 .root()
17122 .select("node")
17123 .arg("id", &id.0)
17124 .inline_fragment("Service"),
17125 graphql_client: self.graphql_client.clone(),
17126 })
17127 }
17128 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
17134 let mut query = self.selection.select("stop");
17135 if let Some(kill) = opts.kill {
17136 query = query.arg("kill", kill);
17137 }
17138 let id: Id = query.execute(self.graphql_client.clone()).await?;
17139 Ok(Service {
17140 proc: self.proc.clone(),
17141 selection: query
17142 .root()
17143 .select("node")
17144 .arg("id", &id.0)
17145 .inline_fragment("Service"),
17146 graphql_client: self.graphql_client.clone(),
17147 })
17148 }
17149 pub fn terminal(&self) -> Service {
17154 let query = self.selection.select("terminal");
17155 Service {
17156 proc: self.proc.clone(),
17157 selection: query,
17158 graphql_client: self.graphql_client.clone(),
17159 }
17160 }
17161 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
17166 let mut query = self.selection.select("terminal");
17167 if let Some(cmd) = opts.cmd {
17168 query = query.arg("cmd", cmd);
17169 }
17170 Service {
17171 proc: self.proc.clone(),
17172 selection: query,
17173 graphql_client: self.graphql_client.clone(),
17174 }
17175 }
17176}
17177impl Node for Service {
17178 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17179 let query = self.selection.select("id");
17180 let graphql_client = self.graphql_client.clone();
17181 async move { query.execute(graphql_client).await }
17182 }
17183}
17184impl Syncer for Service {
17185 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17186 let query = self.selection.select("id");
17187 let graphql_client = self.graphql_client.clone();
17188 async move { query.execute(graphql_client).await }
17189 }
17190 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17191 let query = self.selection.select("sync");
17192 let proc = self.proc.clone();
17193 let graphql_client = self.graphql_client.clone();
17194 async move {
17195 let id: Id = query.execute(graphql_client.clone()).await?;
17196 Ok(Self {
17197 proc,
17198 selection: query
17199 .root()
17200 .select("node")
17201 .arg("id", &id.0)
17202 .inline_fragment("Service"),
17203 graphql_client,
17204 })
17205 }
17206 }
17207}
17208#[derive(Clone)]
17209pub struct Socket {
17210 pub proc: Option<Arc<DaggerSessionProc>>,
17211 pub selection: Selection,
17212 pub graphql_client: DynGraphQLClient,
17213}
17214impl IntoID<Id> for Socket {
17215 fn into_id(
17216 self,
17217 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17218 Box::pin(async move { self.id().await })
17219 }
17220}
17221impl Loadable for Socket {
17222 fn graphql_type() -> &'static str {
17223 "Socket"
17224 }
17225 fn from_query(
17226 proc: Option<Arc<DaggerSessionProc>>,
17227 selection: Selection,
17228 graphql_client: DynGraphQLClient,
17229 ) -> Self {
17230 Self {
17231 proc,
17232 selection,
17233 graphql_client,
17234 }
17235 }
17236}
17237impl Socket {
17238 pub async fn id(&self) -> Result<Id, DaggerError> {
17240 let query = self.selection.select("id");
17241 query.execute(self.graphql_client.clone()).await
17242 }
17243}
17244impl Node for Socket {
17245 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17246 let query = self.selection.select("id");
17247 let graphql_client = self.graphql_client.clone();
17248 async move { query.execute(graphql_client).await }
17249 }
17250}
17251#[derive(Clone)]
17252pub struct SourceMap {
17253 pub proc: Option<Arc<DaggerSessionProc>>,
17254 pub selection: Selection,
17255 pub graphql_client: DynGraphQLClient,
17256}
17257impl IntoID<Id> for SourceMap {
17258 fn into_id(
17259 self,
17260 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17261 Box::pin(async move { self.id().await })
17262 }
17263}
17264impl Loadable for SourceMap {
17265 fn graphql_type() -> &'static str {
17266 "SourceMap"
17267 }
17268 fn from_query(
17269 proc: Option<Arc<DaggerSessionProc>>,
17270 selection: Selection,
17271 graphql_client: DynGraphQLClient,
17272 ) -> Self {
17273 Self {
17274 proc,
17275 selection,
17276 graphql_client,
17277 }
17278 }
17279}
17280impl SourceMap {
17281 pub async fn id(&self) -> Result<Id, DaggerError> {
17283 let query = self.selection.select("id");
17284 query.execute(self.graphql_client.clone()).await
17285 }
17286 pub async fn module(&self) -> Result<String, DaggerError> {
17288 let query = self.selection.select("module");
17289 query.execute(self.graphql_client.clone()).await
17290 }
17291 pub async fn filename(&self) -> Result<String, DaggerError> {
17293 let query = self.selection.select("filename");
17294 query.execute(self.graphql_client.clone()).await
17295 }
17296 pub async fn line(&self) -> Result<isize, DaggerError> {
17298 let query = self.selection.select("line");
17299 query.execute(self.graphql_client.clone()).await
17300 }
17301 pub async fn column(&self) -> Result<isize, DaggerError> {
17303 let query = self.selection.select("column");
17304 query.execute(self.graphql_client.clone()).await
17305 }
17306 pub async fn url(&self) -> Result<String, DaggerError> {
17308 let query = self.selection.select("url");
17309 query.execute(self.graphql_client.clone()).await
17310 }
17311}
17312impl Node for SourceMap {
17313 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17314 let query = self.selection.select("id");
17315 let graphql_client = self.graphql_client.clone();
17316 async move { query.execute(graphql_client).await }
17317 }
17318}
17319#[derive(Clone)]
17320pub struct Stat {
17321 pub proc: Option<Arc<DaggerSessionProc>>,
17322 pub selection: Selection,
17323 pub graphql_client: DynGraphQLClient,
17324}
17325impl IntoID<Id> for Stat {
17326 fn into_id(
17327 self,
17328 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17329 Box::pin(async move { self.id().await })
17330 }
17331}
17332impl Loadable for Stat {
17333 fn graphql_type() -> &'static str {
17334 "Stat"
17335 }
17336 fn from_query(
17337 proc: Option<Arc<DaggerSessionProc>>,
17338 selection: Selection,
17339 graphql_client: DynGraphQLClient,
17340 ) -> Self {
17341 Self {
17342 proc,
17343 selection,
17344 graphql_client,
17345 }
17346 }
17347}
17348impl Stat {
17349 pub async fn id(&self) -> Result<Id, DaggerError> {
17351 let query = self.selection.select("id");
17352 query.execute(self.graphql_client.clone()).await
17353 }
17354 pub async fn size(&self) -> Result<isize, DaggerError> {
17356 let query = self.selection.select("size");
17357 query.execute(self.graphql_client.clone()).await
17358 }
17359 pub async fn name(&self) -> Result<String, DaggerError> {
17361 let query = self.selection.select("name");
17362 query.execute(self.graphql_client.clone()).await
17363 }
17364 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
17366 let query = self.selection.select("fileType");
17367 query.execute(self.graphql_client.clone()).await
17368 }
17369 pub async fn permissions(&self) -> Result<isize, DaggerError> {
17371 let query = self.selection.select("permissions");
17372 query.execute(self.graphql_client.clone()).await
17373 }
17374}
17375impl Node for Stat {
17376 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17377 let query = self.selection.select("id");
17378 let graphql_client = self.graphql_client.clone();
17379 async move { query.execute(graphql_client).await }
17380 }
17381}
17382#[derive(Clone)]
17383pub struct Terminal {
17384 pub proc: Option<Arc<DaggerSessionProc>>,
17385 pub selection: Selection,
17386 pub graphql_client: DynGraphQLClient,
17387}
17388impl IntoID<Id> for Terminal {
17389 fn into_id(
17390 self,
17391 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17392 Box::pin(async move { self.id().await })
17393 }
17394}
17395impl Loadable for Terminal {
17396 fn graphql_type() -> &'static str {
17397 "Terminal"
17398 }
17399 fn from_query(
17400 proc: Option<Arc<DaggerSessionProc>>,
17401 selection: Selection,
17402 graphql_client: DynGraphQLClient,
17403 ) -> Self {
17404 Self {
17405 proc,
17406 selection,
17407 graphql_client,
17408 }
17409 }
17410}
17411impl Terminal {
17412 pub async fn id(&self) -> Result<Id, DaggerError> {
17414 let query = self.selection.select("id");
17415 query.execute(self.graphql_client.clone()).await
17416 }
17417 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
17420 let query = self.selection.select("sync");
17421 let id: Id = query.execute(self.graphql_client.clone()).await?;
17422 Ok(Terminal {
17423 proc: self.proc.clone(),
17424 selection: query
17425 .root()
17426 .select("node")
17427 .arg("id", &id.0)
17428 .inline_fragment("Terminal"),
17429 graphql_client: self.graphql_client.clone(),
17430 })
17431 }
17432}
17433impl Node for Terminal {
17434 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17435 let query = self.selection.select("id");
17436 let graphql_client = self.graphql_client.clone();
17437 async move { query.execute(graphql_client).await }
17438 }
17439}
17440impl Syncer for Terminal {
17441 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17442 let query = self.selection.select("id");
17443 let graphql_client = self.graphql_client.clone();
17444 async move { query.execute(graphql_client).await }
17445 }
17446 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17447 let query = self.selection.select("sync");
17448 let proc = self.proc.clone();
17449 let graphql_client = self.graphql_client.clone();
17450 async move {
17451 let id: Id = query.execute(graphql_client.clone()).await?;
17452 Ok(Self {
17453 proc,
17454 selection: query
17455 .root()
17456 .select("node")
17457 .arg("id", &id.0)
17458 .inline_fragment("Terminal"),
17459 graphql_client,
17460 })
17461 }
17462 }
17463}
17464#[derive(Clone)]
17465pub struct TypeDef {
17466 pub proc: Option<Arc<DaggerSessionProc>>,
17467 pub selection: Selection,
17468 pub graphql_client: DynGraphQLClient,
17469}
17470#[derive(Builder, Debug, PartialEq)]
17471pub struct TypeDefWithScalarOpts<'a> {
17472 #[builder(setter(into, strip_option), default)]
17473 pub description: Option<&'a str>,
17474}
17475#[derive(Builder, Debug, PartialEq)]
17476pub struct TypeDefWithObjectOpts<'a> {
17477 #[builder(setter(into, strip_option), default)]
17478 pub deprecated: Option<&'a str>,
17479 #[builder(setter(into, strip_option), default)]
17480 pub description: Option<&'a str>,
17481 #[builder(setter(into, strip_option), default)]
17482 pub source_map: Option<Id>,
17483}
17484#[derive(Builder, Debug, PartialEq)]
17485pub struct TypeDefWithInterfaceOpts<'a> {
17486 #[builder(setter(into, strip_option), default)]
17487 pub description: Option<&'a str>,
17488 #[builder(setter(into, strip_option), default)]
17489 pub source_map: Option<Id>,
17490}
17491#[derive(Builder, Debug, PartialEq)]
17492pub struct TypeDefWithFieldOpts<'a> {
17493 #[builder(setter(into, strip_option), default)]
17495 pub deprecated: Option<&'a str>,
17496 #[builder(setter(into, strip_option), default)]
17498 pub description: Option<&'a str>,
17499 #[builder(setter(into, strip_option), default)]
17501 pub source_map: Option<Id>,
17502}
17503#[derive(Builder, Debug, PartialEq)]
17504pub struct TypeDefWithEnumOpts<'a> {
17505 #[builder(setter(into, strip_option), default)]
17507 pub description: Option<&'a str>,
17508 #[builder(setter(into, strip_option), default)]
17510 pub source_map: Option<Id>,
17511}
17512#[derive(Builder, Debug, PartialEq)]
17513pub struct TypeDefWithEnumValueOpts<'a> {
17514 #[builder(setter(into, strip_option), default)]
17516 pub deprecated: Option<&'a str>,
17517 #[builder(setter(into, strip_option), default)]
17519 pub description: Option<&'a str>,
17520 #[builder(setter(into, strip_option), default)]
17522 pub source_map: Option<Id>,
17523}
17524#[derive(Builder, Debug, PartialEq)]
17525pub struct TypeDefWithEnumMemberOpts<'a> {
17526 #[builder(setter(into, strip_option), default)]
17528 pub deprecated: Option<&'a str>,
17529 #[builder(setter(into, strip_option), default)]
17531 pub description: Option<&'a str>,
17532 #[builder(setter(into, strip_option), default)]
17534 pub source_map: Option<Id>,
17535 #[builder(setter(into, strip_option), default)]
17537 pub value: Option<&'a str>,
17538}
17539impl IntoID<Id> for TypeDef {
17540 fn into_id(
17541 self,
17542 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17543 Box::pin(async move { self.id().await })
17544 }
17545}
17546impl Loadable for TypeDef {
17547 fn graphql_type() -> &'static str {
17548 "TypeDef"
17549 }
17550 fn from_query(
17551 proc: Option<Arc<DaggerSessionProc>>,
17552 selection: Selection,
17553 graphql_client: DynGraphQLClient,
17554 ) -> Self {
17555 Self {
17556 proc,
17557 selection,
17558 graphql_client,
17559 }
17560 }
17561}
17562impl TypeDef {
17563 pub async fn id(&self) -> Result<Id, DaggerError> {
17565 let query = self.selection.select("id");
17566 query.execute(self.graphql_client.clone()).await
17567 }
17568 pub fn with_collection(&self) -> TypeDef {
17570 let query = self.selection.select("withCollection");
17571 TypeDef {
17572 proc: self.proc.clone(),
17573 selection: query,
17574 graphql_client: self.graphql_client.clone(),
17575 }
17576 }
17577 pub fn with_collection_keys(&self, name: impl Into<String>) -> TypeDef {
17579 let mut query = self.selection.select("withCollectionKeys");
17580 query = query.arg("name", name.into());
17581 TypeDef {
17582 proc: self.proc.clone(),
17583 selection: query,
17584 graphql_client: self.graphql_client.clone(),
17585 }
17586 }
17587 pub fn with_collection_get(&self, name: impl Into<String>) -> TypeDef {
17589 let mut query = self.selection.select("withCollectionGet");
17590 query = query.arg("name", name.into());
17591 TypeDef {
17592 proc: self.proc.clone(),
17593 selection: query,
17594 graphql_client: self.graphql_client.clone(),
17595 }
17596 }
17597 pub fn with_collection_delta(&self, name: impl Into<String>) -> TypeDef {
17599 let mut query = self.selection.select("withCollectionDelta");
17600 query = query.arg("name", name.into());
17601 TypeDef {
17602 proc: self.proc.clone(),
17603 selection: query,
17604 graphql_client: self.graphql_client.clone(),
17605 }
17606 }
17607 pub async fn as_collection(&self) -> Result<Option<CollectionTypeDef>, DaggerError> {
17609 let query = self.selection.select("asCollection");
17610 let query = query.select("id");
17611 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
17612 Ok(id.map(|id| CollectionTypeDef {
17613 proc: self.proc.clone(),
17614 selection: query
17615 .root()
17616 .select("node")
17617 .arg("id", &id.0)
17618 .inline_fragment("CollectionTypeDef"),
17619 graphql_client: self.graphql_client.clone(),
17620 }))
17621 }
17622 pub async fn name(&self) -> Result<String, DaggerError> {
17624 let query = self.selection.select("name");
17625 query.execute(self.graphql_client.clone()).await
17626 }
17627 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
17629 let query = self.selection.select("kind");
17630 query.execute(self.graphql_client.clone()).await
17631 }
17632 pub async fn optional(&self) -> Result<bool, DaggerError> {
17634 let query = self.selection.select("optional");
17635 query.execute(self.graphql_client.clone()).await
17636 }
17637 pub fn with_optional(&self, optional: bool) -> TypeDef {
17639 let mut query = self.selection.select("withOptional");
17640 query = query.arg("optional", optional);
17641 TypeDef {
17642 proc: self.proc.clone(),
17643 selection: query,
17644 graphql_client: self.graphql_client.clone(),
17645 }
17646 }
17647 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
17649 let mut query = self.selection.select("withKind");
17650 query = query.arg("kind", kind);
17651 TypeDef {
17652 proc: self.proc.clone(),
17653 selection: query,
17654 graphql_client: self.graphql_client.clone(),
17655 }
17656 }
17657 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
17663 let mut query = self.selection.select("withScalar");
17664 query = query.arg("name", name.into());
17665 TypeDef {
17666 proc: self.proc.clone(),
17667 selection: query,
17668 graphql_client: self.graphql_client.clone(),
17669 }
17670 }
17671 pub fn with_scalar_opts<'a>(
17677 &self,
17678 name: impl Into<String>,
17679 opts: TypeDefWithScalarOpts<'a>,
17680 ) -> TypeDef {
17681 let mut query = self.selection.select("withScalar");
17682 query = query.arg("name", name.into());
17683 if let Some(description) = opts.description {
17684 query = query.arg("description", description);
17685 }
17686 TypeDef {
17687 proc: self.proc.clone(),
17688 selection: query,
17689 graphql_client: self.graphql_client.clone(),
17690 }
17691 }
17692 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
17694 let mut query = self.selection.select("withListOf");
17695 query = query.arg_lazy(
17696 "elementType",
17697 Box::new(move || {
17698 let element_type = element_type.clone();
17699 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
17700 }),
17701 );
17702 TypeDef {
17703 proc: self.proc.clone(),
17704 selection: query,
17705 graphql_client: self.graphql_client.clone(),
17706 }
17707 }
17708 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
17715 let mut query = self.selection.select("withObject");
17716 query = query.arg("name", name.into());
17717 TypeDef {
17718 proc: self.proc.clone(),
17719 selection: query,
17720 graphql_client: self.graphql_client.clone(),
17721 }
17722 }
17723 pub fn with_object_opts<'a>(
17730 &self,
17731 name: impl Into<String>,
17732 opts: TypeDefWithObjectOpts<'a>,
17733 ) -> TypeDef {
17734 let mut query = self.selection.select("withObject");
17735 query = query.arg("name", name.into());
17736 if let Some(description) = opts.description {
17737 query = query.arg("description", description);
17738 }
17739 if let Some(source_map) = opts.source_map {
17740 query = query.arg("sourceMap", source_map);
17741 }
17742 if let Some(deprecated) = opts.deprecated {
17743 query = query.arg("deprecated", deprecated);
17744 }
17745 TypeDef {
17746 proc: self.proc.clone(),
17747 selection: query,
17748 graphql_client: self.graphql_client.clone(),
17749 }
17750 }
17751 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
17757 let mut query = self.selection.select("withInterface");
17758 query = query.arg("name", name.into());
17759 TypeDef {
17760 proc: self.proc.clone(),
17761 selection: query,
17762 graphql_client: self.graphql_client.clone(),
17763 }
17764 }
17765 pub fn with_interface_opts<'a>(
17771 &self,
17772 name: impl Into<String>,
17773 opts: TypeDefWithInterfaceOpts<'a>,
17774 ) -> TypeDef {
17775 let mut query = self.selection.select("withInterface");
17776 query = query.arg("name", name.into());
17777 if let Some(description) = opts.description {
17778 query = query.arg("description", description);
17779 }
17780 if let Some(source_map) = opts.source_map {
17781 query = query.arg("sourceMap", source_map);
17782 }
17783 TypeDef {
17784 proc: self.proc.clone(),
17785 selection: query,
17786 graphql_client: self.graphql_client.clone(),
17787 }
17788 }
17789 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
17797 let mut query = self.selection.select("withField");
17798 query = query.arg("name", name.into());
17799 query = query.arg_lazy(
17800 "typeDef",
17801 Box::new(move || {
17802 let type_def = type_def.clone();
17803 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17804 }),
17805 );
17806 TypeDef {
17807 proc: self.proc.clone(),
17808 selection: query,
17809 graphql_client: self.graphql_client.clone(),
17810 }
17811 }
17812 pub fn with_field_opts<'a>(
17820 &self,
17821 name: impl Into<String>,
17822 type_def: impl IntoID<Id>,
17823 opts: TypeDefWithFieldOpts<'a>,
17824 ) -> TypeDef {
17825 let mut query = self.selection.select("withField");
17826 query = query.arg("name", name.into());
17827 query = query.arg_lazy(
17828 "typeDef",
17829 Box::new(move || {
17830 let type_def = type_def.clone();
17831 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
17832 }),
17833 );
17834 if let Some(description) = opts.description {
17835 query = query.arg("description", description);
17836 }
17837 if let Some(source_map) = opts.source_map {
17838 query = query.arg("sourceMap", source_map);
17839 }
17840 if let Some(deprecated) = opts.deprecated {
17841 query = query.arg("deprecated", deprecated);
17842 }
17843 TypeDef {
17844 proc: self.proc.clone(),
17845 selection: query,
17846 graphql_client: self.graphql_client.clone(),
17847 }
17848 }
17849 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
17851 let mut query = self.selection.select("withFunction");
17852 query = query.arg_lazy(
17853 "function",
17854 Box::new(move || {
17855 let function = function.clone();
17856 Box::pin(async move { function.into_id().await.unwrap().quote() })
17857 }),
17858 );
17859 TypeDef {
17860 proc: self.proc.clone(),
17861 selection: query,
17862 graphql_client: self.graphql_client.clone(),
17863 }
17864 }
17865 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
17867 let mut query = self.selection.select("withConstructor");
17868 query = query.arg_lazy(
17869 "function",
17870 Box::new(move || {
17871 let function = function.clone();
17872 Box::pin(async move { function.into_id().await.unwrap().quote() })
17873 }),
17874 );
17875 TypeDef {
17876 proc: self.proc.clone(),
17877 selection: query,
17878 graphql_client: self.graphql_client.clone(),
17879 }
17880 }
17881 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
17889 let mut query = self.selection.select("withEnum");
17890 query = query.arg("name", name.into());
17891 TypeDef {
17892 proc: self.proc.clone(),
17893 selection: query,
17894 graphql_client: self.graphql_client.clone(),
17895 }
17896 }
17897 pub fn with_enum_opts<'a>(
17905 &self,
17906 name: impl Into<String>,
17907 opts: TypeDefWithEnumOpts<'a>,
17908 ) -> TypeDef {
17909 let mut query = self.selection.select("withEnum");
17910 query = query.arg("name", name.into());
17911 if let Some(description) = opts.description {
17912 query = query.arg("description", description);
17913 }
17914 if let Some(source_map) = opts.source_map {
17915 query = query.arg("sourceMap", source_map);
17916 }
17917 TypeDef {
17918 proc: self.proc.clone(),
17919 selection: query,
17920 graphql_client: self.graphql_client.clone(),
17921 }
17922 }
17923 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
17930 let mut query = self.selection.select("withEnumValue");
17931 query = query.arg("value", value.into());
17932 TypeDef {
17933 proc: self.proc.clone(),
17934 selection: query,
17935 graphql_client: self.graphql_client.clone(),
17936 }
17937 }
17938 pub fn with_enum_value_opts<'a>(
17945 &self,
17946 value: impl Into<String>,
17947 opts: TypeDefWithEnumValueOpts<'a>,
17948 ) -> TypeDef {
17949 let mut query = self.selection.select("withEnumValue");
17950 query = query.arg("value", value.into());
17951 if let Some(description) = opts.description {
17952 query = query.arg("description", description);
17953 }
17954 if let Some(source_map) = opts.source_map {
17955 query = query.arg("sourceMap", source_map);
17956 }
17957 if let Some(deprecated) = opts.deprecated {
17958 query = query.arg("deprecated", deprecated);
17959 }
17960 TypeDef {
17961 proc: self.proc.clone(),
17962 selection: query,
17963 graphql_client: self.graphql_client.clone(),
17964 }
17965 }
17966 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
17973 let mut query = self.selection.select("withEnumMember");
17974 query = query.arg("name", name.into());
17975 TypeDef {
17976 proc: self.proc.clone(),
17977 selection: query,
17978 graphql_client: self.graphql_client.clone(),
17979 }
17980 }
17981 pub fn with_enum_member_opts<'a>(
17988 &self,
17989 name: impl Into<String>,
17990 opts: TypeDefWithEnumMemberOpts<'a>,
17991 ) -> TypeDef {
17992 let mut query = self.selection.select("withEnumMember");
17993 query = query.arg("name", name.into());
17994 if let Some(value) = opts.value {
17995 query = query.arg("value", value);
17996 }
17997 if let Some(description) = opts.description {
17998 query = query.arg("description", description);
17999 }
18000 if let Some(source_map) = opts.source_map {
18001 query = query.arg("sourceMap", source_map);
18002 }
18003 if let Some(deprecated) = opts.deprecated {
18004 query = query.arg("deprecated", deprecated);
18005 }
18006 TypeDef {
18007 proc: self.proc.clone(),
18008 selection: query,
18009 graphql_client: self.graphql_client.clone(),
18010 }
18011 }
18012 pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
18014 let query = self.selection.select("asList");
18015 let query = query.select("id");
18016 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18017 Ok(id.map(|id| ListTypeDef {
18018 proc: self.proc.clone(),
18019 selection: query
18020 .root()
18021 .select("node")
18022 .arg("id", &id.0)
18023 .inline_fragment("ListTypeDef"),
18024 graphql_client: self.graphql_client.clone(),
18025 }))
18026 }
18027 pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
18029 let query = self.selection.select("asObject");
18030 let query = query.select("id");
18031 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18032 Ok(id.map(|id| ObjectTypeDef {
18033 proc: self.proc.clone(),
18034 selection: query
18035 .root()
18036 .select("node")
18037 .arg("id", &id.0)
18038 .inline_fragment("ObjectTypeDef"),
18039 graphql_client: self.graphql_client.clone(),
18040 }))
18041 }
18042 pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
18044 let query = self.selection.select("asInterface");
18045 let query = query.select("id");
18046 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18047 Ok(id.map(|id| InterfaceTypeDef {
18048 proc: self.proc.clone(),
18049 selection: query
18050 .root()
18051 .select("node")
18052 .arg("id", &id.0)
18053 .inline_fragment("InterfaceTypeDef"),
18054 graphql_client: self.graphql_client.clone(),
18055 }))
18056 }
18057 pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
18059 let query = self.selection.select("asInput");
18060 let query = query.select("id");
18061 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18062 Ok(id.map(|id| InputTypeDef {
18063 proc: self.proc.clone(),
18064 selection: query
18065 .root()
18066 .select("node")
18067 .arg("id", &id.0)
18068 .inline_fragment("InputTypeDef"),
18069 graphql_client: self.graphql_client.clone(),
18070 }))
18071 }
18072 pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
18074 let query = self.selection.select("asScalar");
18075 let query = query.select("id");
18076 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18077 Ok(id.map(|id| ScalarTypeDef {
18078 proc: self.proc.clone(),
18079 selection: query
18080 .root()
18081 .select("node")
18082 .arg("id", &id.0)
18083 .inline_fragment("ScalarTypeDef"),
18084 graphql_client: self.graphql_client.clone(),
18085 }))
18086 }
18087 pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
18089 let query = self.selection.select("asEnum");
18090 let query = query.select("id");
18091 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18092 Ok(id.map(|id| EnumTypeDef {
18093 proc: self.proc.clone(),
18094 selection: query
18095 .root()
18096 .select("node")
18097 .arg("id", &id.0)
18098 .inline_fragment("EnumTypeDef"),
18099 graphql_client: self.graphql_client.clone(),
18100 }))
18101 }
18102}
18103impl Node for TypeDef {
18104 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18105 let query = self.selection.select("id");
18106 let graphql_client = self.graphql_client.clone();
18107 async move { query.execute(graphql_client).await }
18108 }
18109}
18110#[derive(Clone)]
18111pub struct Volume {
18112 pub proc: Option<Arc<DaggerSessionProc>>,
18113 pub selection: Selection,
18114 pub graphql_client: DynGraphQLClient,
18115}
18116impl IntoID<Id> for Volume {
18117 fn into_id(
18118 self,
18119 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18120 Box::pin(async move { self.id().await })
18121 }
18122}
18123impl Loadable for Volume {
18124 fn graphql_type() -> &'static str {
18125 "Volume"
18126 }
18127 fn from_query(
18128 proc: Option<Arc<DaggerSessionProc>>,
18129 selection: Selection,
18130 graphql_client: DynGraphQLClient,
18131 ) -> Self {
18132 Self {
18133 proc,
18134 selection,
18135 graphql_client,
18136 }
18137 }
18138}
18139impl Volume {
18140 pub async fn id(&self) -> Result<Id, DaggerError> {
18142 let query = self.selection.select("id");
18143 query.execute(self.graphql_client.clone()).await
18144 }
18145}
18146impl Node for Volume {
18147 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18148 let query = self.selection.select("id");
18149 let graphql_client = self.graphql_client.clone();
18150 async move { query.execute(graphql_client).await }
18151 }
18152}
18153#[derive(Clone)]
18154pub struct Workspace {
18155 pub proc: Option<Arc<DaggerSessionProc>>,
18156 pub selection: Selection,
18157 pub graphql_client: DynGraphQLClient,
18158}
18159#[derive(Builder, Debug, PartialEq)]
18160pub struct WorkspaceMigrateModuleOpts<'a> {
18161 #[builder(setter(into, strip_option), default)]
18163 pub path: Option<&'a str>,
18164}
18165#[derive(Builder, Debug, PartialEq)]
18166pub struct WorkspaceCompareCommitsFromOpts<'a> {
18167 #[builder(setter(into, strip_option), default)]
18169 pub commits: Option<Vec<&'a str>>,
18170 #[builder(setter(into, strip_option), default)]
18172 pub max_commits: Option<isize>,
18173}
18174#[derive(Builder, Debug, PartialEq)]
18175pub struct WorkspaceWithCommitsFromOpts<'a> {
18176 #[builder(setter(into, strip_option), default)]
18178 pub commits: Option<Vec<&'a str>>,
18179 #[builder(setter(into, strip_option), default)]
18181 pub max_commits: Option<isize>,
18182}
18183#[derive(Builder, Debug, PartialEq)]
18184pub struct WorkspaceWithCommitOpts<'a> {
18185 #[builder(setter(into, strip_option), default)]
18187 pub author_email: Option<&'a str>,
18188 #[builder(setter(into, strip_option), default)]
18190 pub author_name: Option<&'a str>,
18191 #[builder(setter(into, strip_option), default)]
18193 pub signoff: Option<bool>,
18194}
18195#[derive(Builder, Debug, PartialEq)]
18196pub struct WorkspaceWithResetOpts {
18197 #[builder(setter(into, strip_option), default)]
18199 pub hard: Option<bool>,
18200}
18201#[derive(Builder, Debug, PartialEq)]
18202pub struct WorkspaceDirectoryOpts<'a> {
18203 #[builder(setter(into, strip_option), default)]
18205 pub exclude: Option<Vec<&'a str>>,
18206 #[builder(setter(into, strip_option), default)]
18208 pub gitignore: Option<bool>,
18209 #[builder(setter(into, strip_option), default)]
18211 pub include: Option<Vec<&'a str>>,
18212}
18213#[derive(Builder, Debug, PartialEq)]
18214pub struct WorkspaceSearchOpts<'a> {
18215 #[builder(setter(into, strip_option), default)]
18217 pub dotall: Option<bool>,
18218 #[builder(setter(into, strip_option), default)]
18220 pub files_only: Option<bool>,
18221 #[builder(setter(into, strip_option), default)]
18223 pub globs: Option<Vec<&'a str>>,
18224 #[builder(setter(into, strip_option), default)]
18226 pub insensitive: Option<bool>,
18227 #[builder(setter(into, strip_option), default)]
18229 pub limit: Option<isize>,
18230 #[builder(setter(into, strip_option), default)]
18232 pub literal: Option<bool>,
18233 #[builder(setter(into, strip_option), default)]
18235 pub multiline: Option<bool>,
18236 #[builder(setter(into, strip_option), default)]
18238 pub paths: Option<Vec<&'a str>>,
18239 #[builder(setter(into, strip_option), default)]
18241 pub skip_hidden: Option<bool>,
18242 #[builder(setter(into, strip_option), default)]
18244 pub skip_ignored: Option<bool>,
18245}
18246#[derive(Builder, Debug, PartialEq)]
18247pub struct WorkspaceFindUpOpts<'a> {
18248 #[builder(setter(into, strip_option), default)]
18250 pub from: Option<&'a str>,
18251}
18252#[derive(Builder, Debug, PartialEq)]
18253pub struct WorkspaceFindRootsOpts<'a> {
18254 #[builder(setter(into, strip_option), default)]
18256 pub exclude: Option<Vec<&'a str>>,
18257 #[builder(setter(into, strip_option), default)]
18259 pub start: Option<&'a str>,
18260}
18261#[derive(Builder, Debug, PartialEq)]
18262pub struct WorkspaceWithNewFileOpts {
18263 #[builder(setter(into, strip_option), default)]
18265 pub permissions: Option<isize>,
18266}
18267#[derive(Builder, Debug, PartialEq)]
18268pub struct WorkspaceWithFileOpts {
18269 #[builder(setter(into, strip_option), default)]
18271 pub permissions: Option<isize>,
18272}
18273#[derive(Builder, Debug, PartialEq)]
18274pub struct WorkspaceWithPatchFileOpts {
18275 #[builder(setter(into, strip_option), default)]
18277 pub on_conflict: Option<PatchConflict>,
18278}
18279#[derive(Builder, Debug, PartialEq)]
18280pub struct WorkspaceWithModuleOpts<'a> {
18281 #[builder(setter(into, strip_option), default)]
18283 pub here: Option<bool>,
18284 #[builder(setter(into, strip_option), default)]
18286 pub name: Option<&'a str>,
18287}
18288#[derive(Builder, Debug, PartialEq)]
18289pub struct WorkspaceWithoutModuleOpts {
18290 #[builder(setter(into, strip_option), default)]
18292 pub here: Option<bool>,
18293}
18294#[derive(Builder, Debug, PartialEq)]
18295pub struct WorkspaceWithSdkOpts<'a> {
18296 #[builder(setter(into, strip_option), default)]
18298 pub as_sdk_name: Option<&'a str>,
18299 #[builder(setter(into, strip_option), default)]
18301 pub here: Option<bool>,
18302 #[builder(setter(into, strip_option), default)]
18304 pub name: Option<&'a str>,
18305}
18306#[derive(Builder, Debug, PartialEq)]
18307pub struct WorkspaceWithoutSdkOpts {
18308 #[builder(setter(into, strip_option), default)]
18310 pub here: Option<bool>,
18311}
18312#[derive(Builder, Debug, PartialEq)]
18313pub struct WorkspaceWithInitModuleOpts<'a> {
18314 #[builder(setter(into, strip_option), default)]
18316 pub entrypoint: Option<bool>,
18317 #[builder(setter(into, strip_option), default)]
18319 pub install: Option<bool>,
18320 #[builder(setter(into, strip_option), default)]
18322 pub name: Option<&'a str>,
18323 #[builder(setter(into, strip_option), default)]
18325 pub path: Option<&'a str>,
18326 #[builder(setter(into, strip_option), default)]
18328 pub settings: Option<Json>,
18329}
18330#[derive(Builder, Debug, PartialEq)]
18331pub struct WorkspaceWithClientOpts<'a> {
18332 #[builder(setter(into, strip_option), default)]
18334 pub sdk: Option<&'a str>,
18335 #[builder(setter(into, strip_option), default)]
18337 pub settings: Option<Json>,
18338}
18339#[derive(Builder, Debug, PartialEq)]
18340pub struct WorkspaceWithoutClientOpts<'a> {
18341 #[builder(setter(into, strip_option), default)]
18343 pub sdk: Option<&'a str>,
18344}
18345#[derive(Builder, Debug, PartialEq)]
18346pub struct WorkspaceWithUpdatedClientsOpts<'a> {
18347 #[builder(setter(into, strip_option), default)]
18349 pub all: Option<bool>,
18350 #[builder(setter(into, strip_option), default)]
18352 pub modules: Option<Vec<&'a str>>,
18353 #[builder(setter(into, strip_option), default)]
18355 pub sdk: Option<&'a str>,
18356}
18357#[derive(Builder, Debug, PartialEq)]
18358pub struct WorkspaceWithConfigValueOpts<'a> {
18359 #[builder(setter(into, strip_option), default)]
18361 pub here: Option<bool>,
18362 #[builder(setter(into, strip_option), default)]
18364 pub values: Option<Vec<&'a str>>,
18365}
18366#[derive(Builder, Debug, PartialEq)]
18367pub struct WorkspaceWithoutConfigValueOpts {
18368 #[builder(setter(into, strip_option), default)]
18370 pub here: Option<bool>,
18371}
18372#[derive(Builder, Debug, PartialEq)]
18373pub struct WorkspaceWithConfigEnvOpts {
18374 #[builder(setter(into, strip_option), default)]
18376 pub here: Option<bool>,
18377}
18378#[derive(Builder, Debug, PartialEq)]
18379pub struct WorkspaceWithoutConfigEnvOpts {
18380 #[builder(setter(into, strip_option), default)]
18382 pub here: Option<bool>,
18383}
18384#[derive(Builder, Debug, PartialEq)]
18385pub struct WorkspaceWithUpdatedLockOpts {
18386 #[builder(setter(into, strip_option), default)]
18388 pub no_generate: Option<bool>,
18389}
18390#[derive(Builder, Debug, PartialEq)]
18391pub struct WorkspaceWithUpdatedModulesOpts<'a> {
18392 #[builder(setter(into, strip_option), default)]
18394 pub names: Option<Vec<&'a str>>,
18395 #[builder(setter(into, strip_option), default)]
18397 pub source: Option<&'a str>,
18398 #[builder(setter(into, strip_option), default)]
18400 pub version: Option<&'a str>,
18401}
18402#[derive(Builder, Debug, PartialEq)]
18403pub struct WorkspaceChangesOpts {
18404 #[builder(setter(into, strip_option), default)]
18406 pub from: Option<Id>,
18407}
18408#[derive(Builder, Debug, PartialEq)]
18409pub struct WorkspaceExportOpts<'a> {
18410 #[builder(setter(into, strip_option), default)]
18412 pub from: Option<Id>,
18413 #[builder(setter(into, strip_option), default)]
18415 pub path: Option<&'a str>,
18416}
18417#[derive(Builder, Debug, PartialEq)]
18418pub struct WorkspaceConfigReadOpts<'a> {
18419 #[builder(setter(into, strip_option), default)]
18421 pub effective: Option<bool>,
18422 #[builder(setter(into, strip_option), default)]
18424 pub key: Option<&'a str>,
18425}
18426#[derive(Builder, Debug, PartialEq)]
18427pub struct WorkspaceArtifactsOpts<'a> {
18428 #[builder(setter(into, strip_option), default)]
18430 pub include: Option<Vec<&'a str>>,
18431}
18432#[derive(Builder, Debug, PartialEq)]
18433pub struct WorkspaceMigrateOpts<'a> {
18434 #[builder(setter(into, strip_option), default)]
18436 pub modules: Option<Vec<&'a str>>,
18437}
18438impl IntoID<Id> for Workspace {
18439 fn into_id(
18440 self,
18441 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18442 Box::pin(async move { self.id().await })
18443 }
18444}
18445impl Loadable for Workspace {
18446 fn graphql_type() -> &'static str {
18447 "Workspace"
18448 }
18449 fn from_query(
18450 proc: Option<Arc<DaggerSessionProc>>,
18451 selection: Selection,
18452 graphql_client: DynGraphQLClient,
18453 ) -> Self {
18454 Self {
18455 proc,
18456 selection,
18457 graphql_client,
18458 }
18459 }
18460}
18461impl Workspace {
18462 pub async fn id(&self) -> Result<Id, DaggerError> {
18464 let query = self.selection.select("id");
18465 query.execute(self.graphql_client.clone()).await
18466 }
18467 pub fn resolve(&self, value: impl Into<String>) -> Address {
18476 let mut query = self.selection.select("resolve");
18477 query = query.arg("value", value.into());
18478 Address {
18479 proc: self.proc.clone(),
18480 selection: query,
18481 graphql_client: self.graphql_client.clone(),
18482 }
18483 }
18484 pub fn with_initialized(&self) -> Workspace {
18487 let query = self.selection.select("withInitialized");
18488 Workspace {
18489 proc: self.proc.clone(),
18490 selection: query,
18491 graphql_client: self.graphql_client.clone(),
18492 }
18493 }
18494 pub fn migrate_module(&self) -> WorkspaceMigration {
18501 let query = self.selection.select("migrateModule");
18502 WorkspaceMigration {
18503 proc: self.proc.clone(),
18504 selection: query,
18505 graphql_client: self.graphql_client.clone(),
18506 }
18507 }
18508 pub fn migrate_module_opts<'a>(
18515 &self,
18516 opts: WorkspaceMigrateModuleOpts<'a>,
18517 ) -> WorkspaceMigration {
18518 let mut query = self.selection.select("migrateModule");
18519 if let Some(path) = opts.path {
18520 query = query.arg("path", path);
18521 }
18522 WorkspaceMigration {
18523 proc: self.proc.clone(),
18524 selection: query,
18525 graphql_client: self.graphql_client.clone(),
18526 }
18527 }
18528 pub async fn compare_commits_from(
18537 &self,
18538 source: impl IntoID<Id>,
18539 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18540 let mut query = self.selection.select("compareCommitsFrom");
18541 query = query.arg_lazy(
18542 "source",
18543 Box::new(move || {
18544 let source = source.clone();
18545 Box::pin(async move { source.into_id().await.unwrap().quote() })
18546 }),
18547 );
18548 let query = query.select("id");
18549 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18550 Ok(ids
18551 .into_iter()
18552 .map(|id| WorkspaceCommitPick {
18553 proc: self.proc.clone(),
18554 selection: crate::querybuilder::query()
18555 .select("node")
18556 .arg("id", &id.0)
18557 .inline_fragment("WorkspaceCommitPick"),
18558 graphql_client: self.graphql_client.clone(),
18559 })
18560 .collect())
18561 }
18562 pub async fn compare_commits_from_opts<'a>(
18571 &self,
18572 source: impl IntoID<Id>,
18573 opts: WorkspaceCompareCommitsFromOpts<'a>,
18574 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18575 let mut query = self.selection.select("compareCommitsFrom");
18576 query = query.arg_lazy(
18577 "source",
18578 Box::new(move || {
18579 let source = source.clone();
18580 Box::pin(async move { source.into_id().await.unwrap().quote() })
18581 }),
18582 );
18583 if let Some(commits) = opts.commits {
18584 query = query.arg("commits", commits);
18585 }
18586 if let Some(max_commits) = opts.max_commits {
18587 query = query.arg("maxCommits", max_commits);
18588 }
18589 let query = query.select("id");
18590 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18591 Ok(ids
18592 .into_iter()
18593 .map(|id| WorkspaceCommitPick {
18594 proc: self.proc.clone(),
18595 selection: crate::querybuilder::query()
18596 .select("node")
18597 .arg("id", &id.0)
18598 .inline_fragment("WorkspaceCommitPick"),
18599 graphql_client: self.graphql_client.clone(),
18600 })
18601 .collect())
18602 }
18603 pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
18613 let mut query = self.selection.select("withCommitsFrom");
18614 query = query.arg_lazy(
18615 "source",
18616 Box::new(move || {
18617 let source = source.clone();
18618 Box::pin(async move { source.into_id().await.unwrap().quote() })
18619 }),
18620 );
18621 Workspace {
18622 proc: self.proc.clone(),
18623 selection: query,
18624 graphql_client: self.graphql_client.clone(),
18625 }
18626 }
18627 pub fn with_commits_from_opts<'a>(
18637 &self,
18638 source: impl IntoID<Id>,
18639 opts: WorkspaceWithCommitsFromOpts<'a>,
18640 ) -> Workspace {
18641 let mut query = self.selection.select("withCommitsFrom");
18642 query = query.arg_lazy(
18643 "source",
18644 Box::new(move || {
18645 let source = source.clone();
18646 Box::pin(async move { source.into_id().await.unwrap().quote() })
18647 }),
18648 );
18649 if let Some(commits) = opts.commits {
18650 query = query.arg("commits", commits);
18651 }
18652 if let Some(max_commits) = opts.max_commits {
18653 query = query.arg("maxCommits", max_commits);
18654 }
18655 Workspace {
18656 proc: self.proc.clone(),
18657 selection: query,
18658 graphql_client: self.graphql_client.clone(),
18659 }
18660 }
18661 pub fn with_commit(
18673 &self,
18674 changes: impl IntoID<Id>,
18675 message: impl Into<String>,
18676 date: impl Into<String>,
18677 ) -> Workspace {
18678 let mut query = self.selection.select("withCommit");
18679 query = query.arg_lazy(
18680 "changes",
18681 Box::new(move || {
18682 let changes = changes.clone();
18683 Box::pin(async move { changes.into_id().await.unwrap().quote() })
18684 }),
18685 );
18686 query = query.arg("message", message.into());
18687 query = query.arg("date", date.into());
18688 Workspace {
18689 proc: self.proc.clone(),
18690 selection: query,
18691 graphql_client: self.graphql_client.clone(),
18692 }
18693 }
18694 pub fn with_commit_opts<'a>(
18706 &self,
18707 changes: impl IntoID<Id>,
18708 message: impl Into<String>,
18709 date: impl Into<String>,
18710 opts: WorkspaceWithCommitOpts<'a>,
18711 ) -> Workspace {
18712 let mut query = self.selection.select("withCommit");
18713 query = query.arg_lazy(
18714 "changes",
18715 Box::new(move || {
18716 let changes = changes.clone();
18717 Box::pin(async move { changes.into_id().await.unwrap().quote() })
18718 }),
18719 );
18720 query = query.arg("message", message.into());
18721 query = query.arg("date", date.into());
18722 if let Some(author_name) = opts.author_name {
18723 query = query.arg("authorName", author_name);
18724 }
18725 if let Some(author_email) = opts.author_email {
18726 query = query.arg("authorEmail", author_email);
18727 }
18728 if let Some(signoff) = opts.signoff {
18729 query = query.arg("signoff", signoff);
18730 }
18731 Workspace {
18732 proc: self.proc.clone(),
18733 selection: query,
18734 graphql_client: self.graphql_client.clone(),
18735 }
18736 }
18737 pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
18747 let mut query = self.selection.select("withReset");
18748 query = query.arg("commit", commit.into());
18749 Workspace {
18750 proc: self.proc.clone(),
18751 selection: query,
18752 graphql_client: self.graphql_client.clone(),
18753 }
18754 }
18755 pub fn with_reset_opts(
18765 &self,
18766 commit: impl Into<String>,
18767 opts: WorkspaceWithResetOpts,
18768 ) -> Workspace {
18769 let mut query = self.selection.select("withReset");
18770 query = query.arg("commit", commit.into());
18771 if let Some(hard) = opts.hard {
18772 query = query.arg("hard", hard);
18773 }
18774 Workspace {
18775 proc: self.proc.clone(),
18776 selection: query,
18777 graphql_client: self.graphql_client.clone(),
18778 }
18779 }
18780 pub fn snapshot(&self) -> Workspace {
18786 let query = self.selection.select("snapshot");
18787 Workspace {
18788 proc: self.proc.clone(),
18789 selection: query,
18790 graphql_client: self.graphql_client.clone(),
18791 }
18792 }
18793 pub fn with_config_paths(
18800 &self,
18801 config_file: impl Into<String>,
18802 lock_file: impl Into<String>,
18803 ) -> Workspace {
18804 let mut query = self.selection.select("withConfigPaths");
18805 query = query.arg("configFile", config_file.into());
18806 query = query.arg("lockFile", lock_file.into());
18807 Workspace {
18808 proc: self.proc.clone(),
18809 selection: query,
18810 graphql_client: self.graphql_client.clone(),
18811 }
18812 }
18813 pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
18819 let mut query = self.selection.select("withConfigEnvironment");
18820 query = query.arg("name", name.into());
18821 Workspace {
18822 proc: self.proc.clone(),
18823 selection: query,
18824 graphql_client: self.graphql_client.clone(),
18825 }
18826 }
18827 pub fn with_user_config(&self) -> Workspace {
18831 let query = self.selection.select("withUserConfig");
18832 Workspace {
18833 proc: self.proc.clone(),
18834 selection: query,
18835 graphql_client: self.graphql_client.clone(),
18836 }
18837 }
18838 pub async fn config_file(&self) -> Result<String, DaggerError> {
18840 let query = self.selection.select("configFile");
18841 query.execute(self.graphql_client.clone()).await
18842 }
18843 pub fn directory(&self, path: impl Into<String>) -> Directory {
18851 let mut query = self.selection.select("directory");
18852 query = query.arg("path", path.into());
18853 Directory {
18854 proc: self.proc.clone(),
18855 selection: query,
18856 graphql_client: self.graphql_client.clone(),
18857 }
18858 }
18859 pub fn directory_opts<'a>(
18867 &self,
18868 path: impl Into<String>,
18869 opts: WorkspaceDirectoryOpts<'a>,
18870 ) -> Directory {
18871 let mut query = self.selection.select("directory");
18872 query = query.arg("path", path.into());
18873 if let Some(exclude) = opts.exclude {
18874 query = query.arg("exclude", exclude);
18875 }
18876 if let Some(include) = opts.include {
18877 query = query.arg("include", include);
18878 }
18879 if let Some(gitignore) = opts.gitignore {
18880 query = query.arg("gitignore", gitignore);
18881 }
18882 Directory {
18883 proc: self.proc.clone(),
18884 selection: query,
18885 graphql_client: self.graphql_client.clone(),
18886 }
18887 }
18888 pub fn file(&self, path: impl Into<String>) -> File {
18895 let mut query = self.selection.select("file");
18896 query = query.arg("path", path.into());
18897 File {
18898 proc: self.proc.clone(),
18899 selection: query,
18900 graphql_client: self.graphql_client.clone(),
18901 }
18902 }
18903 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
18910 let mut query = self.selection.select("glob");
18911 query = query.arg("pattern", pattern.into());
18912 query.execute(self.graphql_client.clone()).await
18913 }
18914 pub async fn search(
18923 &self,
18924 pattern: impl Into<String>,
18925 ) -> Result<Vec<SearchResult>, DaggerError> {
18926 let mut query = self.selection.select("search");
18927 query = query.arg("pattern", pattern.into());
18928 let query = query.select("id");
18929 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18930 Ok(ids
18931 .into_iter()
18932 .map(|id| SearchResult {
18933 proc: self.proc.clone(),
18934 selection: crate::querybuilder::query()
18935 .select("node")
18936 .arg("id", &id.0)
18937 .inline_fragment("SearchResult"),
18938 graphql_client: self.graphql_client.clone(),
18939 })
18940 .collect())
18941 }
18942 pub async fn search_opts<'a>(
18951 &self,
18952 pattern: impl Into<String>,
18953 opts: WorkspaceSearchOpts<'a>,
18954 ) -> Result<Vec<SearchResult>, DaggerError> {
18955 let mut query = self.selection.select("search");
18956 query = query.arg("pattern", pattern.into());
18957 if let Some(paths) = opts.paths {
18958 query = query.arg("paths", paths);
18959 }
18960 if let Some(globs) = opts.globs {
18961 query = query.arg("globs", globs);
18962 }
18963 if let Some(literal) = opts.literal {
18964 query = query.arg("literal", literal);
18965 }
18966 if let Some(multiline) = opts.multiline {
18967 query = query.arg("multiline", multiline);
18968 }
18969 if let Some(dotall) = opts.dotall {
18970 query = query.arg("dotall", dotall);
18971 }
18972 if let Some(insensitive) = opts.insensitive {
18973 query = query.arg("insensitive", insensitive);
18974 }
18975 if let Some(skip_ignored) = opts.skip_ignored {
18976 query = query.arg("skipIgnored", skip_ignored);
18977 }
18978 if let Some(skip_hidden) = opts.skip_hidden {
18979 query = query.arg("skipHidden", skip_hidden);
18980 }
18981 if let Some(files_only) = opts.files_only {
18982 query = query.arg("filesOnly", files_only);
18983 }
18984 if let Some(limit) = opts.limit {
18985 query = query.arg("limit", limit);
18986 }
18987 let query = query.select("id");
18988 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18989 Ok(ids
18990 .into_iter()
18991 .map(|id| SearchResult {
18992 proc: self.proc.clone(),
18993 selection: crate::querybuilder::query()
18994 .select("node")
18995 .arg("id", &id.0)
18996 .inline_fragment("SearchResult"),
18997 graphql_client: self.graphql_client.clone(),
18998 })
18999 .collect())
19000 }
19001 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
19011 let mut query = self.selection.select("findUp");
19012 query = query.arg("name", name.into());
19013 query.execute(self.graphql_client.clone()).await
19014 }
19015 pub async fn find_up_opts<'a>(
19025 &self,
19026 name: impl Into<String>,
19027 opts: WorkspaceFindUpOpts<'a>,
19028 ) -> Result<String, DaggerError> {
19029 let mut query = self.selection.select("findUp");
19030 query = query.arg("name", name.into());
19031 if let Some(from) = opts.from {
19032 query = query.arg("from", from);
19033 }
19034 query.execute(self.graphql_client.clone()).await
19035 }
19036 pub async fn find_roots(
19045 &self,
19046 markers: Vec<impl Into<String>>,
19047 ) -> Result<Vec<String>, DaggerError> {
19048 let mut query = self.selection.select("findRoots");
19049 query = query.arg(
19050 "markers",
19051 markers
19052 .into_iter()
19053 .map(|i| i.into())
19054 .collect::<Vec<String>>(),
19055 );
19056 query.execute(self.graphql_client.clone()).await
19057 }
19058 pub async fn find_roots_opts<'a>(
19067 &self,
19068 markers: Vec<impl Into<String>>,
19069 opts: WorkspaceFindRootsOpts<'a>,
19070 ) -> Result<Vec<String>, DaggerError> {
19071 let mut query = self.selection.select("findRoots");
19072 query = query.arg(
19073 "markers",
19074 markers
19075 .into_iter()
19076 .map(|i| i.into())
19077 .collect::<Vec<String>>(),
19078 );
19079 if let Some(start) = opts.start {
19080 query = query.arg("start", start);
19081 }
19082 if let Some(exclude) = opts.exclude {
19083 query = query.arg("exclude", exclude);
19084 }
19085 query.execute(self.graphql_client.clone()).await
19086 }
19087 pub fn git(&self) -> WorkspaceGit {
19089 let query = self.selection.select("git");
19090 WorkspaceGit {
19091 proc: self.proc.clone(),
19092 selection: query,
19093 graphql_client: self.graphql_client.clone(),
19094 }
19095 }
19096 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
19104 let mut query = self.selection.select("withNewFile");
19105 query = query.arg("path", path.into());
19106 query = query.arg("contents", contents.into());
19107 Workspace {
19108 proc: self.proc.clone(),
19109 selection: query,
19110 graphql_client: self.graphql_client.clone(),
19111 }
19112 }
19113 pub fn with_new_file_opts(
19121 &self,
19122 path: impl Into<String>,
19123 contents: impl Into<String>,
19124 opts: WorkspaceWithNewFileOpts,
19125 ) -> Workspace {
19126 let mut query = self.selection.select("withNewFile");
19127 query = query.arg("path", path.into());
19128 query = query.arg("contents", contents.into());
19129 if let Some(permissions) = opts.permissions {
19130 query = query.arg("permissions", permissions);
19131 }
19132 Workspace {
19133 proc: self.proc.clone(),
19134 selection: query,
19135 graphql_client: self.graphql_client.clone(),
19136 }
19137 }
19138 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19146 let mut query = self.selection.select("withFile");
19147 query = query.arg("path", path.into());
19148 query = query.arg_lazy(
19149 "source",
19150 Box::new(move || {
19151 let source = source.clone();
19152 Box::pin(async move { source.into_id().await.unwrap().quote() })
19153 }),
19154 );
19155 Workspace {
19156 proc: self.proc.clone(),
19157 selection: query,
19158 graphql_client: self.graphql_client.clone(),
19159 }
19160 }
19161 pub fn with_file_opts(
19169 &self,
19170 path: impl Into<String>,
19171 source: impl IntoID<Id>,
19172 opts: WorkspaceWithFileOpts,
19173 ) -> Workspace {
19174 let mut query = self.selection.select("withFile");
19175 query = query.arg("path", path.into());
19176 query = query.arg_lazy(
19177 "source",
19178 Box::new(move || {
19179 let source = source.clone();
19180 Box::pin(async move { source.into_id().await.unwrap().quote() })
19181 }),
19182 );
19183 if let Some(permissions) = opts.permissions {
19184 query = query.arg("permissions", permissions);
19185 }
19186 Workspace {
19187 proc: self.proc.clone(),
19188 selection: query,
19189 graphql_client: self.graphql_client.clone(),
19190 }
19191 }
19192 pub fn with_new_directory(
19200 &self,
19201 path: impl Into<String>,
19202 source: impl IntoID<Id>,
19203 ) -> Workspace {
19204 let mut query = self.selection.select("withNewDirectory");
19205 query = query.arg("path", path.into());
19206 query = query.arg_lazy(
19207 "source",
19208 Box::new(move || {
19209 let source = source.clone();
19210 Box::pin(async move { source.into_id().await.unwrap().quote() })
19211 }),
19212 );
19213 Workspace {
19214 proc: self.proc.clone(),
19215 selection: query,
19216 graphql_client: self.graphql_client.clone(),
19217 }
19218 }
19219 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19227 let mut query = self.selection.select("withDirectory");
19228 query = query.arg("path", path.into());
19229 query = query.arg_lazy(
19230 "source",
19231 Box::new(move || {
19232 let source = source.clone();
19233 Box::pin(async move { source.into_id().await.unwrap().quote() })
19234 }),
19235 );
19236 Workspace {
19237 proc: self.proc.clone(),
19238 selection: query,
19239 graphql_client: self.graphql_client.clone(),
19240 }
19241 }
19242 pub fn without_file(&self, path: impl Into<String>) -> Workspace {
19248 let mut query = self.selection.select("withoutFile");
19249 query = query.arg("path", path.into());
19250 Workspace {
19251 proc: self.proc.clone(),
19252 selection: query,
19253 graphql_client: self.graphql_client.clone(),
19254 }
19255 }
19256 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Workspace {
19262 let mut query = self.selection.select("withoutFiles");
19263 query = query.arg(
19264 "paths",
19265 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
19266 );
19267 Workspace {
19268 proc: self.proc.clone(),
19269 selection: query,
19270 graphql_client: self.graphql_client.clone(),
19271 }
19272 }
19273 pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
19279 let mut query = self.selection.select("withoutDirectory");
19280 query = query.arg("path", path.into());
19281 Workspace {
19282 proc: self.proc.clone(),
19283 selection: query,
19284 graphql_client: self.graphql_client.clone(),
19285 }
19286 }
19287 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
19293 let mut query = self.selection.select("withChanges");
19294 query = query.arg_lazy(
19295 "changes",
19296 Box::new(move || {
19297 let changes = changes.clone();
19298 Box::pin(async move { changes.into_id().await.unwrap().quote() })
19299 }),
19300 );
19301 Workspace {
19302 proc: self.proc.clone(),
19303 selection: query,
19304 graphql_client: self.graphql_client.clone(),
19305 }
19306 }
19307 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Workspace {
19315 let mut query = self.selection.select("withPatchFile");
19316 query = query.arg_lazy(
19317 "patch",
19318 Box::new(move || {
19319 let patch = patch.clone();
19320 Box::pin(async move { patch.into_id().await.unwrap().quote() })
19321 }),
19322 );
19323 Workspace {
19324 proc: self.proc.clone(),
19325 selection: query,
19326 graphql_client: self.graphql_client.clone(),
19327 }
19328 }
19329 pub fn with_patch_file_opts(
19337 &self,
19338 patch: impl IntoID<Id>,
19339 opts: WorkspaceWithPatchFileOpts,
19340 ) -> Workspace {
19341 let mut query = self.selection.select("withPatchFile");
19342 query = query.arg_lazy(
19343 "patch",
19344 Box::new(move || {
19345 let patch = patch.clone();
19346 Box::pin(async move { patch.into_id().await.unwrap().quote() })
19347 }),
19348 );
19349 if let Some(on_conflict) = opts.on_conflict {
19350 query = query.arg("onConflict", on_conflict);
19351 }
19352 Workspace {
19353 proc: self.proc.clone(),
19354 selection: query,
19355 graphql_client: self.graphql_client.clone(),
19356 }
19357 }
19358 pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
19364 let mut query = self.selection.select("withWorkdir");
19365 query = query.arg("path", path.into());
19366 Workspace {
19367 proc: self.proc.clone(),
19368 selection: query,
19369 graphql_client: self.graphql_client.clone(),
19370 }
19371 }
19372 pub fn with_mounted_directory(
19380 &self,
19381 path: impl Into<String>,
19382 source: impl IntoID<Id>,
19383 ) -> Workspace {
19384 let mut query = self.selection.select("withMountedDirectory");
19385 query = query.arg("path", path.into());
19386 query = query.arg_lazy(
19387 "source",
19388 Box::new(move || {
19389 let source = source.clone();
19390 Box::pin(async move { source.into_id().await.unwrap().quote() })
19391 }),
19392 );
19393 Workspace {
19394 proc: self.proc.clone(),
19395 selection: query,
19396 graphql_client: self.graphql_client.clone(),
19397 }
19398 }
19399 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19407 let mut query = self.selection.select("withMountedFile");
19408 query = query.arg("path", path.into());
19409 query = query.arg_lazy(
19410 "source",
19411 Box::new(move || {
19412 let source = source.clone();
19413 Box::pin(async move { source.into_id().await.unwrap().quote() })
19414 }),
19415 );
19416 Workspace {
19417 proc: self.proc.clone(),
19418 selection: query,
19419 graphql_client: self.graphql_client.clone(),
19420 }
19421 }
19422 pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
19429 let mut query = self.selection.select("withoutMount");
19430 query = query.arg("path", path.into());
19431 Workspace {
19432 proc: self.proc.clone(),
19433 selection: query,
19434 graphql_client: self.graphql_client.clone(),
19435 }
19436 }
19437 pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
19445 let mut query = self.selection.select("withModule");
19446 query = query.arg("ref", r#ref.into());
19447 Workspace {
19448 proc: self.proc.clone(),
19449 selection: query,
19450 graphql_client: self.graphql_client.clone(),
19451 }
19452 }
19453 pub fn with_module_opts<'a>(
19461 &self,
19462 r#ref: impl Into<String>,
19463 opts: WorkspaceWithModuleOpts<'a>,
19464 ) -> Workspace {
19465 let mut query = self.selection.select("withModule");
19466 query = query.arg("ref", r#ref.into());
19467 if let Some(name) = opts.name {
19468 query = query.arg("name", name);
19469 }
19470 if let Some(here) = opts.here {
19471 query = query.arg("here", here);
19472 }
19473 Workspace {
19474 proc: self.proc.clone(),
19475 selection: query,
19476 graphql_client: self.graphql_client.clone(),
19477 }
19478 }
19479 pub fn without_module(&self, name: impl Into<String>) -> Workspace {
19487 let mut query = self.selection.select("withoutModule");
19488 query = query.arg("name", name.into());
19489 Workspace {
19490 proc: self.proc.clone(),
19491 selection: query,
19492 graphql_client: self.graphql_client.clone(),
19493 }
19494 }
19495 pub fn without_module_opts(
19503 &self,
19504 name: impl Into<String>,
19505 opts: WorkspaceWithoutModuleOpts,
19506 ) -> Workspace {
19507 let mut query = self.selection.select("withoutModule");
19508 query = query.arg("name", name.into());
19509 if let Some(here) = opts.here {
19510 query = query.arg("here", here);
19511 }
19512 Workspace {
19513 proc: self.proc.clone(),
19514 selection: query,
19515 graphql_client: self.graphql_client.clone(),
19516 }
19517 }
19518 pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
19525 let mut query = self.selection.select("withSDK");
19526 query = query.arg("ref", r#ref.into());
19527 Workspace {
19528 proc: self.proc.clone(),
19529 selection: query,
19530 graphql_client: self.graphql_client.clone(),
19531 }
19532 }
19533 pub fn with_sdk_opts<'a>(
19540 &self,
19541 r#ref: impl Into<String>,
19542 opts: WorkspaceWithSdkOpts<'a>,
19543 ) -> Workspace {
19544 let mut query = self.selection.select("withSDK");
19545 query = query.arg("ref", r#ref.into());
19546 if let Some(name) = opts.name {
19547 query = query.arg("name", name);
19548 }
19549 if let Some(here) = opts.here {
19550 query = query.arg("here", here);
19551 }
19552 if let Some(as_sdk_name) = opts.as_sdk_name {
19553 query = query.arg("asSdkName", as_sdk_name);
19554 }
19555 Workspace {
19556 proc: self.proc.clone(),
19557 selection: query,
19558 graphql_client: self.graphql_client.clone(),
19559 }
19560 }
19561 pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
19568 let mut query = self.selection.select("withoutSDK");
19569 query = query.arg("name", name.into());
19570 Workspace {
19571 proc: self.proc.clone(),
19572 selection: query,
19573 graphql_client: self.graphql_client.clone(),
19574 }
19575 }
19576 pub fn without_sdk_opts(
19583 &self,
19584 name: impl Into<String>,
19585 opts: WorkspaceWithoutSdkOpts,
19586 ) -> Workspace {
19587 let mut query = self.selection.select("withoutSDK");
19588 query = query.arg("name", name.into());
19589 if let Some(here) = opts.here {
19590 query = query.arg("here", here);
19591 }
19592 Workspace {
19593 proc: self.proc.clone(),
19594 selection: query,
19595 graphql_client: self.graphql_client.clone(),
19596 }
19597 }
19598 pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
19605 let mut query = self.selection.select("withEntrypoint");
19606 query = query.arg("name", name.into());
19607 Workspace {
19608 proc: self.proc.clone(),
19609 selection: query,
19610 graphql_client: self.graphql_client.clone(),
19611 }
19612 }
19613 pub fn without_entrypoint(&self) -> Workspace {
19615 let query = self.selection.select("withoutEntrypoint");
19616 Workspace {
19617 proc: self.proc.clone(),
19618 selection: query,
19619 graphql_client: self.graphql_client.clone(),
19620 }
19621 }
19622 pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
19630 let mut query = self.selection.select("withInitModule");
19631 query = query.arg("sdk", sdk.into());
19632 Workspace {
19633 proc: self.proc.clone(),
19634 selection: query,
19635 graphql_client: self.graphql_client.clone(),
19636 }
19637 }
19638 pub fn with_init_module_opts<'a>(
19646 &self,
19647 sdk: impl Into<String>,
19648 opts: WorkspaceWithInitModuleOpts<'a>,
19649 ) -> Workspace {
19650 let mut query = self.selection.select("withInitModule");
19651 query = query.arg("sdk", sdk.into());
19652 if let Some(name) = opts.name {
19653 query = query.arg("name", name);
19654 }
19655 if let Some(path) = opts.path {
19656 query = query.arg("path", path);
19657 }
19658 if let Some(install) = opts.install {
19659 query = query.arg("install", install);
19660 }
19661 if let Some(entrypoint) = opts.entrypoint {
19662 query = query.arg("entrypoint", entrypoint);
19663 }
19664 if let Some(settings) = opts.settings {
19665 query = query.arg("settings", settings);
19666 }
19667 Workspace {
19668 proc: self.proc.clone(),
19669 selection: query,
19670 graphql_client: self.graphql_client.clone(),
19671 }
19672 }
19673 pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
19679 let mut query = self.selection.select("detectScope");
19680 query = query.arg("sdk", sdk.into());
19681 query.execute(self.graphql_client.clone()).await
19682 }
19683 pub fn with_client(&self, module: impl Into<String>) -> Workspace {
19691 let mut query = self.selection.select("withClient");
19692 query = query.arg("module", module.into());
19693 Workspace {
19694 proc: self.proc.clone(),
19695 selection: query,
19696 graphql_client: self.graphql_client.clone(),
19697 }
19698 }
19699 pub fn with_client_opts<'a>(
19707 &self,
19708 module: impl Into<String>,
19709 opts: WorkspaceWithClientOpts<'a>,
19710 ) -> Workspace {
19711 let mut query = self.selection.select("withClient");
19712 query = query.arg("module", module.into());
19713 if let Some(sdk) = opts.sdk {
19714 query = query.arg("sdk", sdk);
19715 }
19716 if let Some(settings) = opts.settings {
19717 query = query.arg("settings", settings);
19718 }
19719 Workspace {
19720 proc: self.proc.clone(),
19721 selection: query,
19722 graphql_client: self.graphql_client.clone(),
19723 }
19724 }
19725 pub fn without_client(&self, module: impl Into<String>) -> Workspace {
19734 let mut query = self.selection.select("withoutClient");
19735 query = query.arg("module", module.into());
19736 Workspace {
19737 proc: self.proc.clone(),
19738 selection: query,
19739 graphql_client: self.graphql_client.clone(),
19740 }
19741 }
19742 pub fn without_client_opts<'a>(
19751 &self,
19752 module: impl Into<String>,
19753 opts: WorkspaceWithoutClientOpts<'a>,
19754 ) -> Workspace {
19755 let mut query = self.selection.select("withoutClient");
19756 query = query.arg("module", module.into());
19757 if let Some(sdk) = opts.sdk {
19758 query = query.arg("sdk", sdk);
19759 }
19760 Workspace {
19761 proc: self.proc.clone(),
19762 selection: query,
19763 graphql_client: self.graphql_client.clone(),
19764 }
19765 }
19766 pub fn with_updated_clients(&self) -> Workspace {
19774 let query = self.selection.select("withUpdatedClients");
19775 Workspace {
19776 proc: self.proc.clone(),
19777 selection: query,
19778 graphql_client: self.graphql_client.clone(),
19779 }
19780 }
19781 pub fn with_updated_clients_opts<'a>(
19789 &self,
19790 opts: WorkspaceWithUpdatedClientsOpts<'a>,
19791 ) -> Workspace {
19792 let mut query = self.selection.select("withUpdatedClients");
19793 if let Some(modules) = opts.modules {
19794 query = query.arg("modules", modules);
19795 }
19796 if let Some(all) = opts.all {
19797 query = query.arg("all", all);
19798 }
19799 if let Some(sdk) = opts.sdk {
19800 query = query.arg("sdk", sdk);
19801 }
19802 Workspace {
19803 proc: self.proc.clone(),
19804 selection: query,
19805 graphql_client: self.graphql_client.clone(),
19806 }
19807 }
19808 pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
19817 let mut query = self.selection.select("withConfigValue");
19818 query = query.arg("key", key.into());
19819 query = query.arg("value", value.into());
19820 Workspace {
19821 proc: self.proc.clone(),
19822 selection: query,
19823 graphql_client: self.graphql_client.clone(),
19824 }
19825 }
19826 pub fn with_config_value_opts<'a>(
19835 &self,
19836 key: impl Into<String>,
19837 value: impl Into<String>,
19838 opts: WorkspaceWithConfigValueOpts<'a>,
19839 ) -> Workspace {
19840 let mut query = self.selection.select("withConfigValue");
19841 query = query.arg("key", key.into());
19842 query = query.arg("value", value.into());
19843 if let Some(values) = opts.values {
19844 query = query.arg("values", values);
19845 }
19846 if let Some(here) = opts.here {
19847 query = query.arg("here", here);
19848 }
19849 Workspace {
19850 proc: self.proc.clone(),
19851 selection: query,
19852 graphql_client: self.graphql_client.clone(),
19853 }
19854 }
19855 pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
19864 let mut query = self.selection.select("withoutConfigValue");
19865 query = query.arg("key", key.into());
19866 Workspace {
19867 proc: self.proc.clone(),
19868 selection: query,
19869 graphql_client: self.graphql_client.clone(),
19870 }
19871 }
19872 pub fn without_config_value_opts(
19881 &self,
19882 key: impl Into<String>,
19883 opts: WorkspaceWithoutConfigValueOpts,
19884 ) -> Workspace {
19885 let mut query = self.selection.select("withoutConfigValue");
19886 query = query.arg("key", key.into());
19887 if let Some(here) = opts.here {
19888 query = query.arg("here", here);
19889 }
19890 Workspace {
19891 proc: self.proc.clone(),
19892 selection: query,
19893 graphql_client: self.graphql_client.clone(),
19894 }
19895 }
19896 pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
19903 let mut query = self.selection.select("withConfigEnv");
19904 query = query.arg("name", name.into());
19905 Workspace {
19906 proc: self.proc.clone(),
19907 selection: query,
19908 graphql_client: self.graphql_client.clone(),
19909 }
19910 }
19911 pub fn with_config_env_opts(
19918 &self,
19919 name: impl Into<String>,
19920 opts: WorkspaceWithConfigEnvOpts,
19921 ) -> Workspace {
19922 let mut query = self.selection.select("withConfigEnv");
19923 query = query.arg("name", name.into());
19924 if let Some(here) = opts.here {
19925 query = query.arg("here", here);
19926 }
19927 Workspace {
19928 proc: self.proc.clone(),
19929 selection: query,
19930 graphql_client: self.graphql_client.clone(),
19931 }
19932 }
19933 pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
19940 let mut query = self.selection.select("withoutConfigEnv");
19941 query = query.arg("name", name.into());
19942 Workspace {
19943 proc: self.proc.clone(),
19944 selection: query,
19945 graphql_client: self.graphql_client.clone(),
19946 }
19947 }
19948 pub fn without_config_env_opts(
19955 &self,
19956 name: impl Into<String>,
19957 opts: WorkspaceWithoutConfigEnvOpts,
19958 ) -> Workspace {
19959 let mut query = self.selection.select("withoutConfigEnv");
19960 query = query.arg("name", name.into());
19961 if let Some(here) = opts.here {
19962 query = query.arg("here", here);
19963 }
19964 Workspace {
19965 proc: self.proc.clone(),
19966 selection: query,
19967 graphql_client: self.graphql_client.clone(),
19968 }
19969 }
19970 pub fn with_updated_lock(&self) -> Workspace {
19977 let query = self.selection.select("withUpdatedLock");
19978 Workspace {
19979 proc: self.proc.clone(),
19980 selection: query,
19981 graphql_client: self.graphql_client.clone(),
19982 }
19983 }
19984 pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
19991 let mut query = self.selection.select("withUpdatedLock");
19992 if let Some(no_generate) = opts.no_generate {
19993 query = query.arg("noGenerate", no_generate);
19994 }
19995 Workspace {
19996 proc: self.proc.clone(),
19997 selection: query,
19998 graphql_client: self.graphql_client.clone(),
19999 }
20000 }
20001 pub fn with_updated_modules(&self) -> Workspace {
20008 let query = self.selection.select("withUpdatedModules");
20009 Workspace {
20010 proc: self.proc.clone(),
20011 selection: query,
20012 graphql_client: self.graphql_client.clone(),
20013 }
20014 }
20015 pub fn with_updated_modules_opts<'a>(
20022 &self,
20023 opts: WorkspaceWithUpdatedModulesOpts<'a>,
20024 ) -> Workspace {
20025 let mut query = self.selection.select("withUpdatedModules");
20026 if let Some(names) = opts.names {
20027 query = query.arg("names", names);
20028 }
20029 if let Some(version) = opts.version {
20030 query = query.arg("version", version);
20031 }
20032 if let Some(source) = opts.source {
20033 query = query.arg("source", source);
20034 }
20035 Workspace {
20036 proc: self.proc.clone(),
20037 selection: query,
20038 graphql_client: self.graphql_client.clone(),
20039 }
20040 }
20041 pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
20043 let query = self.selection.select("sdks");
20044 let query = query.select("id");
20045 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20046 Ok(ids
20047 .into_iter()
20048 .map(|id| WorkspaceSdk {
20049 proc: self.proc.clone(),
20050 selection: crate::querybuilder::query()
20051 .select("node")
20052 .arg("id", &id.0)
20053 .inline_fragment("WorkspaceSDK"),
20054 graphql_client: self.graphql_client.clone(),
20055 })
20056 .collect())
20057 }
20058 pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
20064 let mut query = self.selection.select("sdk");
20065 query = query.arg("name", name.into());
20066 WorkspaceSdk {
20067 proc: self.proc.clone(),
20068 selection: query,
20069 graphql_client: self.graphql_client.clone(),
20070 }
20071 }
20072 pub fn changes(&self) -> Changeset {
20079 let query = self.selection.select("changes");
20080 Changeset {
20081 proc: self.proc.clone(),
20082 selection: query,
20083 graphql_client: self.graphql_client.clone(),
20084 }
20085 }
20086 pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
20093 let mut query = self.selection.select("changes");
20094 if let Some(from) = opts.from {
20095 query = query.arg("from", from);
20096 }
20097 Changeset {
20098 proc: self.proc.clone(),
20099 selection: query,
20100 graphql_client: self.graphql_client.clone(),
20101 }
20102 }
20103 pub async fn export(&self) -> Result<Void, DaggerError> {
20112 let query = self.selection.select("export");
20113 query.execute(self.graphql_client.clone()).await
20114 }
20115 pub async fn export_opts<'a>(
20124 &self,
20125 opts: WorkspaceExportOpts<'a>,
20126 ) -> Result<Void, DaggerError> {
20127 let mut query = self.selection.select("export");
20128 if let Some(path) = opts.path {
20129 query = query.arg("path", path);
20130 }
20131 if let Some(from) = opts.from {
20132 query = query.arg("from", from);
20133 }
20134 query.execute(self.graphql_client.clone()).await
20135 }
20136 pub async fn config_read(&self) -> Result<String, DaggerError> {
20145 let query = self.selection.select("configRead");
20146 query.execute(self.graphql_client.clone()).await
20147 }
20148 pub async fn config_read_opts<'a>(
20157 &self,
20158 opts: WorkspaceConfigReadOpts<'a>,
20159 ) -> Result<String, DaggerError> {
20160 let mut query = self.selection.select("configRead");
20161 if let Some(key) = opts.key {
20162 query = query.arg("key", key);
20163 }
20164 if let Some(effective) = opts.effective {
20165 query = query.arg("effective", effective);
20166 }
20167 query.execute(self.graphql_client.clone()).await
20168 }
20169 pub async fn entrypoint(&self) -> Result<String, DaggerError> {
20172 let query = self.selection.select("entrypoint");
20173 query.execute(self.graphql_client.clone()).await
20174 }
20175 pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
20177 let query = self.selection.select("envList");
20178 query.execute(self.graphql_client.clone()).await
20179 }
20180 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20183 let query = self.selection.select("modules");
20184 let query = query.select("id");
20185 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20186 Ok(ids
20187 .into_iter()
20188 .map(|id| WorkspaceModule {
20189 proc: self.proc.clone(),
20190 selection: crate::querybuilder::query()
20191 .select("node")
20192 .arg("id", &id.0)
20193 .inline_fragment("WorkspaceModule"),
20194 graphql_client: self.graphql_client.clone(),
20195 })
20196 .collect())
20197 }
20198 pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
20205 let mut query = self.selection.select("module");
20206 query = query.arg("name", name.into());
20207 WorkspaceModule {
20208 proc: self.proc.clone(),
20209 selection: query,
20210 graphql_client: self.graphql_client.clone(),
20211 }
20212 }
20213 pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
20221 let mut query = self.selection.select("moduleSource");
20222 query = query.arg("path", path.into());
20223 ModuleSource {
20224 proc: self.proc.clone(),
20225 selection: query,
20226 graphql_client: self.graphql_client.clone(),
20227 }
20228 }
20229 pub async fn cwd(&self) -> Result<String, DaggerError> {
20233 let query = self.selection.select("cwd");
20234 query.execute(self.graphql_client.clone()).await
20235 }
20236 pub fn artifacts(&self) -> Artifacts {
20242 let query = self.selection.select("artifacts");
20243 Artifacts {
20244 proc: self.proc.clone(),
20245 selection: query,
20246 graphql_client: self.graphql_client.clone(),
20247 }
20248 }
20249 pub fn artifacts_opts<'a>(&self, opts: WorkspaceArtifactsOpts<'a>) -> Artifacts {
20255 let mut query = self.selection.select("artifacts");
20256 if let Some(include) = opts.include {
20257 query = query.arg("include", include);
20258 }
20259 Artifacts {
20260 proc: self.proc.clone(),
20261 selection: query,
20262 graphql_client: self.graphql_client.clone(),
20263 }
20264 }
20265 pub fn migrate(&self) -> WorkspaceMigration {
20273 let query = self.selection.select("migrate");
20274 WorkspaceMigration {
20275 proc: self.proc.clone(),
20276 selection: query,
20277 graphql_client: self.graphql_client.clone(),
20278 }
20279 }
20280 pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
20288 let mut query = self.selection.select("migrate");
20289 if let Some(modules) = opts.modules {
20290 query = query.arg("modules", modules);
20291 }
20292 WorkspaceMigration {
20293 proc: self.proc.clone(),
20294 selection: query,
20295 graphql_client: self.graphql_client.clone(),
20296 }
20297 }
20298 pub async fn address(&self) -> Result<String, DaggerError> {
20300 let query = self.selection.select("address");
20301 query.execute(self.graphql_client.clone()).await
20302 }
20303}
20304impl Node for Workspace {
20305 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20306 let query = self.selection.select("id");
20307 let graphql_client = self.graphql_client.clone();
20308 async move { query.execute(graphql_client).await }
20309 }
20310}
20311#[derive(Clone)]
20312pub struct WorkspaceCommitPick {
20313 pub proc: Option<Arc<DaggerSessionProc>>,
20314 pub selection: Selection,
20315 pub graphql_client: DynGraphQLClient,
20316}
20317impl IntoID<Id> for WorkspaceCommitPick {
20318 fn into_id(
20319 self,
20320 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20321 Box::pin(async move { self.id().await })
20322 }
20323}
20324impl Loadable for WorkspaceCommitPick {
20325 fn graphql_type() -> &'static str {
20326 "WorkspaceCommitPick"
20327 }
20328 fn from_query(
20329 proc: Option<Arc<DaggerSessionProc>>,
20330 selection: Selection,
20331 graphql_client: DynGraphQLClient,
20332 ) -> Self {
20333 Self {
20334 proc,
20335 selection,
20336 graphql_client,
20337 }
20338 }
20339}
20340impl WorkspaceCommitPick {
20341 pub async fn id(&self) -> Result<Id, DaggerError> {
20343 let query = self.selection.select("id");
20344 query.execute(self.graphql_client.clone()).await
20345 }
20346 pub fn commit(&self) -> GitCommit {
20348 let query = self.selection.select("commit");
20349 GitCommit {
20350 proc: self.proc.clone(),
20351 selection: query,
20352 graphql_client: self.graphql_client.clone(),
20353 }
20354 }
20355 pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
20357 let query = self.selection.select("status");
20358 query.execute(self.graphql_client.clone()).await
20359 }
20360 pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
20362 let query = self.selection.select("reason");
20363 query.execute(self.graphql_client.clone()).await
20364 }
20365 pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
20367 let query = self.selection.select("conflictPaths");
20368 query.execute(self.graphql_client.clone()).await
20369 }
20370}
20371impl Node for WorkspaceCommitPick {
20372 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20373 let query = self.selection.select("id");
20374 let graphql_client = self.graphql_client.clone();
20375 async move { query.execute(graphql_client).await }
20376 }
20377}
20378#[derive(Clone)]
20379pub struct WorkspaceGit {
20380 pub proc: Option<Arc<DaggerSessionProc>>,
20381 pub selection: Selection,
20382 pub graphql_client: DynGraphQLClient,
20383}
20384impl IntoID<Id> for WorkspaceGit {
20385 fn into_id(
20386 self,
20387 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20388 Box::pin(async move { self.id().await })
20389 }
20390}
20391impl Loadable for WorkspaceGit {
20392 fn graphql_type() -> &'static str {
20393 "WorkspaceGit"
20394 }
20395 fn from_query(
20396 proc: Option<Arc<DaggerSessionProc>>,
20397 selection: Selection,
20398 graphql_client: DynGraphQLClient,
20399 ) -> Self {
20400 Self {
20401 proc,
20402 selection,
20403 graphql_client,
20404 }
20405 }
20406}
20407impl WorkspaceGit {
20408 pub async fn id(&self) -> Result<Id, DaggerError> {
20410 let query = self.selection.select("id");
20411 query.execute(self.graphql_client.clone()).await
20412 }
20413 pub fn head(&self) -> GitRef {
20415 let query = self.selection.select("head");
20416 GitRef {
20417 proc: self.proc.clone(),
20418 selection: query,
20419 graphql_client: self.graphql_client.clone(),
20420 }
20421 }
20422 pub fn directory(&self) -> Directory {
20426 let query = self.selection.select("directory");
20427 Directory {
20428 proc: self.proc.clone(),
20429 selection: query,
20430 graphql_client: self.graphql_client.clone(),
20431 }
20432 }
20433 pub fn uncommitted(&self) -> Changeset {
20435 let query = self.selection.select("uncommitted");
20436 Changeset {
20437 proc: self.proc.clone(),
20438 selection: query,
20439 graphql_client: self.graphql_client.clone(),
20440 }
20441 }
20442}
20443impl Node for WorkspaceGit {
20444 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20445 let query = self.selection.select("id");
20446 let graphql_client = self.graphql_client.clone();
20447 async move { query.execute(graphql_client).await }
20448 }
20449}
20450#[derive(Clone)]
20451pub struct WorkspaceMigration {
20452 pub proc: Option<Arc<DaggerSessionProc>>,
20453 pub selection: Selection,
20454 pub graphql_client: DynGraphQLClient,
20455}
20456impl IntoID<Id> for WorkspaceMigration {
20457 fn into_id(
20458 self,
20459 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20460 Box::pin(async move { self.id().await })
20461 }
20462}
20463impl Loadable for WorkspaceMigration {
20464 fn graphql_type() -> &'static str {
20465 "WorkspaceMigration"
20466 }
20467 fn from_query(
20468 proc: Option<Arc<DaggerSessionProc>>,
20469 selection: Selection,
20470 graphql_client: DynGraphQLClient,
20471 ) -> Self {
20472 Self {
20473 proc,
20474 selection,
20475 graphql_client,
20476 }
20477 }
20478}
20479impl WorkspaceMigration {
20480 pub async fn id(&self) -> Result<Id, DaggerError> {
20482 let query = self.selection.select("id");
20483 query.execute(self.graphql_client.clone()).await
20484 }
20485 pub fn changes(&self) -> Changeset {
20487 let query = self.selection.select("changes");
20488 Changeset {
20489 proc: self.proc.clone(),
20490 selection: query,
20491 graphql_client: self.graphql_client.clone(),
20492 }
20493 }
20494 pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
20496 let query = self.selection.select("steps");
20497 let query = query.select("id");
20498 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20499 Ok(ids
20500 .into_iter()
20501 .map(|id| WorkspaceMigrationStep {
20502 proc: self.proc.clone(),
20503 selection: crate::querybuilder::query()
20504 .select("node")
20505 .arg("id", &id.0)
20506 .inline_fragment("WorkspaceMigrationStep"),
20507 graphql_client: self.graphql_client.clone(),
20508 })
20509 .collect())
20510 }
20511 pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
20513 let query = self.selection.select("moduleCandidates");
20514 query.execute(self.graphql_client.clone()).await
20515 }
20516 pub async fn config_file(&self) -> Result<String, DaggerError> {
20518 let query = self.selection.select("configFile");
20519 query.execute(self.graphql_client.clone()).await
20520 }
20521}
20522impl Node for WorkspaceMigration {
20523 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20524 let query = self.selection.select("id");
20525 let graphql_client = self.graphql_client.clone();
20526 async move { query.execute(graphql_client).await }
20527 }
20528}
20529#[derive(Clone)]
20530pub struct WorkspaceMigrationStep {
20531 pub proc: Option<Arc<DaggerSessionProc>>,
20532 pub selection: Selection,
20533 pub graphql_client: DynGraphQLClient,
20534}
20535impl IntoID<Id> for WorkspaceMigrationStep {
20536 fn into_id(
20537 self,
20538 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20539 Box::pin(async move { self.id().await })
20540 }
20541}
20542impl Loadable for WorkspaceMigrationStep {
20543 fn graphql_type() -> &'static str {
20544 "WorkspaceMigrationStep"
20545 }
20546 fn from_query(
20547 proc: Option<Arc<DaggerSessionProc>>,
20548 selection: Selection,
20549 graphql_client: DynGraphQLClient,
20550 ) -> Self {
20551 Self {
20552 proc,
20553 selection,
20554 graphql_client,
20555 }
20556 }
20557}
20558impl WorkspaceMigrationStep {
20559 pub async fn id(&self) -> Result<Id, DaggerError> {
20561 let query = self.selection.select("id");
20562 query.execute(self.graphql_client.clone()).await
20563 }
20564 pub async fn code(&self) -> Result<String, DaggerError> {
20566 let query = self.selection.select("code");
20567 query.execute(self.graphql_client.clone()).await
20568 }
20569 pub async fn description(&self) -> Result<String, DaggerError> {
20571 let query = self.selection.select("description");
20572 query.execute(self.graphql_client.clone()).await
20573 }
20574 pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
20576 let query = self.selection.select("warnings");
20577 query.execute(self.graphql_client.clone()).await
20578 }
20579 pub fn changes(&self) -> Changeset {
20581 let query = self.selection.select("changes");
20582 Changeset {
20583 proc: self.proc.clone(),
20584 selection: query,
20585 graphql_client: self.graphql_client.clone(),
20586 }
20587 }
20588}
20589impl Node for WorkspaceMigrationStep {
20590 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20591 let query = self.selection.select("id");
20592 let graphql_client = self.graphql_client.clone();
20593 async move { query.execute(graphql_client).await }
20594 }
20595}
20596#[derive(Clone)]
20597pub struct WorkspaceModule {
20598 pub proc: Option<Arc<DaggerSessionProc>>,
20599 pub selection: Selection,
20600 pub graphql_client: DynGraphQLClient,
20601}
20602impl IntoID<Id> for WorkspaceModule {
20603 fn into_id(
20604 self,
20605 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20606 Box::pin(async move { self.id().await })
20607 }
20608}
20609impl Loadable for WorkspaceModule {
20610 fn graphql_type() -> &'static str {
20611 "WorkspaceModule"
20612 }
20613 fn from_query(
20614 proc: Option<Arc<DaggerSessionProc>>,
20615 selection: Selection,
20616 graphql_client: DynGraphQLClient,
20617 ) -> Self {
20618 Self {
20619 proc,
20620 selection,
20621 graphql_client,
20622 }
20623 }
20624}
20625impl WorkspaceModule {
20626 pub async fn id(&self) -> Result<Id, DaggerError> {
20628 let query = self.selection.select("id");
20629 query.execute(self.graphql_client.clone()).await
20630 }
20631 pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
20633 let query = self.selection.select("settings");
20634 let query = query.select("id");
20635 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20636 Ok(ids
20637 .into_iter()
20638 .map(|id| WorkspaceModuleSetting {
20639 proc: self.proc.clone(),
20640 selection: crate::querybuilder::query()
20641 .select("node")
20642 .arg("id", &id.0)
20643 .inline_fragment("WorkspaceModuleSetting"),
20644 graphql_client: self.graphql_client.clone(),
20645 })
20646 .collect())
20647 }
20648 pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
20650 let query = self.selection.select("functions");
20651 query.execute(self.graphql_client.clone()).await
20652 }
20653 pub async fn name(&self) -> Result<String, DaggerError> {
20655 let query = self.selection.select("name");
20656 query.execute(self.graphql_client.clone()).await
20657 }
20658 pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
20660 let query = self.selection.select("entrypoint");
20661 query.execute(self.graphql_client.clone()).await
20662 }
20663 pub async fn source(&self) -> Result<String, DaggerError> {
20665 let query = self.selection.select("source");
20666 query.execute(self.graphql_client.clone()).await
20667 }
20668}
20669impl Node for WorkspaceModule {
20670 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20671 let query = self.selection.select("id");
20672 let graphql_client = self.graphql_client.clone();
20673 async move { query.execute(graphql_client).await }
20674 }
20675}
20676#[derive(Clone)]
20677pub struct WorkspaceModuleSetting {
20678 pub proc: Option<Arc<DaggerSessionProc>>,
20679 pub selection: Selection,
20680 pub graphql_client: DynGraphQLClient,
20681}
20682impl IntoID<Id> for WorkspaceModuleSetting {
20683 fn into_id(
20684 self,
20685 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20686 Box::pin(async move { self.id().await })
20687 }
20688}
20689impl Loadable for WorkspaceModuleSetting {
20690 fn graphql_type() -> &'static str {
20691 "WorkspaceModuleSetting"
20692 }
20693 fn from_query(
20694 proc: Option<Arc<DaggerSessionProc>>,
20695 selection: Selection,
20696 graphql_client: DynGraphQLClient,
20697 ) -> Self {
20698 Self {
20699 proc,
20700 selection,
20701 graphql_client,
20702 }
20703 }
20704}
20705impl WorkspaceModuleSetting {
20706 pub async fn id(&self) -> Result<Id, DaggerError> {
20708 let query = self.selection.select("id");
20709 query.execute(self.graphql_client.clone()).await
20710 }
20711 pub async fn key(&self) -> Result<String, DaggerError> {
20713 let query = self.selection.select("key");
20714 query.execute(self.graphql_client.clone()).await
20715 }
20716 pub async fn value(&self) -> Result<String, DaggerError> {
20718 let query = self.selection.select("value");
20719 query.execute(self.graphql_client.clone()).await
20720 }
20721 pub async fn description(&self) -> Result<String, DaggerError> {
20723 let query = self.selection.select("description");
20724 query.execute(self.graphql_client.clone()).await
20725 }
20726 pub async fn default_value(&self) -> Result<String, DaggerError> {
20728 let query = self.selection.select("defaultValue");
20729 query.execute(self.graphql_client.clone()).await
20730 }
20731 pub async fn is_string(&self) -> Result<bool, DaggerError> {
20733 let query = self.selection.select("isString");
20734 query.execute(self.graphql_client.clone()).await
20735 }
20736 pub async fn is_list(&self) -> Result<bool, DaggerError> {
20738 let query = self.selection.select("isList");
20739 query.execute(self.graphql_client.clone()).await
20740 }
20741 pub async fn is_object(&self) -> Result<bool, DaggerError> {
20743 let query = self.selection.select("isObject");
20744 query.execute(self.graphql_client.clone()).await
20745 }
20746}
20747impl Node for WorkspaceModuleSetting {
20748 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20749 let query = self.selection.select("id");
20750 let graphql_client = self.graphql_client.clone();
20751 async move { query.execute(graphql_client).await }
20752 }
20753}
20754#[derive(Clone)]
20755pub struct WorkspaceSdk {
20756 pub proc: Option<Arc<DaggerSessionProc>>,
20757 pub selection: Selection,
20758 pub graphql_client: DynGraphQLClient,
20759}
20760impl IntoID<Id> for WorkspaceSdk {
20761 fn into_id(
20762 self,
20763 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20764 Box::pin(async move { self.id().await })
20765 }
20766}
20767impl Loadable for WorkspaceSdk {
20768 fn graphql_type() -> &'static str {
20769 "WorkspaceSDK"
20770 }
20771 fn from_query(
20772 proc: Option<Arc<DaggerSessionProc>>,
20773 selection: Selection,
20774 graphql_client: DynGraphQLClient,
20775 ) -> Self {
20776 Self {
20777 proc,
20778 selection,
20779 graphql_client,
20780 }
20781 }
20782}
20783impl WorkspaceSdk {
20784 pub async fn id(&self) -> Result<Id, DaggerError> {
20786 let query = self.selection.select("id");
20787 query.execute(self.graphql_client.clone()).await
20788 }
20789 pub fn generate(&self) -> Changeset {
20791 let query = self.selection.select("generate");
20792 Changeset {
20793 proc: self.proc.clone(),
20794 selection: query,
20795 graphql_client: self.graphql_client.clone(),
20796 }
20797 }
20798 pub async fn name(&self) -> Result<String, DaggerError> {
20800 let query = self.selection.select("name");
20801 query.execute(self.graphql_client.clone()).await
20802 }
20803 pub async fn r#ref(&self) -> Result<String, DaggerError> {
20805 let query = self.selection.select("ref");
20806 query.execute(self.graphql_client.clone()).await
20807 }
20808 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20810 let query = self.selection.select("modules");
20811 let query = query.select("id");
20812 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20813 Ok(ids
20814 .into_iter()
20815 .map(|id| WorkspaceModule {
20816 proc: self.proc.clone(),
20817 selection: crate::querybuilder::query()
20818 .select("node")
20819 .arg("id", &id.0)
20820 .inline_fragment("WorkspaceModule"),
20821 graphql_client: self.graphql_client.clone(),
20822 })
20823 .collect())
20824 }
20825 pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20827 let query = self.selection.select("clients");
20828 let query = query.select("id");
20829 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20830 Ok(ids
20831 .into_iter()
20832 .map(|id| WorkspaceModule {
20833 proc: self.proc.clone(),
20834 selection: crate::querybuilder::query()
20835 .select("node")
20836 .arg("id", &id.0)
20837 .inline_fragment("WorkspaceModule"),
20838 graphql_client: self.graphql_client.clone(),
20839 })
20840 .collect())
20841 }
20842}
20843impl Node for WorkspaceSdk {
20844 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20845 let query = self.selection.select("id");
20846 let graphql_client = self.graphql_client.clone();
20847 async move { query.execute(graphql_client).await }
20848 }
20849}
20850#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20851pub enum AgentMessageDelivery {
20852 #[serde(rename = "QUEUED")]
20853 Queued,
20854 #[serde(rename = "STARTED")]
20855 Started,
20856 #[serde(rename = "STEERED")]
20857 Steered,
20858}
20859#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20860pub enum AgentState {
20861 #[serde(rename = "FAILED")]
20862 Failed,
20863 #[serde(rename = "IDLE")]
20864 Idle,
20865 #[serde(rename = "PAUSED")]
20866 Paused,
20867 #[serde(rename = "RUNNING")]
20868 Running,
20869 #[serde(rename = "STOPPED")]
20870 Stopped,
20871 #[serde(rename = "WAITING_INPUT")]
20872 WaitingInput,
20873}
20874#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20875pub enum ArtifactDimensionKind {
20876 #[serde(rename = "COLLECTION")]
20877 Collection,
20878 #[serde(rename = "MODULE")]
20879 Module,
20880 #[serde(rename = "TYPE")]
20881 Type,
20882}
20883#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20884pub enum CacheSharingMode {
20885 #[serde(rename = "LOCKED")]
20886 Locked,
20887 #[serde(rename = "PRIVATE")]
20888 Private,
20889 #[serde(rename = "SHARED")]
20890 Shared,
20891}
20892#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20893pub enum ChangesetMergeConflict {
20894 #[serde(rename = "FAIL")]
20895 Fail,
20896 #[serde(rename = "FAIL_EARLY")]
20897 FailEarly,
20898 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
20899 LeaveConflictMarkers,
20900 #[serde(rename = "PREFER_OURS")]
20901 PreferOurs,
20902 #[serde(rename = "PREFER_THEIRS")]
20903 PreferTheirs,
20904}
20905#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20906pub enum ChangesetsMergeConflict {
20907 #[serde(rename = "FAIL")]
20908 Fail,
20909 #[serde(rename = "FAIL_EARLY")]
20910 FailEarly,
20911}
20912#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20913pub enum DiffStatKind {
20914 #[serde(rename = "ADDED")]
20915 Added,
20916 #[serde(rename = "MODIFIED")]
20917 Modified,
20918 #[serde(rename = "REMOVED")]
20919 Removed,
20920 #[serde(rename = "RENAMED")]
20921 Renamed,
20922}
20923#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20924pub enum ExistsType {
20925 #[serde(rename = "DIRECTORY_TYPE")]
20926 DirectoryType,
20927 #[serde(rename = "REGULAR_TYPE")]
20928 RegularType,
20929 #[serde(rename = "SYMLINK_TYPE")]
20930 SymlinkType,
20931}
20932#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20933pub enum FileType {
20934 #[serde(rename = "DIRECTORY")]
20935 Directory,
20936 #[serde(rename = "DIRECTORY_TYPE")]
20937 DirectoryType,
20938 #[serde(rename = "REGULAR")]
20939 Regular,
20940 #[serde(rename = "REGULAR_TYPE")]
20941 RegularType,
20942 #[serde(rename = "SYMLINK")]
20943 Symlink,
20944 #[serde(rename = "SYMLINK_TYPE")]
20945 SymlinkType,
20946 #[serde(rename = "UNKNOWN")]
20947 Unknown,
20948}
20949#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20950pub enum FunctionCachePolicy {
20951 #[serde(rename = "Default")]
20952 Default,
20953 #[serde(rename = "Never")]
20954 Never,
20955 #[serde(rename = "PerSession")]
20956 PerSession,
20957}
20958#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20959pub enum GitPushDisposition {
20960 #[serde(rename = "CREATED")]
20961 Created,
20962 #[serde(rename = "FAST_FORWARD")]
20963 FastForward,
20964 #[serde(rename = "FORCED")]
20965 Forced,
20966 #[serde(rename = "UP_TO_DATE")]
20967 UpToDate,
20968}
20969#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20970pub enum ImageLayerCompression {
20971 #[serde(rename = "EStarGZ")]
20972 EStarGz,
20973 #[serde(rename = "ESTARGZ")]
20974 Estargz,
20975 #[serde(rename = "Gzip")]
20976 Gzip,
20977 #[serde(rename = "Uncompressed")]
20978 Uncompressed,
20979 #[serde(rename = "Zstd")]
20980 Zstd,
20981}
20982#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20983pub enum ImageMediaTypes {
20984 #[serde(rename = "DOCKER")]
20985 Docker,
20986 #[serde(rename = "DockerMediaTypes")]
20987 DockerMediaTypes,
20988 #[serde(rename = "OCI")]
20989 Oci,
20990 #[serde(rename = "OCIMediaTypes")]
20991 OciMediaTypes,
20992}
20993#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
20994pub enum LlmContentBlockKind {
20995 #[serde(rename = "AUDIO")]
20996 Audio,
20997 #[serde(rename = "DOCUMENT")]
20998 Document,
20999 #[serde(rename = "IMAGE")]
21000 Image,
21001 #[serde(rename = "TEXT")]
21002 Text,
21003 #[serde(rename = "THINKING")]
21004 Thinking,
21005 #[serde(rename = "TOOL_CALL")]
21006 ToolCall,
21007 #[serde(rename = "TOOL_RESULT")]
21008 ToolResult,
21009}
21010#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21011pub enum LlmMessageOriginKind {
21012 #[serde(rename = "AGENT")]
21013 Agent,
21014 #[serde(rename = "EVENT")]
21015 Event,
21016 #[serde(rename = "USER")]
21017 User,
21018}
21019#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21020pub enum LlmMessageRole {
21021 #[serde(rename = "ASSISTANT")]
21022 Assistant,
21023 #[serde(rename = "SYSTEM")]
21024 System,
21025 #[serde(rename = "USER")]
21026 User,
21027}
21028#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21029pub enum ModuleSourceExperimentalFeature {
21030 #[serde(rename = "SELF_CALLS")]
21031 SelfCalls,
21032}
21033#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21034pub enum ModuleSourceKind {
21035 #[serde(rename = "DIR")]
21036 Dir,
21037 #[serde(rename = "DIR_SOURCE")]
21038 DirSource,
21039 #[serde(rename = "GIT")]
21040 Git,
21041 #[serde(rename = "GIT_SOURCE")]
21042 GitSource,
21043 #[serde(rename = "LOCAL")]
21044 Local,
21045 #[serde(rename = "LOCAL_SOURCE")]
21046 LocalSource,
21047}
21048#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21049pub enum NetworkProtocol {
21050 #[serde(rename = "TCP")]
21051 Tcp,
21052 #[serde(rename = "UDP")]
21053 Udp,
21054}
21055#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21056pub enum PatchConflict {
21057 #[serde(rename = "FAIL")]
21058 Fail,
21059 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21060 LeaveConflictMarkers,
21061}
21062#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21063pub enum RegistryProtocol {
21064 #[serde(rename = "HTTP")]
21065 Http,
21066 #[serde(rename = "HTTPS")]
21067 Https,
21068}
21069#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21070pub enum ReturnType {
21071 #[serde(rename = "ANY")]
21072 Any,
21073 #[serde(rename = "FAILURE")]
21074 Failure,
21075 #[serde(rename = "SUCCESS")]
21076 Success,
21077}
21078#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21079pub enum TypeDefKind {
21080 #[serde(rename = "BOOLEAN")]
21081 Boolean,
21082 #[serde(rename = "BOOLEAN_KIND")]
21083 BooleanKind,
21084 #[serde(rename = "ENUM")]
21085 Enum,
21086 #[serde(rename = "ENUM_KIND")]
21087 EnumKind,
21088 #[serde(rename = "FLOAT")]
21089 Float,
21090 #[serde(rename = "FLOAT_KIND")]
21091 FloatKind,
21092 #[serde(rename = "INPUT")]
21093 Input,
21094 #[serde(rename = "INPUT_KIND")]
21095 InputKind,
21096 #[serde(rename = "INTEGER")]
21097 Integer,
21098 #[serde(rename = "INTEGER_KIND")]
21099 IntegerKind,
21100 #[serde(rename = "INTERFACE")]
21101 Interface,
21102 #[serde(rename = "INTERFACE_KIND")]
21103 InterfaceKind,
21104 #[serde(rename = "LIST")]
21105 List,
21106 #[serde(rename = "LIST_KIND")]
21107 ListKind,
21108 #[serde(rename = "OBJECT")]
21109 Object,
21110 #[serde(rename = "OBJECT_KIND")]
21111 ObjectKind,
21112 #[serde(rename = "SCALAR")]
21113 Scalar,
21114 #[serde(rename = "SCALAR_KIND")]
21115 ScalarKind,
21116 #[serde(rename = "STRING")]
21117 String,
21118 #[serde(rename = "STRING_KIND")]
21119 StringKind,
21120 #[serde(rename = "VOID")]
21121 Void,
21122 #[serde(rename = "VOID_KIND")]
21123 VoidKind,
21124}
21125#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21126pub enum WorkspaceCommitPickReason {
21127 #[serde(rename = "CONTENT")]
21128 Content,
21129 #[serde(rename = "DIRTY")]
21130 Dirty,
21131 #[serde(rename = "NONE")]
21132 None,
21133}
21134#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21135pub enum WorkspaceCommitPickStatus {
21136 #[serde(rename = "CONFLICT")]
21137 Conflict,
21138 #[serde(rename = "PICKABLE")]
21139 Pickable,
21140 #[serde(rename = "PICKED")]
21141 Picked,
21142 #[serde(rename = "REDUNDANT")]
21143 Redundant,
21144}