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 parent(&self) -> Result<Option<Agent>, DaggerError> {
683 let query = self.selection.select("parent");
684 let query = query.select("id");
685 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
686 Ok(id.map(|id| Agent {
687 proc: self.proc.clone(),
688 selection: query
689 .root()
690 .select("node")
691 .arg("id", &id.0)
692 .inline_fragment("Agent"),
693 graphql_client: self.graphql_client.clone(),
694 }))
695 }
696 pub async fn name(&self) -> Result<String, DaggerError> {
698 let query = self.selection.select("name");
699 query.execute(self.graphql_client.clone()).await
700 }
701 pub async fn handle(&self) -> Result<String, DaggerError> {
704 let query = self.selection.select("handle");
705 query.execute(self.graphql_client.clone()).await
706 }
707 pub async fn state(&self) -> Result<AgentState, DaggerError> {
710 let query = self.selection.select("state");
711 query.execute(self.graphql_client.clone()).await
712 }
713 pub async fn error(&self) -> Result<String, DaggerError> {
716 let query = self.selection.select("error");
717 query.execute(self.graphql_client.clone()).await
718 }
719 pub fn seed(&self) -> Llm {
723 let query = self.selection.select("seed");
724 Llm {
725 proc: self.proc.clone(),
726 selection: query,
727 graphql_client: self.graphql_client.clone(),
728 }
729 }
730 pub fn snapshot(&self) -> Llm {
734 let query = self.selection.select("snapshot");
735 Llm {
736 proc: self.proc.clone(),
737 selection: query,
738 graphql_client: self.graphql_client.clone(),
739 }
740 }
741 pub async fn send(&self, message: impl Into<String>) -> Result<AgentMessage, DaggerError> {
751 let mut query = self.selection.select("send");
752 query = query.arg("message", message.into());
753 let id: Id = query.execute(self.graphql_client.clone()).await?;
754 Ok(AgentMessage {
755 proc: self.proc.clone(),
756 selection: query
757 .root()
758 .select("node")
759 .arg("id", &id.0)
760 .inline_fragment("AgentMessage"),
761 graphql_client: self.graphql_client.clone(),
762 })
763 }
764 pub async fn send_opts<'a>(
774 &self,
775 message: impl Into<String>,
776 opts: AgentSendOpts<'a>,
777 ) -> Result<AgentMessage, DaggerError> {
778 let mut query = self.selection.select("send");
779 query = query.arg("message", message.into());
780 if let Some(reply_to) = opts.reply_to {
781 query = query.arg("replyTo", reply_to);
782 }
783 if let Some(content) = opts.content {
784 query = query.arg("content", content);
785 }
786 let id: Id = query.execute(self.graphql_client.clone()).await?;
787 Ok(AgentMessage {
788 proc: self.proc.clone(),
789 selection: query
790 .root()
791 .select("node")
792 .arg("id", &id.0)
793 .inline_fragment("AgentMessage"),
794 graphql_client: self.graphql_client.clone(),
795 })
796 }
797 pub fn message(&self, r#ref: impl Into<String>) -> AgentMessage {
805 let mut query = self.selection.select("message");
806 query = query.arg("ref", r#ref.into());
807 AgentMessage {
808 proc: self.proc.clone(),
809 selection: query,
810 graphql_client: self.graphql_client.clone(),
811 }
812 }
813 pub async fn pause(&self) -> Result<Agent, DaggerError> {
821 let query = self.selection.select("pause");
822 let id: Id = query.execute(self.graphql_client.clone()).await?;
823 Ok(Agent {
824 proc: self.proc.clone(),
825 selection: query
826 .root()
827 .select("node")
828 .arg("id", &id.0)
829 .inline_fragment("Agent"),
830 graphql_client: self.graphql_client.clone(),
831 })
832 }
833 pub async fn pause_opts(&self, opts: AgentPauseOpts) -> Result<Agent, DaggerError> {
841 let mut query = self.selection.select("pause");
842 if let Some(interrupt) = opts.interrupt {
843 query = query.arg("interrupt", interrupt);
844 }
845 let id: Id = query.execute(self.graphql_client.clone()).await?;
846 Ok(Agent {
847 proc: self.proc.clone(),
848 selection: query
849 .root()
850 .select("node")
851 .arg("id", &id.0)
852 .inline_fragment("Agent"),
853 graphql_client: self.graphql_client.clone(),
854 })
855 }
856 pub async fn resume(&self) -> Result<Agent, DaggerError> {
860 let query = self.selection.select("resume");
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 wait(&self) -> Result<Agent, DaggerError> {
875 let query = self.selection.select("wait");
876 let id: Id = query.execute(self.graphql_client.clone()).await?;
877 Ok(Agent {
878 proc: self.proc.clone(),
879 selection: query
880 .root()
881 .select("node")
882 .arg("id", &id.0)
883 .inline_fragment("Agent"),
884 graphql_client: self.graphql_client.clone(),
885 })
886 }
887 pub async fn notify(&self, subscriber: impl IntoID<Id>) -> Result<Agent, DaggerError> {
898 let mut query = self.selection.select("notify");
899 query = query.arg_lazy(
900 "subscriber",
901 Box::new(move || {
902 let subscriber = subscriber.clone();
903 Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
904 }),
905 );
906 let id: Id = query.execute(self.graphql_client.clone()).await?;
907 Ok(Agent {
908 proc: self.proc.clone(),
909 selection: query
910 .root()
911 .select("node")
912 .arg("id", &id.0)
913 .inline_fragment("Agent"),
914 graphql_client: self.graphql_client.clone(),
915 })
916 }
917 pub async fn notify_opts(
928 &self,
929 subscriber: impl IntoID<Id>,
930 opts: AgentNotifyOpts,
931 ) -> Result<Agent, DaggerError> {
932 let mut query = self.selection.select("notify");
933 query = query.arg_lazy(
934 "subscriber",
935 Box::new(move || {
936 let subscriber = subscriber.clone();
937 Box::pin(async move { subscriber.into_id().await.unwrap().quote() })
938 }),
939 );
940 if let Some(on) = opts.on {
941 query = query.arg("on", on);
942 }
943 let id: Id = query.execute(self.graphql_client.clone()).await?;
944 Ok(Agent {
945 proc: self.proc.clone(),
946 selection: query
947 .root()
948 .select("node")
949 .arg("id", &id.0)
950 .inline_fragment("Agent"),
951 graphql_client: self.graphql_client.clone(),
952 })
953 }
954 pub async fn stop(&self) -> Result<Agent, DaggerError> {
960 let query = self.selection.select("stop");
961 let id: Id = query.execute(self.graphql_client.clone()).await?;
962 Ok(Agent {
963 proc: self.proc.clone(),
964 selection: query
965 .root()
966 .select("node")
967 .arg("id", &id.0)
968 .inline_fragment("Agent"),
969 graphql_client: self.graphql_client.clone(),
970 })
971 }
972 pub async fn stop_opts(&self, opts: AgentStopOpts) -> Result<Agent, DaggerError> {
978 let mut query = self.selection.select("stop");
979 if let Some(kill) = opts.kill {
980 query = query.arg("kill", kill);
981 }
982 let id: Id = query.execute(self.graphql_client.clone()).await?;
983 Ok(Agent {
984 proc: self.proc.clone(),
985 selection: query
986 .root()
987 .select("node")
988 .arg("id", &id.0)
989 .inline_fragment("Agent"),
990 graphql_client: self.graphql_client.clone(),
991 })
992 }
993 pub async fn reseed(&self, conversation: impl IntoID<Id>) -> Result<Agent, DaggerError> {
1002 let mut query = self.selection.select("reseed");
1003 query = query.arg_lazy(
1004 "conversation",
1005 Box::new(move || {
1006 let conversation = conversation.clone();
1007 Box::pin(async move { conversation.into_id().await.unwrap().quote() })
1008 }),
1009 );
1010 let id: Id = query.execute(self.graphql_client.clone()).await?;
1011 Ok(Agent {
1012 proc: self.proc.clone(),
1013 selection: query
1014 .root()
1015 .select("node")
1016 .arg("id", &id.0)
1017 .inline_fragment("Agent"),
1018 graphql_client: self.graphql_client.clone(),
1019 })
1020 }
1021}
1022impl Node for Agent {
1023 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1024 let query = self.selection.select("id");
1025 let graphql_client = self.graphql_client.clone();
1026 async move { query.execute(graphql_client).await }
1027 }
1028}
1029#[derive(Clone)]
1030pub struct AgentMessage {
1031 pub proc: Option<Arc<DaggerSessionProc>>,
1032 pub selection: Selection,
1033 pub graphql_client: DynGraphQLClient,
1034}
1035impl IntoID<Id> for AgentMessage {
1036 fn into_id(
1037 self,
1038 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1039 Box::pin(async move { self.id().await })
1040 }
1041}
1042impl Loadable for AgentMessage {
1043 fn graphql_type() -> &'static str {
1044 "AgentMessage"
1045 }
1046 fn from_query(
1047 proc: Option<Arc<DaggerSessionProc>>,
1048 selection: Selection,
1049 graphql_client: DynGraphQLClient,
1050 ) -> Self {
1051 Self {
1052 proc,
1053 selection,
1054 graphql_client,
1055 }
1056 }
1057}
1058impl AgentMessage {
1059 pub async fn id(&self) -> Result<Id, DaggerError> {
1061 let query = self.selection.select("id");
1062 query.execute(self.graphql_client.clone()).await
1063 }
1064 pub async fn delivery(&self) -> Result<AgentMessageDelivery, DaggerError> {
1067 let query = self.selection.select("delivery");
1068 query.execute(self.graphql_client.clone()).await
1069 }
1070 pub async fn r#ref(&self) -> Result<String, DaggerError> {
1073 let query = self.selection.select("ref");
1074 query.execute(self.graphql_client.clone()).await
1075 }
1076 pub async fn response(&self) -> Result<String, DaggerError> {
1081 let query = self.selection.select("response");
1082 query.execute(self.graphql_client.clone()).await
1083 }
1084}
1085impl Node for AgentMessage {
1086 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1087 let query = self.selection.select("id");
1088 let graphql_client = self.graphql_client.clone();
1089 async move { query.execute(graphql_client).await }
1090 }
1091}
1092#[derive(Clone)]
1093pub struct Artifact {
1094 pub proc: Option<Arc<DaggerSessionProc>>,
1095 pub selection: Selection,
1096 pub graphql_client: DynGraphQLClient,
1097}
1098#[derive(Builder, Debug, PartialEq)]
1099pub struct ArtifactUriOpts {
1100 #[builder(setter(into, strip_option), default)]
1102 pub absolute: Option<bool>,
1103 #[builder(setter(into, strip_option), default)]
1105 pub dimension_keys: Option<bool>,
1106 #[builder(setter(into, strip_option), default)]
1108 pub type_assertion: Option<bool>,
1109}
1110impl IntoID<Id> for Artifact {
1111 fn into_id(
1112 self,
1113 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1114 Box::pin(async move { self.id().await })
1115 }
1116}
1117impl Loadable for Artifact {
1118 fn graphql_type() -> &'static str {
1119 "Artifact"
1120 }
1121 fn from_query(
1122 proc: Option<Arc<DaggerSessionProc>>,
1123 selection: Selection,
1124 graphql_client: DynGraphQLClient,
1125 ) -> Self {
1126 Self {
1127 proc,
1128 selection,
1129 graphql_client,
1130 }
1131 }
1132}
1133impl Artifact {
1134 pub async fn id(&self) -> Result<Id, DaggerError> {
1136 let query = self.selection.select("id");
1137 query.execute(self.graphql_client.clone()).await
1138 }
1139 pub async fn load_error(&self) -> Result<String, DaggerError> {
1141 let query = self.selection.select("loadError");
1142 query.execute(self.graphql_client.clone()).await
1143 }
1144 pub async fn arguments(&self) -> Result<Vec<FunctionArg>, DaggerError> {
1146 let query = self.selection.select("arguments");
1147 let query = query.select("id");
1148 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1149 Ok(ids
1150 .into_iter()
1151 .map(|id| FunctionArg {
1152 proc: self.proc.clone(),
1153 selection: crate::querybuilder::query()
1154 .select("node")
1155 .arg("id", &id.0)
1156 .inline_fragment("FunctionArg"),
1157 graphql_client: self.graphql_client.clone(),
1158 })
1159 .collect())
1160 }
1161 pub async fn description(&self) -> Result<String, DaggerError> {
1163 let query = self.selection.select("description");
1164 query.execute(self.graphql_client.clone()).await
1165 }
1166 pub async fn workspace(&self) -> Result<Option<Workspace>, DaggerError> {
1168 let query = self.selection.select("workspace");
1169 let query = query.select("id");
1170 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1171 Ok(id.map(|id| Workspace {
1172 proc: self.proc.clone(),
1173 selection: query
1174 .root()
1175 .select("node")
1176 .arg("id", &id.0)
1177 .inline_fragment("Workspace"),
1178 graphql_client: self.graphql_client.clone(),
1179 }))
1180 }
1181 pub async fn uri(&self) -> Result<String, DaggerError> {
1187 let query = self.selection.select("uri");
1188 query.execute(self.graphql_client.clone()).await
1189 }
1190 pub async fn uri_opts(&self, opts: ArtifactUriOpts) -> Result<String, DaggerError> {
1196 let mut query = self.selection.select("uri");
1197 if let Some(absolute) = opts.absolute {
1198 query = query.arg("absolute", absolute);
1199 }
1200 if let Some(dimension_keys) = opts.dimension_keys {
1201 query = query.arg("dimensionKeys", dimension_keys);
1202 }
1203 if let Some(type_assertion) = opts.type_assertion {
1204 query = query.arg("typeAssertion", type_assertion);
1205 }
1206 query.execute(self.graphql_client.clone()).await
1207 }
1208 pub async fn module_name(&self) -> Result<String, DaggerError> {
1210 let query = self.selection.select("moduleName");
1211 query.execute(self.graphql_client.clone()).await
1212 }
1213 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1215 let query = self.selection.select("path");
1216 query.execute(self.graphql_client.clone()).await
1217 }
1218 pub async fn dimension_keys(&self) -> Result<Vec<ArtifactDimensionKey>, DaggerError> {
1220 let query = self.selection.select("dimensionKeys");
1221 let query = query.select("id");
1222 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1223 Ok(ids
1224 .into_iter()
1225 .map(|id| ArtifactDimensionKey {
1226 proc: self.proc.clone(),
1227 selection: crate::querybuilder::query()
1228 .select("node")
1229 .arg("id", &id.0)
1230 .inline_fragment("ArtifactDimensionKey"),
1231 graphql_client: self.graphql_client.clone(),
1232 })
1233 .collect())
1234 }
1235 pub async fn directives(&self) -> Result<Vec<String>, DaggerError> {
1237 let query = self.selection.select("directives");
1238 query.execute(self.graphql_client.clone()).await
1239 }
1240 pub fn value(&self, arguments: Json) -> NodeClient {
1246 let mut query = self.selection.select("value");
1247 query = query.arg("arguments", arguments);
1248 NodeClient {
1249 proc: self.proc.clone(),
1250 selection: query,
1251 graphql_client: self.graphql_client.clone(),
1252 }
1253 }
1254}
1255impl Node for Artifact {
1256 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1257 let query = self.selection.select("id");
1258 let graphql_client = self.graphql_client.clone();
1259 async move { query.execute(graphql_client).await }
1260 }
1261}
1262#[derive(Clone)]
1263pub struct ArtifactDimension {
1264 pub proc: Option<Arc<DaggerSessionProc>>,
1265 pub selection: Selection,
1266 pub graphql_client: DynGraphQLClient,
1267}
1268impl IntoID<Id> for ArtifactDimension {
1269 fn into_id(
1270 self,
1271 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1272 Box::pin(async move { self.id().await })
1273 }
1274}
1275impl Loadable for ArtifactDimension {
1276 fn graphql_type() -> &'static str {
1277 "ArtifactDimension"
1278 }
1279 fn from_query(
1280 proc: Option<Arc<DaggerSessionProc>>,
1281 selection: Selection,
1282 graphql_client: DynGraphQLClient,
1283 ) -> Self {
1284 Self {
1285 proc,
1286 selection,
1287 graphql_client,
1288 }
1289 }
1290}
1291impl ArtifactDimension {
1292 pub async fn id(&self) -> Result<Id, DaggerError> {
1294 let query = self.selection.select("id");
1295 query.execute(self.graphql_client.clone()).await
1296 }
1297 pub async fn kind(&self) -> Result<ArtifactDimensionKind, DaggerError> {
1299 let query = self.selection.select("kind");
1300 query.execute(self.graphql_client.clone()).await
1301 }
1302 pub async fn collection_type(&self) -> Result<String, DaggerError> {
1304 let query = self.selection.select("collectionType");
1305 query.execute(self.graphql_client.clone()).await
1306 }
1307 pub async fn identifier(&self) -> Result<String, DaggerError> {
1309 let query = self.selection.select("identifier");
1310 query.execute(self.graphql_client.clone()).await
1311 }
1312 pub async fn name(&self) -> Result<String, DaggerError> {
1314 let query = self.selection.select("name");
1315 query.execute(self.graphql_client.clone()).await
1316 }
1317 pub async fn qualified_name(&self) -> Result<String, DaggerError> {
1319 let query = self.selection.select("qualifiedName");
1320 query.execute(self.graphql_client.clone()).await
1321 }
1322 pub async fn item_type(&self) -> Result<String, DaggerError> {
1324 let query = self.selection.select("itemType");
1325 query.execute(self.graphql_client.clone()).await
1326 }
1327 pub async fn key_name(&self) -> Result<String, DaggerError> {
1329 let query = self.selection.select("keyName");
1330 query.execute(self.graphql_client.clone()).await
1331 }
1332 pub async fn key_description(&self) -> Result<String, DaggerError> {
1334 let query = self.selection.select("keyDescription");
1335 query.execute(self.graphql_client.clone()).await
1336 }
1337}
1338impl Node for ArtifactDimension {
1339 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1340 let query = self.selection.select("id");
1341 let graphql_client = self.graphql_client.clone();
1342 async move { query.execute(graphql_client).await }
1343 }
1344}
1345#[derive(Clone)]
1346pub struct ArtifactDimensionKey {
1347 pub proc: Option<Arc<DaggerSessionProc>>,
1348 pub selection: Selection,
1349 pub graphql_client: DynGraphQLClient,
1350}
1351impl IntoID<Id> for ArtifactDimensionKey {
1352 fn into_id(
1353 self,
1354 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1355 Box::pin(async move { self.id().await })
1356 }
1357}
1358impl Loadable for ArtifactDimensionKey {
1359 fn graphql_type() -> &'static str {
1360 "ArtifactDimensionKey"
1361 }
1362 fn from_query(
1363 proc: Option<Arc<DaggerSessionProc>>,
1364 selection: Selection,
1365 graphql_client: DynGraphQLClient,
1366 ) -> Self {
1367 Self {
1368 proc,
1369 selection,
1370 graphql_client,
1371 }
1372 }
1373}
1374impl ArtifactDimensionKey {
1375 pub async fn id(&self) -> Result<Id, DaggerError> {
1377 let query = self.selection.select("id");
1378 query.execute(self.graphql_client.clone()).await
1379 }
1380 pub async fn dimension(&self) -> Result<String, DaggerError> {
1382 let query = self.selection.select("dimension");
1383 query.execute(self.graphql_client.clone()).await
1384 }
1385 pub async fn key(&self) -> Result<String, DaggerError> {
1387 let query = self.selection.select("key");
1388 query.execute(self.graphql_client.clone()).await
1389 }
1390}
1391impl Node for ArtifactDimensionKey {
1392 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1393 let query = self.selection.select("id");
1394 let graphql_client = self.graphql_client.clone();
1395 async move { query.execute(graphql_client).await }
1396 }
1397}
1398#[derive(Clone)]
1399pub struct ArtifactPath {
1400 pub proc: Option<Arc<DaggerSessionProc>>,
1401 pub selection: Selection,
1402 pub graphql_client: DynGraphQLClient,
1403}
1404impl IntoID<Id> for ArtifactPath {
1405 fn into_id(
1406 self,
1407 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1408 Box::pin(async move { self.id().await })
1409 }
1410}
1411impl Loadable for ArtifactPath {
1412 fn graphql_type() -> &'static str {
1413 "ArtifactPath"
1414 }
1415 fn from_query(
1416 proc: Option<Arc<DaggerSessionProc>>,
1417 selection: Selection,
1418 graphql_client: DynGraphQLClient,
1419 ) -> Self {
1420 Self {
1421 proc,
1422 selection,
1423 graphql_client,
1424 }
1425 }
1426}
1427impl ArtifactPath {
1428 pub async fn id(&self) -> Result<Id, DaggerError> {
1430 let query = self.selection.select("id");
1431 query.execute(self.graphql_client.clone()).await
1432 }
1433 pub async fn module_name(&self) -> Result<String, DaggerError> {
1435 let query = self.selection.select("moduleName");
1436 query.execute(self.graphql_client.clone()).await
1437 }
1438 pub async fn uri(&self) -> Result<String, DaggerError> {
1440 let query = self.selection.select("uri");
1441 query.execute(self.graphql_client.clone()).await
1442 }
1443 pub async fn description(&self) -> Result<String, DaggerError> {
1445 let query = self.selection.select("description");
1446 query.execute(self.graphql_client.clone()).await
1447 }
1448 pub async fn load_error(&self) -> Result<String, DaggerError> {
1450 let query = self.selection.select("loadError");
1451 query.execute(self.graphql_client.clone()).await
1452 }
1453 pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
1455 let query = self.selection.select("dimensions");
1456 query.execute(self.graphql_client.clone()).await
1457 }
1458}
1459impl Node for ArtifactPath {
1460 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1461 let query = self.selection.select("id");
1462 let graphql_client = self.graphql_client.clone();
1463 async move { query.execute(graphql_client).await }
1464 }
1465}
1466#[derive(Clone)]
1467pub struct ArtifactResult {
1468 pub proc: Option<Arc<DaggerSessionProc>>,
1469 pub selection: Selection,
1470 pub graphql_client: DynGraphQLClient,
1471}
1472impl IntoID<Id> for ArtifactResult {
1473 fn into_id(
1474 self,
1475 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1476 Box::pin(async move { self.id().await })
1477 }
1478}
1479impl Loadable for ArtifactResult {
1480 fn graphql_type() -> &'static str {
1481 "ArtifactResult"
1482 }
1483 fn from_query(
1484 proc: Option<Arc<DaggerSessionProc>>,
1485 selection: Selection,
1486 graphql_client: DynGraphQLClient,
1487 ) -> Self {
1488 Self {
1489 proc,
1490 selection,
1491 graphql_client,
1492 }
1493 }
1494}
1495impl ArtifactResult {
1496 pub async fn id(&self) -> Result<Id, DaggerError> {
1498 let query = self.selection.select("id");
1499 query.execute(self.graphql_client.clone()).await
1500 }
1501 pub fn artifact(&self) -> Artifact {
1503 let query = self.selection.select("artifact");
1504 Artifact {
1505 proc: self.proc.clone(),
1506 selection: query,
1507 graphql_client: self.graphql_client.clone(),
1508 }
1509 }
1510 pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
1512 let query = self.selection.select("error");
1513 let query = query.select("id");
1514 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1515 Ok(id.map(|id| Error {
1516 proc: self.proc.clone(),
1517 selection: query
1518 .root()
1519 .select("node")
1520 .arg("id", &id.0)
1521 .inline_fragment("Error"),
1522 graphql_client: self.graphql_client.clone(),
1523 }))
1524 }
1525 pub async fn value(&self) -> Result<Option<NodeClient>, DaggerError> {
1527 let query = self.selection.select("value");
1528 let query = query.select("id");
1529 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
1530 Ok(id.map(|id| NodeClient {
1531 proc: self.proc.clone(),
1532 selection: query
1533 .root()
1534 .select("node")
1535 .arg("id", &id.0)
1536 .inline_fragment("Node"),
1537 graphql_client: self.graphql_client.clone(),
1538 }))
1539 }
1540}
1541impl Node for ArtifactResult {
1542 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1543 let query = self.selection.select("id");
1544 let graphql_client = self.graphql_client.clone();
1545 async move { query.execute(graphql_client).await }
1546 }
1547}
1548#[derive(Clone)]
1549pub struct Artifacts {
1550 pub proc: Option<Arc<DaggerSessionProc>>,
1551 pub selection: Selection,
1552 pub graphql_client: DynGraphQLClient,
1553}
1554#[derive(Builder, Debug, PartialEq)]
1555pub struct ArtifactsPathDefinitionsOpts<'a> {
1556 #[builder(setter(into, strip_option), default)]
1558 pub absolute: Option<bool>,
1559 #[builder(setter(into, strip_option), default)]
1561 pub dimension: Option<&'a str>,
1562 #[builder(setter(into, strip_option), default)]
1564 pub type_assertion: Option<bool>,
1565}
1566#[derive(Builder, Debug, PartialEq)]
1567pub struct ArtifactsValuesOpts {
1568 #[builder(setter(into, strip_option), default)]
1570 pub arguments: Option<Json>,
1571 #[builder(setter(into, strip_option), default)]
1573 pub fail_fast: Option<bool>,
1574 #[builder(setter(into, strip_option), default)]
1576 pub max_concurrency: Option<isize>,
1577}
1578#[derive(Builder, Debug, PartialEq)]
1579pub struct ArtifactsFilterDirectivesOpts {
1580 #[builder(setter(into, strip_option), default)]
1582 pub exclude: Option<bool>,
1583}
1584#[derive(Builder, Debug, PartialEq)]
1585pub struct ArtifactsFilterParentTypesOpts {
1586 #[builder(setter(into, strip_option), default)]
1588 pub exclude: Option<bool>,
1589}
1590#[derive(Builder, Debug, PartialEq)]
1591pub struct ArtifactsFilterParentDirectivesOpts {
1592 #[builder(setter(into, strip_option), default)]
1594 pub exclude: Option<bool>,
1595}
1596#[derive(Builder, Debug, PartialEq)]
1597pub struct ArtifactsFilterTypesOpts {
1598 #[builder(setter(into, strip_option), default)]
1600 pub exclude: Option<bool>,
1601}
1602impl IntoID<Id> for Artifacts {
1603 fn into_id(
1604 self,
1605 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1606 Box::pin(async move { self.id().await })
1607 }
1608}
1609impl Loadable for Artifacts {
1610 fn graphql_type() -> &'static str {
1611 "Artifacts"
1612 }
1613 fn from_query(
1614 proc: Option<Arc<DaggerSessionProc>>,
1615 selection: Selection,
1616 graphql_client: DynGraphQLClient,
1617 ) -> Self {
1618 Self {
1619 proc,
1620 selection,
1621 graphql_client,
1622 }
1623 }
1624}
1625impl Artifacts {
1626 pub async fn id(&self) -> Result<Id, DaggerError> {
1628 let query = self.selection.select("id");
1629 query.execute(self.graphql_client.clone()).await
1630 }
1631 pub async fn as_expertise(&self) -> Result<Vec<Expertise>, DaggerError> {
1633 let query = self.selection.select("asExpertise");
1634 let query = query.select("id");
1635 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1636 Ok(ids
1637 .into_iter()
1638 .map(|id| Expertise {
1639 proc: self.proc.clone(),
1640 selection: crate::querybuilder::query()
1641 .select("node")
1642 .arg("id", &id.0)
1643 .inline_fragment("Expertise"),
1644 graphql_client: self.graphql_client.clone(),
1645 })
1646 .collect())
1647 }
1648 pub async fn as_generators(&self) -> Result<Vec<Generator>, DaggerError> {
1650 let query = self.selection.select("asGenerators");
1651 let query = query.select("id");
1652 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1653 Ok(ids
1654 .into_iter()
1655 .map(|id| Generator {
1656 proc: self.proc.clone(),
1657 selection: crate::querybuilder::query()
1658 .select("node")
1659 .arg("id", &id.0)
1660 .inline_fragment("Generator"),
1661 graphql_client: self.graphql_client.clone(),
1662 })
1663 .collect())
1664 }
1665 pub async fn as_checks(&self) -> Result<Vec<Check>, DaggerError> {
1667 let query = self.selection.select("asChecks");
1668 let query = query.select("id");
1669 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1670 Ok(ids
1671 .into_iter()
1672 .map(|id| Check {
1673 proc: self.proc.clone(),
1674 selection: crate::querybuilder::query()
1675 .select("node")
1676 .arg("id", &id.0)
1677 .inline_fragment("Check"),
1678 graphql_client: self.graphql_client.clone(),
1679 })
1680 .collect())
1681 }
1682 pub async fn as_changesets(&self) -> Result<Vec<Changeset>, DaggerError> {
1684 let query = self.selection.select("asChangesets");
1685 let query = query.select("id");
1686 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1687 Ok(ids
1688 .into_iter()
1689 .map(|id| Changeset {
1690 proc: self.proc.clone(),
1691 selection: crate::querybuilder::query()
1692 .select("node")
1693 .arg("id", &id.0)
1694 .inline_fragment("Changeset"),
1695 graphql_client: self.graphql_client.clone(),
1696 })
1697 .collect())
1698 }
1699 pub async fn as_services(&self) -> Result<Vec<Service>, DaggerError> {
1701 let query = self.selection.select("asServices");
1702 let query = query.select("id");
1703 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1704 Ok(ids
1705 .into_iter()
1706 .map(|id| Service {
1707 proc: self.proc.clone(),
1708 selection: crate::querybuilder::query()
1709 .select("node")
1710 .arg("id", &id.0)
1711 .inline_fragment("Service"),
1712 graphql_client: self.graphql_client.clone(),
1713 })
1714 .collect())
1715 }
1716 pub async fn path_definitions(&self) -> Result<Vec<ArtifactPath>, DaggerError> {
1722 let query = self.selection.select("pathDefinitions");
1723 let query = query.select("id");
1724 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1725 Ok(ids
1726 .into_iter()
1727 .map(|id| ArtifactPath {
1728 proc: self.proc.clone(),
1729 selection: crate::querybuilder::query()
1730 .select("node")
1731 .arg("id", &id.0)
1732 .inline_fragment("ArtifactPath"),
1733 graphql_client: self.graphql_client.clone(),
1734 })
1735 .collect())
1736 }
1737 pub async fn path_definitions_opts<'a>(
1743 &self,
1744 opts: ArtifactsPathDefinitionsOpts<'a>,
1745 ) -> Result<Vec<ArtifactPath>, DaggerError> {
1746 let mut query = self.selection.select("pathDefinitions");
1747 if let Some(absolute) = opts.absolute {
1748 query = query.arg("absolute", absolute);
1749 }
1750 if let Some(type_assertion) = opts.type_assertion {
1751 query = query.arg("typeAssertion", type_assertion);
1752 }
1753 if let Some(dimension) = opts.dimension {
1754 query = query.arg("dimension", dimension);
1755 }
1756 let query = query.select("id");
1757 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1758 Ok(ids
1759 .into_iter()
1760 .map(|id| ArtifactPath {
1761 proc: self.proc.clone(),
1762 selection: crate::querybuilder::query()
1763 .select("node")
1764 .arg("id", &id.0)
1765 .inline_fragment("ArtifactPath"),
1766 graphql_client: self.graphql_client.clone(),
1767 })
1768 .collect())
1769 }
1770 pub async fn dimension_definitions(&self) -> Result<Vec<ArtifactDimension>, DaggerError> {
1772 let query = self.selection.select("dimensionDefinitions");
1773 let query = query.select("id");
1774 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1775 Ok(ids
1776 .into_iter()
1777 .map(|id| ArtifactDimension {
1778 proc: self.proc.clone(),
1779 selection: crate::querybuilder::query()
1780 .select("node")
1781 .arg("id", &id.0)
1782 .inline_fragment("ArtifactDimension"),
1783 graphql_client: self.graphql_client.clone(),
1784 })
1785 .collect())
1786 }
1787 pub async fn values(&self) -> Result<Vec<ArtifactResult>, DaggerError> {
1793 let query = self.selection.select("values");
1794 let query = query.select("id");
1795 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1796 Ok(ids
1797 .into_iter()
1798 .map(|id| ArtifactResult {
1799 proc: self.proc.clone(),
1800 selection: crate::querybuilder::query()
1801 .select("node")
1802 .arg("id", &id.0)
1803 .inline_fragment("ArtifactResult"),
1804 graphql_client: self.graphql_client.clone(),
1805 })
1806 .collect())
1807 }
1808 pub async fn values_opts(
1814 &self,
1815 opts: ArtifactsValuesOpts,
1816 ) -> Result<Vec<ArtifactResult>, DaggerError> {
1817 let mut query = self.selection.select("values");
1818 if let Some(fail_fast) = opts.fail_fast {
1819 query = query.arg("failFast", fail_fast);
1820 }
1821 if let Some(arguments) = opts.arguments {
1822 query = query.arg("arguments", arguments);
1823 }
1824 if let Some(max_concurrency) = opts.max_concurrency {
1825 query = query.arg("maxConcurrency", max_concurrency);
1826 }
1827 let query = query.select("id");
1828 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1829 Ok(ids
1830 .into_iter()
1831 .map(|id| ArtifactResult {
1832 proc: self.proc.clone(),
1833 selection: crate::querybuilder::query()
1834 .select("node")
1835 .arg("id", &id.0)
1836 .inline_fragment("ArtifactResult"),
1837 graphql_client: self.graphql_client.clone(),
1838 })
1839 .collect())
1840 }
1841 pub async fn modules(&self) -> Result<Vec<Module>, DaggerError> {
1843 let query = self.selection.select("modules");
1844 let query = query.select("id");
1845 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1846 Ok(ids
1847 .into_iter()
1848 .map(|id| Module {
1849 proc: self.proc.clone(),
1850 selection: crate::querybuilder::query()
1851 .select("node")
1852 .arg("id", &id.0)
1853 .inline_fragment("Module"),
1854 graphql_client: self.graphql_client.clone(),
1855 })
1856 .collect())
1857 }
1858 pub async fn types(&self) -> Result<Vec<TypeDef>, DaggerError> {
1860 let query = self.selection.select("types");
1861 let query = query.select("id");
1862 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1863 Ok(ids
1864 .into_iter()
1865 .map(|id| TypeDef {
1866 proc: self.proc.clone(),
1867 selection: crate::querybuilder::query()
1868 .select("node")
1869 .arg("id", &id.0)
1870 .inline_fragment("TypeDef"),
1871 graphql_client: self.graphql_client.clone(),
1872 })
1873 .collect())
1874 }
1875 pub fn filter_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1881 let mut query = self.selection.select("filterDirectives");
1882 query = query.arg(
1883 "directives",
1884 directives
1885 .into_iter()
1886 .map(|i| i.into())
1887 .collect::<Vec<String>>(),
1888 );
1889 Artifacts {
1890 proc: self.proc.clone(),
1891 selection: query,
1892 graphql_client: self.graphql_client.clone(),
1893 }
1894 }
1895 pub fn filter_directives_opts(
1901 &self,
1902 directives: Vec<impl Into<String>>,
1903 opts: ArtifactsFilterDirectivesOpts,
1904 ) -> Artifacts {
1905 let mut query = self.selection.select("filterDirectives");
1906 query = query.arg(
1907 "directives",
1908 directives
1909 .into_iter()
1910 .map(|i| i.into())
1911 .collect::<Vec<String>>(),
1912 );
1913 if let Some(exclude) = opts.exclude {
1914 query = query.arg("exclude", exclude);
1915 }
1916 Artifacts {
1917 proc: self.proc.clone(),
1918 selection: query,
1919 graphql_client: self.graphql_client.clone(),
1920 }
1921 }
1922 pub fn filter_parent_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
1928 let mut query = self.selection.select("filterParentTypes");
1929 query = query.arg(
1930 "types",
1931 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1932 );
1933 Artifacts {
1934 proc: self.proc.clone(),
1935 selection: query,
1936 graphql_client: self.graphql_client.clone(),
1937 }
1938 }
1939 pub fn filter_parent_types_opts(
1945 &self,
1946 types: Vec<impl Into<String>>,
1947 opts: ArtifactsFilterParentTypesOpts,
1948 ) -> Artifacts {
1949 let mut query = self.selection.select("filterParentTypes");
1950 query = query.arg(
1951 "types",
1952 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
1953 );
1954 if let Some(exclude) = opts.exclude {
1955 query = query.arg("exclude", exclude);
1956 }
1957 Artifacts {
1958 proc: self.proc.clone(),
1959 selection: query,
1960 graphql_client: self.graphql_client.clone(),
1961 }
1962 }
1963 pub fn filter_parent_directives(&self, directives: Vec<impl Into<String>>) -> Artifacts {
1969 let mut query = self.selection.select("filterParentDirectives");
1970 query = query.arg(
1971 "directives",
1972 directives
1973 .into_iter()
1974 .map(|i| i.into())
1975 .collect::<Vec<String>>(),
1976 );
1977 Artifacts {
1978 proc: self.proc.clone(),
1979 selection: query,
1980 graphql_client: self.graphql_client.clone(),
1981 }
1982 }
1983 pub fn filter_parent_directives_opts(
1989 &self,
1990 directives: Vec<impl Into<String>>,
1991 opts: ArtifactsFilterParentDirectivesOpts,
1992 ) -> Artifacts {
1993 let mut query = self.selection.select("filterParentDirectives");
1994 query = query.arg(
1995 "directives",
1996 directives
1997 .into_iter()
1998 .map(|i| i.into())
1999 .collect::<Vec<String>>(),
2000 );
2001 if let Some(exclude) = opts.exclude {
2002 query = query.arg("exclude", exclude);
2003 }
2004 Artifacts {
2005 proc: self.proc.clone(),
2006 selection: query,
2007 graphql_client: self.graphql_client.clone(),
2008 }
2009 }
2010 pub fn with_artifacts(&self, artifacts: impl IntoID<Id>) -> Artifacts {
2012 let mut query = self.selection.select("withArtifacts");
2013 query = query.arg_lazy(
2014 "artifacts",
2015 Box::new(move || {
2016 let artifacts = artifacts.clone();
2017 Box::pin(async move { artifacts.into_id().await.unwrap().quote() })
2018 }),
2019 );
2020 Artifacts {
2021 proc: self.proc.clone(),
2022 selection: query,
2023 graphql_client: self.graphql_client.clone(),
2024 }
2025 }
2026 pub fn without_uri(&self, uri: impl Into<String>) -> Artifacts {
2028 let mut query = self.selection.select("withoutUri");
2029 query = query.arg("uri", uri.into());
2030 Artifacts {
2031 proc: self.proc.clone(),
2032 selection: query,
2033 graphql_client: self.graphql_client.clone(),
2034 }
2035 }
2036 pub fn filter_types(&self, types: Vec<impl Into<String>>) -> Artifacts {
2042 let mut query = self.selection.select("filterTypes");
2043 query = query.arg(
2044 "types",
2045 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2046 );
2047 Artifacts {
2048 proc: self.proc.clone(),
2049 selection: query,
2050 graphql_client: self.graphql_client.clone(),
2051 }
2052 }
2053 pub fn filter_types_opts(
2059 &self,
2060 types: Vec<impl Into<String>>,
2061 opts: ArtifactsFilterTypesOpts,
2062 ) -> Artifacts {
2063 let mut query = self.selection.select("filterTypes");
2064 query = query.arg(
2065 "types",
2066 types.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2067 );
2068 if let Some(exclude) = opts.exclude {
2069 query = query.arg("exclude", exclude);
2070 }
2071 Artifacts {
2072 proc: self.proc.clone(),
2073 selection: query,
2074 graphql_client: self.graphql_client.clone(),
2075 }
2076 }
2077 pub fn filter_path(&self, path: Vec<impl Into<String>>) -> Artifacts {
2079 let mut query = self.selection.select("filterPath");
2080 query = query.arg(
2081 "path",
2082 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2083 );
2084 Artifacts {
2085 proc: self.proc.clone(),
2086 selection: query,
2087 graphql_client: self.graphql_client.clone(),
2088 }
2089 }
2090 pub fn filter_path_pattern(&self, pattern: impl Into<String>) -> Artifacts {
2092 let mut query = self.selection.select("filterPathPattern");
2093 query = query.arg("pattern", pattern.into());
2094 Artifacts {
2095 proc: self.proc.clone(),
2096 selection: query,
2097 graphql_client: self.graphql_client.clone(),
2098 }
2099 }
2100 pub fn filter_dimensions(&self, dimensions: Vec<impl Into<String>>) -> Artifacts {
2102 let mut query = self.selection.select("filterDimensions");
2103 query = query.arg(
2104 "dimensions",
2105 dimensions
2106 .into_iter()
2107 .map(|i| i.into())
2108 .collect::<Vec<String>>(),
2109 );
2110 Artifacts {
2111 proc: self.proc.clone(),
2112 selection: query,
2113 graphql_client: self.graphql_client.clone(),
2114 }
2115 }
2116 pub fn filter_dimension_keys(
2118 &self,
2119 dimension: impl Into<String>,
2120 keys: Vec<impl Into<String>>,
2121 ) -> Artifacts {
2122 let mut query = self.selection.select("filterDimensionKeys");
2123 query = query.arg("dimension", dimension.into());
2124 query = query.arg(
2125 "keys",
2126 keys.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2127 );
2128 Artifacts {
2129 proc: self.proc.clone(),
2130 selection: query,
2131 graphql_client: self.graphql_client.clone(),
2132 }
2133 }
2134 pub fn filter_uri(&self, uri: impl Into<String>) -> Artifacts {
2142 let mut query = self.selection.select("filterUri");
2143 query = query.arg("uri", uri.into());
2144 Artifacts {
2145 proc: self.proc.clone(),
2146 selection: query,
2147 graphql_client: self.graphql_client.clone(),
2148 }
2149 }
2150 pub async fn dimensions(&self) -> Result<Vec<String>, DaggerError> {
2152 let query = self.selection.select("dimensions");
2153 query.execute(self.graphql_client.clone()).await
2154 }
2155 pub async fn dimension_keys(
2157 &self,
2158 dimension: impl Into<String>,
2159 ) -> Result<Vec<String>, DaggerError> {
2160 let mut query = self.selection.select("dimensionKeys");
2161 query = query.arg("dimension", dimension.into());
2162 query.execute(self.graphql_client.clone()).await
2163 }
2164 pub async fn dimension_items(
2166 &self,
2167 dimension: impl Into<String>,
2168 ) -> Result<Vec<Artifact>, DaggerError> {
2169 let mut query = self.selection.select("dimensionItems");
2170 query = query.arg("dimension", dimension.into());
2171 let query = query.select("id");
2172 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2173 Ok(ids
2174 .into_iter()
2175 .map(|id| Artifact {
2176 proc: self.proc.clone(),
2177 selection: crate::querybuilder::query()
2178 .select("node")
2179 .arg("id", &id.0)
2180 .inline_fragment("Artifact"),
2181 graphql_client: self.graphql_client.clone(),
2182 })
2183 .collect())
2184 }
2185 pub async fn items(&self) -> Result<Vec<Artifact>, DaggerError> {
2187 let query = self.selection.select("items");
2188 let query = query.select("id");
2189 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2190 Ok(ids
2191 .into_iter()
2192 .map(|id| Artifact {
2193 proc: self.proc.clone(),
2194 selection: crate::querybuilder::query()
2195 .select("node")
2196 .arg("id", &id.0)
2197 .inline_fragment("Artifact"),
2198 graphql_client: self.graphql_client.clone(),
2199 })
2200 .collect())
2201 }
2202 pub fn one(&self) -> Artifact {
2204 let query = self.selection.select("one");
2205 Artifact {
2206 proc: self.proc.clone(),
2207 selection: query,
2208 graphql_client: self.graphql_client.clone(),
2209 }
2210 }
2211 pub async fn uri(&self) -> Result<String, DaggerError> {
2213 let query = self.selection.select("uri");
2214 query.execute(self.graphql_client.clone()).await
2215 }
2216}
2217impl Node for Artifacts {
2218 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2219 let query = self.selection.select("id");
2220 let graphql_client = self.graphql_client.clone();
2221 async move { query.execute(graphql_client).await }
2222 }
2223}
2224#[derive(Clone)]
2225pub struct CacheVolume {
2226 pub proc: Option<Arc<DaggerSessionProc>>,
2227 pub selection: Selection,
2228 pub graphql_client: DynGraphQLClient,
2229}
2230impl IntoID<Id> for CacheVolume {
2231 fn into_id(
2232 self,
2233 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2234 Box::pin(async move { self.id().await })
2235 }
2236}
2237impl Loadable for CacheVolume {
2238 fn graphql_type() -> &'static str {
2239 "CacheVolume"
2240 }
2241 fn from_query(
2242 proc: Option<Arc<DaggerSessionProc>>,
2243 selection: Selection,
2244 graphql_client: DynGraphQLClient,
2245 ) -> Self {
2246 Self {
2247 proc,
2248 selection,
2249 graphql_client,
2250 }
2251 }
2252}
2253impl CacheVolume {
2254 pub async fn id(&self) -> Result<Id, DaggerError> {
2256 let query = self.selection.select("id");
2257 query.execute(self.graphql_client.clone()).await
2258 }
2259}
2260impl Node for CacheVolume {
2261 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2262 let query = self.selection.select("id");
2263 let graphql_client = self.graphql_client.clone();
2264 async move { query.execute(graphql_client).await }
2265 }
2266}
2267#[derive(Clone)]
2268pub struct Changeset {
2269 pub proc: Option<Arc<DaggerSessionProc>>,
2270 pub selection: Selection,
2271 pub graphql_client: DynGraphQLClient,
2272}
2273#[derive(Builder, Debug, PartialEq)]
2274pub struct ChangesetFilterOpts<'a> {
2275 #[builder(setter(into, strip_option), default)]
2277 pub exclude: Option<Vec<&'a str>>,
2278 #[builder(setter(into, strip_option), default)]
2280 pub include: Option<Vec<&'a str>>,
2281}
2282#[derive(Builder, Debug, PartialEq)]
2283pub struct ChangesetWithChangesetOpts {
2284 #[builder(setter(into, strip_option), default)]
2286 pub on_conflict: Option<ChangesetMergeConflict>,
2287}
2288#[derive(Builder, Debug, PartialEq)]
2289pub struct ChangesetWithChangesetsOpts {
2290 #[builder(setter(into, strip_option), default)]
2292 pub on_conflict: Option<ChangesetsMergeConflict>,
2293}
2294impl IntoID<Id> for Changeset {
2295 fn into_id(
2296 self,
2297 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2298 Box::pin(async move { self.id().await })
2299 }
2300}
2301impl Loadable for Changeset {
2302 fn graphql_type() -> &'static str {
2303 "Changeset"
2304 }
2305 fn from_query(
2306 proc: Option<Arc<DaggerSessionProc>>,
2307 selection: Selection,
2308 graphql_client: DynGraphQLClient,
2309 ) -> Self {
2310 Self {
2311 proc,
2312 selection,
2313 graphql_client,
2314 }
2315 }
2316}
2317impl Changeset {
2318 pub async fn id(&self) -> Result<Id, DaggerError> {
2320 let query = self.selection.select("id");
2321 query.execute(self.graphql_client.clone()).await
2322 }
2323 pub async fn sync(&self) -> Result<Changeset, DaggerError> {
2325 let query = self.selection.select("sync");
2326 let id: Id = query.execute(self.graphql_client.clone()).await?;
2327 Ok(Changeset {
2328 proc: self.proc.clone(),
2329 selection: query
2330 .root()
2331 .select("node")
2332 .arg("id", &id.0)
2333 .inline_fragment("Changeset"),
2334 graphql_client: self.graphql_client.clone(),
2335 })
2336 }
2337 pub fn filter(&self) -> Changeset {
2344 let query = self.selection.select("filter");
2345 Changeset {
2346 proc: self.proc.clone(),
2347 selection: query,
2348 graphql_client: self.graphql_client.clone(),
2349 }
2350 }
2351 pub fn filter_opts<'a>(&self, opts: ChangesetFilterOpts<'a>) -> Changeset {
2358 let mut query = self.selection.select("filter");
2359 if let Some(include) = opts.include {
2360 query = query.arg("include", include);
2361 }
2362 if let Some(exclude) = opts.exclude {
2363 query = query.arg("exclude", exclude);
2364 }
2365 Changeset {
2366 proc: self.proc.clone(),
2367 selection: query,
2368 graphql_client: self.graphql_client.clone(),
2369 }
2370 }
2371 pub fn layer(&self) -> Directory {
2373 let query = self.selection.select("layer");
2374 Directory {
2375 proc: self.proc.clone(),
2376 selection: query,
2377 graphql_client: self.graphql_client.clone(),
2378 }
2379 }
2380 pub fn as_patch(&self) -> File {
2382 let query = self.selection.select("asPatch");
2383 File {
2384 proc: self.proc.clone(),
2385 selection: query,
2386 graphql_client: self.graphql_client.clone(),
2387 }
2388 }
2389 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2395 let mut query = self.selection.select("export");
2396 query = query.arg("path", path.into());
2397 query.execute(self.graphql_client.clone()).await
2398 }
2399 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2401 let query = self.selection.select("isEmpty");
2402 query.execute(self.graphql_client.clone()).await
2403 }
2404 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2406 let query = self.selection.select("addedPaths");
2407 query.execute(self.graphql_client.clone()).await
2408 }
2409 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2411 let query = self.selection.select("modifiedPaths");
2412 query.execute(self.graphql_client.clone()).await
2413 }
2414 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2416 let query = self.selection.select("removedPaths");
2417 query.execute(self.graphql_client.clone()).await
2418 }
2419 pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
2421 let query = self.selection.select("diffStats");
2422 let query = query.select("id");
2423 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2424 Ok(ids
2425 .into_iter()
2426 .map(|id| DiffStat {
2427 proc: self.proc.clone(),
2428 selection: crate::querybuilder::query()
2429 .select("node")
2430 .arg("id", &id.0)
2431 .inline_fragment("DiffStat"),
2432 graphql_client: self.graphql_client.clone(),
2433 })
2434 .collect())
2435 }
2436 pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
2444 let mut query = self.selection.select("withChangeset");
2445 query = query.arg_lazy(
2446 "changes",
2447 Box::new(move || {
2448 let changes = changes.clone();
2449 Box::pin(async move { changes.into_id().await.unwrap().quote() })
2450 }),
2451 );
2452 Changeset {
2453 proc: self.proc.clone(),
2454 selection: query,
2455 graphql_client: self.graphql_client.clone(),
2456 }
2457 }
2458 pub fn with_changeset_opts(
2466 &self,
2467 changes: impl IntoID<Id>,
2468 opts: ChangesetWithChangesetOpts,
2469 ) -> Changeset {
2470 let mut query = self.selection.select("withChangeset");
2471 query = query.arg_lazy(
2472 "changes",
2473 Box::new(move || {
2474 let changes = changes.clone();
2475 Box::pin(async move { changes.into_id().await.unwrap().quote() })
2476 }),
2477 );
2478 if let Some(on_conflict) = opts.on_conflict {
2479 query = query.arg("onConflict", on_conflict);
2480 }
2481 Changeset {
2482 proc: self.proc.clone(),
2483 selection: query,
2484 graphql_client: self.graphql_client.clone(),
2485 }
2486 }
2487 pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
2496 let mut query = self.selection.select("withChangesets");
2497 query = query.arg("changes", changes);
2498 Changeset {
2499 proc: self.proc.clone(),
2500 selection: query,
2501 graphql_client: self.graphql_client.clone(),
2502 }
2503 }
2504 pub fn with_changesets_opts(
2513 &self,
2514 changes: Vec<Id>,
2515 opts: ChangesetWithChangesetsOpts,
2516 ) -> Changeset {
2517 let mut query = self.selection.select("withChangesets");
2518 query = query.arg("changes", changes);
2519 if let Some(on_conflict) = opts.on_conflict {
2520 query = query.arg("onConflict", on_conflict);
2521 }
2522 Changeset {
2523 proc: self.proc.clone(),
2524 selection: query,
2525 graphql_client: self.graphql_client.clone(),
2526 }
2527 }
2528 pub fn before(&self) -> Directory {
2530 let query = self.selection.select("before");
2531 Directory {
2532 proc: self.proc.clone(),
2533 selection: query,
2534 graphql_client: self.graphql_client.clone(),
2535 }
2536 }
2537 pub fn after(&self) -> Directory {
2539 let query = self.selection.select("after");
2540 Directory {
2541 proc: self.proc.clone(),
2542 selection: query,
2543 graphql_client: self.graphql_client.clone(),
2544 }
2545 }
2546}
2547impl Exportable for Changeset {
2548 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2549 let query = self.selection.select("id");
2550 let graphql_client = self.graphql_client.clone();
2551 async move { query.execute(graphql_client).await }
2552 }
2553 fn export(
2554 &self,
2555 path: impl Into<String>,
2556 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
2557 let mut query = self.selection.select("export");
2558 query = query.arg("path", path.into());
2559 let graphql_client = self.graphql_client.clone();
2560 async move { query.execute(graphql_client).await }
2561 }
2562}
2563impl Node for Changeset {
2564 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2565 let query = self.selection.select("id");
2566 let graphql_client = self.graphql_client.clone();
2567 async move { query.execute(graphql_client).await }
2568 }
2569}
2570impl Syncer for Changeset {
2571 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2572 let query = self.selection.select("id");
2573 let graphql_client = self.graphql_client.clone();
2574 async move { query.execute(graphql_client).await }
2575 }
2576 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
2577 let query = self.selection.select("sync");
2578 let proc = self.proc.clone();
2579 let graphql_client = self.graphql_client.clone();
2580 async move {
2581 let id: Id = query.execute(graphql_client.clone()).await?;
2582 Ok(Self {
2583 proc,
2584 selection: query
2585 .root()
2586 .select("node")
2587 .arg("id", &id.0)
2588 .inline_fragment("Changeset"),
2589 graphql_client,
2590 })
2591 }
2592 }
2593}
2594#[derive(Clone)]
2595pub struct Check {
2596 pub proc: Option<Arc<DaggerSessionProc>>,
2597 pub selection: Selection,
2598 pub graphql_client: DynGraphQLClient,
2599}
2600impl IntoID<Id> for Check {
2601 fn into_id(
2602 self,
2603 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2604 Box::pin(async move { self.id().await })
2605 }
2606}
2607impl Loadable for Check {
2608 fn graphql_type() -> &'static str {
2609 "Check"
2610 }
2611 fn from_query(
2612 proc: Option<Arc<DaggerSessionProc>>,
2613 selection: Selection,
2614 graphql_client: DynGraphQLClient,
2615 ) -> Self {
2616 Self {
2617 proc,
2618 selection,
2619 graphql_client,
2620 }
2621 }
2622}
2623impl Check {
2624 pub async fn id(&self) -> Result<Id, DaggerError> {
2626 let query = self.selection.select("id");
2627 query.execute(self.graphql_client.clone()).await
2628 }
2629 pub fn sync(&self) -> Check {
2631 let query = self.selection.select("sync");
2632 Check {
2633 proc: self.proc.clone(),
2634 selection: query,
2635 graphql_client: self.graphql_client.clone(),
2636 }
2637 }
2638 pub async fn pass(&self) -> Result<bool, DaggerError> {
2640 let query = self.selection.select("pass");
2641 query.execute(self.graphql_client.clone()).await
2642 }
2643 pub async fn error(&self) -> Result<Option<Error>, DaggerError> {
2645 let query = self.selection.select("error");
2646 let query = query.select("id");
2647 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2648 Ok(id.map(|id| Error {
2649 proc: self.proc.clone(),
2650 selection: query
2651 .root()
2652 .select("node")
2653 .arg("id", &id.0)
2654 .inline_fragment("Error"),
2655 graphql_client: self.graphql_client.clone(),
2656 }))
2657 }
2658 pub async fn assertion(&self) -> Result<String, DaggerError> {
2660 let query = self.selection.select("assertion");
2661 query.execute(self.graphql_client.clone()).await
2662 }
2663 pub async fn report(&self) -> Result<Option<Directory>, DaggerError> {
2665 let query = self.selection.select("report");
2666 let query = query.select("id");
2667 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2668 Ok(id.map(|id| Directory {
2669 proc: self.proc.clone(),
2670 selection: query
2671 .root()
2672 .select("node")
2673 .arg("id", &id.0)
2674 .inline_fragment("Directory"),
2675 graphql_client: self.graphql_client.clone(),
2676 }))
2677 }
2678}
2679impl Node for Check {
2680 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2681 let query = self.selection.select("id");
2682 let graphql_client = self.graphql_client.clone();
2683 async move { query.execute(graphql_client).await }
2684 }
2685}
2686#[derive(Clone)]
2687pub struct ClientFilesyncMirror {
2688 pub proc: Option<Arc<DaggerSessionProc>>,
2689 pub selection: Selection,
2690 pub graphql_client: DynGraphQLClient,
2691}
2692impl IntoID<Id> for ClientFilesyncMirror {
2693 fn into_id(
2694 self,
2695 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2696 Box::pin(async move { self.id().await })
2697 }
2698}
2699impl Loadable for ClientFilesyncMirror {
2700 fn graphql_type() -> &'static str {
2701 "ClientFilesyncMirror"
2702 }
2703 fn from_query(
2704 proc: Option<Arc<DaggerSessionProc>>,
2705 selection: Selection,
2706 graphql_client: DynGraphQLClient,
2707 ) -> Self {
2708 Self {
2709 proc,
2710 selection,
2711 graphql_client,
2712 }
2713 }
2714}
2715impl ClientFilesyncMirror {
2716 pub async fn id(&self) -> Result<Id, DaggerError> {
2718 let query = self.selection.select("id");
2719 query.execute(self.graphql_client.clone()).await
2720 }
2721}
2722impl Node for ClientFilesyncMirror {
2723 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2724 let query = self.selection.select("id");
2725 let graphql_client = self.graphql_client.clone();
2726 async move { query.execute(graphql_client).await }
2727 }
2728}
2729#[derive(Clone)]
2730pub struct Cloud {
2731 pub proc: Option<Arc<DaggerSessionProc>>,
2732 pub selection: Selection,
2733 pub graphql_client: DynGraphQLClient,
2734}
2735impl IntoID<Id> for Cloud {
2736 fn into_id(
2737 self,
2738 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2739 Box::pin(async move { self.id().await })
2740 }
2741}
2742impl Loadable for Cloud {
2743 fn graphql_type() -> &'static str {
2744 "Cloud"
2745 }
2746 fn from_query(
2747 proc: Option<Arc<DaggerSessionProc>>,
2748 selection: Selection,
2749 graphql_client: DynGraphQLClient,
2750 ) -> Self {
2751 Self {
2752 proc,
2753 selection,
2754 graphql_client,
2755 }
2756 }
2757}
2758impl Cloud {
2759 pub async fn id(&self) -> Result<Id, DaggerError> {
2761 let query = self.selection.select("id");
2762 query.execute(self.graphql_client.clone()).await
2763 }
2764 pub async fn trace_url(&self) -> Result<String, DaggerError> {
2766 let query = self.selection.select("traceURL");
2767 query.execute(self.graphql_client.clone()).await
2768 }
2769}
2770impl Node for Cloud {
2771 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2772 let query = self.selection.select("id");
2773 let graphql_client = self.graphql_client.clone();
2774 async move { query.execute(graphql_client).await }
2775 }
2776}
2777#[derive(Clone)]
2778pub struct CollectionDelta {
2779 pub proc: Option<Arc<DaggerSessionProc>>,
2780 pub selection: Selection,
2781 pub graphql_client: DynGraphQLClient,
2782}
2783impl IntoID<Id> for CollectionDelta {
2784 fn into_id(
2785 self,
2786 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2787 Box::pin(async move { self.id().await })
2788 }
2789}
2790impl Loadable for CollectionDelta {
2791 fn graphql_type() -> &'static str {
2792 "CollectionDelta"
2793 }
2794 fn from_query(
2795 proc: Option<Arc<DaggerSessionProc>>,
2796 selection: Selection,
2797 graphql_client: DynGraphQLClient,
2798 ) -> Self {
2799 Self {
2800 proc,
2801 selection,
2802 graphql_client,
2803 }
2804 }
2805}
2806impl CollectionDelta {
2807 pub async fn id(&self) -> Result<Id, DaggerError> {
2809 let query = self.selection.select("id");
2810 query.execute(self.graphql_client.clone()).await
2811 }
2812 pub async fn added_keys(&self) -> Result<Vec<String>, DaggerError> {
2814 let query = self.selection.select("addedKeys");
2815 query.execute(self.graphql_client.clone()).await
2816 }
2817 pub async fn removed_keys(&self) -> Result<Vec<String>, DaggerError> {
2819 let query = self.selection.select("removedKeys");
2820 query.execute(self.graphql_client.clone()).await
2821 }
2822}
2823impl Node for CollectionDelta {
2824 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2825 let query = self.selection.select("id");
2826 let graphql_client = self.graphql_client.clone();
2827 async move { query.execute(graphql_client).await }
2828 }
2829}
2830#[derive(Clone)]
2831pub struct CollectionTypeDef {
2832 pub proc: Option<Arc<DaggerSessionProc>>,
2833 pub selection: Selection,
2834 pub graphql_client: DynGraphQLClient,
2835}
2836impl IntoID<Id> for CollectionTypeDef {
2837 fn into_id(
2838 self,
2839 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2840 Box::pin(async move { self.id().await })
2841 }
2842}
2843impl Loadable for CollectionTypeDef {
2844 fn graphql_type() -> &'static str {
2845 "CollectionTypeDef"
2846 }
2847 fn from_query(
2848 proc: Option<Arc<DaggerSessionProc>>,
2849 selection: Selection,
2850 graphql_client: DynGraphQLClient,
2851 ) -> Self {
2852 Self {
2853 proc,
2854 selection,
2855 graphql_client,
2856 }
2857 }
2858}
2859impl CollectionTypeDef {
2860 pub async fn id(&self) -> Result<Id, DaggerError> {
2862 let query = self.selection.select("id");
2863 query.execute(self.graphql_client.clone()).await
2864 }
2865 pub fn key_type(&self) -> TypeDef {
2867 let query = self.selection.select("keyType");
2868 TypeDef {
2869 proc: self.proc.clone(),
2870 selection: query,
2871 graphql_client: self.graphql_client.clone(),
2872 }
2873 }
2874 pub fn value_type(&self) -> TypeDef {
2876 let query = self.selection.select("valueType");
2877 TypeDef {
2878 proc: self.proc.clone(),
2879 selection: query,
2880 graphql_client: self.graphql_client.clone(),
2881 }
2882 }
2883 pub async fn batch_type(&self) -> Result<Option<TypeDef>, DaggerError> {
2885 let query = self.selection.select("batchType");
2886 let query = query.select("id");
2887 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
2888 Ok(id.map(|id| TypeDef {
2889 proc: self.proc.clone(),
2890 selection: query
2891 .root()
2892 .select("node")
2893 .arg("id", &id.0)
2894 .inline_fragment("TypeDef"),
2895 graphql_client: self.graphql_client.clone(),
2896 }))
2897 }
2898}
2899impl Node for CollectionTypeDef {
2900 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2901 let query = self.selection.select("id");
2902 let graphql_client = self.graphql_client.clone();
2903 async move { query.execute(graphql_client).await }
2904 }
2905}
2906#[derive(Clone)]
2907pub struct Command {
2908 pub proc: Option<Arc<DaggerSessionProc>>,
2909 pub selection: Selection,
2910 pub graphql_client: DynGraphQLClient,
2911}
2912impl IntoID<Id> for Command {
2913 fn into_id(
2914 self,
2915 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
2916 Box::pin(async move { self.id().await })
2917 }
2918}
2919impl Loadable for Command {
2920 fn graphql_type() -> &'static str {
2921 "Command"
2922 }
2923 fn from_query(
2924 proc: Option<Arc<DaggerSessionProc>>,
2925 selection: Selection,
2926 graphql_client: DynGraphQLClient,
2927 ) -> Self {
2928 Self {
2929 proc,
2930 selection,
2931 graphql_client,
2932 }
2933 }
2934}
2935impl Command {
2936 pub async fn id(&self) -> Result<Id, DaggerError> {
2938 let query = self.selection.select("id");
2939 query.execute(self.graphql_client.clone()).await
2940 }
2941 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
2943 let query = self.selection.select("args");
2944 query.execute(self.graphql_client.clone()).await
2945 }
2946 pub async fn env(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2948 let query = self.selection.select("env");
2949 let query = query.select("id");
2950 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2951 Ok(ids
2952 .into_iter()
2953 .map(|id| EnvVariable {
2954 proc: self.proc.clone(),
2955 selection: crate::querybuilder::query()
2956 .select("node")
2957 .arg("id", &id.0)
2958 .inline_fragment("EnvVariable"),
2959 graphql_client: self.graphql_client.clone(),
2960 })
2961 .collect())
2962 }
2963 pub async fn workdir(&self) -> Result<String, DaggerError> {
2965 let query = self.selection.select("workdir");
2966 query.execute(self.graphql_client.clone()).await
2967 }
2968 pub async fn privileged_nesting(&self) -> Result<bool, DaggerError> {
2970 let query = self.selection.select("privilegedNesting");
2971 query.execute(self.graphql_client.clone()).await
2972 }
2973 pub async fn insecure_root_capabilities(&self) -> Result<bool, DaggerError> {
2975 let query = self.selection.select("insecureRootCapabilities");
2976 query.execute(self.graphql_client.clone()).await
2977 }
2978}
2979impl Node for Command {
2980 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
2981 let query = self.selection.select("id");
2982 let graphql_client = self.graphql_client.clone();
2983 async move { query.execute(graphql_client).await }
2984 }
2985}
2986#[derive(Clone)]
2987pub struct Container {
2988 pub proc: Option<Arc<DaggerSessionProc>>,
2989 pub selection: Selection,
2990 pub graphql_client: DynGraphQLClient,
2991}
2992#[derive(Builder, Debug, PartialEq)]
2993pub struct ContainerFromOpts<'a> {
2994 #[builder(setter(into, strip_option), default)]
2996 pub insecure_skip_tls_verify: Option<bool>,
2997 #[builder(setter(into, strip_option), default)]
2999 pub no_lock: Option<bool>,
3000 #[builder(setter(into, strip_option), default)]
3003 pub protocol: Option<RegistryProtocol>,
3004 #[builder(setter(into, strip_option), default)]
3007 pub registry_service: Option<Id>,
3008 #[builder(setter(into, strip_option), default)]
3010 pub version: Option<&'a str>,
3011}
3012#[derive(Builder, Debug, PartialEq)]
3013pub struct ContainerDirectoryOpts {
3014 #[builder(setter(into, strip_option), default)]
3016 pub expand: Option<bool>,
3017}
3018#[derive(Builder, Debug, PartialEq)]
3019pub struct ContainerFileOpts {
3020 #[builder(setter(into, strip_option), default)]
3022 pub expand: Option<bool>,
3023}
3024#[derive(Builder, Debug, PartialEq)]
3025pub struct ContainerWithWorkdirOpts {
3026 #[builder(setter(into, strip_option), default)]
3028 pub expand: Option<bool>,
3029}
3030#[derive(Builder, Debug, PartialEq)]
3031pub struct ContainerWithEnvVariableOpts {
3032 #[builder(setter(into, strip_option), default)]
3034 pub expand: Option<bool>,
3035}
3036#[derive(Builder, Debug, PartialEq)]
3037pub struct ContainerWithDockerHealthcheckOpts<'a> {
3038 #[builder(setter(into, strip_option), default)]
3040 pub interval: Option<&'a str>,
3041 #[builder(setter(into, strip_option), default)]
3043 pub retries: Option<isize>,
3044 #[builder(setter(into, strip_option), default)]
3046 pub shell: Option<bool>,
3047 #[builder(setter(into, strip_option), default)]
3049 pub start_interval: Option<&'a str>,
3050 #[builder(setter(into, strip_option), default)]
3052 pub start_period: Option<&'a str>,
3053 #[builder(setter(into, strip_option), default)]
3055 pub timeout: Option<&'a str>,
3056}
3057#[derive(Builder, Debug, PartialEq)]
3058pub struct ContainerWithEntrypointOpts {
3059 #[builder(setter(into, strip_option), default)]
3061 pub keep_default_args: Option<bool>,
3062}
3063#[derive(Builder, Debug, PartialEq)]
3064pub struct ContainerWithoutEntrypointOpts {
3065 #[builder(setter(into, strip_option), default)]
3067 pub keep_default_args: Option<bool>,
3068}
3069#[derive(Builder, Debug, PartialEq)]
3070pub struct ContainerWithMountedDirectoryOpts<'a> {
3071 #[builder(setter(into, strip_option), default)]
3073 pub expand: Option<bool>,
3074 #[builder(setter(into, strip_option), default)]
3076 pub inherit_owner: Option<bool>,
3077 #[builder(setter(into, strip_option), default)]
3081 pub owner: Option<&'a str>,
3082 #[builder(setter(into, strip_option), default)]
3084 pub read_only: Option<bool>,
3085}
3086#[derive(Builder, Debug, PartialEq)]
3087pub struct ContainerWithMountedFileOpts<'a> {
3088 #[builder(setter(into, strip_option), default)]
3090 pub expand: Option<bool>,
3091 #[builder(setter(into, strip_option), default)]
3093 pub inherit_owner: Option<bool>,
3094 #[builder(setter(into, strip_option), default)]
3098 pub owner: Option<&'a str>,
3099 #[builder(setter(into, strip_option), default)]
3101 pub read_only: Option<bool>,
3102}
3103#[derive(Builder, Debug, PartialEq)]
3104pub struct ContainerWithMountedTempOpts {
3105 #[builder(setter(into, strip_option), default)]
3107 pub expand: Option<bool>,
3108 #[builder(setter(into, strip_option), default)]
3110 pub size: Option<isize>,
3111}
3112#[derive(Builder, Debug, PartialEq)]
3113pub struct ContainerWithMountedCacheOpts<'a> {
3114 #[builder(setter(into, strip_option), default)]
3116 pub expand: Option<bool>,
3117 #[builder(setter(into, strip_option), default)]
3119 pub inherit_owner: Option<bool>,
3120 #[builder(setter(into, strip_option), default)]
3125 pub owner: Option<&'a str>,
3126 #[builder(setter(into, strip_option), default)]
3128 pub sharing: Option<CacheSharingMode>,
3129 #[builder(setter(into, strip_option), default)]
3131 pub source: Option<Id>,
3132}
3133#[derive(Builder, Debug, PartialEq)]
3134pub struct ContainerWithMountedVolumeOpts {
3135 #[builder(setter(into, strip_option), default)]
3137 pub expand: Option<bool>,
3138 #[builder(setter(into, strip_option), default)]
3140 pub read_only: Option<bool>,
3141}
3142#[derive(Builder, Debug, PartialEq)]
3143pub struct ContainerWithMountedSecretOpts<'a> {
3144 #[builder(setter(into, strip_option), default)]
3146 pub expand: Option<bool>,
3147 #[builder(setter(into, strip_option), default)]
3149 pub inherit_owner: Option<bool>,
3150 #[builder(setter(into, strip_option), default)]
3153 pub mode: Option<isize>,
3154 #[builder(setter(into, strip_option), default)]
3158 pub owner: Option<&'a str>,
3159}
3160#[derive(Builder, Debug, PartialEq)]
3161pub struct ContainerWithUnixSocketOpts<'a> {
3162 #[builder(setter(into, strip_option), default)]
3164 pub expand: Option<bool>,
3165 #[builder(setter(into, strip_option), default)]
3167 pub inherit_owner: Option<bool>,
3168 #[builder(setter(into, strip_option), default)]
3172 pub owner: Option<&'a str>,
3173}
3174#[derive(Builder, Debug, PartialEq)]
3175pub struct ContainerWithoutUnixSocketOpts {
3176 #[builder(setter(into, strip_option), default)]
3178 pub expand: Option<bool>,
3179}
3180#[derive(Builder, Debug, PartialEq)]
3181pub struct ContainerWithoutMountOpts {
3182 #[builder(setter(into, strip_option), default)]
3184 pub expand: Option<bool>,
3185}
3186#[derive(Builder, Debug, PartialEq)]
3187pub struct ContainerWithFileOpts<'a> {
3188 #[builder(setter(into, strip_option), default)]
3190 pub expand: Option<bool>,
3191 #[builder(setter(into, strip_option), default)]
3193 pub inherit_owner: Option<bool>,
3194 #[builder(setter(into, strip_option), default)]
3198 pub owner: Option<&'a str>,
3199 #[builder(setter(into, strip_option), default)]
3201 pub permissions: Option<isize>,
3202}
3203#[derive(Builder, Debug, PartialEq)]
3204pub struct ContainerWithoutFileOpts {
3205 #[builder(setter(into, strip_option), default)]
3207 pub expand: Option<bool>,
3208}
3209#[derive(Builder, Debug, PartialEq)]
3210pub struct ContainerWithoutFilesOpts {
3211 #[builder(setter(into, strip_option), default)]
3213 pub expand: Option<bool>,
3214}
3215#[derive(Builder, Debug, PartialEq)]
3216pub struct ContainerWithFilesOpts<'a> {
3217 #[builder(setter(into, strip_option), default)]
3219 pub expand: Option<bool>,
3220 #[builder(setter(into, strip_option), default)]
3222 pub inherit_owner: Option<bool>,
3223 #[builder(setter(into, strip_option), default)]
3227 pub owner: Option<&'a str>,
3228 #[builder(setter(into, strip_option), default)]
3230 pub permissions: Option<isize>,
3231}
3232#[derive(Builder, Debug, PartialEq)]
3233pub struct ContainerWithNewFileOpts<'a> {
3234 #[builder(setter(into, strip_option), default)]
3236 pub expand: Option<bool>,
3237 #[builder(setter(into, strip_option), default)]
3239 pub inherit_owner: Option<bool>,
3240 #[builder(setter(into, strip_option), default)]
3244 pub owner: Option<&'a str>,
3245 #[builder(setter(into, strip_option), default)]
3247 pub permissions: Option<isize>,
3248}
3249#[derive(Builder, Debug, PartialEq)]
3250pub struct ContainerWithDirectoryOpts<'a> {
3251 #[builder(setter(into, strip_option), default)]
3253 pub exclude: Option<Vec<&'a str>>,
3254 #[builder(setter(into, strip_option), default)]
3256 pub expand: Option<bool>,
3257 #[builder(setter(into, strip_option), default)]
3259 pub gitignore: Option<bool>,
3260 #[builder(setter(into, strip_option), default)]
3262 pub include: Option<Vec<&'a str>>,
3263 #[builder(setter(into, strip_option), default)]
3265 pub inherit_owner: Option<bool>,
3266 #[builder(setter(into, strip_option), default)]
3270 pub owner: Option<&'a str>,
3271 #[builder(setter(into, strip_option), default)]
3272 pub permissions: Option<isize>,
3273}
3274#[derive(Builder, Debug, PartialEq)]
3275pub struct ContainerWithoutDirectoryOpts {
3276 #[builder(setter(into, strip_option), default)]
3278 pub expand: Option<bool>,
3279}
3280#[derive(Builder, Debug, PartialEq)]
3281pub struct ContainerExistsOpts {
3282 #[builder(setter(into, strip_option), default)]
3284 pub do_not_follow_symlinks: Option<bool>,
3285 #[builder(setter(into, strip_option), default)]
3287 pub expand: Option<bool>,
3288 #[builder(setter(into, strip_option), default)]
3290 pub expected_type: Option<ExistsType>,
3291}
3292#[derive(Builder, Debug, PartialEq)]
3293pub struct ContainerStatOpts {
3294 #[builder(setter(into, strip_option), default)]
3296 pub do_not_follow_symlinks: Option<bool>,
3297}
3298#[derive(Builder, Debug, PartialEq)]
3299pub struct ContainerWithExecOpts<'a> {
3300 #[builder(setter(into, strip_option), default)]
3304 pub dagger_in_dagger_new_session: Option<bool>,
3305 #[builder(setter(into, strip_option), default)]
3307 pub disable_dagger_in_dagger: Option<bool>,
3308 #[builder(setter(into, strip_option), default)]
3310 pub expand: Option<bool>,
3311 #[builder(setter(into, strip_option), default)]
3313 pub expect: Option<ReturnType>,
3314 #[builder(setter(into, strip_option), default)]
3315 pub experimental_privileged_nesting: Option<bool>,
3316 #[builder(setter(into, strip_option), default)]
3319 pub insecure_root_capabilities: Option<bool>,
3320 #[builder(setter(into, strip_option), default)]
3323 pub no_init: Option<bool>,
3324 #[builder(setter(into, strip_option), default)]
3326 pub redirect_stderr: Option<&'a str>,
3327 #[builder(setter(into, strip_option), default)]
3329 pub redirect_stdin: Option<&'a str>,
3330 #[builder(setter(into, strip_option), default)]
3332 pub redirect_stdout: Option<&'a str>,
3333 #[builder(setter(into, strip_option), default)]
3335 pub stdin: Option<&'a str>,
3336 #[builder(setter(into, strip_option), default)]
3338 pub use_entrypoint: Option<bool>,
3339}
3340#[derive(Builder, Debug, PartialEq)]
3341pub struct ContainerWithSymlinkOpts {
3342 #[builder(setter(into, strip_option), default)]
3344 pub expand: Option<bool>,
3345}
3346#[derive(Builder, Debug, PartialEq)]
3347pub struct ContainerPublishOpts {
3348 #[builder(setter(into, strip_option), default)]
3351 pub forced_compression: Option<ImageLayerCompression>,
3352 #[builder(setter(into, strip_option), default)]
3354 pub insecure_skip_tls_verify: Option<bool>,
3355 #[builder(setter(into, strip_option), default)]
3358 pub media_types: Option<ImageMediaTypes>,
3359 #[builder(setter(into, strip_option), default)]
3362 pub platform_variants: Option<Vec<Id>>,
3363 #[builder(setter(into, strip_option), default)]
3366 pub protocol: Option<RegistryProtocol>,
3367 #[builder(setter(into, strip_option), default)]
3370 pub registry_service: Option<Id>,
3371}
3372#[derive(Builder, Debug, PartialEq)]
3373pub struct ContainerExportOpts {
3374 #[builder(setter(into, strip_option), default)]
3376 pub expand: Option<bool>,
3377 #[builder(setter(into, strip_option), default)]
3380 pub forced_compression: Option<ImageLayerCompression>,
3381 #[builder(setter(into, strip_option), default)]
3384 pub media_types: Option<ImageMediaTypes>,
3385 #[builder(setter(into, strip_option), default)]
3388 pub platform_variants: Option<Vec<Id>>,
3389}
3390#[derive(Builder, Debug, PartialEq)]
3391pub struct ContainerExportImageOpts {
3392 #[builder(setter(into, strip_option), default)]
3395 pub forced_compression: Option<ImageLayerCompression>,
3396 #[builder(setter(into, strip_option), default)]
3399 pub media_types: Option<ImageMediaTypes>,
3400 #[builder(setter(into, strip_option), default)]
3403 pub platform_variants: Option<Vec<Id>>,
3404}
3405#[derive(Builder, Debug, PartialEq)]
3406pub struct ContainerAsTarballOpts {
3407 #[builder(setter(into, strip_option), default)]
3410 pub forced_compression: Option<ImageLayerCompression>,
3411 #[builder(setter(into, strip_option), default)]
3414 pub media_types: Option<ImageMediaTypes>,
3415 #[builder(setter(into, strip_option), default)]
3418 pub platform_variants: Option<Vec<Id>>,
3419}
3420#[derive(Builder, Debug, PartialEq)]
3421pub struct ContainerImportOpts<'a> {
3422 #[builder(setter(into, strip_option), default)]
3424 pub tag: Option<&'a str>,
3425}
3426#[derive(Builder, Debug, PartialEq)]
3427pub struct ContainerManifestOpts {
3428 #[builder(setter(into, strip_option), default)]
3431 pub forced_compression: Option<ImageLayerCompression>,
3432 #[builder(setter(into, strip_option), default)]
3434 pub media_types: Option<ImageMediaTypes>,
3435}
3436#[derive(Builder, Debug, PartialEq)]
3437pub struct ContainerLayerOpts {
3438 #[builder(setter(into, strip_option), default)]
3441 pub forced_compression: Option<ImageLayerCompression>,
3442 #[builder(setter(into, strip_option), default)]
3444 pub media_types: Option<ImageMediaTypes>,
3445}
3446#[derive(Builder, Debug, PartialEq)]
3447pub struct ContainerWithExposedPortOpts<'a> {
3448 #[builder(setter(into, strip_option), default)]
3450 pub description: Option<&'a str>,
3451 #[builder(setter(into, strip_option), default)]
3453 pub experimental_skip_healthcheck: Option<bool>,
3454 #[builder(setter(into, strip_option), default)]
3456 pub protocol: Option<NetworkProtocol>,
3457}
3458#[derive(Builder, Debug, PartialEq)]
3459pub struct ContainerWithoutExposedPortOpts {
3460 #[builder(setter(into, strip_option), default)]
3462 pub protocol: Option<NetworkProtocol>,
3463}
3464#[derive(Builder, Debug, PartialEq)]
3465pub struct ContainerWithDefaultTerminalCmdOpts {
3466 #[builder(setter(into, strip_option), default)]
3468 pub disable_dagger_in_dagger: Option<bool>,
3469 #[builder(setter(into, strip_option), default)]
3470 pub experimental_privileged_nesting: Option<bool>,
3471 #[builder(setter(into, strip_option), default)]
3473 pub insecure_root_capabilities: Option<bool>,
3474}
3475#[derive(Builder, Debug, PartialEq)]
3476pub struct ContainerWithShellOpts<'a> {
3477 #[builder(setter(into, strip_option), default)]
3479 pub batch: 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 ContainerShellOpts {
3491 #[builder(setter(into, strip_option), default)]
3493 pub batch: Option<bool>,
3494}
3495#[derive(Builder, Debug, PartialEq)]
3496pub struct ContainerWithRunOpts<'a> {
3497 #[builder(setter(into, strip_option), default)]
3499 pub disable_dagger_in_dagger: Option<bool>,
3500 #[builder(setter(into, strip_option), default)]
3501 pub experimental_privileged_nesting: Option<bool>,
3502 #[builder(setter(into, strip_option), default)]
3504 pub insecure_root_capabilities: Option<bool>,
3505 #[builder(setter(into, strip_option), default)]
3507 pub shell: Option<Vec<&'a str>>,
3508}
3509#[derive(Builder, Debug, PartialEq)]
3510pub struct ContainerTerminalOpts<'a> {
3511 #[builder(setter(into, strip_option), default)]
3513 pub cmd: Option<Vec<&'a str>>,
3514 #[builder(setter(into, strip_option), default)]
3516 pub disable_dagger_in_dagger: Option<bool>,
3517 #[builder(setter(into, strip_option), default)]
3518 pub experimental_privileged_nesting: Option<bool>,
3519 #[builder(setter(into, strip_option), default)]
3521 pub insecure_root_capabilities: Option<bool>,
3522}
3523#[derive(Builder, Debug, PartialEq)]
3524pub struct ContainerAsServiceOpts<'a> {
3525 #[builder(setter(into, strip_option), default)]
3528 pub args: Option<Vec<&'a str>>,
3529 #[builder(setter(into, strip_option), default)]
3533 pub dagger_in_dagger_new_session: Option<bool>,
3534 #[builder(setter(into, strip_option), default)]
3536 pub disable_dagger_in_dagger: Option<bool>,
3537 #[builder(setter(into, strip_option), default)]
3539 pub expand: Option<bool>,
3540 #[builder(setter(into, strip_option), default)]
3541 pub experimental_privileged_nesting: Option<bool>,
3542 #[builder(setter(into, strip_option), default)]
3544 pub insecure_root_capabilities: Option<bool>,
3545 #[builder(setter(into, strip_option), default)]
3548 pub no_init: Option<bool>,
3549 #[builder(setter(into, strip_option), default)]
3551 pub use_entrypoint: Option<bool>,
3552}
3553#[derive(Builder, Debug, PartialEq)]
3554pub struct ContainerUpOpts<'a> {
3555 #[builder(setter(into, strip_option), default)]
3558 pub args: Option<Vec<&'a str>>,
3559 #[builder(setter(into, strip_option), default)]
3563 pub dagger_in_dagger_new_session: Option<bool>,
3564 #[builder(setter(into, strip_option), default)]
3566 pub disable_dagger_in_dagger: Option<bool>,
3567 #[builder(setter(into, strip_option), default)]
3569 pub expand: Option<bool>,
3570 #[builder(setter(into, strip_option), default)]
3571 pub experimental_privileged_nesting: Option<bool>,
3572 #[builder(setter(into, strip_option), default)]
3574 pub insecure_root_capabilities: Option<bool>,
3575 #[builder(setter(into, strip_option), default)]
3578 pub no_init: Option<bool>,
3579 #[builder(setter(into, strip_option), default)]
3582 pub ports: Option<Vec<PortForward>>,
3583 #[builder(setter(into, strip_option), default)]
3585 pub random: Option<bool>,
3586 #[builder(setter(into, strip_option), default)]
3588 pub use_entrypoint: Option<bool>,
3589}
3590impl IntoID<Id> for Container {
3591 fn into_id(
3592 self,
3593 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
3594 Box::pin(async move { self.id().await })
3595 }
3596}
3597impl Loadable for Container {
3598 fn graphql_type() -> &'static str {
3599 "Container"
3600 }
3601 fn from_query(
3602 proc: Option<Arc<DaggerSessionProc>>,
3603 selection: Selection,
3604 graphql_client: DynGraphQLClient,
3605 ) -> Self {
3606 Self {
3607 proc,
3608 selection,
3609 graphql_client,
3610 }
3611 }
3612}
3613impl Container {
3614 pub async fn id(&self) -> Result<Id, DaggerError> {
3616 let query = self.selection.select("id");
3617 query.execute(self.graphql_client.clone()).await
3618 }
3619 pub async fn sync(&self) -> Result<Container, DaggerError> {
3622 let query = self.selection.select("sync");
3623 let id: Id = query.execute(self.graphql_client.clone()).await?;
3624 Ok(Container {
3625 proc: self.proc.clone(),
3626 selection: query
3627 .root()
3628 .select("node")
3629 .arg("id", &id.0)
3630 .inline_fragment("Container"),
3631 graphql_client: self.graphql_client.clone(),
3632 })
3633 }
3634 pub fn from(&self, address: impl Into<String>) -> Container {
3643 let mut query = self.selection.select("from");
3644 query = query.arg("address", address.into());
3645 Container {
3646 proc: self.proc.clone(),
3647 selection: query,
3648 graphql_client: self.graphql_client.clone(),
3649 }
3650 }
3651 pub fn from_opts<'a>(
3660 &self,
3661 address: impl Into<String>,
3662 opts: ContainerFromOpts<'a>,
3663 ) -> Container {
3664 let mut query = self.selection.select("from");
3665 query = query.arg("address", address.into());
3666 if let Some(version) = opts.version {
3667 query = query.arg("version", version);
3668 }
3669 if let Some(registry_service) = opts.registry_service {
3670 query = query.arg("registryService", registry_service);
3671 }
3672 if let Some(protocol) = opts.protocol {
3673 query = query.arg("protocol", protocol);
3674 }
3675 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
3676 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
3677 }
3678 if let Some(no_lock) = opts.no_lock {
3679 query = query.arg("noLock", no_lock);
3680 }
3681 Container {
3682 proc: self.proc.clone(),
3683 selection: query,
3684 graphql_client: self.graphql_client.clone(),
3685 }
3686 }
3687 pub fn rootfs(&self) -> Directory {
3689 let query = self.selection.select("rootfs");
3690 Directory {
3691 proc: self.proc.clone(),
3692 selection: query,
3693 graphql_client: self.graphql_client.clone(),
3694 }
3695 }
3696 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3702 let mut query = self.selection.select("withRootfs");
3703 query = query.arg_lazy(
3704 "directory",
3705 Box::new(move || {
3706 let directory = directory.clone();
3707 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3708 }),
3709 );
3710 Container {
3711 proc: self.proc.clone(),
3712 selection: query,
3713 graphql_client: self.graphql_client.clone(),
3714 }
3715 }
3716 pub fn directory(&self, path: impl Into<String>) -> Directory {
3724 let mut query = self.selection.select("directory");
3725 query = query.arg("path", path.into());
3726 Directory {
3727 proc: self.proc.clone(),
3728 selection: query,
3729 graphql_client: self.graphql_client.clone(),
3730 }
3731 }
3732 pub fn directory_opts(
3740 &self,
3741 path: impl Into<String>,
3742 opts: ContainerDirectoryOpts,
3743 ) -> Directory {
3744 let mut query = self.selection.select("directory");
3745 query = query.arg("path", path.into());
3746 if let Some(expand) = opts.expand {
3747 query = query.arg("expand", expand);
3748 }
3749 Directory {
3750 proc: self.proc.clone(),
3751 selection: query,
3752 graphql_client: self.graphql_client.clone(),
3753 }
3754 }
3755 pub fn file(&self, path: impl Into<String>) -> File {
3763 let mut query = self.selection.select("file");
3764 query = query.arg("path", path.into());
3765 File {
3766 proc: self.proc.clone(),
3767 selection: query,
3768 graphql_client: self.graphql_client.clone(),
3769 }
3770 }
3771 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3779 let mut query = self.selection.select("file");
3780 query = query.arg("path", path.into());
3781 if let Some(expand) = opts.expand {
3782 query = query.arg("expand", expand);
3783 }
3784 File {
3785 proc: self.proc.clone(),
3786 selection: query,
3787 graphql_client: self.graphql_client.clone(),
3788 }
3789 }
3790 pub async fn user(&self) -> Result<String, DaggerError> {
3792 let query = self.selection.select("user");
3793 query.execute(self.graphql_client.clone()).await
3794 }
3795 pub fn with_user(&self, name: impl Into<String>) -> Container {
3801 let mut query = self.selection.select("withUser");
3802 query = query.arg("name", name.into());
3803 Container {
3804 proc: self.proc.clone(),
3805 selection: query,
3806 graphql_client: self.graphql_client.clone(),
3807 }
3808 }
3809 pub fn without_user(&self) -> Container {
3812 let query = self.selection.select("withoutUser");
3813 Container {
3814 proc: self.proc.clone(),
3815 selection: query,
3816 graphql_client: self.graphql_client.clone(),
3817 }
3818 }
3819 pub async fn workdir(&self) -> Result<String, DaggerError> {
3821 let query = self.selection.select("workdir");
3822 query.execute(self.graphql_client.clone()).await
3823 }
3824 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3831 let mut query = self.selection.select("withWorkdir");
3832 query = query.arg("path", path.into());
3833 Container {
3834 proc: self.proc.clone(),
3835 selection: query,
3836 graphql_client: self.graphql_client.clone(),
3837 }
3838 }
3839 pub fn with_workdir_opts(
3846 &self,
3847 path: impl Into<String>,
3848 opts: ContainerWithWorkdirOpts,
3849 ) -> Container {
3850 let mut query = self.selection.select("withWorkdir");
3851 query = query.arg("path", path.into());
3852 if let Some(expand) = opts.expand {
3853 query = query.arg("expand", expand);
3854 }
3855 Container {
3856 proc: self.proc.clone(),
3857 selection: query,
3858 graphql_client: self.graphql_client.clone(),
3859 }
3860 }
3861 pub fn without_workdir(&self) -> Container {
3864 let query = self.selection.select("withoutWorkdir");
3865 Container {
3866 proc: self.proc.clone(),
3867 selection: query,
3868 graphql_client: self.graphql_client.clone(),
3869 }
3870 }
3871 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
3873 let query = self.selection.select("envVariables");
3874 let query = query.select("id");
3875 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
3876 Ok(ids
3877 .into_iter()
3878 .map(|id| EnvVariable {
3879 proc: self.proc.clone(),
3880 selection: crate::querybuilder::query()
3881 .select("node")
3882 .arg("id", &id.0)
3883 .inline_fragment("EnvVariable"),
3884 graphql_client: self.graphql_client.clone(),
3885 })
3886 .collect())
3887 }
3888 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3894 let mut query = self.selection.select("envVariable");
3895 query = query.arg("name", name.into());
3896 query.execute(self.graphql_client.clone()).await
3897 }
3898 pub fn with_env_variable(
3906 &self,
3907 name: impl Into<String>,
3908 value: impl Into<String>,
3909 ) -> Container {
3910 let mut query = self.selection.select("withEnvVariable");
3911 query = query.arg("name", name.into());
3912 query = query.arg("value", value.into());
3913 Container {
3914 proc: self.proc.clone(),
3915 selection: query,
3916 graphql_client: self.graphql_client.clone(),
3917 }
3918 }
3919 pub fn with_env_variable_opts(
3927 &self,
3928 name: impl Into<String>,
3929 value: impl Into<String>,
3930 opts: ContainerWithEnvVariableOpts,
3931 ) -> Container {
3932 let mut query = self.selection.select("withEnvVariable");
3933 query = query.arg("name", name.into());
3934 query = query.arg("value", value.into());
3935 if let Some(expand) = opts.expand {
3936 query = query.arg("expand", expand);
3937 }
3938 Container {
3939 proc: self.proc.clone(),
3940 selection: query,
3941 graphql_client: self.graphql_client.clone(),
3942 }
3943 }
3944 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
3950 let mut query = self.selection.select("withEnvFileVariables");
3951 query = query.arg_lazy(
3952 "source",
3953 Box::new(move || {
3954 let source = source.clone();
3955 Box::pin(async move { source.into_id().await.unwrap().quote() })
3956 }),
3957 );
3958 Container {
3959 proc: self.proc.clone(),
3960 selection: query,
3961 graphql_client: self.graphql_client.clone(),
3962 }
3963 }
3964 pub fn with_secret_variable(
3971 &self,
3972 name: impl Into<String>,
3973 secret: impl IntoID<Id>,
3974 ) -> Container {
3975 let mut query = self.selection.select("withSecretVariable");
3976 query = query.arg("name", name.into());
3977 query = query.arg_lazy(
3978 "secret",
3979 Box::new(move || {
3980 let secret = secret.clone();
3981 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3982 }),
3983 );
3984 Container {
3985 proc: self.proc.clone(),
3986 selection: query,
3987 graphql_client: self.graphql_client.clone(),
3988 }
3989 }
3990 pub fn with_volatile_variable(
3998 &self,
3999 name: impl Into<String>,
4000 value: impl Into<String>,
4001 ) -> Container {
4002 let mut query = self.selection.select("withVolatileVariable");
4003 query = query.arg("name", name.into());
4004 query = query.arg("value", value.into());
4005 Container {
4006 proc: self.proc.clone(),
4007 selection: query,
4008 graphql_client: self.graphql_client.clone(),
4009 }
4010 }
4011 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4017 let mut query = self.selection.select("withoutEnvVariable");
4018 query = query.arg("name", name.into());
4019 Container {
4020 proc: self.proc.clone(),
4021 selection: query,
4022 graphql_client: self.graphql_client.clone(),
4023 }
4024 }
4025 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4031 let mut query = self.selection.select("withoutSecretVariable");
4032 query = query.arg("name", name.into());
4033 Container {
4034 proc: self.proc.clone(),
4035 selection: query,
4036 graphql_client: self.graphql_client.clone(),
4037 }
4038 }
4039 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4045 let mut query = self.selection.select("withoutVolatileVariable");
4046 query = query.arg("name", name.into());
4047 Container {
4048 proc: self.proc.clone(),
4049 selection: query,
4050 graphql_client: self.graphql_client.clone(),
4051 }
4052 }
4053 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4060 let mut query = self.selection.select("withLabel");
4061 query = query.arg("name", name.into());
4062 query = query.arg("value", value.into());
4063 Container {
4064 proc: self.proc.clone(),
4065 selection: query,
4066 graphql_client: self.graphql_client.clone(),
4067 }
4068 }
4069 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
4075 let mut query = self.selection.select("label");
4076 query = query.arg("name", name.into());
4077 query.execute(self.graphql_client.clone()).await
4078 }
4079 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
4081 let query = self.selection.select("labels");
4082 let query = query.select("id");
4083 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4084 Ok(ids
4085 .into_iter()
4086 .map(|id| Label {
4087 proc: self.proc.clone(),
4088 selection: crate::querybuilder::query()
4089 .select("node")
4090 .arg("id", &id.0)
4091 .inline_fragment("Label"),
4092 graphql_client: self.graphql_client.clone(),
4093 })
4094 .collect())
4095 }
4096 pub fn without_label(&self, name: impl Into<String>) -> Container {
4102 let mut query = self.selection.select("withoutLabel");
4103 query = query.arg("name", name.into());
4104 Container {
4105 proc: self.proc.clone(),
4106 selection: query,
4107 graphql_client: self.graphql_client.clone(),
4108 }
4109 }
4110 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4117 let mut query = self.selection.select("withDockerHealthcheck");
4118 query = query.arg(
4119 "args",
4120 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4121 );
4122 Container {
4123 proc: self.proc.clone(),
4124 selection: query,
4125 graphql_client: self.graphql_client.clone(),
4126 }
4127 }
4128 pub fn with_docker_healthcheck_opts<'a>(
4135 &self,
4136 args: Vec<impl Into<String>>,
4137 opts: ContainerWithDockerHealthcheckOpts<'a>,
4138 ) -> Container {
4139 let mut query = self.selection.select("withDockerHealthcheck");
4140 query = query.arg(
4141 "args",
4142 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4143 );
4144 if let Some(shell) = opts.shell {
4145 query = query.arg("shell", shell);
4146 }
4147 if let Some(interval) = opts.interval {
4148 query = query.arg("interval", interval);
4149 }
4150 if let Some(timeout) = opts.timeout {
4151 query = query.arg("timeout", timeout);
4152 }
4153 if let Some(start_period) = opts.start_period {
4154 query = query.arg("startPeriod", start_period);
4155 }
4156 if let Some(start_interval) = opts.start_interval {
4157 query = query.arg("startInterval", start_interval);
4158 }
4159 if let Some(retries) = opts.retries {
4160 query = query.arg("retries", retries);
4161 }
4162 Container {
4163 proc: self.proc.clone(),
4164 selection: query,
4165 graphql_client: self.graphql_client.clone(),
4166 }
4167 }
4168 pub fn without_docker_healthcheck(&self) -> Container {
4170 let query = self.selection.select("withoutDockerHealthcheck");
4171 Container {
4172 proc: self.proc.clone(),
4173 selection: query,
4174 graphql_client: self.graphql_client.clone(),
4175 }
4176 }
4177 pub async fn docker_healthcheck(&self) -> Result<Option<HealthcheckConfig>, DaggerError> {
4179 let query = self.selection.select("dockerHealthcheck");
4180 let query = query.select("id");
4181 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
4182 Ok(id.map(|id| HealthcheckConfig {
4183 proc: self.proc.clone(),
4184 selection: query
4185 .root()
4186 .select("node")
4187 .arg("id", &id.0)
4188 .inline_fragment("HealthcheckConfig"),
4189 graphql_client: self.graphql_client.clone(),
4190 }))
4191 }
4192 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
4194 let query = self.selection.select("entrypoint");
4195 query.execute(self.graphql_client.clone()).await
4196 }
4197 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4204 let mut query = self.selection.select("withEntrypoint");
4205 query = query.arg(
4206 "args",
4207 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4208 );
4209 Container {
4210 proc: self.proc.clone(),
4211 selection: query,
4212 graphql_client: self.graphql_client.clone(),
4213 }
4214 }
4215 pub fn with_entrypoint_opts(
4222 &self,
4223 args: Vec<impl Into<String>>,
4224 opts: ContainerWithEntrypointOpts,
4225 ) -> Container {
4226 let mut query = self.selection.select("withEntrypoint");
4227 query = query.arg(
4228 "args",
4229 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4230 );
4231 if let Some(keep_default_args) = opts.keep_default_args {
4232 query = query.arg("keepDefaultArgs", keep_default_args);
4233 }
4234 Container {
4235 proc: self.proc.clone(),
4236 selection: query,
4237 graphql_client: self.graphql_client.clone(),
4238 }
4239 }
4240 pub fn without_entrypoint(&self) -> Container {
4246 let query = self.selection.select("withoutEntrypoint");
4247 Container {
4248 proc: self.proc.clone(),
4249 selection: query,
4250 graphql_client: self.graphql_client.clone(),
4251 }
4252 }
4253 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4259 let mut query = self.selection.select("withoutEntrypoint");
4260 if let Some(keep_default_args) = opts.keep_default_args {
4261 query = query.arg("keepDefaultArgs", keep_default_args);
4262 }
4263 Container {
4264 proc: self.proc.clone(),
4265 selection: query,
4266 graphql_client: self.graphql_client.clone(),
4267 }
4268 }
4269 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
4271 let query = self.selection.select("defaultArgs");
4272 query.execute(self.graphql_client.clone()).await
4273 }
4274 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4280 let mut query = self.selection.select("withDefaultArgs");
4281 query = query.arg(
4282 "args",
4283 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4284 );
4285 Container {
4286 proc: self.proc.clone(),
4287 selection: query,
4288 graphql_client: self.graphql_client.clone(),
4289 }
4290 }
4291 pub fn without_default_args(&self) -> Container {
4293 let query = self.selection.select("withoutDefaultArgs");
4294 Container {
4295 proc: self.proc.clone(),
4296 selection: query,
4297 graphql_client: self.graphql_client.clone(),
4298 }
4299 }
4300 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
4302 let query = self.selection.select("mounts");
4303 query.execute(self.graphql_client.clone()).await
4304 }
4305 pub fn with_mounted_directory(
4313 &self,
4314 path: impl Into<String>,
4315 source: impl IntoID<Id>,
4316 ) -> Container {
4317 let mut query = self.selection.select("withMountedDirectory");
4318 query = query.arg("path", path.into());
4319 query = query.arg_lazy(
4320 "source",
4321 Box::new(move || {
4322 let source = source.clone();
4323 Box::pin(async move { source.into_id().await.unwrap().quote() })
4324 }),
4325 );
4326 Container {
4327 proc: self.proc.clone(),
4328 selection: query,
4329 graphql_client: self.graphql_client.clone(),
4330 }
4331 }
4332 pub fn with_mounted_directory_opts<'a>(
4340 &self,
4341 path: impl Into<String>,
4342 source: impl IntoID<Id>,
4343 opts: ContainerWithMountedDirectoryOpts<'a>,
4344 ) -> Container {
4345 let mut query = self.selection.select("withMountedDirectory");
4346 query = query.arg("path", path.into());
4347 query = query.arg_lazy(
4348 "source",
4349 Box::new(move || {
4350 let source = source.clone();
4351 Box::pin(async move { source.into_id().await.unwrap().quote() })
4352 }),
4353 );
4354 if let Some(owner) = opts.owner {
4355 query = query.arg("owner", owner);
4356 }
4357 if let Some(inherit_owner) = opts.inherit_owner {
4358 query = query.arg("inheritOwner", inherit_owner);
4359 }
4360 if let Some(read_only) = opts.read_only {
4361 query = query.arg("readOnly", read_only);
4362 }
4363 if let Some(expand) = opts.expand {
4364 query = query.arg("expand", expand);
4365 }
4366 Container {
4367 proc: self.proc.clone(),
4368 selection: query,
4369 graphql_client: self.graphql_client.clone(),
4370 }
4371 }
4372 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4380 let mut query = self.selection.select("withMountedFile");
4381 query = query.arg("path", path.into());
4382 query = query.arg_lazy(
4383 "source",
4384 Box::new(move || {
4385 let source = source.clone();
4386 Box::pin(async move { source.into_id().await.unwrap().quote() })
4387 }),
4388 );
4389 Container {
4390 proc: self.proc.clone(),
4391 selection: query,
4392 graphql_client: self.graphql_client.clone(),
4393 }
4394 }
4395 pub fn with_mounted_file_opts<'a>(
4403 &self,
4404 path: impl Into<String>,
4405 source: impl IntoID<Id>,
4406 opts: ContainerWithMountedFileOpts<'a>,
4407 ) -> Container {
4408 let mut query = self.selection.select("withMountedFile");
4409 query = query.arg("path", path.into());
4410 query = query.arg_lazy(
4411 "source",
4412 Box::new(move || {
4413 let source = source.clone();
4414 Box::pin(async move { source.into_id().await.unwrap().quote() })
4415 }),
4416 );
4417 if let Some(owner) = opts.owner {
4418 query = query.arg("owner", owner);
4419 }
4420 if let Some(inherit_owner) = opts.inherit_owner {
4421 query = query.arg("inheritOwner", inherit_owner);
4422 }
4423 if let Some(expand) = opts.expand {
4424 query = query.arg("expand", expand);
4425 }
4426 if let Some(read_only) = opts.read_only {
4427 query = query.arg("readOnly", read_only);
4428 }
4429 Container {
4430 proc: self.proc.clone(),
4431 selection: query,
4432 graphql_client: self.graphql_client.clone(),
4433 }
4434 }
4435 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4442 let mut query = self.selection.select("withMountedTemp");
4443 query = query.arg("path", path.into());
4444 Container {
4445 proc: self.proc.clone(),
4446 selection: query,
4447 graphql_client: self.graphql_client.clone(),
4448 }
4449 }
4450 pub fn with_mounted_temp_opts(
4457 &self,
4458 path: impl Into<String>,
4459 opts: ContainerWithMountedTempOpts,
4460 ) -> Container {
4461 let mut query = self.selection.select("withMountedTemp");
4462 query = query.arg("path", path.into());
4463 if let Some(size) = opts.size {
4464 query = query.arg("size", size);
4465 }
4466 if let Some(expand) = opts.expand {
4467 query = query.arg("expand", expand);
4468 }
4469 Container {
4470 proc: self.proc.clone(),
4471 selection: query,
4472 graphql_client: self.graphql_client.clone(),
4473 }
4474 }
4475 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
4483 let mut query = self.selection.select("withMountedCache");
4484 query = query.arg("path", path.into());
4485 query = query.arg_lazy(
4486 "cache",
4487 Box::new(move || {
4488 let cache = cache.clone();
4489 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4490 }),
4491 );
4492 Container {
4493 proc: self.proc.clone(),
4494 selection: query,
4495 graphql_client: self.graphql_client.clone(),
4496 }
4497 }
4498 pub fn with_mounted_cache_opts<'a>(
4506 &self,
4507 path: impl Into<String>,
4508 cache: impl IntoID<Id>,
4509 opts: ContainerWithMountedCacheOpts<'a>,
4510 ) -> Container {
4511 let mut query = self.selection.select("withMountedCache");
4512 query = query.arg("path", path.into());
4513 query = query.arg_lazy(
4514 "cache",
4515 Box::new(move || {
4516 let cache = cache.clone();
4517 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4518 }),
4519 );
4520 if let Some(source) = opts.source {
4521 query = query.arg("source", source);
4522 }
4523 if let Some(sharing) = opts.sharing {
4524 query = query.arg("sharing", sharing);
4525 }
4526 if let Some(owner) = opts.owner {
4527 query = query.arg("owner", owner);
4528 }
4529 if let Some(inherit_owner) = opts.inherit_owner {
4530 query = query.arg("inheritOwner", inherit_owner);
4531 }
4532 if let Some(expand) = opts.expand {
4533 query = query.arg("expand", expand);
4534 }
4535 Container {
4536 proc: self.proc.clone(),
4537 selection: query,
4538 graphql_client: self.graphql_client.clone(),
4539 }
4540 }
4541 pub fn with_mounted_volume(
4549 &self,
4550 path: impl Into<String>,
4551 volume: impl IntoID<Id>,
4552 ) -> Container {
4553 let mut query = self.selection.select("withMountedVolume");
4554 query = query.arg("path", path.into());
4555 query = query.arg_lazy(
4556 "volume",
4557 Box::new(move || {
4558 let volume = volume.clone();
4559 Box::pin(async move { volume.into_id().await.unwrap().quote() })
4560 }),
4561 );
4562 Container {
4563 proc: self.proc.clone(),
4564 selection: query,
4565 graphql_client: self.graphql_client.clone(),
4566 }
4567 }
4568 pub fn with_mounted_volume_opts(
4576 &self,
4577 path: impl Into<String>,
4578 volume: impl IntoID<Id>,
4579 opts: ContainerWithMountedVolumeOpts,
4580 ) -> Container {
4581 let mut query = self.selection.select("withMountedVolume");
4582 query = query.arg("path", path.into());
4583 query = query.arg_lazy(
4584 "volume",
4585 Box::new(move || {
4586 let volume = volume.clone();
4587 Box::pin(async move { volume.into_id().await.unwrap().quote() })
4588 }),
4589 );
4590 if let Some(read_only) = opts.read_only {
4591 query = query.arg("readOnly", read_only);
4592 }
4593 if let Some(expand) = opts.expand {
4594 query = query.arg("expand", expand);
4595 }
4596 Container {
4597 proc: self.proc.clone(),
4598 selection: query,
4599 graphql_client: self.graphql_client.clone(),
4600 }
4601 }
4602 pub fn with_mounted_secret(
4610 &self,
4611 path: impl Into<String>,
4612 source: impl IntoID<Id>,
4613 ) -> Container {
4614 let mut query = self.selection.select("withMountedSecret");
4615 query = query.arg("path", path.into());
4616 query = query.arg_lazy(
4617 "source",
4618 Box::new(move || {
4619 let source = source.clone();
4620 Box::pin(async move { source.into_id().await.unwrap().quote() })
4621 }),
4622 );
4623 Container {
4624 proc: self.proc.clone(),
4625 selection: query,
4626 graphql_client: self.graphql_client.clone(),
4627 }
4628 }
4629 pub fn with_mounted_secret_opts<'a>(
4637 &self,
4638 path: impl Into<String>,
4639 source: impl IntoID<Id>,
4640 opts: ContainerWithMountedSecretOpts<'a>,
4641 ) -> Container {
4642 let mut query = self.selection.select("withMountedSecret");
4643 query = query.arg("path", path.into());
4644 query = query.arg_lazy(
4645 "source",
4646 Box::new(move || {
4647 let source = source.clone();
4648 Box::pin(async move { source.into_id().await.unwrap().quote() })
4649 }),
4650 );
4651 if let Some(owner) = opts.owner {
4652 query = query.arg("owner", owner);
4653 }
4654 if let Some(inherit_owner) = opts.inherit_owner {
4655 query = query.arg("inheritOwner", inherit_owner);
4656 }
4657 if let Some(mode) = opts.mode {
4658 query = query.arg("mode", mode);
4659 }
4660 if let Some(expand) = opts.expand {
4661 query = query.arg("expand", expand);
4662 }
4663 Container {
4664 proc: self.proc.clone(),
4665 selection: query,
4666 graphql_client: self.graphql_client.clone(),
4667 }
4668 }
4669 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4677 let mut query = self.selection.select("withUnixSocket");
4678 query = query.arg("path", path.into());
4679 query = query.arg_lazy(
4680 "source",
4681 Box::new(move || {
4682 let source = source.clone();
4683 Box::pin(async move { source.into_id().await.unwrap().quote() })
4684 }),
4685 );
4686 Container {
4687 proc: self.proc.clone(),
4688 selection: query,
4689 graphql_client: self.graphql_client.clone(),
4690 }
4691 }
4692 pub fn with_unix_socket_opts<'a>(
4700 &self,
4701 path: impl Into<String>,
4702 source: impl IntoID<Id>,
4703 opts: ContainerWithUnixSocketOpts<'a>,
4704 ) -> Container {
4705 let mut query = self.selection.select("withUnixSocket");
4706 query = query.arg("path", path.into());
4707 query = query.arg_lazy(
4708 "source",
4709 Box::new(move || {
4710 let source = source.clone();
4711 Box::pin(async move { source.into_id().await.unwrap().quote() })
4712 }),
4713 );
4714 if let Some(owner) = opts.owner {
4715 query = query.arg("owner", owner);
4716 }
4717 if let Some(inherit_owner) = opts.inherit_owner {
4718 query = query.arg("inheritOwner", inherit_owner);
4719 }
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_unix_socket(&self, path: impl Into<String>) -> Container {
4736 let mut query = self.selection.select("withoutUnixSocket");
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_unix_socket_opts(
4751 &self,
4752 path: impl Into<String>,
4753 opts: ContainerWithoutUnixSocketOpts,
4754 ) -> Container {
4755 let mut query = self.selection.select("withoutUnixSocket");
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 without_mount(&self, path: impl Into<String>) -> Container {
4773 let mut query = self.selection.select("withoutMount");
4774 query = query.arg("path", path.into());
4775 Container {
4776 proc: self.proc.clone(),
4777 selection: query,
4778 graphql_client: self.graphql_client.clone(),
4779 }
4780 }
4781 pub fn without_mount_opts(
4788 &self,
4789 path: impl Into<String>,
4790 opts: ContainerWithoutMountOpts,
4791 ) -> Container {
4792 let mut query = self.selection.select("withoutMount");
4793 query = query.arg("path", path.into());
4794 if let Some(expand) = opts.expand {
4795 query = query.arg("expand", expand);
4796 }
4797 Container {
4798 proc: self.proc.clone(),
4799 selection: query,
4800 graphql_client: self.graphql_client.clone(),
4801 }
4802 }
4803 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
4811 let mut query = self.selection.select("withFile");
4812 query = query.arg("path", path.into());
4813 query = query.arg_lazy(
4814 "source",
4815 Box::new(move || {
4816 let source = source.clone();
4817 Box::pin(async move { source.into_id().await.unwrap().quote() })
4818 }),
4819 );
4820 Container {
4821 proc: self.proc.clone(),
4822 selection: query,
4823 graphql_client: self.graphql_client.clone(),
4824 }
4825 }
4826 pub fn with_file_opts<'a>(
4834 &self,
4835 path: impl Into<String>,
4836 source: impl IntoID<Id>,
4837 opts: ContainerWithFileOpts<'a>,
4838 ) -> Container {
4839 let mut query = self.selection.select("withFile");
4840 query = query.arg("path", path.into());
4841 query = query.arg_lazy(
4842 "source",
4843 Box::new(move || {
4844 let source = source.clone();
4845 Box::pin(async move { source.into_id().await.unwrap().quote() })
4846 }),
4847 );
4848 if let Some(permissions) = opts.permissions {
4849 query = query.arg("permissions", permissions);
4850 }
4851 if let Some(owner) = opts.owner {
4852 query = query.arg("owner", owner);
4853 }
4854 if let Some(inherit_owner) = opts.inherit_owner {
4855 query = query.arg("inheritOwner", inherit_owner);
4856 }
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_file(&self, path: impl Into<String>) -> Container {
4873 let mut query = self.selection.select("withoutFile");
4874 query = query.arg("path", path.into());
4875 Container {
4876 proc: self.proc.clone(),
4877 selection: query,
4878 graphql_client: self.graphql_client.clone(),
4879 }
4880 }
4881 pub fn without_file_opts(
4888 &self,
4889 path: impl Into<String>,
4890 opts: ContainerWithoutFileOpts,
4891 ) -> Container {
4892 let mut query = self.selection.select("withoutFile");
4893 query = query.arg("path", path.into());
4894 if let Some(expand) = opts.expand {
4895 query = query.arg("expand", expand);
4896 }
4897 Container {
4898 proc: self.proc.clone(),
4899 selection: query,
4900 graphql_client: self.graphql_client.clone(),
4901 }
4902 }
4903 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4910 let mut query = self.selection.select("withoutFiles");
4911 query = query.arg(
4912 "paths",
4913 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4914 );
4915 Container {
4916 proc: self.proc.clone(),
4917 selection: query,
4918 graphql_client: self.graphql_client.clone(),
4919 }
4920 }
4921 pub fn without_files_opts(
4928 &self,
4929 paths: Vec<impl Into<String>>,
4930 opts: ContainerWithoutFilesOpts,
4931 ) -> Container {
4932 let mut query = self.selection.select("withoutFiles");
4933 query = query.arg(
4934 "paths",
4935 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4936 );
4937 if let Some(expand) = opts.expand {
4938 query = query.arg("expand", expand);
4939 }
4940 Container {
4941 proc: self.proc.clone(),
4942 selection: query,
4943 graphql_client: self.graphql_client.clone(),
4944 }
4945 }
4946 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
4954 let mut query = self.selection.select("withFiles");
4955 query = query.arg("path", path.into());
4956 query = query.arg("sources", sources);
4957 Container {
4958 proc: self.proc.clone(),
4959 selection: query,
4960 graphql_client: self.graphql_client.clone(),
4961 }
4962 }
4963 pub fn with_files_opts<'a>(
4971 &self,
4972 path: impl Into<String>,
4973 sources: Vec<Id>,
4974 opts: ContainerWithFilesOpts<'a>,
4975 ) -> Container {
4976 let mut query = self.selection.select("withFiles");
4977 query = query.arg("path", path.into());
4978 query = query.arg("sources", sources);
4979 if let Some(permissions) = opts.permissions {
4980 query = query.arg("permissions", permissions);
4981 }
4982 if let Some(owner) = opts.owner {
4983 query = query.arg("owner", owner);
4984 }
4985 if let Some(inherit_owner) = opts.inherit_owner {
4986 query = query.arg("inheritOwner", inherit_owner);
4987 }
4988 if let Some(expand) = opts.expand {
4989 query = query.arg("expand", expand);
4990 }
4991 Container {
4992 proc: self.proc.clone(),
4993 selection: query,
4994 graphql_client: self.graphql_client.clone(),
4995 }
4996 }
4997 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
5005 let mut query = self.selection.select("withNewFile");
5006 query = query.arg("path", path.into());
5007 query = query.arg("contents", contents.into());
5008 Container {
5009 proc: self.proc.clone(),
5010 selection: query,
5011 graphql_client: self.graphql_client.clone(),
5012 }
5013 }
5014 pub fn with_new_file_opts<'a>(
5022 &self,
5023 path: impl Into<String>,
5024 contents: impl Into<String>,
5025 opts: ContainerWithNewFileOpts<'a>,
5026 ) -> Container {
5027 let mut query = self.selection.select("withNewFile");
5028 query = query.arg("path", path.into());
5029 query = query.arg("contents", contents.into());
5030 if let Some(permissions) = opts.permissions {
5031 query = query.arg("permissions", permissions);
5032 }
5033 if let Some(owner) = opts.owner {
5034 query = query.arg("owner", owner);
5035 }
5036 if let Some(inherit_owner) = opts.inherit_owner {
5037 query = query.arg("inheritOwner", inherit_owner);
5038 }
5039 if let Some(expand) = opts.expand {
5040 query = query.arg("expand", expand);
5041 }
5042 Container {
5043 proc: self.proc.clone(),
5044 selection: query,
5045 graphql_client: self.graphql_client.clone(),
5046 }
5047 }
5048 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
5056 let mut query = self.selection.select("withDirectory");
5057 query = query.arg("path", path.into());
5058 query = query.arg_lazy(
5059 "source",
5060 Box::new(move || {
5061 let source = source.clone();
5062 Box::pin(async move { source.into_id().await.unwrap().quote() })
5063 }),
5064 );
5065 Container {
5066 proc: self.proc.clone(),
5067 selection: query,
5068 graphql_client: self.graphql_client.clone(),
5069 }
5070 }
5071 pub fn with_directory_opts<'a>(
5079 &self,
5080 path: impl Into<String>,
5081 source: impl IntoID<Id>,
5082 opts: ContainerWithDirectoryOpts<'a>,
5083 ) -> Container {
5084 let mut query = self.selection.select("withDirectory");
5085 query = query.arg("path", path.into());
5086 query = query.arg_lazy(
5087 "source",
5088 Box::new(move || {
5089 let source = source.clone();
5090 Box::pin(async move { source.into_id().await.unwrap().quote() })
5091 }),
5092 );
5093 if let Some(exclude) = opts.exclude {
5094 query = query.arg("exclude", exclude);
5095 }
5096 if let Some(include) = opts.include {
5097 query = query.arg("include", include);
5098 }
5099 if let Some(gitignore) = opts.gitignore {
5100 query = query.arg("gitignore", gitignore);
5101 }
5102 if let Some(owner) = opts.owner {
5103 query = query.arg("owner", owner);
5104 }
5105 if let Some(inherit_owner) = opts.inherit_owner {
5106 query = query.arg("inheritOwner", inherit_owner);
5107 }
5108 if let Some(expand) = opts.expand {
5109 query = query.arg("expand", expand);
5110 }
5111 if let Some(permissions) = opts.permissions {
5112 query = query.arg("permissions", permissions);
5113 }
5114 Container {
5115 proc: self.proc.clone(),
5116 selection: query,
5117 graphql_client: self.graphql_client.clone(),
5118 }
5119 }
5120 pub fn without_directory(&self, path: impl Into<String>) -> Container {
5127 let mut query = self.selection.select("withoutDirectory");
5128 query = query.arg("path", path.into());
5129 Container {
5130 proc: self.proc.clone(),
5131 selection: query,
5132 graphql_client: self.graphql_client.clone(),
5133 }
5134 }
5135 pub fn without_directory_opts(
5142 &self,
5143 path: impl Into<String>,
5144 opts: ContainerWithoutDirectoryOpts,
5145 ) -> Container {
5146 let mut query = self.selection.select("withoutDirectory");
5147 query = query.arg("path", path.into());
5148 if let Some(expand) = opts.expand {
5149 query = query.arg("expand", expand);
5150 }
5151 Container {
5152 proc: self.proc.clone(),
5153 selection: query,
5154 graphql_client: self.graphql_client.clone(),
5155 }
5156 }
5157 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5164 let mut query = self.selection.select("exists");
5165 query = query.arg("path", path.into());
5166 query.execute(self.graphql_client.clone()).await
5167 }
5168 pub async fn exists_opts(
5175 &self,
5176 path: impl Into<String>,
5177 opts: ContainerExistsOpts,
5178 ) -> Result<bool, DaggerError> {
5179 let mut query = self.selection.select("exists");
5180 query = query.arg("path", path.into());
5181 if let Some(expected_type) = opts.expected_type {
5182 query = query.arg("expectedType", expected_type);
5183 }
5184 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5185 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5186 }
5187 if let Some(expand) = opts.expand {
5188 query = query.arg("expand", expand);
5189 }
5190 query.execute(self.graphql_client.clone()).await
5191 }
5192 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
5199 let mut query = self.selection.select("stat");
5200 query = query.arg("path", path.into());
5201 let query = query.select("id");
5202 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5203 Ok(id.map(|id| Stat {
5204 proc: self.proc.clone(),
5205 selection: query
5206 .root()
5207 .select("node")
5208 .arg("id", &id.0)
5209 .inline_fragment("Stat"),
5210 graphql_client: self.graphql_client.clone(),
5211 }))
5212 }
5213 pub async fn stat_opts(
5220 &self,
5221 path: impl Into<String>,
5222 opts: ContainerStatOpts,
5223 ) -> Result<Option<Stat>, DaggerError> {
5224 let mut query = self.selection.select("stat");
5225 query = query.arg("path", path.into());
5226 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5227 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5228 }
5229 let query = query.select("id");
5230 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
5231 Ok(id.map(|id| Stat {
5232 proc: self.proc.clone(),
5233 selection: query
5234 .root()
5235 .select("node")
5236 .arg("id", &id.0)
5237 .inline_fragment("Stat"),
5238 graphql_client: self.graphql_client.clone(),
5239 }))
5240 }
5241 pub fn with_error(&self, err: impl Into<String>) -> Container {
5247 let mut query = self.selection.select("withError");
5248 query = query.arg("err", err.into());
5249 Container {
5250 proc: self.proc.clone(),
5251 selection: query,
5252 graphql_client: self.graphql_client.clone(),
5253 }
5254 }
5255 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
5266 let mut query = self.selection.select("withExec");
5267 query = query.arg(
5268 "args",
5269 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5270 );
5271 Container {
5272 proc: self.proc.clone(),
5273 selection: query,
5274 graphql_client: self.graphql_client.clone(),
5275 }
5276 }
5277 pub fn with_exec_opts<'a>(
5288 &self,
5289 args: Vec<impl Into<String>>,
5290 opts: ContainerWithExecOpts<'a>,
5291 ) -> Container {
5292 let mut query = self.selection.select("withExec");
5293 query = query.arg(
5294 "args",
5295 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5296 );
5297 if let Some(use_entrypoint) = opts.use_entrypoint {
5298 query = query.arg("useEntrypoint", use_entrypoint);
5299 }
5300 if let Some(stdin) = opts.stdin {
5301 query = query.arg("stdin", stdin);
5302 }
5303 if let Some(redirect_stdin) = opts.redirect_stdin {
5304 query = query.arg("redirectStdin", redirect_stdin);
5305 }
5306 if let Some(redirect_stdout) = opts.redirect_stdout {
5307 query = query.arg("redirectStdout", redirect_stdout);
5308 }
5309 if let Some(redirect_stderr) = opts.redirect_stderr {
5310 query = query.arg("redirectStderr", redirect_stderr);
5311 }
5312 if let Some(expect) = opts.expect {
5313 query = query.arg("expect", expect);
5314 }
5315 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5316 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5317 }
5318 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5319 query = query.arg(
5320 "experimentalPrivilegedNesting",
5321 experimental_privileged_nesting,
5322 );
5323 }
5324 if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
5325 query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
5326 }
5327 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5328 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5329 }
5330 if let Some(expand) = opts.expand {
5331 query = query.arg("expand", expand);
5332 }
5333 if let Some(no_init) = opts.no_init {
5334 query = query.arg("noInit", no_init);
5335 }
5336 Container {
5337 proc: self.proc.clone(),
5338 selection: query,
5339 graphql_client: self.graphql_client.clone(),
5340 }
5341 }
5342 pub async fn stdout(&self) -> Result<String, DaggerError> {
5345 let query = self.selection.select("stdout");
5346 query.execute(self.graphql_client.clone()).await
5347 }
5348 pub async fn stderr(&self) -> Result<String, DaggerError> {
5351 let query = self.selection.select("stderr");
5352 query.execute(self.graphql_client.clone()).await
5353 }
5354 pub async fn combined_output(&self) -> Result<String, DaggerError> {
5357 let query = self.selection.select("combinedOutput");
5358 query.execute(self.graphql_client.clone()).await
5359 }
5360 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
5363 let query = self.selection.select("exitCode");
5364 query.execute(self.graphql_client.clone()).await
5365 }
5366 pub fn with_symlink(
5374 &self,
5375 target: impl Into<String>,
5376 link_name: impl Into<String>,
5377 ) -> Container {
5378 let mut query = self.selection.select("withSymlink");
5379 query = query.arg("target", target.into());
5380 query = query.arg("linkName", link_name.into());
5381 Container {
5382 proc: self.proc.clone(),
5383 selection: query,
5384 graphql_client: self.graphql_client.clone(),
5385 }
5386 }
5387 pub fn with_symlink_opts(
5395 &self,
5396 target: impl Into<String>,
5397 link_name: impl Into<String>,
5398 opts: ContainerWithSymlinkOpts,
5399 ) -> Container {
5400 let mut query = self.selection.select("withSymlink");
5401 query = query.arg("target", target.into());
5402 query = query.arg("linkName", link_name.into());
5403 if let Some(expand) = opts.expand {
5404 query = query.arg("expand", expand);
5405 }
5406 Container {
5407 proc: self.proc.clone(),
5408 selection: query,
5409 graphql_client: self.graphql_client.clone(),
5410 }
5411 }
5412 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
5419 let mut query = self.selection.select("withAnnotation");
5420 query = query.arg("name", name.into());
5421 query = query.arg("value", value.into());
5422 Container {
5423 proc: self.proc.clone(),
5424 selection: query,
5425 graphql_client: self.graphql_client.clone(),
5426 }
5427 }
5428 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5434 let mut query = self.selection.select("withoutAnnotation");
5435 query = query.arg("name", name.into());
5436 Container {
5437 proc: self.proc.clone(),
5438 selection: query,
5439 graphql_client: self.graphql_client.clone(),
5440 }
5441 }
5442 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
5452 let mut query = self.selection.select("publish");
5453 query = query.arg("address", address.into());
5454 query.execute(self.graphql_client.clone()).await
5455 }
5456 pub async fn publish_opts(
5466 &self,
5467 address: impl Into<String>,
5468 opts: ContainerPublishOpts,
5469 ) -> Result<String, DaggerError> {
5470 let mut query = self.selection.select("publish");
5471 query = query.arg("address", address.into());
5472 if let Some(platform_variants) = opts.platform_variants {
5473 query = query.arg("platformVariants", platform_variants);
5474 }
5475 if let Some(forced_compression) = opts.forced_compression {
5476 query = query.arg("forcedCompression", forced_compression);
5477 }
5478 if let Some(media_types) = opts.media_types {
5479 query = query.arg("mediaTypes", media_types);
5480 }
5481 if let Some(registry_service) = opts.registry_service {
5482 query = query.arg("registryService", registry_service);
5483 }
5484 if let Some(protocol) = opts.protocol {
5485 query = query.arg("protocol", protocol);
5486 }
5487 if let Some(insecure_skip_tls_verify) = opts.insecure_skip_tls_verify {
5488 query = query.arg("insecureSkipTLSVerify", insecure_skip_tls_verify);
5489 }
5490 query.execute(self.graphql_client.clone()).await
5491 }
5492 pub async fn platform(&self) -> Result<Platform, DaggerError> {
5494 let query = self.selection.select("platform");
5495 query.execute(self.graphql_client.clone()).await
5496 }
5497 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5507 let mut query = self.selection.select("export");
5508 query = query.arg("path", path.into());
5509 query.execute(self.graphql_client.clone()).await
5510 }
5511 pub async fn export_opts(
5521 &self,
5522 path: impl Into<String>,
5523 opts: ContainerExportOpts,
5524 ) -> Result<String, DaggerError> {
5525 let mut query = self.selection.select("export");
5526 query = query.arg("path", path.into());
5527 if let Some(platform_variants) = opts.platform_variants {
5528 query = query.arg("platformVariants", platform_variants);
5529 }
5530 if let Some(forced_compression) = opts.forced_compression {
5531 query = query.arg("forcedCompression", forced_compression);
5532 }
5533 if let Some(media_types) = opts.media_types {
5534 query = query.arg("mediaTypes", media_types);
5535 }
5536 if let Some(expand) = opts.expand {
5537 query = query.arg("expand", expand);
5538 }
5539 query.execute(self.graphql_client.clone()).await
5540 }
5541 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
5548 let mut query = self.selection.select("exportImage");
5549 query = query.arg("name", name.into());
5550 query.execute(self.graphql_client.clone()).await
5551 }
5552 pub async fn export_image_opts(
5559 &self,
5560 name: impl Into<String>,
5561 opts: ContainerExportImageOpts,
5562 ) -> Result<Void, DaggerError> {
5563 let mut query = self.selection.select("exportImage");
5564 query = query.arg("name", name.into());
5565 if let Some(platform_variants) = opts.platform_variants {
5566 query = query.arg("platformVariants", platform_variants);
5567 }
5568 if let Some(forced_compression) = opts.forced_compression {
5569 query = query.arg("forcedCompression", forced_compression);
5570 }
5571 if let Some(media_types) = opts.media_types {
5572 query = query.arg("mediaTypes", media_types);
5573 }
5574 query.execute(self.graphql_client.clone()).await
5575 }
5576 pub fn as_tarball(&self) -> File {
5582 let query = self.selection.select("asTarball");
5583 File {
5584 proc: self.proc.clone(),
5585 selection: query,
5586 graphql_client: self.graphql_client.clone(),
5587 }
5588 }
5589 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
5595 let mut query = self.selection.select("asTarball");
5596 if let Some(platform_variants) = opts.platform_variants {
5597 query = query.arg("platformVariants", platform_variants);
5598 }
5599 if let Some(forced_compression) = opts.forced_compression {
5600 query = query.arg("forcedCompression", forced_compression);
5601 }
5602 if let Some(media_types) = opts.media_types {
5603 query = query.arg("mediaTypes", media_types);
5604 }
5605 File {
5606 proc: self.proc.clone(),
5607 selection: query,
5608 graphql_client: self.graphql_client.clone(),
5609 }
5610 }
5611 pub fn import(&self, source: impl IntoID<Id>) -> Container {
5618 let mut query = self.selection.select("import");
5619 query = query.arg_lazy(
5620 "source",
5621 Box::new(move || {
5622 let source = source.clone();
5623 Box::pin(async move { source.into_id().await.unwrap().quote() })
5624 }),
5625 );
5626 Container {
5627 proc: self.proc.clone(),
5628 selection: query,
5629 graphql_client: self.graphql_client.clone(),
5630 }
5631 }
5632 pub fn import_opts<'a>(
5639 &self,
5640 source: impl IntoID<Id>,
5641 opts: ContainerImportOpts<'a>,
5642 ) -> Container {
5643 let mut query = self.selection.select("import");
5644 query = query.arg_lazy(
5645 "source",
5646 Box::new(move || {
5647 let source = source.clone();
5648 Box::pin(async move { source.into_id().await.unwrap().quote() })
5649 }),
5650 );
5651 if let Some(tag) = opts.tag {
5652 query = query.arg("tag", tag);
5653 }
5654 Container {
5655 proc: self.proc.clone(),
5656 selection: query,
5657 graphql_client: self.graphql_client.clone(),
5658 }
5659 }
5660 pub fn with_registry_auth(
5668 &self,
5669 address: impl Into<String>,
5670 username: impl Into<String>,
5671 secret: impl IntoID<Id>,
5672 ) -> Container {
5673 let mut query = self.selection.select("withRegistryAuth");
5674 query = query.arg("address", address.into());
5675 query = query.arg("username", username.into());
5676 query = query.arg_lazy(
5677 "secret",
5678 Box::new(move || {
5679 let secret = secret.clone();
5680 Box::pin(async move { secret.into_id().await.unwrap().quote() })
5681 }),
5682 );
5683 Container {
5684 proc: self.proc.clone(),
5685 selection: query,
5686 graphql_client: self.graphql_client.clone(),
5687 }
5688 }
5689 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5697 let mut query = self.selection.select("withoutRegistryAuth");
5698 query = query.arg("address", address.into());
5699 Container {
5700 proc: self.proc.clone(),
5701 selection: query,
5702 graphql_client: self.graphql_client.clone(),
5703 }
5704 }
5705 pub async fn image_ref(&self) -> Result<String, DaggerError> {
5707 let query = self.selection.select("imageRef");
5708 query.execute(self.graphql_client.clone()).await
5709 }
5710 pub fn manifest(&self) -> File {
5716 let query = self.selection.select("manifest");
5717 File {
5718 proc: self.proc.clone(),
5719 selection: query,
5720 graphql_client: self.graphql_client.clone(),
5721 }
5722 }
5723 pub fn manifest_opts(&self, opts: ContainerManifestOpts) -> File {
5729 let mut query = self.selection.select("manifest");
5730 if let Some(forced_compression) = opts.forced_compression {
5731 query = query.arg("forcedCompression", forced_compression);
5732 }
5733 if let Some(media_types) = opts.media_types {
5734 query = query.arg("mediaTypes", media_types);
5735 }
5736 File {
5737 proc: self.proc.clone(),
5738 selection: query,
5739 graphql_client: self.graphql_client.clone(),
5740 }
5741 }
5742 pub fn layer(&self, id: impl Into<String>) -> File {
5749 let mut query = self.selection.select("layer");
5750 query = query.arg("id", id.into());
5751 File {
5752 proc: self.proc.clone(),
5753 selection: query,
5754 graphql_client: self.graphql_client.clone(),
5755 }
5756 }
5757 pub fn layer_opts(&self, id: impl Into<String>, opts: ContainerLayerOpts) -> File {
5764 let mut query = self.selection.select("layer");
5765 query = query.arg("id", id.into());
5766 if let Some(forced_compression) = opts.forced_compression {
5767 query = query.arg("forcedCompression", forced_compression);
5768 }
5769 if let Some(media_types) = opts.media_types {
5770 query = query.arg("mediaTypes", media_types);
5771 }
5772 File {
5773 proc: self.proc.clone(),
5774 selection: query,
5775 graphql_client: self.graphql_client.clone(),
5776 }
5777 }
5778 pub fn with_exposed_port(&self, port: isize) -> Container {
5788 let mut query = self.selection.select("withExposedPort");
5789 query = query.arg("port", port);
5790 Container {
5791 proc: self.proc.clone(),
5792 selection: query,
5793 graphql_client: self.graphql_client.clone(),
5794 }
5795 }
5796 pub fn with_exposed_port_opts<'a>(
5806 &self,
5807 port: isize,
5808 opts: ContainerWithExposedPortOpts<'a>,
5809 ) -> Container {
5810 let mut query = self.selection.select("withExposedPort");
5811 query = query.arg("port", port);
5812 if let Some(protocol) = opts.protocol {
5813 query = query.arg("protocol", protocol);
5814 }
5815 if let Some(description) = opts.description {
5816 query = query.arg("description", description);
5817 }
5818 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
5819 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
5820 }
5821 Container {
5822 proc: self.proc.clone(),
5823 selection: query,
5824 graphql_client: self.graphql_client.clone(),
5825 }
5826 }
5827 pub fn without_exposed_port(&self, port: isize) -> Container {
5834 let mut query = self.selection.select("withoutExposedPort");
5835 query = query.arg("port", port);
5836 Container {
5837 proc: self.proc.clone(),
5838 selection: query,
5839 graphql_client: self.graphql_client.clone(),
5840 }
5841 }
5842 pub fn without_exposed_port_opts(
5849 &self,
5850 port: isize,
5851 opts: ContainerWithoutExposedPortOpts,
5852 ) -> Container {
5853 let mut query = self.selection.select("withoutExposedPort");
5854 query = query.arg("port", port);
5855 if let Some(protocol) = opts.protocol {
5856 query = query.arg("protocol", protocol);
5857 }
5858 Container {
5859 proc: self.proc.clone(),
5860 selection: query,
5861 graphql_client: self.graphql_client.clone(),
5862 }
5863 }
5864 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
5867 let query = self.selection.select("exposedPorts");
5868 let query = query.select("id");
5869 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5870 Ok(ids
5871 .into_iter()
5872 .map(|id| Port {
5873 proc: self.proc.clone(),
5874 selection: crate::querybuilder::query()
5875 .select("node")
5876 .arg("id", &id.0)
5877 .inline_fragment("Port"),
5878 graphql_client: self.graphql_client.clone(),
5879 })
5880 .collect())
5881 }
5882 pub fn with_service_binding(
5892 &self,
5893 alias: impl Into<String>,
5894 service: impl IntoID<Id>,
5895 ) -> Container {
5896 let mut query = self.selection.select("withServiceBinding");
5897 query = query.arg("alias", alias.into());
5898 query = query.arg_lazy(
5899 "service",
5900 Box::new(move || {
5901 let service = service.clone();
5902 Box::pin(async move { service.into_id().await.unwrap().quote() })
5903 }),
5904 );
5905 Container {
5906 proc: self.proc.clone(),
5907 selection: query,
5908 graphql_client: self.graphql_client.clone(),
5909 }
5910 }
5911 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
5918 let mut query = self.selection.select("withDefaultTerminalCmd");
5919 query = query.arg(
5920 "args",
5921 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5922 );
5923 Container {
5924 proc: self.proc.clone(),
5925 selection: query,
5926 graphql_client: self.graphql_client.clone(),
5927 }
5928 }
5929 pub fn with_default_terminal_cmd_opts(
5936 &self,
5937 args: Vec<impl Into<String>>,
5938 opts: ContainerWithDefaultTerminalCmdOpts,
5939 ) -> Container {
5940 let mut query = self.selection.select("withDefaultTerminalCmd");
5941 query = query.arg(
5942 "args",
5943 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5944 );
5945 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
5946 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
5947 }
5948 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5949 query = query.arg(
5950 "experimentalPrivilegedNesting",
5951 experimental_privileged_nesting,
5952 );
5953 }
5954 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5955 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5956 }
5957 Container {
5958 proc: self.proc.clone(),
5959 selection: query,
5960 graphql_client: self.graphql_client.clone(),
5961 }
5962 }
5963 pub fn with_shell(&self, interactive: Vec<impl Into<String>>) -> Container {
5970 let mut query = self.selection.select("withShell");
5971 query = query.arg(
5972 "interactive",
5973 interactive
5974 .into_iter()
5975 .map(|i| i.into())
5976 .collect::<Vec<String>>(),
5977 );
5978 Container {
5979 proc: self.proc.clone(),
5980 selection: query,
5981 graphql_client: self.graphql_client.clone(),
5982 }
5983 }
5984 pub fn with_shell_opts<'a>(
5991 &self,
5992 interactive: Vec<impl Into<String>>,
5993 opts: ContainerWithShellOpts<'a>,
5994 ) -> Container {
5995 let mut query = self.selection.select("withShell");
5996 query = query.arg(
5997 "interactive",
5998 interactive
5999 .into_iter()
6000 .map(|i| i.into())
6001 .collect::<Vec<String>>(),
6002 );
6003 if let Some(batch) = opts.batch {
6004 query = query.arg("batch", batch);
6005 }
6006 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6007 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6008 }
6009 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6010 query = query.arg(
6011 "experimentalPrivilegedNesting",
6012 experimental_privileged_nesting,
6013 );
6014 }
6015 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6016 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6017 }
6018 Container {
6019 proc: self.proc.clone(),
6020 selection: query,
6021 graphql_client: self.graphql_client.clone(),
6022 }
6023 }
6024 pub fn shell(&self) -> Command {
6030 let query = self.selection.select("shell");
6031 Command {
6032 proc: self.proc.clone(),
6033 selection: query,
6034 graphql_client: self.graphql_client.clone(),
6035 }
6036 }
6037 pub fn shell_opts(&self, opts: ContainerShellOpts) -> Command {
6043 let mut query = self.selection.select("shell");
6044 if let Some(batch) = opts.batch {
6045 query = query.arg("batch", batch);
6046 }
6047 Command {
6048 proc: self.proc.clone(),
6049 selection: query,
6050 graphql_client: self.graphql_client.clone(),
6051 }
6052 }
6053 pub fn with_run(&self, command: impl Into<String>) -> Container {
6060 let mut query = self.selection.select("withRun");
6061 query = query.arg("command", command.into());
6062 Container {
6063 proc: self.proc.clone(),
6064 selection: query,
6065 graphql_client: self.graphql_client.clone(),
6066 }
6067 }
6068 pub fn with_run_opts<'a>(
6075 &self,
6076 command: impl Into<String>,
6077 opts: ContainerWithRunOpts<'a>,
6078 ) -> Container {
6079 let mut query = self.selection.select("withRun");
6080 query = query.arg("command", command.into());
6081 if let Some(shell) = opts.shell {
6082 query = query.arg("shell", shell);
6083 }
6084 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6085 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6086 }
6087 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6088 query = query.arg(
6089 "experimentalPrivilegedNesting",
6090 experimental_privileged_nesting,
6091 );
6092 }
6093 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6094 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6095 }
6096 Container {
6097 proc: self.proc.clone(),
6098 selection: query,
6099 graphql_client: self.graphql_client.clone(),
6100 }
6101 }
6102 pub fn terminal(&self) -> Container {
6108 let query = self.selection.select("terminal");
6109 Container {
6110 proc: self.proc.clone(),
6111 selection: query,
6112 graphql_client: self.graphql_client.clone(),
6113 }
6114 }
6115 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
6121 let mut query = self.selection.select("terminal");
6122 if let Some(cmd) = opts.cmd {
6123 query = query.arg("cmd", cmd);
6124 }
6125 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6126 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6127 }
6128 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6129 query = query.arg(
6130 "experimentalPrivilegedNesting",
6131 experimental_privileged_nesting,
6132 );
6133 }
6134 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6135 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6136 }
6137 Container {
6138 proc: self.proc.clone(),
6139 selection: query,
6140 graphql_client: self.graphql_client.clone(),
6141 }
6142 }
6143 pub fn with_gpu(&self) -> Container {
6146 let query = self.selection.select("withGPU");
6147 Container {
6148 proc: self.proc.clone(),
6149 selection: query,
6150 graphql_client: self.graphql_client.clone(),
6151 }
6152 }
6153 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
6160 let mut query = self.selection.select("experimentalWithGPU");
6161 query = query.arg(
6162 "devices",
6163 devices
6164 .into_iter()
6165 .map(|i| i.into())
6166 .collect::<Vec<String>>(),
6167 );
6168 Container {
6169 proc: self.proc.clone(),
6170 selection: query,
6171 graphql_client: self.graphql_client.clone(),
6172 }
6173 }
6174 pub fn experimental_with_all_gp_us(&self) -> Container {
6177 let query = self.selection.select("experimentalWithAllGPUs");
6178 Container {
6179 proc: self.proc.clone(),
6180 selection: query,
6181 graphql_client: self.graphql_client.clone(),
6182 }
6183 }
6184 pub fn as_service(&self) -> Service {
6191 let query = self.selection.select("asService");
6192 Service {
6193 proc: self.proc.clone(),
6194 selection: query,
6195 graphql_client: self.graphql_client.clone(),
6196 }
6197 }
6198 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
6205 let mut query = self.selection.select("asService");
6206 if let Some(args) = opts.args {
6207 query = query.arg("args", args);
6208 }
6209 if let Some(use_entrypoint) = opts.use_entrypoint {
6210 query = query.arg("useEntrypoint", use_entrypoint);
6211 }
6212 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6213 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6214 }
6215 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6216 query = query.arg(
6217 "experimentalPrivilegedNesting",
6218 experimental_privileged_nesting,
6219 );
6220 }
6221 if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6222 query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6223 }
6224 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6225 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6226 }
6227 if let Some(expand) = opts.expand {
6228 query = query.arg("expand", expand);
6229 }
6230 if let Some(no_init) = opts.no_init {
6231 query = query.arg("noInit", no_init);
6232 }
6233 Service {
6234 proc: self.proc.clone(),
6235 selection: query,
6236 graphql_client: self.graphql_client.clone(),
6237 }
6238 }
6239 pub async fn up(&self) -> Result<Void, DaggerError> {
6246 let query = self.selection.select("up");
6247 query.execute(self.graphql_client.clone()).await
6248 }
6249 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
6256 let mut query = self.selection.select("up");
6257 if let Some(random) = opts.random {
6258 query = query.arg("random", random);
6259 }
6260 if let Some(ports) = opts.ports {
6261 query = query.arg("ports", ports);
6262 }
6263 if let Some(args) = opts.args {
6264 query = query.arg("args", args);
6265 }
6266 if let Some(use_entrypoint) = opts.use_entrypoint {
6267 query = query.arg("useEntrypoint", use_entrypoint);
6268 }
6269 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
6270 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
6271 }
6272 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6273 query = query.arg(
6274 "experimentalPrivilegedNesting",
6275 experimental_privileged_nesting,
6276 );
6277 }
6278 if let Some(dagger_in_dagger_new_session) = opts.dagger_in_dagger_new_session {
6279 query = query.arg("daggerInDaggerNewSession", dagger_in_dagger_new_session);
6280 }
6281 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6282 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6283 }
6284 if let Some(expand) = opts.expand {
6285 query = query.arg("expand", expand);
6286 }
6287 if let Some(no_init) = opts.no_init {
6288 query = query.arg("noInit", no_init);
6289 }
6290 query.execute(self.graphql_client.clone()).await
6291 }
6292}
6293impl Exportable for Container {
6294 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6295 let query = self.selection.select("id");
6296 let graphql_client = self.graphql_client.clone();
6297 async move { query.execute(graphql_client).await }
6298 }
6299 fn export(
6300 &self,
6301 path: impl Into<String>,
6302 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
6303 let mut query = self.selection.select("export");
6304 query = query.arg("path", path.into());
6305 let graphql_client = self.graphql_client.clone();
6306 async move { query.execute(graphql_client).await }
6307 }
6308}
6309impl Node for Container {
6310 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6311 let query = self.selection.select("id");
6312 let graphql_client = self.graphql_client.clone();
6313 async move { query.execute(graphql_client).await }
6314 }
6315}
6316impl Syncer for Container {
6317 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6318 let query = self.selection.select("id");
6319 let graphql_client = self.graphql_client.clone();
6320 async move { query.execute(graphql_client).await }
6321 }
6322 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
6323 let query = self.selection.select("sync");
6324 let proc = self.proc.clone();
6325 let graphql_client = self.graphql_client.clone();
6326 async move {
6327 let id: Id = query.execute(graphql_client.clone()).await?;
6328 Ok(Self {
6329 proc,
6330 selection: query
6331 .root()
6332 .select("node")
6333 .arg("id", &id.0)
6334 .inline_fragment("Container"),
6335 graphql_client,
6336 })
6337 }
6338 }
6339}
6340#[derive(Clone)]
6341pub struct CurrentModule {
6342 pub proc: Option<Arc<DaggerSessionProc>>,
6343 pub selection: Selection,
6344 pub graphql_client: DynGraphQLClient,
6345}
6346#[derive(Builder, Debug, PartialEq)]
6347pub struct CurrentModuleWorkdirOpts<'a> {
6348 #[builder(setter(into, strip_option), default)]
6350 pub exclude: Option<Vec<&'a str>>,
6351 #[builder(setter(into, strip_option), default)]
6353 pub gitignore: Option<bool>,
6354 #[builder(setter(into, strip_option), default)]
6356 pub include: Option<Vec<&'a str>>,
6357}
6358impl IntoID<Id> for CurrentModule {
6359 fn into_id(
6360 self,
6361 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6362 Box::pin(async move { self.id().await })
6363 }
6364}
6365impl Loadable for CurrentModule {
6366 fn graphql_type() -> &'static str {
6367 "CurrentModule"
6368 }
6369 fn from_query(
6370 proc: Option<Arc<DaggerSessionProc>>,
6371 selection: Selection,
6372 graphql_client: DynGraphQLClient,
6373 ) -> Self {
6374 Self {
6375 proc,
6376 selection,
6377 graphql_client,
6378 }
6379 }
6380}
6381impl CurrentModule {
6382 pub async fn id(&self) -> Result<Id, DaggerError> {
6384 let query = self.selection.select("id");
6385 query.execute(self.graphql_client.clone()).await
6386 }
6387 pub fn context_directory(&self) -> Directory {
6390 let query = self.selection.select("contextDirectory");
6391 Directory {
6392 proc: self.proc.clone(),
6393 selection: query,
6394 graphql_client: self.graphql_client.clone(),
6395 }
6396 }
6397 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
6399 let query = self.selection.select("dependencies");
6400 let query = query.select("id");
6401 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6402 Ok(ids
6403 .into_iter()
6404 .map(|id| Module {
6405 proc: self.proc.clone(),
6406 selection: crate::querybuilder::query()
6407 .select("node")
6408 .arg("id", &id.0)
6409 .inline_fragment("Module"),
6410 graphql_client: self.graphql_client.clone(),
6411 })
6412 .collect())
6413 }
6414 pub fn generated_context_directory(&self) -> Directory {
6416 let query = self.selection.select("generatedContextDirectory");
6417 Directory {
6418 proc: self.proc.clone(),
6419 selection: query,
6420 graphql_client: self.graphql_client.clone(),
6421 }
6422 }
6423 pub async fn name(&self) -> Result<String, DaggerError> {
6425 let query = self.selection.select("name");
6426 query.execute(self.graphql_client.clone()).await
6427 }
6428 pub fn source(&self) -> Directory {
6430 let query = self.selection.select("source");
6431 Directory {
6432 proc: self.proc.clone(),
6433 selection: query,
6434 graphql_client: self.graphql_client.clone(),
6435 }
6436 }
6437 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6439 let query = self.selection.select("sourceSubpath");
6440 query.execute(self.graphql_client.clone()).await
6441 }
6442 pub fn workdir(&self, path: impl Into<String>) -> Directory {
6449 let mut query = self.selection.select("workdir");
6450 query = query.arg("path", path.into());
6451 Directory {
6452 proc: self.proc.clone(),
6453 selection: query,
6454 graphql_client: self.graphql_client.clone(),
6455 }
6456 }
6457 pub fn workdir_opts<'a>(
6464 &self,
6465 path: impl Into<String>,
6466 opts: CurrentModuleWorkdirOpts<'a>,
6467 ) -> Directory {
6468 let mut query = self.selection.select("workdir");
6469 query = query.arg("path", path.into());
6470 if let Some(exclude) = opts.exclude {
6471 query = query.arg("exclude", exclude);
6472 }
6473 if let Some(include) = opts.include {
6474 query = query.arg("include", include);
6475 }
6476 if let Some(gitignore) = opts.gitignore {
6477 query = query.arg("gitignore", gitignore);
6478 }
6479 Directory {
6480 proc: self.proc.clone(),
6481 selection: query,
6482 graphql_client: self.graphql_client.clone(),
6483 }
6484 }
6485 pub fn workdir_file(&self, path: impl Into<String>) -> File {
6491 let mut query = self.selection.select("workdirFile");
6492 query = query.arg("path", path.into());
6493 File {
6494 proc: self.proc.clone(),
6495 selection: query,
6496 graphql_client: self.graphql_client.clone(),
6497 }
6498 }
6499}
6500impl Node for CurrentModule {
6501 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6502 let query = self.selection.select("id");
6503 let graphql_client = self.graphql_client.clone();
6504 async move { query.execute(graphql_client).await }
6505 }
6506}
6507#[derive(Clone)]
6508pub struct DiffStat {
6509 pub proc: Option<Arc<DaggerSessionProc>>,
6510 pub selection: Selection,
6511 pub graphql_client: DynGraphQLClient,
6512}
6513impl IntoID<Id> for DiffStat {
6514 fn into_id(
6515 self,
6516 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6517 Box::pin(async move { self.id().await })
6518 }
6519}
6520impl Loadable for DiffStat {
6521 fn graphql_type() -> &'static str {
6522 "DiffStat"
6523 }
6524 fn from_query(
6525 proc: Option<Arc<DaggerSessionProc>>,
6526 selection: Selection,
6527 graphql_client: DynGraphQLClient,
6528 ) -> Self {
6529 Self {
6530 proc,
6531 selection,
6532 graphql_client,
6533 }
6534 }
6535}
6536impl DiffStat {
6537 pub async fn id(&self) -> Result<Id, DaggerError> {
6539 let query = self.selection.select("id");
6540 query.execute(self.graphql_client.clone()).await
6541 }
6542 pub async fn path(&self) -> Result<String, DaggerError> {
6544 let query = self.selection.select("path");
6545 query.execute(self.graphql_client.clone()).await
6546 }
6547 pub async fn old_path(&self) -> Result<String, DaggerError> {
6549 let query = self.selection.select("oldPath");
6550 query.execute(self.graphql_client.clone()).await
6551 }
6552 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6554 let query = self.selection.select("kind");
6555 query.execute(self.graphql_client.clone()).await
6556 }
6557 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6559 let query = self.selection.select("addedLines");
6560 query.execute(self.graphql_client.clone()).await
6561 }
6562 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6564 let query = self.selection.select("removedLines");
6565 query.execute(self.graphql_client.clone()).await
6566 }
6567}
6568impl Node for DiffStat {
6569 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6570 let query = self.selection.select("id");
6571 let graphql_client = self.graphql_client.clone();
6572 async move { query.execute(graphql_client).await }
6573 }
6574}
6575#[derive(Clone)]
6576pub struct Directory {
6577 pub proc: Option<Arc<DaggerSessionProc>>,
6578 pub selection: Selection,
6579 pub graphql_client: DynGraphQLClient,
6580}
6581#[derive(Builder, Debug, PartialEq)]
6582pub struct DirectoryEntriesOpts<'a> {
6583 #[builder(setter(into, strip_option), default)]
6585 pub path: Option<&'a str>,
6586}
6587#[derive(Builder, Debug, PartialEq)]
6588pub struct DirectorySearchOpts<'a> {
6589 #[builder(setter(into, strip_option), default)]
6591 pub dotall: Option<bool>,
6592 #[builder(setter(into, strip_option), default)]
6594 pub files_only: Option<bool>,
6595 #[builder(setter(into, strip_option), default)]
6597 pub globs: Option<Vec<&'a str>>,
6598 #[builder(setter(into, strip_option), default)]
6600 pub insensitive: Option<bool>,
6601 #[builder(setter(into, strip_option), default)]
6603 pub limit: Option<isize>,
6604 #[builder(setter(into, strip_option), default)]
6606 pub literal: Option<bool>,
6607 #[builder(setter(into, strip_option), default)]
6609 pub multiline: Option<bool>,
6610 #[builder(setter(into, strip_option), default)]
6612 pub paths: Option<Vec<&'a str>>,
6613 #[builder(setter(into, strip_option), default)]
6615 pub skip_hidden: Option<bool>,
6616 #[builder(setter(into, strip_option), default)]
6618 pub skip_ignored: Option<bool>,
6619}
6620#[derive(Builder, Debug, PartialEq)]
6621pub struct DirectoryWithFileOpts<'a> {
6622 #[builder(setter(into, strip_option), default)]
6626 pub owner: Option<&'a str>,
6627 #[builder(setter(into, strip_option), default)]
6629 pub permissions: Option<isize>,
6630}
6631#[derive(Builder, Debug, PartialEq)]
6632pub struct DirectoryWithFilesOpts {
6633 #[builder(setter(into, strip_option), default)]
6635 pub permissions: Option<isize>,
6636}
6637#[derive(Builder, Debug, PartialEq)]
6638pub struct DirectoryWithNewFileOpts {
6639 #[builder(setter(into, strip_option), default)]
6641 pub permissions: Option<isize>,
6642}
6643#[derive(Builder, Debug, PartialEq)]
6644pub struct DirectoryExistsOpts {
6645 #[builder(setter(into, strip_option), default)]
6647 pub do_not_follow_symlinks: Option<bool>,
6648 #[builder(setter(into, strip_option), default)]
6650 pub expected_type: Option<ExistsType>,
6651}
6652#[derive(Builder, Debug, PartialEq)]
6653pub struct DirectoryStatOpts {
6654 #[builder(setter(into, strip_option), default)]
6656 pub do_not_follow_symlinks: Option<bool>,
6657}
6658#[derive(Builder, Debug, PartialEq)]
6659pub struct DirectoryWithDirectoryOpts<'a> {
6660 #[builder(setter(into, strip_option), default)]
6662 pub exclude: Option<Vec<&'a str>>,
6663 #[builder(setter(into, strip_option), default)]
6665 pub gitignore: Option<bool>,
6666 #[builder(setter(into, strip_option), default)]
6668 pub include: Option<Vec<&'a str>>,
6669 #[builder(setter(into, strip_option), default)]
6673 pub owner: Option<&'a str>,
6674 #[builder(setter(into, strip_option), default)]
6676 pub permissions: Option<isize>,
6677}
6678#[derive(Builder, Debug, PartialEq)]
6679pub struct DirectoryFilterOpts<'a> {
6680 #[builder(setter(into, strip_option), default)]
6682 pub exclude: Option<Vec<&'a str>>,
6683 #[builder(setter(into, strip_option), default)]
6685 pub gitignore: Option<bool>,
6686 #[builder(setter(into, strip_option), default)]
6688 pub include: Option<Vec<&'a str>>,
6689}
6690#[derive(Builder, Debug, PartialEq)]
6691pub struct DirectoryWithNewDirectoryOpts {
6692 #[builder(setter(into, strip_option), default)]
6694 pub permissions: Option<isize>,
6695}
6696#[derive(Builder, Debug, PartialEq)]
6697pub struct DirectoryExportOpts {
6698 #[builder(setter(into, strip_option), default)]
6700 pub wipe: Option<bool>,
6701}
6702#[derive(Builder, Debug, PartialEq)]
6703pub struct DirectoryDockerBuildOpts<'a> {
6704 #[builder(setter(into, strip_option), default)]
6706 pub build_args: Option<Vec<BuildArg>>,
6707 #[builder(setter(into, strip_option), default)]
6709 pub dockerfile: Option<&'a str>,
6710 #[builder(setter(into, strip_option), default)]
6713 pub no_init: Option<bool>,
6714 #[builder(setter(into, strip_option), default)]
6716 pub platform: Option<Platform>,
6717 #[builder(setter(into, strip_option), default)]
6720 pub secrets: Option<Vec<Id>>,
6721 #[builder(setter(into, strip_option), default)]
6725 pub ssh: Option<Id>,
6726 #[builder(setter(into, strip_option), default)]
6728 pub target: Option<&'a str>,
6729}
6730#[derive(Builder, Debug, PartialEq)]
6731pub struct DirectoryWithPatchOpts {
6732 #[builder(setter(into, strip_option), default)]
6734 pub on_conflict: Option<PatchConflict>,
6735}
6736#[derive(Builder, Debug, PartialEq)]
6737pub struct DirectoryWithPatchFileOpts {
6738 #[builder(setter(into, strip_option), default)]
6740 pub on_conflict: Option<PatchConflict>,
6741}
6742#[derive(Builder, Debug, PartialEq)]
6743pub struct DirectoryAsWorkspaceOpts<'a> {
6744 #[builder(setter(into, strip_option), default)]
6746 pub cwd: Option<&'a str>,
6747}
6748#[derive(Builder, Debug, PartialEq)]
6749pub struct DirectoryTerminalOpts<'a> {
6750 #[builder(setter(into, strip_option), default)]
6752 pub cmd: Option<Vec<&'a str>>,
6753 #[builder(setter(into, strip_option), default)]
6755 pub container: Option<Id>,
6756 #[builder(setter(into, strip_option), default)]
6758 pub disable_dagger_in_dagger: Option<bool>,
6759 #[builder(setter(into, strip_option), default)]
6760 pub experimental_privileged_nesting: Option<bool>,
6761 #[builder(setter(into, strip_option), default)]
6763 pub insecure_root_capabilities: Option<bool>,
6764}
6765#[derive(Builder, Debug, PartialEq)]
6766pub struct DirectoryAsModuleOpts<'a> {
6767 #[builder(setter(into, strip_option), default)]
6770 pub source_root_path: Option<&'a str>,
6771}
6772#[derive(Builder, Debug, PartialEq)]
6773pub struct DirectoryAsModuleSourceOpts<'a> {
6774 #[builder(setter(into, strip_option), default)]
6777 pub source_root_path: Option<&'a str>,
6778}
6779impl IntoID<Id> for Directory {
6780 fn into_id(
6781 self,
6782 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6783 Box::pin(async move { self.id().await })
6784 }
6785}
6786impl Loadable for Directory {
6787 fn graphql_type() -> &'static str {
6788 "Directory"
6789 }
6790 fn from_query(
6791 proc: Option<Arc<DaggerSessionProc>>,
6792 selection: Selection,
6793 graphql_client: DynGraphQLClient,
6794 ) -> Self {
6795 Self {
6796 proc,
6797 selection,
6798 graphql_client,
6799 }
6800 }
6801}
6802impl Directory {
6803 pub async fn id(&self) -> Result<Id, DaggerError> {
6805 let query = self.selection.select("id");
6806 query.execute(self.graphql_client.clone()).await
6807 }
6808 pub async fn sync(&self) -> Result<Directory, DaggerError> {
6810 let query = self.selection.select("sync");
6811 let id: Id = query.execute(self.graphql_client.clone()).await?;
6812 Ok(Directory {
6813 proc: self.proc.clone(),
6814 selection: query
6815 .root()
6816 .select("node")
6817 .arg("id", &id.0)
6818 .inline_fragment("Directory"),
6819 graphql_client: self.graphql_client.clone(),
6820 })
6821 }
6822 pub async fn name(&self) -> Result<String, DaggerError> {
6824 let query = self.selection.select("name");
6825 query.execute(self.graphql_client.clone()).await
6826 }
6827 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6833 let query = self.selection.select("entries");
6834 query.execute(self.graphql_client.clone()).await
6835 }
6836 pub async fn entries_opts<'a>(
6842 &self,
6843 opts: DirectoryEntriesOpts<'a>,
6844 ) -> Result<Vec<String>, DaggerError> {
6845 let mut query = self.selection.select("entries");
6846 if let Some(path) = opts.path {
6847 query = query.arg("path", path);
6848 }
6849 query.execute(self.graphql_client.clone()).await
6850 }
6851 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6857 let mut query = self.selection.select("glob");
6858 query = query.arg("pattern", pattern.into());
6859 query.execute(self.graphql_client.clone()).await
6860 }
6861 pub async fn search(
6869 &self,
6870 pattern: impl Into<String>,
6871 ) -> Result<Vec<SearchResult>, DaggerError> {
6872 let mut query = self.selection.select("search");
6873 query = query.arg("pattern", pattern.into());
6874 let query = query.select("id");
6875 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6876 Ok(ids
6877 .into_iter()
6878 .map(|id| SearchResult {
6879 proc: self.proc.clone(),
6880 selection: crate::querybuilder::query()
6881 .select("node")
6882 .arg("id", &id.0)
6883 .inline_fragment("SearchResult"),
6884 graphql_client: self.graphql_client.clone(),
6885 })
6886 .collect())
6887 }
6888 pub async fn search_opts<'a>(
6896 &self,
6897 pattern: impl Into<String>,
6898 opts: DirectorySearchOpts<'a>,
6899 ) -> Result<Vec<SearchResult>, DaggerError> {
6900 let mut query = self.selection.select("search");
6901 query = query.arg("pattern", pattern.into());
6902 if let Some(paths) = opts.paths {
6903 query = query.arg("paths", paths);
6904 }
6905 if let Some(globs) = opts.globs {
6906 query = query.arg("globs", globs);
6907 }
6908 if let Some(literal) = opts.literal {
6909 query = query.arg("literal", literal);
6910 }
6911 if let Some(multiline) = opts.multiline {
6912 query = query.arg("multiline", multiline);
6913 }
6914 if let Some(dotall) = opts.dotall {
6915 query = query.arg("dotall", dotall);
6916 }
6917 if let Some(insensitive) = opts.insensitive {
6918 query = query.arg("insensitive", insensitive);
6919 }
6920 if let Some(skip_ignored) = opts.skip_ignored {
6921 query = query.arg("skipIgnored", skip_ignored);
6922 }
6923 if let Some(skip_hidden) = opts.skip_hidden {
6924 query = query.arg("skipHidden", skip_hidden);
6925 }
6926 if let Some(files_only) = opts.files_only {
6927 query = query.arg("filesOnly", files_only);
6928 }
6929 if let Some(limit) = opts.limit {
6930 query = query.arg("limit", limit);
6931 }
6932 let query = query.select("id");
6933 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6934 Ok(ids
6935 .into_iter()
6936 .map(|id| SearchResult {
6937 proc: self.proc.clone(),
6938 selection: crate::querybuilder::query()
6939 .select("node")
6940 .arg("id", &id.0)
6941 .inline_fragment("SearchResult"),
6942 graphql_client: self.graphql_client.clone(),
6943 })
6944 .collect())
6945 }
6946 pub async fn digest(&self) -> Result<String, DaggerError> {
6948 let query = self.selection.select("digest");
6949 query.execute(self.graphql_client.clone()).await
6950 }
6951 pub fn file(&self, path: impl Into<String>) -> File {
6957 let mut query = self.selection.select("file");
6958 query = query.arg("path", path.into());
6959 File {
6960 proc: self.proc.clone(),
6961 selection: query,
6962 graphql_client: self.graphql_client.clone(),
6963 }
6964 }
6965 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
6973 let mut query = self.selection.select("withFile");
6974 query = query.arg("path", path.into());
6975 query = query.arg_lazy(
6976 "source",
6977 Box::new(move || {
6978 let source = source.clone();
6979 Box::pin(async move { source.into_id().await.unwrap().quote() })
6980 }),
6981 );
6982 Directory {
6983 proc: self.proc.clone(),
6984 selection: query,
6985 graphql_client: self.graphql_client.clone(),
6986 }
6987 }
6988 pub fn with_file_opts<'a>(
6996 &self,
6997 path: impl Into<String>,
6998 source: impl IntoID<Id>,
6999 opts: DirectoryWithFileOpts<'a>,
7000 ) -> Directory {
7001 let mut query = self.selection.select("withFile");
7002 query = query.arg("path", path.into());
7003 query = query.arg_lazy(
7004 "source",
7005 Box::new(move || {
7006 let source = source.clone();
7007 Box::pin(async move { source.into_id().await.unwrap().quote() })
7008 }),
7009 );
7010 if let Some(permissions) = opts.permissions {
7011 query = query.arg("permissions", permissions);
7012 }
7013 if let Some(owner) = opts.owner {
7014 query = query.arg("owner", owner);
7015 }
7016 Directory {
7017 proc: self.proc.clone(),
7018 selection: query,
7019 graphql_client: self.graphql_client.clone(),
7020 }
7021 }
7022 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
7030 let mut query = self.selection.select("withFiles");
7031 query = query.arg("path", path.into());
7032 query = query.arg("sources", sources);
7033 Directory {
7034 proc: self.proc.clone(),
7035 selection: query,
7036 graphql_client: self.graphql_client.clone(),
7037 }
7038 }
7039 pub fn with_files_opts(
7047 &self,
7048 path: impl Into<String>,
7049 sources: Vec<Id>,
7050 opts: DirectoryWithFilesOpts,
7051 ) -> Directory {
7052 let mut query = self.selection.select("withFiles");
7053 query = query.arg("path", path.into());
7054 query = query.arg("sources", sources);
7055 if let Some(permissions) = opts.permissions {
7056 query = query.arg("permissions", permissions);
7057 }
7058 Directory {
7059 proc: self.proc.clone(),
7060 selection: query,
7061 graphql_client: self.graphql_client.clone(),
7062 }
7063 }
7064 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7072 let mut query = self.selection.select("withNewFile");
7073 query = query.arg("path", path.into());
7074 query = query.arg("contents", contents.into());
7075 Directory {
7076 proc: self.proc.clone(),
7077 selection: query,
7078 graphql_client: self.graphql_client.clone(),
7079 }
7080 }
7081 pub fn with_new_file_opts(
7089 &self,
7090 path: impl Into<String>,
7091 contents: impl Into<String>,
7092 opts: DirectoryWithNewFileOpts,
7093 ) -> Directory {
7094 let mut query = self.selection.select("withNewFile");
7095 query = query.arg("path", path.into());
7096 query = query.arg("contents", contents.into());
7097 if let Some(permissions) = opts.permissions {
7098 query = query.arg("permissions", permissions);
7099 }
7100 Directory {
7101 proc: self.proc.clone(),
7102 selection: query,
7103 graphql_client: self.graphql_client.clone(),
7104 }
7105 }
7106 pub fn without_file(&self, path: impl Into<String>) -> Directory {
7112 let mut query = self.selection.select("withoutFile");
7113 query = query.arg("path", path.into());
7114 Directory {
7115 proc: self.proc.clone(),
7116 selection: query,
7117 graphql_client: self.graphql_client.clone(),
7118 }
7119 }
7120 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7126 let mut query = self.selection.select("withoutFiles");
7127 query = query.arg(
7128 "paths",
7129 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7130 );
7131 Directory {
7132 proc: self.proc.clone(),
7133 selection: query,
7134 graphql_client: self.graphql_client.clone(),
7135 }
7136 }
7137 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
7144 let mut query = self.selection.select("exists");
7145 query = query.arg("path", path.into());
7146 query.execute(self.graphql_client.clone()).await
7147 }
7148 pub async fn exists_opts(
7155 &self,
7156 path: impl Into<String>,
7157 opts: DirectoryExistsOpts,
7158 ) -> Result<bool, DaggerError> {
7159 let mut query = self.selection.select("exists");
7160 query = query.arg("path", path.into());
7161 if let Some(expected_type) = opts.expected_type {
7162 query = query.arg("expectedType", expected_type);
7163 }
7164 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7165 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7166 }
7167 query.execute(self.graphql_client.clone()).await
7168 }
7169 pub async fn stat(&self, path: impl Into<String>) -> Result<Option<Stat>, DaggerError> {
7176 let mut query = self.selection.select("stat");
7177 query = query.arg("path", path.into());
7178 let query = query.select("id");
7179 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7180 Ok(id.map(|id| Stat {
7181 proc: self.proc.clone(),
7182 selection: query
7183 .root()
7184 .select("node")
7185 .arg("id", &id.0)
7186 .inline_fragment("Stat"),
7187 graphql_client: self.graphql_client.clone(),
7188 }))
7189 }
7190 pub async fn stat_opts(
7197 &self,
7198 path: impl Into<String>,
7199 opts: DirectoryStatOpts,
7200 ) -> Result<Option<Stat>, DaggerError> {
7201 let mut query = self.selection.select("stat");
7202 query = query.arg("path", path.into());
7203 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
7204 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
7205 }
7206 let query = query.select("id");
7207 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
7208 Ok(id.map(|id| Stat {
7209 proc: self.proc.clone(),
7210 selection: query
7211 .root()
7212 .select("node")
7213 .arg("id", &id.0)
7214 .inline_fragment("Stat"),
7215 graphql_client: self.graphql_client.clone(),
7216 }))
7217 }
7218 pub fn directory(&self, path: impl Into<String>) -> Directory {
7224 let mut query = self.selection.select("directory");
7225 query = query.arg("path", path.into());
7226 Directory {
7227 proc: self.proc.clone(),
7228 selection: query,
7229 graphql_client: self.graphql_client.clone(),
7230 }
7231 }
7232 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
7240 let mut query = self.selection.select("withDirectory");
7241 query = query.arg("path", path.into());
7242 query = query.arg_lazy(
7243 "source",
7244 Box::new(move || {
7245 let source = source.clone();
7246 Box::pin(async move { source.into_id().await.unwrap().quote() })
7247 }),
7248 );
7249 Directory {
7250 proc: self.proc.clone(),
7251 selection: query,
7252 graphql_client: self.graphql_client.clone(),
7253 }
7254 }
7255 pub fn with_directory_opts<'a>(
7263 &self,
7264 path: impl Into<String>,
7265 source: impl IntoID<Id>,
7266 opts: DirectoryWithDirectoryOpts<'a>,
7267 ) -> Directory {
7268 let mut query = self.selection.select("withDirectory");
7269 query = query.arg("path", path.into());
7270 query = query.arg_lazy(
7271 "source",
7272 Box::new(move || {
7273 let source = source.clone();
7274 Box::pin(async move { source.into_id().await.unwrap().quote() })
7275 }),
7276 );
7277 if let Some(exclude) = opts.exclude {
7278 query = query.arg("exclude", exclude);
7279 }
7280 if let Some(include) = opts.include {
7281 query = query.arg("include", include);
7282 }
7283 if let Some(gitignore) = opts.gitignore {
7284 query = query.arg("gitignore", gitignore);
7285 }
7286 if let Some(owner) = opts.owner {
7287 query = query.arg("owner", owner);
7288 }
7289 if let Some(permissions) = opts.permissions {
7290 query = query.arg("permissions", permissions);
7291 }
7292 Directory {
7293 proc: self.proc.clone(),
7294 selection: query,
7295 graphql_client: self.graphql_client.clone(),
7296 }
7297 }
7298 pub fn filter(&self) -> Directory {
7304 let query = self.selection.select("filter");
7305 Directory {
7306 proc: self.proc.clone(),
7307 selection: query,
7308 graphql_client: self.graphql_client.clone(),
7309 }
7310 }
7311 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
7317 let mut query = self.selection.select("filter");
7318 if let Some(exclude) = opts.exclude {
7319 query = query.arg("exclude", exclude);
7320 }
7321 if let Some(include) = opts.include {
7322 query = query.arg("include", include);
7323 }
7324 if let Some(gitignore) = opts.gitignore {
7325 query = query.arg("gitignore", gitignore);
7326 }
7327 Directory {
7328 proc: self.proc.clone(),
7329 selection: query,
7330 graphql_client: self.graphql_client.clone(),
7331 }
7332 }
7333 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
7340 let mut query = self.selection.select("withNewDirectory");
7341 query = query.arg("path", path.into());
7342 Directory {
7343 proc: self.proc.clone(),
7344 selection: query,
7345 graphql_client: self.graphql_client.clone(),
7346 }
7347 }
7348 pub fn with_new_directory_opts(
7355 &self,
7356 path: impl Into<String>,
7357 opts: DirectoryWithNewDirectoryOpts,
7358 ) -> Directory {
7359 let mut query = self.selection.select("withNewDirectory");
7360 query = query.arg("path", path.into());
7361 if let Some(permissions) = opts.permissions {
7362 query = query.arg("permissions", permissions);
7363 }
7364 Directory {
7365 proc: self.proc.clone(),
7366 selection: query,
7367 graphql_client: self.graphql_client.clone(),
7368 }
7369 }
7370 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7376 let mut query = self.selection.select("withoutDirectory");
7377 query = query.arg("path", path.into());
7378 Directory {
7379 proc: self.proc.clone(),
7380 selection: query,
7381 graphql_client: self.graphql_client.clone(),
7382 }
7383 }
7384 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
7390 let mut query = self.selection.select("diff");
7391 query = query.arg_lazy(
7392 "other",
7393 Box::new(move || {
7394 let other = other.clone();
7395 Box::pin(async move { other.into_id().await.unwrap().quote() })
7396 }),
7397 );
7398 Directory {
7399 proc: self.proc.clone(),
7400 selection: query,
7401 graphql_client: self.graphql_client.clone(),
7402 }
7403 }
7404 pub async fn find_up(
7411 &self,
7412 name: impl Into<String>,
7413 start: impl Into<String>,
7414 ) -> Result<String, DaggerError> {
7415 let mut query = self.selection.select("findUp");
7416 query = query.arg("name", name.into());
7417 query = query.arg("start", start.into());
7418 query.execute(self.graphql_client.clone()).await
7419 }
7420 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
7427 let mut query = self.selection.select("changes");
7428 query = query.arg_lazy(
7429 "from",
7430 Box::new(move || {
7431 let from = from.clone();
7432 Box::pin(async move { from.into_id().await.unwrap().quote() })
7433 }),
7434 );
7435 Changeset {
7436 proc: self.proc.clone(),
7437 selection: query,
7438 graphql_client: self.graphql_client.clone(),
7439 }
7440 }
7441 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
7447 let mut query = self.selection.select("withChanges");
7448 query = query.arg_lazy(
7449 "changes",
7450 Box::new(move || {
7451 let changes = changes.clone();
7452 Box::pin(async move { changes.into_id().await.unwrap().quote() })
7453 }),
7454 );
7455 Directory {
7456 proc: self.proc.clone(),
7457 selection: query,
7458 graphql_client: self.graphql_client.clone(),
7459 }
7460 }
7461 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7468 let mut query = self.selection.select("export");
7469 query = query.arg("path", path.into());
7470 query.execute(self.graphql_client.clone()).await
7471 }
7472 pub async fn export_opts(
7479 &self,
7480 path: impl Into<String>,
7481 opts: DirectoryExportOpts,
7482 ) -> Result<String, DaggerError> {
7483 let mut query = self.selection.select("export");
7484 query = query.arg("path", path.into());
7485 if let Some(wipe) = opts.wipe {
7486 query = query.arg("wipe", wipe);
7487 }
7488 query.execute(self.graphql_client.clone()).await
7489 }
7490 pub fn docker_build(&self) -> Container {
7496 let query = self.selection.select("dockerBuild");
7497 Container {
7498 proc: self.proc.clone(),
7499 selection: query,
7500 graphql_client: self.graphql_client.clone(),
7501 }
7502 }
7503 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
7509 let mut query = self.selection.select("dockerBuild");
7510 if let Some(dockerfile) = opts.dockerfile {
7511 query = query.arg("dockerfile", dockerfile);
7512 }
7513 if let Some(platform) = opts.platform {
7514 query = query.arg("platform", platform);
7515 }
7516 if let Some(build_args) = opts.build_args {
7517 query = query.arg("buildArgs", build_args);
7518 }
7519 if let Some(target) = opts.target {
7520 query = query.arg("target", target);
7521 }
7522 if let Some(secrets) = opts.secrets {
7523 query = query.arg("secrets", secrets);
7524 }
7525 if let Some(no_init) = opts.no_init {
7526 query = query.arg("noInit", no_init);
7527 }
7528 if let Some(ssh) = opts.ssh {
7529 query = query.arg("ssh", ssh);
7530 }
7531 Container {
7532 proc: self.proc.clone(),
7533 selection: query,
7534 graphql_client: self.graphql_client.clone(),
7535 }
7536 }
7537 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7545 let mut query = self.selection.select("withTimestamps");
7546 query = query.arg("timestamp", timestamp);
7547 Directory {
7548 proc: self.proc.clone(),
7549 selection: query,
7550 graphql_client: self.graphql_client.clone(),
7551 }
7552 }
7553 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
7560 let mut query = self.selection.select("withPatch");
7561 query = query.arg("patch", patch.into());
7562 Directory {
7563 proc: self.proc.clone(),
7564 selection: query,
7565 graphql_client: self.graphql_client.clone(),
7566 }
7567 }
7568 pub fn with_patch_opts(
7575 &self,
7576 patch: impl Into<String>,
7577 opts: DirectoryWithPatchOpts,
7578 ) -> Directory {
7579 let mut query = self.selection.select("withPatch");
7580 query = query.arg("patch", patch.into());
7581 if let Some(on_conflict) = opts.on_conflict {
7582 query = query.arg("onConflict", on_conflict);
7583 }
7584 Directory {
7585 proc: self.proc.clone(),
7586 selection: query,
7587 graphql_client: self.graphql_client.clone(),
7588 }
7589 }
7590 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
7597 let mut query = self.selection.select("withPatchFile");
7598 query = query.arg_lazy(
7599 "patch",
7600 Box::new(move || {
7601 let patch = patch.clone();
7602 Box::pin(async move { patch.into_id().await.unwrap().quote() })
7603 }),
7604 );
7605 Directory {
7606 proc: self.proc.clone(),
7607 selection: query,
7608 graphql_client: self.graphql_client.clone(),
7609 }
7610 }
7611 pub fn with_patch_file_opts(
7618 &self,
7619 patch: impl IntoID<Id>,
7620 opts: DirectoryWithPatchFileOpts,
7621 ) -> Directory {
7622 let mut query = self.selection.select("withPatchFile");
7623 query = query.arg_lazy(
7624 "patch",
7625 Box::new(move || {
7626 let patch = patch.clone();
7627 Box::pin(async move { patch.into_id().await.unwrap().quote() })
7628 }),
7629 );
7630 if let Some(on_conflict) = opts.on_conflict {
7631 query = query.arg("onConflict", on_conflict);
7632 }
7633 Directory {
7634 proc: self.proc.clone(),
7635 selection: query,
7636 graphql_client: self.graphql_client.clone(),
7637 }
7638 }
7639 pub fn as_git(&self) -> GitRepository {
7641 let query = self.selection.select("asGit");
7642 GitRepository {
7643 proc: self.proc.clone(),
7644 selection: query,
7645 graphql_client: self.graphql_client.clone(),
7646 }
7647 }
7648 pub fn as_workspace(&self) -> Workspace {
7654 let query = self.selection.select("asWorkspace");
7655 Workspace {
7656 proc: self.proc.clone(),
7657 selection: query,
7658 graphql_client: self.graphql_client.clone(),
7659 }
7660 }
7661 pub fn as_workspace_opts<'a>(&self, opts: DirectoryAsWorkspaceOpts<'a>) -> Workspace {
7667 let mut query = self.selection.select("asWorkspace");
7668 if let Some(cwd) = opts.cwd {
7669 query = query.arg("cwd", cwd);
7670 }
7671 Workspace {
7672 proc: self.proc.clone(),
7673 selection: query,
7674 graphql_client: self.graphql_client.clone(),
7675 }
7676 }
7677 pub fn terminal(&self) -> Directory {
7683 let query = self.selection.select("terminal");
7684 Directory {
7685 proc: self.proc.clone(),
7686 selection: query,
7687 graphql_client: self.graphql_client.clone(),
7688 }
7689 }
7690 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
7696 let mut query = self.selection.select("terminal");
7697 if let Some(container) = opts.container {
7698 query = query.arg("container", container);
7699 }
7700 if let Some(cmd) = opts.cmd {
7701 query = query.arg("cmd", cmd);
7702 }
7703 if let Some(disable_dagger_in_dagger) = opts.disable_dagger_in_dagger {
7704 query = query.arg("disableDaggerInDagger", disable_dagger_in_dagger);
7705 }
7706 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
7707 query = query.arg(
7708 "experimentalPrivilegedNesting",
7709 experimental_privileged_nesting,
7710 );
7711 }
7712 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
7713 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
7714 }
7715 Directory {
7716 proc: self.proc.clone(),
7717 selection: query,
7718 graphql_client: self.graphql_client.clone(),
7719 }
7720 }
7721 pub fn with_symlink(
7728 &self,
7729 target: impl Into<String>,
7730 link_name: impl Into<String>,
7731 ) -> Directory {
7732 let mut query = self.selection.select("withSymlink");
7733 query = query.arg("target", target.into());
7734 query = query.arg("linkName", link_name.into());
7735 Directory {
7736 proc: self.proc.clone(),
7737 selection: query,
7738 graphql_client: self.graphql_client.clone(),
7739 }
7740 }
7741 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
7752 let mut query = self.selection.select("chown");
7753 query = query.arg("path", path.into());
7754 query = query.arg("owner", owner.into());
7755 Directory {
7756 proc: self.proc.clone(),
7757 selection: query,
7758 graphql_client: self.graphql_client.clone(),
7759 }
7760 }
7761 pub fn with_error(&self, err: impl Into<String>) -> Directory {
7767 let mut query = self.selection.select("withError");
7768 query = query.arg("err", err.into());
7769 Directory {
7770 proc: self.proc.clone(),
7771 selection: query,
7772 graphql_client: self.graphql_client.clone(),
7773 }
7774 }
7775 pub fn as_module(&self) -> Module {
7781 let query = self.selection.select("asModule");
7782 Module {
7783 proc: self.proc.clone(),
7784 selection: query,
7785 graphql_client: self.graphql_client.clone(),
7786 }
7787 }
7788 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
7794 let mut query = self.selection.select("asModule");
7795 if let Some(source_root_path) = opts.source_root_path {
7796 query = query.arg("sourceRootPath", source_root_path);
7797 }
7798 Module {
7799 proc: self.proc.clone(),
7800 selection: query,
7801 graphql_client: self.graphql_client.clone(),
7802 }
7803 }
7804 pub fn as_module_source(&self) -> ModuleSource {
7810 let query = self.selection.select("asModuleSource");
7811 ModuleSource {
7812 proc: self.proc.clone(),
7813 selection: query,
7814 graphql_client: self.graphql_client.clone(),
7815 }
7816 }
7817 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
7823 let mut query = self.selection.select("asModuleSource");
7824 if let Some(source_root_path) = opts.source_root_path {
7825 query = query.arg("sourceRootPath", source_root_path);
7826 }
7827 ModuleSource {
7828 proc: self.proc.clone(),
7829 selection: query,
7830 graphql_client: self.graphql_client.clone(),
7831 }
7832 }
7833}
7834impl Exportable for Directory {
7835 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7836 let query = self.selection.select("id");
7837 let graphql_client = self.graphql_client.clone();
7838 async move { query.execute(graphql_client).await }
7839 }
7840 fn export(
7841 &self,
7842 path: impl Into<String>,
7843 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
7844 let mut query = self.selection.select("export");
7845 query = query.arg("path", path.into());
7846 let graphql_client = self.graphql_client.clone();
7847 async move { query.execute(graphql_client).await }
7848 }
7849}
7850impl Node for Directory {
7851 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7852 let query = self.selection.select("id");
7853 let graphql_client = self.graphql_client.clone();
7854 async move { query.execute(graphql_client).await }
7855 }
7856}
7857impl Syncer for Directory {
7858 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7859 let query = self.selection.select("id");
7860 let graphql_client = self.graphql_client.clone();
7861 async move { query.execute(graphql_client).await }
7862 }
7863 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
7864 let query = self.selection.select("sync");
7865 let proc = self.proc.clone();
7866 let graphql_client = self.graphql_client.clone();
7867 async move {
7868 let id: Id = query.execute(graphql_client.clone()).await?;
7869 Ok(Self {
7870 proc,
7871 selection: query
7872 .root()
7873 .select("node")
7874 .arg("id", &id.0)
7875 .inline_fragment("Directory"),
7876 graphql_client,
7877 })
7878 }
7879 }
7880}
7881#[derive(Clone)]
7882pub struct Engine {
7883 pub proc: Option<Arc<DaggerSessionProc>>,
7884 pub selection: Selection,
7885 pub graphql_client: DynGraphQLClient,
7886}
7887impl IntoID<Id> for Engine {
7888 fn into_id(
7889 self,
7890 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7891 Box::pin(async move { self.id().await })
7892 }
7893}
7894impl Loadable for Engine {
7895 fn graphql_type() -> &'static str {
7896 "Engine"
7897 }
7898 fn from_query(
7899 proc: Option<Arc<DaggerSessionProc>>,
7900 selection: Selection,
7901 graphql_client: DynGraphQLClient,
7902 ) -> Self {
7903 Self {
7904 proc,
7905 selection,
7906 graphql_client,
7907 }
7908 }
7909}
7910impl Engine {
7911 pub async fn id(&self) -> Result<Id, DaggerError> {
7913 let query = self.selection.select("id");
7914 query.execute(self.graphql_client.clone()).await
7915 }
7916 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7918 let query = self.selection.select("clients");
7919 query.execute(self.graphql_client.clone()).await
7920 }
7921 pub async fn name(&self) -> Result<String, DaggerError> {
7923 let query = self.selection.select("name");
7924 query.execute(self.graphql_client.clone()).await
7925 }
7926 pub fn local_cache(&self) -> EngineCache {
7928 let query = self.selection.select("localCache");
7929 EngineCache {
7930 proc: self.proc.clone(),
7931 selection: query,
7932 graphql_client: self.graphql_client.clone(),
7933 }
7934 }
7935}
7936impl Node for Engine {
7937 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7938 let query = self.selection.select("id");
7939 let graphql_client = self.graphql_client.clone();
7940 async move { query.execute(graphql_client).await }
7941 }
7942}
7943#[derive(Clone)]
7944pub struct EngineCache {
7945 pub proc: Option<Arc<DaggerSessionProc>>,
7946 pub selection: Selection,
7947 pub graphql_client: DynGraphQLClient,
7948}
7949#[derive(Builder, Debug, PartialEq)]
7950pub struct EngineCacheEntrySetOpts<'a> {
7951 #[builder(setter(into, strip_option), default)]
7952 pub key: Option<&'a str>,
7953}
7954#[derive(Builder, Debug, PartialEq)]
7955pub struct EngineCachePruneOpts<'a> {
7956 #[builder(setter(into, strip_option), default)]
7958 pub max_estimated_bytes: Option<isize>,
7959 #[builder(setter(into, strip_option), default)]
7961 pub max_used_space: Option<&'a str>,
7962 #[builder(setter(into, strip_option), default)]
7964 pub min_free_space: Option<&'a str>,
7965 #[builder(setter(into, strip_option), default)]
7967 pub reserved_space: Option<&'a str>,
7968 #[builder(setter(into, strip_option), default)]
7970 pub target_estimated_bytes: Option<isize>,
7971 #[builder(setter(into, strip_option), default)]
7973 pub target_space: Option<&'a str>,
7974 #[builder(setter(into, strip_option), default)]
7976 pub use_default_policy: Option<bool>,
7977}
7978impl IntoID<Id> for EngineCache {
7979 fn into_id(
7980 self,
7981 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7982 Box::pin(async move { self.id().await })
7983 }
7984}
7985impl Loadable for EngineCache {
7986 fn graphql_type() -> &'static str {
7987 "EngineCache"
7988 }
7989 fn from_query(
7990 proc: Option<Arc<DaggerSessionProc>>,
7991 selection: Selection,
7992 graphql_client: DynGraphQLClient,
7993 ) -> Self {
7994 Self {
7995 proc,
7996 selection,
7997 graphql_client,
7998 }
7999 }
8000}
8001impl EngineCache {
8002 pub async fn id(&self) -> Result<Id, DaggerError> {
8004 let query = self.selection.select("id");
8005 query.execute(self.graphql_client.clone()).await
8006 }
8007 pub fn entry_set(&self) -> EngineCacheEntrySet {
8013 let query = self.selection.select("entrySet");
8014 EngineCacheEntrySet {
8015 proc: self.proc.clone(),
8016 selection: query,
8017 graphql_client: self.graphql_client.clone(),
8018 }
8019 }
8020 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
8026 let mut query = self.selection.select("entrySet");
8027 if let Some(key) = opts.key {
8028 query = query.arg("key", key);
8029 }
8030 EngineCacheEntrySet {
8031 proc: self.proc.clone(),
8032 selection: query,
8033 graphql_client: self.graphql_client.clone(),
8034 }
8035 }
8036 pub async fn prune(&self) -> Result<Void, DaggerError> {
8042 let query = self.selection.select("prune");
8043 query.execute(self.graphql_client.clone()).await
8044 }
8045 pub async fn prune_opts<'a>(
8051 &self,
8052 opts: EngineCachePruneOpts<'a>,
8053 ) -> Result<Void, DaggerError> {
8054 let mut query = self.selection.select("prune");
8055 if let Some(use_default_policy) = opts.use_default_policy {
8056 query = query.arg("useDefaultPolicy", use_default_policy);
8057 }
8058 if let Some(max_used_space) = opts.max_used_space {
8059 query = query.arg("maxUsedSpace", max_used_space);
8060 }
8061 if let Some(reserved_space) = opts.reserved_space {
8062 query = query.arg("reservedSpace", reserved_space);
8063 }
8064 if let Some(min_free_space) = opts.min_free_space {
8065 query = query.arg("minFreeSpace", min_free_space);
8066 }
8067 if let Some(target_space) = opts.target_space {
8068 query = query.arg("targetSpace", target_space);
8069 }
8070 if let Some(max_estimated_bytes) = opts.max_estimated_bytes {
8071 query = query.arg("maxEstimatedBytes", max_estimated_bytes);
8072 }
8073 if let Some(target_estimated_bytes) = opts.target_estimated_bytes {
8074 query = query.arg("targetEstimatedBytes", target_estimated_bytes);
8075 }
8076 query.execute(self.graphql_client.clone()).await
8077 }
8078 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
8080 let query = self.selection.select("maxUsedSpace");
8081 query.execute(self.graphql_client.clone()).await
8082 }
8083 pub async fn target_space(&self) -> Result<isize, DaggerError> {
8085 let query = self.selection.select("targetSpace");
8086 query.execute(self.graphql_client.clone()).await
8087 }
8088 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
8090 let query = self.selection.select("reservedSpace");
8091 query.execute(self.graphql_client.clone()).await
8092 }
8093 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
8095 let query = self.selection.select("minFreeSpace");
8096 query.execute(self.graphql_client.clone()).await
8097 }
8098}
8099impl Node for EngineCache {
8100 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8101 let query = self.selection.select("id");
8102 let graphql_client = self.graphql_client.clone();
8103 async move { query.execute(graphql_client).await }
8104 }
8105}
8106#[derive(Clone)]
8107pub struct EngineCacheEntry {
8108 pub proc: Option<Arc<DaggerSessionProc>>,
8109 pub selection: Selection,
8110 pub graphql_client: DynGraphQLClient,
8111}
8112impl IntoID<Id> for EngineCacheEntry {
8113 fn into_id(
8114 self,
8115 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8116 Box::pin(async move { self.id().await })
8117 }
8118}
8119impl Loadable for EngineCacheEntry {
8120 fn graphql_type() -> &'static str {
8121 "EngineCacheEntry"
8122 }
8123 fn from_query(
8124 proc: Option<Arc<DaggerSessionProc>>,
8125 selection: Selection,
8126 graphql_client: DynGraphQLClient,
8127 ) -> Self {
8128 Self {
8129 proc,
8130 selection,
8131 graphql_client,
8132 }
8133 }
8134}
8135impl EngineCacheEntry {
8136 pub async fn id(&self) -> Result<Id, DaggerError> {
8138 let query = self.selection.select("id");
8139 query.execute(self.graphql_client.clone()).await
8140 }
8141 pub async fn description(&self) -> Result<String, DaggerError> {
8143 let query = self.selection.select("description");
8144 query.execute(self.graphql_client.clone()).await
8145 }
8146 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8148 let query = self.selection.select("diskSpaceBytes");
8149 query.execute(self.graphql_client.clone()).await
8150 }
8151 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
8153 let query = self.selection.select("createdTimeUnixNano");
8154 query.execute(self.graphql_client.clone()).await
8155 }
8156 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
8158 let query = self.selection.select("mostRecentUseTimeUnixNano");
8159 query.execute(self.graphql_client.clone()).await
8160 }
8161 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
8163 let query = self.selection.select("activelyUsed");
8164 query.execute(self.graphql_client.clone()).await
8165 }
8166 pub async fn record_type(&self) -> Result<String, DaggerError> {
8168 let query = self.selection.select("recordType");
8169 query.execute(self.graphql_client.clone()).await
8170 }
8171 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
8173 let query = self.selection.select("recordTypes");
8174 query.execute(self.graphql_client.clone()).await
8175 }
8176 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
8178 let query = self.selection.select("dagqlCall");
8179 query.execute(self.graphql_client.clone()).await
8180 }
8181}
8182impl Node for EngineCacheEntry {
8183 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8184 let query = self.selection.select("id");
8185 let graphql_client = self.graphql_client.clone();
8186 async move { query.execute(graphql_client).await }
8187 }
8188}
8189#[derive(Clone)]
8190pub struct EngineCacheEntrySet {
8191 pub proc: Option<Arc<DaggerSessionProc>>,
8192 pub selection: Selection,
8193 pub graphql_client: DynGraphQLClient,
8194}
8195impl IntoID<Id> for EngineCacheEntrySet {
8196 fn into_id(
8197 self,
8198 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8199 Box::pin(async move { self.id().await })
8200 }
8201}
8202impl Loadable for EngineCacheEntrySet {
8203 fn graphql_type() -> &'static str {
8204 "EngineCacheEntrySet"
8205 }
8206 fn from_query(
8207 proc: Option<Arc<DaggerSessionProc>>,
8208 selection: Selection,
8209 graphql_client: DynGraphQLClient,
8210 ) -> Self {
8211 Self {
8212 proc,
8213 selection,
8214 graphql_client,
8215 }
8216 }
8217}
8218impl EngineCacheEntrySet {
8219 pub async fn id(&self) -> Result<Id, DaggerError> {
8221 let query = self.selection.select("id");
8222 query.execute(self.graphql_client.clone()).await
8223 }
8224 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
8226 let query = self.selection.select("entries");
8227 let query = query.select("id");
8228 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8229 Ok(ids
8230 .into_iter()
8231 .map(|id| EngineCacheEntry {
8232 proc: self.proc.clone(),
8233 selection: crate::querybuilder::query()
8234 .select("node")
8235 .arg("id", &id.0)
8236 .inline_fragment("EngineCacheEntry"),
8237 graphql_client: self.graphql_client.clone(),
8238 })
8239 .collect())
8240 }
8241 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
8243 let query = self.selection.select("entryCount");
8244 query.execute(self.graphql_client.clone()).await
8245 }
8246 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
8248 let query = self.selection.select("diskSpaceBytes");
8249 query.execute(self.graphql_client.clone()).await
8250 }
8251}
8252impl Node for EngineCacheEntrySet {
8253 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8254 let query = self.selection.select("id");
8255 let graphql_client = self.graphql_client.clone();
8256 async move { query.execute(graphql_client).await }
8257 }
8258}
8259#[derive(Clone)]
8260pub struct EnumTypeDef {
8261 pub proc: Option<Arc<DaggerSessionProc>>,
8262 pub selection: Selection,
8263 pub graphql_client: DynGraphQLClient,
8264}
8265impl IntoID<Id> for EnumTypeDef {
8266 fn into_id(
8267 self,
8268 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8269 Box::pin(async move { self.id().await })
8270 }
8271}
8272impl Loadable for EnumTypeDef {
8273 fn graphql_type() -> &'static str {
8274 "EnumTypeDef"
8275 }
8276 fn from_query(
8277 proc: Option<Arc<DaggerSessionProc>>,
8278 selection: Selection,
8279 graphql_client: DynGraphQLClient,
8280 ) -> Self {
8281 Self {
8282 proc,
8283 selection,
8284 graphql_client,
8285 }
8286 }
8287}
8288impl EnumTypeDef {
8289 pub async fn id(&self) -> Result<Id, DaggerError> {
8291 let query = self.selection.select("id");
8292 query.execute(self.graphql_client.clone()).await
8293 }
8294 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8296 let query = self.selection.select("values");
8297 let query = query.select("id");
8298 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8299 Ok(ids
8300 .into_iter()
8301 .map(|id| EnumValueTypeDef {
8302 proc: self.proc.clone(),
8303 selection: crate::querybuilder::query()
8304 .select("node")
8305 .arg("id", &id.0)
8306 .inline_fragment("EnumValueTypeDef"),
8307 graphql_client: self.graphql_client.clone(),
8308 })
8309 .collect())
8310 }
8311 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
8313 let query = self.selection.select("members");
8314 let query = query.select("id");
8315 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8316 Ok(ids
8317 .into_iter()
8318 .map(|id| EnumValueTypeDef {
8319 proc: self.proc.clone(),
8320 selection: crate::querybuilder::query()
8321 .select("node")
8322 .arg("id", &id.0)
8323 .inline_fragment("EnumValueTypeDef"),
8324 graphql_client: self.graphql_client.clone(),
8325 })
8326 .collect())
8327 }
8328 pub async fn name(&self) -> Result<String, DaggerError> {
8330 let query = self.selection.select("name");
8331 query.execute(self.graphql_client.clone()).await
8332 }
8333 pub async fn description(&self) -> Result<String, DaggerError> {
8335 let query = self.selection.select("description");
8336 query.execute(self.graphql_client.clone()).await
8337 }
8338 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8340 let query = self.selection.select("sourceMap");
8341 let query = query.select("id");
8342 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8343 Ok(id.map(|id| SourceMap {
8344 proc: self.proc.clone(),
8345 selection: query
8346 .root()
8347 .select("node")
8348 .arg("id", &id.0)
8349 .inline_fragment("SourceMap"),
8350 graphql_client: self.graphql_client.clone(),
8351 }))
8352 }
8353 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8355 let query = self.selection.select("sourceModuleName");
8356 query.execute(self.graphql_client.clone()).await
8357 }
8358}
8359impl Node for EnumTypeDef {
8360 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8361 let query = self.selection.select("id");
8362 let graphql_client = self.graphql_client.clone();
8363 async move { query.execute(graphql_client).await }
8364 }
8365}
8366#[derive(Clone)]
8367pub struct EnumValueTypeDef {
8368 pub proc: Option<Arc<DaggerSessionProc>>,
8369 pub selection: Selection,
8370 pub graphql_client: DynGraphQLClient,
8371}
8372impl IntoID<Id> for EnumValueTypeDef {
8373 fn into_id(
8374 self,
8375 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8376 Box::pin(async move { self.id().await })
8377 }
8378}
8379impl Loadable for EnumValueTypeDef {
8380 fn graphql_type() -> &'static str {
8381 "EnumValueTypeDef"
8382 }
8383 fn from_query(
8384 proc: Option<Arc<DaggerSessionProc>>,
8385 selection: Selection,
8386 graphql_client: DynGraphQLClient,
8387 ) -> Self {
8388 Self {
8389 proc,
8390 selection,
8391 graphql_client,
8392 }
8393 }
8394}
8395impl EnumValueTypeDef {
8396 pub async fn id(&self) -> Result<Id, DaggerError> {
8398 let query = self.selection.select("id");
8399 query.execute(self.graphql_client.clone()).await
8400 }
8401 pub async fn name(&self) -> Result<String, DaggerError> {
8403 let query = self.selection.select("name");
8404 query.execute(self.graphql_client.clone()).await
8405 }
8406 pub async fn value(&self) -> Result<String, DaggerError> {
8408 let query = self.selection.select("value");
8409 query.execute(self.graphql_client.clone()).await
8410 }
8411 pub async fn description(&self) -> Result<String, DaggerError> {
8413 let query = self.selection.select("description");
8414 query.execute(self.graphql_client.clone()).await
8415 }
8416 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8418 let query = self.selection.select("sourceMap");
8419 let query = query.select("id");
8420 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8421 Ok(id.map(|id| SourceMap {
8422 proc: self.proc.clone(),
8423 selection: query
8424 .root()
8425 .select("node")
8426 .arg("id", &id.0)
8427 .inline_fragment("SourceMap"),
8428 graphql_client: self.graphql_client.clone(),
8429 }))
8430 }
8431 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8433 let query = self.selection.select("deprecated");
8434 query.execute(self.graphql_client.clone()).await
8435 }
8436}
8437impl Node for EnumValueTypeDef {
8438 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8439 let query = self.selection.select("id");
8440 let graphql_client = self.graphql_client.clone();
8441 async move { query.execute(graphql_client).await }
8442 }
8443}
8444#[derive(Clone)]
8445pub struct EnvFile {
8446 pub proc: Option<Arc<DaggerSessionProc>>,
8447 pub selection: Selection,
8448 pub graphql_client: DynGraphQLClient,
8449}
8450#[derive(Builder, Debug, PartialEq)]
8451pub struct EnvFileVariablesOpts {
8452 #[builder(setter(into, strip_option), default)]
8454 pub raw: Option<bool>,
8455}
8456#[derive(Builder, Debug, PartialEq)]
8457pub struct EnvFileGetOpts {
8458 #[builder(setter(into, strip_option), default)]
8460 pub raw: Option<bool>,
8461}
8462impl IntoID<Id> for EnvFile {
8463 fn into_id(
8464 self,
8465 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8466 Box::pin(async move { self.id().await })
8467 }
8468}
8469impl Loadable for EnvFile {
8470 fn graphql_type() -> &'static str {
8471 "EnvFile"
8472 }
8473 fn from_query(
8474 proc: Option<Arc<DaggerSessionProc>>,
8475 selection: Selection,
8476 graphql_client: DynGraphQLClient,
8477 ) -> Self {
8478 Self {
8479 proc,
8480 selection,
8481 graphql_client,
8482 }
8483 }
8484}
8485impl EnvFile {
8486 pub async fn id(&self) -> Result<Id, DaggerError> {
8488 let query = self.selection.select("id");
8489 query.execute(self.graphql_client.clone()).await
8490 }
8491 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8497 let query = self.selection.select("variables");
8498 let query = query.select("id");
8499 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8500 Ok(ids
8501 .into_iter()
8502 .map(|id| EnvVariable {
8503 proc: self.proc.clone(),
8504 selection: crate::querybuilder::query()
8505 .select("node")
8506 .arg("id", &id.0)
8507 .inline_fragment("EnvVariable"),
8508 graphql_client: self.graphql_client.clone(),
8509 })
8510 .collect())
8511 }
8512 pub async fn variables_opts(
8518 &self,
8519 opts: EnvFileVariablesOpts,
8520 ) -> Result<Vec<EnvVariable>, DaggerError> {
8521 let mut query = self.selection.select("variables");
8522 if let Some(raw) = opts.raw {
8523 query = query.arg("raw", raw);
8524 }
8525 let query = query.select("id");
8526 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8527 Ok(ids
8528 .into_iter()
8529 .map(|id| EnvVariable {
8530 proc: self.proc.clone(),
8531 selection: crate::querybuilder::query()
8532 .select("node")
8533 .arg("id", &id.0)
8534 .inline_fragment("EnvVariable"),
8535 graphql_client: self.graphql_client.clone(),
8536 })
8537 .collect())
8538 }
8539 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8546 let mut query = self.selection.select("withVariable");
8547 query = query.arg("name", name.into());
8548 query = query.arg("value", value.into());
8549 EnvFile {
8550 proc: self.proc.clone(),
8551 selection: query,
8552 graphql_client: self.graphql_client.clone(),
8553 }
8554 }
8555 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8561 let mut query = self.selection.select("withoutVariable");
8562 query = query.arg("name", name.into());
8563 EnvFile {
8564 proc: self.proc.clone(),
8565 selection: query,
8566 graphql_client: self.graphql_client.clone(),
8567 }
8568 }
8569 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8576 let mut query = self.selection.select("get");
8577 query = query.arg("name", name.into());
8578 query.execute(self.graphql_client.clone()).await
8579 }
8580 pub async fn get_opts(
8587 &self,
8588 name: impl Into<String>,
8589 opts: EnvFileGetOpts,
8590 ) -> Result<String, DaggerError> {
8591 let mut query = self.selection.select("get");
8592 query = query.arg("name", name.into());
8593 if let Some(raw) = opts.raw {
8594 query = query.arg("raw", raw);
8595 }
8596 query.execute(self.graphql_client.clone()).await
8597 }
8598 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8604 let mut query = self.selection.select("exists");
8605 query = query.arg("name", name.into());
8606 query.execute(self.graphql_client.clone()).await
8607 }
8608 pub fn as_file(&self) -> File {
8610 let query = self.selection.select("asFile");
8611 File {
8612 proc: self.proc.clone(),
8613 selection: query,
8614 graphql_client: self.graphql_client.clone(),
8615 }
8616 }
8617 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8623 let mut query = self.selection.select("namespace");
8624 query = query.arg("prefix", prefix.into());
8625 EnvFile {
8626 proc: self.proc.clone(),
8627 selection: query,
8628 graphql_client: self.graphql_client.clone(),
8629 }
8630 }
8631}
8632impl Node for EnvFile {
8633 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8634 let query = self.selection.select("id");
8635 let graphql_client = self.graphql_client.clone();
8636 async move { query.execute(graphql_client).await }
8637 }
8638}
8639#[derive(Clone)]
8640pub struct EnvVariable {
8641 pub proc: Option<Arc<DaggerSessionProc>>,
8642 pub selection: Selection,
8643 pub graphql_client: DynGraphQLClient,
8644}
8645impl IntoID<Id> for EnvVariable {
8646 fn into_id(
8647 self,
8648 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8649 Box::pin(async move { self.id().await })
8650 }
8651}
8652impl Loadable for EnvVariable {
8653 fn graphql_type() -> &'static str {
8654 "EnvVariable"
8655 }
8656 fn from_query(
8657 proc: Option<Arc<DaggerSessionProc>>,
8658 selection: Selection,
8659 graphql_client: DynGraphQLClient,
8660 ) -> Self {
8661 Self {
8662 proc,
8663 selection,
8664 graphql_client,
8665 }
8666 }
8667}
8668impl EnvVariable {
8669 pub async fn id(&self) -> Result<Id, DaggerError> {
8671 let query = self.selection.select("id");
8672 query.execute(self.graphql_client.clone()).await
8673 }
8674 pub async fn name(&self) -> Result<String, DaggerError> {
8676 let query = self.selection.select("name");
8677 query.execute(self.graphql_client.clone()).await
8678 }
8679 pub async fn value(&self) -> Result<String, DaggerError> {
8681 let query = self.selection.select("value");
8682 query.execute(self.graphql_client.clone()).await
8683 }
8684}
8685impl Node for EnvVariable {
8686 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8687 let query = self.selection.select("id");
8688 let graphql_client = self.graphql_client.clone();
8689 async move { query.execute(graphql_client).await }
8690 }
8691}
8692#[derive(Clone)]
8693pub struct Error {
8694 pub proc: Option<Arc<DaggerSessionProc>>,
8695 pub selection: Selection,
8696 pub graphql_client: DynGraphQLClient,
8697}
8698impl IntoID<Id> for Error {
8699 fn into_id(
8700 self,
8701 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8702 Box::pin(async move { self.id().await })
8703 }
8704}
8705impl Loadable for Error {
8706 fn graphql_type() -> &'static str {
8707 "Error"
8708 }
8709 fn from_query(
8710 proc: Option<Arc<DaggerSessionProc>>,
8711 selection: Selection,
8712 graphql_client: DynGraphQLClient,
8713 ) -> Self {
8714 Self {
8715 proc,
8716 selection,
8717 graphql_client,
8718 }
8719 }
8720}
8721impl Error {
8722 pub async fn id(&self) -> Result<Id, DaggerError> {
8724 let query = self.selection.select("id");
8725 query.execute(self.graphql_client.clone()).await
8726 }
8727 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8734 let mut query = self.selection.select("withValue");
8735 query = query.arg("name", name.into());
8736 query = query.arg("value", value);
8737 Error {
8738 proc: self.proc.clone(),
8739 selection: query,
8740 graphql_client: self.graphql_client.clone(),
8741 }
8742 }
8743 pub async fn message(&self) -> Result<String, DaggerError> {
8745 let query = self.selection.select("message");
8746 query.execute(self.graphql_client.clone()).await
8747 }
8748 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8750 let query = self.selection.select("values");
8751 let query = query.select("id");
8752 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8753 Ok(ids
8754 .into_iter()
8755 .map(|id| ErrorValue {
8756 proc: self.proc.clone(),
8757 selection: crate::querybuilder::query()
8758 .select("node")
8759 .arg("id", &id.0)
8760 .inline_fragment("ErrorValue"),
8761 graphql_client: self.graphql_client.clone(),
8762 })
8763 .collect())
8764 }
8765}
8766impl Node for Error {
8767 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8768 let query = self.selection.select("id");
8769 let graphql_client = self.graphql_client.clone();
8770 async move { query.execute(graphql_client).await }
8771 }
8772}
8773#[derive(Clone)]
8774pub struct ErrorValue {
8775 pub proc: Option<Arc<DaggerSessionProc>>,
8776 pub selection: Selection,
8777 pub graphql_client: DynGraphQLClient,
8778}
8779impl IntoID<Id> for ErrorValue {
8780 fn into_id(
8781 self,
8782 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8783 Box::pin(async move { self.id().await })
8784 }
8785}
8786impl Loadable for ErrorValue {
8787 fn graphql_type() -> &'static str {
8788 "ErrorValue"
8789 }
8790 fn from_query(
8791 proc: Option<Arc<DaggerSessionProc>>,
8792 selection: Selection,
8793 graphql_client: DynGraphQLClient,
8794 ) -> Self {
8795 Self {
8796 proc,
8797 selection,
8798 graphql_client,
8799 }
8800 }
8801}
8802impl ErrorValue {
8803 pub async fn id(&self) -> Result<Id, DaggerError> {
8805 let query = self.selection.select("id");
8806 query.execute(self.graphql_client.clone()).await
8807 }
8808 pub async fn name(&self) -> Result<String, DaggerError> {
8810 let query = self.selection.select("name");
8811 query.execute(self.graphql_client.clone()).await
8812 }
8813 pub async fn value(&self) -> Result<Json, DaggerError> {
8815 let query = self.selection.select("value");
8816 query.execute(self.graphql_client.clone()).await
8817 }
8818}
8819impl Node for ErrorValue {
8820 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8821 let query = self.selection.select("id");
8822 let graphql_client = self.graphql_client.clone();
8823 async move { query.execute(graphql_client).await }
8824 }
8825}
8826#[derive(Clone)]
8827pub struct Expertise {
8828 pub proc: Option<Arc<DaggerSessionProc>>,
8829 pub selection: Selection,
8830 pub graphql_client: DynGraphQLClient,
8831}
8832impl IntoID<Id> for Expertise {
8833 fn into_id(
8834 self,
8835 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8836 Box::pin(async move { self.id().await })
8837 }
8838}
8839impl Loadable for Expertise {
8840 fn graphql_type() -> &'static str {
8841 "Expertise"
8842 }
8843 fn from_query(
8844 proc: Option<Arc<DaggerSessionProc>>,
8845 selection: Selection,
8846 graphql_client: DynGraphQLClient,
8847 ) -> Self {
8848 Self {
8849 proc,
8850 selection,
8851 graphql_client,
8852 }
8853 }
8854}
8855impl Expertise {
8856 pub async fn id(&self) -> Result<Id, DaggerError> {
8858 let query = self.selection.select("id");
8859 query.execute(self.graphql_client.clone()).await
8860 }
8861 pub fn artifact(&self) -> Artifact {
8863 let query = self.selection.select("artifact");
8864 Artifact {
8865 proc: self.proc.clone(),
8866 selection: query,
8867 graphql_client: self.graphql_client.clone(),
8868 }
8869 }
8870 pub async fn name(&self) -> Result<String, DaggerError> {
8872 let query = self.selection.select("name");
8873 query.execute(self.graphql_client.clone()).await
8874 }
8875 pub async fn description(&self) -> Result<String, DaggerError> {
8877 let query = self.selection.select("description");
8878 query.execute(self.graphql_client.clone()).await
8879 }
8880 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
8882 let query = self.selection.select("path");
8883 query.execute(self.graphql_client.clone()).await
8884 }
8885 pub fn original_module(&self) -> Module {
8887 let query = self.selection.select("originalModule");
8888 Module {
8889 proc: self.proc.clone(),
8890 selection: query,
8891 graphql_client: self.graphql_client.clone(),
8892 }
8893 }
8894}
8895impl Node for Expertise {
8896 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8897 let query = self.selection.select("id");
8898 let graphql_client = self.graphql_client.clone();
8899 async move { query.execute(graphql_client).await }
8900 }
8901}
8902#[derive(Clone)]
8903pub struct FieldTypeDef {
8904 pub proc: Option<Arc<DaggerSessionProc>>,
8905 pub selection: Selection,
8906 pub graphql_client: DynGraphQLClient,
8907}
8908impl IntoID<Id> for FieldTypeDef {
8909 fn into_id(
8910 self,
8911 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8912 Box::pin(async move { self.id().await })
8913 }
8914}
8915impl Loadable for FieldTypeDef {
8916 fn graphql_type() -> &'static str {
8917 "FieldTypeDef"
8918 }
8919 fn from_query(
8920 proc: Option<Arc<DaggerSessionProc>>,
8921 selection: Selection,
8922 graphql_client: DynGraphQLClient,
8923 ) -> Self {
8924 Self {
8925 proc,
8926 selection,
8927 graphql_client,
8928 }
8929 }
8930}
8931impl FieldTypeDef {
8932 pub async fn id(&self) -> Result<Id, DaggerError> {
8934 let query = self.selection.select("id");
8935 query.execute(self.graphql_client.clone()).await
8936 }
8937 pub fn type_def(&self) -> TypeDef {
8939 let query = self.selection.select("typeDef");
8940 TypeDef {
8941 proc: self.proc.clone(),
8942 selection: query,
8943 graphql_client: self.graphql_client.clone(),
8944 }
8945 }
8946 pub async fn name(&self) -> Result<String, DaggerError> {
8948 let query = self.selection.select("name");
8949 query.execute(self.graphql_client.clone()).await
8950 }
8951 pub async fn description(&self) -> Result<String, DaggerError> {
8953 let query = self.selection.select("description");
8954 query.execute(self.graphql_client.clone()).await
8955 }
8956 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
8958 let query = self.selection.select("sourceMap");
8959 let query = query.select("id");
8960 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
8961 Ok(id.map(|id| SourceMap {
8962 proc: self.proc.clone(),
8963 selection: query
8964 .root()
8965 .select("node")
8966 .arg("id", &id.0)
8967 .inline_fragment("SourceMap"),
8968 graphql_client: self.graphql_client.clone(),
8969 }))
8970 }
8971 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8973 let query = self.selection.select("deprecated");
8974 query.execute(self.graphql_client.clone()).await
8975 }
8976}
8977impl Node for FieldTypeDef {
8978 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8979 let query = self.selection.select("id");
8980 let graphql_client = self.graphql_client.clone();
8981 async move { query.execute(graphql_client).await }
8982 }
8983}
8984#[derive(Clone)]
8985pub struct File {
8986 pub proc: Option<Arc<DaggerSessionProc>>,
8987 pub selection: Selection,
8988 pub graphql_client: DynGraphQLClient,
8989}
8990#[derive(Builder, Debug, PartialEq)]
8991pub struct FileContentsOpts {
8992 #[builder(setter(into, strip_option), default)]
8994 pub limit_lines: Option<isize>,
8995 #[builder(setter(into, strip_option), default)]
8997 pub offset_lines: Option<isize>,
8998}
8999#[derive(Builder, Debug, PartialEq)]
9000pub struct FileDigestOpts {
9001 #[builder(setter(into, strip_option), default)]
9003 pub exclude_metadata: Option<bool>,
9004}
9005#[derive(Builder, Debug, PartialEq)]
9006pub struct FileSearchOpts<'a> {
9007 #[builder(setter(into, strip_option), default)]
9009 pub dotall: Option<bool>,
9010 #[builder(setter(into, strip_option), default)]
9012 pub files_only: Option<bool>,
9013 #[builder(setter(into, strip_option), default)]
9014 pub globs: Option<Vec<&'a str>>,
9015 #[builder(setter(into, strip_option), default)]
9017 pub insensitive: Option<bool>,
9018 #[builder(setter(into, strip_option), default)]
9020 pub limit: Option<isize>,
9021 #[builder(setter(into, strip_option), default)]
9023 pub literal: Option<bool>,
9024 #[builder(setter(into, strip_option), default)]
9026 pub multiline: Option<bool>,
9027 #[builder(setter(into, strip_option), default)]
9028 pub paths: Option<Vec<&'a str>>,
9029 #[builder(setter(into, strip_option), default)]
9031 pub skip_hidden: Option<bool>,
9032 #[builder(setter(into, strip_option), default)]
9034 pub skip_ignored: Option<bool>,
9035}
9036#[derive(Builder, Debug, PartialEq)]
9037pub struct FileWithReplacedOpts {
9038 #[builder(setter(into, strip_option), default)]
9040 pub all: Option<bool>,
9041 #[builder(setter(into, strip_option), default)]
9043 pub first_from: Option<isize>,
9044}
9045#[derive(Builder, Debug, PartialEq)]
9046pub struct FileExportOpts {
9047 #[builder(setter(into, strip_option), default)]
9049 pub allow_parent_dir_path: Option<bool>,
9050}
9051#[derive(Builder, Debug, PartialEq)]
9052pub struct FileAsEnvFileOpts {
9053 #[builder(setter(into, strip_option), default)]
9055 pub expand: Option<bool>,
9056}
9057impl IntoID<Id> for File {
9058 fn into_id(
9059 self,
9060 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9061 Box::pin(async move { self.id().await })
9062 }
9063}
9064impl Loadable for File {
9065 fn graphql_type() -> &'static str {
9066 "File"
9067 }
9068 fn from_query(
9069 proc: Option<Arc<DaggerSessionProc>>,
9070 selection: Selection,
9071 graphql_client: DynGraphQLClient,
9072 ) -> Self {
9073 Self {
9074 proc,
9075 selection,
9076 graphql_client,
9077 }
9078 }
9079}
9080impl File {
9081 pub async fn id(&self) -> Result<Id, DaggerError> {
9083 let query = self.selection.select("id");
9084 query.execute(self.graphql_client.clone()).await
9085 }
9086 pub async fn sync(&self) -> Result<File, DaggerError> {
9088 let query = self.selection.select("sync");
9089 let id: Id = query.execute(self.graphql_client.clone()).await?;
9090 Ok(File {
9091 proc: self.proc.clone(),
9092 selection: query
9093 .root()
9094 .select("node")
9095 .arg("id", &id.0)
9096 .inline_fragment("File"),
9097 graphql_client: self.graphql_client.clone(),
9098 })
9099 }
9100 pub async fn contents(&self) -> Result<String, DaggerError> {
9106 let query = self.selection.select("contents");
9107 query.execute(self.graphql_client.clone()).await
9108 }
9109 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9115 let mut query = self.selection.select("contents");
9116 if let Some(offset_lines) = opts.offset_lines {
9117 query = query.arg("offsetLines", offset_lines);
9118 }
9119 if let Some(limit_lines) = opts.limit_lines {
9120 query = query.arg("limitLines", limit_lines);
9121 }
9122 query.execute(self.graphql_client.clone()).await
9123 }
9124 pub async fn size(&self) -> Result<isize, DaggerError> {
9126 let query = self.selection.select("size");
9127 query.execute(self.graphql_client.clone()).await
9128 }
9129 pub async fn name(&self) -> Result<String, DaggerError> {
9131 let query = self.selection.select("name");
9132 query.execute(self.graphql_client.clone()).await
9133 }
9134 pub async fn stat(&self) -> Result<Option<Stat>, DaggerError> {
9136 let query = self.selection.select("stat");
9137 let query = query.select("id");
9138 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9139 Ok(id.map(|id| Stat {
9140 proc: self.proc.clone(),
9141 selection: query
9142 .root()
9143 .select("node")
9144 .arg("id", &id.0)
9145 .inline_fragment("Stat"),
9146 graphql_client: self.graphql_client.clone(),
9147 }))
9148 }
9149 pub async fn digest(&self) -> Result<String, DaggerError> {
9155 let query = self.selection.select("digest");
9156 query.execute(self.graphql_client.clone()).await
9157 }
9158 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9164 let mut query = self.selection.select("digest");
9165 if let Some(exclude_metadata) = opts.exclude_metadata {
9166 query = query.arg("excludeMetadata", exclude_metadata);
9167 }
9168 query.execute(self.graphql_client.clone()).await
9169 }
9170 pub fn with_name(&self, name: impl Into<String>) -> File {
9176 let mut query = self.selection.select("withName");
9177 query = query.arg("name", name.into());
9178 File {
9179 proc: self.proc.clone(),
9180 selection: query,
9181 graphql_client: self.graphql_client.clone(),
9182 }
9183 }
9184 pub async fn search(
9192 &self,
9193 pattern: impl Into<String>,
9194 ) -> Result<Vec<SearchResult>, DaggerError> {
9195 let mut query = self.selection.select("search");
9196 query = query.arg("pattern", pattern.into());
9197 let query = query.select("id");
9198 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9199 Ok(ids
9200 .into_iter()
9201 .map(|id| SearchResult {
9202 proc: self.proc.clone(),
9203 selection: crate::querybuilder::query()
9204 .select("node")
9205 .arg("id", &id.0)
9206 .inline_fragment("SearchResult"),
9207 graphql_client: self.graphql_client.clone(),
9208 })
9209 .collect())
9210 }
9211 pub async fn search_opts<'a>(
9219 &self,
9220 pattern: impl Into<String>,
9221 opts: FileSearchOpts<'a>,
9222 ) -> Result<Vec<SearchResult>, DaggerError> {
9223 let mut query = self.selection.select("search");
9224 query = query.arg("pattern", pattern.into());
9225 if let Some(literal) = opts.literal {
9226 query = query.arg("literal", literal);
9227 }
9228 if let Some(multiline) = opts.multiline {
9229 query = query.arg("multiline", multiline);
9230 }
9231 if let Some(dotall) = opts.dotall {
9232 query = query.arg("dotall", dotall);
9233 }
9234 if let Some(insensitive) = opts.insensitive {
9235 query = query.arg("insensitive", insensitive);
9236 }
9237 if let Some(skip_ignored) = opts.skip_ignored {
9238 query = query.arg("skipIgnored", skip_ignored);
9239 }
9240 if let Some(skip_hidden) = opts.skip_hidden {
9241 query = query.arg("skipHidden", skip_hidden);
9242 }
9243 if let Some(files_only) = opts.files_only {
9244 query = query.arg("filesOnly", files_only);
9245 }
9246 if let Some(limit) = opts.limit {
9247 query = query.arg("limit", limit);
9248 }
9249 if let Some(paths) = opts.paths {
9250 query = query.arg("paths", paths);
9251 }
9252 if let Some(globs) = opts.globs {
9253 query = query.arg("globs", globs);
9254 }
9255 let query = query.select("id");
9256 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9257 Ok(ids
9258 .into_iter()
9259 .map(|id| SearchResult {
9260 proc: self.proc.clone(),
9261 selection: crate::querybuilder::query()
9262 .select("node")
9263 .arg("id", &id.0)
9264 .inline_fragment("SearchResult"),
9265 graphql_client: self.graphql_client.clone(),
9266 })
9267 .collect())
9268 }
9269 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9281 let mut query = self.selection.select("withReplaced");
9282 query = query.arg("search", search.into());
9283 query = query.arg("replacement", replacement.into());
9284 File {
9285 proc: self.proc.clone(),
9286 selection: query,
9287 graphql_client: self.graphql_client.clone(),
9288 }
9289 }
9290 pub fn with_replaced_opts(
9302 &self,
9303 search: impl Into<String>,
9304 replacement: impl Into<String>,
9305 opts: FileWithReplacedOpts,
9306 ) -> File {
9307 let mut query = self.selection.select("withReplaced");
9308 query = query.arg("search", search.into());
9309 query = query.arg("replacement", replacement.into());
9310 if let Some(all) = opts.all {
9311 query = query.arg("all", all);
9312 }
9313 if let Some(first_from) = opts.first_from {
9314 query = query.arg("firstFrom", first_from);
9315 }
9316 File {
9317 proc: self.proc.clone(),
9318 selection: query,
9319 graphql_client: self.graphql_client.clone(),
9320 }
9321 }
9322 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9329 let mut query = self.selection.select("export");
9330 query = query.arg("path", path.into());
9331 query.execute(self.graphql_client.clone()).await
9332 }
9333 pub async fn export_opts(
9340 &self,
9341 path: impl Into<String>,
9342 opts: FileExportOpts,
9343 ) -> Result<String, DaggerError> {
9344 let mut query = self.selection.select("export");
9345 query = query.arg("path", path.into());
9346 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9347 query = query.arg("allowParentDirPath", allow_parent_dir_path);
9348 }
9349 query.execute(self.graphql_client.clone()).await
9350 }
9351 pub fn with_timestamps(&self, timestamp: isize) -> File {
9359 let mut query = self.selection.select("withTimestamps");
9360 query = query.arg("timestamp", timestamp);
9361 File {
9362 proc: self.proc.clone(),
9363 selection: query,
9364 graphql_client: self.graphql_client.clone(),
9365 }
9366 }
9367 pub fn chown(&self, owner: impl Into<String>) -> File {
9377 let mut query = self.selection.select("chown");
9378 query = query.arg("owner", owner.into());
9379 File {
9380 proc: self.proc.clone(),
9381 selection: query,
9382 graphql_client: self.graphql_client.clone(),
9383 }
9384 }
9385 pub fn as_git_bundle(&self) -> GitBundle {
9387 let query = self.selection.select("asGitBundle");
9388 GitBundle {
9389 proc: self.proc.clone(),
9390 selection: query,
9391 graphql_client: self.graphql_client.clone(),
9392 }
9393 }
9394 pub fn as_json(&self) -> JsonValue {
9396 let query = self.selection.select("asJSON");
9397 JsonValue {
9398 proc: self.proc.clone(),
9399 selection: query,
9400 graphql_client: self.graphql_client.clone(),
9401 }
9402 }
9403 pub fn as_env_file(&self) -> EnvFile {
9409 let query = self.selection.select("asEnvFile");
9410 EnvFile {
9411 proc: self.proc.clone(),
9412 selection: query,
9413 graphql_client: self.graphql_client.clone(),
9414 }
9415 }
9416 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9422 let mut query = self.selection.select("asEnvFile");
9423 if let Some(expand) = opts.expand {
9424 query = query.arg("expand", expand);
9425 }
9426 EnvFile {
9427 proc: self.proc.clone(),
9428 selection: query,
9429 graphql_client: self.graphql_client.clone(),
9430 }
9431 }
9432}
9433impl Exportable for File {
9434 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9435 let query = self.selection.select("id");
9436 let graphql_client = self.graphql_client.clone();
9437 async move { query.execute(graphql_client).await }
9438 }
9439 fn export(
9440 &self,
9441 path: impl Into<String>,
9442 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9443 let mut query = self.selection.select("export");
9444 query = query.arg("path", path.into());
9445 let graphql_client = self.graphql_client.clone();
9446 async move { query.execute(graphql_client).await }
9447 }
9448}
9449impl Node for File {
9450 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9451 let query = self.selection.select("id");
9452 let graphql_client = self.graphql_client.clone();
9453 async move { query.execute(graphql_client).await }
9454 }
9455}
9456impl Syncer for File {
9457 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9458 let query = self.selection.select("id");
9459 let graphql_client = self.graphql_client.clone();
9460 async move { query.execute(graphql_client).await }
9461 }
9462 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
9463 let query = self.selection.select("sync");
9464 let proc = self.proc.clone();
9465 let graphql_client = self.graphql_client.clone();
9466 async move {
9467 let id: Id = query.execute(graphql_client.clone()).await?;
9468 Ok(Self {
9469 proc,
9470 selection: query
9471 .root()
9472 .select("node")
9473 .arg("id", &id.0)
9474 .inline_fragment("File"),
9475 graphql_client,
9476 })
9477 }
9478 }
9479}
9480#[derive(Clone)]
9481pub struct Function {
9482 pub proc: Option<Arc<DaggerSessionProc>>,
9483 pub selection: Selection,
9484 pub graphql_client: DynGraphQLClient,
9485}
9486#[derive(Builder, Debug, PartialEq)]
9487pub struct FunctionWithDeprecatedOpts<'a> {
9488 #[builder(setter(into, strip_option), default)]
9490 pub reason: Option<&'a str>,
9491}
9492#[derive(Builder, Debug, PartialEq)]
9493pub struct FunctionWithArgOpts<'a> {
9494 #[builder(setter(into, strip_option), default)]
9495 pub default_address: Option<&'a str>,
9496 #[builder(setter(into, strip_option), default)]
9498 pub default_path: Option<&'a str>,
9499 #[builder(setter(into, strip_option), default)]
9501 pub default_value: Option<Json>,
9502 #[builder(setter(into, strip_option), default)]
9504 pub deprecated: Option<&'a str>,
9505 #[builder(setter(into, strip_option), default)]
9507 pub description: Option<&'a str>,
9508 #[builder(setter(into, strip_option), default)]
9510 pub ignore: Option<Vec<&'a str>>,
9511 #[builder(setter(into, strip_option), default)]
9513 pub source_map: Option<Id>,
9514}
9515#[derive(Builder, Debug, PartialEq)]
9516pub struct FunctionWithCachePolicyOpts<'a> {
9517 #[builder(setter(into, strip_option), default)]
9519 pub time_to_live: Option<&'a str>,
9520}
9521impl IntoID<Id> for Function {
9522 fn into_id(
9523 self,
9524 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9525 Box::pin(async move { self.id().await })
9526 }
9527}
9528impl Loadable for Function {
9529 fn graphql_type() -> &'static str {
9530 "Function"
9531 }
9532 fn from_query(
9533 proc: Option<Arc<DaggerSessionProc>>,
9534 selection: Selection,
9535 graphql_client: DynGraphQLClient,
9536 ) -> Self {
9537 Self {
9538 proc,
9539 selection,
9540 graphql_client,
9541 }
9542 }
9543}
9544impl Function {
9545 pub async fn id(&self) -> Result<Id, DaggerError> {
9547 let query = self.selection.select("id");
9548 query.execute(self.graphql_client.clone()).await
9549 }
9550 pub fn with_description(&self, description: impl Into<String>) -> Function {
9556 let mut query = self.selection.select("withDescription");
9557 query = query.arg("description", description.into());
9558 Function {
9559 proc: self.proc.clone(),
9560 selection: query,
9561 graphql_client: self.graphql_client.clone(),
9562 }
9563 }
9564 pub fn with_deprecated(&self) -> Function {
9570 let query = self.selection.select("withDeprecated");
9571 Function {
9572 proc: self.proc.clone(),
9573 selection: query,
9574 graphql_client: self.graphql_client.clone(),
9575 }
9576 }
9577 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9583 let mut query = self.selection.select("withDeprecated");
9584 if let Some(reason) = opts.reason {
9585 query = query.arg("reason", reason);
9586 }
9587 Function {
9588 proc: self.proc.clone(),
9589 selection: query,
9590 graphql_client: self.graphql_client.clone(),
9591 }
9592 }
9593 pub fn with_check(&self) -> Function {
9595 let query = self.selection.select("withCheck");
9596 Function {
9597 proc: self.proc.clone(),
9598 selection: query,
9599 graphql_client: self.graphql_client.clone(),
9600 }
9601 }
9602 pub fn with_generator(&self) -> Function {
9604 let query = self.selection.select("withGenerator");
9605 Function {
9606 proc: self.proc.clone(),
9607 selection: query,
9608 graphql_client: self.graphql_client.clone(),
9609 }
9610 }
9611 pub fn with_up(&self) -> Function {
9613 let query = self.selection.select("withUp");
9614 Function {
9615 proc: self.proc.clone(),
9616 selection: query,
9617 graphql_client: self.graphql_client.clone(),
9618 }
9619 }
9620 pub fn with_agent(&self) -> Function {
9622 let query = self.selection.select("withAgent");
9623 Function {
9624 proc: self.proc.clone(),
9625 selection: query,
9626 graphql_client: self.graphql_client.clone(),
9627 }
9628 }
9629 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9635 let mut query = self.selection.select("withSourceMap");
9636 query = query.arg_lazy(
9637 "sourceMap",
9638 Box::new(move || {
9639 let source_map = source_map.clone();
9640 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9641 }),
9642 );
9643 Function {
9644 proc: self.proc.clone(),
9645 selection: query,
9646 graphql_client: self.graphql_client.clone(),
9647 }
9648 }
9649 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9657 let mut query = self.selection.select("withArg");
9658 query = query.arg("name", name.into());
9659 query = query.arg_lazy(
9660 "typeDef",
9661 Box::new(move || {
9662 let type_def = type_def.clone();
9663 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9664 }),
9665 );
9666 Function {
9667 proc: self.proc.clone(),
9668 selection: query,
9669 graphql_client: self.graphql_client.clone(),
9670 }
9671 }
9672 pub fn with_arg_opts<'a>(
9680 &self,
9681 name: impl Into<String>,
9682 type_def: impl IntoID<Id>,
9683 opts: FunctionWithArgOpts<'a>,
9684 ) -> Function {
9685 let mut query = self.selection.select("withArg");
9686 query = query.arg("name", name.into());
9687 query = query.arg_lazy(
9688 "typeDef",
9689 Box::new(move || {
9690 let type_def = type_def.clone();
9691 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9692 }),
9693 );
9694 if let Some(description) = opts.description {
9695 query = query.arg("description", description);
9696 }
9697 if let Some(default_value) = opts.default_value {
9698 query = query.arg("defaultValue", default_value);
9699 }
9700 if let Some(default_path) = opts.default_path {
9701 query = query.arg("defaultPath", default_path);
9702 }
9703 if let Some(ignore) = opts.ignore {
9704 query = query.arg("ignore", ignore);
9705 }
9706 if let Some(source_map) = opts.source_map {
9707 query = query.arg("sourceMap", source_map);
9708 }
9709 if let Some(deprecated) = opts.deprecated {
9710 query = query.arg("deprecated", deprecated);
9711 }
9712 if let Some(default_address) = opts.default_address {
9713 query = query.arg("defaultAddress", default_address);
9714 }
9715 Function {
9716 proc: self.proc.clone(),
9717 selection: query,
9718 graphql_client: self.graphql_client.clone(),
9719 }
9720 }
9721 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9728 let mut query = self.selection.select("withCachePolicy");
9729 query = query.arg("policy", policy);
9730 Function {
9731 proc: self.proc.clone(),
9732 selection: query,
9733 graphql_client: self.graphql_client.clone(),
9734 }
9735 }
9736 pub fn with_cache_policy_opts<'a>(
9743 &self,
9744 policy: FunctionCachePolicy,
9745 opts: FunctionWithCachePolicyOpts<'a>,
9746 ) -> Function {
9747 let mut query = self.selection.select("withCachePolicy");
9748 query = query.arg("policy", policy);
9749 if let Some(time_to_live) = opts.time_to_live {
9750 query = query.arg("timeToLive", time_to_live);
9751 }
9752 Function {
9753 proc: self.proc.clone(),
9754 selection: query,
9755 graphql_client: self.graphql_client.clone(),
9756 }
9757 }
9758 pub async fn name(&self) -> Result<String, DaggerError> {
9760 let query = self.selection.select("name");
9761 query.execute(self.graphql_client.clone()).await
9762 }
9763 pub async fn description(&self) -> Result<String, DaggerError> {
9765 let query = self.selection.select("description");
9766 query.execute(self.graphql_client.clone()).await
9767 }
9768 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9770 let query = self.selection.select("deprecated");
9771 query.execute(self.graphql_client.clone()).await
9772 }
9773 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9775 let query = self.selection.select("sourceMap");
9776 let query = query.select("id");
9777 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9778 Ok(id.map(|id| SourceMap {
9779 proc: self.proc.clone(),
9780 selection: query
9781 .root()
9782 .select("node")
9783 .arg("id", &id.0)
9784 .inline_fragment("SourceMap"),
9785 graphql_client: self.graphql_client.clone(),
9786 }))
9787 }
9788 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9790 let query = self.selection.select("sourceModuleName");
9791 query.execute(self.graphql_client.clone()).await
9792 }
9793 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9795 let query = self.selection.select("args");
9796 let query = query.select("id");
9797 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9798 Ok(ids
9799 .into_iter()
9800 .map(|id| FunctionArg {
9801 proc: self.proc.clone(),
9802 selection: crate::querybuilder::query()
9803 .select("node")
9804 .arg("id", &id.0)
9805 .inline_fragment("FunctionArg"),
9806 graphql_client: self.graphql_client.clone(),
9807 })
9808 .collect())
9809 }
9810 pub fn return_type(&self) -> TypeDef {
9812 let query = self.selection.select("returnType");
9813 TypeDef {
9814 proc: self.proc.clone(),
9815 selection: query,
9816 graphql_client: self.graphql_client.clone(),
9817 }
9818 }
9819}
9820impl Node for Function {
9821 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9822 let query = self.selection.select("id");
9823 let graphql_client = self.graphql_client.clone();
9824 async move { query.execute(graphql_client).await }
9825 }
9826}
9827#[derive(Clone)]
9828pub struct FunctionArg {
9829 pub proc: Option<Arc<DaggerSessionProc>>,
9830 pub selection: Selection,
9831 pub graphql_client: DynGraphQLClient,
9832}
9833impl IntoID<Id> for FunctionArg {
9834 fn into_id(
9835 self,
9836 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9837 Box::pin(async move { self.id().await })
9838 }
9839}
9840impl Loadable for FunctionArg {
9841 fn graphql_type() -> &'static str {
9842 "FunctionArg"
9843 }
9844 fn from_query(
9845 proc: Option<Arc<DaggerSessionProc>>,
9846 selection: Selection,
9847 graphql_client: DynGraphQLClient,
9848 ) -> Self {
9849 Self {
9850 proc,
9851 selection,
9852 graphql_client,
9853 }
9854 }
9855}
9856impl FunctionArg {
9857 pub async fn id(&self) -> Result<Id, DaggerError> {
9859 let query = self.selection.select("id");
9860 query.execute(self.graphql_client.clone()).await
9861 }
9862 pub async fn name(&self) -> Result<String, DaggerError> {
9864 let query = self.selection.select("name");
9865 query.execute(self.graphql_client.clone()).await
9866 }
9867 pub async fn description(&self) -> Result<String, DaggerError> {
9869 let query = self.selection.select("description");
9870 query.execute(self.graphql_client.clone()).await
9871 }
9872 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
9874 let query = self.selection.select("sourceMap");
9875 let query = query.select("id");
9876 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
9877 Ok(id.map(|id| SourceMap {
9878 proc: self.proc.clone(),
9879 selection: query
9880 .root()
9881 .select("node")
9882 .arg("id", &id.0)
9883 .inline_fragment("SourceMap"),
9884 graphql_client: self.graphql_client.clone(),
9885 }))
9886 }
9887 pub async fn default_value(&self) -> Result<Json, DaggerError> {
9889 let query = self.selection.select("defaultValue");
9890 query.execute(self.graphql_client.clone()).await
9891 }
9892 pub async fn default_path(&self) -> Result<String, DaggerError> {
9894 let query = self.selection.select("defaultPath");
9895 query.execute(self.graphql_client.clone()).await
9896 }
9897 pub async fn default_address(&self) -> Result<String, DaggerError> {
9899 let query = self.selection.select("defaultAddress");
9900 query.execute(self.graphql_client.clone()).await
9901 }
9902 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9904 let query = self.selection.select("ignore");
9905 query.execute(self.graphql_client.clone()).await
9906 }
9907 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9909 let query = self.selection.select("deprecated");
9910 query.execute(self.graphql_client.clone()).await
9911 }
9912 pub fn type_def(&self) -> TypeDef {
9914 let query = self.selection.select("typeDef");
9915 TypeDef {
9916 proc: self.proc.clone(),
9917 selection: query,
9918 graphql_client: self.graphql_client.clone(),
9919 }
9920 }
9921}
9922impl Node for FunctionArg {
9923 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9924 let query = self.selection.select("id");
9925 let graphql_client = self.graphql_client.clone();
9926 async move { query.execute(graphql_client).await }
9927 }
9928}
9929#[derive(Clone)]
9930pub struct FunctionCall {
9931 pub proc: Option<Arc<DaggerSessionProc>>,
9932 pub selection: Selection,
9933 pub graphql_client: DynGraphQLClient,
9934}
9935impl IntoID<Id> for FunctionCall {
9936 fn into_id(
9937 self,
9938 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9939 Box::pin(async move { self.id().await })
9940 }
9941}
9942impl Loadable for FunctionCall {
9943 fn graphql_type() -> &'static str {
9944 "FunctionCall"
9945 }
9946 fn from_query(
9947 proc: Option<Arc<DaggerSessionProc>>,
9948 selection: Selection,
9949 graphql_client: DynGraphQLClient,
9950 ) -> Self {
9951 Self {
9952 proc,
9953 selection,
9954 graphql_client,
9955 }
9956 }
9957}
9958impl FunctionCall {
9959 pub async fn id(&self) -> Result<Id, DaggerError> {
9961 let query = self.selection.select("id");
9962 query.execute(self.graphql_client.clone()).await
9963 }
9964 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9970 let mut query = self.selection.select("returnValue");
9971 query = query.arg("value", value);
9972 query.execute(self.graphql_client.clone()).await
9973 }
9974 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9980 let mut query = self.selection.select("returnError");
9981 query = query.arg_lazy(
9982 "error",
9983 Box::new(move || {
9984 let error = error.clone();
9985 Box::pin(async move { error.into_id().await.unwrap().quote() })
9986 }),
9987 );
9988 query.execute(self.graphql_client.clone()).await
9989 }
9990 pub async fn name(&self) -> Result<String, DaggerError> {
9992 let query = self.selection.select("name");
9993 query.execute(self.graphql_client.clone()).await
9994 }
9995 pub async fn parent_name(&self) -> Result<String, DaggerError> {
9997 let query = self.selection.select("parentName");
9998 query.execute(self.graphql_client.clone()).await
9999 }
10000 pub async fn parent(&self) -> Result<Json, DaggerError> {
10002 let query = self.selection.select("parent");
10003 query.execute(self.graphql_client.clone()).await
10004 }
10005 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
10007 let query = self.selection.select("inputArgs");
10008 let query = query.select("id");
10009 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10010 Ok(ids
10011 .into_iter()
10012 .map(|id| FunctionCallArgValue {
10013 proc: self.proc.clone(),
10014 selection: crate::querybuilder::query()
10015 .select("node")
10016 .arg("id", &id.0)
10017 .inline_fragment("FunctionCallArgValue"),
10018 graphql_client: self.graphql_client.clone(),
10019 })
10020 .collect())
10021 }
10022}
10023impl Node for FunctionCall {
10024 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10025 let query = self.selection.select("id");
10026 let graphql_client = self.graphql_client.clone();
10027 async move { query.execute(graphql_client).await }
10028 }
10029}
10030#[derive(Clone)]
10031pub struct FunctionCallArgValue {
10032 pub proc: Option<Arc<DaggerSessionProc>>,
10033 pub selection: Selection,
10034 pub graphql_client: DynGraphQLClient,
10035}
10036impl IntoID<Id> for FunctionCallArgValue {
10037 fn into_id(
10038 self,
10039 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10040 Box::pin(async move { self.id().await })
10041 }
10042}
10043impl Loadable for FunctionCallArgValue {
10044 fn graphql_type() -> &'static str {
10045 "FunctionCallArgValue"
10046 }
10047 fn from_query(
10048 proc: Option<Arc<DaggerSessionProc>>,
10049 selection: Selection,
10050 graphql_client: DynGraphQLClient,
10051 ) -> Self {
10052 Self {
10053 proc,
10054 selection,
10055 graphql_client,
10056 }
10057 }
10058}
10059impl FunctionCallArgValue {
10060 pub async fn id(&self) -> Result<Id, DaggerError> {
10062 let query = self.selection.select("id");
10063 query.execute(self.graphql_client.clone()).await
10064 }
10065 pub async fn name(&self) -> Result<String, DaggerError> {
10067 let query = self.selection.select("name");
10068 query.execute(self.graphql_client.clone()).await
10069 }
10070 pub async fn value(&self) -> Result<Json, DaggerError> {
10072 let query = self.selection.select("value");
10073 query.execute(self.graphql_client.clone()).await
10074 }
10075}
10076impl Node for FunctionCallArgValue {
10077 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10078 let query = self.selection.select("id");
10079 let graphql_client = self.graphql_client.clone();
10080 async move { query.execute(graphql_client).await }
10081 }
10082}
10083#[derive(Clone)]
10084pub struct GeneratedCode {
10085 pub proc: Option<Arc<DaggerSessionProc>>,
10086 pub selection: Selection,
10087 pub graphql_client: DynGraphQLClient,
10088}
10089impl IntoID<Id> for GeneratedCode {
10090 fn into_id(
10091 self,
10092 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10093 Box::pin(async move { self.id().await })
10094 }
10095}
10096impl Loadable for GeneratedCode {
10097 fn graphql_type() -> &'static str {
10098 "GeneratedCode"
10099 }
10100 fn from_query(
10101 proc: Option<Arc<DaggerSessionProc>>,
10102 selection: Selection,
10103 graphql_client: DynGraphQLClient,
10104 ) -> Self {
10105 Self {
10106 proc,
10107 selection,
10108 graphql_client,
10109 }
10110 }
10111}
10112impl GeneratedCode {
10113 pub async fn id(&self) -> Result<Id, DaggerError> {
10115 let query = self.selection.select("id");
10116 query.execute(self.graphql_client.clone()).await
10117 }
10118 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10120 let mut query = self.selection.select("withVCSGeneratedPaths");
10121 query = query.arg(
10122 "paths",
10123 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10124 );
10125 GeneratedCode {
10126 proc: self.proc.clone(),
10127 selection: query,
10128 graphql_client: self.graphql_client.clone(),
10129 }
10130 }
10131 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10133 let mut query = self.selection.select("withVCSIgnoredPaths");
10134 query = query.arg(
10135 "paths",
10136 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10137 );
10138 GeneratedCode {
10139 proc: self.proc.clone(),
10140 selection: query,
10141 graphql_client: self.graphql_client.clone(),
10142 }
10143 }
10144 pub fn code(&self) -> Directory {
10146 let query = self.selection.select("code");
10147 Directory {
10148 proc: self.proc.clone(),
10149 selection: query,
10150 graphql_client: self.graphql_client.clone(),
10151 }
10152 }
10153 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10155 let query = self.selection.select("vcsGeneratedPaths");
10156 query.execute(self.graphql_client.clone()).await
10157 }
10158 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10160 let query = self.selection.select("vcsIgnoredPaths");
10161 query.execute(self.graphql_client.clone()).await
10162 }
10163}
10164impl Node for GeneratedCode {
10165 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10166 let query = self.selection.select("id");
10167 let graphql_client = self.graphql_client.clone();
10168 async move { query.execute(graphql_client).await }
10169 }
10170}
10171#[derive(Clone)]
10172pub struct Generator {
10173 pub proc: Option<Arc<DaggerSessionProc>>,
10174 pub selection: Selection,
10175 pub graphql_client: DynGraphQLClient,
10176}
10177impl IntoID<Id> for Generator {
10178 fn into_id(
10179 self,
10180 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10181 Box::pin(async move { self.id().await })
10182 }
10183}
10184impl Loadable for Generator {
10185 fn graphql_type() -> &'static str {
10186 "Generator"
10187 }
10188 fn from_query(
10189 proc: Option<Arc<DaggerSessionProc>>,
10190 selection: Selection,
10191 graphql_client: DynGraphQLClient,
10192 ) -> Self {
10193 Self {
10194 proc,
10195 selection,
10196 graphql_client,
10197 }
10198 }
10199}
10200impl Generator {
10201 pub async fn id(&self) -> Result<Id, DaggerError> {
10203 let query = self.selection.select("id");
10204 query.execute(self.graphql_client.clone()).await
10205 }
10206 pub fn changeset(&self) -> Changeset {
10208 let query = self.selection.select("changeset");
10209 Changeset {
10210 proc: self.proc.clone(),
10211 selection: query,
10212 graphql_client: self.graphql_client.clone(),
10213 }
10214 }
10215 pub fn sync(&self) -> Generator {
10217 let query = self.selection.select("sync");
10218 Generator {
10219 proc: self.proc.clone(),
10220 selection: query,
10221 graphql_client: self.graphql_client.clone(),
10222 }
10223 }
10224 pub fn stale(&self) -> Check {
10226 let query = self.selection.select("stale");
10227 Check {
10228 proc: self.proc.clone(),
10229 selection: query,
10230 graphql_client: self.graphql_client.clone(),
10231 }
10232 }
10233}
10234impl Node for Generator {
10235 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10236 let query = self.selection.select("id");
10237 let graphql_client = self.graphql_client.clone();
10238 async move { query.execute(graphql_client).await }
10239 }
10240}
10241#[derive(Clone)]
10242pub struct GitBundle {
10243 pub proc: Option<Arc<DaggerSessionProc>>,
10244 pub selection: Selection,
10245 pub graphql_client: DynGraphQLClient,
10246}
10247impl IntoID<Id> for GitBundle {
10248 fn into_id(
10249 self,
10250 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10251 Box::pin(async move { self.id().await })
10252 }
10253}
10254impl Loadable for GitBundle {
10255 fn graphql_type() -> &'static str {
10256 "GitBundle"
10257 }
10258 fn from_query(
10259 proc: Option<Arc<DaggerSessionProc>>,
10260 selection: Selection,
10261 graphql_client: DynGraphQLClient,
10262 ) -> Self {
10263 Self {
10264 proc,
10265 selection,
10266 graphql_client,
10267 }
10268 }
10269}
10270impl GitBundle {
10271 pub async fn id(&self) -> Result<Id, DaggerError> {
10273 let query = self.selection.select("id");
10274 query.execute(self.graphql_client.clone()).await
10275 }
10276 pub fn validate(&self) -> GitBundle {
10278 let query = self.selection.select("validate");
10279 GitBundle {
10280 proc: self.proc.clone(),
10281 selection: query,
10282 graphql_client: self.graphql_client.clone(),
10283 }
10284 }
10285 pub fn as_file(&self) -> File {
10287 let query = self.selection.select("asFile");
10288 File {
10289 proc: self.proc.clone(),
10290 selection: query,
10291 graphql_client: self.graphql_client.clone(),
10292 }
10293 }
10294 pub async fn version(&self) -> Result<isize, DaggerError> {
10296 let query = self.selection.select("version");
10297 query.execute(self.graphql_client.clone()).await
10298 }
10299 pub async fn object_format(&self) -> Result<String, DaggerError> {
10301 let query = self.selection.select("objectFormat");
10302 query.execute(self.graphql_client.clone()).await
10303 }
10304 pub async fn refs(&self) -> Result<Vec<GitBundleRef>, DaggerError> {
10306 let query = self.selection.select("refs");
10307 let query = query.select("id");
10308 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10309 Ok(ids
10310 .into_iter()
10311 .map(|id| GitBundleRef {
10312 proc: self.proc.clone(),
10313 selection: crate::querybuilder::query()
10314 .select("node")
10315 .arg("id", &id.0)
10316 .inline_fragment("GitBundleRef"),
10317 graphql_client: self.graphql_client.clone(),
10318 })
10319 .collect())
10320 }
10321 pub async fn prerequisite_sh_as(&self) -> Result<Vec<String>, DaggerError> {
10323 let query = self.selection.select("prerequisiteSHAs");
10324 query.execute(self.graphql_client.clone()).await
10325 }
10326}
10327impl Node for GitBundle {
10328 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10329 let query = self.selection.select("id");
10330 let graphql_client = self.graphql_client.clone();
10331 async move { query.execute(graphql_client).await }
10332 }
10333}
10334#[derive(Clone)]
10335pub struct GitBundleRef {
10336 pub proc: Option<Arc<DaggerSessionProc>>,
10337 pub selection: Selection,
10338 pub graphql_client: DynGraphQLClient,
10339}
10340impl IntoID<Id> for GitBundleRef {
10341 fn into_id(
10342 self,
10343 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10344 Box::pin(async move { self.id().await })
10345 }
10346}
10347impl Loadable for GitBundleRef {
10348 fn graphql_type() -> &'static str {
10349 "GitBundleRef"
10350 }
10351 fn from_query(
10352 proc: Option<Arc<DaggerSessionProc>>,
10353 selection: Selection,
10354 graphql_client: DynGraphQLClient,
10355 ) -> Self {
10356 Self {
10357 proc,
10358 selection,
10359 graphql_client,
10360 }
10361 }
10362}
10363impl GitBundleRef {
10364 pub async fn id(&self) -> Result<Id, DaggerError> {
10366 let query = self.selection.select("id");
10367 query.execute(self.graphql_client.clone()).await
10368 }
10369 pub async fn name(&self) -> Result<String, DaggerError> {
10371 let query = self.selection.select("name");
10372 query.execute(self.graphql_client.clone()).await
10373 }
10374 pub async fn sha(&self) -> Result<String, DaggerError> {
10376 let query = self.selection.select("sha");
10377 query.execute(self.graphql_client.clone()).await
10378 }
10379}
10380impl Node for GitBundleRef {
10381 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10382 let query = self.selection.select("id");
10383 let graphql_client = self.graphql_client.clone();
10384 async move { query.execute(graphql_client).await }
10385 }
10386}
10387#[derive(Clone)]
10388pub struct GitCommit {
10389 pub proc: Option<Arc<DaggerSessionProc>>,
10390 pub selection: Selection,
10391 pub graphql_client: DynGraphQLClient,
10392}
10393#[derive(Builder, Debug, PartialEq)]
10394pub struct GitCommitReleaseTagOpts {
10395 #[builder(setter(into, strip_option), default)]
10397 pub include_pre_release: Option<bool>,
10398}
10399#[derive(Builder, Debug, PartialEq)]
10400pub struct GitCommitAncestorReleaseTagOpts {
10401 #[builder(setter(into, strip_option), default)]
10403 pub include_pre_release: Option<bool>,
10404}
10405#[derive(Builder, Debug, PartialEq)]
10406pub struct GitCommitTreeOpts {
10407 #[builder(setter(into, strip_option), default)]
10409 pub depth: Option<isize>,
10410 #[builder(setter(into, strip_option), default)]
10412 pub discard_git_dir: Option<bool>,
10413 #[builder(setter(into, strip_option), default)]
10415 pub include_tags: Option<bool>,
10416}
10417#[derive(Builder, Debug, PartialEq)]
10418pub struct GitCommitChangesOpts {
10419 #[builder(setter(into, strip_option), default)]
10421 pub against: Option<Id>,
10422}
10423impl IntoID<Id> for GitCommit {
10424 fn into_id(
10425 self,
10426 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10427 Box::pin(async move { self.id().await })
10428 }
10429}
10430impl Loadable for GitCommit {
10431 fn graphql_type() -> &'static str {
10432 "GitCommit"
10433 }
10434 fn from_query(
10435 proc: Option<Arc<DaggerSessionProc>>,
10436 selection: Selection,
10437 graphql_client: DynGraphQLClient,
10438 ) -> Self {
10439 Self {
10440 proc,
10441 selection,
10442 graphql_client,
10443 }
10444 }
10445}
10446impl GitCommit {
10447 pub async fn id(&self) -> Result<Id, DaggerError> {
10449 let query = self.selection.select("id");
10450 query.execute(self.graphql_client.clone()).await
10451 }
10452 pub async fn release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10458 let query = self.selection.select("releaseTag");
10459 let query = query.select("id");
10460 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10461 Ok(id.map(|id| GitRef {
10462 proc: self.proc.clone(),
10463 selection: query
10464 .root()
10465 .select("node")
10466 .arg("id", &id.0)
10467 .inline_fragment("GitRef"),
10468 graphql_client: self.graphql_client.clone(),
10469 }))
10470 }
10471 pub async fn release_tag_opts(
10477 &self,
10478 opts: GitCommitReleaseTagOpts,
10479 ) -> Result<Option<GitRef>, DaggerError> {
10480 let mut query = self.selection.select("releaseTag");
10481 if let Some(include_pre_release) = opts.include_pre_release {
10482 query = query.arg("includePreRelease", include_pre_release);
10483 }
10484 let query = query.select("id");
10485 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10486 Ok(id.map(|id| GitRef {
10487 proc: self.proc.clone(),
10488 selection: query
10489 .root()
10490 .select("node")
10491 .arg("id", &id.0)
10492 .inline_fragment("GitRef"),
10493 graphql_client: self.graphql_client.clone(),
10494 }))
10495 }
10496 pub async fn ancestor_release_tag(&self) -> Result<Option<GitRef>, DaggerError> {
10502 let query = self.selection.select("ancestorReleaseTag");
10503 let query = query.select("id");
10504 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10505 Ok(id.map(|id| GitRef {
10506 proc: self.proc.clone(),
10507 selection: query
10508 .root()
10509 .select("node")
10510 .arg("id", &id.0)
10511 .inline_fragment("GitRef"),
10512 graphql_client: self.graphql_client.clone(),
10513 }))
10514 }
10515 pub async fn ancestor_release_tag_opts(
10521 &self,
10522 opts: GitCommitAncestorReleaseTagOpts,
10523 ) -> Result<Option<GitRef>, DaggerError> {
10524 let mut query = self.selection.select("ancestorReleaseTag");
10525 if let Some(include_pre_release) = opts.include_pre_release {
10526 query = query.arg("includePreRelease", include_pre_release);
10527 }
10528 let query = query.select("id");
10529 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
10530 Ok(id.map(|id| GitRef {
10531 proc: self.proc.clone(),
10532 selection: query
10533 .root()
10534 .select("node")
10535 .arg("id", &id.0)
10536 .inline_fragment("GitRef"),
10537 graphql_client: self.graphql_client.clone(),
10538 }))
10539 }
10540 pub fn tree(&self) -> Directory {
10546 let query = self.selection.select("tree");
10547 Directory {
10548 proc: self.proc.clone(),
10549 selection: query,
10550 graphql_client: self.graphql_client.clone(),
10551 }
10552 }
10553 pub fn tree_opts(&self, opts: GitCommitTreeOpts) -> Directory {
10559 let mut query = self.selection.select("tree");
10560 if let Some(discard_git_dir) = opts.discard_git_dir {
10561 query = query.arg("discardGitDir", discard_git_dir);
10562 }
10563 if let Some(depth) = opts.depth {
10564 query = query.arg("depth", depth);
10565 }
10566 if let Some(include_tags) = opts.include_tags {
10567 query = query.arg("includeTags", include_tags);
10568 }
10569 Directory {
10570 proc: self.proc.clone(),
10571 selection: query,
10572 graphql_client: self.graphql_client.clone(),
10573 }
10574 }
10575 pub fn changes(&self) -> Changeset {
10582 let query = self.selection.select("changes");
10583 Changeset {
10584 proc: self.proc.clone(),
10585 selection: query,
10586 graphql_client: self.graphql_client.clone(),
10587 }
10588 }
10589 pub fn changes_opts(&self, opts: GitCommitChangesOpts) -> Changeset {
10596 let mut query = self.selection.select("changes");
10597 if let Some(against) = opts.against {
10598 query = query.arg("against", against);
10599 }
10600 Changeset {
10601 proc: self.proc.clone(),
10602 selection: query,
10603 graphql_client: self.graphql_client.clone(),
10604 }
10605 }
10606 pub async fn sha(&self) -> Result<String, DaggerError> {
10608 let query = self.selection.select("sha");
10609 query.execute(self.graphql_client.clone()).await
10610 }
10611 pub async fn short_sha(&self) -> Result<String, DaggerError> {
10613 let query = self.selection.select("shortSha");
10614 query.execute(self.graphql_client.clone()).await
10615 }
10616 pub async fn tree_sha(&self) -> Result<String, DaggerError> {
10619 let query = self.selection.select("treeSHA");
10620 query.execute(self.graphql_client.clone()).await
10621 }
10622 pub async fn authored_date(&self) -> Result<String, DaggerError> {
10624 let query = self.selection.select("authoredDate");
10625 query.execute(self.graphql_client.clone()).await
10626 }
10627 pub async fn committed_date(&self) -> Result<String, DaggerError> {
10629 let query = self.selection.select("committedDate");
10630 query.execute(self.graphql_client.clone()).await
10631 }
10632 pub async fn author_name(&self) -> Result<String, DaggerError> {
10634 let query = self.selection.select("authorName");
10635 query.execute(self.graphql_client.clone()).await
10636 }
10637 pub async fn author_email(&self) -> Result<String, DaggerError> {
10639 let query = self.selection.select("authorEmail");
10640 query.execute(self.graphql_client.clone()).await
10641 }
10642 pub async fn committer_name(&self) -> Result<String, DaggerError> {
10644 let query = self.selection.select("committerName");
10645 query.execute(self.graphql_client.clone()).await
10646 }
10647 pub async fn committer_email(&self) -> Result<String, DaggerError> {
10649 let query = self.selection.select("committerEmail");
10650 query.execute(self.graphql_client.clone()).await
10651 }
10652 pub async fn message(&self) -> Result<String, DaggerError> {
10654 let query = self.selection.select("message");
10655 query.execute(self.graphql_client.clone()).await
10656 }
10657 pub async fn message_headline(&self) -> Result<String, DaggerError> {
10659 let query = self.selection.select("messageHeadline");
10660 query.execute(self.graphql_client.clone()).await
10661 }
10662 pub async fn message_body(&self) -> Result<String, DaggerError> {
10664 let query = self.selection.select("messageBody");
10665 query.execute(self.graphql_client.clone()).await
10666 }
10667 pub async fn parent_shas(&self) -> Result<Vec<String>, DaggerError> {
10669 let query = self.selection.select("parentShas");
10670 query.execute(self.graphql_client.clone()).await
10671 }
10672}
10673impl Node for GitCommit {
10674 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10675 let query = self.selection.select("id");
10676 let graphql_client = self.graphql_client.clone();
10677 async move { query.execute(graphql_client).await }
10678 }
10679}
10680#[derive(Clone)]
10681pub struct GitPushResult {
10682 pub proc: Option<Arc<DaggerSessionProc>>,
10683 pub selection: Selection,
10684 pub graphql_client: DynGraphQLClient,
10685}
10686impl IntoID<Id> for GitPushResult {
10687 fn into_id(
10688 self,
10689 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10690 Box::pin(async move { self.id().await })
10691 }
10692}
10693impl Loadable for GitPushResult {
10694 fn graphql_type() -> &'static str {
10695 "GitPushResult"
10696 }
10697 fn from_query(
10698 proc: Option<Arc<DaggerSessionProc>>,
10699 selection: Selection,
10700 graphql_client: DynGraphQLClient,
10701 ) -> Self {
10702 Self {
10703 proc,
10704 selection,
10705 graphql_client,
10706 }
10707 }
10708}
10709impl GitPushResult {
10710 pub async fn id(&self) -> Result<Id, DaggerError> {
10712 let query = self.selection.select("id");
10713 query.execute(self.graphql_client.clone()).await
10714 }
10715 pub async fn r#ref(&self) -> Result<String, DaggerError> {
10717 let query = self.selection.select("ref");
10718 query.execute(self.graphql_client.clone()).await
10719 }
10720 pub async fn previous_sha(&self) -> Result<String, DaggerError> {
10722 let query = self.selection.select("previousSHA");
10723 query.execute(self.graphql_client.clone()).await
10724 }
10725 pub async fn sha(&self) -> Result<String, DaggerError> {
10727 let query = self.selection.select("sha");
10728 query.execute(self.graphql_client.clone()).await
10729 }
10730 pub async fn disposition(&self) -> Result<GitPushDisposition, DaggerError> {
10732 let query = self.selection.select("disposition");
10733 query.execute(self.graphql_client.clone()).await
10734 }
10735}
10736impl Node for GitPushResult {
10737 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10738 let query = self.selection.select("id");
10739 let graphql_client = self.graphql_client.clone();
10740 async move { query.execute(graphql_client).await }
10741 }
10742}
10743#[derive(Clone)]
10744pub struct GitRef {
10745 pub proc: Option<Arc<DaggerSessionProc>>,
10746 pub selection: Selection,
10747 pub graphql_client: DynGraphQLClient,
10748}
10749#[derive(Builder, Debug, PartialEq)]
10750pub struct GitRefPushOpts<'a> {
10751 #[builder(setter(into, strip_option), default)]
10753 pub branch: Option<&'a str>,
10754 #[builder(setter(into, strip_option), default)]
10756 pub expected_remote_sha: Option<&'a str>,
10757 #[builder(setter(into, strip_option), default)]
10759 pub remote: Option<&'a str>,
10760 #[builder(setter(into, strip_option), default)]
10762 pub to: Option<Id>,
10763}
10764#[derive(Builder, Debug, PartialEq)]
10765pub struct GitRefTreeOpts {
10766 #[builder(setter(into, strip_option), default)]
10768 pub depth: Option<isize>,
10769 #[builder(setter(into, strip_option), default)]
10771 pub discard_git_dir: Option<bool>,
10772 #[builder(setter(into, strip_option), default)]
10774 pub include_tags: Option<bool>,
10775}
10776#[derive(Builder, Debug, PartialEq)]
10777pub struct GitRefLogOpts<'a> {
10778 #[builder(setter(into, strip_option), default)]
10780 pub base: Option<Id>,
10781 #[builder(setter(into, strip_option), default)]
10783 pub limit: Option<isize>,
10784 #[builder(setter(into, strip_option), default)]
10786 pub paths: Option<Vec<&'a str>>,
10787}
10788#[derive(Builder, Debug, PartialEq)]
10789pub struct GitRefWithCommitOpts<'a> {
10790 #[builder(setter(into, strip_option), default)]
10792 pub allow_empty: Option<bool>,
10793 #[builder(setter(into, strip_option), default)]
10795 pub committer_date: Option<&'a str>,
10796 #[builder(setter(into, strip_option), default)]
10798 pub committer_email: Option<&'a str>,
10799 #[builder(setter(into, strip_option), default)]
10801 pub committer_name: Option<&'a str>,
10802 #[builder(setter(into, strip_option), default)]
10804 pub signoff: Option<bool>,
10805}
10806#[derive(Builder, Debug, PartialEq)]
10807pub struct GitRefAsWorkspaceOpts<'a> {
10808 #[builder(setter(into, strip_option), default)]
10810 pub cwd: Option<&'a str>,
10811}
10812impl IntoID<Id> for GitRef {
10813 fn into_id(
10814 self,
10815 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10816 Box::pin(async move { self.id().await })
10817 }
10818}
10819impl Loadable for GitRef {
10820 fn graphql_type() -> &'static str {
10821 "GitRef"
10822 }
10823 fn from_query(
10824 proc: Option<Arc<DaggerSessionProc>>,
10825 selection: Selection,
10826 graphql_client: DynGraphQLClient,
10827 ) -> Self {
10828 Self {
10829 proc,
10830 selection,
10831 graphql_client,
10832 }
10833 }
10834}
10835impl GitRef {
10836 pub async fn id(&self) -> Result<Id, DaggerError> {
10838 let query = self.selection.select("id");
10839 query.execute(self.graphql_client.clone()).await
10840 }
10841 pub fn push(&self) -> GitPushResult {
10849 let query = self.selection.select("push");
10850 GitPushResult {
10851 proc: self.proc.clone(),
10852 selection: query,
10853 graphql_client: self.graphql_client.clone(),
10854 }
10855 }
10856 pub fn push_opts<'a>(&self, opts: GitRefPushOpts<'a>) -> GitPushResult {
10864 let mut query = self.selection.select("push");
10865 if let Some(to) = opts.to {
10866 query = query.arg("to", to);
10867 }
10868 if let Some(remote) = opts.remote {
10869 query = query.arg("remote", remote);
10870 }
10871 if let Some(branch) = opts.branch {
10872 query = query.arg("branch", branch);
10873 }
10874 if let Some(expected_remote_sha) = opts.expected_remote_sha {
10875 query = query.arg("expectedRemoteSHA", expected_remote_sha);
10876 }
10877 GitPushResult {
10878 proc: self.proc.clone(),
10879 selection: query,
10880 graphql_client: self.graphql_client.clone(),
10881 }
10882 }
10883 pub fn target_commit(&self) -> GitCommit {
10885 let query = self.selection.select("targetCommit");
10886 GitCommit {
10887 proc: self.proc.clone(),
10888 selection: query,
10889 graphql_client: self.graphql_client.clone(),
10890 }
10891 }
10892 pub async fn commit_sha(&self) -> Result<String, DaggerError> {
10894 let query = self.selection.select("commitSHA");
10895 query.execute(self.graphql_client.clone()).await
10896 }
10897 pub fn tree(&self) -> Directory {
10903 let query = self.selection.select("tree");
10904 Directory {
10905 proc: self.proc.clone(),
10906 selection: query,
10907 graphql_client: self.graphql_client.clone(),
10908 }
10909 }
10910 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10916 let mut query = self.selection.select("tree");
10917 if let Some(discard_git_dir) = opts.discard_git_dir {
10918 query = query.arg("discardGitDir", discard_git_dir);
10919 }
10920 if let Some(depth) = opts.depth {
10921 query = query.arg("depth", depth);
10922 }
10923 if let Some(include_tags) = opts.include_tags {
10924 query = query.arg("includeTags", include_tags);
10925 }
10926 Directory {
10927 proc: self.proc.clone(),
10928 selection: query,
10929 graphql_client: self.graphql_client.clone(),
10930 }
10931 }
10932 pub async fn commit(&self) -> Result<String, DaggerError> {
10934 let query = self.selection.select("commit");
10935 query.execute(self.graphql_client.clone()).await
10936 }
10937 pub async fn name(&self) -> Result<String, DaggerError> {
10939 let query = self.selection.select("name");
10940 query.execute(self.graphql_client.clone()).await
10941 }
10942 pub async fn r#ref(&self) -> Result<String, DaggerError> {
10944 let query = self.selection.select("ref");
10945 query.execute(self.graphql_client.clone()).await
10946 }
10947 pub async fn contains(&self, other: impl IntoID<Id>) -> Result<bool, DaggerError> {
10954 let mut query = self.selection.select("contains");
10955 query = query.arg_lazy(
10956 "other",
10957 Box::new(move || {
10958 let other = other.clone();
10959 Box::pin(async move { other.into_id().await.unwrap().quote() })
10960 }),
10961 );
10962 query.execute(self.graphql_client.clone()).await
10963 }
10964 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10970 let mut query = self.selection.select("commonAncestor");
10971 query = query.arg_lazy(
10972 "other",
10973 Box::new(move || {
10974 let other = other.clone();
10975 Box::pin(async move { other.into_id().await.unwrap().quote() })
10976 }),
10977 );
10978 GitRef {
10979 proc: self.proc.clone(),
10980 selection: query,
10981 graphql_client: self.graphql_client.clone(),
10982 }
10983 }
10984 pub async fn log(&self) -> Result<Vec<GitCommit>, DaggerError> {
10990 let query = self.selection.select("log");
10991 let query = query.select("id");
10992 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10993 Ok(ids
10994 .into_iter()
10995 .map(|id| GitCommit {
10996 proc: self.proc.clone(),
10997 selection: crate::querybuilder::query()
10998 .select("node")
10999 .arg("id", &id.0)
11000 .inline_fragment("GitCommit"),
11001 graphql_client: self.graphql_client.clone(),
11002 })
11003 .collect())
11004 }
11005 pub async fn log_opts<'a>(
11011 &self,
11012 opts: GitRefLogOpts<'a>,
11013 ) -> Result<Vec<GitCommit>, DaggerError> {
11014 let mut query = self.selection.select("log");
11015 if let Some(limit) = opts.limit {
11016 query = query.arg("limit", limit);
11017 }
11018 if let Some(paths) = opts.paths {
11019 query = query.arg("paths", paths);
11020 }
11021 if let Some(base) = opts.base {
11022 query = query.arg("base", base);
11023 }
11024 let query = query.select("id");
11025 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11026 Ok(ids
11027 .into_iter()
11028 .map(|id| GitCommit {
11029 proc: self.proc.clone(),
11030 selection: crate::querybuilder::query()
11031 .select("node")
11032 .arg("id", &id.0)
11033 .inline_fragment("GitCommit"),
11034 graphql_client: self.graphql_client.clone(),
11035 })
11036 .collect())
11037 }
11038 pub fn with_commit(
11051 &self,
11052 changes: impl IntoID<Id>,
11053 message: impl Into<String>,
11054 date: impl Into<String>,
11055 author_name: impl Into<String>,
11056 author_email: impl Into<String>,
11057 ) -> GitRef {
11058 let mut query = self.selection.select("withCommit");
11059 query = query.arg_lazy(
11060 "changes",
11061 Box::new(move || {
11062 let changes = changes.clone();
11063 Box::pin(async move { changes.into_id().await.unwrap().quote() })
11064 }),
11065 );
11066 query = query.arg("message", message.into());
11067 query = query.arg("date", date.into());
11068 query = query.arg("authorName", author_name.into());
11069 query = query.arg("authorEmail", author_email.into());
11070 GitRef {
11071 proc: self.proc.clone(),
11072 selection: query,
11073 graphql_client: self.graphql_client.clone(),
11074 }
11075 }
11076 pub fn with_commit_opts<'a>(
11089 &self,
11090 changes: impl IntoID<Id>,
11091 message: impl Into<String>,
11092 date: impl Into<String>,
11093 author_name: impl Into<String>,
11094 author_email: impl Into<String>,
11095 opts: GitRefWithCommitOpts<'a>,
11096 ) -> GitRef {
11097 let mut query = self.selection.select("withCommit");
11098 query = query.arg_lazy(
11099 "changes",
11100 Box::new(move || {
11101 let changes = changes.clone();
11102 Box::pin(async move { changes.into_id().await.unwrap().quote() })
11103 }),
11104 );
11105 query = query.arg("message", message.into());
11106 query = query.arg("date", date.into());
11107 query = query.arg("authorName", author_name.into());
11108 query = query.arg("authorEmail", author_email.into());
11109 if let Some(committer_name) = opts.committer_name {
11110 query = query.arg("committerName", committer_name);
11111 }
11112 if let Some(committer_email) = opts.committer_email {
11113 query = query.arg("committerEmail", committer_email);
11114 }
11115 if let Some(committer_date) = opts.committer_date {
11116 query = query.arg("committerDate", committer_date);
11117 }
11118 if let Some(allow_empty) = opts.allow_empty {
11119 query = query.arg("allowEmpty", allow_empty);
11120 }
11121 if let Some(signoff) = opts.signoff {
11122 query = query.arg("signoff", signoff);
11123 }
11124 GitRef {
11125 proc: self.proc.clone(),
11126 selection: query,
11127 graphql_client: self.graphql_client.clone(),
11128 }
11129 }
11130 pub fn as_repository(&self) -> GitRepository {
11133 let query = self.selection.select("asRepository");
11134 GitRepository {
11135 proc: self.proc.clone(),
11136 selection: query,
11137 graphql_client: self.graphql_client.clone(),
11138 }
11139 }
11140 pub fn as_workspace(&self) -> Workspace {
11146 let query = self.selection.select("asWorkspace");
11147 Workspace {
11148 proc: self.proc.clone(),
11149 selection: query,
11150 graphql_client: self.graphql_client.clone(),
11151 }
11152 }
11153 pub fn as_workspace_opts<'a>(&self, opts: GitRefAsWorkspaceOpts<'a>) -> Workspace {
11159 let mut query = self.selection.select("asWorkspace");
11160 if let Some(cwd) = opts.cwd {
11161 query = query.arg("cwd", cwd);
11162 }
11163 Workspace {
11164 proc: self.proc.clone(),
11165 selection: query,
11166 graphql_client: self.graphql_client.clone(),
11167 }
11168 }
11169}
11170impl Node for GitRef {
11171 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11172 let query = self.selection.select("id");
11173 let graphql_client = self.graphql_client.clone();
11174 async move { query.execute(graphql_client).await }
11175 }
11176}
11177#[derive(Clone)]
11178pub struct GitRemote {
11179 pub proc: Option<Arc<DaggerSessionProc>>,
11180 pub selection: Selection,
11181 pub graphql_client: DynGraphQLClient,
11182}
11183impl IntoID<Id> for GitRemote {
11184 fn into_id(
11185 self,
11186 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11187 Box::pin(async move { self.id().await })
11188 }
11189}
11190impl Loadable for GitRemote {
11191 fn graphql_type() -> &'static str {
11192 "GitRemote"
11193 }
11194 fn from_query(
11195 proc: Option<Arc<DaggerSessionProc>>,
11196 selection: Selection,
11197 graphql_client: DynGraphQLClient,
11198 ) -> Self {
11199 Self {
11200 proc,
11201 selection,
11202 graphql_client,
11203 }
11204 }
11205}
11206impl GitRemote {
11207 pub async fn id(&self) -> Result<Id, DaggerError> {
11209 let query = self.selection.select("id");
11210 query.execute(self.graphql_client.clone()).await
11211 }
11212 pub fn repository(&self) -> GitRepository {
11215 let query = self.selection.select("repository");
11216 GitRepository {
11217 proc: self.proc.clone(),
11218 selection: query,
11219 graphql_client: self.graphql_client.clone(),
11220 }
11221 }
11222 pub async fn name(&self) -> Result<String, DaggerError> {
11224 let query = self.selection.select("name");
11225 query.execute(self.graphql_client.clone()).await
11226 }
11227}
11228impl Node for GitRemote {
11229 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11230 let query = self.selection.select("id");
11231 let graphql_client = self.graphql_client.clone();
11232 async move { query.execute(graphql_client).await }
11233 }
11234}
11235#[derive(Clone)]
11236pub struct GitRepository {
11237 pub proc: Option<Arc<DaggerSessionProc>>,
11238 pub selection: Selection,
11239 pub graphql_client: DynGraphQLClient,
11240}
11241#[derive(Builder, Debug, PartialEq)]
11242pub struct GitRepositoryHeadOpts {
11243 #[builder(setter(into, strip_option), default)]
11245 pub no_lock: Option<bool>,
11246}
11247#[derive(Builder, Debug, PartialEq)]
11248pub struct GitRepositoryRefOpts {
11249 #[builder(setter(into, strip_option), default)]
11251 pub no_lock: Option<bool>,
11252}
11253#[derive(Builder, Debug, PartialEq)]
11254pub struct GitRepositoryBranchOpts {
11255 #[builder(setter(into, strip_option), default)]
11257 pub no_lock: Option<bool>,
11258}
11259#[derive(Builder, Debug, PartialEq)]
11260pub struct GitRepositoryTagOpts {
11261 #[builder(setter(into, strip_option), default)]
11263 pub no_lock: Option<bool>,
11264}
11265#[derive(Builder, Debug, PartialEq)]
11266pub struct GitRepositoryLatestOpts<'a> {
11267 #[builder(setter(into, strip_option), default)]
11269 pub no_lock: Option<bool>,
11270 #[builder(setter(into, strip_option), default)]
11272 pub version: Option<&'a str>,
11273}
11274#[derive(Builder, Debug, PartialEq)]
11275pub struct GitRepositoryTagsOpts<'a> {
11276 #[builder(setter(into, strip_option), default)]
11278 pub patterns: Option<Vec<&'a str>>,
11279}
11280#[derive(Builder, Debug, PartialEq)]
11281pub struct GitRepositoryBranchesOpts<'a> {
11282 #[builder(setter(into, strip_option), default)]
11284 pub patterns: Option<Vec<&'a str>>,
11285}
11286#[derive(Builder, Debug, PartialEq)]
11287pub struct GitRepositoryBundleOpts {
11288 #[builder(setter(into, strip_option), default)]
11290 pub base: Option<Id>,
11291}
11292#[derive(Builder, Debug, PartialEq)]
11293pub struct GitRepositoryWithBundleOpts<'a> {
11294 #[builder(setter(into, strip_option), default)]
11296 pub prerequisite_ref: Option<&'a str>,
11297}
11298#[derive(Builder, Debug, PartialEq)]
11299pub struct GitRepositoryWithRemoteOpts<'a> {
11300 #[builder(setter(into, strip_option), default)]
11302 pub push_url: Option<&'a str>,
11303}
11304#[derive(Builder, Debug, PartialEq)]
11305pub struct GitRepositoryAsWorkspaceOpts<'a> {
11306 #[builder(setter(into, strip_option), default)]
11308 pub cwd: Option<&'a str>,
11309}
11310impl IntoID<Id> for GitRepository {
11311 fn into_id(
11312 self,
11313 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11314 Box::pin(async move { self.id().await })
11315 }
11316}
11317impl Loadable for GitRepository {
11318 fn graphql_type() -> &'static str {
11319 "GitRepository"
11320 }
11321 fn from_query(
11322 proc: Option<Arc<DaggerSessionProc>>,
11323 selection: Selection,
11324 graphql_client: DynGraphQLClient,
11325 ) -> Self {
11326 Self {
11327 proc,
11328 selection,
11329 graphql_client,
11330 }
11331 }
11332}
11333impl GitRepository {
11334 pub async fn id(&self) -> Result<Id, DaggerError> {
11336 let query = self.selection.select("id");
11337 query.execute(self.graphql_client.clone()).await
11338 }
11339 pub fn head(&self) -> GitRef {
11345 let query = self.selection.select("head");
11346 GitRef {
11347 proc: self.proc.clone(),
11348 selection: query,
11349 graphql_client: self.graphql_client.clone(),
11350 }
11351 }
11352 pub fn head_opts(&self, opts: GitRepositoryHeadOpts) -> GitRef {
11358 let mut query = self.selection.select("head");
11359 if let Some(no_lock) = opts.no_lock {
11360 query = query.arg("noLock", no_lock);
11361 }
11362 GitRef {
11363 proc: self.proc.clone(),
11364 selection: query,
11365 graphql_client: self.graphql_client.clone(),
11366 }
11367 }
11368 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
11381 let mut query = self.selection.select("ref");
11382 query = query.arg("name", name.into());
11383 GitRef {
11384 proc: self.proc.clone(),
11385 selection: query,
11386 graphql_client: self.graphql_client.clone(),
11387 }
11388 }
11389 pub fn r#ref_opts(&self, name: impl Into<String>, opts: GitRepositoryRefOpts) -> GitRef {
11402 let mut query = self.selection.select("ref");
11403 query = query.arg("name", name.into());
11404 if let Some(no_lock) = opts.no_lock {
11405 query = query.arg("noLock", no_lock);
11406 }
11407 GitRef {
11408 proc: self.proc.clone(),
11409 selection: query,
11410 graphql_client: self.graphql_client.clone(),
11411 }
11412 }
11413 pub fn branch(&self, name: impl Into<String>) -> GitRef {
11420 let mut query = self.selection.select("branch");
11421 query = query.arg("name", name.into());
11422 GitRef {
11423 proc: self.proc.clone(),
11424 selection: query,
11425 graphql_client: self.graphql_client.clone(),
11426 }
11427 }
11428 pub fn branch_opts(&self, name: impl Into<String>, opts: GitRepositoryBranchOpts) -> GitRef {
11435 let mut query = self.selection.select("branch");
11436 query = query.arg("name", name.into());
11437 if let Some(no_lock) = opts.no_lock {
11438 query = query.arg("noLock", no_lock);
11439 }
11440 GitRef {
11441 proc: self.proc.clone(),
11442 selection: query,
11443 graphql_client: self.graphql_client.clone(),
11444 }
11445 }
11446 pub fn tag(&self, name: impl Into<String>) -> GitRef {
11453 let mut query = self.selection.select("tag");
11454 query = query.arg("name", name.into());
11455 GitRef {
11456 proc: self.proc.clone(),
11457 selection: query,
11458 graphql_client: self.graphql_client.clone(),
11459 }
11460 }
11461 pub fn tag_opts(&self, name: impl Into<String>, opts: GitRepositoryTagOpts) -> GitRef {
11468 let mut query = self.selection.select("tag");
11469 query = query.arg("name", name.into());
11470 if let Some(no_lock) = opts.no_lock {
11471 query = query.arg("noLock", no_lock);
11472 }
11473 GitRef {
11474 proc: self.proc.clone(),
11475 selection: query,
11476 graphql_client: self.graphql_client.clone(),
11477 }
11478 }
11479 pub fn commit(&self, id: impl Into<String>) -> GitCommit {
11487 let mut query = self.selection.select("commit");
11488 query = query.arg("id", id.into());
11489 GitCommit {
11490 proc: self.proc.clone(),
11491 selection: query,
11492 graphql_client: self.graphql_client.clone(),
11493 }
11494 }
11495 pub fn latest(&self) -> GitRef {
11502 let query = self.selection.select("latest");
11503 GitRef {
11504 proc: self.proc.clone(),
11505 selection: query,
11506 graphql_client: self.graphql_client.clone(),
11507 }
11508 }
11509 pub fn latest_opts<'a>(&self, opts: GitRepositoryLatestOpts<'a>) -> GitRef {
11516 let mut query = self.selection.select("latest");
11517 if let Some(version) = opts.version {
11518 query = query.arg("version", version);
11519 }
11520 if let Some(no_lock) = opts.no_lock {
11521 query = query.arg("noLock", no_lock);
11522 }
11523 GitRef {
11524 proc: self.proc.clone(),
11525 selection: query,
11526 graphql_client: self.graphql_client.clone(),
11527 }
11528 }
11529 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
11535 let query = self.selection.select("tags");
11536 query.execute(self.graphql_client.clone()).await
11537 }
11538 pub async fn tags_opts<'a>(
11544 &self,
11545 opts: GitRepositoryTagsOpts<'a>,
11546 ) -> Result<Vec<String>, DaggerError> {
11547 let mut query = self.selection.select("tags");
11548 if let Some(patterns) = opts.patterns {
11549 query = query.arg("patterns", patterns);
11550 }
11551 query.execute(self.graphql_client.clone()).await
11552 }
11553 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
11559 let query = self.selection.select("branches");
11560 query.execute(self.graphql_client.clone()).await
11561 }
11562 pub async fn branches_opts<'a>(
11568 &self,
11569 opts: GitRepositoryBranchesOpts<'a>,
11570 ) -> Result<Vec<String>, DaggerError> {
11571 let mut query = self.selection.select("branches");
11572 if let Some(patterns) = opts.patterns {
11573 query = query.arg("patterns", patterns);
11574 }
11575 query.execute(self.graphql_client.clone()).await
11576 }
11577 pub fn bundle(&self, refs: Vec<impl Into<String>>) -> GitBundle {
11584 let mut query = self.selection.select("bundle");
11585 query = query.arg(
11586 "refs",
11587 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11588 );
11589 GitBundle {
11590 proc: self.proc.clone(),
11591 selection: query,
11592 graphql_client: self.graphql_client.clone(),
11593 }
11594 }
11595 pub fn bundle_opts(
11602 &self,
11603 refs: Vec<impl Into<String>>,
11604 opts: GitRepositoryBundleOpts,
11605 ) -> GitBundle {
11606 let mut query = self.selection.select("bundle");
11607 query = query.arg(
11608 "refs",
11609 refs.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11610 );
11611 if let Some(base) = opts.base {
11612 query = query.arg("base", base);
11613 }
11614 GitBundle {
11615 proc: self.proc.clone(),
11616 selection: query,
11617 graphql_client: self.graphql_client.clone(),
11618 }
11619 }
11620 pub fn with_bundle(&self, bundle: impl IntoID<Id>) -> GitRepository {
11627 let mut query = self.selection.select("withBundle");
11628 query = query.arg_lazy(
11629 "bundle",
11630 Box::new(move || {
11631 let bundle = bundle.clone();
11632 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11633 }),
11634 );
11635 GitRepository {
11636 proc: self.proc.clone(),
11637 selection: query,
11638 graphql_client: self.graphql_client.clone(),
11639 }
11640 }
11641 pub fn with_bundle_opts<'a>(
11648 &self,
11649 bundle: impl IntoID<Id>,
11650 opts: GitRepositoryWithBundleOpts<'a>,
11651 ) -> GitRepository {
11652 let mut query = self.selection.select("withBundle");
11653 query = query.arg_lazy(
11654 "bundle",
11655 Box::new(move || {
11656 let bundle = bundle.clone();
11657 Box::pin(async move { bundle.into_id().await.unwrap().quote() })
11658 }),
11659 );
11660 if let Some(prerequisite_ref) = opts.prerequisite_ref {
11661 query = query.arg("prerequisiteRef", prerequisite_ref);
11662 }
11663 GitRepository {
11664 proc: self.proc.clone(),
11665 selection: query,
11666 graphql_client: self.graphql_client.clone(),
11667 }
11668 }
11669 pub fn with_remote(&self, name: impl Into<String>, url: impl Into<String>) -> GitRepository {
11679 let mut query = self.selection.select("withRemote");
11680 query = query.arg("name", name.into());
11681 query = query.arg("url", url.into());
11682 GitRepository {
11683 proc: self.proc.clone(),
11684 selection: query,
11685 graphql_client: self.graphql_client.clone(),
11686 }
11687 }
11688 pub fn with_remote_opts<'a>(
11698 &self,
11699 name: impl Into<String>,
11700 url: impl Into<String>,
11701 opts: GitRepositoryWithRemoteOpts<'a>,
11702 ) -> GitRepository {
11703 let mut query = self.selection.select("withRemote");
11704 query = query.arg("name", name.into());
11705 query = query.arg("url", url.into());
11706 if let Some(push_url) = opts.push_url {
11707 query = query.arg("pushUrl", push_url);
11708 }
11709 GitRepository {
11710 proc: self.proc.clone(),
11711 selection: query,
11712 graphql_client: self.graphql_client.clone(),
11713 }
11714 }
11715 pub async fn remotes(&self) -> Result<Vec<GitRemote>, DaggerError> {
11717 let query = self.selection.select("remotes");
11718 let query = query.select("id");
11719 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11720 Ok(ids
11721 .into_iter()
11722 .map(|id| GitRemote {
11723 proc: self.proc.clone(),
11724 selection: crate::querybuilder::query()
11725 .select("node")
11726 .arg("id", &id.0)
11727 .inline_fragment("GitRemote"),
11728 graphql_client: self.graphql_client.clone(),
11729 })
11730 .collect())
11731 }
11732 pub fn remote(&self, name: impl Into<String>) -> GitRemote {
11738 let mut query = self.selection.select("remote");
11739 query = query.arg("name", name.into());
11740 GitRemote {
11741 proc: self.proc.clone(),
11742 selection: query,
11743 graphql_client: self.graphql_client.clone(),
11744 }
11745 }
11746 pub async fn default_remote(&self) -> Result<Option<GitRemote>, DaggerError> {
11749 let query = self.selection.select("defaultRemote");
11750 let query = query.select("id");
11751 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
11752 Ok(id.map(|id| GitRemote {
11753 proc: self.proc.clone(),
11754 selection: query
11755 .root()
11756 .select("node")
11757 .arg("id", &id.0)
11758 .inline_fragment("GitRemote"),
11759 graphql_client: self.graphql_client.clone(),
11760 }))
11761 }
11762 pub fn with_contents(&self, directory: impl IntoID<Id>) -> GitRepository {
11771 let mut query = self.selection.select("withContents");
11772 query = query.arg_lazy(
11773 "directory",
11774 Box::new(move || {
11775 let directory = directory.clone();
11776 Box::pin(async move { directory.into_id().await.unwrap().quote() })
11777 }),
11778 );
11779 GitRepository {
11780 proc: self.proc.clone(),
11781 selection: query,
11782 graphql_client: self.graphql_client.clone(),
11783 }
11784 }
11785 pub fn uncommitted(&self) -> Changeset {
11787 let query = self.selection.select("uncommitted");
11788 Changeset {
11789 proc: self.proc.clone(),
11790 selection: query,
11791 graphql_client: self.graphql_client.clone(),
11792 }
11793 }
11794 pub fn as_workspace(&self) -> Workspace {
11801 let query = self.selection.select("asWorkspace");
11802 Workspace {
11803 proc: self.proc.clone(),
11804 selection: query,
11805 graphql_client: self.graphql_client.clone(),
11806 }
11807 }
11808 pub fn as_workspace_opts<'a>(&self, opts: GitRepositoryAsWorkspaceOpts<'a>) -> Workspace {
11815 let mut query = self.selection.select("asWorkspace");
11816 if let Some(cwd) = opts.cwd {
11817 query = query.arg("cwd", cwd);
11818 }
11819 Workspace {
11820 proc: self.proc.clone(),
11821 selection: query,
11822 graphql_client: self.graphql_client.clone(),
11823 }
11824 }
11825 pub async fn url(&self) -> Result<String, DaggerError> {
11827 let query = self.selection.select("url");
11828 query.execute(self.graphql_client.clone()).await
11829 }
11830}
11831impl Node for GitRepository {
11832 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11833 let query = self.selection.select("id");
11834 let graphql_client = self.graphql_client.clone();
11835 async move { query.execute(graphql_client).await }
11836 }
11837}
11838#[derive(Clone)]
11839pub struct HttpState {
11840 pub proc: Option<Arc<DaggerSessionProc>>,
11841 pub selection: Selection,
11842 pub graphql_client: DynGraphQLClient,
11843}
11844impl IntoID<Id> for HttpState {
11845 fn into_id(
11846 self,
11847 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11848 Box::pin(async move { self.id().await })
11849 }
11850}
11851impl Loadable for HttpState {
11852 fn graphql_type() -> &'static str {
11853 "HTTPState"
11854 }
11855 fn from_query(
11856 proc: Option<Arc<DaggerSessionProc>>,
11857 selection: Selection,
11858 graphql_client: DynGraphQLClient,
11859 ) -> Self {
11860 Self {
11861 proc,
11862 selection,
11863 graphql_client,
11864 }
11865 }
11866}
11867impl HttpState {
11868 pub async fn id(&self) -> Result<Id, DaggerError> {
11870 let query = self.selection.select("id");
11871 query.execute(self.graphql_client.clone()).await
11872 }
11873}
11874impl Node for HttpState {
11875 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11876 let query = self.selection.select("id");
11877 let graphql_client = self.graphql_client.clone();
11878 async move { query.execute(graphql_client).await }
11879 }
11880}
11881#[derive(Clone)]
11882pub struct HealthcheckConfig {
11883 pub proc: Option<Arc<DaggerSessionProc>>,
11884 pub selection: Selection,
11885 pub graphql_client: DynGraphQLClient,
11886}
11887impl IntoID<Id> for HealthcheckConfig {
11888 fn into_id(
11889 self,
11890 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11891 Box::pin(async move { self.id().await })
11892 }
11893}
11894impl Loadable for HealthcheckConfig {
11895 fn graphql_type() -> &'static str {
11896 "HealthcheckConfig"
11897 }
11898 fn from_query(
11899 proc: Option<Arc<DaggerSessionProc>>,
11900 selection: Selection,
11901 graphql_client: DynGraphQLClient,
11902 ) -> Self {
11903 Self {
11904 proc,
11905 selection,
11906 graphql_client,
11907 }
11908 }
11909}
11910impl HealthcheckConfig {
11911 pub async fn id(&self) -> Result<Id, DaggerError> {
11913 let query = self.selection.select("id");
11914 query.execute(self.graphql_client.clone()).await
11915 }
11916 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
11918 let query = self.selection.select("args");
11919 query.execute(self.graphql_client.clone()).await
11920 }
11921 pub async fn shell(&self) -> Result<bool, DaggerError> {
11923 let query = self.selection.select("shell");
11924 query.execute(self.graphql_client.clone()).await
11925 }
11926 pub async fn timeout(&self) -> Result<String, DaggerError> {
11928 let query = self.selection.select("timeout");
11929 query.execute(self.graphql_client.clone()).await
11930 }
11931 pub async fn interval(&self) -> Result<String, DaggerError> {
11933 let query = self.selection.select("interval");
11934 query.execute(self.graphql_client.clone()).await
11935 }
11936 pub async fn start_period(&self) -> Result<String, DaggerError> {
11938 let query = self.selection.select("startPeriod");
11939 query.execute(self.graphql_client.clone()).await
11940 }
11941 pub async fn start_interval(&self) -> Result<String, DaggerError> {
11943 let query = self.selection.select("startInterval");
11944 query.execute(self.graphql_client.clone()).await
11945 }
11946 pub async fn retries(&self) -> Result<isize, DaggerError> {
11948 let query = self.selection.select("retries");
11949 query.execute(self.graphql_client.clone()).await
11950 }
11951}
11952impl Node for HealthcheckConfig {
11953 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11954 let query = self.selection.select("id");
11955 let graphql_client = self.graphql_client.clone();
11956 async move { query.execute(graphql_client).await }
11957 }
11958}
11959#[derive(Clone)]
11960pub struct Host {
11961 pub proc: Option<Arc<DaggerSessionProc>>,
11962 pub selection: Selection,
11963 pub graphql_client: DynGraphQLClient,
11964}
11965#[derive(Builder, Debug, PartialEq)]
11966pub struct HostDirectoryOpts<'a> {
11967 #[builder(setter(into, strip_option), default)]
11969 pub exclude: Option<Vec<&'a str>>,
11970 #[builder(setter(into, strip_option), default)]
11972 pub gitignore: Option<bool>,
11973 #[builder(setter(into, strip_option), default)]
11975 pub include: Option<Vec<&'a str>>,
11976 #[builder(setter(into, strip_option), default)]
11978 pub no_cache: Option<bool>,
11979}
11980#[derive(Builder, Debug, PartialEq)]
11981pub struct HostFileOpts {
11982 #[builder(setter(into, strip_option), default)]
11984 pub no_cache: Option<bool>,
11985}
11986#[derive(Builder, Debug, PartialEq)]
11987pub struct HostFindUpOpts {
11988 #[builder(setter(into, strip_option), default)]
11989 pub no_cache: Option<bool>,
11990}
11991#[derive(Builder, Debug, PartialEq)]
11992pub struct HostTunnelOpts {
11993 #[builder(setter(into, strip_option), default)]
11996 pub native: Option<bool>,
11997 #[builder(setter(into, strip_option), default)]
12002 pub ports: Option<Vec<PortForward>>,
12003}
12004#[derive(Builder, Debug, PartialEq)]
12005pub struct HostServiceOpts<'a> {
12006 #[builder(setter(into, strip_option), default)]
12008 pub host: Option<&'a str>,
12009}
12010impl IntoID<Id> for Host {
12011 fn into_id(
12012 self,
12013 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12014 Box::pin(async move { self.id().await })
12015 }
12016}
12017impl Loadable for Host {
12018 fn graphql_type() -> &'static str {
12019 "Host"
12020 }
12021 fn from_query(
12022 proc: Option<Arc<DaggerSessionProc>>,
12023 selection: Selection,
12024 graphql_client: DynGraphQLClient,
12025 ) -> Self {
12026 Self {
12027 proc,
12028 selection,
12029 graphql_client,
12030 }
12031 }
12032}
12033impl Host {
12034 pub async fn id(&self) -> Result<Id, DaggerError> {
12036 let query = self.selection.select("id");
12037 query.execute(self.graphql_client.clone()).await
12038 }
12039 pub fn directory(&self, path: impl Into<String>) -> Directory {
12046 let mut query = self.selection.select("directory");
12047 query = query.arg("path", path.into());
12048 Directory {
12049 proc: self.proc.clone(),
12050 selection: query,
12051 graphql_client: self.graphql_client.clone(),
12052 }
12053 }
12054 pub fn directory_opts<'a>(
12061 &self,
12062 path: impl Into<String>,
12063 opts: HostDirectoryOpts<'a>,
12064 ) -> Directory {
12065 let mut query = self.selection.select("directory");
12066 query = query.arg("path", path.into());
12067 if let Some(exclude) = opts.exclude {
12068 query = query.arg("exclude", exclude);
12069 }
12070 if let Some(include) = opts.include {
12071 query = query.arg("include", include);
12072 }
12073 if let Some(no_cache) = opts.no_cache {
12074 query = query.arg("noCache", no_cache);
12075 }
12076 if let Some(gitignore) = opts.gitignore {
12077 query = query.arg("gitignore", gitignore);
12078 }
12079 Directory {
12080 proc: self.proc.clone(),
12081 selection: query,
12082 graphql_client: self.graphql_client.clone(),
12083 }
12084 }
12085 pub fn file(&self, path: impl Into<String>) -> File {
12092 let mut query = self.selection.select("file");
12093 query = query.arg("path", path.into());
12094 File {
12095 proc: self.proc.clone(),
12096 selection: query,
12097 graphql_client: self.graphql_client.clone(),
12098 }
12099 }
12100 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
12107 let mut query = self.selection.select("file");
12108 query = query.arg("path", path.into());
12109 if let Some(no_cache) = opts.no_cache {
12110 query = query.arg("noCache", no_cache);
12111 }
12112 File {
12113 proc: self.proc.clone(),
12114 selection: query,
12115 graphql_client: self.graphql_client.clone(),
12116 }
12117 }
12118 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
12125 let mut query = self.selection.select("findUp");
12126 query = query.arg("name", name.into());
12127 query.execute(self.graphql_client.clone()).await
12128 }
12129 pub async fn find_up_opts(
12136 &self,
12137 name: impl Into<String>,
12138 opts: HostFindUpOpts,
12139 ) -> Result<String, DaggerError> {
12140 let mut query = self.selection.select("findUp");
12141 query = query.arg("name", name.into());
12142 if let Some(no_cache) = opts.no_cache {
12143 query = query.arg("noCache", no_cache);
12144 }
12145 query.execute(self.graphql_client.clone()).await
12146 }
12147 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
12153 let mut query = self.selection.select("unixSocket");
12154 query = query.arg("path", path.into());
12155 Socket {
12156 proc: self.proc.clone(),
12157 selection: query,
12158 graphql_client: self.graphql_client.clone(),
12159 }
12160 }
12161 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
12168 let mut query = self.selection.select("tunnel");
12169 query = query.arg_lazy(
12170 "service",
12171 Box::new(move || {
12172 let service = service.clone();
12173 Box::pin(async move { service.into_id().await.unwrap().quote() })
12174 }),
12175 );
12176 Service {
12177 proc: self.proc.clone(),
12178 selection: query,
12179 graphql_client: self.graphql_client.clone(),
12180 }
12181 }
12182 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
12189 let mut query = self.selection.select("tunnel");
12190 query = query.arg_lazy(
12191 "service",
12192 Box::new(move || {
12193 let service = service.clone();
12194 Box::pin(async move { service.into_id().await.unwrap().quote() })
12195 }),
12196 );
12197 if let Some(native) = opts.native {
12198 query = query.arg("native", native);
12199 }
12200 if let Some(ports) = opts.ports {
12201 query = query.arg("ports", ports);
12202 }
12203 Service {
12204 proc: self.proc.clone(),
12205 selection: query,
12206 graphql_client: self.graphql_client.clone(),
12207 }
12208 }
12209 pub fn service(&self, ports: Vec<PortForward>) -> Service {
12220 let mut query = self.selection.select("service");
12221 query = query.arg("ports", ports);
12222 Service {
12223 proc: self.proc.clone(),
12224 selection: query,
12225 graphql_client: self.graphql_client.clone(),
12226 }
12227 }
12228 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
12239 let mut query = self.selection.select("service");
12240 query = query.arg("ports", ports);
12241 if let Some(host) = opts.host {
12242 query = query.arg("host", host);
12243 }
12244 Service {
12245 proc: self.proc.clone(),
12246 selection: query,
12247 graphql_client: self.graphql_client.clone(),
12248 }
12249 }
12250 pub fn container_image(&self, name: impl Into<String>) -> Container {
12256 let mut query = self.selection.select("containerImage");
12257 query = query.arg("name", name.into());
12258 Container {
12259 proc: self.proc.clone(),
12260 selection: query,
12261 graphql_client: self.graphql_client.clone(),
12262 }
12263 }
12264}
12265impl Node for Host {
12266 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12267 let query = self.selection.select("id");
12268 let graphql_client = self.graphql_client.clone();
12269 async move { query.execute(graphql_client).await }
12270 }
12271}
12272#[derive(Clone)]
12273pub struct Identifier {
12274 pub proc: Option<Arc<DaggerSessionProc>>,
12275 pub selection: Selection,
12276 pub graphql_client: DynGraphQLClient,
12277}
12278#[derive(Builder, Debug, PartialEq)]
12279pub struct IdentifierFormatOpts {
12280 #[builder(setter(into, strip_option), default)]
12282 pub acronyms: Option<AcronymStyle>,
12283}
12284impl IntoID<Id> for Identifier {
12285 fn into_id(
12286 self,
12287 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12288 Box::pin(async move { self.id().await })
12289 }
12290}
12291impl Loadable for Identifier {
12292 fn graphql_type() -> &'static str {
12293 "Identifier"
12294 }
12295 fn from_query(
12296 proc: Option<Arc<DaggerSessionProc>>,
12297 selection: Selection,
12298 graphql_client: DynGraphQLClient,
12299 ) -> Self {
12300 Self {
12301 proc,
12302 selection,
12303 graphql_client,
12304 }
12305 }
12306}
12307impl Identifier {
12308 pub async fn id(&self) -> Result<Id, DaggerError> {
12310 let query = self.selection.select("id");
12311 query.execute(self.graphql_client.clone()).await
12312 }
12313 pub async fn format(&self, casing: Casing) -> Result<String, DaggerError> {
12320 let mut query = self.selection.select("format");
12321 query = query.arg("casing", casing);
12322 query.execute(self.graphql_client.clone()).await
12323 }
12324 pub async fn format_opts(
12331 &self,
12332 casing: Casing,
12333 opts: IdentifierFormatOpts,
12334 ) -> Result<String, DaggerError> {
12335 let mut query = self.selection.select("format");
12336 query = query.arg("casing", casing);
12337 if let Some(acronyms) = opts.acronyms {
12338 query = query.arg("acronyms", acronyms);
12339 }
12340 query.execute(self.graphql_client.clone()).await
12341 }
12342 pub async fn name(&self) -> Result<String, DaggerError> {
12344 let query = self.selection.select("name");
12345 query.execute(self.graphql_client.clone()).await
12346 }
12347 pub async fn words(&self) -> Result<Vec<IdentifierWord>, DaggerError> {
12349 let query = self.selection.select("words");
12350 let query = query.select("id");
12351 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12352 Ok(ids
12353 .into_iter()
12354 .map(|id| IdentifierWord {
12355 proc: self.proc.clone(),
12356 selection: crate::querybuilder::query()
12357 .select("node")
12358 .arg("id", &id.0)
12359 .inline_fragment("IdentifierWord"),
12360 graphql_client: self.graphql_client.clone(),
12361 })
12362 .collect())
12363 }
12364}
12365impl Node for Identifier {
12366 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12367 let query = self.selection.select("id");
12368 let graphql_client = self.graphql_client.clone();
12369 async move { query.execute(graphql_client).await }
12370 }
12371}
12372#[derive(Clone)]
12373pub struct IdentifierWord {
12374 pub proc: Option<Arc<DaggerSessionProc>>,
12375 pub selection: Selection,
12376 pub graphql_client: DynGraphQLClient,
12377}
12378impl IntoID<Id> for IdentifierWord {
12379 fn into_id(
12380 self,
12381 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12382 Box::pin(async move { self.id().await })
12383 }
12384}
12385impl Loadable for IdentifierWord {
12386 fn graphql_type() -> &'static str {
12387 "IdentifierWord"
12388 }
12389 fn from_query(
12390 proc: Option<Arc<DaggerSessionProc>>,
12391 selection: Selection,
12392 graphql_client: DynGraphQLClient,
12393 ) -> Self {
12394 Self {
12395 proc,
12396 selection,
12397 graphql_client,
12398 }
12399 }
12400}
12401impl IdentifierWord {
12402 pub async fn id(&self) -> Result<Id, DaggerError> {
12404 let query = self.selection.select("id");
12405 query.execute(self.graphql_client.clone()).await
12406 }
12407 pub async fn term(&self) -> Result<Option<NamingTerm>, DaggerError> {
12409 let query = self.selection.select("term");
12410 let query = query.select("id");
12411 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12412 Ok(id.map(|id| NamingTerm {
12413 proc: self.proc.clone(),
12414 selection: query
12415 .root()
12416 .select("node")
12417 .arg("id", &id.0)
12418 .inline_fragment("NamingTerm"),
12419 graphql_client: self.graphql_client.clone(),
12420 }))
12421 }
12422 pub async fn text(&self) -> Result<String, DaggerError> {
12424 let query = self.selection.select("text");
12425 query.execute(self.graphql_client.clone()).await
12426 }
12427 pub async fn suffix(&self) -> Result<String, DaggerError> {
12429 let query = self.selection.select("suffix");
12430 query.execute(self.graphql_client.clone()).await
12431 }
12432 pub async fn kind(&self) -> Result<IdentifierWordKind, DaggerError> {
12434 let query = self.selection.select("kind");
12435 query.execute(self.graphql_client.clone()).await
12436 }
12437}
12438impl Node for IdentifierWord {
12439 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12440 let query = self.selection.select("id");
12441 let graphql_client = self.graphql_client.clone();
12442 async move { query.execute(graphql_client).await }
12443 }
12444}
12445#[derive(Clone)]
12446pub struct InputTypeDef {
12447 pub proc: Option<Arc<DaggerSessionProc>>,
12448 pub selection: Selection,
12449 pub graphql_client: DynGraphQLClient,
12450}
12451impl IntoID<Id> for InputTypeDef {
12452 fn into_id(
12453 self,
12454 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12455 Box::pin(async move { self.id().await })
12456 }
12457}
12458impl Loadable for InputTypeDef {
12459 fn graphql_type() -> &'static str {
12460 "InputTypeDef"
12461 }
12462 fn from_query(
12463 proc: Option<Arc<DaggerSessionProc>>,
12464 selection: Selection,
12465 graphql_client: DynGraphQLClient,
12466 ) -> Self {
12467 Self {
12468 proc,
12469 selection,
12470 graphql_client,
12471 }
12472 }
12473}
12474impl InputTypeDef {
12475 pub async fn id(&self) -> Result<Id, DaggerError> {
12477 let query = self.selection.select("id");
12478 query.execute(self.graphql_client.clone()).await
12479 }
12480 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12482 let query = self.selection.select("fields");
12483 let query = query.select("id");
12484 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12485 Ok(ids
12486 .into_iter()
12487 .map(|id| FieldTypeDef {
12488 proc: self.proc.clone(),
12489 selection: crate::querybuilder::query()
12490 .select("node")
12491 .arg("id", &id.0)
12492 .inline_fragment("FieldTypeDef"),
12493 graphql_client: self.graphql_client.clone(),
12494 })
12495 .collect())
12496 }
12497 pub async fn name(&self) -> Result<String, DaggerError> {
12499 let query = self.selection.select("name");
12500 query.execute(self.graphql_client.clone()).await
12501 }
12502}
12503impl Node for InputTypeDef {
12504 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12505 let query = self.selection.select("id");
12506 let graphql_client = self.graphql_client.clone();
12507 async move { query.execute(graphql_client).await }
12508 }
12509}
12510#[derive(Clone)]
12511pub struct InterfaceTypeDef {
12512 pub proc: Option<Arc<DaggerSessionProc>>,
12513 pub selection: Selection,
12514 pub graphql_client: DynGraphQLClient,
12515}
12516impl IntoID<Id> for InterfaceTypeDef {
12517 fn into_id(
12518 self,
12519 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12520 Box::pin(async move { self.id().await })
12521 }
12522}
12523impl Loadable for InterfaceTypeDef {
12524 fn graphql_type() -> &'static str {
12525 "InterfaceTypeDef"
12526 }
12527 fn from_query(
12528 proc: Option<Arc<DaggerSessionProc>>,
12529 selection: Selection,
12530 graphql_client: DynGraphQLClient,
12531 ) -> Self {
12532 Self {
12533 proc,
12534 selection,
12535 graphql_client,
12536 }
12537 }
12538}
12539impl InterfaceTypeDef {
12540 pub async fn id(&self) -> Result<Id, DaggerError> {
12542 let query = self.selection.select("id");
12543 query.execute(self.graphql_client.clone()).await
12544 }
12545 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12547 let query = self.selection.select("functions");
12548 let query = query.select("id");
12549 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12550 Ok(ids
12551 .into_iter()
12552 .map(|id| Function {
12553 proc: self.proc.clone(),
12554 selection: crate::querybuilder::query()
12555 .select("node")
12556 .arg("id", &id.0)
12557 .inline_fragment("Function"),
12558 graphql_client: self.graphql_client.clone(),
12559 })
12560 .collect())
12561 }
12562 pub async fn name(&self) -> Result<String, DaggerError> {
12564 let query = self.selection.select("name");
12565 query.execute(self.graphql_client.clone()).await
12566 }
12567 pub async fn description(&self) -> Result<String, DaggerError> {
12569 let query = self.selection.select("description");
12570 query.execute(self.graphql_client.clone()).await
12571 }
12572 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
12574 let query = self.selection.select("sourceMap");
12575 let query = query.select("id");
12576 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
12577 Ok(id.map(|id| SourceMap {
12578 proc: self.proc.clone(),
12579 selection: query
12580 .root()
12581 .select("node")
12582 .arg("id", &id.0)
12583 .inline_fragment("SourceMap"),
12584 graphql_client: self.graphql_client.clone(),
12585 }))
12586 }
12587 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12589 let query = self.selection.select("sourceModuleName");
12590 query.execute(self.graphql_client.clone()).await
12591 }
12592}
12593impl Node for InterfaceTypeDef {
12594 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12595 let query = self.selection.select("id");
12596 let graphql_client = self.graphql_client.clone();
12597 async move { query.execute(graphql_client).await }
12598 }
12599}
12600#[derive(Clone)]
12601pub struct JsonValue {
12602 pub proc: Option<Arc<DaggerSessionProc>>,
12603 pub selection: Selection,
12604 pub graphql_client: DynGraphQLClient,
12605}
12606#[derive(Builder, Debug, PartialEq)]
12607pub struct JsonValueContentsOpts<'a> {
12608 #[builder(setter(into, strip_option), default)]
12610 pub indent: Option<&'a str>,
12611 #[builder(setter(into, strip_option), default)]
12613 pub pretty: Option<bool>,
12614}
12615impl IntoID<Id> for JsonValue {
12616 fn into_id(
12617 self,
12618 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12619 Box::pin(async move { self.id().await })
12620 }
12621}
12622impl Loadable for JsonValue {
12623 fn graphql_type() -> &'static str {
12624 "JSONValue"
12625 }
12626 fn from_query(
12627 proc: Option<Arc<DaggerSessionProc>>,
12628 selection: Selection,
12629 graphql_client: DynGraphQLClient,
12630 ) -> Self {
12631 Self {
12632 proc,
12633 selection,
12634 graphql_client,
12635 }
12636 }
12637}
12638impl JsonValue {
12639 pub async fn id(&self) -> Result<Id, DaggerError> {
12641 let query = self.selection.select("id");
12642 query.execute(self.graphql_client.clone()).await
12643 }
12644 pub async fn contents(&self) -> Result<Json, DaggerError> {
12650 let query = self.selection.select("contents");
12651 query.execute(self.graphql_client.clone()).await
12652 }
12653 pub async fn contents_opts<'a>(
12659 &self,
12660 opts: JsonValueContentsOpts<'a>,
12661 ) -> Result<Json, DaggerError> {
12662 let mut query = self.selection.select("contents");
12663 if let Some(pretty) = opts.pretty {
12664 query = query.arg("pretty", pretty);
12665 }
12666 if let Some(indent) = opts.indent {
12667 query = query.arg("indent", indent);
12668 }
12669 query.execute(self.graphql_client.clone()).await
12670 }
12671 pub fn with_contents(&self, contents: Json) -> JsonValue {
12677 let mut query = self.selection.select("withContents");
12678 query = query.arg("contents", contents);
12679 JsonValue {
12680 proc: self.proc.clone(),
12681 selection: query,
12682 graphql_client: self.graphql_client.clone(),
12683 }
12684 }
12685 pub fn new_integer(&self, value: isize) -> JsonValue {
12691 let mut query = self.selection.select("newInteger");
12692 query = query.arg("value", value);
12693 JsonValue {
12694 proc: self.proc.clone(),
12695 selection: query,
12696 graphql_client: self.graphql_client.clone(),
12697 }
12698 }
12699 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
12701 let query = self.selection.select("asInteger");
12702 query.execute(self.graphql_client.clone()).await
12703 }
12704 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
12710 let mut query = self.selection.select("newString");
12711 query = query.arg("value", value.into());
12712 JsonValue {
12713 proc: self.proc.clone(),
12714 selection: query,
12715 graphql_client: self.graphql_client.clone(),
12716 }
12717 }
12718 pub async fn as_string(&self) -> Result<String, DaggerError> {
12720 let query = self.selection.select("asString");
12721 query.execute(self.graphql_client.clone()).await
12722 }
12723 pub fn new_boolean(&self, value: bool) -> JsonValue {
12729 let mut query = self.selection.select("newBoolean");
12730 query = query.arg("value", value);
12731 JsonValue {
12732 proc: self.proc.clone(),
12733 selection: query,
12734 graphql_client: self.graphql_client.clone(),
12735 }
12736 }
12737 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
12739 let query = self.selection.select("asBoolean");
12740 query.execute(self.graphql_client.clone()).await
12741 }
12742 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
12744 let query = self.selection.select("asArray");
12745 let query = query.select("id");
12746 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12747 Ok(ids
12748 .into_iter()
12749 .map(|id| JsonValue {
12750 proc: self.proc.clone(),
12751 selection: crate::querybuilder::query()
12752 .select("node")
12753 .arg("id", &id.0)
12754 .inline_fragment("JSONValue"),
12755 graphql_client: self.graphql_client.clone(),
12756 })
12757 .collect())
12758 }
12759 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
12761 let query = self.selection.select("fields");
12762 query.execute(self.graphql_client.clone()).await
12763 }
12764 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
12770 let mut query = self.selection.select("field");
12771 query = query.arg(
12772 "path",
12773 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12774 );
12775 JsonValue {
12776 proc: self.proc.clone(),
12777 selection: query,
12778 graphql_client: self.graphql_client.clone(),
12779 }
12780 }
12781 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
12788 let mut query = self.selection.select("withField");
12789 query = query.arg(
12790 "path",
12791 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
12792 );
12793 query = query.arg_lazy(
12794 "value",
12795 Box::new(move || {
12796 let value = value.clone();
12797 Box::pin(async move { value.into_id().await.unwrap().quote() })
12798 }),
12799 );
12800 JsonValue {
12801 proc: self.proc.clone(),
12802 selection: query,
12803 graphql_client: self.graphql_client.clone(),
12804 }
12805 }
12806}
12807impl Node for JsonValue {
12808 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12809 let query = self.selection.select("id");
12810 let graphql_client = self.graphql_client.clone();
12811 async move { query.execute(graphql_client).await }
12812 }
12813}
12814#[derive(Clone)]
12815pub struct Llm {
12816 pub proc: Option<Arc<DaggerSessionProc>>,
12817 pub selection: Selection,
12818 pub graphql_client: DynGraphQLClient,
12819}
12820#[derive(Builder, Debug, PartialEq)]
12821pub struct LlmArtifactsOpts<'a> {
12822 #[builder(setter(into, strip_option), default)]
12824 pub include: Option<Vec<&'a str>>,
12825}
12826#[derive(Builder, Debug, PartialEq)]
12827pub struct LlmWithModelOpts<'a> {
12828 #[builder(setter(into, strip_option), default)]
12830 pub provider: Option<&'a str>,
12831}
12832#[derive(Builder, Debug, PartialEq)]
12833pub struct LlmWithPromptOpts {
12834 #[builder(setter(into, strip_option), default)]
12836 pub origin: Option<LlmMessageOriginInput>,
12837}
12838#[derive(Builder, Debug, PartialEq)]
12839pub struct LlmWithContentOpts {
12840 #[builder(setter(into, strip_option), default)]
12842 pub origin: Option<LlmMessageOriginInput>,
12843}
12844#[derive(Builder, Debug, PartialEq)]
12845pub struct LlmWithContentFileOpts<'a> {
12846 #[builder(setter(into, strip_option), default)]
12848 pub mime_type: Option<&'a str>,
12849}
12850#[derive(Builder, Debug, PartialEq)]
12851pub struct LlmWithResponseOpts {
12852 #[builder(setter(into, strip_option), default)]
12854 pub cached_token_reads: Option<isize>,
12855 #[builder(setter(into, strip_option), default)]
12857 pub cached_token_writes: Option<isize>,
12858 #[builder(setter(into, strip_option), default)]
12860 pub input_tokens: Option<isize>,
12861 #[builder(setter(into, strip_option), default)]
12863 pub output_tokens: Option<isize>,
12864 #[builder(setter(into, strip_option), default)]
12866 pub total_tokens: Option<isize>,
12867}
12868#[derive(Builder, Debug, PartialEq)]
12869pub struct LlmWithToolResultOpts {
12870 #[builder(setter(into, strip_option), default)]
12872 pub blocks: Option<Vec<LlmContentBlockInput>>,
12873}
12874#[derive(Builder, Debug, PartialEq)]
12875pub struct LlmWithToolsOpts<'a> {
12876 #[builder(setter(into, strip_option), default)]
12878 pub except: Option<Vec<&'a str>>,
12879 #[builder(setter(into, strip_option), default)]
12881 pub version: Option<isize>,
12882}
12883#[derive(Builder, Debug, PartialEq)]
12884pub struct LlmLoopOpts {
12885 #[builder(setter(into, strip_option), default)]
12887 pub max_steps: Option<isize>,
12888 #[builder(setter(into, strip_option), default)]
12890 pub max_tokens: Option<isize>,
12891}
12892#[derive(Builder, Debug, PartialEq)]
12893pub struct LlmStepOpts {
12894 #[builder(setter(into, strip_option), default)]
12896 pub max_tokens: Option<isize>,
12897}
12898#[derive(Builder, Debug, PartialEq)]
12899pub struct LlmSpawnOpts<'a> {
12900 #[builder(setter(into, strip_option), default)]
12902 pub error: Option<&'a str>,
12903 #[builder(setter(into, strip_option), default)]
12905 pub expertise: Option<Vec<Id>>,
12906 #[builder(setter(into, strip_option), default)]
12908 pub handle: Option<&'a str>,
12909 #[builder(setter(into, strip_option), default)]
12911 pub name: Option<&'a str>,
12912 #[builder(setter(into, strip_option), default)]
12914 pub parent_handle: Option<&'a str>,
12915 #[builder(setter(into, strip_option), default)]
12918 pub state: Option<AgentState>,
12919}
12920impl IntoID<Id> for Llm {
12921 fn into_id(
12922 self,
12923 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12924 Box::pin(async move { self.id().await })
12925 }
12926}
12927impl Loadable for Llm {
12928 fn graphql_type() -> &'static str {
12929 "LLM"
12930 }
12931 fn from_query(
12932 proc: Option<Arc<DaggerSessionProc>>,
12933 selection: Selection,
12934 graphql_client: DynGraphQLClient,
12935 ) -> Self {
12936 Self {
12937 proc,
12938 selection,
12939 graphql_client,
12940 }
12941 }
12942}
12943impl Llm {
12944 pub async fn id(&self) -> Result<Id, DaggerError> {
12946 let query = self.selection.select("id");
12947 query.execute(self.graphql_client.clone()).await
12948 }
12949 pub async fn expertise(&self) -> Result<Vec<Expertise>, DaggerError> {
12951 let query = self.selection.select("expertise");
12952 let query = query.select("id");
12953 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12954 Ok(ids
12955 .into_iter()
12956 .map(|id| Expertise {
12957 proc: self.proc.clone(),
12958 selection: crate::querybuilder::query()
12959 .select("node")
12960 .arg("id", &id.0)
12961 .inline_fragment("Expertise"),
12962 graphql_client: self.graphql_client.clone(),
12963 })
12964 .collect())
12965 }
12966 pub fn compose(&self, expertise: Vec<Id>) -> Llm {
12974 let mut query = self.selection.select("compose");
12975 query = query.arg("expertise", expertise);
12976 Llm {
12977 proc: self.proc.clone(),
12978 selection: query,
12979 graphql_client: self.graphql_client.clone(),
12980 }
12981 }
12982 pub async fn model(&self) -> Result<String, DaggerError> {
12984 let query = self.selection.select("model");
12985 query.execute(self.graphql_client.clone()).await
12986 }
12987 pub async fn provider(&self) -> Result<String, DaggerError> {
12989 let query = self.selection.select("provider");
12990 query.execute(self.graphql_client.clone()).await
12991 }
12992 pub async fn context_window(&self) -> Result<isize, DaggerError> {
12994 let query = self.selection.select("contextWindow");
12995 query.execute(self.graphql_client.clone()).await
12996 }
12997 pub async fn messages(&self) -> Result<Vec<LlmMessage>, DaggerError> {
12999 let query = self.selection.select("messages");
13000 let query = query.select("id");
13001 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13002 Ok(ids
13003 .into_iter()
13004 .map(|id| LlmMessage {
13005 proc: self.proc.clone(),
13006 selection: crate::querybuilder::query()
13007 .select("node")
13008 .arg("id", &id.0)
13009 .inline_fragment("LLMMessage"),
13010 graphql_client: self.graphql_client.clone(),
13011 })
13012 .collect())
13013 }
13014 pub async fn transcript(&self) -> Result<String, DaggerError> {
13016 let query = self.selection.select("transcript");
13017 query.execute(self.graphql_client.clone()).await
13018 }
13019 pub fn without_message_history(&self) -> Llm {
13021 let query = self.selection.select("withoutMessageHistory");
13022 Llm {
13023 proc: self.proc.clone(),
13024 selection: query,
13025 graphql_client: self.graphql_client.clone(),
13026 }
13027 }
13028 pub fn without_system_prompts(&self) -> Llm {
13030 let query = self.selection.select("withoutSystemPrompts");
13031 Llm {
13032 proc: self.proc.clone(),
13033 selection: query,
13034 graphql_client: self.graphql_client.clone(),
13035 }
13036 }
13037 pub async fn last_reply(&self) -> Result<String, DaggerError> {
13039 let query = self.selection.select("lastReply");
13040 query.execute(self.graphql_client.clone()).await
13041 }
13042 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Llm {
13048 let mut query = self.selection.select("withWorkspace");
13049 query = query.arg_lazy(
13050 "workspace",
13051 Box::new(move || {
13052 let workspace = workspace.clone();
13053 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
13054 }),
13055 );
13056 Llm {
13057 proc: self.proc.clone(),
13058 selection: query,
13059 graphql_client: self.graphql_client.clone(),
13060 }
13061 }
13062 pub fn workspace(&self) -> Workspace {
13064 let query = self.selection.select("workspace");
13065 Workspace {
13066 proc: self.proc.clone(),
13067 selection: query,
13068 graphql_client: self.graphql_client.clone(),
13069 }
13070 }
13071 pub fn artifacts(&self) -> Artifacts {
13080 let query = self.selection.select("artifacts");
13081 Artifacts {
13082 proc: self.proc.clone(),
13083 selection: query,
13084 graphql_client: self.graphql_client.clone(),
13085 }
13086 }
13087 pub fn artifacts_opts<'a>(&self, opts: LlmArtifactsOpts<'a>) -> Artifacts {
13096 let mut query = self.selection.select("artifacts");
13097 if let Some(include) = opts.include {
13098 query = query.arg("include", include);
13099 }
13100 Artifacts {
13101 proc: self.proc.clone(),
13102 selection: query,
13103 graphql_client: self.graphql_client.clone(),
13104 }
13105 }
13106 pub fn with_model(&self, model: impl Into<String>) -> Llm {
13113 let mut query = self.selection.select("withModel");
13114 query = query.arg("model", model.into());
13115 Llm {
13116 proc: self.proc.clone(),
13117 selection: query,
13118 graphql_client: self.graphql_client.clone(),
13119 }
13120 }
13121 pub fn with_model_opts<'a>(&self, model: impl Into<String>, opts: LlmWithModelOpts<'a>) -> Llm {
13128 let mut query = self.selection.select("withModel");
13129 query = query.arg("model", model.into());
13130 if let Some(provider) = opts.provider {
13131 query = query.arg("provider", provider);
13132 }
13133 Llm {
13134 proc: self.proc.clone(),
13135 selection: query,
13136 graphql_client: self.graphql_client.clone(),
13137 }
13138 }
13139 pub fn with_small_model(&self) -> Llm {
13141 let query = self.selection.select("withSmallModel");
13142 Llm {
13143 proc: self.proc.clone(),
13144 selection: query,
13145 graphql_client: self.graphql_client.clone(),
13146 }
13147 }
13148 pub async fn reasoning_effort(&self) -> Result<String, DaggerError> {
13150 let query = self.selection.select("reasoningEffort");
13151 query.execute(self.graphql_client.clone()).await
13152 }
13153 pub fn with_reasoning_effort(&self, effort: impl Into<String>) -> Llm {
13159 let mut query = self.selection.select("withReasoningEffort");
13160 query = query.arg("effort", effort.into());
13161 Llm {
13162 proc: self.proc.clone(),
13163 selection: query,
13164 graphql_client: self.graphql_client.clone(),
13165 }
13166 }
13167 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
13174 let mut query = self.selection.select("withPrompt");
13175 query = query.arg("prompt", prompt.into());
13176 Llm {
13177 proc: self.proc.clone(),
13178 selection: query,
13179 graphql_client: self.graphql_client.clone(),
13180 }
13181 }
13182 pub fn with_prompt_opts(&self, prompt: impl Into<String>, opts: LlmWithPromptOpts) -> Llm {
13189 let mut query = self.selection.select("withPrompt");
13190 query = query.arg("prompt", prompt.into());
13191 if let Some(origin) = opts.origin {
13192 query = query.arg("origin", origin);
13193 }
13194 Llm {
13195 proc: self.proc.clone(),
13196 selection: query,
13197 graphql_client: self.graphql_client.clone(),
13198 }
13199 }
13200 pub fn with_content(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13207 let mut query = self.selection.select("withContent");
13208 query = query.arg("content", content);
13209 Llm {
13210 proc: self.proc.clone(),
13211 selection: query,
13212 graphql_client: self.graphql_client.clone(),
13213 }
13214 }
13215 pub fn with_content_opts(
13222 &self,
13223 content: Vec<LlmContentBlockInput>,
13224 opts: LlmWithContentOpts,
13225 ) -> Llm {
13226 let mut query = self.selection.select("withContent");
13227 query = query.arg("content", content);
13228 if let Some(origin) = opts.origin {
13229 query = query.arg("origin", origin);
13230 }
13231 Llm {
13232 proc: self.proc.clone(),
13233 selection: query,
13234 graphql_client: self.graphql_client.clone(),
13235 }
13236 }
13237 pub fn with_content_file(&self, file: impl IntoID<Id>) -> Llm {
13244 let mut query = self.selection.select("withContentFile");
13245 query = query.arg_lazy(
13246 "file",
13247 Box::new(move || {
13248 let file = file.clone();
13249 Box::pin(async move { file.into_id().await.unwrap().quote() })
13250 }),
13251 );
13252 Llm {
13253 proc: self.proc.clone(),
13254 selection: query,
13255 graphql_client: self.graphql_client.clone(),
13256 }
13257 }
13258 pub fn with_content_file_opts<'a>(
13265 &self,
13266 file: impl IntoID<Id>,
13267 opts: LlmWithContentFileOpts<'a>,
13268 ) -> Llm {
13269 let mut query = self.selection.select("withContentFile");
13270 query = query.arg_lazy(
13271 "file",
13272 Box::new(move || {
13273 let file = file.clone();
13274 Box::pin(async move { file.into_id().await.unwrap().quote() })
13275 }),
13276 );
13277 if let Some(mime_type) = opts.mime_type {
13278 query = query.arg("mimeType", mime_type);
13279 }
13280 Llm {
13281 proc: self.proc.clone(),
13282 selection: query,
13283 graphql_client: self.graphql_client.clone(),
13284 }
13285 }
13286 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
13292 let mut query = self.selection.select("withPromptFile");
13293 query = query.arg_lazy(
13294 "file",
13295 Box::new(move || {
13296 let file = file.clone();
13297 Box::pin(async move { file.into_id().await.unwrap().quote() })
13298 }),
13299 );
13300 Llm {
13301 proc: self.proc.clone(),
13302 selection: query,
13303 graphql_client: self.graphql_client.clone(),
13304 }
13305 }
13306 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
13312 let mut query = self.selection.select("withSystemPrompt");
13313 query = query.arg("prompt", prompt.into());
13314 Llm {
13315 proc: self.proc.clone(),
13316 selection: query,
13317 graphql_client: self.graphql_client.clone(),
13318 }
13319 }
13320 pub fn with_response(&self, content: Vec<LlmContentBlockInput>) -> Llm {
13327 let mut query = self.selection.select("withResponse");
13328 query = query.arg("content", content);
13329 Llm {
13330 proc: self.proc.clone(),
13331 selection: query,
13332 graphql_client: self.graphql_client.clone(),
13333 }
13334 }
13335 pub fn with_response_opts(
13342 &self,
13343 content: Vec<LlmContentBlockInput>,
13344 opts: LlmWithResponseOpts,
13345 ) -> Llm {
13346 let mut query = self.selection.select("withResponse");
13347 query = query.arg("content", content);
13348 if let Some(input_tokens) = opts.input_tokens {
13349 query = query.arg("inputTokens", input_tokens);
13350 }
13351 if let Some(output_tokens) = opts.output_tokens {
13352 query = query.arg("outputTokens", output_tokens);
13353 }
13354 if let Some(cached_token_reads) = opts.cached_token_reads {
13355 query = query.arg("cachedTokenReads", cached_token_reads);
13356 }
13357 if let Some(cached_token_writes) = opts.cached_token_writes {
13358 query = query.arg("cachedTokenWrites", cached_token_writes);
13359 }
13360 if let Some(total_tokens) = opts.total_tokens {
13361 query = query.arg("totalTokens", total_tokens);
13362 }
13363 Llm {
13364 proc: self.proc.clone(),
13365 selection: query,
13366 graphql_client: self.graphql_client.clone(),
13367 }
13368 }
13369 pub fn with_tool_result(
13378 &self,
13379 call_id: impl Into<String>,
13380 content: impl Into<String>,
13381 errored: bool,
13382 ) -> Llm {
13383 let mut query = self.selection.select("withToolResult");
13384 query = query.arg("callId", call_id.into());
13385 query = query.arg("content", content.into());
13386 query = query.arg("errored", errored);
13387 Llm {
13388 proc: self.proc.clone(),
13389 selection: query,
13390 graphql_client: self.graphql_client.clone(),
13391 }
13392 }
13393 pub fn with_tool_result_opts(
13402 &self,
13403 call_id: impl Into<String>,
13404 content: impl Into<String>,
13405 errored: bool,
13406 opts: LlmWithToolResultOpts,
13407 ) -> Llm {
13408 let mut query = self.selection.select("withToolResult");
13409 query = query.arg("callId", call_id.into());
13410 query = query.arg("content", content.into());
13411 query = query.arg("errored", errored);
13412 if let Some(blocks) = opts.blocks {
13413 query = query.arg("blocks", blocks);
13414 }
13415 Llm {
13416 proc: self.proc.clone(),
13417 selection: query,
13418 graphql_client: self.graphql_client.clone(),
13419 }
13420 }
13421 pub fn with_tools(&self, object: impl IntoID<Id>) -> Llm {
13428 let mut query = self.selection.select("withTools");
13429 query = query.arg_lazy(
13430 "object",
13431 Box::new(move || {
13432 let object = object.clone();
13433 Box::pin(async move { object.into_id().await.unwrap().quote() })
13434 }),
13435 );
13436 Llm {
13437 proc: self.proc.clone(),
13438 selection: query,
13439 graphql_client: self.graphql_client.clone(),
13440 }
13441 }
13442 pub fn with_tools_opts<'a>(&self, object: impl IntoID<Id>, opts: LlmWithToolsOpts<'a>) -> Llm {
13449 let mut query = self.selection.select("withTools");
13450 query = query.arg_lazy(
13451 "object",
13452 Box::new(move || {
13453 let object = object.clone();
13454 Box::pin(async move { object.into_id().await.unwrap().quote() })
13455 }),
13456 );
13457 if let Some(except) = opts.except {
13458 query = query.arg("except", except);
13459 }
13460 if let Some(version) = opts.version {
13461 query = query.arg("version", version);
13462 }
13463 Llm {
13464 proc: self.proc.clone(),
13465 selection: query,
13466 graphql_client: self.graphql_client.clone(),
13467 }
13468 }
13469 pub fn without_default_system_prompt(&self) -> Llm {
13471 let query = self.selection.select("withoutDefaultSystemPrompt");
13472 Llm {
13473 proc: self.proc.clone(),
13474 selection: query,
13475 graphql_client: self.graphql_client.clone(),
13476 }
13477 }
13478 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
13485 let mut query = self.selection.select("withMCPServer");
13486 query = query.arg("name", name.into());
13487 query = query.arg_lazy(
13488 "service",
13489 Box::new(move || {
13490 let service = service.clone();
13491 Box::pin(async move { service.into_id().await.unwrap().quote() })
13492 }),
13493 );
13494 Llm {
13495 proc: self.proc.clone(),
13496 selection: query,
13497 graphql_client: self.graphql_client.clone(),
13498 }
13499 }
13500 pub fn with_skills(&self, directory: impl IntoID<Id>) -> Llm {
13506 let mut query = self.selection.select("withSkills");
13507 query = query.arg_lazy(
13508 "directory",
13509 Box::new(move || {
13510 let directory = directory.clone();
13511 Box::pin(async move { directory.into_id().await.unwrap().quote() })
13512 }),
13513 );
13514 Llm {
13515 proc: self.proc.clone(),
13516 selection: query,
13517 graphql_client: self.graphql_client.clone(),
13518 }
13519 }
13520 pub async fn skills(&self) -> Result<Vec<LlmSkill>, DaggerError> {
13522 let query = self.selection.select("skills");
13523 let query = query.select("id");
13524 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13525 Ok(ids
13526 .into_iter()
13527 .map(|id| LlmSkill {
13528 proc: self.proc.clone(),
13529 selection: crate::querybuilder::query()
13530 .select("node")
13531 .arg("id", &id.0)
13532 .inline_fragment("LLMSkill"),
13533 graphql_client: self.graphql_client.clone(),
13534 })
13535 .collect())
13536 }
13537 pub async fn sync(&self) -> Result<Llm, DaggerError> {
13539 let query = self.selection.select("sync");
13540 let id: Id = query.execute(self.graphql_client.clone()).await?;
13541 Ok(Llm {
13542 proc: self.proc.clone(),
13543 selection: query
13544 .root()
13545 .select("node")
13546 .arg("id", &id.0)
13547 .inline_fragment("LLM"),
13548 graphql_client: self.graphql_client.clone(),
13549 })
13550 }
13551 pub fn r#loop(&self) -> Llm {
13557 let query = self.selection.select("loop");
13558 Llm {
13559 proc: self.proc.clone(),
13560 selection: query,
13561 graphql_client: self.graphql_client.clone(),
13562 }
13563 }
13564 pub fn r#loop_opts(&self, opts: LlmLoopOpts) -> Llm {
13570 let mut query = self.selection.select("loop");
13571 if let Some(max_steps) = opts.max_steps {
13572 query = query.arg("maxSteps", max_steps);
13573 }
13574 if let Some(max_tokens) = opts.max_tokens {
13575 query = query.arg("maxTokens", max_tokens);
13576 }
13577 Llm {
13578 proc: self.proc.clone(),
13579 selection: query,
13580 graphql_client: self.graphql_client.clone(),
13581 }
13582 }
13583 pub fn step(&self) -> Llm {
13589 let query = self.selection.select("step");
13590 Llm {
13591 proc: self.proc.clone(),
13592 selection: query,
13593 graphql_client: self.graphql_client.clone(),
13594 }
13595 }
13596 pub fn step_opts(&self, opts: LlmStepOpts) -> Llm {
13602 let mut query = self.selection.select("step");
13603 if let Some(max_tokens) = opts.max_tokens {
13604 query = query.arg("maxTokens", max_tokens);
13605 }
13606 Llm {
13607 proc: self.proc.clone(),
13608 selection: query,
13609 graphql_client: self.graphql_client.clone(),
13610 }
13611 }
13612 pub async fn spawn(&self) -> Result<Agent, DaggerError> {
13621 let query = self.selection.select("spawn");
13622 let id: Id = query.execute(self.graphql_client.clone()).await?;
13623 Ok(Agent {
13624 proc: self.proc.clone(),
13625 selection: query
13626 .root()
13627 .select("node")
13628 .arg("id", &id.0)
13629 .inline_fragment("Agent"),
13630 graphql_client: self.graphql_client.clone(),
13631 })
13632 }
13633 pub async fn spawn_opts<'a>(&self, opts: LlmSpawnOpts<'a>) -> Result<Agent, DaggerError> {
13642 let mut query = self.selection.select("spawn");
13643 if let Some(expertise) = opts.expertise {
13644 query = query.arg("expertise", expertise);
13645 }
13646 if let Some(name) = opts.name {
13647 query = query.arg("name", name);
13648 }
13649 if let Some(handle) = opts.handle {
13650 query = query.arg("handle", handle);
13651 }
13652 if let Some(state) = opts.state {
13653 query = query.arg("state", state);
13654 }
13655 if let Some(parent_handle) = opts.parent_handle {
13656 query = query.arg("parentHandle", parent_handle);
13657 }
13658 if let Some(error) = opts.error {
13659 query = query.arg("error", error);
13660 }
13661 let id: Id = query.execute(self.graphql_client.clone()).await?;
13662 Ok(Agent {
13663 proc: self.proc.clone(),
13664 selection: query
13665 .root()
13666 .select("node")
13667 .arg("id", &id.0)
13668 .inline_fragment("Agent"),
13669 graphql_client: self.graphql_client.clone(),
13670 })
13671 }
13672 pub fn agent(&self, handle: impl Into<String>, name: impl Into<String>) -> Agent {
13680 let mut query = self.selection.select("agent");
13681 query = query.arg("handle", handle.into());
13682 query = query.arg("name", name.into());
13683 Agent {
13684 proc: self.proc.clone(),
13685 selection: query,
13686 graphql_client: self.graphql_client.clone(),
13687 }
13688 }
13689 pub async fn has_pending(&self) -> Result<bool, DaggerError> {
13691 let query = self.selection.select("hasPending");
13692 query.execute(self.graphql_client.clone()).await
13693 }
13694 pub fn fork(&self, label: impl Into<String>) -> Llm {
13700 let mut query = self.selection.select("fork");
13701 query = query.arg("label", label.into());
13702 Llm {
13703 proc: self.proc.clone(),
13704 selection: query,
13705 graphql_client: self.graphql_client.clone(),
13706 }
13707 }
13708 pub async fn tools(&self) -> Result<String, DaggerError> {
13710 let query = self.selection.select("tools");
13711 query.execute(self.graphql_client.clone()).await
13712 }
13713 pub fn token_usage(&self) -> LlmTokenUsage {
13715 let query = self.selection.select("tokenUsage");
13716 LlmTokenUsage {
13717 proc: self.proc.clone(),
13718 selection: query,
13719 graphql_client: self.graphql_client.clone(),
13720 }
13721 }
13722 pub async fn context_tokens(&self) -> Result<isize, DaggerError> {
13724 let query = self.selection.select("contextTokens");
13725 query.execute(self.graphql_client.clone()).await
13726 }
13727}
13728impl Node for Llm {
13729 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13730 let query = self.selection.select("id");
13731 let graphql_client = self.graphql_client.clone();
13732 async move { query.execute(graphql_client).await }
13733 }
13734}
13735impl Syncer for Llm {
13736 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13737 let query = self.selection.select("id");
13738 let graphql_client = self.graphql_client.clone();
13739 async move { query.execute(graphql_client).await }
13740 }
13741 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
13742 let query = self.selection.select("sync");
13743 let proc = self.proc.clone();
13744 let graphql_client = self.graphql_client.clone();
13745 async move {
13746 let id: Id = query.execute(graphql_client.clone()).await?;
13747 Ok(Self {
13748 proc,
13749 selection: query
13750 .root()
13751 .select("node")
13752 .arg("id", &id.0)
13753 .inline_fragment("LLM"),
13754 graphql_client,
13755 })
13756 }
13757 }
13758}
13759#[derive(Clone)]
13760pub struct LlmContent {
13761 pub proc: Option<Arc<DaggerSessionProc>>,
13762 pub selection: Selection,
13763 pub graphql_client: DynGraphQLClient,
13764}
13765#[derive(Builder, Debug, PartialEq)]
13766pub struct LlmContentWithFileOpts<'a> {
13767 #[builder(setter(into, strip_option), default)]
13769 pub mime_type: Option<&'a str>,
13770}
13771impl IntoID<Id> for LlmContent {
13772 fn into_id(
13773 self,
13774 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13775 Box::pin(async move { self.id().await })
13776 }
13777}
13778impl Loadable for LlmContent {
13779 fn graphql_type() -> &'static str {
13780 "LLMContent"
13781 }
13782 fn from_query(
13783 proc: Option<Arc<DaggerSessionProc>>,
13784 selection: Selection,
13785 graphql_client: DynGraphQLClient,
13786 ) -> Self {
13787 Self {
13788 proc,
13789 selection,
13790 graphql_client,
13791 }
13792 }
13793}
13794impl LlmContent {
13795 pub async fn id(&self) -> Result<Id, DaggerError> {
13797 let query = self.selection.select("id");
13798 query.execute(self.graphql_client.clone()).await
13799 }
13800 pub fn with_text(&self, text: impl Into<String>) -> LlmContent {
13806 let mut query = self.selection.select("withText");
13807 query = query.arg("text", text.into());
13808 LlmContent {
13809 proc: self.proc.clone(),
13810 selection: query,
13811 graphql_client: self.graphql_client.clone(),
13812 }
13813 }
13814 pub fn with_file(&self, file: impl IntoID<Id>) -> LlmContent {
13821 let mut query = self.selection.select("withFile");
13822 query = query.arg_lazy(
13823 "file",
13824 Box::new(move || {
13825 let file = file.clone();
13826 Box::pin(async move { file.into_id().await.unwrap().quote() })
13827 }),
13828 );
13829 LlmContent {
13830 proc: self.proc.clone(),
13831 selection: query,
13832 graphql_client: self.graphql_client.clone(),
13833 }
13834 }
13835 pub fn with_file_opts<'a>(
13842 &self,
13843 file: impl IntoID<Id>,
13844 opts: LlmContentWithFileOpts<'a>,
13845 ) -> LlmContent {
13846 let mut query = self.selection.select("withFile");
13847 query = query.arg_lazy(
13848 "file",
13849 Box::new(move || {
13850 let file = file.clone();
13851 Box::pin(async move { file.into_id().await.unwrap().quote() })
13852 }),
13853 );
13854 if let Some(mime_type) = opts.mime_type {
13855 query = query.arg("mimeType", mime_type);
13856 }
13857 LlmContent {
13858 proc: self.proc.clone(),
13859 selection: query,
13860 graphql_client: self.graphql_client.clone(),
13861 }
13862 }
13863 pub fn with_data(&self, data: Bytes, mime_type: impl Into<String>) -> LlmContent {
13871 let mut query = self.selection.select("withData");
13872 query = query.arg("data", data);
13873 query = query.arg("mimeType", mime_type.into());
13874 LlmContent {
13875 proc: self.proc.clone(),
13876 selection: query,
13877 graphql_client: self.graphql_client.clone(),
13878 }
13879 }
13880 pub async fn blocks(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13882 let query = self.selection.select("blocks");
13883 let query = query.select("id");
13884 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13885 Ok(ids
13886 .into_iter()
13887 .map(|id| LlmContentBlock {
13888 proc: self.proc.clone(),
13889 selection: crate::querybuilder::query()
13890 .select("node")
13891 .arg("id", &id.0)
13892 .inline_fragment("LLMContentBlock"),
13893 graphql_client: self.graphql_client.clone(),
13894 })
13895 .collect())
13896 }
13897}
13898impl Node for LlmContent {
13899 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
13900 let query = self.selection.select("id");
13901 let graphql_client = self.graphql_client.clone();
13902 async move { query.execute(graphql_client).await }
13903 }
13904}
13905#[derive(Clone)]
13906pub struct LlmContentBlock {
13907 pub proc: Option<Arc<DaggerSessionProc>>,
13908 pub selection: Selection,
13909 pub graphql_client: DynGraphQLClient,
13910}
13911impl IntoID<Id> for LlmContentBlock {
13912 fn into_id(
13913 self,
13914 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13915 Box::pin(async move { self.id().await })
13916 }
13917}
13918impl Loadable for LlmContentBlock {
13919 fn graphql_type() -> &'static str {
13920 "LLMContentBlock"
13921 }
13922 fn from_query(
13923 proc: Option<Arc<DaggerSessionProc>>,
13924 selection: Selection,
13925 graphql_client: DynGraphQLClient,
13926 ) -> Self {
13927 Self {
13928 proc,
13929 selection,
13930 graphql_client,
13931 }
13932 }
13933}
13934impl LlmContentBlock {
13935 pub async fn id(&self) -> Result<Id, DaggerError> {
13937 let query = self.selection.select("id");
13938 query.execute(self.graphql_client.clone()).await
13939 }
13940 pub async fn kind(&self) -> Result<LlmContentBlockKind, DaggerError> {
13942 let query = self.selection.select("kind");
13943 query.execute(self.graphql_client.clone()).await
13944 }
13945 pub async fn text(&self) -> Result<String, DaggerError> {
13947 let query = self.selection.select("text");
13948 query.execute(self.graphql_client.clone()).await
13949 }
13950 pub async fn call_id(&self) -> Result<String, DaggerError> {
13952 let query = self.selection.select("callId");
13953 query.execute(self.graphql_client.clone()).await
13954 }
13955 pub async fn tool_name(&self) -> Result<String, DaggerError> {
13957 let query = self.selection.select("toolName");
13958 query.execute(self.graphql_client.clone()).await
13959 }
13960 pub async fn arguments(&self) -> Result<Json, DaggerError> {
13962 let query = self.selection.select("arguments");
13963 query.execute(self.graphql_client.clone()).await
13964 }
13965 pub async fn errored(&self) -> Result<bool, DaggerError> {
13967 let query = self.selection.select("errored");
13968 query.execute(self.graphql_client.clone()).await
13969 }
13970 pub async fn mime_type(&self) -> Result<String, DaggerError> {
13972 let query = self.selection.select("mimeType");
13973 query.execute(self.graphql_client.clone()).await
13974 }
13975 pub async fn data(&self) -> Result<Bytes, DaggerError> {
13977 let query = self.selection.select("data");
13978 query.execute(self.graphql_client.clone()).await
13979 }
13980 pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
13982 let query = self.selection.select("content");
13983 let query = query.select("id");
13984 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13985 Ok(ids
13986 .into_iter()
13987 .map(|id| LlmContentBlock {
13988 proc: self.proc.clone(),
13989 selection: crate::querybuilder::query()
13990 .select("node")
13991 .arg("id", &id.0)
13992 .inline_fragment("LLMContentBlock"),
13993 graphql_client: self.graphql_client.clone(),
13994 })
13995 .collect())
13996 }
13997 pub async fn signature(&self) -> Result<String, DaggerError> {
13999 let query = self.selection.select("signature");
14000 query.execute(self.graphql_client.clone()).await
14001 }
14002}
14003impl Node for LlmContentBlock {
14004 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14005 let query = self.selection.select("id");
14006 let graphql_client = self.graphql_client.clone();
14007 async move { query.execute(graphql_client).await }
14008 }
14009}
14010#[derive(Clone)]
14011pub struct LlmMessage {
14012 pub proc: Option<Arc<DaggerSessionProc>>,
14013 pub selection: Selection,
14014 pub graphql_client: DynGraphQLClient,
14015}
14016impl IntoID<Id> for LlmMessage {
14017 fn into_id(
14018 self,
14019 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14020 Box::pin(async move { self.id().await })
14021 }
14022}
14023impl Loadable for LlmMessage {
14024 fn graphql_type() -> &'static str {
14025 "LLMMessage"
14026 }
14027 fn from_query(
14028 proc: Option<Arc<DaggerSessionProc>>,
14029 selection: Selection,
14030 graphql_client: DynGraphQLClient,
14031 ) -> Self {
14032 Self {
14033 proc,
14034 selection,
14035 graphql_client,
14036 }
14037 }
14038}
14039impl LlmMessage {
14040 pub async fn id(&self) -> Result<Id, DaggerError> {
14042 let query = self.selection.select("id");
14043 query.execute(self.graphql_client.clone()).await
14044 }
14045 pub async fn origin(&self) -> Result<Option<LlmMessageOrigin>, DaggerError> {
14048 let query = self.selection.select("origin");
14049 let query = query.select("id");
14050 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14051 Ok(id.map(|id| LlmMessageOrigin {
14052 proc: self.proc.clone(),
14053 selection: query
14054 .root()
14055 .select("node")
14056 .arg("id", &id.0)
14057 .inline_fragment("LLMMessageOrigin"),
14058 graphql_client: self.graphql_client.clone(),
14059 }))
14060 }
14061 pub async fn role(&self) -> Result<LlmMessageRole, DaggerError> {
14063 let query = self.selection.select("role");
14064 query.execute(self.graphql_client.clone()).await
14065 }
14066 pub async fn content(&self) -> Result<Vec<LlmContentBlock>, DaggerError> {
14068 let query = self.selection.select("content");
14069 let query = query.select("id");
14070 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14071 Ok(ids
14072 .into_iter()
14073 .map(|id| LlmContentBlock {
14074 proc: self.proc.clone(),
14075 selection: crate::querybuilder::query()
14076 .select("node")
14077 .arg("id", &id.0)
14078 .inline_fragment("LLMContentBlock"),
14079 graphql_client: self.graphql_client.clone(),
14080 })
14081 .collect())
14082 }
14083 pub fn token_usage(&self) -> LlmTokenUsage {
14085 let query = self.selection.select("tokenUsage");
14086 LlmTokenUsage {
14087 proc: self.proc.clone(),
14088 selection: query,
14089 graphql_client: self.graphql_client.clone(),
14090 }
14091 }
14092}
14093impl Node for LlmMessage {
14094 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14095 let query = self.selection.select("id");
14096 let graphql_client = self.graphql_client.clone();
14097 async move { query.execute(graphql_client).await }
14098 }
14099}
14100#[derive(Clone)]
14101pub struct LlmMessageOrigin {
14102 pub proc: Option<Arc<DaggerSessionProc>>,
14103 pub selection: Selection,
14104 pub graphql_client: DynGraphQLClient,
14105}
14106impl IntoID<Id> for LlmMessageOrigin {
14107 fn into_id(
14108 self,
14109 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14110 Box::pin(async move { self.id().await })
14111 }
14112}
14113impl Loadable for LlmMessageOrigin {
14114 fn graphql_type() -> &'static str {
14115 "LLMMessageOrigin"
14116 }
14117 fn from_query(
14118 proc: Option<Arc<DaggerSessionProc>>,
14119 selection: Selection,
14120 graphql_client: DynGraphQLClient,
14121 ) -> Self {
14122 Self {
14123 proc,
14124 selection,
14125 graphql_client,
14126 }
14127 }
14128}
14129impl LlmMessageOrigin {
14130 pub async fn id(&self) -> Result<Id, DaggerError> {
14132 let query = self.selection.select("id");
14133 query.execute(self.graphql_client.clone()).await
14134 }
14135 pub async fn kind(&self) -> Result<LlmMessageOriginKind, DaggerError> {
14137 let query = self.selection.select("kind");
14138 query.execute(self.graphql_client.clone()).await
14139 }
14140 pub async fn agent_name(&self) -> Result<String, DaggerError> {
14142 let query = self.selection.select("agentName");
14143 query.execute(self.graphql_client.clone()).await
14144 }
14145 pub async fn r#ref(&self) -> Result<String, DaggerError> {
14147 let query = self.selection.select("ref");
14148 query.execute(self.graphql_client.clone()).await
14149 }
14150 pub async fn reply_to(&self) -> Result<String, DaggerError> {
14152 let query = self.selection.select("replyTo");
14153 query.execute(self.graphql_client.clone()).await
14154 }
14155}
14156impl Node for LlmMessageOrigin {
14157 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14158 let query = self.selection.select("id");
14159 let graphql_client = self.graphql_client.clone();
14160 async move { query.execute(graphql_client).await }
14161 }
14162}
14163#[derive(Clone)]
14164pub struct LlmSkill {
14165 pub proc: Option<Arc<DaggerSessionProc>>,
14166 pub selection: Selection,
14167 pub graphql_client: DynGraphQLClient,
14168}
14169impl IntoID<Id> for LlmSkill {
14170 fn into_id(
14171 self,
14172 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14173 Box::pin(async move { self.id().await })
14174 }
14175}
14176impl Loadable for LlmSkill {
14177 fn graphql_type() -> &'static str {
14178 "LLMSkill"
14179 }
14180 fn from_query(
14181 proc: Option<Arc<DaggerSessionProc>>,
14182 selection: Selection,
14183 graphql_client: DynGraphQLClient,
14184 ) -> Self {
14185 Self {
14186 proc,
14187 selection,
14188 graphql_client,
14189 }
14190 }
14191}
14192impl LlmSkill {
14193 pub async fn id(&self) -> Result<Id, DaggerError> {
14195 let query = self.selection.select("id");
14196 query.execute(self.graphql_client.clone()).await
14197 }
14198 pub async fn name(&self) -> Result<String, DaggerError> {
14200 let query = self.selection.select("name");
14201 query.execute(self.graphql_client.clone()).await
14202 }
14203 pub async fn description(&self) -> Result<String, DaggerError> {
14205 let query = self.selection.select("description");
14206 query.execute(self.graphql_client.clone()).await
14207 }
14208}
14209impl Node for LlmSkill {
14210 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14211 let query = self.selection.select("id");
14212 let graphql_client = self.graphql_client.clone();
14213 async move { query.execute(graphql_client).await }
14214 }
14215}
14216#[derive(Clone)]
14217pub struct LlmTokenUsage {
14218 pub proc: Option<Arc<DaggerSessionProc>>,
14219 pub selection: Selection,
14220 pub graphql_client: DynGraphQLClient,
14221}
14222impl IntoID<Id> for LlmTokenUsage {
14223 fn into_id(
14224 self,
14225 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14226 Box::pin(async move { self.id().await })
14227 }
14228}
14229impl Loadable for LlmTokenUsage {
14230 fn graphql_type() -> &'static str {
14231 "LLMTokenUsage"
14232 }
14233 fn from_query(
14234 proc: Option<Arc<DaggerSessionProc>>,
14235 selection: Selection,
14236 graphql_client: DynGraphQLClient,
14237 ) -> Self {
14238 Self {
14239 proc,
14240 selection,
14241 graphql_client,
14242 }
14243 }
14244}
14245impl LlmTokenUsage {
14246 pub async fn id(&self) -> Result<Id, DaggerError> {
14248 let query = self.selection.select("id");
14249 query.execute(self.graphql_client.clone()).await
14250 }
14251 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
14253 let query = self.selection.select("inputTokens");
14254 query.execute(self.graphql_client.clone()).await
14255 }
14256 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
14258 let query = self.selection.select("outputTokens");
14259 query.execute(self.graphql_client.clone()).await
14260 }
14261 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
14263 let query = self.selection.select("cachedTokenReads");
14264 query.execute(self.graphql_client.clone()).await
14265 }
14266 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
14268 let query = self.selection.select("cachedTokenWrites");
14269 query.execute(self.graphql_client.clone()).await
14270 }
14271 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
14273 let query = self.selection.select("totalTokens");
14274 query.execute(self.graphql_client.clone()).await
14275 }
14276}
14277impl Node for LlmTokenUsage {
14278 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14279 let query = self.selection.select("id");
14280 let graphql_client = self.graphql_client.clone();
14281 async move { query.execute(graphql_client).await }
14282 }
14283}
14284#[derive(Clone)]
14285pub struct Label {
14286 pub proc: Option<Arc<DaggerSessionProc>>,
14287 pub selection: Selection,
14288 pub graphql_client: DynGraphQLClient,
14289}
14290impl IntoID<Id> for Label {
14291 fn into_id(
14292 self,
14293 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14294 Box::pin(async move { self.id().await })
14295 }
14296}
14297impl Loadable for Label {
14298 fn graphql_type() -> &'static str {
14299 "Label"
14300 }
14301 fn from_query(
14302 proc: Option<Arc<DaggerSessionProc>>,
14303 selection: Selection,
14304 graphql_client: DynGraphQLClient,
14305 ) -> Self {
14306 Self {
14307 proc,
14308 selection,
14309 graphql_client,
14310 }
14311 }
14312}
14313impl Label {
14314 pub async fn id(&self) -> Result<Id, DaggerError> {
14316 let query = self.selection.select("id");
14317 query.execute(self.graphql_client.clone()).await
14318 }
14319 pub async fn name(&self) -> Result<String, DaggerError> {
14321 let query = self.selection.select("name");
14322 query.execute(self.graphql_client.clone()).await
14323 }
14324 pub async fn value(&self) -> Result<String, DaggerError> {
14326 let query = self.selection.select("value");
14327 query.execute(self.graphql_client.clone()).await
14328 }
14329}
14330impl Node for Label {
14331 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14332 let query = self.selection.select("id");
14333 let graphql_client = self.graphql_client.clone();
14334 async move { query.execute(graphql_client).await }
14335 }
14336}
14337#[derive(Clone)]
14338pub struct ListTypeDef {
14339 pub proc: Option<Arc<DaggerSessionProc>>,
14340 pub selection: Selection,
14341 pub graphql_client: DynGraphQLClient,
14342}
14343impl IntoID<Id> for ListTypeDef {
14344 fn into_id(
14345 self,
14346 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14347 Box::pin(async move { self.id().await })
14348 }
14349}
14350impl Loadable for ListTypeDef {
14351 fn graphql_type() -> &'static str {
14352 "ListTypeDef"
14353 }
14354 fn from_query(
14355 proc: Option<Arc<DaggerSessionProc>>,
14356 selection: Selection,
14357 graphql_client: DynGraphQLClient,
14358 ) -> Self {
14359 Self {
14360 proc,
14361 selection,
14362 graphql_client,
14363 }
14364 }
14365}
14366impl ListTypeDef {
14367 pub async fn id(&self) -> Result<Id, DaggerError> {
14369 let query = self.selection.select("id");
14370 query.execute(self.graphql_client.clone()).await
14371 }
14372 pub fn element_type_def(&self) -> TypeDef {
14374 let query = self.selection.select("elementTypeDef");
14375 TypeDef {
14376 proc: self.proc.clone(),
14377 selection: query,
14378 graphql_client: self.graphql_client.clone(),
14379 }
14380 }
14381}
14382impl Node for ListTypeDef {
14383 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14384 let query = self.selection.select("id");
14385 let graphql_client = self.graphql_client.clone();
14386 async move { query.execute(graphql_client).await }
14387 }
14388}
14389#[derive(Clone)]
14390pub struct Module {
14391 pub proc: Option<Arc<DaggerSessionProc>>,
14392 pub selection: Selection,
14393 pub graphql_client: DynGraphQLClient,
14394}
14395#[derive(Builder, Debug, PartialEq)]
14396pub struct ModuleServeOpts {
14397 #[builder(setter(into, strip_option), default)]
14399 pub entrypoint: Option<bool>,
14400 #[builder(setter(into, strip_option), default)]
14402 pub include_dependencies: Option<bool>,
14403}
14404impl IntoID<Id> for Module {
14405 fn into_id(
14406 self,
14407 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14408 Box::pin(async move { self.id().await })
14409 }
14410}
14411impl Loadable for Module {
14412 fn graphql_type() -> &'static str {
14413 "Module"
14414 }
14415 fn from_query(
14416 proc: Option<Arc<DaggerSessionProc>>,
14417 selection: Selection,
14418 graphql_client: DynGraphQLClient,
14419 ) -> Self {
14420 Self {
14421 proc,
14422 selection,
14423 graphql_client,
14424 }
14425 }
14426}
14427impl Module {
14428 pub async fn id(&self) -> Result<Id, DaggerError> {
14430 let query = self.selection.select("id");
14431 query.execute(self.graphql_client.clone()).await
14432 }
14433 pub async fn context_source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14435 let query = self.selection.select("contextSource");
14436 let query = query.select("id");
14437 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14438 Ok(id.map(|id| ModuleSource {
14439 proc: self.proc.clone(),
14440 selection: query
14441 .root()
14442 .select("node")
14443 .arg("id", &id.0)
14444 .inline_fragment("ModuleSource"),
14445 graphql_client: self.graphql_client.clone(),
14446 }))
14447 }
14448 pub async fn sync(&self) -> Result<Module, DaggerError> {
14450 let query = self.selection.select("sync");
14451 let id: Id = query.execute(self.graphql_client.clone()).await?;
14452 Ok(Module {
14453 proc: self.proc.clone(),
14454 selection: query
14455 .root()
14456 .select("node")
14457 .arg("id", &id.0)
14458 .inline_fragment("Module"),
14459 graphql_client: self.graphql_client.clone(),
14460 })
14461 }
14462 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
14464 let query = self.selection.select("dependencies");
14465 let query = query.select("id");
14466 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14467 Ok(ids
14468 .into_iter()
14469 .map(|id| Module {
14470 proc: self.proc.clone(),
14471 selection: crate::querybuilder::query()
14472 .select("node")
14473 .arg("id", &id.0)
14474 .inline_fragment("Module"),
14475 graphql_client: self.graphql_client.clone(),
14476 })
14477 .collect())
14478 }
14479 pub fn introspection_schema_json(&self) -> File {
14483 let query = self.selection.select("introspectionSchemaJSON");
14484 File {
14485 proc: self.proc.clone(),
14486 selection: query,
14487 graphql_client: self.graphql_client.clone(),
14488 }
14489 }
14490 pub fn generated_context_directory(&self) -> Directory {
14492 let query = self.selection.select("generatedContextDirectory");
14493 Directory {
14494 proc: self.proc.clone(),
14495 selection: query,
14496 graphql_client: self.graphql_client.clone(),
14497 }
14498 }
14499 pub fn user_defaults(&self) -> EnvFile {
14501 let query = self.selection.select("userDefaults");
14502 EnvFile {
14503 proc: self.proc.clone(),
14504 selection: query,
14505 graphql_client: self.graphql_client.clone(),
14506 }
14507 }
14508 pub fn with_description(&self, description: impl Into<String>) -> Module {
14514 let mut query = self.selection.select("withDescription");
14515 query = query.arg("description", description.into());
14516 Module {
14517 proc: self.proc.clone(),
14518 selection: query,
14519 graphql_client: self.graphql_client.clone(),
14520 }
14521 }
14522 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
14524 let mut query = self.selection.select("withObject");
14525 query = query.arg_lazy(
14526 "object",
14527 Box::new(move || {
14528 let object = object.clone();
14529 Box::pin(async move { object.into_id().await.unwrap().quote() })
14530 }),
14531 );
14532 Module {
14533 proc: self.proc.clone(),
14534 selection: query,
14535 graphql_client: self.graphql_client.clone(),
14536 }
14537 }
14538 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
14540 let mut query = self.selection.select("withInterface");
14541 query = query.arg_lazy(
14542 "iface",
14543 Box::new(move || {
14544 let iface = iface.clone();
14545 Box::pin(async move { iface.into_id().await.unwrap().quote() })
14546 }),
14547 );
14548 Module {
14549 proc: self.proc.clone(),
14550 selection: query,
14551 graphql_client: self.graphql_client.clone(),
14552 }
14553 }
14554 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
14556 let mut query = self.selection.select("withEnum");
14557 query = query.arg_lazy(
14558 "enum",
14559 Box::new(move || {
14560 let r#enum = r#enum.clone();
14561 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
14562 }),
14563 );
14564 Module {
14565 proc: self.proc.clone(),
14566 selection: query,
14567 graphql_client: self.graphql_client.clone(),
14568 }
14569 }
14570 pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
14572 let query = self.selection.select("runtime");
14573 let query = query.select("id");
14574 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14575 Ok(id.map(|id| Container {
14576 proc: self.proc.clone(),
14577 selection: query
14578 .root()
14579 .select("node")
14580 .arg("id", &id.0)
14581 .inline_fragment("Container"),
14582 graphql_client: self.graphql_client.clone(),
14583 }))
14584 }
14585 pub async fn serve(&self) -> Result<Void, DaggerError> {
14592 let query = self.selection.select("serve");
14593 query.execute(self.graphql_client.clone()).await
14594 }
14595 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
14602 let mut query = self.selection.select("serve");
14603 if let Some(include_dependencies) = opts.include_dependencies {
14604 query = query.arg("includeDependencies", include_dependencies);
14605 }
14606 if let Some(entrypoint) = opts.entrypoint {
14607 query = query.arg("entrypoint", entrypoint);
14608 }
14609 query.execute(self.graphql_client.clone()).await
14610 }
14611 pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14613 let query = self.selection.select("source");
14614 let query = query.select("id");
14615 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14616 Ok(id.map(|id| ModuleSource {
14617 proc: self.proc.clone(),
14618 selection: query
14619 .root()
14620 .select("node")
14621 .arg("id", &id.0)
14622 .inline_fragment("ModuleSource"),
14623 graphql_client: self.graphql_client.clone(),
14624 }))
14625 }
14626 pub async fn name(&self) -> Result<String, DaggerError> {
14628 let query = self.selection.select("name");
14629 query.execute(self.graphql_client.clone()).await
14630 }
14631 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
14633 let query = self.selection.select("sdk");
14634 let query = query.select("id");
14635 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14636 Ok(id.map(|id| SdkConfig {
14637 proc: self.proc.clone(),
14638 selection: query
14639 .root()
14640 .select("node")
14641 .arg("id", &id.0)
14642 .inline_fragment("SDKConfig"),
14643 graphql_client: self.graphql_client.clone(),
14644 }))
14645 }
14646 pub async fn description(&self) -> Result<String, DaggerError> {
14648 let query = self.selection.select("description");
14649 query.execute(self.graphql_client.clone()).await
14650 }
14651 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
14653 let query = self.selection.select("objects");
14654 let query = query.select("id");
14655 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14656 Ok(ids
14657 .into_iter()
14658 .map(|id| TypeDef {
14659 proc: self.proc.clone(),
14660 selection: crate::querybuilder::query()
14661 .select("node")
14662 .arg("id", &id.0)
14663 .inline_fragment("TypeDef"),
14664 graphql_client: self.graphql_client.clone(),
14665 })
14666 .collect())
14667 }
14668 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
14670 let query = self.selection.select("interfaces");
14671 let query = query.select("id");
14672 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14673 Ok(ids
14674 .into_iter()
14675 .map(|id| TypeDef {
14676 proc: self.proc.clone(),
14677 selection: crate::querybuilder::query()
14678 .select("node")
14679 .arg("id", &id.0)
14680 .inline_fragment("TypeDef"),
14681 graphql_client: self.graphql_client.clone(),
14682 })
14683 .collect())
14684 }
14685 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
14687 let query = self.selection.select("enums");
14688 let query = query.select("id");
14689 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14690 Ok(ids
14691 .into_iter()
14692 .map(|id| TypeDef {
14693 proc: self.proc.clone(),
14694 selection: crate::querybuilder::query()
14695 .select("node")
14696 .arg("id", &id.0)
14697 .inline_fragment("TypeDef"),
14698 graphql_client: self.graphql_client.clone(),
14699 })
14700 .collect())
14701 }
14702}
14703impl Node for Module {
14704 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14705 let query = self.selection.select("id");
14706 let graphql_client = self.graphql_client.clone();
14707 async move { query.execute(graphql_client).await }
14708 }
14709}
14710impl Syncer for Module {
14711 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14712 let query = self.selection.select("id");
14713 let graphql_client = self.graphql_client.clone();
14714 async move { query.execute(graphql_client).await }
14715 }
14716 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
14717 let query = self.selection.select("sync");
14718 let proc = self.proc.clone();
14719 let graphql_client = self.graphql_client.clone();
14720 async move {
14721 let id: Id = query.execute(graphql_client.clone()).await?;
14722 Ok(Self {
14723 proc,
14724 selection: query
14725 .root()
14726 .select("node")
14727 .arg("id", &id.0)
14728 .inline_fragment("Module"),
14729 graphql_client,
14730 })
14731 }
14732 }
14733}
14734#[derive(Clone)]
14735pub struct ModuleConfigClient {
14736 pub proc: Option<Arc<DaggerSessionProc>>,
14737 pub selection: Selection,
14738 pub graphql_client: DynGraphQLClient,
14739}
14740impl IntoID<Id> for ModuleConfigClient {
14741 fn into_id(
14742 self,
14743 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14744 Box::pin(async move { self.id().await })
14745 }
14746}
14747impl Loadable for ModuleConfigClient {
14748 fn graphql_type() -> &'static str {
14749 "ModuleConfigClient"
14750 }
14751 fn from_query(
14752 proc: Option<Arc<DaggerSessionProc>>,
14753 selection: Selection,
14754 graphql_client: DynGraphQLClient,
14755 ) -> Self {
14756 Self {
14757 proc,
14758 selection,
14759 graphql_client,
14760 }
14761 }
14762}
14763impl ModuleConfigClient {
14764 pub async fn id(&self) -> Result<Id, DaggerError> {
14766 let query = self.selection.select("id");
14767 query.execute(self.graphql_client.clone()).await
14768 }
14769 pub async fn generator(&self) -> Result<String, DaggerError> {
14771 let query = self.selection.select("generator");
14772 query.execute(self.graphql_client.clone()).await
14773 }
14774 pub async fn directory(&self) -> Result<String, DaggerError> {
14776 let query = self.selection.select("directory");
14777 query.execute(self.graphql_client.clone()).await
14778 }
14779}
14780impl Node for ModuleConfigClient {
14781 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14782 let query = self.selection.select("id");
14783 let graphql_client = self.graphql_client.clone();
14784 async move { query.execute(graphql_client).await }
14785 }
14786}
14787#[derive(Clone)]
14788pub struct ModuleSource {
14789 pub proc: Option<Arc<DaggerSessionProc>>,
14790 pub selection: Selection,
14791 pub graphql_client: DynGraphQLClient,
14792}
14793impl IntoID<Id> for ModuleSource {
14794 fn into_id(
14795 self,
14796 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14797 Box::pin(async move { self.id().await })
14798 }
14799}
14800impl Loadable for ModuleSource {
14801 fn graphql_type() -> &'static str {
14802 "ModuleSource"
14803 }
14804 fn from_query(
14805 proc: Option<Arc<DaggerSessionProc>>,
14806 selection: Selection,
14807 graphql_client: DynGraphQLClient,
14808 ) -> Self {
14809 Self {
14810 proc,
14811 selection,
14812 graphql_client,
14813 }
14814 }
14815}
14816impl ModuleSource {
14817 pub async fn id(&self) -> Result<Id, DaggerError> {
14819 let query = self.selection.select("id");
14820 query.execute(self.graphql_client.clone()).await
14821 }
14822 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
14824 let query = self.selection.select("sync");
14825 let id: Id = query.execute(self.graphql_client.clone()).await?;
14826 Ok(ModuleSource {
14827 proc: self.proc.clone(),
14828 selection: query
14829 .root()
14830 .select("node")
14831 .arg("id", &id.0)
14832 .inline_fragment("ModuleSource"),
14833 graphql_client: self.graphql_client.clone(),
14834 })
14835 }
14836 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
14838 let query = self.selection.select("sourceSubpath");
14839 query.execute(self.graphql_client.clone()).await
14840 }
14841 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
14843 let query = self.selection.select("originalSubpath");
14844 query.execute(self.graphql_client.clone()).await
14845 }
14846 pub async fn digest(&self) -> Result<String, DaggerError> {
14848 let query = self.selection.select("digest");
14849 query.execute(self.graphql_client.clone()).await
14850 }
14851 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
14857 let mut query = self.selection.select("withSourceSubpath");
14858 query = query.arg("path", path.into());
14859 ModuleSource {
14860 proc: self.proc.clone(),
14861 selection: query,
14862 graphql_client: self.graphql_client.clone(),
14863 }
14864 }
14865 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
14871 let mut query = self.selection.select("withName");
14872 query = query.arg("name", name.into());
14873 ModuleSource {
14874 proc: self.proc.clone(),
14875 selection: query,
14876 graphql_client: self.graphql_client.clone(),
14877 }
14878 }
14879 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
14885 let mut query = self.selection.select("withIncludes");
14886 query = query.arg(
14887 "patterns",
14888 patterns
14889 .into_iter()
14890 .map(|i| i.into())
14891 .collect::<Vec<String>>(),
14892 );
14893 ModuleSource {
14894 proc: self.proc.clone(),
14895 selection: query,
14896 graphql_client: self.graphql_client.clone(),
14897 }
14898 }
14899 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
14905 let mut query = self.selection.select("withSDK");
14906 query = query.arg("source", source.into());
14907 ModuleSource {
14908 proc: self.proc.clone(),
14909 selection: query,
14910 graphql_client: self.graphql_client.clone(),
14911 }
14912 }
14913 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
14919 let mut query = self.selection.select("withEngineVersion");
14920 query = query.arg("version", version.into());
14921 ModuleSource {
14922 proc: self.proc.clone(),
14923 selection: query,
14924 graphql_client: self.graphql_client.clone(),
14925 }
14926 }
14927 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
14933 let mut query = self.selection.select("withDependencies");
14934 query = query.arg("dependencies", dependencies);
14935 ModuleSource {
14936 proc: self.proc.clone(),
14937 selection: query,
14938 graphql_client: self.graphql_client.clone(),
14939 }
14940 }
14941 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14947 let mut query = self.selection.select("withUpdateDependencies");
14948 query = query.arg(
14949 "dependencies",
14950 dependencies
14951 .into_iter()
14952 .map(|i| i.into())
14953 .collect::<Vec<String>>(),
14954 );
14955 ModuleSource {
14956 proc: self.proc.clone(),
14957 selection: query,
14958 graphql_client: self.graphql_client.clone(),
14959 }
14960 }
14961 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14967 let mut query = self.selection.select("withoutDependencies");
14968 query = query.arg(
14969 "dependencies",
14970 dependencies
14971 .into_iter()
14972 .map(|i| i.into())
14973 .collect::<Vec<String>>(),
14974 );
14975 ModuleSource {
14976 proc: self.proc.clone(),
14977 selection: query,
14978 graphql_client: self.graphql_client.clone(),
14979 }
14980 }
14981 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
14987 let mut query = self.selection.select("withBlueprint");
14988 query = query.arg_lazy(
14989 "blueprint",
14990 Box::new(move || {
14991 let blueprint = blueprint.clone();
14992 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
14993 }),
14994 );
14995 ModuleSource {
14996 proc: self.proc.clone(),
14997 selection: query,
14998 graphql_client: self.graphql_client.clone(),
14999 }
15000 }
15001 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
15007 let mut query = self.selection.select("withToolchains");
15008 query = query.arg("toolchains", toolchains);
15009 ModuleSource {
15010 proc: self.proc.clone(),
15011 selection: query,
15012 graphql_client: self.graphql_client.clone(),
15013 }
15014 }
15015 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
15021 let mut query = self.selection.select("withUpdateToolchains");
15022 query = query.arg(
15023 "toolchains",
15024 toolchains
15025 .into_iter()
15026 .map(|i| i.into())
15027 .collect::<Vec<String>>(),
15028 );
15029 ModuleSource {
15030 proc: self.proc.clone(),
15031 selection: query,
15032 graphql_client: self.graphql_client.clone(),
15033 }
15034 }
15035 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
15041 let mut query = self.selection.select("withoutToolchains");
15042 query = query.arg(
15043 "toolchains",
15044 toolchains
15045 .into_iter()
15046 .map(|i| i.into())
15047 .collect::<Vec<String>>(),
15048 );
15049 ModuleSource {
15050 proc: self.proc.clone(),
15051 selection: query,
15052 graphql_client: self.graphql_client.clone(),
15053 }
15054 }
15055 pub fn with_update_blueprint(&self) -> ModuleSource {
15057 let query = self.selection.select("withUpdateBlueprint");
15058 ModuleSource {
15059 proc: self.proc.clone(),
15060 selection: query,
15061 graphql_client: self.graphql_client.clone(),
15062 }
15063 }
15064 pub fn without_blueprint(&self) -> ModuleSource {
15066 let query = self.selection.select("withoutBlueprint");
15067 ModuleSource {
15068 proc: self.proc.clone(),
15069 selection: query,
15070 graphql_client: self.graphql_client.clone(),
15071 }
15072 }
15073 pub fn with_experimental_features(
15079 &self,
15080 features: Vec<ModuleSourceExperimentalFeature>,
15081 ) -> ModuleSource {
15082 let mut query = self.selection.select("withExperimentalFeatures");
15083 query = query.arg("features", features);
15084 ModuleSource {
15085 proc: self.proc.clone(),
15086 selection: query,
15087 graphql_client: self.graphql_client.clone(),
15088 }
15089 }
15090 pub fn without_experimental_features(
15096 &self,
15097 features: Vec<ModuleSourceExperimentalFeature>,
15098 ) -> ModuleSource {
15099 let mut query = self.selection.select("withoutExperimentalFeatures");
15100 query = query.arg("features", features);
15101 ModuleSource {
15102 proc: self.proc.clone(),
15103 selection: query,
15104 graphql_client: self.graphql_client.clone(),
15105 }
15106 }
15107 pub fn generated_context_directory(&self) -> Directory {
15109 let query = self.selection.select("generatedContextDirectory");
15110 Directory {
15111 proc: self.proc.clone(),
15112 selection: query,
15113 graphql_client: self.graphql_client.clone(),
15114 }
15115 }
15116 pub fn updated_config_directory(&self) -> Directory {
15119 let query = self.selection.select("updatedConfigDirectory");
15120 Directory {
15121 proc: self.proc.clone(),
15122 selection: query,
15123 graphql_client: self.graphql_client.clone(),
15124 }
15125 }
15126 pub fn generated_context_changeset(&self) -> Changeset {
15128 let query = self.selection.select("generatedContextChangeset");
15129 Changeset {
15130 proc: self.proc.clone(),
15131 selection: query,
15132 graphql_client: self.graphql_client.clone(),
15133 }
15134 }
15135 pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
15142 let mut query = self.selection.select("generate");
15143 query = query.arg_lazy(
15144 "workspace",
15145 Box::new(move || {
15146 let workspace = workspace.clone();
15147 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
15148 }),
15149 );
15150 Workspace {
15151 proc: self.proc.clone(),
15152 selection: query,
15153 graphql_client: self.graphql_client.clone(),
15154 }
15155 }
15156 pub async fn as_string(&self) -> Result<String, DaggerError> {
15158 let query = self.selection.select("asString");
15159 query.execute(self.graphql_client.clone()).await
15160 }
15161 pub async fn pin(&self) -> Result<String, DaggerError> {
15163 let query = self.selection.select("pin");
15164 query.execute(self.graphql_client.clone()).await
15165 }
15166 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
15168 let query = self.selection.select("localContextDirectoryPath");
15169 query.execute(self.graphql_client.clone()).await
15170 }
15171 pub fn as_module(&self) -> Module {
15173 let query = self.selection.select("asModule");
15174 Module {
15175 proc: self.proc.clone(),
15176 selection: query,
15177 graphql_client: self.graphql_client.clone(),
15178 }
15179 }
15180 pub fn introspection_schema_json(&self) -> File {
15184 let query = self.selection.select("introspectionSchemaJSON");
15185 File {
15186 proc: self.proc.clone(),
15187 selection: query,
15188 graphql_client: self.graphql_client.clone(),
15189 }
15190 }
15191 pub fn client_schema_introspection_json(&self) -> File {
15194 let query = self.selection.select("clientSchemaIntrospectionJSON");
15195 File {
15196 proc: self.proc.clone(),
15197 selection: query,
15198 graphql_client: self.graphql_client.clone(),
15199 }
15200 }
15201 pub fn directory(&self, path: impl Into<String>) -> Directory {
15207 let mut query = self.selection.select("directory");
15208 query = query.arg("path", path.into());
15209 Directory {
15210 proc: self.proc.clone(),
15211 selection: query,
15212 graphql_client: self.graphql_client.clone(),
15213 }
15214 }
15215 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
15217 let query = self.selection.select("cloneRef");
15218 query.execute(self.graphql_client.clone()).await
15219 }
15220 pub async fn html_url(&self) -> Result<String, DaggerError> {
15222 let query = self.selection.select("htmlURL");
15223 query.execute(self.graphql_client.clone()).await
15224 }
15225 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
15227 let query = self.selection.select("htmlRepoURL");
15228 query.execute(self.graphql_client.clone()).await
15229 }
15230 pub async fn version(&self) -> Result<String, DaggerError> {
15232 let query = self.selection.select("version");
15233 query.execute(self.graphql_client.clone()).await
15234 }
15235 pub async fn commit(&self) -> Result<String, DaggerError> {
15237 let query = self.selection.select("commit");
15238 query.execute(self.graphql_client.clone()).await
15239 }
15240 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
15242 let query = self.selection.select("repoRootPath");
15243 query.execute(self.graphql_client.clone()).await
15244 }
15245 pub fn with_client(
15252 &self,
15253 generator: impl Into<String>,
15254 output_dir: impl Into<String>,
15255 ) -> ModuleSource {
15256 let mut query = self.selection.select("withClient");
15257 query = query.arg("generator", generator.into());
15258 query = query.arg("outputDir", output_dir.into());
15259 ModuleSource {
15260 proc: self.proc.clone(),
15261 selection: query,
15262 graphql_client: self.graphql_client.clone(),
15263 }
15264 }
15265 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
15271 let mut query = self.selection.select("withUpdatedClients");
15272 query = query.arg(
15273 "clients",
15274 clients
15275 .into_iter()
15276 .map(|i| i.into())
15277 .collect::<Vec<String>>(),
15278 );
15279 ModuleSource {
15280 proc: self.proc.clone(),
15281 selection: query,
15282 graphql_client: self.graphql_client.clone(),
15283 }
15284 }
15285 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
15291 let mut query = self.selection.select("withoutClient");
15292 query = query.arg("path", path.into());
15293 ModuleSource {
15294 proc: self.proc.clone(),
15295 selection: query,
15296 graphql_client: self.graphql_client.clone(),
15297 }
15298 }
15299 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
15301 let query = self.selection.select("configExists");
15302 query.execute(self.graphql_client.clone()).await
15303 }
15304 pub async fn module_name(&self) -> Result<String, DaggerError> {
15306 let query = self.selection.select("moduleName");
15307 query.execute(self.graphql_client.clone()).await
15308 }
15309 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
15311 let query = self.selection.select("moduleOriginalName");
15312 query.execute(self.graphql_client.clone()).await
15313 }
15314 pub async fn engine_version(&self) -> Result<String, DaggerError> {
15316 let query = self.selection.select("engineVersion");
15317 query.execute(self.graphql_client.clone()).await
15318 }
15319 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
15321 let query = self.selection.select("sdk");
15322 let query = query.select("id");
15323 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15324 Ok(id.map(|id| SdkConfig {
15325 proc: self.proc.clone(),
15326 selection: query
15327 .root()
15328 .select("node")
15329 .arg("id", &id.0)
15330 .inline_fragment("SDKConfig"),
15331 graphql_client: self.graphql_client.clone(),
15332 }))
15333 }
15334 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15336 let query = self.selection.select("dependencies");
15337 let query = query.select("id");
15338 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15339 Ok(ids
15340 .into_iter()
15341 .map(|id| ModuleSource {
15342 proc: self.proc.clone(),
15343 selection: crate::querybuilder::query()
15344 .select("node")
15345 .arg("id", &id.0)
15346 .inline_fragment("ModuleSource"),
15347 graphql_client: self.graphql_client.clone(),
15348 })
15349 .collect())
15350 }
15351 pub fn blueprint(&self) -> ModuleSource {
15353 let query = self.selection.select("blueprint");
15354 ModuleSource {
15355 proc: self.proc.clone(),
15356 selection: query,
15357 graphql_client: self.graphql_client.clone(),
15358 }
15359 }
15360 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15362 let query = self.selection.select("toolchains");
15363 let query = query.select("id");
15364 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15365 Ok(ids
15366 .into_iter()
15367 .map(|id| ModuleSource {
15368 proc: self.proc.clone(),
15369 selection: crate::querybuilder::query()
15370 .select("node")
15371 .arg("id", &id.0)
15372 .inline_fragment("ModuleSource"),
15373 graphql_client: self.graphql_client.clone(),
15374 })
15375 .collect())
15376 }
15377 pub fn user_defaults(&self) -> EnvFile {
15379 let query = self.selection.select("userDefaults");
15380 EnvFile {
15381 proc: self.proc.clone(),
15382 selection: query,
15383 graphql_client: self.graphql_client.clone(),
15384 }
15385 }
15386 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
15388 let query = self.selection.select("configClients");
15389 let query = query.select("id");
15390 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15391 Ok(ids
15392 .into_iter()
15393 .map(|id| ModuleConfigClient {
15394 proc: self.proc.clone(),
15395 selection: crate::querybuilder::query()
15396 .select("node")
15397 .arg("id", &id.0)
15398 .inline_fragment("ModuleConfigClient"),
15399 graphql_client: self.graphql_client.clone(),
15400 })
15401 .collect())
15402 }
15403 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
15405 let query = self.selection.select("sourceRootSubpath");
15406 query.execute(self.graphql_client.clone()).await
15407 }
15408 pub fn context_directory(&self) -> Directory {
15410 let query = self.selection.select("contextDirectory");
15411 Directory {
15412 proc: self.proc.clone(),
15413 selection: query,
15414 graphql_client: self.graphql_client.clone(),
15415 }
15416 }
15417 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
15419 let query = self.selection.select("kind");
15420 query.execute(self.graphql_client.clone()).await
15421 }
15422}
15423impl Node for ModuleSource {
15424 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15425 let query = self.selection.select("id");
15426 let graphql_client = self.graphql_client.clone();
15427 async move { query.execute(graphql_client).await }
15428 }
15429}
15430impl Syncer for ModuleSource {
15431 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15432 let query = self.selection.select("id");
15433 let graphql_client = self.graphql_client.clone();
15434 async move { query.execute(graphql_client).await }
15435 }
15436 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15437 let query = self.selection.select("sync");
15438 let proc = self.proc.clone();
15439 let graphql_client = self.graphql_client.clone();
15440 async move {
15441 let id: Id = query.execute(graphql_client.clone()).await?;
15442 Ok(Self {
15443 proc,
15444 selection: query
15445 .root()
15446 .select("node")
15447 .arg("id", &id.0)
15448 .inline_fragment("ModuleSource"),
15449 graphql_client,
15450 })
15451 }
15452 }
15453}
15454#[derive(Clone)]
15455pub struct NamingTerm {
15456 pub proc: Option<Arc<DaggerSessionProc>>,
15457 pub selection: Selection,
15458 pub graphql_client: DynGraphQLClient,
15459}
15460impl IntoID<Id> for NamingTerm {
15461 fn into_id(
15462 self,
15463 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15464 Box::pin(async move { self.id().await })
15465 }
15466}
15467impl Loadable for NamingTerm {
15468 fn graphql_type() -> &'static str {
15469 "NamingTerm"
15470 }
15471 fn from_query(
15472 proc: Option<Arc<DaggerSessionProc>>,
15473 selection: Selection,
15474 graphql_client: DynGraphQLClient,
15475 ) -> Self {
15476 Self {
15477 proc,
15478 selection,
15479 graphql_client,
15480 }
15481 }
15482}
15483impl NamingTerm {
15484 pub async fn id(&self) -> Result<Id, DaggerError> {
15486 let query = self.selection.select("id");
15487 query.execute(self.graphql_client.clone()).await
15488 }
15489 pub async fn spelling(&self) -> Result<String, DaggerError> {
15491 let query = self.selection.select("spelling");
15492 query.execute(self.graphql_client.clone()).await
15493 }
15494 pub async fn capitalized(&self) -> Result<String, DaggerError> {
15496 let query = self.selection.select("capitalized");
15497 query.execute(self.graphql_client.clone()).await
15498 }
15499}
15500impl Node for NamingTerm {
15501 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15502 let query = self.selection.select("id");
15503 let graphql_client = self.graphql_client.clone();
15504 async move { query.execute(graphql_client).await }
15505 }
15506}
15507#[derive(Clone)]
15508pub struct ObjectTypeDef {
15509 pub proc: Option<Arc<DaggerSessionProc>>,
15510 pub selection: Selection,
15511 pub graphql_client: DynGraphQLClient,
15512}
15513impl IntoID<Id> for ObjectTypeDef {
15514 fn into_id(
15515 self,
15516 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15517 Box::pin(async move { self.id().await })
15518 }
15519}
15520impl Loadable for ObjectTypeDef {
15521 fn graphql_type() -> &'static str {
15522 "ObjectTypeDef"
15523 }
15524 fn from_query(
15525 proc: Option<Arc<DaggerSessionProc>>,
15526 selection: Selection,
15527 graphql_client: DynGraphQLClient,
15528 ) -> Self {
15529 Self {
15530 proc,
15531 selection,
15532 graphql_client,
15533 }
15534 }
15535}
15536impl ObjectTypeDef {
15537 pub async fn id(&self) -> Result<Id, DaggerError> {
15539 let query = self.selection.select("id");
15540 query.execute(self.graphql_client.clone()).await
15541 }
15542 pub async fn name(&self) -> Result<String, DaggerError> {
15544 let query = self.selection.select("name");
15545 query.execute(self.graphql_client.clone()).await
15546 }
15547 pub async fn description(&self) -> Result<String, DaggerError> {
15549 let query = self.selection.select("description");
15550 query.execute(self.graphql_client.clone()).await
15551 }
15552 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
15554 let query = self.selection.select("sourceMap");
15555 let query = query.select("id");
15556 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15557 Ok(id.map(|id| SourceMap {
15558 proc: self.proc.clone(),
15559 selection: query
15560 .root()
15561 .select("node")
15562 .arg("id", &id.0)
15563 .inline_fragment("SourceMap"),
15564 graphql_client: self.graphql_client.clone(),
15565 }))
15566 }
15567 pub async fn deprecated(&self) -> Result<String, DaggerError> {
15569 let query = self.selection.select("deprecated");
15570 query.execute(self.graphql_client.clone()).await
15571 }
15572 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15574 let query = self.selection.select("sourceModuleName");
15575 query.execute(self.graphql_client.clone()).await
15576 }
15577 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
15579 let query = self.selection.select("fields");
15580 let query = query.select("id");
15581 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15582 Ok(ids
15583 .into_iter()
15584 .map(|id| FieldTypeDef {
15585 proc: self.proc.clone(),
15586 selection: crate::querybuilder::query()
15587 .select("node")
15588 .arg("id", &id.0)
15589 .inline_fragment("FieldTypeDef"),
15590 graphql_client: self.graphql_client.clone(),
15591 })
15592 .collect())
15593 }
15594 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
15596 let query = self.selection.select("functions");
15597 let query = query.select("id");
15598 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15599 Ok(ids
15600 .into_iter()
15601 .map(|id| Function {
15602 proc: self.proc.clone(),
15603 selection: crate::querybuilder::query()
15604 .select("node")
15605 .arg("id", &id.0)
15606 .inline_fragment("Function"),
15607 graphql_client: self.graphql_client.clone(),
15608 })
15609 .collect())
15610 }
15611 pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
15613 let query = self.selection.select("constructor");
15614 let query = query.select("id");
15615 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15616 Ok(id.map(|id| Function {
15617 proc: self.proc.clone(),
15618 selection: query
15619 .root()
15620 .select("node")
15621 .arg("id", &id.0)
15622 .inline_fragment("Function"),
15623 graphql_client: self.graphql_client.clone(),
15624 }))
15625 }
15626}
15627impl Node for ObjectTypeDef {
15628 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15629 let query = self.selection.select("id");
15630 let graphql_client = self.graphql_client.clone();
15631 async move { query.execute(graphql_client).await }
15632 }
15633}
15634#[derive(Clone)]
15635pub struct Port {
15636 pub proc: Option<Arc<DaggerSessionProc>>,
15637 pub selection: Selection,
15638 pub graphql_client: DynGraphQLClient,
15639}
15640impl IntoID<Id> for Port {
15641 fn into_id(
15642 self,
15643 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15644 Box::pin(async move { self.id().await })
15645 }
15646}
15647impl Loadable for Port {
15648 fn graphql_type() -> &'static str {
15649 "Port"
15650 }
15651 fn from_query(
15652 proc: Option<Arc<DaggerSessionProc>>,
15653 selection: Selection,
15654 graphql_client: DynGraphQLClient,
15655 ) -> Self {
15656 Self {
15657 proc,
15658 selection,
15659 graphql_client,
15660 }
15661 }
15662}
15663impl Port {
15664 pub async fn id(&self) -> Result<Id, DaggerError> {
15666 let query = self.selection.select("id");
15667 query.execute(self.graphql_client.clone()).await
15668 }
15669 pub async fn port(&self) -> Result<isize, DaggerError> {
15671 let query = self.selection.select("port");
15672 query.execute(self.graphql_client.clone()).await
15673 }
15674 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
15676 let query = self.selection.select("protocol");
15677 query.execute(self.graphql_client.clone()).await
15678 }
15679 pub async fn description(&self) -> Result<String, DaggerError> {
15681 let query = self.selection.select("description");
15682 query.execute(self.graphql_client.clone()).await
15683 }
15684 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
15686 let query = self.selection.select("experimentalSkipHealthcheck");
15687 query.execute(self.graphql_client.clone()).await
15688 }
15689}
15690impl Node for Port {
15691 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15692 let query = self.selection.select("id");
15693 let graphql_client = self.graphql_client.clone();
15694 async move { query.execute(graphql_client).await }
15695 }
15696}
15697#[derive(Clone)]
15698pub struct Query {
15699 pub proc: Option<Arc<DaggerSessionProc>>,
15700 pub selection: Selection,
15701 pub graphql_client: DynGraphQLClient,
15702}
15703#[derive(Builder, Debug, PartialEq)]
15704pub struct QueryFileOpts {
15705 #[builder(setter(into, strip_option), default)]
15707 pub permissions: Option<isize>,
15708}
15709#[derive(Builder, Debug, PartialEq)]
15710pub struct QueryBlobOpts {
15711 #[builder(setter(into, strip_option), default)]
15713 pub permissions: Option<isize>,
15714}
15715#[derive(Builder, Debug, PartialEq)]
15716pub struct QueryGitOpts<'a> {
15717 #[builder(setter(into, strip_option), default)]
15719 pub experimental_service_host: Option<Id>,
15720 #[builder(setter(into, strip_option), default)]
15722 pub http_auth_header: Option<Id>,
15723 #[builder(setter(into, strip_option), default)]
15725 pub http_auth_token: Option<Id>,
15726 #[builder(setter(into, strip_option), default)]
15728 pub http_auth_username: Option<&'a str>,
15729 #[builder(setter(into, strip_option), default)]
15731 pub keep_git_dir: Option<bool>,
15732 #[builder(setter(into, strip_option), default)]
15734 pub ssh_auth_socket: Option<Id>,
15735 #[builder(setter(into, strip_option), default)]
15737 pub ssh_known_hosts: Option<&'a str>,
15738}
15739#[derive(Builder, Debug, PartialEq)]
15740pub struct QueryContainerOpts {
15741 #[builder(setter(into, strip_option), default)]
15743 pub platform: Option<Platform>,
15744}
15745#[derive(Builder, Debug, PartialEq)]
15746pub struct QueryCacheVolumeOpts<'a> {
15747 #[builder(setter(into, strip_option), default)]
15751 pub owner: Option<&'a str>,
15752 #[builder(setter(into, strip_option), default)]
15754 pub sharing: Option<CacheSharingMode>,
15755 #[builder(setter(into, strip_option), default)]
15757 pub source: Option<Id>,
15758}
15759#[derive(Builder, Debug, PartialEq)]
15760pub struct QueryEngineVolumeOpts<'a> {
15761 #[builder(setter(into, strip_option), default)]
15763 pub subdir: Option<&'a str>,
15764}
15765#[derive(Builder, Debug, PartialEq)]
15766pub struct QuerySshfsVolumeOpts<'a> {
15767 #[builder(setter(into, strip_option), default)]
15769 pub cache_key: Option<&'a str>,
15770 #[builder(setter(into, strip_option), default)]
15772 pub experimental_service_host: Option<Id>,
15773 #[builder(setter(into, strip_option), default)]
15775 pub insecure_skip_host_key_check: Option<bool>,
15776 #[builder(setter(into, strip_option), default)]
15778 pub known_hosts: Option<Id>,
15779}
15780#[derive(Builder, Debug, PartialEq)]
15781pub struct QuerySecretOpts<'a> {
15782 #[builder(setter(into, strip_option), default)]
15786 pub cache_key: Option<&'a str>,
15787}
15788#[derive(Builder, Debug, PartialEq)]
15789pub struct QueryHttpOpts<'a> {
15790 #[builder(setter(into, strip_option), default)]
15792 pub auth_header: Option<Id>,
15793 #[builder(setter(into, strip_option), default)]
15795 pub checksum: Option<&'a str>,
15796 #[builder(setter(into, strip_option), default)]
15798 pub experimental_service_host: Option<Id>,
15799 #[builder(setter(into, strip_option), default)]
15801 pub name: Option<&'a str>,
15802 #[builder(setter(into, strip_option), default)]
15804 pub permissions: Option<isize>,
15805}
15806#[derive(Builder, Debug, PartialEq)]
15807pub struct QueryModuleSourceOpts<'a> {
15808 #[builder(setter(into, strip_option), default)]
15810 pub allow_not_exists: Option<bool>,
15811 #[builder(setter(into, strip_option), default)]
15813 pub disable_find_up: Option<bool>,
15814 #[builder(setter(into, strip_option), default)]
15816 pub ref_pin: Option<&'a str>,
15817 #[builder(setter(into, strip_option), default)]
15819 pub require_kind: Option<ModuleSourceKind>,
15820 #[builder(setter(into, strip_option), default)]
15822 pub version: Option<&'a str>,
15823}
15824#[derive(Builder, Debug, PartialEq)]
15825pub struct QueryCurrentTypeDefsOpts {
15826 #[builder(setter(into, strip_option), default)]
15829 pub hide_core: Option<bool>,
15830 #[builder(setter(into, strip_option), default)]
15832 pub return_all_types: Option<bool>,
15833}
15834#[derive(Builder, Debug, PartialEq)]
15835pub struct QueryServeModuleOpts<'a> {
15836 #[builder(setter(into, strip_option), default)]
15838 pub ref_pin: Option<&'a str>,
15839}
15840#[derive(Builder, Debug, PartialEq)]
15841pub struct QueryLlmOpts<'a> {
15842 #[builder(setter(into, strip_option), default)]
15844 pub model: Option<&'a str>,
15845 #[builder(setter(into, strip_option), default)]
15847 pub provider: Option<&'a str>,
15848}
15849#[derive(Builder, Debug, PartialEq)]
15850pub struct QueryFormatIdentifiersOpts<'a> {
15851 #[builder(setter(into, strip_option), default)]
15853 pub acronyms: Option<AcronymStyle>,
15854 #[builder(setter(into, strip_option), default)]
15856 pub version: Option<&'a str>,
15857}
15858#[derive(Builder, Debug, PartialEq)]
15859pub struct QueryEnvFileOpts {
15860 #[builder(setter(into, strip_option), default)]
15862 pub expand: Option<bool>,
15863}
15864impl IntoID<Id> for Query {
15865 fn into_id(
15866 self,
15867 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15868 Box::pin(async move { self.id().await })
15869 }
15870}
15871impl Loadable for Query {
15872 fn graphql_type() -> &'static str {
15873 "Query"
15874 }
15875 fn from_query(
15876 proc: Option<Arc<DaggerSessionProc>>,
15877 selection: Selection,
15878 graphql_client: DynGraphQLClient,
15879 ) -> Self {
15880 Self {
15881 proc,
15882 selection,
15883 graphql_client,
15884 }
15885 }
15886}
15887impl Query {
15888 pub async fn id(&self) -> Result<Id, DaggerError> {
15890 let query = self.selection.select("id");
15891 query.execute(self.graphql_client.clone()).await
15892 }
15893 pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
15895 let mut query = self.selection.select("node");
15896 query = query.arg_lazy(
15897 "id",
15898 Box::new(move || {
15899 let id = id.clone();
15900 Box::pin(async move { id.into_id().await.unwrap().quote() })
15901 }),
15902 );
15903 let query = query.select("id");
15904 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15905 Ok(id.map(|id| NodeClient {
15906 proc: self.proc.clone(),
15907 selection: query
15908 .root()
15909 .select("node")
15910 .arg("id", &id.0)
15911 .inline_fragment("Node"),
15912 graphql_client: self.graphql_client.clone(),
15913 }))
15914 }
15915 pub async fn version(&self) -> Result<String, DaggerError> {
15917 let query = self.selection.select("version");
15918 query.execute(self.graphql_client.clone()).await
15919 }
15920 pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
15922 let query = self.selection.select("currentTimestamp");
15923 query.execute(self.graphql_client.clone()).await
15924 }
15925 pub async fn set_session_title(&self, title: impl Into<String>) -> Result<Void, DaggerError> {
15932 let mut query = self.selection.select("setSessionTitle");
15933 query = query.arg("title", title.into());
15934 query.execute(self.graphql_client.clone()).await
15935 }
15936 pub fn directory(&self) -> Directory {
15938 let query = self.selection.select("directory");
15939 Directory {
15940 proc: self.proc.clone(),
15941 selection: query,
15942 graphql_client: self.graphql_client.clone(),
15943 }
15944 }
15945 pub fn changeset(&self) -> Changeset {
15947 let query = self.selection.select("changeset");
15948 Changeset {
15949 proc: self.proc.clone(),
15950 selection: query,
15951 graphql_client: self.graphql_client.clone(),
15952 }
15953 }
15954 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
15962 let mut query = self.selection.select("file");
15963 query = query.arg("name", name.into());
15964 query = query.arg("contents", contents.into());
15965 File {
15966 proc: self.proc.clone(),
15967 selection: query,
15968 graphql_client: self.graphql_client.clone(),
15969 }
15970 }
15971 pub fn file_opts(
15979 &self,
15980 name: impl Into<String>,
15981 contents: impl Into<String>,
15982 opts: QueryFileOpts,
15983 ) -> File {
15984 let mut query = self.selection.select("file");
15985 query = query.arg("name", name.into());
15986 query = query.arg("contents", contents.into());
15987 if let Some(permissions) = opts.permissions {
15988 query = query.arg("permissions", permissions);
15989 }
15990 File {
15991 proc: self.proc.clone(),
15992 selection: query,
15993 graphql_client: self.graphql_client.clone(),
15994 }
15995 }
15996 pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
16004 let mut query = self.selection.select("blob");
16005 query = query.arg("name", name.into());
16006 query = query.arg("contents", contents);
16007 File {
16008 proc: self.proc.clone(),
16009 selection: query,
16010 graphql_client: self.graphql_client.clone(),
16011 }
16012 }
16013 pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
16021 let mut query = self.selection.select("blob");
16022 query = query.arg("name", name.into());
16023 query = query.arg("contents", contents);
16024 if let Some(permissions) = opts.permissions {
16025 query = query.arg("permissions", permissions);
16026 }
16027 File {
16028 proc: self.proc.clone(),
16029 selection: query,
16030 graphql_client: self.graphql_client.clone(),
16031 }
16032 }
16033 pub fn git(&self, url: impl Into<String>) -> GitRepository {
16044 let mut query = self.selection.select("git");
16045 query = query.arg("url", url.into());
16046 GitRepository {
16047 proc: self.proc.clone(),
16048 selection: query,
16049 graphql_client: self.graphql_client.clone(),
16050 }
16051 }
16052 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
16063 let mut query = self.selection.select("git");
16064 query = query.arg("url", url.into());
16065 if let Some(keep_git_dir) = opts.keep_git_dir {
16066 query = query.arg("keepGitDir", keep_git_dir);
16067 }
16068 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
16069 query = query.arg("sshKnownHosts", ssh_known_hosts);
16070 }
16071 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
16072 query = query.arg("sshAuthSocket", ssh_auth_socket);
16073 }
16074 if let Some(http_auth_username) = opts.http_auth_username {
16075 query = query.arg("httpAuthUsername", http_auth_username);
16076 }
16077 if let Some(http_auth_token) = opts.http_auth_token {
16078 query = query.arg("httpAuthToken", http_auth_token);
16079 }
16080 if let Some(http_auth_header) = opts.http_auth_header {
16081 query = query.arg("httpAuthHeader", http_auth_header);
16082 }
16083 if let Some(experimental_service_host) = opts.experimental_service_host {
16084 query = query.arg("experimentalServiceHost", experimental_service_host);
16085 }
16086 GitRepository {
16087 proc: self.proc.clone(),
16088 selection: query,
16089 graphql_client: self.graphql_client.clone(),
16090 }
16091 }
16092 pub fn container(&self) -> Container {
16099 let query = self.selection.select("container");
16100 Container {
16101 proc: self.proc.clone(),
16102 selection: query,
16103 graphql_client: self.graphql_client.clone(),
16104 }
16105 }
16106 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
16113 let mut query = self.selection.select("container");
16114 if let Some(platform) = opts.platform {
16115 query = query.arg("platform", platform);
16116 }
16117 Container {
16118 proc: self.proc.clone(),
16119 selection: query,
16120 graphql_client: self.graphql_client.clone(),
16121 }
16122 }
16123 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
16130 let mut query = self.selection.select("cacheVolume");
16131 query = query.arg("key", key.into());
16132 CacheVolume {
16133 proc: self.proc.clone(),
16134 selection: query,
16135 graphql_client: self.graphql_client.clone(),
16136 }
16137 }
16138 pub fn cache_volume_opts<'a>(
16145 &self,
16146 key: impl Into<String>,
16147 opts: QueryCacheVolumeOpts<'a>,
16148 ) -> CacheVolume {
16149 let mut query = self.selection.select("cacheVolume");
16150 query = query.arg("key", key.into());
16151 if let Some(source) = opts.source {
16152 query = query.arg("source", source);
16153 }
16154 if let Some(sharing) = opts.sharing {
16155 query = query.arg("sharing", sharing);
16156 }
16157 if let Some(owner) = opts.owner {
16158 query = query.arg("owner", owner);
16159 }
16160 CacheVolume {
16161 proc: self.proc.clone(),
16162 selection: query,
16163 graphql_client: self.graphql_client.clone(),
16164 }
16165 }
16166 pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
16173 let mut query = self.selection.select("engineVolume");
16174 query = query.arg("name", name.into());
16175 Volume {
16176 proc: self.proc.clone(),
16177 selection: query,
16178 graphql_client: self.graphql_client.clone(),
16179 }
16180 }
16181 pub fn engine_volume_opts<'a>(
16188 &self,
16189 name: impl Into<String>,
16190 opts: QueryEngineVolumeOpts<'a>,
16191 ) -> Volume {
16192 let mut query = self.selection.select("engineVolume");
16193 query = query.arg("name", name.into());
16194 if let Some(subdir) = opts.subdir {
16195 query = query.arg("subdir", subdir);
16196 }
16197 Volume {
16198 proc: self.proc.clone(),
16199 selection: query,
16200 graphql_client: self.graphql_client.clone(),
16201 }
16202 }
16203 pub fn sshfs_volume(
16211 &self,
16212 endpoint: impl Into<String>,
16213 private_key: impl IntoID<Id>,
16214 ) -> Volume {
16215 let mut query = self.selection.select("sshfsVolume");
16216 query = query.arg("endpoint", endpoint.into());
16217 query = query.arg_lazy(
16218 "privateKey",
16219 Box::new(move || {
16220 let private_key = private_key.clone();
16221 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
16222 }),
16223 );
16224 Volume {
16225 proc: self.proc.clone(),
16226 selection: query,
16227 graphql_client: self.graphql_client.clone(),
16228 }
16229 }
16230 pub fn sshfs_volume_opts<'a>(
16238 &self,
16239 endpoint: impl Into<String>,
16240 private_key: impl IntoID<Id>,
16241 opts: QuerySshfsVolumeOpts<'a>,
16242 ) -> Volume {
16243 let mut query = self.selection.select("sshfsVolume");
16244 query = query.arg("endpoint", endpoint.into());
16245 query = query.arg_lazy(
16246 "privateKey",
16247 Box::new(move || {
16248 let private_key = private_key.clone();
16249 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
16250 }),
16251 );
16252 if let Some(known_hosts) = opts.known_hosts {
16253 query = query.arg("knownHosts", known_hosts);
16254 }
16255 if let Some(cache_key) = opts.cache_key {
16256 query = query.arg("cacheKey", cache_key);
16257 }
16258 if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
16259 query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
16260 }
16261 if let Some(experimental_service_host) = opts.experimental_service_host {
16262 query = query.arg("experimentalServiceHost", experimental_service_host);
16263 }
16264 Volume {
16265 proc: self.proc.clone(),
16266 selection: query,
16267 graphql_client: self.graphql_client.clone(),
16268 }
16269 }
16270 pub fn secret(&self, uri: impl Into<String>) -> Secret {
16277 let mut query = self.selection.select("secret");
16278 query = query.arg("uri", uri.into());
16279 Secret {
16280 proc: self.proc.clone(),
16281 selection: query,
16282 graphql_client: self.graphql_client.clone(),
16283 }
16284 }
16285 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
16292 let mut query = self.selection.select("secret");
16293 query = query.arg("uri", uri.into());
16294 if let Some(cache_key) = opts.cache_key {
16295 query = query.arg("cacheKey", cache_key);
16296 }
16297 Secret {
16298 proc: self.proc.clone(),
16299 selection: query,
16300 graphql_client: self.graphql_client.clone(),
16301 }
16302 }
16303 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
16311 let mut query = self.selection.select("setSecret");
16312 query = query.arg("name", name.into());
16313 query = query.arg("plaintext", plaintext.into());
16314 Secret {
16315 proc: self.proc.clone(),
16316 selection: query,
16317 graphql_client: self.graphql_client.clone(),
16318 }
16319 }
16320 pub fn host(&self) -> Host {
16322 let query = self.selection.select("host");
16323 Host {
16324 proc: self.proc.clone(),
16325 selection: query,
16326 graphql_client: self.graphql_client.clone(),
16327 }
16328 }
16329 pub fn http(&self, url: impl Into<String>) -> File {
16336 let mut query = self.selection.select("http");
16337 query = query.arg("url", url.into());
16338 File {
16339 proc: self.proc.clone(),
16340 selection: query,
16341 graphql_client: self.graphql_client.clone(),
16342 }
16343 }
16344 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
16351 let mut query = self.selection.select("http");
16352 query = query.arg("url", url.into());
16353 if let Some(name) = opts.name {
16354 query = query.arg("name", name);
16355 }
16356 if let Some(permissions) = opts.permissions {
16357 query = query.arg("permissions", permissions);
16358 }
16359 if let Some(checksum) = opts.checksum {
16360 query = query.arg("checksum", checksum);
16361 }
16362 if let Some(auth_header) = opts.auth_header {
16363 query = query.arg("authHeader", auth_header);
16364 }
16365 if let Some(experimental_service_host) = opts.experimental_service_host {
16366 query = query.arg("experimentalServiceHost", experimental_service_host);
16367 }
16368 File {
16369 proc: self.proc.clone(),
16370 selection: query,
16371 graphql_client: self.graphql_client.clone(),
16372 }
16373 }
16374 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
16376 let query = self.selection.select("defaultPlatform");
16377 query.execute(self.graphql_client.clone()).await
16378 }
16379 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
16386 let mut query = self.selection.select("moduleSource");
16387 query = query.arg("refString", ref_string.into());
16388 ModuleSource {
16389 proc: self.proc.clone(),
16390 selection: query,
16391 graphql_client: self.graphql_client.clone(),
16392 }
16393 }
16394 pub fn module_source_opts<'a>(
16401 &self,
16402 ref_string: impl Into<String>,
16403 opts: QueryModuleSourceOpts<'a>,
16404 ) -> ModuleSource {
16405 let mut query = self.selection.select("moduleSource");
16406 query = query.arg("refString", ref_string.into());
16407 if let Some(version) = opts.version {
16408 query = query.arg("version", version);
16409 }
16410 if let Some(ref_pin) = opts.ref_pin {
16411 query = query.arg("refPin", ref_pin);
16412 }
16413 if let Some(disable_find_up) = opts.disable_find_up {
16414 query = query.arg("disableFindUp", disable_find_up);
16415 }
16416 if let Some(allow_not_exists) = opts.allow_not_exists {
16417 query = query.arg("allowNotExists", allow_not_exists);
16418 }
16419 if let Some(require_kind) = opts.require_kind {
16420 query = query.arg("requireKind", require_kind);
16421 }
16422 ModuleSource {
16423 proc: self.proc.clone(),
16424 selection: query,
16425 graphql_client: self.graphql_client.clone(),
16426 }
16427 }
16428 pub fn module(&self) -> Module {
16430 let query = self.selection.select("module");
16431 Module {
16432 proc: self.proc.clone(),
16433 selection: query,
16434 graphql_client: self.graphql_client.clone(),
16435 }
16436 }
16437 pub fn type_def(&self) -> TypeDef {
16439 let query = self.selection.select("typeDef");
16440 TypeDef {
16441 proc: self.proc.clone(),
16442 selection: query,
16443 graphql_client: self.graphql_client.clone(),
16444 }
16445 }
16446 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
16448 let mut query = self.selection.select("generatedCode");
16449 query = query.arg_lazy(
16450 "code",
16451 Box::new(move || {
16452 let code = code.clone();
16453 Box::pin(async move { code.into_id().await.unwrap().quote() })
16454 }),
16455 );
16456 GeneratedCode {
16457 proc: self.proc.clone(),
16458 selection: query,
16459 graphql_client: self.graphql_client.clone(),
16460 }
16461 }
16462 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
16469 let mut query = self.selection.select("function");
16470 query = query.arg("name", name.into());
16471 query = query.arg_lazy(
16472 "returnType",
16473 Box::new(move || {
16474 let return_type = return_type.clone();
16475 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
16476 }),
16477 );
16478 Function {
16479 proc: self.proc.clone(),
16480 selection: query,
16481 graphql_client: self.graphql_client.clone(),
16482 }
16483 }
16484 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
16492 let mut query = self.selection.select("sourceMap");
16493 query = query.arg("filename", filename.into());
16494 query = query.arg("line", line);
16495 query = query.arg("column", column);
16496 SourceMap {
16497 proc: self.proc.clone(),
16498 selection: query,
16499 graphql_client: self.graphql_client.clone(),
16500 }
16501 }
16502 pub fn current_module(&self) -> CurrentModule {
16504 let query = self.selection.select("currentModule");
16505 CurrentModule {
16506 proc: self.proc.clone(),
16507 selection: query,
16508 graphql_client: self.graphql_client.clone(),
16509 }
16510 }
16511 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
16517 let query = self.selection.select("currentTypeDefs");
16518 let query = query.select("id");
16519 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16520 Ok(ids
16521 .into_iter()
16522 .map(|id| TypeDef {
16523 proc: self.proc.clone(),
16524 selection: crate::querybuilder::query()
16525 .select("node")
16526 .arg("id", &id.0)
16527 .inline_fragment("TypeDef"),
16528 graphql_client: self.graphql_client.clone(),
16529 })
16530 .collect())
16531 }
16532 pub async fn current_type_defs_opts(
16538 &self,
16539 opts: QueryCurrentTypeDefsOpts,
16540 ) -> Result<Vec<TypeDef>, DaggerError> {
16541 let mut query = self.selection.select("currentTypeDefs");
16542 if let Some(return_all_types) = opts.return_all_types {
16543 query = query.arg("returnAllTypes", return_all_types);
16544 }
16545 if let Some(hide_core) = opts.hide_core {
16546 query = query.arg("hideCore", hide_core);
16547 }
16548 let query = query.select("id");
16549 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16550 Ok(ids
16551 .into_iter()
16552 .map(|id| TypeDef {
16553 proc: self.proc.clone(),
16554 selection: crate::querybuilder::query()
16555 .select("node")
16556 .arg("id", &id.0)
16557 .inline_fragment("TypeDef"),
16558 graphql_client: self.graphql_client.clone(),
16559 })
16560 .collect())
16561 }
16562 pub fn current_function_call(&self) -> FunctionCall {
16565 let query = self.selection.select("currentFunctionCall");
16566 FunctionCall {
16567 proc: self.proc.clone(),
16568 selection: query,
16569 graphql_client: self.graphql_client.clone(),
16570 }
16571 }
16572 pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
16584 let mut query = self.selection.select("serveModule");
16585 query = query.arg("address", address.into());
16586 query.execute(self.graphql_client.clone()).await
16587 }
16588 pub async fn serve_module_opts<'a>(
16600 &self,
16601 address: impl Into<String>,
16602 opts: QueryServeModuleOpts<'a>,
16603 ) -> Result<Void, DaggerError> {
16604 let mut query = self.selection.select("serveModule");
16605 query = query.arg("address", address.into());
16606 if let Some(ref_pin) = opts.ref_pin {
16607 query = query.arg("refPin", ref_pin);
16608 }
16609 query.execute(self.graphql_client.clone()).await
16610 }
16611 pub fn current_node(&self) -> NodeClient {
16613 let query = self.selection.select("currentNode");
16614 NodeClient {
16615 proc: self.proc.clone(),
16616 selection: query,
16617 graphql_client: self.graphql_client.clone(),
16618 }
16619 }
16620 pub fn error(&self, message: impl Into<String>) -> Error {
16626 let mut query = self.selection.select("error");
16627 query = query.arg("message", message.into());
16628 Error {
16629 proc: self.proc.clone(),
16630 selection: query,
16631 graphql_client: self.graphql_client.clone(),
16632 }
16633 }
16634 pub fn engine(&self) -> Engine {
16636 let query = self.selection.select("engine");
16637 Engine {
16638 proc: self.proc.clone(),
16639 selection: query,
16640 graphql_client: self.graphql_client.clone(),
16641 }
16642 }
16643 pub fn cloud(&self) -> Cloud {
16645 let query = self.selection.select("cloud");
16646 Cloud {
16647 proc: self.proc.clone(),
16648 selection: query,
16649 graphql_client: self.graphql_client.clone(),
16650 }
16651 }
16652 pub fn llm(&self) -> Llm {
16658 let query = self.selection.select("llm");
16659 Llm {
16660 proc: self.proc.clone(),
16661 selection: query,
16662 graphql_client: self.graphql_client.clone(),
16663 }
16664 }
16665 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
16671 let mut query = self.selection.select("llm");
16672 if let Some(model) = opts.model {
16673 query = query.arg("model", model);
16674 }
16675 if let Some(provider) = opts.provider {
16676 query = query.arg("provider", provider);
16677 }
16678 Llm {
16679 proc: self.proc.clone(),
16680 selection: query,
16681 graphql_client: self.graphql_client.clone(),
16682 }
16683 }
16684 pub fn llm_content(&self) -> LlmContent {
16687 let query = self.selection.select("llmContent");
16688 LlmContent {
16689 proc: self.proc.clone(),
16690 selection: query,
16691 graphql_client: self.graphql_client.clone(),
16692 }
16693 }
16694 pub fn json(&self) -> JsonValue {
16696 let query = self.selection.select("json");
16697 JsonValue {
16698 proc: self.proc.clone(),
16699 selection: query,
16700 graphql_client: self.graphql_client.clone(),
16701 }
16702 }
16703 pub fn identifier(&self, name: impl Into<String>) -> Identifier {
16710 let mut query = self.selection.select("identifier");
16711 query = query.arg("name", name.into());
16712 Identifier {
16713 proc: self.proc.clone(),
16714 selection: query,
16715 graphql_client: self.graphql_client.clone(),
16716 }
16717 }
16718 pub async fn format_identifiers(
16726 &self,
16727 names: Vec<impl Into<String>>,
16728 casing: Casing,
16729 ) -> Result<Vec<String>, DaggerError> {
16730 let mut query = self.selection.select("formatIdentifiers");
16731 query = query.arg(
16732 "names",
16733 names.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
16734 );
16735 query = query.arg("casing", casing);
16736 query.execute(self.graphql_client.clone()).await
16737 }
16738 pub async fn format_identifiers_opts<'a>(
16746 &self,
16747 names: Vec<impl Into<String>>,
16748 casing: Casing,
16749 opts: QueryFormatIdentifiersOpts<'a>,
16750 ) -> Result<Vec<String>, DaggerError> {
16751 let mut query = self.selection.select("formatIdentifiers");
16752 query = query.arg(
16753 "names",
16754 names.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
16755 );
16756 query = query.arg("casing", casing);
16757 if let Some(acronyms) = opts.acronyms {
16758 query = query.arg("acronyms", acronyms);
16759 }
16760 if let Some(version) = opts.version {
16761 query = query.arg("version", version);
16762 }
16763 query.execute(self.graphql_client.clone()).await
16764 }
16765 pub async fn naming_dictionary(&self) -> Result<Vec<NamingTerm>, DaggerError> {
16767 let query = self.selection.select("namingDictionary");
16768 let query = query.select("id");
16769 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16770 Ok(ids
16771 .into_iter()
16772 .map(|id| NamingTerm {
16773 proc: self.proc.clone(),
16774 selection: crate::querybuilder::query()
16775 .select("node")
16776 .arg("id", &id.0)
16777 .inline_fragment("NamingTerm"),
16778 graphql_client: self.graphql_client.clone(),
16779 })
16780 .collect())
16781 }
16782 pub fn schema(&self, json: Json) -> Schema {
16788 let mut query = self.selection.select("schema");
16789 query = query.arg("json", json);
16790 Schema {
16791 proc: self.proc.clone(),
16792 selection: query,
16793 graphql_client: self.graphql_client.clone(),
16794 }
16795 }
16796 pub fn env_file(&self) -> EnvFile {
16802 let query = self.selection.select("envFile");
16803 EnvFile {
16804 proc: self.proc.clone(),
16805 selection: query,
16806 graphql_client: self.graphql_client.clone(),
16807 }
16808 }
16809 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
16815 let mut query = self.selection.select("envFile");
16816 if let Some(expand) = opts.expand {
16817 query = query.arg("expand", expand);
16818 }
16819 EnvFile {
16820 proc: self.proc.clone(),
16821 selection: query,
16822 graphql_client: self.graphql_client.clone(),
16823 }
16824 }
16825 pub fn address(&self, value: impl Into<String>) -> Address {
16827 let mut query = self.selection.select("address");
16828 query = query.arg("value", value.into());
16829 Address {
16830 proc: self.proc.clone(),
16831 selection: query,
16832 graphql_client: self.graphql_client.clone(),
16833 }
16834 }
16835 pub fn current_workspace(&self) -> Workspace {
16837 let query = self.selection.select("currentWorkspace");
16838 Workspace {
16839 proc: self.proc.clone(),
16840 selection: query,
16841 graphql_client: self.graphql_client.clone(),
16842 }
16843 }
16844}
16845impl Node for Query {
16846 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16847 let query = self.selection.select("id");
16848 let graphql_client = self.graphql_client.clone();
16849 async move { query.execute(graphql_client).await }
16850 }
16851}
16852#[derive(Clone)]
16853pub struct RemoteGitMirror {
16854 pub proc: Option<Arc<DaggerSessionProc>>,
16855 pub selection: Selection,
16856 pub graphql_client: DynGraphQLClient,
16857}
16858impl IntoID<Id> for RemoteGitMirror {
16859 fn into_id(
16860 self,
16861 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16862 Box::pin(async move { self.id().await })
16863 }
16864}
16865impl Loadable for RemoteGitMirror {
16866 fn graphql_type() -> &'static str {
16867 "RemoteGitMirror"
16868 }
16869 fn from_query(
16870 proc: Option<Arc<DaggerSessionProc>>,
16871 selection: Selection,
16872 graphql_client: DynGraphQLClient,
16873 ) -> Self {
16874 Self {
16875 proc,
16876 selection,
16877 graphql_client,
16878 }
16879 }
16880}
16881impl RemoteGitMirror {
16882 pub async fn id(&self) -> Result<Id, DaggerError> {
16884 let query = self.selection.select("id");
16885 query.execute(self.graphql_client.clone()).await
16886 }
16887}
16888impl Node for RemoteGitMirror {
16889 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16890 let query = self.selection.select("id");
16891 let graphql_client = self.graphql_client.clone();
16892 async move { query.execute(graphql_client).await }
16893 }
16894}
16895#[derive(Clone)]
16896pub struct SdkConfig {
16897 pub proc: Option<Arc<DaggerSessionProc>>,
16898 pub selection: Selection,
16899 pub graphql_client: DynGraphQLClient,
16900}
16901impl IntoID<Id> for SdkConfig {
16902 fn into_id(
16903 self,
16904 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16905 Box::pin(async move { self.id().await })
16906 }
16907}
16908impl Loadable for SdkConfig {
16909 fn graphql_type() -> &'static str {
16910 "SDKConfig"
16911 }
16912 fn from_query(
16913 proc: Option<Arc<DaggerSessionProc>>,
16914 selection: Selection,
16915 graphql_client: DynGraphQLClient,
16916 ) -> Self {
16917 Self {
16918 proc,
16919 selection,
16920 graphql_client,
16921 }
16922 }
16923}
16924impl SdkConfig {
16925 pub async fn id(&self) -> Result<Id, DaggerError> {
16927 let query = self.selection.select("id");
16928 query.execute(self.graphql_client.clone()).await
16929 }
16930 pub async fn source(&self) -> Result<String, DaggerError> {
16932 let query = self.selection.select("source");
16933 query.execute(self.graphql_client.clone()).await
16934 }
16935 pub async fn debug(&self) -> Result<bool, DaggerError> {
16937 let query = self.selection.select("debug");
16938 query.execute(self.graphql_client.clone()).await
16939 }
16940}
16941impl Node for SdkConfig {
16942 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16943 let query = self.selection.select("id");
16944 let graphql_client = self.graphql_client.clone();
16945 async move { query.execute(graphql_client).await }
16946 }
16947}
16948#[derive(Clone)]
16949pub struct ScalarTypeDef {
16950 pub proc: Option<Arc<DaggerSessionProc>>,
16951 pub selection: Selection,
16952 pub graphql_client: DynGraphQLClient,
16953}
16954impl IntoID<Id> for ScalarTypeDef {
16955 fn into_id(
16956 self,
16957 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16958 Box::pin(async move { self.id().await })
16959 }
16960}
16961impl Loadable for ScalarTypeDef {
16962 fn graphql_type() -> &'static str {
16963 "ScalarTypeDef"
16964 }
16965 fn from_query(
16966 proc: Option<Arc<DaggerSessionProc>>,
16967 selection: Selection,
16968 graphql_client: DynGraphQLClient,
16969 ) -> Self {
16970 Self {
16971 proc,
16972 selection,
16973 graphql_client,
16974 }
16975 }
16976}
16977impl ScalarTypeDef {
16978 pub async fn id(&self) -> Result<Id, DaggerError> {
16980 let query = self.selection.select("id");
16981 query.execute(self.graphql_client.clone()).await
16982 }
16983 pub async fn name(&self) -> Result<String, DaggerError> {
16985 let query = self.selection.select("name");
16986 query.execute(self.graphql_client.clone()).await
16987 }
16988 pub async fn description(&self) -> Result<String, DaggerError> {
16990 let query = self.selection.select("description");
16991 query.execute(self.graphql_client.clone()).await
16992 }
16993 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
16995 let query = self.selection.select("sourceModuleName");
16996 query.execute(self.graphql_client.clone()).await
16997 }
16998}
16999impl Node for ScalarTypeDef {
17000 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17001 let query = self.selection.select("id");
17002 let graphql_client = self.graphql_client.clone();
17003 async move { query.execute(graphql_client).await }
17004 }
17005}
17006#[derive(Clone)]
17007pub struct Schema {
17008 pub proc: Option<Arc<DaggerSessionProc>>,
17009 pub selection: Selection,
17010 pub graphql_client: DynGraphQLClient,
17011}
17012impl IntoID<Id> for Schema {
17013 fn into_id(
17014 self,
17015 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17016 Box::pin(async move { self.id().await })
17017 }
17018}
17019impl Loadable for Schema {
17020 fn graphql_type() -> &'static str {
17021 "Schema"
17022 }
17023 fn from_query(
17024 proc: Option<Arc<DaggerSessionProc>>,
17025 selection: Selection,
17026 graphql_client: DynGraphQLClient,
17027 ) -> Self {
17028 Self {
17029 proc,
17030 selection,
17031 graphql_client,
17032 }
17033 }
17034}
17035impl Schema {
17036 pub async fn id(&self) -> Result<Id, DaggerError> {
17038 let query = self.selection.select("id");
17039 query.execute(self.graphql_client.clone()).await
17040 }
17041 pub async fn contents(&self) -> Result<Json, DaggerError> {
17043 let query = self.selection.select("contents");
17044 query.execute(self.graphql_client.clone()).await
17045 }
17046 pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
17053 let mut query = self.selection.select("merge");
17054 query = query.arg("moduleTypes", module_types);
17055 query = query.arg("moduleName", module_name.into());
17056 Schema {
17057 proc: self.proc.clone(),
17058 selection: query,
17059 graphql_client: self.graphql_client.clone(),
17060 }
17061 }
17062}
17063impl Node for Schema {
17064 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17065 let query = self.selection.select("id");
17066 let graphql_client = self.graphql_client.clone();
17067 async move { query.execute(graphql_client).await }
17068 }
17069}
17070#[derive(Clone)]
17071pub struct SearchResult {
17072 pub proc: Option<Arc<DaggerSessionProc>>,
17073 pub selection: Selection,
17074 pub graphql_client: DynGraphQLClient,
17075}
17076impl IntoID<Id> for SearchResult {
17077 fn into_id(
17078 self,
17079 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17080 Box::pin(async move { self.id().await })
17081 }
17082}
17083impl Loadable for SearchResult {
17084 fn graphql_type() -> &'static str {
17085 "SearchResult"
17086 }
17087 fn from_query(
17088 proc: Option<Arc<DaggerSessionProc>>,
17089 selection: Selection,
17090 graphql_client: DynGraphQLClient,
17091 ) -> Self {
17092 Self {
17093 proc,
17094 selection,
17095 graphql_client,
17096 }
17097 }
17098}
17099impl SearchResult {
17100 pub async fn id(&self) -> Result<Id, DaggerError> {
17102 let query = self.selection.select("id");
17103 query.execute(self.graphql_client.clone()).await
17104 }
17105 pub async fn file_path(&self) -> Result<String, DaggerError> {
17107 let query = self.selection.select("filePath");
17108 query.execute(self.graphql_client.clone()).await
17109 }
17110 pub async fn line_number(&self) -> Result<isize, DaggerError> {
17112 let query = self.selection.select("lineNumber");
17113 query.execute(self.graphql_client.clone()).await
17114 }
17115 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
17117 let query = self.selection.select("absoluteOffset");
17118 query.execute(self.graphql_client.clone()).await
17119 }
17120 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
17122 let query = self.selection.select("matchedLines");
17123 query.execute(self.graphql_client.clone()).await
17124 }
17125 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
17127 let query = self.selection.select("submatches");
17128 let query = query.select("id");
17129 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17130 Ok(ids
17131 .into_iter()
17132 .map(|id| SearchSubmatch {
17133 proc: self.proc.clone(),
17134 selection: crate::querybuilder::query()
17135 .select("node")
17136 .arg("id", &id.0)
17137 .inline_fragment("SearchSubmatch"),
17138 graphql_client: self.graphql_client.clone(),
17139 })
17140 .collect())
17141 }
17142}
17143impl Node for SearchResult {
17144 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17145 let query = self.selection.select("id");
17146 let graphql_client = self.graphql_client.clone();
17147 async move { query.execute(graphql_client).await }
17148 }
17149}
17150#[derive(Clone)]
17151pub struct SearchSubmatch {
17152 pub proc: Option<Arc<DaggerSessionProc>>,
17153 pub selection: Selection,
17154 pub graphql_client: DynGraphQLClient,
17155}
17156impl IntoID<Id> for SearchSubmatch {
17157 fn into_id(
17158 self,
17159 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17160 Box::pin(async move { self.id().await })
17161 }
17162}
17163impl Loadable for SearchSubmatch {
17164 fn graphql_type() -> &'static str {
17165 "SearchSubmatch"
17166 }
17167 fn from_query(
17168 proc: Option<Arc<DaggerSessionProc>>,
17169 selection: Selection,
17170 graphql_client: DynGraphQLClient,
17171 ) -> Self {
17172 Self {
17173 proc,
17174 selection,
17175 graphql_client,
17176 }
17177 }
17178}
17179impl SearchSubmatch {
17180 pub async fn id(&self) -> Result<Id, DaggerError> {
17182 let query = self.selection.select("id");
17183 query.execute(self.graphql_client.clone()).await
17184 }
17185 pub async fn text(&self) -> Result<String, DaggerError> {
17187 let query = self.selection.select("text");
17188 query.execute(self.graphql_client.clone()).await
17189 }
17190 pub async fn start(&self) -> Result<isize, DaggerError> {
17192 let query = self.selection.select("start");
17193 query.execute(self.graphql_client.clone()).await
17194 }
17195 pub async fn end(&self) -> Result<isize, DaggerError> {
17197 let query = self.selection.select("end");
17198 query.execute(self.graphql_client.clone()).await
17199 }
17200}
17201impl Node for SearchSubmatch {
17202 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17203 let query = self.selection.select("id");
17204 let graphql_client = self.graphql_client.clone();
17205 async move { query.execute(graphql_client).await }
17206 }
17207}
17208#[derive(Clone)]
17209pub struct Secret {
17210 pub proc: Option<Arc<DaggerSessionProc>>,
17211 pub selection: Selection,
17212 pub graphql_client: DynGraphQLClient,
17213}
17214impl IntoID<Id> for Secret {
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 Secret {
17222 fn graphql_type() -> &'static str {
17223 "Secret"
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 Secret {
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 pub async fn name(&self) -> Result<String, DaggerError> {
17245 let query = self.selection.select("name");
17246 query.execute(self.graphql_client.clone()).await
17247 }
17248 pub async fn uri(&self) -> Result<String, DaggerError> {
17250 let query = self.selection.select("uri");
17251 query.execute(self.graphql_client.clone()).await
17252 }
17253 pub async fn plaintext(&self) -> Result<String, DaggerError> {
17255 let query = self.selection.select("plaintext");
17256 query.execute(self.graphql_client.clone()).await
17257 }
17258}
17259impl Node for Secret {
17260 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17261 let query = self.selection.select("id");
17262 let graphql_client = self.graphql_client.clone();
17263 async move { query.execute(graphql_client).await }
17264 }
17265}
17266#[derive(Clone)]
17267pub struct Service {
17268 pub proc: Option<Arc<DaggerSessionProc>>,
17269 pub selection: Selection,
17270 pub graphql_client: DynGraphQLClient,
17271}
17272#[derive(Builder, Debug, PartialEq)]
17273pub struct ServicePortsOpts {
17274 #[builder(setter(into, strip_option), default)]
17276 pub declared: Option<bool>,
17277}
17278#[derive(Builder, Debug, PartialEq)]
17279pub struct ServiceEndpointOpts<'a> {
17280 #[builder(setter(into, strip_option), default)]
17282 pub port: Option<isize>,
17283 #[builder(setter(into, strip_option), default)]
17285 pub scheme: Option<&'a str>,
17286}
17287#[derive(Builder, Debug, PartialEq)]
17288pub struct ServiceUpOpts {
17289 #[builder(setter(into, strip_option), default)]
17292 pub ports: Option<Vec<PortForward>>,
17293 #[builder(setter(into, strip_option), default)]
17295 pub random: Option<bool>,
17296}
17297#[derive(Builder, Debug, PartialEq)]
17298pub struct ServiceStopOpts {
17299 #[builder(setter(into, strip_option), default)]
17301 pub kill: Option<bool>,
17302}
17303#[derive(Builder, Debug, PartialEq)]
17304pub struct ServiceTerminalOpts<'a> {
17305 #[builder(setter(into, strip_option), default)]
17306 pub cmd: Option<Vec<&'a str>>,
17307}
17308impl IntoID<Id> for Service {
17309 fn into_id(
17310 self,
17311 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17312 Box::pin(async move { self.id().await })
17313 }
17314}
17315impl Loadable for Service {
17316 fn graphql_type() -> &'static str {
17317 "Service"
17318 }
17319 fn from_query(
17320 proc: Option<Arc<DaggerSessionProc>>,
17321 selection: Selection,
17322 graphql_client: DynGraphQLClient,
17323 ) -> Self {
17324 Self {
17325 proc,
17326 selection,
17327 graphql_client,
17328 }
17329 }
17330}
17331impl Service {
17332 pub async fn id(&self) -> Result<Id, DaggerError> {
17334 let query = self.selection.select("id");
17335 query.execute(self.graphql_client.clone()).await
17336 }
17337 pub async fn sync(&self) -> Result<Service, DaggerError> {
17339 let query = self.selection.select("sync");
17340 let id: Id = query.execute(self.graphql_client.clone()).await?;
17341 Ok(Service {
17342 proc: self.proc.clone(),
17343 selection: query
17344 .root()
17345 .select("node")
17346 .arg("id", &id.0)
17347 .inline_fragment("Service"),
17348 graphql_client: self.graphql_client.clone(),
17349 })
17350 }
17351 pub async fn hostname(&self) -> Result<String, DaggerError> {
17353 let query = self.selection.select("hostname");
17354 query.execute(self.graphql_client.clone()).await
17355 }
17356 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
17362 let mut query = self.selection.select("withHostname");
17363 query = query.arg("hostname", hostname.into());
17364 Service {
17365 proc: self.proc.clone(),
17366 selection: query,
17367 graphql_client: self.graphql_client.clone(),
17368 }
17369 }
17370 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
17376 let query = self.selection.select("ports");
17377 let query = query.select("id");
17378 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17379 Ok(ids
17380 .into_iter()
17381 .map(|id| Port {
17382 proc: self.proc.clone(),
17383 selection: crate::querybuilder::query()
17384 .select("node")
17385 .arg("id", &id.0)
17386 .inline_fragment("Port"),
17387 graphql_client: self.graphql_client.clone(),
17388 })
17389 .collect())
17390 }
17391 pub async fn ports_opts(&self, opts: ServicePortsOpts) -> Result<Vec<Port>, DaggerError> {
17397 let mut query = self.selection.select("ports");
17398 if let Some(declared) = opts.declared {
17399 query = query.arg("declared", declared);
17400 }
17401 let query = query.select("id");
17402 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17403 Ok(ids
17404 .into_iter()
17405 .map(|id| Port {
17406 proc: self.proc.clone(),
17407 selection: crate::querybuilder::query()
17408 .select("node")
17409 .arg("id", &id.0)
17410 .inline_fragment("Port"),
17411 graphql_client: self.graphql_client.clone(),
17412 })
17413 .collect())
17414 }
17415 pub async fn endpoint(&self) -> Result<String, DaggerError> {
17423 let query = self.selection.select("endpoint");
17424 query.execute(self.graphql_client.clone()).await
17425 }
17426 pub async fn endpoint_opts<'a>(
17434 &self,
17435 opts: ServiceEndpointOpts<'a>,
17436 ) -> Result<String, DaggerError> {
17437 let mut query = self.selection.select("endpoint");
17438 if let Some(port) = opts.port {
17439 query = query.arg("port", port);
17440 }
17441 if let Some(scheme) = opts.scheme {
17442 query = query.arg("scheme", scheme);
17443 }
17444 query.execute(self.graphql_client.clone()).await
17445 }
17446 pub async fn start(&self) -> Result<Service, DaggerError> {
17449 let query = self.selection.select("start");
17450 let id: Id = query.execute(self.graphql_client.clone()).await?;
17451 Ok(Service {
17452 proc: self.proc.clone(),
17453 selection: query
17454 .root()
17455 .select("node")
17456 .arg("id", &id.0)
17457 .inline_fragment("Service"),
17458 graphql_client: self.graphql_client.clone(),
17459 })
17460 }
17461 pub async fn up(&self) -> Result<Void, DaggerError> {
17467 let query = self.selection.select("up");
17468 query.execute(self.graphql_client.clone()).await
17469 }
17470 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
17476 let mut query = self.selection.select("up");
17477 if let Some(ports) = opts.ports {
17478 query = query.arg("ports", ports);
17479 }
17480 if let Some(random) = opts.random {
17481 query = query.arg("random", random);
17482 }
17483 query.execute(self.graphql_client.clone()).await
17484 }
17485 pub async fn stop(&self) -> Result<Service, DaggerError> {
17491 let query = self.selection.select("stop");
17492 let id: Id = query.execute(self.graphql_client.clone()).await?;
17493 Ok(Service {
17494 proc: self.proc.clone(),
17495 selection: query
17496 .root()
17497 .select("node")
17498 .arg("id", &id.0)
17499 .inline_fragment("Service"),
17500 graphql_client: self.graphql_client.clone(),
17501 })
17502 }
17503 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
17509 let mut query = self.selection.select("stop");
17510 if let Some(kill) = opts.kill {
17511 query = query.arg("kill", kill);
17512 }
17513 let id: Id = query.execute(self.graphql_client.clone()).await?;
17514 Ok(Service {
17515 proc: self.proc.clone(),
17516 selection: query
17517 .root()
17518 .select("node")
17519 .arg("id", &id.0)
17520 .inline_fragment("Service"),
17521 graphql_client: self.graphql_client.clone(),
17522 })
17523 }
17524 pub fn terminal(&self) -> Service {
17529 let query = self.selection.select("terminal");
17530 Service {
17531 proc: self.proc.clone(),
17532 selection: query,
17533 graphql_client: self.graphql_client.clone(),
17534 }
17535 }
17536 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
17541 let mut query = self.selection.select("terminal");
17542 if let Some(cmd) = opts.cmd {
17543 query = query.arg("cmd", cmd);
17544 }
17545 Service {
17546 proc: self.proc.clone(),
17547 selection: query,
17548 graphql_client: self.graphql_client.clone(),
17549 }
17550 }
17551}
17552impl Node for Service {
17553 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17554 let query = self.selection.select("id");
17555 let graphql_client = self.graphql_client.clone();
17556 async move { query.execute(graphql_client).await }
17557 }
17558}
17559impl Syncer for Service {
17560 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17561 let query = self.selection.select("id");
17562 let graphql_client = self.graphql_client.clone();
17563 async move { query.execute(graphql_client).await }
17564 }
17565 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17566 let query = self.selection.select("sync");
17567 let proc = self.proc.clone();
17568 let graphql_client = self.graphql_client.clone();
17569 async move {
17570 let id: Id = query.execute(graphql_client.clone()).await?;
17571 Ok(Self {
17572 proc,
17573 selection: query
17574 .root()
17575 .select("node")
17576 .arg("id", &id.0)
17577 .inline_fragment("Service"),
17578 graphql_client,
17579 })
17580 }
17581 }
17582}
17583#[derive(Clone)]
17584pub struct Socket {
17585 pub proc: Option<Arc<DaggerSessionProc>>,
17586 pub selection: Selection,
17587 pub graphql_client: DynGraphQLClient,
17588}
17589impl IntoID<Id> for Socket {
17590 fn into_id(
17591 self,
17592 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17593 Box::pin(async move { self.id().await })
17594 }
17595}
17596impl Loadable for Socket {
17597 fn graphql_type() -> &'static str {
17598 "Socket"
17599 }
17600 fn from_query(
17601 proc: Option<Arc<DaggerSessionProc>>,
17602 selection: Selection,
17603 graphql_client: DynGraphQLClient,
17604 ) -> Self {
17605 Self {
17606 proc,
17607 selection,
17608 graphql_client,
17609 }
17610 }
17611}
17612impl Socket {
17613 pub async fn id(&self) -> Result<Id, DaggerError> {
17615 let query = self.selection.select("id");
17616 query.execute(self.graphql_client.clone()).await
17617 }
17618}
17619impl Node for Socket {
17620 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17621 let query = self.selection.select("id");
17622 let graphql_client = self.graphql_client.clone();
17623 async move { query.execute(graphql_client).await }
17624 }
17625}
17626#[derive(Clone)]
17627pub struct SourceMap {
17628 pub proc: Option<Arc<DaggerSessionProc>>,
17629 pub selection: Selection,
17630 pub graphql_client: DynGraphQLClient,
17631}
17632impl IntoID<Id> for SourceMap {
17633 fn into_id(
17634 self,
17635 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17636 Box::pin(async move { self.id().await })
17637 }
17638}
17639impl Loadable for SourceMap {
17640 fn graphql_type() -> &'static str {
17641 "SourceMap"
17642 }
17643 fn from_query(
17644 proc: Option<Arc<DaggerSessionProc>>,
17645 selection: Selection,
17646 graphql_client: DynGraphQLClient,
17647 ) -> Self {
17648 Self {
17649 proc,
17650 selection,
17651 graphql_client,
17652 }
17653 }
17654}
17655impl SourceMap {
17656 pub async fn id(&self) -> Result<Id, DaggerError> {
17658 let query = self.selection.select("id");
17659 query.execute(self.graphql_client.clone()).await
17660 }
17661 pub async fn module(&self) -> Result<String, DaggerError> {
17663 let query = self.selection.select("module");
17664 query.execute(self.graphql_client.clone()).await
17665 }
17666 pub async fn filename(&self) -> Result<String, DaggerError> {
17668 let query = self.selection.select("filename");
17669 query.execute(self.graphql_client.clone()).await
17670 }
17671 pub async fn line(&self) -> Result<isize, DaggerError> {
17673 let query = self.selection.select("line");
17674 query.execute(self.graphql_client.clone()).await
17675 }
17676 pub async fn column(&self) -> Result<isize, DaggerError> {
17678 let query = self.selection.select("column");
17679 query.execute(self.graphql_client.clone()).await
17680 }
17681 pub async fn url(&self) -> Result<String, DaggerError> {
17683 let query = self.selection.select("url");
17684 query.execute(self.graphql_client.clone()).await
17685 }
17686}
17687impl Node for SourceMap {
17688 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17689 let query = self.selection.select("id");
17690 let graphql_client = self.graphql_client.clone();
17691 async move { query.execute(graphql_client).await }
17692 }
17693}
17694#[derive(Clone)]
17695pub struct Stat {
17696 pub proc: Option<Arc<DaggerSessionProc>>,
17697 pub selection: Selection,
17698 pub graphql_client: DynGraphQLClient,
17699}
17700impl IntoID<Id> for Stat {
17701 fn into_id(
17702 self,
17703 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17704 Box::pin(async move { self.id().await })
17705 }
17706}
17707impl Loadable for Stat {
17708 fn graphql_type() -> &'static str {
17709 "Stat"
17710 }
17711 fn from_query(
17712 proc: Option<Arc<DaggerSessionProc>>,
17713 selection: Selection,
17714 graphql_client: DynGraphQLClient,
17715 ) -> Self {
17716 Self {
17717 proc,
17718 selection,
17719 graphql_client,
17720 }
17721 }
17722}
17723impl Stat {
17724 pub async fn id(&self) -> Result<Id, DaggerError> {
17726 let query = self.selection.select("id");
17727 query.execute(self.graphql_client.clone()).await
17728 }
17729 pub async fn size(&self) -> Result<isize, DaggerError> {
17731 let query = self.selection.select("size");
17732 query.execute(self.graphql_client.clone()).await
17733 }
17734 pub async fn name(&self) -> Result<String, DaggerError> {
17736 let query = self.selection.select("name");
17737 query.execute(self.graphql_client.clone()).await
17738 }
17739 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
17741 let query = self.selection.select("fileType");
17742 query.execute(self.graphql_client.clone()).await
17743 }
17744 pub async fn permissions(&self) -> Result<isize, DaggerError> {
17746 let query = self.selection.select("permissions");
17747 query.execute(self.graphql_client.clone()).await
17748 }
17749}
17750impl Node for Stat {
17751 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17752 let query = self.selection.select("id");
17753 let graphql_client = self.graphql_client.clone();
17754 async move { query.execute(graphql_client).await }
17755 }
17756}
17757#[derive(Clone)]
17758pub struct Terminal {
17759 pub proc: Option<Arc<DaggerSessionProc>>,
17760 pub selection: Selection,
17761 pub graphql_client: DynGraphQLClient,
17762}
17763impl IntoID<Id> for Terminal {
17764 fn into_id(
17765 self,
17766 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17767 Box::pin(async move { self.id().await })
17768 }
17769}
17770impl Loadable for Terminal {
17771 fn graphql_type() -> &'static str {
17772 "Terminal"
17773 }
17774 fn from_query(
17775 proc: Option<Arc<DaggerSessionProc>>,
17776 selection: Selection,
17777 graphql_client: DynGraphQLClient,
17778 ) -> Self {
17779 Self {
17780 proc,
17781 selection,
17782 graphql_client,
17783 }
17784 }
17785}
17786impl Terminal {
17787 pub async fn id(&self) -> Result<Id, DaggerError> {
17789 let query = self.selection.select("id");
17790 query.execute(self.graphql_client.clone()).await
17791 }
17792 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
17795 let query = self.selection.select("sync");
17796 let id: Id = query.execute(self.graphql_client.clone()).await?;
17797 Ok(Terminal {
17798 proc: self.proc.clone(),
17799 selection: query
17800 .root()
17801 .select("node")
17802 .arg("id", &id.0)
17803 .inline_fragment("Terminal"),
17804 graphql_client: self.graphql_client.clone(),
17805 })
17806 }
17807}
17808impl Node for Terminal {
17809 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17810 let query = self.selection.select("id");
17811 let graphql_client = self.graphql_client.clone();
17812 async move { query.execute(graphql_client).await }
17813 }
17814}
17815impl Syncer for Terminal {
17816 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17817 let query = self.selection.select("id");
17818 let graphql_client = self.graphql_client.clone();
17819 async move { query.execute(graphql_client).await }
17820 }
17821 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17822 let query = self.selection.select("sync");
17823 let proc = self.proc.clone();
17824 let graphql_client = self.graphql_client.clone();
17825 async move {
17826 let id: Id = query.execute(graphql_client.clone()).await?;
17827 Ok(Self {
17828 proc,
17829 selection: query
17830 .root()
17831 .select("node")
17832 .arg("id", &id.0)
17833 .inline_fragment("Terminal"),
17834 graphql_client,
17835 })
17836 }
17837 }
17838}
17839#[derive(Clone)]
17840pub struct TypeDef {
17841 pub proc: Option<Arc<DaggerSessionProc>>,
17842 pub selection: Selection,
17843 pub graphql_client: DynGraphQLClient,
17844}
17845#[derive(Builder, Debug, PartialEq)]
17846pub struct TypeDefWithScalarOpts<'a> {
17847 #[builder(setter(into, strip_option), default)]
17848 pub description: Option<&'a str>,
17849}
17850#[derive(Builder, Debug, PartialEq)]
17851pub struct TypeDefWithObjectOpts<'a> {
17852 #[builder(setter(into, strip_option), default)]
17853 pub deprecated: Option<&'a str>,
17854 #[builder(setter(into, strip_option), default)]
17855 pub description: Option<&'a str>,
17856 #[builder(setter(into, strip_option), default)]
17857 pub source_map: Option<Id>,
17858}
17859#[derive(Builder, Debug, PartialEq)]
17860pub struct TypeDefWithInterfaceOpts<'a> {
17861 #[builder(setter(into, strip_option), default)]
17862 pub description: Option<&'a str>,
17863 #[builder(setter(into, strip_option), default)]
17864 pub source_map: Option<Id>,
17865}
17866#[derive(Builder, Debug, PartialEq)]
17867pub struct TypeDefWithFieldOpts<'a> {
17868 #[builder(setter(into, strip_option), default)]
17870 pub deprecated: Option<&'a str>,
17871 #[builder(setter(into, strip_option), default)]
17873 pub description: Option<&'a str>,
17874 #[builder(setter(into, strip_option), default)]
17876 pub source_map: Option<Id>,
17877}
17878#[derive(Builder, Debug, PartialEq)]
17879pub struct TypeDefWithEnumOpts<'a> {
17880 #[builder(setter(into, strip_option), default)]
17882 pub description: Option<&'a str>,
17883 #[builder(setter(into, strip_option), default)]
17885 pub source_map: Option<Id>,
17886}
17887#[derive(Builder, Debug, PartialEq)]
17888pub struct TypeDefWithEnumValueOpts<'a> {
17889 #[builder(setter(into, strip_option), default)]
17891 pub deprecated: Option<&'a str>,
17892 #[builder(setter(into, strip_option), default)]
17894 pub description: Option<&'a str>,
17895 #[builder(setter(into, strip_option), default)]
17897 pub source_map: Option<Id>,
17898}
17899#[derive(Builder, Debug, PartialEq)]
17900pub struct TypeDefWithEnumMemberOpts<'a> {
17901 #[builder(setter(into, strip_option), default)]
17903 pub deprecated: Option<&'a str>,
17904 #[builder(setter(into, strip_option), default)]
17906 pub description: Option<&'a str>,
17907 #[builder(setter(into, strip_option), default)]
17909 pub source_map: Option<Id>,
17910 #[builder(setter(into, strip_option), default)]
17912 pub value: Option<&'a str>,
17913}
17914impl IntoID<Id> for TypeDef {
17915 fn into_id(
17916 self,
17917 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17918 Box::pin(async move { self.id().await })
17919 }
17920}
17921impl Loadable for TypeDef {
17922 fn graphql_type() -> &'static str {
17923 "TypeDef"
17924 }
17925 fn from_query(
17926 proc: Option<Arc<DaggerSessionProc>>,
17927 selection: Selection,
17928 graphql_client: DynGraphQLClient,
17929 ) -> Self {
17930 Self {
17931 proc,
17932 selection,
17933 graphql_client,
17934 }
17935 }
17936}
17937impl TypeDef {
17938 pub async fn id(&self) -> Result<Id, DaggerError> {
17940 let query = self.selection.select("id");
17941 query.execute(self.graphql_client.clone()).await
17942 }
17943 pub fn with_collection(&self) -> TypeDef {
17945 let query = self.selection.select("withCollection");
17946 TypeDef {
17947 proc: self.proc.clone(),
17948 selection: query,
17949 graphql_client: self.graphql_client.clone(),
17950 }
17951 }
17952 pub fn with_collection_keys(&self, name: impl Into<String>) -> TypeDef {
17954 let mut query = self.selection.select("withCollectionKeys");
17955 query = query.arg("name", name.into());
17956 TypeDef {
17957 proc: self.proc.clone(),
17958 selection: query,
17959 graphql_client: self.graphql_client.clone(),
17960 }
17961 }
17962 pub fn with_collection_get(&self, name: impl Into<String>) -> TypeDef {
17964 let mut query = self.selection.select("withCollectionGet");
17965 query = query.arg("name", name.into());
17966 TypeDef {
17967 proc: self.proc.clone(),
17968 selection: query,
17969 graphql_client: self.graphql_client.clone(),
17970 }
17971 }
17972 pub fn with_collection_delta(&self, name: impl Into<String>) -> TypeDef {
17974 let mut query = self.selection.select("withCollectionDelta");
17975 query = query.arg("name", name.into());
17976 TypeDef {
17977 proc: self.proc.clone(),
17978 selection: query,
17979 graphql_client: self.graphql_client.clone(),
17980 }
17981 }
17982 pub async fn as_collection(&self) -> Result<Option<CollectionTypeDef>, DaggerError> {
17984 let query = self.selection.select("asCollection");
17985 let query = query.select("id");
17986 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
17987 Ok(id.map(|id| CollectionTypeDef {
17988 proc: self.proc.clone(),
17989 selection: query
17990 .root()
17991 .select("node")
17992 .arg("id", &id.0)
17993 .inline_fragment("CollectionTypeDef"),
17994 graphql_client: self.graphql_client.clone(),
17995 }))
17996 }
17997 pub async fn name(&self) -> Result<String, DaggerError> {
17999 let query = self.selection.select("name");
18000 query.execute(self.graphql_client.clone()).await
18001 }
18002 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
18004 let query = self.selection.select("kind");
18005 query.execute(self.graphql_client.clone()).await
18006 }
18007 pub async fn optional(&self) -> Result<bool, DaggerError> {
18009 let query = self.selection.select("optional");
18010 query.execute(self.graphql_client.clone()).await
18011 }
18012 pub fn with_optional(&self, optional: bool) -> TypeDef {
18014 let mut query = self.selection.select("withOptional");
18015 query = query.arg("optional", optional);
18016 TypeDef {
18017 proc: self.proc.clone(),
18018 selection: query,
18019 graphql_client: self.graphql_client.clone(),
18020 }
18021 }
18022 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
18024 let mut query = self.selection.select("withKind");
18025 query = query.arg("kind", kind);
18026 TypeDef {
18027 proc: self.proc.clone(),
18028 selection: query,
18029 graphql_client: self.graphql_client.clone(),
18030 }
18031 }
18032 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
18038 let mut query = self.selection.select("withScalar");
18039 query = query.arg("name", name.into());
18040 TypeDef {
18041 proc: self.proc.clone(),
18042 selection: query,
18043 graphql_client: self.graphql_client.clone(),
18044 }
18045 }
18046 pub fn with_scalar_opts<'a>(
18052 &self,
18053 name: impl Into<String>,
18054 opts: TypeDefWithScalarOpts<'a>,
18055 ) -> TypeDef {
18056 let mut query = self.selection.select("withScalar");
18057 query = query.arg("name", name.into());
18058 if let Some(description) = opts.description {
18059 query = query.arg("description", description);
18060 }
18061 TypeDef {
18062 proc: self.proc.clone(),
18063 selection: query,
18064 graphql_client: self.graphql_client.clone(),
18065 }
18066 }
18067 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
18069 let mut query = self.selection.select("withListOf");
18070 query = query.arg_lazy(
18071 "elementType",
18072 Box::new(move || {
18073 let element_type = element_type.clone();
18074 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
18075 }),
18076 );
18077 TypeDef {
18078 proc: self.proc.clone(),
18079 selection: query,
18080 graphql_client: self.graphql_client.clone(),
18081 }
18082 }
18083 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
18090 let mut query = self.selection.select("withObject");
18091 query = query.arg("name", name.into());
18092 TypeDef {
18093 proc: self.proc.clone(),
18094 selection: query,
18095 graphql_client: self.graphql_client.clone(),
18096 }
18097 }
18098 pub fn with_object_opts<'a>(
18105 &self,
18106 name: impl Into<String>,
18107 opts: TypeDefWithObjectOpts<'a>,
18108 ) -> TypeDef {
18109 let mut query = self.selection.select("withObject");
18110 query = query.arg("name", name.into());
18111 if let Some(description) = opts.description {
18112 query = query.arg("description", description);
18113 }
18114 if let Some(source_map) = opts.source_map {
18115 query = query.arg("sourceMap", source_map);
18116 }
18117 if let Some(deprecated) = opts.deprecated {
18118 query = query.arg("deprecated", deprecated);
18119 }
18120 TypeDef {
18121 proc: self.proc.clone(),
18122 selection: query,
18123 graphql_client: self.graphql_client.clone(),
18124 }
18125 }
18126 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
18132 let mut query = self.selection.select("withInterface");
18133 query = query.arg("name", name.into());
18134 TypeDef {
18135 proc: self.proc.clone(),
18136 selection: query,
18137 graphql_client: self.graphql_client.clone(),
18138 }
18139 }
18140 pub fn with_interface_opts<'a>(
18146 &self,
18147 name: impl Into<String>,
18148 opts: TypeDefWithInterfaceOpts<'a>,
18149 ) -> TypeDef {
18150 let mut query = self.selection.select("withInterface");
18151 query = query.arg("name", name.into());
18152 if let Some(description) = opts.description {
18153 query = query.arg("description", description);
18154 }
18155 if let Some(source_map) = opts.source_map {
18156 query = query.arg("sourceMap", source_map);
18157 }
18158 TypeDef {
18159 proc: self.proc.clone(),
18160 selection: query,
18161 graphql_client: self.graphql_client.clone(),
18162 }
18163 }
18164 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
18172 let mut query = self.selection.select("withField");
18173 query = query.arg("name", name.into());
18174 query = query.arg_lazy(
18175 "typeDef",
18176 Box::new(move || {
18177 let type_def = type_def.clone();
18178 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
18179 }),
18180 );
18181 TypeDef {
18182 proc: self.proc.clone(),
18183 selection: query,
18184 graphql_client: self.graphql_client.clone(),
18185 }
18186 }
18187 pub fn with_field_opts<'a>(
18195 &self,
18196 name: impl Into<String>,
18197 type_def: impl IntoID<Id>,
18198 opts: TypeDefWithFieldOpts<'a>,
18199 ) -> TypeDef {
18200 let mut query = self.selection.select("withField");
18201 query = query.arg("name", name.into());
18202 query = query.arg_lazy(
18203 "typeDef",
18204 Box::new(move || {
18205 let type_def = type_def.clone();
18206 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
18207 }),
18208 );
18209 if let Some(description) = opts.description {
18210 query = query.arg("description", description);
18211 }
18212 if let Some(source_map) = opts.source_map {
18213 query = query.arg("sourceMap", source_map);
18214 }
18215 if let Some(deprecated) = opts.deprecated {
18216 query = query.arg("deprecated", deprecated);
18217 }
18218 TypeDef {
18219 proc: self.proc.clone(),
18220 selection: query,
18221 graphql_client: self.graphql_client.clone(),
18222 }
18223 }
18224 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
18226 let mut query = self.selection.select("withFunction");
18227 query = query.arg_lazy(
18228 "function",
18229 Box::new(move || {
18230 let function = function.clone();
18231 Box::pin(async move { function.into_id().await.unwrap().quote() })
18232 }),
18233 );
18234 TypeDef {
18235 proc: self.proc.clone(),
18236 selection: query,
18237 graphql_client: self.graphql_client.clone(),
18238 }
18239 }
18240 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
18242 let mut query = self.selection.select("withConstructor");
18243 query = query.arg_lazy(
18244 "function",
18245 Box::new(move || {
18246 let function = function.clone();
18247 Box::pin(async move { function.into_id().await.unwrap().quote() })
18248 }),
18249 );
18250 TypeDef {
18251 proc: self.proc.clone(),
18252 selection: query,
18253 graphql_client: self.graphql_client.clone(),
18254 }
18255 }
18256 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
18264 let mut query = self.selection.select("withEnum");
18265 query = query.arg("name", name.into());
18266 TypeDef {
18267 proc: self.proc.clone(),
18268 selection: query,
18269 graphql_client: self.graphql_client.clone(),
18270 }
18271 }
18272 pub fn with_enum_opts<'a>(
18280 &self,
18281 name: impl Into<String>,
18282 opts: TypeDefWithEnumOpts<'a>,
18283 ) -> TypeDef {
18284 let mut query = self.selection.select("withEnum");
18285 query = query.arg("name", name.into());
18286 if let Some(description) = opts.description {
18287 query = query.arg("description", description);
18288 }
18289 if let Some(source_map) = opts.source_map {
18290 query = query.arg("sourceMap", source_map);
18291 }
18292 TypeDef {
18293 proc: self.proc.clone(),
18294 selection: query,
18295 graphql_client: self.graphql_client.clone(),
18296 }
18297 }
18298 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
18305 let mut query = self.selection.select("withEnumValue");
18306 query = query.arg("value", value.into());
18307 TypeDef {
18308 proc: self.proc.clone(),
18309 selection: query,
18310 graphql_client: self.graphql_client.clone(),
18311 }
18312 }
18313 pub fn with_enum_value_opts<'a>(
18320 &self,
18321 value: impl Into<String>,
18322 opts: TypeDefWithEnumValueOpts<'a>,
18323 ) -> TypeDef {
18324 let mut query = self.selection.select("withEnumValue");
18325 query = query.arg("value", value.into());
18326 if let Some(description) = opts.description {
18327 query = query.arg("description", description);
18328 }
18329 if let Some(source_map) = opts.source_map {
18330 query = query.arg("sourceMap", source_map);
18331 }
18332 if let Some(deprecated) = opts.deprecated {
18333 query = query.arg("deprecated", deprecated);
18334 }
18335 TypeDef {
18336 proc: self.proc.clone(),
18337 selection: query,
18338 graphql_client: self.graphql_client.clone(),
18339 }
18340 }
18341 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
18348 let mut query = self.selection.select("withEnumMember");
18349 query = query.arg("name", name.into());
18350 TypeDef {
18351 proc: self.proc.clone(),
18352 selection: query,
18353 graphql_client: self.graphql_client.clone(),
18354 }
18355 }
18356 pub fn with_enum_member_opts<'a>(
18363 &self,
18364 name: impl Into<String>,
18365 opts: TypeDefWithEnumMemberOpts<'a>,
18366 ) -> TypeDef {
18367 let mut query = self.selection.select("withEnumMember");
18368 query = query.arg("name", name.into());
18369 if let Some(value) = opts.value {
18370 query = query.arg("value", value);
18371 }
18372 if let Some(description) = opts.description {
18373 query = query.arg("description", description);
18374 }
18375 if let Some(source_map) = opts.source_map {
18376 query = query.arg("sourceMap", source_map);
18377 }
18378 if let Some(deprecated) = opts.deprecated {
18379 query = query.arg("deprecated", deprecated);
18380 }
18381 TypeDef {
18382 proc: self.proc.clone(),
18383 selection: query,
18384 graphql_client: self.graphql_client.clone(),
18385 }
18386 }
18387 pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
18389 let query = self.selection.select("asList");
18390 let query = query.select("id");
18391 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18392 Ok(id.map(|id| ListTypeDef {
18393 proc: self.proc.clone(),
18394 selection: query
18395 .root()
18396 .select("node")
18397 .arg("id", &id.0)
18398 .inline_fragment("ListTypeDef"),
18399 graphql_client: self.graphql_client.clone(),
18400 }))
18401 }
18402 pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
18404 let query = self.selection.select("asObject");
18405 let query = query.select("id");
18406 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18407 Ok(id.map(|id| ObjectTypeDef {
18408 proc: self.proc.clone(),
18409 selection: query
18410 .root()
18411 .select("node")
18412 .arg("id", &id.0)
18413 .inline_fragment("ObjectTypeDef"),
18414 graphql_client: self.graphql_client.clone(),
18415 }))
18416 }
18417 pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
18419 let query = self.selection.select("asInterface");
18420 let query = query.select("id");
18421 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18422 Ok(id.map(|id| InterfaceTypeDef {
18423 proc: self.proc.clone(),
18424 selection: query
18425 .root()
18426 .select("node")
18427 .arg("id", &id.0)
18428 .inline_fragment("InterfaceTypeDef"),
18429 graphql_client: self.graphql_client.clone(),
18430 }))
18431 }
18432 pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
18434 let query = self.selection.select("asInput");
18435 let query = query.select("id");
18436 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18437 Ok(id.map(|id| InputTypeDef {
18438 proc: self.proc.clone(),
18439 selection: query
18440 .root()
18441 .select("node")
18442 .arg("id", &id.0)
18443 .inline_fragment("InputTypeDef"),
18444 graphql_client: self.graphql_client.clone(),
18445 }))
18446 }
18447 pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
18449 let query = self.selection.select("asScalar");
18450 let query = query.select("id");
18451 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18452 Ok(id.map(|id| ScalarTypeDef {
18453 proc: self.proc.clone(),
18454 selection: query
18455 .root()
18456 .select("node")
18457 .arg("id", &id.0)
18458 .inline_fragment("ScalarTypeDef"),
18459 graphql_client: self.graphql_client.clone(),
18460 }))
18461 }
18462 pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
18464 let query = self.selection.select("asEnum");
18465 let query = query.select("id");
18466 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18467 Ok(id.map(|id| EnumTypeDef {
18468 proc: self.proc.clone(),
18469 selection: query
18470 .root()
18471 .select("node")
18472 .arg("id", &id.0)
18473 .inline_fragment("EnumTypeDef"),
18474 graphql_client: self.graphql_client.clone(),
18475 }))
18476 }
18477}
18478impl Node for TypeDef {
18479 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18480 let query = self.selection.select("id");
18481 let graphql_client = self.graphql_client.clone();
18482 async move { query.execute(graphql_client).await }
18483 }
18484}
18485#[derive(Clone)]
18486pub struct Volume {
18487 pub proc: Option<Arc<DaggerSessionProc>>,
18488 pub selection: Selection,
18489 pub graphql_client: DynGraphQLClient,
18490}
18491impl IntoID<Id> for Volume {
18492 fn into_id(
18493 self,
18494 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18495 Box::pin(async move { self.id().await })
18496 }
18497}
18498impl Loadable for Volume {
18499 fn graphql_type() -> &'static str {
18500 "Volume"
18501 }
18502 fn from_query(
18503 proc: Option<Arc<DaggerSessionProc>>,
18504 selection: Selection,
18505 graphql_client: DynGraphQLClient,
18506 ) -> Self {
18507 Self {
18508 proc,
18509 selection,
18510 graphql_client,
18511 }
18512 }
18513}
18514impl Volume {
18515 pub async fn id(&self) -> Result<Id, DaggerError> {
18517 let query = self.selection.select("id");
18518 query.execute(self.graphql_client.clone()).await
18519 }
18520}
18521impl Node for Volume {
18522 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18523 let query = self.selection.select("id");
18524 let graphql_client = self.graphql_client.clone();
18525 async move { query.execute(graphql_client).await }
18526 }
18527}
18528#[derive(Clone)]
18529pub struct Workspace {
18530 pub proc: Option<Arc<DaggerSessionProc>>,
18531 pub selection: Selection,
18532 pub graphql_client: DynGraphQLClient,
18533}
18534#[derive(Builder, Debug, PartialEq)]
18535pub struct WorkspaceMigrateModuleOpts<'a> {
18536 #[builder(setter(into, strip_option), default)]
18538 pub path: Option<&'a str>,
18539}
18540#[derive(Builder, Debug, PartialEq)]
18541pub struct WorkspaceCompareCommitsFromOpts<'a> {
18542 #[builder(setter(into, strip_option), default)]
18544 pub commits: Option<Vec<&'a str>>,
18545 #[builder(setter(into, strip_option), default)]
18547 pub max_commits: Option<isize>,
18548}
18549#[derive(Builder, Debug, PartialEq)]
18550pub struct WorkspaceWithCommitsFromOpts<'a> {
18551 #[builder(setter(into, strip_option), default)]
18553 pub commits: Option<Vec<&'a str>>,
18554 #[builder(setter(into, strip_option), default)]
18556 pub max_commits: Option<isize>,
18557}
18558#[derive(Builder, Debug, PartialEq)]
18559pub struct WorkspaceWithCommitOpts<'a> {
18560 #[builder(setter(into, strip_option), default)]
18562 pub author_email: Option<&'a str>,
18563 #[builder(setter(into, strip_option), default)]
18565 pub author_name: Option<&'a str>,
18566 #[builder(setter(into, strip_option), default)]
18568 pub signoff: Option<bool>,
18569}
18570#[derive(Builder, Debug, PartialEq)]
18571pub struct WorkspaceWithResetOpts {
18572 #[builder(setter(into, strip_option), default)]
18574 pub hard: Option<bool>,
18575}
18576#[derive(Builder, Debug, PartialEq)]
18577pub struct WorkspaceDirectoryOpts<'a> {
18578 #[builder(setter(into, strip_option), default)]
18580 pub exclude: Option<Vec<&'a str>>,
18581 #[builder(setter(into, strip_option), default)]
18583 pub gitignore: Option<bool>,
18584 #[builder(setter(into, strip_option), default)]
18586 pub include: Option<Vec<&'a str>>,
18587}
18588#[derive(Builder, Debug, PartialEq)]
18589pub struct WorkspaceSearchOpts<'a> {
18590 #[builder(setter(into, strip_option), default)]
18592 pub dotall: Option<bool>,
18593 #[builder(setter(into, strip_option), default)]
18595 pub files_only: Option<bool>,
18596 #[builder(setter(into, strip_option), default)]
18598 pub globs: Option<Vec<&'a str>>,
18599 #[builder(setter(into, strip_option), default)]
18601 pub insensitive: Option<bool>,
18602 #[builder(setter(into, strip_option), default)]
18604 pub limit: Option<isize>,
18605 #[builder(setter(into, strip_option), default)]
18607 pub literal: Option<bool>,
18608 #[builder(setter(into, strip_option), default)]
18610 pub multiline: Option<bool>,
18611 #[builder(setter(into, strip_option), default)]
18613 pub paths: Option<Vec<&'a str>>,
18614 #[builder(setter(into, strip_option), default)]
18616 pub skip_hidden: Option<bool>,
18617 #[builder(setter(into, strip_option), default)]
18619 pub skip_ignored: Option<bool>,
18620}
18621#[derive(Builder, Debug, PartialEq)]
18622pub struct WorkspaceFindUpOpts<'a> {
18623 #[builder(setter(into, strip_option), default)]
18625 pub from: Option<&'a str>,
18626}
18627#[derive(Builder, Debug, PartialEq)]
18628pub struct WorkspaceFindRootsOpts<'a> {
18629 #[builder(setter(into, strip_option), default)]
18631 pub exclude: Option<Vec<&'a str>>,
18632 #[builder(setter(into, strip_option), default)]
18634 pub start: Option<&'a str>,
18635}
18636#[derive(Builder, Debug, PartialEq)]
18637pub struct WorkspaceWithNewFileOpts {
18638 #[builder(setter(into, strip_option), default)]
18640 pub permissions: Option<isize>,
18641}
18642#[derive(Builder, Debug, PartialEq)]
18643pub struct WorkspaceWithFileOpts {
18644 #[builder(setter(into, strip_option), default)]
18646 pub permissions: Option<isize>,
18647}
18648#[derive(Builder, Debug, PartialEq)]
18649pub struct WorkspaceWithPatchFileOpts {
18650 #[builder(setter(into, strip_option), default)]
18652 pub on_conflict: Option<PatchConflict>,
18653}
18654#[derive(Builder, Debug, PartialEq)]
18655pub struct WorkspaceWithModuleOpts<'a> {
18656 #[builder(setter(into, strip_option), default)]
18658 pub here: Option<bool>,
18659 #[builder(setter(into, strip_option), default)]
18661 pub name: Option<&'a str>,
18662}
18663#[derive(Builder, Debug, PartialEq)]
18664pub struct WorkspaceWithoutModuleOpts {
18665 #[builder(setter(into, strip_option), default)]
18667 pub here: Option<bool>,
18668}
18669#[derive(Builder, Debug, PartialEq)]
18670pub struct WorkspaceWithSdkOpts<'a> {
18671 #[builder(setter(into, strip_option), default)]
18673 pub as_sdk_name: Option<&'a str>,
18674 #[builder(setter(into, strip_option), default)]
18676 pub here: Option<bool>,
18677 #[builder(setter(into, strip_option), default)]
18679 pub name: Option<&'a str>,
18680}
18681#[derive(Builder, Debug, PartialEq)]
18682pub struct WorkspaceWithoutSdkOpts {
18683 #[builder(setter(into, strip_option), default)]
18685 pub here: Option<bool>,
18686}
18687#[derive(Builder, Debug, PartialEq)]
18688pub struct WorkspaceWithInitModuleOpts<'a> {
18689 #[builder(setter(into, strip_option), default)]
18691 pub entrypoint: Option<bool>,
18692 #[builder(setter(into, strip_option), default)]
18694 pub install: Option<bool>,
18695 #[builder(setter(into, strip_option), default)]
18697 pub name: Option<&'a str>,
18698 #[builder(setter(into, strip_option), default)]
18700 pub path: Option<&'a str>,
18701 #[builder(setter(into, strip_option), default)]
18703 pub settings: Option<Json>,
18704}
18705#[derive(Builder, Debug, PartialEq)]
18706pub struct WorkspaceWithClientOpts<'a> {
18707 #[builder(setter(into, strip_option), default)]
18709 pub sdk: Option<&'a str>,
18710 #[builder(setter(into, strip_option), default)]
18712 pub settings: Option<Json>,
18713}
18714#[derive(Builder, Debug, PartialEq)]
18715pub struct WorkspaceWithoutClientOpts<'a> {
18716 #[builder(setter(into, strip_option), default)]
18718 pub sdk: Option<&'a str>,
18719}
18720#[derive(Builder, Debug, PartialEq)]
18721pub struct WorkspaceWithUpdatedClientsOpts<'a> {
18722 #[builder(setter(into, strip_option), default)]
18724 pub all: Option<bool>,
18725 #[builder(setter(into, strip_option), default)]
18727 pub modules: Option<Vec<&'a str>>,
18728 #[builder(setter(into, strip_option), default)]
18730 pub sdk: Option<&'a str>,
18731}
18732#[derive(Builder, Debug, PartialEq)]
18733pub struct WorkspaceWithConfigValueOpts<'a> {
18734 #[builder(setter(into, strip_option), default)]
18736 pub here: Option<bool>,
18737 #[builder(setter(into, strip_option), default)]
18739 pub values: Option<Vec<&'a str>>,
18740}
18741#[derive(Builder, Debug, PartialEq)]
18742pub struct WorkspaceWithoutConfigValueOpts {
18743 #[builder(setter(into, strip_option), default)]
18745 pub here: Option<bool>,
18746}
18747#[derive(Builder, Debug, PartialEq)]
18748pub struct WorkspaceWithConfigEnvOpts {
18749 #[builder(setter(into, strip_option), default)]
18751 pub here: Option<bool>,
18752}
18753#[derive(Builder, Debug, PartialEq)]
18754pub struct WorkspaceWithoutConfigEnvOpts {
18755 #[builder(setter(into, strip_option), default)]
18757 pub here: Option<bool>,
18758}
18759#[derive(Builder, Debug, PartialEq)]
18760pub struct WorkspaceWithUpdatedLockOpts {
18761 #[builder(setter(into, strip_option), default)]
18763 pub no_generate: Option<bool>,
18764}
18765#[derive(Builder, Debug, PartialEq)]
18766pub struct WorkspaceWithUpdatedModulesOpts<'a> {
18767 #[builder(setter(into, strip_option), default)]
18769 pub names: Option<Vec<&'a str>>,
18770 #[builder(setter(into, strip_option), default)]
18772 pub source: Option<&'a str>,
18773 #[builder(setter(into, strip_option), default)]
18775 pub version: Option<&'a str>,
18776}
18777#[derive(Builder, Debug, PartialEq)]
18778pub struct WorkspaceChangesOpts {
18779 #[builder(setter(into, strip_option), default)]
18781 pub from: Option<Id>,
18782}
18783#[derive(Builder, Debug, PartialEq)]
18784pub struct WorkspaceExportOpts<'a> {
18785 #[builder(setter(into, strip_option), default)]
18787 pub from: Option<Id>,
18788 #[builder(setter(into, strip_option), default)]
18790 pub path: Option<&'a str>,
18791}
18792#[derive(Builder, Debug, PartialEq)]
18793pub struct WorkspaceConfigReadOpts<'a> {
18794 #[builder(setter(into, strip_option), default)]
18796 pub effective: Option<bool>,
18797 #[builder(setter(into, strip_option), default)]
18799 pub key: Option<&'a str>,
18800}
18801#[derive(Builder, Debug, PartialEq)]
18802pub struct WorkspaceArtifactsOpts<'a> {
18803 #[builder(setter(into, strip_option), default)]
18805 pub include: Option<Vec<&'a str>>,
18806}
18807#[derive(Builder, Debug, PartialEq)]
18808pub struct WorkspaceMigrateOpts<'a> {
18809 #[builder(setter(into, strip_option), default)]
18811 pub modules: Option<Vec<&'a str>>,
18812}
18813impl IntoID<Id> for Workspace {
18814 fn into_id(
18815 self,
18816 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18817 Box::pin(async move { self.id().await })
18818 }
18819}
18820impl Loadable for Workspace {
18821 fn graphql_type() -> &'static str {
18822 "Workspace"
18823 }
18824 fn from_query(
18825 proc: Option<Arc<DaggerSessionProc>>,
18826 selection: Selection,
18827 graphql_client: DynGraphQLClient,
18828 ) -> Self {
18829 Self {
18830 proc,
18831 selection,
18832 graphql_client,
18833 }
18834 }
18835}
18836impl Workspace {
18837 pub async fn id(&self) -> Result<Id, DaggerError> {
18839 let query = self.selection.select("id");
18840 query.execute(self.graphql_client.clone()).await
18841 }
18842 pub fn resolve(&self, value: impl Into<String>) -> Address {
18851 let mut query = self.selection.select("resolve");
18852 query = query.arg("value", value.into());
18853 Address {
18854 proc: self.proc.clone(),
18855 selection: query,
18856 graphql_client: self.graphql_client.clone(),
18857 }
18858 }
18859 pub fn with_initialized(&self) -> Workspace {
18862 let query = self.selection.select("withInitialized");
18863 Workspace {
18864 proc: self.proc.clone(),
18865 selection: query,
18866 graphql_client: self.graphql_client.clone(),
18867 }
18868 }
18869 pub fn migrate_module(&self) -> WorkspaceMigration {
18876 let query = self.selection.select("migrateModule");
18877 WorkspaceMigration {
18878 proc: self.proc.clone(),
18879 selection: query,
18880 graphql_client: self.graphql_client.clone(),
18881 }
18882 }
18883 pub fn migrate_module_opts<'a>(
18890 &self,
18891 opts: WorkspaceMigrateModuleOpts<'a>,
18892 ) -> WorkspaceMigration {
18893 let mut query = self.selection.select("migrateModule");
18894 if let Some(path) = opts.path {
18895 query = query.arg("path", path);
18896 }
18897 WorkspaceMigration {
18898 proc: self.proc.clone(),
18899 selection: query,
18900 graphql_client: self.graphql_client.clone(),
18901 }
18902 }
18903 pub async fn compare_commits_from(
18912 &self,
18913 source: impl IntoID<Id>,
18914 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18915 let mut query = self.selection.select("compareCommitsFrom");
18916 query = query.arg_lazy(
18917 "source",
18918 Box::new(move || {
18919 let source = source.clone();
18920 Box::pin(async move { source.into_id().await.unwrap().quote() })
18921 }),
18922 );
18923 let query = query.select("id");
18924 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18925 Ok(ids
18926 .into_iter()
18927 .map(|id| WorkspaceCommitPick {
18928 proc: self.proc.clone(),
18929 selection: crate::querybuilder::query()
18930 .select("node")
18931 .arg("id", &id.0)
18932 .inline_fragment("WorkspaceCommitPick"),
18933 graphql_client: self.graphql_client.clone(),
18934 })
18935 .collect())
18936 }
18937 pub async fn compare_commits_from_opts<'a>(
18946 &self,
18947 source: impl IntoID<Id>,
18948 opts: WorkspaceCompareCommitsFromOpts<'a>,
18949 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18950 let mut query = self.selection.select("compareCommitsFrom");
18951 query = query.arg_lazy(
18952 "source",
18953 Box::new(move || {
18954 let source = source.clone();
18955 Box::pin(async move { source.into_id().await.unwrap().quote() })
18956 }),
18957 );
18958 if let Some(commits) = opts.commits {
18959 query = query.arg("commits", commits);
18960 }
18961 if let Some(max_commits) = opts.max_commits {
18962 query = query.arg("maxCommits", max_commits);
18963 }
18964 let query = query.select("id");
18965 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18966 Ok(ids
18967 .into_iter()
18968 .map(|id| WorkspaceCommitPick {
18969 proc: self.proc.clone(),
18970 selection: crate::querybuilder::query()
18971 .select("node")
18972 .arg("id", &id.0)
18973 .inline_fragment("WorkspaceCommitPick"),
18974 graphql_client: self.graphql_client.clone(),
18975 })
18976 .collect())
18977 }
18978 pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
18988 let mut query = self.selection.select("withCommitsFrom");
18989 query = query.arg_lazy(
18990 "source",
18991 Box::new(move || {
18992 let source = source.clone();
18993 Box::pin(async move { source.into_id().await.unwrap().quote() })
18994 }),
18995 );
18996 Workspace {
18997 proc: self.proc.clone(),
18998 selection: query,
18999 graphql_client: self.graphql_client.clone(),
19000 }
19001 }
19002 pub fn with_commits_from_opts<'a>(
19012 &self,
19013 source: impl IntoID<Id>,
19014 opts: WorkspaceWithCommitsFromOpts<'a>,
19015 ) -> Workspace {
19016 let mut query = self.selection.select("withCommitsFrom");
19017 query = query.arg_lazy(
19018 "source",
19019 Box::new(move || {
19020 let source = source.clone();
19021 Box::pin(async move { source.into_id().await.unwrap().quote() })
19022 }),
19023 );
19024 if let Some(commits) = opts.commits {
19025 query = query.arg("commits", commits);
19026 }
19027 if let Some(max_commits) = opts.max_commits {
19028 query = query.arg("maxCommits", max_commits);
19029 }
19030 Workspace {
19031 proc: self.proc.clone(),
19032 selection: query,
19033 graphql_client: self.graphql_client.clone(),
19034 }
19035 }
19036 pub fn with_commit(
19048 &self,
19049 changes: impl IntoID<Id>,
19050 message: impl Into<String>,
19051 date: impl Into<String>,
19052 ) -> Workspace {
19053 let mut query = self.selection.select("withCommit");
19054 query = query.arg_lazy(
19055 "changes",
19056 Box::new(move || {
19057 let changes = changes.clone();
19058 Box::pin(async move { changes.into_id().await.unwrap().quote() })
19059 }),
19060 );
19061 query = query.arg("message", message.into());
19062 query = query.arg("date", date.into());
19063 Workspace {
19064 proc: self.proc.clone(),
19065 selection: query,
19066 graphql_client: self.graphql_client.clone(),
19067 }
19068 }
19069 pub fn with_commit_opts<'a>(
19081 &self,
19082 changes: impl IntoID<Id>,
19083 message: impl Into<String>,
19084 date: impl Into<String>,
19085 opts: WorkspaceWithCommitOpts<'a>,
19086 ) -> Workspace {
19087 let mut query = self.selection.select("withCommit");
19088 query = query.arg_lazy(
19089 "changes",
19090 Box::new(move || {
19091 let changes = changes.clone();
19092 Box::pin(async move { changes.into_id().await.unwrap().quote() })
19093 }),
19094 );
19095 query = query.arg("message", message.into());
19096 query = query.arg("date", date.into());
19097 if let Some(author_name) = opts.author_name {
19098 query = query.arg("authorName", author_name);
19099 }
19100 if let Some(author_email) = opts.author_email {
19101 query = query.arg("authorEmail", author_email);
19102 }
19103 if let Some(signoff) = opts.signoff {
19104 query = query.arg("signoff", signoff);
19105 }
19106 Workspace {
19107 proc: self.proc.clone(),
19108 selection: query,
19109 graphql_client: self.graphql_client.clone(),
19110 }
19111 }
19112 pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
19122 let mut query = self.selection.select("withReset");
19123 query = query.arg("commit", commit.into());
19124 Workspace {
19125 proc: self.proc.clone(),
19126 selection: query,
19127 graphql_client: self.graphql_client.clone(),
19128 }
19129 }
19130 pub fn with_reset_opts(
19140 &self,
19141 commit: impl Into<String>,
19142 opts: WorkspaceWithResetOpts,
19143 ) -> Workspace {
19144 let mut query = self.selection.select("withReset");
19145 query = query.arg("commit", commit.into());
19146 if let Some(hard) = opts.hard {
19147 query = query.arg("hard", hard);
19148 }
19149 Workspace {
19150 proc: self.proc.clone(),
19151 selection: query,
19152 graphql_client: self.graphql_client.clone(),
19153 }
19154 }
19155 pub fn snapshot(&self) -> Workspace {
19161 let query = self.selection.select("snapshot");
19162 Workspace {
19163 proc: self.proc.clone(),
19164 selection: query,
19165 graphql_client: self.graphql_client.clone(),
19166 }
19167 }
19168 pub fn with_config_paths(
19175 &self,
19176 config_file: impl Into<String>,
19177 lock_file: impl Into<String>,
19178 ) -> Workspace {
19179 let mut query = self.selection.select("withConfigPaths");
19180 query = query.arg("configFile", config_file.into());
19181 query = query.arg("lockFile", lock_file.into());
19182 Workspace {
19183 proc: self.proc.clone(),
19184 selection: query,
19185 graphql_client: self.graphql_client.clone(),
19186 }
19187 }
19188 pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
19194 let mut query = self.selection.select("withConfigEnvironment");
19195 query = query.arg("name", name.into());
19196 Workspace {
19197 proc: self.proc.clone(),
19198 selection: query,
19199 graphql_client: self.graphql_client.clone(),
19200 }
19201 }
19202 pub fn with_user_config(&self) -> Workspace {
19206 let query = self.selection.select("withUserConfig");
19207 Workspace {
19208 proc: self.proc.clone(),
19209 selection: query,
19210 graphql_client: self.graphql_client.clone(),
19211 }
19212 }
19213 pub async fn config_file(&self) -> Result<String, DaggerError> {
19215 let query = self.selection.select("configFile");
19216 query.execute(self.graphql_client.clone()).await
19217 }
19218 pub fn directory(&self, path: impl Into<String>) -> Directory {
19226 let mut query = self.selection.select("directory");
19227 query = query.arg("path", path.into());
19228 Directory {
19229 proc: self.proc.clone(),
19230 selection: query,
19231 graphql_client: self.graphql_client.clone(),
19232 }
19233 }
19234 pub fn directory_opts<'a>(
19242 &self,
19243 path: impl Into<String>,
19244 opts: WorkspaceDirectoryOpts<'a>,
19245 ) -> Directory {
19246 let mut query = self.selection.select("directory");
19247 query = query.arg("path", path.into());
19248 if let Some(exclude) = opts.exclude {
19249 query = query.arg("exclude", exclude);
19250 }
19251 if let Some(include) = opts.include {
19252 query = query.arg("include", include);
19253 }
19254 if let Some(gitignore) = opts.gitignore {
19255 query = query.arg("gitignore", gitignore);
19256 }
19257 Directory {
19258 proc: self.proc.clone(),
19259 selection: query,
19260 graphql_client: self.graphql_client.clone(),
19261 }
19262 }
19263 pub fn file(&self, path: impl Into<String>) -> File {
19270 let mut query = self.selection.select("file");
19271 query = query.arg("path", path.into());
19272 File {
19273 proc: self.proc.clone(),
19274 selection: query,
19275 graphql_client: self.graphql_client.clone(),
19276 }
19277 }
19278 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
19285 let mut query = self.selection.select("glob");
19286 query = query.arg("pattern", pattern.into());
19287 query.execute(self.graphql_client.clone()).await
19288 }
19289 pub async fn search(
19298 &self,
19299 pattern: impl Into<String>,
19300 ) -> Result<Vec<SearchResult>, DaggerError> {
19301 let mut query = self.selection.select("search");
19302 query = query.arg("pattern", pattern.into());
19303 let query = query.select("id");
19304 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19305 Ok(ids
19306 .into_iter()
19307 .map(|id| SearchResult {
19308 proc: self.proc.clone(),
19309 selection: crate::querybuilder::query()
19310 .select("node")
19311 .arg("id", &id.0)
19312 .inline_fragment("SearchResult"),
19313 graphql_client: self.graphql_client.clone(),
19314 })
19315 .collect())
19316 }
19317 pub async fn search_opts<'a>(
19326 &self,
19327 pattern: impl Into<String>,
19328 opts: WorkspaceSearchOpts<'a>,
19329 ) -> Result<Vec<SearchResult>, DaggerError> {
19330 let mut query = self.selection.select("search");
19331 query = query.arg("pattern", pattern.into());
19332 if let Some(paths) = opts.paths {
19333 query = query.arg("paths", paths);
19334 }
19335 if let Some(globs) = opts.globs {
19336 query = query.arg("globs", globs);
19337 }
19338 if let Some(literal) = opts.literal {
19339 query = query.arg("literal", literal);
19340 }
19341 if let Some(multiline) = opts.multiline {
19342 query = query.arg("multiline", multiline);
19343 }
19344 if let Some(dotall) = opts.dotall {
19345 query = query.arg("dotall", dotall);
19346 }
19347 if let Some(insensitive) = opts.insensitive {
19348 query = query.arg("insensitive", insensitive);
19349 }
19350 if let Some(skip_ignored) = opts.skip_ignored {
19351 query = query.arg("skipIgnored", skip_ignored);
19352 }
19353 if let Some(skip_hidden) = opts.skip_hidden {
19354 query = query.arg("skipHidden", skip_hidden);
19355 }
19356 if let Some(files_only) = opts.files_only {
19357 query = query.arg("filesOnly", files_only);
19358 }
19359 if let Some(limit) = opts.limit {
19360 query = query.arg("limit", limit);
19361 }
19362 let query = query.select("id");
19363 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19364 Ok(ids
19365 .into_iter()
19366 .map(|id| SearchResult {
19367 proc: self.proc.clone(),
19368 selection: crate::querybuilder::query()
19369 .select("node")
19370 .arg("id", &id.0)
19371 .inline_fragment("SearchResult"),
19372 graphql_client: self.graphql_client.clone(),
19373 })
19374 .collect())
19375 }
19376 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
19386 let mut query = self.selection.select("findUp");
19387 query = query.arg("name", name.into());
19388 query.execute(self.graphql_client.clone()).await
19389 }
19390 pub async fn find_up_opts<'a>(
19400 &self,
19401 name: impl Into<String>,
19402 opts: WorkspaceFindUpOpts<'a>,
19403 ) -> Result<String, DaggerError> {
19404 let mut query = self.selection.select("findUp");
19405 query = query.arg("name", name.into());
19406 if let Some(from) = opts.from {
19407 query = query.arg("from", from);
19408 }
19409 query.execute(self.graphql_client.clone()).await
19410 }
19411 pub async fn find_roots(
19420 &self,
19421 markers: Vec<impl Into<String>>,
19422 ) -> Result<Vec<String>, DaggerError> {
19423 let mut query = self.selection.select("findRoots");
19424 query = query.arg(
19425 "markers",
19426 markers
19427 .into_iter()
19428 .map(|i| i.into())
19429 .collect::<Vec<String>>(),
19430 );
19431 query.execute(self.graphql_client.clone()).await
19432 }
19433 pub async fn find_roots_opts<'a>(
19442 &self,
19443 markers: Vec<impl Into<String>>,
19444 opts: WorkspaceFindRootsOpts<'a>,
19445 ) -> Result<Vec<String>, DaggerError> {
19446 let mut query = self.selection.select("findRoots");
19447 query = query.arg(
19448 "markers",
19449 markers
19450 .into_iter()
19451 .map(|i| i.into())
19452 .collect::<Vec<String>>(),
19453 );
19454 if let Some(start) = opts.start {
19455 query = query.arg("start", start);
19456 }
19457 if let Some(exclude) = opts.exclude {
19458 query = query.arg("exclude", exclude);
19459 }
19460 query.execute(self.graphql_client.clone()).await
19461 }
19462 pub fn git(&self) -> WorkspaceGit {
19464 let query = self.selection.select("git");
19465 WorkspaceGit {
19466 proc: self.proc.clone(),
19467 selection: query,
19468 graphql_client: self.graphql_client.clone(),
19469 }
19470 }
19471 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
19479 let mut query = self.selection.select("withNewFile");
19480 query = query.arg("path", path.into());
19481 query = query.arg("contents", contents.into());
19482 Workspace {
19483 proc: self.proc.clone(),
19484 selection: query,
19485 graphql_client: self.graphql_client.clone(),
19486 }
19487 }
19488 pub fn with_new_file_opts(
19496 &self,
19497 path: impl Into<String>,
19498 contents: impl Into<String>,
19499 opts: WorkspaceWithNewFileOpts,
19500 ) -> Workspace {
19501 let mut query = self.selection.select("withNewFile");
19502 query = query.arg("path", path.into());
19503 query = query.arg("contents", contents.into());
19504 if let Some(permissions) = opts.permissions {
19505 query = query.arg("permissions", permissions);
19506 }
19507 Workspace {
19508 proc: self.proc.clone(),
19509 selection: query,
19510 graphql_client: self.graphql_client.clone(),
19511 }
19512 }
19513 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19521 let mut query = self.selection.select("withFile");
19522 query = query.arg("path", path.into());
19523 query = query.arg_lazy(
19524 "source",
19525 Box::new(move || {
19526 let source = source.clone();
19527 Box::pin(async move { source.into_id().await.unwrap().quote() })
19528 }),
19529 );
19530 Workspace {
19531 proc: self.proc.clone(),
19532 selection: query,
19533 graphql_client: self.graphql_client.clone(),
19534 }
19535 }
19536 pub fn with_file_opts(
19544 &self,
19545 path: impl Into<String>,
19546 source: impl IntoID<Id>,
19547 opts: WorkspaceWithFileOpts,
19548 ) -> Workspace {
19549 let mut query = self.selection.select("withFile");
19550 query = query.arg("path", path.into());
19551 query = query.arg_lazy(
19552 "source",
19553 Box::new(move || {
19554 let source = source.clone();
19555 Box::pin(async move { source.into_id().await.unwrap().quote() })
19556 }),
19557 );
19558 if let Some(permissions) = opts.permissions {
19559 query = query.arg("permissions", permissions);
19560 }
19561 Workspace {
19562 proc: self.proc.clone(),
19563 selection: query,
19564 graphql_client: self.graphql_client.clone(),
19565 }
19566 }
19567 pub fn with_new_directory(
19575 &self,
19576 path: impl Into<String>,
19577 source: impl IntoID<Id>,
19578 ) -> Workspace {
19579 let mut query = self.selection.select("withNewDirectory");
19580 query = query.arg("path", path.into());
19581 query = query.arg_lazy(
19582 "source",
19583 Box::new(move || {
19584 let source = source.clone();
19585 Box::pin(async move { source.into_id().await.unwrap().quote() })
19586 }),
19587 );
19588 Workspace {
19589 proc: self.proc.clone(),
19590 selection: query,
19591 graphql_client: self.graphql_client.clone(),
19592 }
19593 }
19594 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19602 let mut query = self.selection.select("withDirectory");
19603 query = query.arg("path", path.into());
19604 query = query.arg_lazy(
19605 "source",
19606 Box::new(move || {
19607 let source = source.clone();
19608 Box::pin(async move { source.into_id().await.unwrap().quote() })
19609 }),
19610 );
19611 Workspace {
19612 proc: self.proc.clone(),
19613 selection: query,
19614 graphql_client: self.graphql_client.clone(),
19615 }
19616 }
19617 pub fn without_file(&self, path: impl Into<String>) -> Workspace {
19623 let mut query = self.selection.select("withoutFile");
19624 query = query.arg("path", path.into());
19625 Workspace {
19626 proc: self.proc.clone(),
19627 selection: query,
19628 graphql_client: self.graphql_client.clone(),
19629 }
19630 }
19631 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Workspace {
19637 let mut query = self.selection.select("withoutFiles");
19638 query = query.arg(
19639 "paths",
19640 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
19641 );
19642 Workspace {
19643 proc: self.proc.clone(),
19644 selection: query,
19645 graphql_client: self.graphql_client.clone(),
19646 }
19647 }
19648 pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
19654 let mut query = self.selection.select("withoutDirectory");
19655 query = query.arg("path", path.into());
19656 Workspace {
19657 proc: self.proc.clone(),
19658 selection: query,
19659 graphql_client: self.graphql_client.clone(),
19660 }
19661 }
19662 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
19668 let mut query = self.selection.select("withChanges");
19669 query = query.arg_lazy(
19670 "changes",
19671 Box::new(move || {
19672 let changes = changes.clone();
19673 Box::pin(async move { changes.into_id().await.unwrap().quote() })
19674 }),
19675 );
19676 Workspace {
19677 proc: self.proc.clone(),
19678 selection: query,
19679 graphql_client: self.graphql_client.clone(),
19680 }
19681 }
19682 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Workspace {
19690 let mut query = self.selection.select("withPatchFile");
19691 query = query.arg_lazy(
19692 "patch",
19693 Box::new(move || {
19694 let patch = patch.clone();
19695 Box::pin(async move { patch.into_id().await.unwrap().quote() })
19696 }),
19697 );
19698 Workspace {
19699 proc: self.proc.clone(),
19700 selection: query,
19701 graphql_client: self.graphql_client.clone(),
19702 }
19703 }
19704 pub fn with_patch_file_opts(
19712 &self,
19713 patch: impl IntoID<Id>,
19714 opts: WorkspaceWithPatchFileOpts,
19715 ) -> Workspace {
19716 let mut query = self.selection.select("withPatchFile");
19717 query = query.arg_lazy(
19718 "patch",
19719 Box::new(move || {
19720 let patch = patch.clone();
19721 Box::pin(async move { patch.into_id().await.unwrap().quote() })
19722 }),
19723 );
19724 if let Some(on_conflict) = opts.on_conflict {
19725 query = query.arg("onConflict", on_conflict);
19726 }
19727 Workspace {
19728 proc: self.proc.clone(),
19729 selection: query,
19730 graphql_client: self.graphql_client.clone(),
19731 }
19732 }
19733 pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
19739 let mut query = self.selection.select("withWorkdir");
19740 query = query.arg("path", path.into());
19741 Workspace {
19742 proc: self.proc.clone(),
19743 selection: query,
19744 graphql_client: self.graphql_client.clone(),
19745 }
19746 }
19747 pub fn with_mounted_directory(
19755 &self,
19756 path: impl Into<String>,
19757 source: impl IntoID<Id>,
19758 ) -> Workspace {
19759 let mut query = self.selection.select("withMountedDirectory");
19760 query = query.arg("path", path.into());
19761 query = query.arg_lazy(
19762 "source",
19763 Box::new(move || {
19764 let source = source.clone();
19765 Box::pin(async move { source.into_id().await.unwrap().quote() })
19766 }),
19767 );
19768 Workspace {
19769 proc: self.proc.clone(),
19770 selection: query,
19771 graphql_client: self.graphql_client.clone(),
19772 }
19773 }
19774 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19782 let mut query = self.selection.select("withMountedFile");
19783 query = query.arg("path", path.into());
19784 query = query.arg_lazy(
19785 "source",
19786 Box::new(move || {
19787 let source = source.clone();
19788 Box::pin(async move { source.into_id().await.unwrap().quote() })
19789 }),
19790 );
19791 Workspace {
19792 proc: self.proc.clone(),
19793 selection: query,
19794 graphql_client: self.graphql_client.clone(),
19795 }
19796 }
19797 pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
19804 let mut query = self.selection.select("withoutMount");
19805 query = query.arg("path", path.into());
19806 Workspace {
19807 proc: self.proc.clone(),
19808 selection: query,
19809 graphql_client: self.graphql_client.clone(),
19810 }
19811 }
19812 pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
19820 let mut query = self.selection.select("withModule");
19821 query = query.arg("ref", r#ref.into());
19822 Workspace {
19823 proc: self.proc.clone(),
19824 selection: query,
19825 graphql_client: self.graphql_client.clone(),
19826 }
19827 }
19828 pub fn with_module_opts<'a>(
19836 &self,
19837 r#ref: impl Into<String>,
19838 opts: WorkspaceWithModuleOpts<'a>,
19839 ) -> Workspace {
19840 let mut query = self.selection.select("withModule");
19841 query = query.arg("ref", r#ref.into());
19842 if let Some(name) = opts.name {
19843 query = query.arg("name", name);
19844 }
19845 if let Some(here) = opts.here {
19846 query = query.arg("here", here);
19847 }
19848 Workspace {
19849 proc: self.proc.clone(),
19850 selection: query,
19851 graphql_client: self.graphql_client.clone(),
19852 }
19853 }
19854 pub fn without_module(&self, name: impl Into<String>) -> Workspace {
19862 let mut query = self.selection.select("withoutModule");
19863 query = query.arg("name", name.into());
19864 Workspace {
19865 proc: self.proc.clone(),
19866 selection: query,
19867 graphql_client: self.graphql_client.clone(),
19868 }
19869 }
19870 pub fn without_module_opts(
19878 &self,
19879 name: impl Into<String>,
19880 opts: WorkspaceWithoutModuleOpts,
19881 ) -> Workspace {
19882 let mut query = self.selection.select("withoutModule");
19883 query = query.arg("name", name.into());
19884 if let Some(here) = opts.here {
19885 query = query.arg("here", here);
19886 }
19887 Workspace {
19888 proc: self.proc.clone(),
19889 selection: query,
19890 graphql_client: self.graphql_client.clone(),
19891 }
19892 }
19893 pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
19900 let mut query = self.selection.select("withSDK");
19901 query = query.arg("ref", r#ref.into());
19902 Workspace {
19903 proc: self.proc.clone(),
19904 selection: query,
19905 graphql_client: self.graphql_client.clone(),
19906 }
19907 }
19908 pub fn with_sdk_opts<'a>(
19915 &self,
19916 r#ref: impl Into<String>,
19917 opts: WorkspaceWithSdkOpts<'a>,
19918 ) -> Workspace {
19919 let mut query = self.selection.select("withSDK");
19920 query = query.arg("ref", r#ref.into());
19921 if let Some(name) = opts.name {
19922 query = query.arg("name", name);
19923 }
19924 if let Some(here) = opts.here {
19925 query = query.arg("here", here);
19926 }
19927 if let Some(as_sdk_name) = opts.as_sdk_name {
19928 query = query.arg("asSdkName", as_sdk_name);
19929 }
19930 Workspace {
19931 proc: self.proc.clone(),
19932 selection: query,
19933 graphql_client: self.graphql_client.clone(),
19934 }
19935 }
19936 pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
19943 let mut query = self.selection.select("withoutSDK");
19944 query = query.arg("name", name.into());
19945 Workspace {
19946 proc: self.proc.clone(),
19947 selection: query,
19948 graphql_client: self.graphql_client.clone(),
19949 }
19950 }
19951 pub fn without_sdk_opts(
19958 &self,
19959 name: impl Into<String>,
19960 opts: WorkspaceWithoutSdkOpts,
19961 ) -> Workspace {
19962 let mut query = self.selection.select("withoutSDK");
19963 query = query.arg("name", name.into());
19964 if let Some(here) = opts.here {
19965 query = query.arg("here", here);
19966 }
19967 Workspace {
19968 proc: self.proc.clone(),
19969 selection: query,
19970 graphql_client: self.graphql_client.clone(),
19971 }
19972 }
19973 pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
19980 let mut query = self.selection.select("withEntrypoint");
19981 query = query.arg("name", name.into());
19982 Workspace {
19983 proc: self.proc.clone(),
19984 selection: query,
19985 graphql_client: self.graphql_client.clone(),
19986 }
19987 }
19988 pub fn without_entrypoint(&self) -> Workspace {
19990 let query = self.selection.select("withoutEntrypoint");
19991 Workspace {
19992 proc: self.proc.clone(),
19993 selection: query,
19994 graphql_client: self.graphql_client.clone(),
19995 }
19996 }
19997 pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
20005 let mut query = self.selection.select("withInitModule");
20006 query = query.arg("sdk", sdk.into());
20007 Workspace {
20008 proc: self.proc.clone(),
20009 selection: query,
20010 graphql_client: self.graphql_client.clone(),
20011 }
20012 }
20013 pub fn with_init_module_opts<'a>(
20021 &self,
20022 sdk: impl Into<String>,
20023 opts: WorkspaceWithInitModuleOpts<'a>,
20024 ) -> Workspace {
20025 let mut query = self.selection.select("withInitModule");
20026 query = query.arg("sdk", sdk.into());
20027 if let Some(name) = opts.name {
20028 query = query.arg("name", name);
20029 }
20030 if let Some(path) = opts.path {
20031 query = query.arg("path", path);
20032 }
20033 if let Some(install) = opts.install {
20034 query = query.arg("install", install);
20035 }
20036 if let Some(entrypoint) = opts.entrypoint {
20037 query = query.arg("entrypoint", entrypoint);
20038 }
20039 if let Some(settings) = opts.settings {
20040 query = query.arg("settings", settings);
20041 }
20042 Workspace {
20043 proc: self.proc.clone(),
20044 selection: query,
20045 graphql_client: self.graphql_client.clone(),
20046 }
20047 }
20048 pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
20054 let mut query = self.selection.select("detectScope");
20055 query = query.arg("sdk", sdk.into());
20056 query.execute(self.graphql_client.clone()).await
20057 }
20058 pub fn with_client(&self, module: impl Into<String>) -> Workspace {
20066 let mut query = self.selection.select("withClient");
20067 query = query.arg("module", module.into());
20068 Workspace {
20069 proc: self.proc.clone(),
20070 selection: query,
20071 graphql_client: self.graphql_client.clone(),
20072 }
20073 }
20074 pub fn with_client_opts<'a>(
20082 &self,
20083 module: impl Into<String>,
20084 opts: WorkspaceWithClientOpts<'a>,
20085 ) -> Workspace {
20086 let mut query = self.selection.select("withClient");
20087 query = query.arg("module", module.into());
20088 if let Some(sdk) = opts.sdk {
20089 query = query.arg("sdk", sdk);
20090 }
20091 if let Some(settings) = opts.settings {
20092 query = query.arg("settings", settings);
20093 }
20094 Workspace {
20095 proc: self.proc.clone(),
20096 selection: query,
20097 graphql_client: self.graphql_client.clone(),
20098 }
20099 }
20100 pub fn without_client(&self, module: impl Into<String>) -> Workspace {
20109 let mut query = self.selection.select("withoutClient");
20110 query = query.arg("module", module.into());
20111 Workspace {
20112 proc: self.proc.clone(),
20113 selection: query,
20114 graphql_client: self.graphql_client.clone(),
20115 }
20116 }
20117 pub fn without_client_opts<'a>(
20126 &self,
20127 module: impl Into<String>,
20128 opts: WorkspaceWithoutClientOpts<'a>,
20129 ) -> Workspace {
20130 let mut query = self.selection.select("withoutClient");
20131 query = query.arg("module", module.into());
20132 if let Some(sdk) = opts.sdk {
20133 query = query.arg("sdk", sdk);
20134 }
20135 Workspace {
20136 proc: self.proc.clone(),
20137 selection: query,
20138 graphql_client: self.graphql_client.clone(),
20139 }
20140 }
20141 pub fn with_updated_clients(&self) -> Workspace {
20149 let query = self.selection.select("withUpdatedClients");
20150 Workspace {
20151 proc: self.proc.clone(),
20152 selection: query,
20153 graphql_client: self.graphql_client.clone(),
20154 }
20155 }
20156 pub fn with_updated_clients_opts<'a>(
20164 &self,
20165 opts: WorkspaceWithUpdatedClientsOpts<'a>,
20166 ) -> Workspace {
20167 let mut query = self.selection.select("withUpdatedClients");
20168 if let Some(modules) = opts.modules {
20169 query = query.arg("modules", modules);
20170 }
20171 if let Some(all) = opts.all {
20172 query = query.arg("all", all);
20173 }
20174 if let Some(sdk) = opts.sdk {
20175 query = query.arg("sdk", sdk);
20176 }
20177 Workspace {
20178 proc: self.proc.clone(),
20179 selection: query,
20180 graphql_client: self.graphql_client.clone(),
20181 }
20182 }
20183 pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
20192 let mut query = self.selection.select("withConfigValue");
20193 query = query.arg("key", key.into());
20194 query = query.arg("value", value.into());
20195 Workspace {
20196 proc: self.proc.clone(),
20197 selection: query,
20198 graphql_client: self.graphql_client.clone(),
20199 }
20200 }
20201 pub fn with_config_value_opts<'a>(
20210 &self,
20211 key: impl Into<String>,
20212 value: impl Into<String>,
20213 opts: WorkspaceWithConfigValueOpts<'a>,
20214 ) -> Workspace {
20215 let mut query = self.selection.select("withConfigValue");
20216 query = query.arg("key", key.into());
20217 query = query.arg("value", value.into());
20218 if let Some(values) = opts.values {
20219 query = query.arg("values", values);
20220 }
20221 if let Some(here) = opts.here {
20222 query = query.arg("here", here);
20223 }
20224 Workspace {
20225 proc: self.proc.clone(),
20226 selection: query,
20227 graphql_client: self.graphql_client.clone(),
20228 }
20229 }
20230 pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
20239 let mut query = self.selection.select("withoutConfigValue");
20240 query = query.arg("key", key.into());
20241 Workspace {
20242 proc: self.proc.clone(),
20243 selection: query,
20244 graphql_client: self.graphql_client.clone(),
20245 }
20246 }
20247 pub fn without_config_value_opts(
20256 &self,
20257 key: impl Into<String>,
20258 opts: WorkspaceWithoutConfigValueOpts,
20259 ) -> Workspace {
20260 let mut query = self.selection.select("withoutConfigValue");
20261 query = query.arg("key", key.into());
20262 if let Some(here) = opts.here {
20263 query = query.arg("here", here);
20264 }
20265 Workspace {
20266 proc: self.proc.clone(),
20267 selection: query,
20268 graphql_client: self.graphql_client.clone(),
20269 }
20270 }
20271 pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
20278 let mut query = self.selection.select("withConfigEnv");
20279 query = query.arg("name", name.into());
20280 Workspace {
20281 proc: self.proc.clone(),
20282 selection: query,
20283 graphql_client: self.graphql_client.clone(),
20284 }
20285 }
20286 pub fn with_config_env_opts(
20293 &self,
20294 name: impl Into<String>,
20295 opts: WorkspaceWithConfigEnvOpts,
20296 ) -> Workspace {
20297 let mut query = self.selection.select("withConfigEnv");
20298 query = query.arg("name", name.into());
20299 if let Some(here) = opts.here {
20300 query = query.arg("here", here);
20301 }
20302 Workspace {
20303 proc: self.proc.clone(),
20304 selection: query,
20305 graphql_client: self.graphql_client.clone(),
20306 }
20307 }
20308 pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
20315 let mut query = self.selection.select("withoutConfigEnv");
20316 query = query.arg("name", name.into());
20317 Workspace {
20318 proc: self.proc.clone(),
20319 selection: query,
20320 graphql_client: self.graphql_client.clone(),
20321 }
20322 }
20323 pub fn without_config_env_opts(
20330 &self,
20331 name: impl Into<String>,
20332 opts: WorkspaceWithoutConfigEnvOpts,
20333 ) -> Workspace {
20334 let mut query = self.selection.select("withoutConfigEnv");
20335 query = query.arg("name", name.into());
20336 if let Some(here) = opts.here {
20337 query = query.arg("here", here);
20338 }
20339 Workspace {
20340 proc: self.proc.clone(),
20341 selection: query,
20342 graphql_client: self.graphql_client.clone(),
20343 }
20344 }
20345 pub fn with_updated_lock(&self) -> Workspace {
20352 let query = self.selection.select("withUpdatedLock");
20353 Workspace {
20354 proc: self.proc.clone(),
20355 selection: query,
20356 graphql_client: self.graphql_client.clone(),
20357 }
20358 }
20359 pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
20366 let mut query = self.selection.select("withUpdatedLock");
20367 if let Some(no_generate) = opts.no_generate {
20368 query = query.arg("noGenerate", no_generate);
20369 }
20370 Workspace {
20371 proc: self.proc.clone(),
20372 selection: query,
20373 graphql_client: self.graphql_client.clone(),
20374 }
20375 }
20376 pub fn with_updated_modules(&self) -> Workspace {
20383 let query = self.selection.select("withUpdatedModules");
20384 Workspace {
20385 proc: self.proc.clone(),
20386 selection: query,
20387 graphql_client: self.graphql_client.clone(),
20388 }
20389 }
20390 pub fn with_updated_modules_opts<'a>(
20397 &self,
20398 opts: WorkspaceWithUpdatedModulesOpts<'a>,
20399 ) -> Workspace {
20400 let mut query = self.selection.select("withUpdatedModules");
20401 if let Some(names) = opts.names {
20402 query = query.arg("names", names);
20403 }
20404 if let Some(version) = opts.version {
20405 query = query.arg("version", version);
20406 }
20407 if let Some(source) = opts.source {
20408 query = query.arg("source", source);
20409 }
20410 Workspace {
20411 proc: self.proc.clone(),
20412 selection: query,
20413 graphql_client: self.graphql_client.clone(),
20414 }
20415 }
20416 pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
20418 let query = self.selection.select("sdks");
20419 let query = query.select("id");
20420 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20421 Ok(ids
20422 .into_iter()
20423 .map(|id| WorkspaceSdk {
20424 proc: self.proc.clone(),
20425 selection: crate::querybuilder::query()
20426 .select("node")
20427 .arg("id", &id.0)
20428 .inline_fragment("WorkspaceSDK"),
20429 graphql_client: self.graphql_client.clone(),
20430 })
20431 .collect())
20432 }
20433 pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
20439 let mut query = self.selection.select("sdk");
20440 query = query.arg("name", name.into());
20441 WorkspaceSdk {
20442 proc: self.proc.clone(),
20443 selection: query,
20444 graphql_client: self.graphql_client.clone(),
20445 }
20446 }
20447 pub fn changes(&self) -> Changeset {
20454 let query = self.selection.select("changes");
20455 Changeset {
20456 proc: self.proc.clone(),
20457 selection: query,
20458 graphql_client: self.graphql_client.clone(),
20459 }
20460 }
20461 pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
20468 let mut query = self.selection.select("changes");
20469 if let Some(from) = opts.from {
20470 query = query.arg("from", from);
20471 }
20472 Changeset {
20473 proc: self.proc.clone(),
20474 selection: query,
20475 graphql_client: self.graphql_client.clone(),
20476 }
20477 }
20478 pub async fn export(&self) -> Result<Void, DaggerError> {
20487 let query = self.selection.select("export");
20488 query.execute(self.graphql_client.clone()).await
20489 }
20490 pub async fn export_opts<'a>(
20499 &self,
20500 opts: WorkspaceExportOpts<'a>,
20501 ) -> Result<Void, DaggerError> {
20502 let mut query = self.selection.select("export");
20503 if let Some(path) = opts.path {
20504 query = query.arg("path", path);
20505 }
20506 if let Some(from) = opts.from {
20507 query = query.arg("from", from);
20508 }
20509 query.execute(self.graphql_client.clone()).await
20510 }
20511 pub async fn config_read(&self) -> Result<String, DaggerError> {
20520 let query = self.selection.select("configRead");
20521 query.execute(self.graphql_client.clone()).await
20522 }
20523 pub async fn config_read_opts<'a>(
20532 &self,
20533 opts: WorkspaceConfigReadOpts<'a>,
20534 ) -> Result<String, DaggerError> {
20535 let mut query = self.selection.select("configRead");
20536 if let Some(key) = opts.key {
20537 query = query.arg("key", key);
20538 }
20539 if let Some(effective) = opts.effective {
20540 query = query.arg("effective", effective);
20541 }
20542 query.execute(self.graphql_client.clone()).await
20543 }
20544 pub async fn entrypoint(&self) -> Result<String, DaggerError> {
20547 let query = self.selection.select("entrypoint");
20548 query.execute(self.graphql_client.clone()).await
20549 }
20550 pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
20552 let query = self.selection.select("envList");
20553 query.execute(self.graphql_client.clone()).await
20554 }
20555 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20558 let query = self.selection.select("modules");
20559 let query = query.select("id");
20560 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20561 Ok(ids
20562 .into_iter()
20563 .map(|id| WorkspaceModule {
20564 proc: self.proc.clone(),
20565 selection: crate::querybuilder::query()
20566 .select("node")
20567 .arg("id", &id.0)
20568 .inline_fragment("WorkspaceModule"),
20569 graphql_client: self.graphql_client.clone(),
20570 })
20571 .collect())
20572 }
20573 pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
20580 let mut query = self.selection.select("module");
20581 query = query.arg("name", name.into());
20582 WorkspaceModule {
20583 proc: self.proc.clone(),
20584 selection: query,
20585 graphql_client: self.graphql_client.clone(),
20586 }
20587 }
20588 pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
20596 let mut query = self.selection.select("moduleSource");
20597 query = query.arg("path", path.into());
20598 ModuleSource {
20599 proc: self.proc.clone(),
20600 selection: query,
20601 graphql_client: self.graphql_client.clone(),
20602 }
20603 }
20604 pub async fn cwd(&self) -> Result<String, DaggerError> {
20608 let query = self.selection.select("cwd");
20609 query.execute(self.graphql_client.clone()).await
20610 }
20611 pub fn artifacts(&self) -> Artifacts {
20617 let query = self.selection.select("artifacts");
20618 Artifacts {
20619 proc: self.proc.clone(),
20620 selection: query,
20621 graphql_client: self.graphql_client.clone(),
20622 }
20623 }
20624 pub fn artifacts_opts<'a>(&self, opts: WorkspaceArtifactsOpts<'a>) -> Artifacts {
20630 let mut query = self.selection.select("artifacts");
20631 if let Some(include) = opts.include {
20632 query = query.arg("include", include);
20633 }
20634 Artifacts {
20635 proc: self.proc.clone(),
20636 selection: query,
20637 graphql_client: self.graphql_client.clone(),
20638 }
20639 }
20640 pub fn migrate(&self) -> WorkspaceMigration {
20648 let query = self.selection.select("migrate");
20649 WorkspaceMigration {
20650 proc: self.proc.clone(),
20651 selection: query,
20652 graphql_client: self.graphql_client.clone(),
20653 }
20654 }
20655 pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
20663 let mut query = self.selection.select("migrate");
20664 if let Some(modules) = opts.modules {
20665 query = query.arg("modules", modules);
20666 }
20667 WorkspaceMigration {
20668 proc: self.proc.clone(),
20669 selection: query,
20670 graphql_client: self.graphql_client.clone(),
20671 }
20672 }
20673 pub async fn address(&self) -> Result<String, DaggerError> {
20675 let query = self.selection.select("address");
20676 query.execute(self.graphql_client.clone()).await
20677 }
20678}
20679impl Node for Workspace {
20680 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20681 let query = self.selection.select("id");
20682 let graphql_client = self.graphql_client.clone();
20683 async move { query.execute(graphql_client).await }
20684 }
20685}
20686#[derive(Clone)]
20687pub struct WorkspaceCommitPick {
20688 pub proc: Option<Arc<DaggerSessionProc>>,
20689 pub selection: Selection,
20690 pub graphql_client: DynGraphQLClient,
20691}
20692impl IntoID<Id> for WorkspaceCommitPick {
20693 fn into_id(
20694 self,
20695 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20696 Box::pin(async move { self.id().await })
20697 }
20698}
20699impl Loadable for WorkspaceCommitPick {
20700 fn graphql_type() -> &'static str {
20701 "WorkspaceCommitPick"
20702 }
20703 fn from_query(
20704 proc: Option<Arc<DaggerSessionProc>>,
20705 selection: Selection,
20706 graphql_client: DynGraphQLClient,
20707 ) -> Self {
20708 Self {
20709 proc,
20710 selection,
20711 graphql_client,
20712 }
20713 }
20714}
20715impl WorkspaceCommitPick {
20716 pub async fn id(&self) -> Result<Id, DaggerError> {
20718 let query = self.selection.select("id");
20719 query.execute(self.graphql_client.clone()).await
20720 }
20721 pub fn commit(&self) -> GitCommit {
20723 let query = self.selection.select("commit");
20724 GitCommit {
20725 proc: self.proc.clone(),
20726 selection: query,
20727 graphql_client: self.graphql_client.clone(),
20728 }
20729 }
20730 pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
20732 let query = self.selection.select("status");
20733 query.execute(self.graphql_client.clone()).await
20734 }
20735 pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
20737 let query = self.selection.select("reason");
20738 query.execute(self.graphql_client.clone()).await
20739 }
20740 pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
20742 let query = self.selection.select("conflictPaths");
20743 query.execute(self.graphql_client.clone()).await
20744 }
20745}
20746impl Node for WorkspaceCommitPick {
20747 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20748 let query = self.selection.select("id");
20749 let graphql_client = self.graphql_client.clone();
20750 async move { query.execute(graphql_client).await }
20751 }
20752}
20753#[derive(Clone)]
20754pub struct WorkspaceGit {
20755 pub proc: Option<Arc<DaggerSessionProc>>,
20756 pub selection: Selection,
20757 pub graphql_client: DynGraphQLClient,
20758}
20759impl IntoID<Id> for WorkspaceGit {
20760 fn into_id(
20761 self,
20762 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20763 Box::pin(async move { self.id().await })
20764 }
20765}
20766impl Loadable for WorkspaceGit {
20767 fn graphql_type() -> &'static str {
20768 "WorkspaceGit"
20769 }
20770 fn from_query(
20771 proc: Option<Arc<DaggerSessionProc>>,
20772 selection: Selection,
20773 graphql_client: DynGraphQLClient,
20774 ) -> Self {
20775 Self {
20776 proc,
20777 selection,
20778 graphql_client,
20779 }
20780 }
20781}
20782impl WorkspaceGit {
20783 pub async fn id(&self) -> Result<Id, DaggerError> {
20785 let query = self.selection.select("id");
20786 query.execute(self.graphql_client.clone()).await
20787 }
20788 pub fn head(&self) -> GitRef {
20790 let query = self.selection.select("head");
20791 GitRef {
20792 proc: self.proc.clone(),
20793 selection: query,
20794 graphql_client: self.graphql_client.clone(),
20795 }
20796 }
20797 pub fn directory(&self) -> Directory {
20801 let query = self.selection.select("directory");
20802 Directory {
20803 proc: self.proc.clone(),
20804 selection: query,
20805 graphql_client: self.graphql_client.clone(),
20806 }
20807 }
20808 pub fn uncommitted(&self) -> Changeset {
20810 let query = self.selection.select("uncommitted");
20811 Changeset {
20812 proc: self.proc.clone(),
20813 selection: query,
20814 graphql_client: self.graphql_client.clone(),
20815 }
20816 }
20817}
20818impl Node for WorkspaceGit {
20819 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20820 let query = self.selection.select("id");
20821 let graphql_client = self.graphql_client.clone();
20822 async move { query.execute(graphql_client).await }
20823 }
20824}
20825#[derive(Clone)]
20826pub struct WorkspaceMigration {
20827 pub proc: Option<Arc<DaggerSessionProc>>,
20828 pub selection: Selection,
20829 pub graphql_client: DynGraphQLClient,
20830}
20831impl IntoID<Id> for WorkspaceMigration {
20832 fn into_id(
20833 self,
20834 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20835 Box::pin(async move { self.id().await })
20836 }
20837}
20838impl Loadable for WorkspaceMigration {
20839 fn graphql_type() -> &'static str {
20840 "WorkspaceMigration"
20841 }
20842 fn from_query(
20843 proc: Option<Arc<DaggerSessionProc>>,
20844 selection: Selection,
20845 graphql_client: DynGraphQLClient,
20846 ) -> Self {
20847 Self {
20848 proc,
20849 selection,
20850 graphql_client,
20851 }
20852 }
20853}
20854impl WorkspaceMigration {
20855 pub async fn id(&self) -> Result<Id, DaggerError> {
20857 let query = self.selection.select("id");
20858 query.execute(self.graphql_client.clone()).await
20859 }
20860 pub fn changes(&self) -> Changeset {
20862 let query = self.selection.select("changes");
20863 Changeset {
20864 proc: self.proc.clone(),
20865 selection: query,
20866 graphql_client: self.graphql_client.clone(),
20867 }
20868 }
20869 pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
20871 let query = self.selection.select("steps");
20872 let query = query.select("id");
20873 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20874 Ok(ids
20875 .into_iter()
20876 .map(|id| WorkspaceMigrationStep {
20877 proc: self.proc.clone(),
20878 selection: crate::querybuilder::query()
20879 .select("node")
20880 .arg("id", &id.0)
20881 .inline_fragment("WorkspaceMigrationStep"),
20882 graphql_client: self.graphql_client.clone(),
20883 })
20884 .collect())
20885 }
20886 pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
20888 let query = self.selection.select("moduleCandidates");
20889 query.execute(self.graphql_client.clone()).await
20890 }
20891 pub async fn config_file(&self) -> Result<String, DaggerError> {
20893 let query = self.selection.select("configFile");
20894 query.execute(self.graphql_client.clone()).await
20895 }
20896}
20897impl Node for WorkspaceMigration {
20898 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20899 let query = self.selection.select("id");
20900 let graphql_client = self.graphql_client.clone();
20901 async move { query.execute(graphql_client).await }
20902 }
20903}
20904#[derive(Clone)]
20905pub struct WorkspaceMigrationStep {
20906 pub proc: Option<Arc<DaggerSessionProc>>,
20907 pub selection: Selection,
20908 pub graphql_client: DynGraphQLClient,
20909}
20910impl IntoID<Id> for WorkspaceMigrationStep {
20911 fn into_id(
20912 self,
20913 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20914 Box::pin(async move { self.id().await })
20915 }
20916}
20917impl Loadable for WorkspaceMigrationStep {
20918 fn graphql_type() -> &'static str {
20919 "WorkspaceMigrationStep"
20920 }
20921 fn from_query(
20922 proc: Option<Arc<DaggerSessionProc>>,
20923 selection: Selection,
20924 graphql_client: DynGraphQLClient,
20925 ) -> Self {
20926 Self {
20927 proc,
20928 selection,
20929 graphql_client,
20930 }
20931 }
20932}
20933impl WorkspaceMigrationStep {
20934 pub async fn id(&self) -> Result<Id, DaggerError> {
20936 let query = self.selection.select("id");
20937 query.execute(self.graphql_client.clone()).await
20938 }
20939 pub async fn code(&self) -> Result<String, DaggerError> {
20941 let query = self.selection.select("code");
20942 query.execute(self.graphql_client.clone()).await
20943 }
20944 pub async fn description(&self) -> Result<String, DaggerError> {
20946 let query = self.selection.select("description");
20947 query.execute(self.graphql_client.clone()).await
20948 }
20949 pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
20951 let query = self.selection.select("warnings");
20952 query.execute(self.graphql_client.clone()).await
20953 }
20954 pub fn changes(&self) -> Changeset {
20956 let query = self.selection.select("changes");
20957 Changeset {
20958 proc: self.proc.clone(),
20959 selection: query,
20960 graphql_client: self.graphql_client.clone(),
20961 }
20962 }
20963}
20964impl Node for WorkspaceMigrationStep {
20965 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20966 let query = self.selection.select("id");
20967 let graphql_client = self.graphql_client.clone();
20968 async move { query.execute(graphql_client).await }
20969 }
20970}
20971#[derive(Clone)]
20972pub struct WorkspaceModule {
20973 pub proc: Option<Arc<DaggerSessionProc>>,
20974 pub selection: Selection,
20975 pub graphql_client: DynGraphQLClient,
20976}
20977impl IntoID<Id> for WorkspaceModule {
20978 fn into_id(
20979 self,
20980 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20981 Box::pin(async move { self.id().await })
20982 }
20983}
20984impl Loadable for WorkspaceModule {
20985 fn graphql_type() -> &'static str {
20986 "WorkspaceModule"
20987 }
20988 fn from_query(
20989 proc: Option<Arc<DaggerSessionProc>>,
20990 selection: Selection,
20991 graphql_client: DynGraphQLClient,
20992 ) -> Self {
20993 Self {
20994 proc,
20995 selection,
20996 graphql_client,
20997 }
20998 }
20999}
21000impl WorkspaceModule {
21001 pub async fn id(&self) -> Result<Id, DaggerError> {
21003 let query = self.selection.select("id");
21004 query.execute(self.graphql_client.clone()).await
21005 }
21006 pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
21008 let query = self.selection.select("settings");
21009 let query = query.select("id");
21010 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21011 Ok(ids
21012 .into_iter()
21013 .map(|id| WorkspaceModuleSetting {
21014 proc: self.proc.clone(),
21015 selection: crate::querybuilder::query()
21016 .select("node")
21017 .arg("id", &id.0)
21018 .inline_fragment("WorkspaceModuleSetting"),
21019 graphql_client: self.graphql_client.clone(),
21020 })
21021 .collect())
21022 }
21023 pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
21025 let query = self.selection.select("functions");
21026 query.execute(self.graphql_client.clone()).await
21027 }
21028 pub async fn name(&self) -> Result<String, DaggerError> {
21030 let query = self.selection.select("name");
21031 query.execute(self.graphql_client.clone()).await
21032 }
21033 pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
21035 let query = self.selection.select("entrypoint");
21036 query.execute(self.graphql_client.clone()).await
21037 }
21038 pub async fn source(&self) -> Result<String, DaggerError> {
21040 let query = self.selection.select("source");
21041 query.execute(self.graphql_client.clone()).await
21042 }
21043}
21044impl Node for WorkspaceModule {
21045 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21046 let query = self.selection.select("id");
21047 let graphql_client = self.graphql_client.clone();
21048 async move { query.execute(graphql_client).await }
21049 }
21050}
21051#[derive(Clone)]
21052pub struct WorkspaceModuleSetting {
21053 pub proc: Option<Arc<DaggerSessionProc>>,
21054 pub selection: Selection,
21055 pub graphql_client: DynGraphQLClient,
21056}
21057impl IntoID<Id> for WorkspaceModuleSetting {
21058 fn into_id(
21059 self,
21060 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21061 Box::pin(async move { self.id().await })
21062 }
21063}
21064impl Loadable for WorkspaceModuleSetting {
21065 fn graphql_type() -> &'static str {
21066 "WorkspaceModuleSetting"
21067 }
21068 fn from_query(
21069 proc: Option<Arc<DaggerSessionProc>>,
21070 selection: Selection,
21071 graphql_client: DynGraphQLClient,
21072 ) -> Self {
21073 Self {
21074 proc,
21075 selection,
21076 graphql_client,
21077 }
21078 }
21079}
21080impl WorkspaceModuleSetting {
21081 pub async fn id(&self) -> Result<Id, DaggerError> {
21083 let query = self.selection.select("id");
21084 query.execute(self.graphql_client.clone()).await
21085 }
21086 pub async fn key(&self) -> Result<String, DaggerError> {
21088 let query = self.selection.select("key");
21089 query.execute(self.graphql_client.clone()).await
21090 }
21091 pub async fn value(&self) -> Result<String, DaggerError> {
21093 let query = self.selection.select("value");
21094 query.execute(self.graphql_client.clone()).await
21095 }
21096 pub async fn description(&self) -> Result<String, DaggerError> {
21098 let query = self.selection.select("description");
21099 query.execute(self.graphql_client.clone()).await
21100 }
21101 pub async fn default_value(&self) -> Result<String, DaggerError> {
21103 let query = self.selection.select("defaultValue");
21104 query.execute(self.graphql_client.clone()).await
21105 }
21106 pub async fn is_string(&self) -> Result<bool, DaggerError> {
21108 let query = self.selection.select("isString");
21109 query.execute(self.graphql_client.clone()).await
21110 }
21111 pub async fn is_list(&self) -> Result<bool, DaggerError> {
21113 let query = self.selection.select("isList");
21114 query.execute(self.graphql_client.clone()).await
21115 }
21116 pub async fn is_object(&self) -> Result<bool, DaggerError> {
21118 let query = self.selection.select("isObject");
21119 query.execute(self.graphql_client.clone()).await
21120 }
21121}
21122impl Node for WorkspaceModuleSetting {
21123 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21124 let query = self.selection.select("id");
21125 let graphql_client = self.graphql_client.clone();
21126 async move { query.execute(graphql_client).await }
21127 }
21128}
21129#[derive(Clone)]
21130pub struct WorkspaceSdk {
21131 pub proc: Option<Arc<DaggerSessionProc>>,
21132 pub selection: Selection,
21133 pub graphql_client: DynGraphQLClient,
21134}
21135impl IntoID<Id> for WorkspaceSdk {
21136 fn into_id(
21137 self,
21138 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21139 Box::pin(async move { self.id().await })
21140 }
21141}
21142impl Loadable for WorkspaceSdk {
21143 fn graphql_type() -> &'static str {
21144 "WorkspaceSDK"
21145 }
21146 fn from_query(
21147 proc: Option<Arc<DaggerSessionProc>>,
21148 selection: Selection,
21149 graphql_client: DynGraphQLClient,
21150 ) -> Self {
21151 Self {
21152 proc,
21153 selection,
21154 graphql_client,
21155 }
21156 }
21157}
21158impl WorkspaceSdk {
21159 pub async fn id(&self) -> Result<Id, DaggerError> {
21161 let query = self.selection.select("id");
21162 query.execute(self.graphql_client.clone()).await
21163 }
21164 pub fn generate(&self) -> Changeset {
21166 let query = self.selection.select("generate");
21167 Changeset {
21168 proc: self.proc.clone(),
21169 selection: query,
21170 graphql_client: self.graphql_client.clone(),
21171 }
21172 }
21173 pub async fn name(&self) -> Result<String, DaggerError> {
21175 let query = self.selection.select("name");
21176 query.execute(self.graphql_client.clone()).await
21177 }
21178 pub async fn r#ref(&self) -> Result<String, DaggerError> {
21180 let query = self.selection.select("ref");
21181 query.execute(self.graphql_client.clone()).await
21182 }
21183 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
21185 let query = self.selection.select("modules");
21186 let query = query.select("id");
21187 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21188 Ok(ids
21189 .into_iter()
21190 .map(|id| WorkspaceModule {
21191 proc: self.proc.clone(),
21192 selection: crate::querybuilder::query()
21193 .select("node")
21194 .arg("id", &id.0)
21195 .inline_fragment("WorkspaceModule"),
21196 graphql_client: self.graphql_client.clone(),
21197 })
21198 .collect())
21199 }
21200 pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
21202 let query = self.selection.select("clients");
21203 let query = query.select("id");
21204 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21205 Ok(ids
21206 .into_iter()
21207 .map(|id| WorkspaceModule {
21208 proc: self.proc.clone(),
21209 selection: crate::querybuilder::query()
21210 .select("node")
21211 .arg("id", &id.0)
21212 .inline_fragment("WorkspaceModule"),
21213 graphql_client: self.graphql_client.clone(),
21214 })
21215 .collect())
21216 }
21217}
21218impl Node for WorkspaceSdk {
21219 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21220 let query = self.selection.select("id");
21221 let graphql_client = self.graphql_client.clone();
21222 async move { query.execute(graphql_client).await }
21223 }
21224}
21225#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21226pub enum AcronymStyle {
21227 #[serde(rename = "CAPITALIZED")]
21228 Capitalized,
21229 #[serde(rename = "UPPERCASE")]
21230 Uppercase,
21231}
21232#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21233pub enum AgentMessageDelivery {
21234 #[serde(rename = "QUEUED")]
21235 Queued,
21236 #[serde(rename = "STARTED")]
21237 Started,
21238 #[serde(rename = "STEERED")]
21239 Steered,
21240}
21241#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21242pub enum AgentState {
21243 #[serde(rename = "FAILED")]
21244 Failed,
21245 #[serde(rename = "IDLE")]
21246 Idle,
21247 #[serde(rename = "PAUSED")]
21248 Paused,
21249 #[serde(rename = "RUNNING")]
21250 Running,
21251 #[serde(rename = "STOPPED")]
21252 Stopped,
21253 #[serde(rename = "WAITING_INPUT")]
21254 WaitingInput,
21255}
21256#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21257pub enum ArtifactDimensionKind {
21258 #[serde(rename = "COLLECTION")]
21259 Collection,
21260 #[serde(rename = "MODULE")]
21261 Module,
21262 #[serde(rename = "TYPE")]
21263 Type,
21264}
21265#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21266pub enum CacheSharingMode {
21267 #[serde(rename = "LOCKED")]
21268 Locked,
21269 #[serde(rename = "PRIVATE")]
21270 Private,
21271 #[serde(rename = "SHARED")]
21272 Shared,
21273}
21274#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21275pub enum Casing {
21276 #[serde(rename = "CAMEL")]
21277 Camel,
21278 #[serde(rename = "FLAT")]
21279 Flat,
21280 #[serde(rename = "KEBAB")]
21281 Kebab,
21282 #[serde(rename = "PASCAL")]
21283 Pascal,
21284 #[serde(rename = "SCREAMING_SNAKE")]
21285 ScreamingSnake,
21286 #[serde(rename = "SNAKE")]
21287 Snake,
21288}
21289#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21290pub enum ChangesetMergeConflict {
21291 #[serde(rename = "FAIL")]
21292 Fail,
21293 #[serde(rename = "FAIL_EARLY")]
21294 FailEarly,
21295 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21296 LeaveConflictMarkers,
21297 #[serde(rename = "PREFER_OURS")]
21298 PreferOurs,
21299 #[serde(rename = "PREFER_THEIRS")]
21300 PreferTheirs,
21301}
21302#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21303pub enum ChangesetsMergeConflict {
21304 #[serde(rename = "FAIL")]
21305 Fail,
21306 #[serde(rename = "FAIL_EARLY")]
21307 FailEarly,
21308}
21309#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21310pub enum DiffStatKind {
21311 #[serde(rename = "ADDED")]
21312 Added,
21313 #[serde(rename = "MODIFIED")]
21314 Modified,
21315 #[serde(rename = "REMOVED")]
21316 Removed,
21317 #[serde(rename = "RENAMED")]
21318 Renamed,
21319}
21320#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21321pub enum ExistsType {
21322 #[serde(rename = "DIRECTORY_TYPE")]
21323 DirectoryType,
21324 #[serde(rename = "REGULAR_TYPE")]
21325 RegularType,
21326 #[serde(rename = "SYMLINK_TYPE")]
21327 SymlinkType,
21328}
21329#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21330pub enum FileType {
21331 #[serde(rename = "DIRECTORY")]
21332 Directory,
21333 #[serde(rename = "DIRECTORY_TYPE")]
21334 DirectoryType,
21335 #[serde(rename = "REGULAR")]
21336 Regular,
21337 #[serde(rename = "REGULAR_TYPE")]
21338 RegularType,
21339 #[serde(rename = "SYMLINK")]
21340 Symlink,
21341 #[serde(rename = "SYMLINK_TYPE")]
21342 SymlinkType,
21343 #[serde(rename = "UNKNOWN")]
21344 Unknown,
21345}
21346#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21347pub enum FunctionCachePolicy {
21348 #[serde(rename = "Default")]
21349 Default,
21350 #[serde(rename = "Never")]
21351 Never,
21352 #[serde(rename = "PerSession")]
21353 PerSession,
21354}
21355#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21356pub enum GitPushDisposition {
21357 #[serde(rename = "CREATED")]
21358 Created,
21359 #[serde(rename = "FAST_FORWARD")]
21360 FastForward,
21361 #[serde(rename = "FORCED")]
21362 Forced,
21363 #[serde(rename = "UP_TO_DATE")]
21364 UpToDate,
21365}
21366#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21367pub enum IdentifierWordKind {
21368 #[serde(rename = "ACRONYM")]
21369 Acronym,
21370 #[serde(rename = "TERM")]
21371 Term,
21372 #[serde(rename = "WORD")]
21373 Word,
21374}
21375#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21376pub enum ImageLayerCompression {
21377 #[serde(rename = "EStarGZ")]
21378 EStarGz,
21379 #[serde(rename = "ESTARGZ")]
21380 Estargz,
21381 #[serde(rename = "Gzip")]
21382 Gzip,
21383 #[serde(rename = "Uncompressed")]
21384 Uncompressed,
21385 #[serde(rename = "Zstd")]
21386 Zstd,
21387}
21388#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21389pub enum ImageMediaTypes {
21390 #[serde(rename = "DOCKER")]
21391 Docker,
21392 #[serde(rename = "DockerMediaTypes")]
21393 DockerMediaTypes,
21394 #[serde(rename = "OCI")]
21395 Oci,
21396 #[serde(rename = "OCIMediaTypes")]
21397 OciMediaTypes,
21398}
21399#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21400pub enum LlmContentBlockKind {
21401 #[serde(rename = "AUDIO")]
21402 Audio,
21403 #[serde(rename = "DOCUMENT")]
21404 Document,
21405 #[serde(rename = "IMAGE")]
21406 Image,
21407 #[serde(rename = "TEXT")]
21408 Text,
21409 #[serde(rename = "THINKING")]
21410 Thinking,
21411 #[serde(rename = "TOOL_CALL")]
21412 ToolCall,
21413 #[serde(rename = "TOOL_RESULT")]
21414 ToolResult,
21415}
21416#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21417pub enum LlmMessageOriginKind {
21418 #[serde(rename = "AGENT")]
21419 Agent,
21420 #[serde(rename = "EVENT")]
21421 Event,
21422 #[serde(rename = "USER")]
21423 User,
21424}
21425#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21426pub enum LlmMessageRole {
21427 #[serde(rename = "ASSISTANT")]
21428 Assistant,
21429 #[serde(rename = "SYSTEM")]
21430 System,
21431 #[serde(rename = "USER")]
21432 User,
21433}
21434#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21435pub enum ModuleSourceExperimentalFeature {
21436 #[serde(rename = "SELF_CALLS")]
21437 SelfCalls,
21438}
21439#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21440pub enum ModuleSourceKind {
21441 #[serde(rename = "DIR")]
21442 Dir,
21443 #[serde(rename = "DIR_SOURCE")]
21444 DirSource,
21445 #[serde(rename = "GIT")]
21446 Git,
21447 #[serde(rename = "GIT_SOURCE")]
21448 GitSource,
21449 #[serde(rename = "LOCAL")]
21450 Local,
21451 #[serde(rename = "LOCAL_SOURCE")]
21452 LocalSource,
21453}
21454#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21455pub enum NetworkProtocol {
21456 #[serde(rename = "TCP")]
21457 Tcp,
21458 #[serde(rename = "UDP")]
21459 Udp,
21460}
21461#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21462pub enum PatchConflict {
21463 #[serde(rename = "FAIL")]
21464 Fail,
21465 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21466 LeaveConflictMarkers,
21467}
21468#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21469pub enum RegistryProtocol {
21470 #[serde(rename = "HTTP")]
21471 Http,
21472 #[serde(rename = "HTTPS")]
21473 Https,
21474}
21475#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21476pub enum ReturnType {
21477 #[serde(rename = "ANY")]
21478 Any,
21479 #[serde(rename = "FAILURE")]
21480 Failure,
21481 #[serde(rename = "SUCCESS")]
21482 Success,
21483}
21484#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21485pub enum TypeDefKind {
21486 #[serde(rename = "BOOLEAN")]
21487 Boolean,
21488 #[serde(rename = "BOOLEAN_KIND")]
21489 BooleanKind,
21490 #[serde(rename = "ENUM")]
21491 Enum,
21492 #[serde(rename = "ENUM_KIND")]
21493 EnumKind,
21494 #[serde(rename = "FLOAT")]
21495 Float,
21496 #[serde(rename = "FLOAT_KIND")]
21497 FloatKind,
21498 #[serde(rename = "INPUT")]
21499 Input,
21500 #[serde(rename = "INPUT_KIND")]
21501 InputKind,
21502 #[serde(rename = "INTEGER")]
21503 Integer,
21504 #[serde(rename = "INTEGER_KIND")]
21505 IntegerKind,
21506 #[serde(rename = "INTERFACE")]
21507 Interface,
21508 #[serde(rename = "INTERFACE_KIND")]
21509 InterfaceKind,
21510 #[serde(rename = "LIST")]
21511 List,
21512 #[serde(rename = "LIST_KIND")]
21513 ListKind,
21514 #[serde(rename = "OBJECT")]
21515 Object,
21516 #[serde(rename = "OBJECT_KIND")]
21517 ObjectKind,
21518 #[serde(rename = "SCALAR")]
21519 Scalar,
21520 #[serde(rename = "SCALAR_KIND")]
21521 ScalarKind,
21522 #[serde(rename = "STRING")]
21523 String,
21524 #[serde(rename = "STRING_KIND")]
21525 StringKind,
21526 #[serde(rename = "VOID")]
21527 Void,
21528 #[serde(rename = "VOID_KIND")]
21529 VoidKind,
21530}
21531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21532pub enum WorkspaceCommitPickReason {
21533 #[serde(rename = "CONTENT")]
21534 Content,
21535 #[serde(rename = "DIRTY")]
21536 Dirty,
21537 #[serde(rename = "NONE")]
21538 None,
21539}
21540#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21541pub enum WorkspaceCommitPickStatus {
21542 #[serde(rename = "CONFLICT")]
21543 Conflict,
21544 #[serde(rename = "PICKABLE")]
21545 Pickable,
21546 #[serde(rename = "PICKED")]
21547 Picked,
21548 #[serde(rename = "REDUNDANT")]
21549 Redundant,
21550}