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 #[builder(setter(into, strip_option), default)]
14405 pub main: Option<bool>,
14406}
14407impl IntoID<Id> for Module {
14408 fn into_id(
14409 self,
14410 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14411 Box::pin(async move { self.id().await })
14412 }
14413}
14414impl Loadable for Module {
14415 fn graphql_type() -> &'static str {
14416 "Module"
14417 }
14418 fn from_query(
14419 proc: Option<Arc<DaggerSessionProc>>,
14420 selection: Selection,
14421 graphql_client: DynGraphQLClient,
14422 ) -> Self {
14423 Self {
14424 proc,
14425 selection,
14426 graphql_client,
14427 }
14428 }
14429}
14430impl Module {
14431 pub async fn id(&self) -> Result<Id, DaggerError> {
14433 let query = self.selection.select("id");
14434 query.execute(self.graphql_client.clone()).await
14435 }
14436 pub async fn context_source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14438 let query = self.selection.select("contextSource");
14439 let query = query.select("id");
14440 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14441 Ok(id.map(|id| ModuleSource {
14442 proc: self.proc.clone(),
14443 selection: query
14444 .root()
14445 .select("node")
14446 .arg("id", &id.0)
14447 .inline_fragment("ModuleSource"),
14448 graphql_client: self.graphql_client.clone(),
14449 }))
14450 }
14451 pub async fn sync(&self) -> Result<Module, DaggerError> {
14453 let query = self.selection.select("sync");
14454 let id: Id = query.execute(self.graphql_client.clone()).await?;
14455 Ok(Module {
14456 proc: self.proc.clone(),
14457 selection: query
14458 .root()
14459 .select("node")
14460 .arg("id", &id.0)
14461 .inline_fragment("Module"),
14462 graphql_client: self.graphql_client.clone(),
14463 })
14464 }
14465 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
14467 let query = self.selection.select("dependencies");
14468 let query = query.select("id");
14469 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14470 Ok(ids
14471 .into_iter()
14472 .map(|id| Module {
14473 proc: self.proc.clone(),
14474 selection: crate::querybuilder::query()
14475 .select("node")
14476 .arg("id", &id.0)
14477 .inline_fragment("Module"),
14478 graphql_client: self.graphql_client.clone(),
14479 })
14480 .collect())
14481 }
14482 pub fn introspection_schema_json(&self) -> File {
14486 let query = self.selection.select("introspectionSchemaJSON");
14487 File {
14488 proc: self.proc.clone(),
14489 selection: query,
14490 graphql_client: self.graphql_client.clone(),
14491 }
14492 }
14493 pub fn generated_context_directory(&self) -> Directory {
14495 let query = self.selection.select("generatedContextDirectory");
14496 Directory {
14497 proc: self.proc.clone(),
14498 selection: query,
14499 graphql_client: self.graphql_client.clone(),
14500 }
14501 }
14502 pub fn user_defaults(&self) -> EnvFile {
14504 let query = self.selection.select("userDefaults");
14505 EnvFile {
14506 proc: self.proc.clone(),
14507 selection: query,
14508 graphql_client: self.graphql_client.clone(),
14509 }
14510 }
14511 pub fn with_description(&self, description: impl Into<String>) -> Module {
14517 let mut query = self.selection.select("withDescription");
14518 query = query.arg("description", description.into());
14519 Module {
14520 proc: self.proc.clone(),
14521 selection: query,
14522 graphql_client: self.graphql_client.clone(),
14523 }
14524 }
14525 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
14527 let mut query = self.selection.select("withObject");
14528 query = query.arg_lazy(
14529 "object",
14530 Box::new(move || {
14531 let object = object.clone();
14532 Box::pin(async move { object.into_id().await.unwrap().quote() })
14533 }),
14534 );
14535 Module {
14536 proc: self.proc.clone(),
14537 selection: query,
14538 graphql_client: self.graphql_client.clone(),
14539 }
14540 }
14541 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
14543 let mut query = self.selection.select("withInterface");
14544 query = query.arg_lazy(
14545 "iface",
14546 Box::new(move || {
14547 let iface = iface.clone();
14548 Box::pin(async move { iface.into_id().await.unwrap().quote() })
14549 }),
14550 );
14551 Module {
14552 proc: self.proc.clone(),
14553 selection: query,
14554 graphql_client: self.graphql_client.clone(),
14555 }
14556 }
14557 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
14559 let mut query = self.selection.select("withEnum");
14560 query = query.arg_lazy(
14561 "enum",
14562 Box::new(move || {
14563 let r#enum = r#enum.clone();
14564 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
14565 }),
14566 );
14567 Module {
14568 proc: self.proc.clone(),
14569 selection: query,
14570 graphql_client: self.graphql_client.clone(),
14571 }
14572 }
14573 pub async fn runtime(&self) -> Result<Option<Container>, DaggerError> {
14575 let query = self.selection.select("runtime");
14576 let query = query.select("id");
14577 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14578 Ok(id.map(|id| Container {
14579 proc: self.proc.clone(),
14580 selection: query
14581 .root()
14582 .select("node")
14583 .arg("id", &id.0)
14584 .inline_fragment("Container"),
14585 graphql_client: self.graphql_client.clone(),
14586 }))
14587 }
14588 pub async fn serve(&self) -> Result<Void, DaggerError> {
14595 let query = self.selection.select("serve");
14596 query.execute(self.graphql_client.clone()).await
14597 }
14598 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
14605 let mut query = self.selection.select("serve");
14606 if let Some(include_dependencies) = opts.include_dependencies {
14607 query = query.arg("includeDependencies", include_dependencies);
14608 }
14609 if let Some(main) = opts.main {
14610 query = query.arg("main", main);
14611 }
14612 if let Some(entrypoint) = opts.entrypoint {
14613 query = query.arg("entrypoint", entrypoint);
14614 }
14615 query.execute(self.graphql_client.clone()).await
14616 }
14617 pub async fn source(&self) -> Result<Option<ModuleSource>, DaggerError> {
14619 let query = self.selection.select("source");
14620 let query = query.select("id");
14621 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14622 Ok(id.map(|id| ModuleSource {
14623 proc: self.proc.clone(),
14624 selection: query
14625 .root()
14626 .select("node")
14627 .arg("id", &id.0)
14628 .inline_fragment("ModuleSource"),
14629 graphql_client: self.graphql_client.clone(),
14630 }))
14631 }
14632 pub async fn name(&self) -> Result<String, DaggerError> {
14634 let query = self.selection.select("name");
14635 query.execute(self.graphql_client.clone()).await
14636 }
14637 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
14639 let query = self.selection.select("sdk");
14640 let query = query.select("id");
14641 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
14642 Ok(id.map(|id| SdkConfig {
14643 proc: self.proc.clone(),
14644 selection: query
14645 .root()
14646 .select("node")
14647 .arg("id", &id.0)
14648 .inline_fragment("SDKConfig"),
14649 graphql_client: self.graphql_client.clone(),
14650 }))
14651 }
14652 pub async fn description(&self) -> Result<String, DaggerError> {
14654 let query = self.selection.select("description");
14655 query.execute(self.graphql_client.clone()).await
14656 }
14657 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
14659 let query = self.selection.select("objects");
14660 let query = query.select("id");
14661 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14662 Ok(ids
14663 .into_iter()
14664 .map(|id| TypeDef {
14665 proc: self.proc.clone(),
14666 selection: crate::querybuilder::query()
14667 .select("node")
14668 .arg("id", &id.0)
14669 .inline_fragment("TypeDef"),
14670 graphql_client: self.graphql_client.clone(),
14671 })
14672 .collect())
14673 }
14674 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
14676 let query = self.selection.select("interfaces");
14677 let query = query.select("id");
14678 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14679 Ok(ids
14680 .into_iter()
14681 .map(|id| TypeDef {
14682 proc: self.proc.clone(),
14683 selection: crate::querybuilder::query()
14684 .select("node")
14685 .arg("id", &id.0)
14686 .inline_fragment("TypeDef"),
14687 graphql_client: self.graphql_client.clone(),
14688 })
14689 .collect())
14690 }
14691 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
14693 let query = self.selection.select("enums");
14694 let query = query.select("id");
14695 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14696 Ok(ids
14697 .into_iter()
14698 .map(|id| TypeDef {
14699 proc: self.proc.clone(),
14700 selection: crate::querybuilder::query()
14701 .select("node")
14702 .arg("id", &id.0)
14703 .inline_fragment("TypeDef"),
14704 graphql_client: self.graphql_client.clone(),
14705 })
14706 .collect())
14707 }
14708}
14709impl Node for Module {
14710 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14711 let query = self.selection.select("id");
14712 let graphql_client = self.graphql_client.clone();
14713 async move { query.execute(graphql_client).await }
14714 }
14715}
14716impl Syncer for Module {
14717 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14718 let query = self.selection.select("id");
14719 let graphql_client = self.graphql_client.clone();
14720 async move { query.execute(graphql_client).await }
14721 }
14722 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
14723 let query = self.selection.select("sync");
14724 let proc = self.proc.clone();
14725 let graphql_client = self.graphql_client.clone();
14726 async move {
14727 let id: Id = query.execute(graphql_client.clone()).await?;
14728 Ok(Self {
14729 proc,
14730 selection: query
14731 .root()
14732 .select("node")
14733 .arg("id", &id.0)
14734 .inline_fragment("Module"),
14735 graphql_client,
14736 })
14737 }
14738 }
14739}
14740#[derive(Clone)]
14741pub struct ModuleConfigClient {
14742 pub proc: Option<Arc<DaggerSessionProc>>,
14743 pub selection: Selection,
14744 pub graphql_client: DynGraphQLClient,
14745}
14746impl IntoID<Id> for ModuleConfigClient {
14747 fn into_id(
14748 self,
14749 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14750 Box::pin(async move { self.id().await })
14751 }
14752}
14753impl Loadable for ModuleConfigClient {
14754 fn graphql_type() -> &'static str {
14755 "ModuleConfigClient"
14756 }
14757 fn from_query(
14758 proc: Option<Arc<DaggerSessionProc>>,
14759 selection: Selection,
14760 graphql_client: DynGraphQLClient,
14761 ) -> Self {
14762 Self {
14763 proc,
14764 selection,
14765 graphql_client,
14766 }
14767 }
14768}
14769impl ModuleConfigClient {
14770 pub async fn id(&self) -> Result<Id, DaggerError> {
14772 let query = self.selection.select("id");
14773 query.execute(self.graphql_client.clone()).await
14774 }
14775 pub async fn generator(&self) -> Result<String, DaggerError> {
14777 let query = self.selection.select("generator");
14778 query.execute(self.graphql_client.clone()).await
14779 }
14780 pub async fn directory(&self) -> Result<String, DaggerError> {
14782 let query = self.selection.select("directory");
14783 query.execute(self.graphql_client.clone()).await
14784 }
14785}
14786impl Node for ModuleConfigClient {
14787 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14788 let query = self.selection.select("id");
14789 let graphql_client = self.graphql_client.clone();
14790 async move { query.execute(graphql_client).await }
14791 }
14792}
14793#[derive(Clone)]
14794pub struct ModuleSource {
14795 pub proc: Option<Arc<DaggerSessionProc>>,
14796 pub selection: Selection,
14797 pub graphql_client: DynGraphQLClient,
14798}
14799impl IntoID<Id> for ModuleSource {
14800 fn into_id(
14801 self,
14802 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14803 Box::pin(async move { self.id().await })
14804 }
14805}
14806impl Loadable for ModuleSource {
14807 fn graphql_type() -> &'static str {
14808 "ModuleSource"
14809 }
14810 fn from_query(
14811 proc: Option<Arc<DaggerSessionProc>>,
14812 selection: Selection,
14813 graphql_client: DynGraphQLClient,
14814 ) -> Self {
14815 Self {
14816 proc,
14817 selection,
14818 graphql_client,
14819 }
14820 }
14821}
14822impl ModuleSource {
14823 pub async fn id(&self) -> Result<Id, DaggerError> {
14825 let query = self.selection.select("id");
14826 query.execute(self.graphql_client.clone()).await
14827 }
14828 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
14830 let query = self.selection.select("sync");
14831 let id: Id = query.execute(self.graphql_client.clone()).await?;
14832 Ok(ModuleSource {
14833 proc: self.proc.clone(),
14834 selection: query
14835 .root()
14836 .select("node")
14837 .arg("id", &id.0)
14838 .inline_fragment("ModuleSource"),
14839 graphql_client: self.graphql_client.clone(),
14840 })
14841 }
14842 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
14844 let query = self.selection.select("sourceSubpath");
14845 query.execute(self.graphql_client.clone()).await
14846 }
14847 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
14849 let query = self.selection.select("originalSubpath");
14850 query.execute(self.graphql_client.clone()).await
14851 }
14852 pub async fn digest(&self) -> Result<String, DaggerError> {
14854 let query = self.selection.select("digest");
14855 query.execute(self.graphql_client.clone()).await
14856 }
14857 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
14863 let mut query = self.selection.select("withSourceSubpath");
14864 query = query.arg("path", path.into());
14865 ModuleSource {
14866 proc: self.proc.clone(),
14867 selection: query,
14868 graphql_client: self.graphql_client.clone(),
14869 }
14870 }
14871 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
14877 let mut query = self.selection.select("withName");
14878 query = query.arg("name", name.into());
14879 ModuleSource {
14880 proc: self.proc.clone(),
14881 selection: query,
14882 graphql_client: self.graphql_client.clone(),
14883 }
14884 }
14885 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
14891 let mut query = self.selection.select("withIncludes");
14892 query = query.arg(
14893 "patterns",
14894 patterns
14895 .into_iter()
14896 .map(|i| i.into())
14897 .collect::<Vec<String>>(),
14898 );
14899 ModuleSource {
14900 proc: self.proc.clone(),
14901 selection: query,
14902 graphql_client: self.graphql_client.clone(),
14903 }
14904 }
14905 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
14911 let mut query = self.selection.select("withSDK");
14912 query = query.arg("source", source.into());
14913 ModuleSource {
14914 proc: self.proc.clone(),
14915 selection: query,
14916 graphql_client: self.graphql_client.clone(),
14917 }
14918 }
14919 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
14925 let mut query = self.selection.select("withEngineVersion");
14926 query = query.arg("version", version.into());
14927 ModuleSource {
14928 proc: self.proc.clone(),
14929 selection: query,
14930 graphql_client: self.graphql_client.clone(),
14931 }
14932 }
14933 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
14939 let mut query = self.selection.select("withDependencies");
14940 query = query.arg("dependencies", dependencies);
14941 ModuleSource {
14942 proc: self.proc.clone(),
14943 selection: query,
14944 graphql_client: self.graphql_client.clone(),
14945 }
14946 }
14947 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14953 let mut query = self.selection.select("withUpdateDependencies");
14954 query = query.arg(
14955 "dependencies",
14956 dependencies
14957 .into_iter()
14958 .map(|i| i.into())
14959 .collect::<Vec<String>>(),
14960 );
14961 ModuleSource {
14962 proc: self.proc.clone(),
14963 selection: query,
14964 graphql_client: self.graphql_client.clone(),
14965 }
14966 }
14967 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
14973 let mut query = self.selection.select("withoutDependencies");
14974 query = query.arg(
14975 "dependencies",
14976 dependencies
14977 .into_iter()
14978 .map(|i| i.into())
14979 .collect::<Vec<String>>(),
14980 );
14981 ModuleSource {
14982 proc: self.proc.clone(),
14983 selection: query,
14984 graphql_client: self.graphql_client.clone(),
14985 }
14986 }
14987 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
14993 let mut query = self.selection.select("withBlueprint");
14994 query = query.arg_lazy(
14995 "blueprint",
14996 Box::new(move || {
14997 let blueprint = blueprint.clone();
14998 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
14999 }),
15000 );
15001 ModuleSource {
15002 proc: self.proc.clone(),
15003 selection: query,
15004 graphql_client: self.graphql_client.clone(),
15005 }
15006 }
15007 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
15013 let mut query = self.selection.select("withToolchains");
15014 query = query.arg("toolchains", toolchains);
15015 ModuleSource {
15016 proc: self.proc.clone(),
15017 selection: query,
15018 graphql_client: self.graphql_client.clone(),
15019 }
15020 }
15021 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
15027 let mut query = self.selection.select("withUpdateToolchains");
15028 query = query.arg(
15029 "toolchains",
15030 toolchains
15031 .into_iter()
15032 .map(|i| i.into())
15033 .collect::<Vec<String>>(),
15034 );
15035 ModuleSource {
15036 proc: self.proc.clone(),
15037 selection: query,
15038 graphql_client: self.graphql_client.clone(),
15039 }
15040 }
15041 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
15047 let mut query = self.selection.select("withoutToolchains");
15048 query = query.arg(
15049 "toolchains",
15050 toolchains
15051 .into_iter()
15052 .map(|i| i.into())
15053 .collect::<Vec<String>>(),
15054 );
15055 ModuleSource {
15056 proc: self.proc.clone(),
15057 selection: query,
15058 graphql_client: self.graphql_client.clone(),
15059 }
15060 }
15061 pub fn with_update_blueprint(&self) -> ModuleSource {
15063 let query = self.selection.select("withUpdateBlueprint");
15064 ModuleSource {
15065 proc: self.proc.clone(),
15066 selection: query,
15067 graphql_client: self.graphql_client.clone(),
15068 }
15069 }
15070 pub fn without_blueprint(&self) -> ModuleSource {
15072 let query = self.selection.select("withoutBlueprint");
15073 ModuleSource {
15074 proc: self.proc.clone(),
15075 selection: query,
15076 graphql_client: self.graphql_client.clone(),
15077 }
15078 }
15079 pub fn with_experimental_features(
15085 &self,
15086 features: Vec<ModuleSourceExperimentalFeature>,
15087 ) -> ModuleSource {
15088 let mut query = self.selection.select("withExperimentalFeatures");
15089 query = query.arg("features", features);
15090 ModuleSource {
15091 proc: self.proc.clone(),
15092 selection: query,
15093 graphql_client: self.graphql_client.clone(),
15094 }
15095 }
15096 pub fn without_experimental_features(
15102 &self,
15103 features: Vec<ModuleSourceExperimentalFeature>,
15104 ) -> ModuleSource {
15105 let mut query = self.selection.select("withoutExperimentalFeatures");
15106 query = query.arg("features", features);
15107 ModuleSource {
15108 proc: self.proc.clone(),
15109 selection: query,
15110 graphql_client: self.graphql_client.clone(),
15111 }
15112 }
15113 pub fn generated_context_directory(&self) -> Directory {
15115 let query = self.selection.select("generatedContextDirectory");
15116 Directory {
15117 proc: self.proc.clone(),
15118 selection: query,
15119 graphql_client: self.graphql_client.clone(),
15120 }
15121 }
15122 pub fn updated_config_directory(&self) -> Directory {
15125 let query = self.selection.select("updatedConfigDirectory");
15126 Directory {
15127 proc: self.proc.clone(),
15128 selection: query,
15129 graphql_client: self.graphql_client.clone(),
15130 }
15131 }
15132 pub fn generated_context_changeset(&self) -> Changeset {
15134 let query = self.selection.select("generatedContextChangeset");
15135 Changeset {
15136 proc: self.proc.clone(),
15137 selection: query,
15138 graphql_client: self.graphql_client.clone(),
15139 }
15140 }
15141 pub fn generate(&self, workspace: impl IntoID<Id>) -> Workspace {
15148 let mut query = self.selection.select("generate");
15149 query = query.arg_lazy(
15150 "workspace",
15151 Box::new(move || {
15152 let workspace = workspace.clone();
15153 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
15154 }),
15155 );
15156 Workspace {
15157 proc: self.proc.clone(),
15158 selection: query,
15159 graphql_client: self.graphql_client.clone(),
15160 }
15161 }
15162 pub async fn as_string(&self) -> Result<String, DaggerError> {
15164 let query = self.selection.select("asString");
15165 query.execute(self.graphql_client.clone()).await
15166 }
15167 pub async fn pin(&self) -> Result<String, DaggerError> {
15169 let query = self.selection.select("pin");
15170 query.execute(self.graphql_client.clone()).await
15171 }
15172 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
15174 let query = self.selection.select("localContextDirectoryPath");
15175 query.execute(self.graphql_client.clone()).await
15176 }
15177 pub fn as_module(&self) -> Module {
15179 let query = self.selection.select("asModule");
15180 Module {
15181 proc: self.proc.clone(),
15182 selection: query,
15183 graphql_client: self.graphql_client.clone(),
15184 }
15185 }
15186 pub fn introspection_schema_json(&self) -> File {
15190 let query = self.selection.select("introspectionSchemaJSON");
15191 File {
15192 proc: self.proc.clone(),
15193 selection: query,
15194 graphql_client: self.graphql_client.clone(),
15195 }
15196 }
15197 pub fn client_schema_introspection_json(&self) -> File {
15200 let query = self.selection.select("clientSchemaIntrospectionJSON");
15201 File {
15202 proc: self.proc.clone(),
15203 selection: query,
15204 graphql_client: self.graphql_client.clone(),
15205 }
15206 }
15207 pub fn directory(&self, path: impl Into<String>) -> Directory {
15213 let mut query = self.selection.select("directory");
15214 query = query.arg("path", path.into());
15215 Directory {
15216 proc: self.proc.clone(),
15217 selection: query,
15218 graphql_client: self.graphql_client.clone(),
15219 }
15220 }
15221 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
15223 let query = self.selection.select("cloneRef");
15224 query.execute(self.graphql_client.clone()).await
15225 }
15226 pub async fn html_url(&self) -> Result<String, DaggerError> {
15228 let query = self.selection.select("htmlURL");
15229 query.execute(self.graphql_client.clone()).await
15230 }
15231 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
15233 let query = self.selection.select("htmlRepoURL");
15234 query.execute(self.graphql_client.clone()).await
15235 }
15236 pub async fn version(&self) -> Result<String, DaggerError> {
15238 let query = self.selection.select("version");
15239 query.execute(self.graphql_client.clone()).await
15240 }
15241 pub async fn commit(&self) -> Result<String, DaggerError> {
15243 let query = self.selection.select("commit");
15244 query.execute(self.graphql_client.clone()).await
15245 }
15246 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
15248 let query = self.selection.select("repoRootPath");
15249 query.execute(self.graphql_client.clone()).await
15250 }
15251 pub fn with_client(
15258 &self,
15259 generator: impl Into<String>,
15260 output_dir: impl Into<String>,
15261 ) -> ModuleSource {
15262 let mut query = self.selection.select("withClient");
15263 query = query.arg("generator", generator.into());
15264 query = query.arg("outputDir", output_dir.into());
15265 ModuleSource {
15266 proc: self.proc.clone(),
15267 selection: query,
15268 graphql_client: self.graphql_client.clone(),
15269 }
15270 }
15271 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
15277 let mut query = self.selection.select("withUpdatedClients");
15278 query = query.arg(
15279 "clients",
15280 clients
15281 .into_iter()
15282 .map(|i| i.into())
15283 .collect::<Vec<String>>(),
15284 );
15285 ModuleSource {
15286 proc: self.proc.clone(),
15287 selection: query,
15288 graphql_client: self.graphql_client.clone(),
15289 }
15290 }
15291 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
15297 let mut query = self.selection.select("withoutClient");
15298 query = query.arg("path", path.into());
15299 ModuleSource {
15300 proc: self.proc.clone(),
15301 selection: query,
15302 graphql_client: self.graphql_client.clone(),
15303 }
15304 }
15305 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
15307 let query = self.selection.select("configExists");
15308 query.execute(self.graphql_client.clone()).await
15309 }
15310 pub async fn module_name(&self) -> Result<String, DaggerError> {
15312 let query = self.selection.select("moduleName");
15313 query.execute(self.graphql_client.clone()).await
15314 }
15315 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
15317 let query = self.selection.select("moduleOriginalName");
15318 query.execute(self.graphql_client.clone()).await
15319 }
15320 pub async fn engine_version(&self) -> Result<String, DaggerError> {
15322 let query = self.selection.select("engineVersion");
15323 query.execute(self.graphql_client.clone()).await
15324 }
15325 pub async fn sdk(&self) -> Result<Option<SdkConfig>, DaggerError> {
15327 let query = self.selection.select("sdk");
15328 let query = query.select("id");
15329 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15330 Ok(id.map(|id| SdkConfig {
15331 proc: self.proc.clone(),
15332 selection: query
15333 .root()
15334 .select("node")
15335 .arg("id", &id.0)
15336 .inline_fragment("SDKConfig"),
15337 graphql_client: self.graphql_client.clone(),
15338 }))
15339 }
15340 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15342 let query = self.selection.select("dependencies");
15343 let query = query.select("id");
15344 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15345 Ok(ids
15346 .into_iter()
15347 .map(|id| ModuleSource {
15348 proc: self.proc.clone(),
15349 selection: crate::querybuilder::query()
15350 .select("node")
15351 .arg("id", &id.0)
15352 .inline_fragment("ModuleSource"),
15353 graphql_client: self.graphql_client.clone(),
15354 })
15355 .collect())
15356 }
15357 pub fn blueprint(&self) -> ModuleSource {
15359 let query = self.selection.select("blueprint");
15360 ModuleSource {
15361 proc: self.proc.clone(),
15362 selection: query,
15363 graphql_client: self.graphql_client.clone(),
15364 }
15365 }
15366 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
15368 let query = self.selection.select("toolchains");
15369 let query = query.select("id");
15370 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15371 Ok(ids
15372 .into_iter()
15373 .map(|id| ModuleSource {
15374 proc: self.proc.clone(),
15375 selection: crate::querybuilder::query()
15376 .select("node")
15377 .arg("id", &id.0)
15378 .inline_fragment("ModuleSource"),
15379 graphql_client: self.graphql_client.clone(),
15380 })
15381 .collect())
15382 }
15383 pub fn user_defaults(&self) -> EnvFile {
15385 let query = self.selection.select("userDefaults");
15386 EnvFile {
15387 proc: self.proc.clone(),
15388 selection: query,
15389 graphql_client: self.graphql_client.clone(),
15390 }
15391 }
15392 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
15394 let query = self.selection.select("configClients");
15395 let query = query.select("id");
15396 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15397 Ok(ids
15398 .into_iter()
15399 .map(|id| ModuleConfigClient {
15400 proc: self.proc.clone(),
15401 selection: crate::querybuilder::query()
15402 .select("node")
15403 .arg("id", &id.0)
15404 .inline_fragment("ModuleConfigClient"),
15405 graphql_client: self.graphql_client.clone(),
15406 })
15407 .collect())
15408 }
15409 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
15411 let query = self.selection.select("sourceRootSubpath");
15412 query.execute(self.graphql_client.clone()).await
15413 }
15414 pub fn context_directory(&self) -> Directory {
15416 let query = self.selection.select("contextDirectory");
15417 Directory {
15418 proc: self.proc.clone(),
15419 selection: query,
15420 graphql_client: self.graphql_client.clone(),
15421 }
15422 }
15423 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
15425 let query = self.selection.select("kind");
15426 query.execute(self.graphql_client.clone()).await
15427 }
15428}
15429impl Node for ModuleSource {
15430 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15431 let query = self.selection.select("id");
15432 let graphql_client = self.graphql_client.clone();
15433 async move { query.execute(graphql_client).await }
15434 }
15435}
15436impl Syncer for ModuleSource {
15437 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15438 let query = self.selection.select("id");
15439 let graphql_client = self.graphql_client.clone();
15440 async move { query.execute(graphql_client).await }
15441 }
15442 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
15443 let query = self.selection.select("sync");
15444 let proc = self.proc.clone();
15445 let graphql_client = self.graphql_client.clone();
15446 async move {
15447 let id: Id = query.execute(graphql_client.clone()).await?;
15448 Ok(Self {
15449 proc,
15450 selection: query
15451 .root()
15452 .select("node")
15453 .arg("id", &id.0)
15454 .inline_fragment("ModuleSource"),
15455 graphql_client,
15456 })
15457 }
15458 }
15459}
15460#[derive(Clone)]
15461pub struct NamingTerm {
15462 pub proc: Option<Arc<DaggerSessionProc>>,
15463 pub selection: Selection,
15464 pub graphql_client: DynGraphQLClient,
15465}
15466impl IntoID<Id> for NamingTerm {
15467 fn into_id(
15468 self,
15469 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15470 Box::pin(async move { self.id().await })
15471 }
15472}
15473impl Loadable for NamingTerm {
15474 fn graphql_type() -> &'static str {
15475 "NamingTerm"
15476 }
15477 fn from_query(
15478 proc: Option<Arc<DaggerSessionProc>>,
15479 selection: Selection,
15480 graphql_client: DynGraphQLClient,
15481 ) -> Self {
15482 Self {
15483 proc,
15484 selection,
15485 graphql_client,
15486 }
15487 }
15488}
15489impl NamingTerm {
15490 pub async fn id(&self) -> Result<Id, DaggerError> {
15492 let query = self.selection.select("id");
15493 query.execute(self.graphql_client.clone()).await
15494 }
15495 pub async fn spelling(&self) -> Result<String, DaggerError> {
15497 let query = self.selection.select("spelling");
15498 query.execute(self.graphql_client.clone()).await
15499 }
15500 pub async fn capitalized(&self) -> Result<String, DaggerError> {
15502 let query = self.selection.select("capitalized");
15503 query.execute(self.graphql_client.clone()).await
15504 }
15505}
15506impl Node for NamingTerm {
15507 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15508 let query = self.selection.select("id");
15509 let graphql_client = self.graphql_client.clone();
15510 async move { query.execute(graphql_client).await }
15511 }
15512}
15513#[derive(Clone)]
15514pub struct ObjectTypeDef {
15515 pub proc: Option<Arc<DaggerSessionProc>>,
15516 pub selection: Selection,
15517 pub graphql_client: DynGraphQLClient,
15518}
15519impl IntoID<Id> for ObjectTypeDef {
15520 fn into_id(
15521 self,
15522 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15523 Box::pin(async move { self.id().await })
15524 }
15525}
15526impl Loadable for ObjectTypeDef {
15527 fn graphql_type() -> &'static str {
15528 "ObjectTypeDef"
15529 }
15530 fn from_query(
15531 proc: Option<Arc<DaggerSessionProc>>,
15532 selection: Selection,
15533 graphql_client: DynGraphQLClient,
15534 ) -> Self {
15535 Self {
15536 proc,
15537 selection,
15538 graphql_client,
15539 }
15540 }
15541}
15542impl ObjectTypeDef {
15543 pub async fn id(&self) -> Result<Id, DaggerError> {
15545 let query = self.selection.select("id");
15546 query.execute(self.graphql_client.clone()).await
15547 }
15548 pub async fn name(&self) -> Result<String, DaggerError> {
15550 let query = self.selection.select("name");
15551 query.execute(self.graphql_client.clone()).await
15552 }
15553 pub async fn description(&self) -> Result<String, DaggerError> {
15555 let query = self.selection.select("description");
15556 query.execute(self.graphql_client.clone()).await
15557 }
15558 pub async fn source_map(&self) -> Result<Option<SourceMap>, DaggerError> {
15560 let query = self.selection.select("sourceMap");
15561 let query = query.select("id");
15562 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15563 Ok(id.map(|id| SourceMap {
15564 proc: self.proc.clone(),
15565 selection: query
15566 .root()
15567 .select("node")
15568 .arg("id", &id.0)
15569 .inline_fragment("SourceMap"),
15570 graphql_client: self.graphql_client.clone(),
15571 }))
15572 }
15573 pub async fn deprecated(&self) -> Result<String, DaggerError> {
15575 let query = self.selection.select("deprecated");
15576 query.execute(self.graphql_client.clone()).await
15577 }
15578 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15580 let query = self.selection.select("sourceModuleName");
15581 query.execute(self.graphql_client.clone()).await
15582 }
15583 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
15585 let query = self.selection.select("fields");
15586 let query = query.select("id");
15587 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15588 Ok(ids
15589 .into_iter()
15590 .map(|id| FieldTypeDef {
15591 proc: self.proc.clone(),
15592 selection: crate::querybuilder::query()
15593 .select("node")
15594 .arg("id", &id.0)
15595 .inline_fragment("FieldTypeDef"),
15596 graphql_client: self.graphql_client.clone(),
15597 })
15598 .collect())
15599 }
15600 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
15602 let query = self.selection.select("functions");
15603 let query = query.select("id");
15604 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15605 Ok(ids
15606 .into_iter()
15607 .map(|id| Function {
15608 proc: self.proc.clone(),
15609 selection: crate::querybuilder::query()
15610 .select("node")
15611 .arg("id", &id.0)
15612 .inline_fragment("Function"),
15613 graphql_client: self.graphql_client.clone(),
15614 })
15615 .collect())
15616 }
15617 pub async fn constructor(&self) -> Result<Option<Function>, DaggerError> {
15619 let query = self.selection.select("constructor");
15620 let query = query.select("id");
15621 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15622 Ok(id.map(|id| Function {
15623 proc: self.proc.clone(),
15624 selection: query
15625 .root()
15626 .select("node")
15627 .arg("id", &id.0)
15628 .inline_fragment("Function"),
15629 graphql_client: self.graphql_client.clone(),
15630 }))
15631 }
15632}
15633impl Node for ObjectTypeDef {
15634 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15635 let query = self.selection.select("id");
15636 let graphql_client = self.graphql_client.clone();
15637 async move { query.execute(graphql_client).await }
15638 }
15639}
15640#[derive(Clone)]
15641pub struct Port {
15642 pub proc: Option<Arc<DaggerSessionProc>>,
15643 pub selection: Selection,
15644 pub graphql_client: DynGraphQLClient,
15645}
15646impl IntoID<Id> for Port {
15647 fn into_id(
15648 self,
15649 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15650 Box::pin(async move { self.id().await })
15651 }
15652}
15653impl Loadable for Port {
15654 fn graphql_type() -> &'static str {
15655 "Port"
15656 }
15657 fn from_query(
15658 proc: Option<Arc<DaggerSessionProc>>,
15659 selection: Selection,
15660 graphql_client: DynGraphQLClient,
15661 ) -> Self {
15662 Self {
15663 proc,
15664 selection,
15665 graphql_client,
15666 }
15667 }
15668}
15669impl Port {
15670 pub async fn id(&self) -> Result<Id, DaggerError> {
15672 let query = self.selection.select("id");
15673 query.execute(self.graphql_client.clone()).await
15674 }
15675 pub async fn port(&self) -> Result<isize, DaggerError> {
15677 let query = self.selection.select("port");
15678 query.execute(self.graphql_client.clone()).await
15679 }
15680 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
15682 let query = self.selection.select("protocol");
15683 query.execute(self.graphql_client.clone()).await
15684 }
15685 pub async fn description(&self) -> Result<String, DaggerError> {
15687 let query = self.selection.select("description");
15688 query.execute(self.graphql_client.clone()).await
15689 }
15690 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
15692 let query = self.selection.select("experimentalSkipHealthcheck");
15693 query.execute(self.graphql_client.clone()).await
15694 }
15695}
15696impl Node for Port {
15697 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15698 let query = self.selection.select("id");
15699 let graphql_client = self.graphql_client.clone();
15700 async move { query.execute(graphql_client).await }
15701 }
15702}
15703#[derive(Clone)]
15704pub struct Query {
15705 pub proc: Option<Arc<DaggerSessionProc>>,
15706 pub selection: Selection,
15707 pub graphql_client: DynGraphQLClient,
15708}
15709#[derive(Builder, Debug, PartialEq)]
15710pub struct QueryFileOpts {
15711 #[builder(setter(into, strip_option), default)]
15713 pub permissions: Option<isize>,
15714}
15715#[derive(Builder, Debug, PartialEq)]
15716pub struct QueryBlobOpts {
15717 #[builder(setter(into, strip_option), default)]
15719 pub permissions: Option<isize>,
15720}
15721#[derive(Builder, Debug, PartialEq)]
15722pub struct QueryGitOpts<'a> {
15723 #[builder(setter(into, strip_option), default)]
15725 pub experimental_service_host: Option<Id>,
15726 #[builder(setter(into, strip_option), default)]
15728 pub http_auth_header: Option<Id>,
15729 #[builder(setter(into, strip_option), default)]
15731 pub http_auth_token: Option<Id>,
15732 #[builder(setter(into, strip_option), default)]
15734 pub http_auth_username: Option<&'a str>,
15735 #[builder(setter(into, strip_option), default)]
15737 pub keep_git_dir: Option<bool>,
15738 #[builder(setter(into, strip_option), default)]
15740 pub ssh_auth_socket: Option<Id>,
15741 #[builder(setter(into, strip_option), default)]
15743 pub ssh_known_hosts: Option<&'a str>,
15744}
15745#[derive(Builder, Debug, PartialEq)]
15746pub struct QueryContainerOpts {
15747 #[builder(setter(into, strip_option), default)]
15749 pub platform: Option<Platform>,
15750}
15751#[derive(Builder, Debug, PartialEq)]
15752pub struct QueryCacheVolumeOpts<'a> {
15753 #[builder(setter(into, strip_option), default)]
15757 pub owner: Option<&'a str>,
15758 #[builder(setter(into, strip_option), default)]
15760 pub sharing: Option<CacheSharingMode>,
15761 #[builder(setter(into, strip_option), default)]
15763 pub source: Option<Id>,
15764}
15765#[derive(Builder, Debug, PartialEq)]
15766pub struct QueryEngineVolumeOpts<'a> {
15767 #[builder(setter(into, strip_option), default)]
15769 pub subdir: Option<&'a str>,
15770}
15771#[derive(Builder, Debug, PartialEq)]
15772pub struct QuerySshfsVolumeOpts<'a> {
15773 #[builder(setter(into, strip_option), default)]
15775 pub cache_key: Option<&'a str>,
15776 #[builder(setter(into, strip_option), default)]
15778 pub experimental_service_host: Option<Id>,
15779 #[builder(setter(into, strip_option), default)]
15781 pub insecure_skip_host_key_check: Option<bool>,
15782 #[builder(setter(into, strip_option), default)]
15784 pub known_hosts: Option<Id>,
15785}
15786#[derive(Builder, Debug, PartialEq)]
15787pub struct QuerySecretOpts<'a> {
15788 #[builder(setter(into, strip_option), default)]
15792 pub cache_key: Option<&'a str>,
15793}
15794#[derive(Builder, Debug, PartialEq)]
15795pub struct QueryHttpOpts<'a> {
15796 #[builder(setter(into, strip_option), default)]
15798 pub auth_header: Option<Id>,
15799 #[builder(setter(into, strip_option), default)]
15801 pub checksum: Option<&'a str>,
15802 #[builder(setter(into, strip_option), default)]
15804 pub experimental_service_host: Option<Id>,
15805 #[builder(setter(into, strip_option), default)]
15807 pub name: Option<&'a str>,
15808 #[builder(setter(into, strip_option), default)]
15810 pub permissions: Option<isize>,
15811}
15812#[derive(Builder, Debug, PartialEq)]
15813pub struct QueryModuleSourceOpts<'a> {
15814 #[builder(setter(into, strip_option), default)]
15816 pub allow_not_exists: Option<bool>,
15817 #[builder(setter(into, strip_option), default)]
15819 pub disable_find_up: Option<bool>,
15820 #[builder(setter(into, strip_option), default)]
15822 pub ref_pin: Option<&'a str>,
15823 #[builder(setter(into, strip_option), default)]
15825 pub require_kind: Option<ModuleSourceKind>,
15826 #[builder(setter(into, strip_option), default)]
15828 pub version: Option<&'a str>,
15829}
15830#[derive(Builder, Debug, PartialEq)]
15831pub struct QueryCurrentTypeDefsOpts {
15832 #[builder(setter(into, strip_option), default)]
15835 pub hide_core: Option<bool>,
15836 #[builder(setter(into, strip_option), default)]
15838 pub return_all_types: Option<bool>,
15839}
15840#[derive(Builder, Debug, PartialEq)]
15841pub struct QueryServeModuleOpts<'a> {
15842 #[builder(setter(into, strip_option), default)]
15844 pub ref_pin: Option<&'a str>,
15845}
15846#[derive(Builder, Debug, PartialEq)]
15847pub struct QueryLlmOpts<'a> {
15848 #[builder(setter(into, strip_option), default)]
15850 pub model: Option<&'a str>,
15851 #[builder(setter(into, strip_option), default)]
15853 pub provider: Option<&'a str>,
15854}
15855#[derive(Builder, Debug, PartialEq)]
15856pub struct QueryFormatIdentifiersOpts<'a> {
15857 #[builder(setter(into, strip_option), default)]
15859 pub acronyms: Option<AcronymStyle>,
15860 #[builder(setter(into, strip_option), default)]
15862 pub version: Option<&'a str>,
15863}
15864#[derive(Builder, Debug, PartialEq)]
15865pub struct QueryEnvFileOpts {
15866 #[builder(setter(into, strip_option), default)]
15868 pub expand: Option<bool>,
15869}
15870impl IntoID<Id> for Query {
15871 fn into_id(
15872 self,
15873 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15874 Box::pin(async move { self.id().await })
15875 }
15876}
15877impl Loadable for Query {
15878 fn graphql_type() -> &'static str {
15879 "Query"
15880 }
15881 fn from_query(
15882 proc: Option<Arc<DaggerSessionProc>>,
15883 selection: Selection,
15884 graphql_client: DynGraphQLClient,
15885 ) -> Self {
15886 Self {
15887 proc,
15888 selection,
15889 graphql_client,
15890 }
15891 }
15892}
15893impl Query {
15894 pub async fn id(&self) -> Result<Id, DaggerError> {
15896 let query = self.selection.select("id");
15897 query.execute(self.graphql_client.clone()).await
15898 }
15899 pub async fn node(&self, id: impl IntoID<Id>) -> Result<Option<NodeClient>, DaggerError> {
15901 let mut query = self.selection.select("node");
15902 query = query.arg_lazy(
15903 "id",
15904 Box::new(move || {
15905 let id = id.clone();
15906 Box::pin(async move { id.into_id().await.unwrap().quote() })
15907 }),
15908 );
15909 let query = query.select("id");
15910 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
15911 Ok(id.map(|id| NodeClient {
15912 proc: self.proc.clone(),
15913 selection: query
15914 .root()
15915 .select("node")
15916 .arg("id", &id.0)
15917 .inline_fragment("Node"),
15918 graphql_client: self.graphql_client.clone(),
15919 }))
15920 }
15921 pub async fn version(&self) -> Result<String, DaggerError> {
15923 let query = self.selection.select("version");
15924 query.execute(self.graphql_client.clone()).await
15925 }
15926 pub async fn current_timestamp(&self) -> Result<String, DaggerError> {
15928 let query = self.selection.select("currentTimestamp");
15929 query.execute(self.graphql_client.clone()).await
15930 }
15931 pub async fn set_session_title(&self, title: impl Into<String>) -> Result<Void, DaggerError> {
15938 let mut query = self.selection.select("setSessionTitle");
15939 query = query.arg("title", title.into());
15940 query.execute(self.graphql_client.clone()).await
15941 }
15942 pub fn directory(&self) -> Directory {
15944 let query = self.selection.select("directory");
15945 Directory {
15946 proc: self.proc.clone(),
15947 selection: query,
15948 graphql_client: self.graphql_client.clone(),
15949 }
15950 }
15951 pub fn changeset(&self) -> Changeset {
15953 let query = self.selection.select("changeset");
15954 Changeset {
15955 proc: self.proc.clone(),
15956 selection: query,
15957 graphql_client: self.graphql_client.clone(),
15958 }
15959 }
15960 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
15968 let mut query = self.selection.select("file");
15969 query = query.arg("name", name.into());
15970 query = query.arg("contents", contents.into());
15971 File {
15972 proc: self.proc.clone(),
15973 selection: query,
15974 graphql_client: self.graphql_client.clone(),
15975 }
15976 }
15977 pub fn file_opts(
15985 &self,
15986 name: impl Into<String>,
15987 contents: impl Into<String>,
15988 opts: QueryFileOpts,
15989 ) -> File {
15990 let mut query = self.selection.select("file");
15991 query = query.arg("name", name.into());
15992 query = query.arg("contents", contents.into());
15993 if let Some(permissions) = opts.permissions {
15994 query = query.arg("permissions", permissions);
15995 }
15996 File {
15997 proc: self.proc.clone(),
15998 selection: query,
15999 graphql_client: self.graphql_client.clone(),
16000 }
16001 }
16002 pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File {
16010 let mut query = self.selection.select("blob");
16011 query = query.arg("name", name.into());
16012 query = query.arg("contents", contents);
16013 File {
16014 proc: self.proc.clone(),
16015 selection: query,
16016 graphql_client: self.graphql_client.clone(),
16017 }
16018 }
16019 pub fn blob_opts(&self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts) -> File {
16027 let mut query = self.selection.select("blob");
16028 query = query.arg("name", name.into());
16029 query = query.arg("contents", contents);
16030 if let Some(permissions) = opts.permissions {
16031 query = query.arg("permissions", permissions);
16032 }
16033 File {
16034 proc: self.proc.clone(),
16035 selection: query,
16036 graphql_client: self.graphql_client.clone(),
16037 }
16038 }
16039 pub fn git(&self, url: impl Into<String>) -> GitRepository {
16050 let mut query = self.selection.select("git");
16051 query = query.arg("url", url.into());
16052 GitRepository {
16053 proc: self.proc.clone(),
16054 selection: query,
16055 graphql_client: self.graphql_client.clone(),
16056 }
16057 }
16058 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
16069 let mut query = self.selection.select("git");
16070 query = query.arg("url", url.into());
16071 if let Some(keep_git_dir) = opts.keep_git_dir {
16072 query = query.arg("keepGitDir", keep_git_dir);
16073 }
16074 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
16075 query = query.arg("sshKnownHosts", ssh_known_hosts);
16076 }
16077 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
16078 query = query.arg("sshAuthSocket", ssh_auth_socket);
16079 }
16080 if let Some(http_auth_username) = opts.http_auth_username {
16081 query = query.arg("httpAuthUsername", http_auth_username);
16082 }
16083 if let Some(http_auth_token) = opts.http_auth_token {
16084 query = query.arg("httpAuthToken", http_auth_token);
16085 }
16086 if let Some(http_auth_header) = opts.http_auth_header {
16087 query = query.arg("httpAuthHeader", http_auth_header);
16088 }
16089 if let Some(experimental_service_host) = opts.experimental_service_host {
16090 query = query.arg("experimentalServiceHost", experimental_service_host);
16091 }
16092 GitRepository {
16093 proc: self.proc.clone(),
16094 selection: query,
16095 graphql_client: self.graphql_client.clone(),
16096 }
16097 }
16098 pub fn container(&self) -> Container {
16105 let query = self.selection.select("container");
16106 Container {
16107 proc: self.proc.clone(),
16108 selection: query,
16109 graphql_client: self.graphql_client.clone(),
16110 }
16111 }
16112 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
16119 let mut query = self.selection.select("container");
16120 if let Some(platform) = opts.platform {
16121 query = query.arg("platform", platform);
16122 }
16123 Container {
16124 proc: self.proc.clone(),
16125 selection: query,
16126 graphql_client: self.graphql_client.clone(),
16127 }
16128 }
16129 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
16136 let mut query = self.selection.select("cacheVolume");
16137 query = query.arg("key", key.into());
16138 CacheVolume {
16139 proc: self.proc.clone(),
16140 selection: query,
16141 graphql_client: self.graphql_client.clone(),
16142 }
16143 }
16144 pub fn cache_volume_opts<'a>(
16151 &self,
16152 key: impl Into<String>,
16153 opts: QueryCacheVolumeOpts<'a>,
16154 ) -> CacheVolume {
16155 let mut query = self.selection.select("cacheVolume");
16156 query = query.arg("key", key.into());
16157 if let Some(source) = opts.source {
16158 query = query.arg("source", source);
16159 }
16160 if let Some(sharing) = opts.sharing {
16161 query = query.arg("sharing", sharing);
16162 }
16163 if let Some(owner) = opts.owner {
16164 query = query.arg("owner", owner);
16165 }
16166 CacheVolume {
16167 proc: self.proc.clone(),
16168 selection: query,
16169 graphql_client: self.graphql_client.clone(),
16170 }
16171 }
16172 pub fn engine_volume(&self, name: impl Into<String>) -> Volume {
16179 let mut query = self.selection.select("engineVolume");
16180 query = query.arg("name", name.into());
16181 Volume {
16182 proc: self.proc.clone(),
16183 selection: query,
16184 graphql_client: self.graphql_client.clone(),
16185 }
16186 }
16187 pub fn engine_volume_opts<'a>(
16194 &self,
16195 name: impl Into<String>,
16196 opts: QueryEngineVolumeOpts<'a>,
16197 ) -> Volume {
16198 let mut query = self.selection.select("engineVolume");
16199 query = query.arg("name", name.into());
16200 if let Some(subdir) = opts.subdir {
16201 query = query.arg("subdir", subdir);
16202 }
16203 Volume {
16204 proc: self.proc.clone(),
16205 selection: query,
16206 graphql_client: self.graphql_client.clone(),
16207 }
16208 }
16209 pub fn sshfs_volume(
16217 &self,
16218 endpoint: impl Into<String>,
16219 private_key: impl IntoID<Id>,
16220 ) -> Volume {
16221 let mut query = self.selection.select("sshfsVolume");
16222 query = query.arg("endpoint", endpoint.into());
16223 query = query.arg_lazy(
16224 "privateKey",
16225 Box::new(move || {
16226 let private_key = private_key.clone();
16227 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
16228 }),
16229 );
16230 Volume {
16231 proc: self.proc.clone(),
16232 selection: query,
16233 graphql_client: self.graphql_client.clone(),
16234 }
16235 }
16236 pub fn sshfs_volume_opts<'a>(
16244 &self,
16245 endpoint: impl Into<String>,
16246 private_key: impl IntoID<Id>,
16247 opts: QuerySshfsVolumeOpts<'a>,
16248 ) -> Volume {
16249 let mut query = self.selection.select("sshfsVolume");
16250 query = query.arg("endpoint", endpoint.into());
16251 query = query.arg_lazy(
16252 "privateKey",
16253 Box::new(move || {
16254 let private_key = private_key.clone();
16255 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
16256 }),
16257 );
16258 if let Some(known_hosts) = opts.known_hosts {
16259 query = query.arg("knownHosts", known_hosts);
16260 }
16261 if let Some(cache_key) = opts.cache_key {
16262 query = query.arg("cacheKey", cache_key);
16263 }
16264 if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
16265 query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
16266 }
16267 if let Some(experimental_service_host) = opts.experimental_service_host {
16268 query = query.arg("experimentalServiceHost", experimental_service_host);
16269 }
16270 Volume {
16271 proc: self.proc.clone(),
16272 selection: query,
16273 graphql_client: self.graphql_client.clone(),
16274 }
16275 }
16276 pub fn secret(&self, uri: impl Into<String>) -> Secret {
16283 let mut query = self.selection.select("secret");
16284 query = query.arg("uri", uri.into());
16285 Secret {
16286 proc: self.proc.clone(),
16287 selection: query,
16288 graphql_client: self.graphql_client.clone(),
16289 }
16290 }
16291 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
16298 let mut query = self.selection.select("secret");
16299 query = query.arg("uri", uri.into());
16300 if let Some(cache_key) = opts.cache_key {
16301 query = query.arg("cacheKey", cache_key);
16302 }
16303 Secret {
16304 proc: self.proc.clone(),
16305 selection: query,
16306 graphql_client: self.graphql_client.clone(),
16307 }
16308 }
16309 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
16317 let mut query = self.selection.select("setSecret");
16318 query = query.arg("name", name.into());
16319 query = query.arg("plaintext", plaintext.into());
16320 Secret {
16321 proc: self.proc.clone(),
16322 selection: query,
16323 graphql_client: self.graphql_client.clone(),
16324 }
16325 }
16326 pub fn host(&self) -> Host {
16328 let query = self.selection.select("host");
16329 Host {
16330 proc: self.proc.clone(),
16331 selection: query,
16332 graphql_client: self.graphql_client.clone(),
16333 }
16334 }
16335 pub fn http(&self, url: impl Into<String>) -> File {
16342 let mut query = self.selection.select("http");
16343 query = query.arg("url", url.into());
16344 File {
16345 proc: self.proc.clone(),
16346 selection: query,
16347 graphql_client: self.graphql_client.clone(),
16348 }
16349 }
16350 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
16357 let mut query = self.selection.select("http");
16358 query = query.arg("url", url.into());
16359 if let Some(name) = opts.name {
16360 query = query.arg("name", name);
16361 }
16362 if let Some(permissions) = opts.permissions {
16363 query = query.arg("permissions", permissions);
16364 }
16365 if let Some(checksum) = opts.checksum {
16366 query = query.arg("checksum", checksum);
16367 }
16368 if let Some(auth_header) = opts.auth_header {
16369 query = query.arg("authHeader", auth_header);
16370 }
16371 if let Some(experimental_service_host) = opts.experimental_service_host {
16372 query = query.arg("experimentalServiceHost", experimental_service_host);
16373 }
16374 File {
16375 proc: self.proc.clone(),
16376 selection: query,
16377 graphql_client: self.graphql_client.clone(),
16378 }
16379 }
16380 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
16382 let query = self.selection.select("defaultPlatform");
16383 query.execute(self.graphql_client.clone()).await
16384 }
16385 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
16392 let mut query = self.selection.select("moduleSource");
16393 query = query.arg("refString", ref_string.into());
16394 ModuleSource {
16395 proc: self.proc.clone(),
16396 selection: query,
16397 graphql_client: self.graphql_client.clone(),
16398 }
16399 }
16400 pub fn module_source_opts<'a>(
16407 &self,
16408 ref_string: impl Into<String>,
16409 opts: QueryModuleSourceOpts<'a>,
16410 ) -> ModuleSource {
16411 let mut query = self.selection.select("moduleSource");
16412 query = query.arg("refString", ref_string.into());
16413 if let Some(version) = opts.version {
16414 query = query.arg("version", version);
16415 }
16416 if let Some(ref_pin) = opts.ref_pin {
16417 query = query.arg("refPin", ref_pin);
16418 }
16419 if let Some(disable_find_up) = opts.disable_find_up {
16420 query = query.arg("disableFindUp", disable_find_up);
16421 }
16422 if let Some(allow_not_exists) = opts.allow_not_exists {
16423 query = query.arg("allowNotExists", allow_not_exists);
16424 }
16425 if let Some(require_kind) = opts.require_kind {
16426 query = query.arg("requireKind", require_kind);
16427 }
16428 ModuleSource {
16429 proc: self.proc.clone(),
16430 selection: query,
16431 graphql_client: self.graphql_client.clone(),
16432 }
16433 }
16434 pub fn module(&self) -> Module {
16436 let query = self.selection.select("module");
16437 Module {
16438 proc: self.proc.clone(),
16439 selection: query,
16440 graphql_client: self.graphql_client.clone(),
16441 }
16442 }
16443 pub fn type_def(&self) -> TypeDef {
16445 let query = self.selection.select("typeDef");
16446 TypeDef {
16447 proc: self.proc.clone(),
16448 selection: query,
16449 graphql_client: self.graphql_client.clone(),
16450 }
16451 }
16452 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
16454 let mut query = self.selection.select("generatedCode");
16455 query = query.arg_lazy(
16456 "code",
16457 Box::new(move || {
16458 let code = code.clone();
16459 Box::pin(async move { code.into_id().await.unwrap().quote() })
16460 }),
16461 );
16462 GeneratedCode {
16463 proc: self.proc.clone(),
16464 selection: query,
16465 graphql_client: self.graphql_client.clone(),
16466 }
16467 }
16468 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
16475 let mut query = self.selection.select("function");
16476 query = query.arg("name", name.into());
16477 query = query.arg_lazy(
16478 "returnType",
16479 Box::new(move || {
16480 let return_type = return_type.clone();
16481 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
16482 }),
16483 );
16484 Function {
16485 proc: self.proc.clone(),
16486 selection: query,
16487 graphql_client: self.graphql_client.clone(),
16488 }
16489 }
16490 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
16498 let mut query = self.selection.select("sourceMap");
16499 query = query.arg("filename", filename.into());
16500 query = query.arg("line", line);
16501 query = query.arg("column", column);
16502 SourceMap {
16503 proc: self.proc.clone(),
16504 selection: query,
16505 graphql_client: self.graphql_client.clone(),
16506 }
16507 }
16508 pub fn current_module(&self) -> CurrentModule {
16510 let query = self.selection.select("currentModule");
16511 CurrentModule {
16512 proc: self.proc.clone(),
16513 selection: query,
16514 graphql_client: self.graphql_client.clone(),
16515 }
16516 }
16517 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
16523 let query = self.selection.select("currentTypeDefs");
16524 let query = query.select("id");
16525 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16526 Ok(ids
16527 .into_iter()
16528 .map(|id| TypeDef {
16529 proc: self.proc.clone(),
16530 selection: crate::querybuilder::query()
16531 .select("node")
16532 .arg("id", &id.0)
16533 .inline_fragment("TypeDef"),
16534 graphql_client: self.graphql_client.clone(),
16535 })
16536 .collect())
16537 }
16538 pub async fn current_type_defs_opts(
16544 &self,
16545 opts: QueryCurrentTypeDefsOpts,
16546 ) -> Result<Vec<TypeDef>, DaggerError> {
16547 let mut query = self.selection.select("currentTypeDefs");
16548 if let Some(return_all_types) = opts.return_all_types {
16549 query = query.arg("returnAllTypes", return_all_types);
16550 }
16551 if let Some(hide_core) = opts.hide_core {
16552 query = query.arg("hideCore", hide_core);
16553 }
16554 let query = query.select("id");
16555 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16556 Ok(ids
16557 .into_iter()
16558 .map(|id| TypeDef {
16559 proc: self.proc.clone(),
16560 selection: crate::querybuilder::query()
16561 .select("node")
16562 .arg("id", &id.0)
16563 .inline_fragment("TypeDef"),
16564 graphql_client: self.graphql_client.clone(),
16565 })
16566 .collect())
16567 }
16568 pub fn current_function_call(&self) -> FunctionCall {
16571 let query = self.selection.select("currentFunctionCall");
16572 FunctionCall {
16573 proc: self.proc.clone(),
16574 selection: query,
16575 graphql_client: self.graphql_client.clone(),
16576 }
16577 }
16578 pub async fn serve_module(&self, address: impl Into<String>) -> Result<Void, DaggerError> {
16590 let mut query = self.selection.select("serveModule");
16591 query = query.arg("address", address.into());
16592 query.execute(self.graphql_client.clone()).await
16593 }
16594 pub async fn serve_module_opts<'a>(
16606 &self,
16607 address: impl Into<String>,
16608 opts: QueryServeModuleOpts<'a>,
16609 ) -> Result<Void, DaggerError> {
16610 let mut query = self.selection.select("serveModule");
16611 query = query.arg("address", address.into());
16612 if let Some(ref_pin) = opts.ref_pin {
16613 query = query.arg("refPin", ref_pin);
16614 }
16615 query.execute(self.graphql_client.clone()).await
16616 }
16617 pub fn current_node(&self) -> NodeClient {
16619 let query = self.selection.select("currentNode");
16620 NodeClient {
16621 proc: self.proc.clone(),
16622 selection: query,
16623 graphql_client: self.graphql_client.clone(),
16624 }
16625 }
16626 pub fn error(&self, message: impl Into<String>) -> Error {
16632 let mut query = self.selection.select("error");
16633 query = query.arg("message", message.into());
16634 Error {
16635 proc: self.proc.clone(),
16636 selection: query,
16637 graphql_client: self.graphql_client.clone(),
16638 }
16639 }
16640 pub fn engine(&self) -> Engine {
16642 let query = self.selection.select("engine");
16643 Engine {
16644 proc: self.proc.clone(),
16645 selection: query,
16646 graphql_client: self.graphql_client.clone(),
16647 }
16648 }
16649 pub fn cloud(&self) -> Cloud {
16651 let query = self.selection.select("cloud");
16652 Cloud {
16653 proc: self.proc.clone(),
16654 selection: query,
16655 graphql_client: self.graphql_client.clone(),
16656 }
16657 }
16658 pub fn llm(&self) -> Llm {
16664 let query = self.selection.select("llm");
16665 Llm {
16666 proc: self.proc.clone(),
16667 selection: query,
16668 graphql_client: self.graphql_client.clone(),
16669 }
16670 }
16671 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
16677 let mut query = self.selection.select("llm");
16678 if let Some(model) = opts.model {
16679 query = query.arg("model", model);
16680 }
16681 if let Some(provider) = opts.provider {
16682 query = query.arg("provider", provider);
16683 }
16684 Llm {
16685 proc: self.proc.clone(),
16686 selection: query,
16687 graphql_client: self.graphql_client.clone(),
16688 }
16689 }
16690 pub fn llm_content(&self) -> LlmContent {
16693 let query = self.selection.select("llmContent");
16694 LlmContent {
16695 proc: self.proc.clone(),
16696 selection: query,
16697 graphql_client: self.graphql_client.clone(),
16698 }
16699 }
16700 pub fn json(&self) -> JsonValue {
16702 let query = self.selection.select("json");
16703 JsonValue {
16704 proc: self.proc.clone(),
16705 selection: query,
16706 graphql_client: self.graphql_client.clone(),
16707 }
16708 }
16709 pub fn identifier(&self, name: impl Into<String>) -> Identifier {
16716 let mut query = self.selection.select("identifier");
16717 query = query.arg("name", name.into());
16718 Identifier {
16719 proc: self.proc.clone(),
16720 selection: query,
16721 graphql_client: self.graphql_client.clone(),
16722 }
16723 }
16724 pub async fn format_identifiers(
16732 &self,
16733 names: Vec<impl Into<String>>,
16734 casing: Casing,
16735 ) -> Result<Vec<String>, DaggerError> {
16736 let mut query = self.selection.select("formatIdentifiers");
16737 query = query.arg(
16738 "names",
16739 names.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
16740 );
16741 query = query.arg("casing", casing);
16742 query.execute(self.graphql_client.clone()).await
16743 }
16744 pub async fn format_identifiers_opts<'a>(
16752 &self,
16753 names: Vec<impl Into<String>>,
16754 casing: Casing,
16755 opts: QueryFormatIdentifiersOpts<'a>,
16756 ) -> Result<Vec<String>, DaggerError> {
16757 let mut query = self.selection.select("formatIdentifiers");
16758 query = query.arg(
16759 "names",
16760 names.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
16761 );
16762 query = query.arg("casing", casing);
16763 if let Some(acronyms) = opts.acronyms {
16764 query = query.arg("acronyms", acronyms);
16765 }
16766 if let Some(version) = opts.version {
16767 query = query.arg("version", version);
16768 }
16769 query.execute(self.graphql_client.clone()).await
16770 }
16771 pub async fn naming_dictionary(&self) -> Result<Vec<NamingTerm>, DaggerError> {
16773 let query = self.selection.select("namingDictionary");
16774 let query = query.select("id");
16775 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16776 Ok(ids
16777 .into_iter()
16778 .map(|id| NamingTerm {
16779 proc: self.proc.clone(),
16780 selection: crate::querybuilder::query()
16781 .select("node")
16782 .arg("id", &id.0)
16783 .inline_fragment("NamingTerm"),
16784 graphql_client: self.graphql_client.clone(),
16785 })
16786 .collect())
16787 }
16788 pub fn schema(&self, json: Json) -> Schema {
16794 let mut query = self.selection.select("schema");
16795 query = query.arg("json", json);
16796 Schema {
16797 proc: self.proc.clone(),
16798 selection: query,
16799 graphql_client: self.graphql_client.clone(),
16800 }
16801 }
16802 pub fn env_file(&self) -> EnvFile {
16808 let query = self.selection.select("envFile");
16809 EnvFile {
16810 proc: self.proc.clone(),
16811 selection: query,
16812 graphql_client: self.graphql_client.clone(),
16813 }
16814 }
16815 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
16821 let mut query = self.selection.select("envFile");
16822 if let Some(expand) = opts.expand {
16823 query = query.arg("expand", expand);
16824 }
16825 EnvFile {
16826 proc: self.proc.clone(),
16827 selection: query,
16828 graphql_client: self.graphql_client.clone(),
16829 }
16830 }
16831 pub fn address(&self, value: impl Into<String>) -> Address {
16833 let mut query = self.selection.select("address");
16834 query = query.arg("value", value.into());
16835 Address {
16836 proc: self.proc.clone(),
16837 selection: query,
16838 graphql_client: self.graphql_client.clone(),
16839 }
16840 }
16841 pub fn current_workspace(&self) -> Workspace {
16843 let query = self.selection.select("currentWorkspace");
16844 Workspace {
16845 proc: self.proc.clone(),
16846 selection: query,
16847 graphql_client: self.graphql_client.clone(),
16848 }
16849 }
16850}
16851impl Node for Query {
16852 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16853 let query = self.selection.select("id");
16854 let graphql_client = self.graphql_client.clone();
16855 async move { query.execute(graphql_client).await }
16856 }
16857}
16858#[derive(Clone)]
16859pub struct RemoteGitMirror {
16860 pub proc: Option<Arc<DaggerSessionProc>>,
16861 pub selection: Selection,
16862 pub graphql_client: DynGraphQLClient,
16863}
16864impl IntoID<Id> for RemoteGitMirror {
16865 fn into_id(
16866 self,
16867 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16868 Box::pin(async move { self.id().await })
16869 }
16870}
16871impl Loadable for RemoteGitMirror {
16872 fn graphql_type() -> &'static str {
16873 "RemoteGitMirror"
16874 }
16875 fn from_query(
16876 proc: Option<Arc<DaggerSessionProc>>,
16877 selection: Selection,
16878 graphql_client: DynGraphQLClient,
16879 ) -> Self {
16880 Self {
16881 proc,
16882 selection,
16883 graphql_client,
16884 }
16885 }
16886}
16887impl RemoteGitMirror {
16888 pub async fn id(&self) -> Result<Id, DaggerError> {
16890 let query = self.selection.select("id");
16891 query.execute(self.graphql_client.clone()).await
16892 }
16893}
16894impl Node for RemoteGitMirror {
16895 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16896 let query = self.selection.select("id");
16897 let graphql_client = self.graphql_client.clone();
16898 async move { query.execute(graphql_client).await }
16899 }
16900}
16901#[derive(Clone)]
16902pub struct SdkConfig {
16903 pub proc: Option<Arc<DaggerSessionProc>>,
16904 pub selection: Selection,
16905 pub graphql_client: DynGraphQLClient,
16906}
16907impl IntoID<Id> for SdkConfig {
16908 fn into_id(
16909 self,
16910 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16911 Box::pin(async move { self.id().await })
16912 }
16913}
16914impl Loadable for SdkConfig {
16915 fn graphql_type() -> &'static str {
16916 "SDKConfig"
16917 }
16918 fn from_query(
16919 proc: Option<Arc<DaggerSessionProc>>,
16920 selection: Selection,
16921 graphql_client: DynGraphQLClient,
16922 ) -> Self {
16923 Self {
16924 proc,
16925 selection,
16926 graphql_client,
16927 }
16928 }
16929}
16930impl SdkConfig {
16931 pub async fn id(&self) -> Result<Id, DaggerError> {
16933 let query = self.selection.select("id");
16934 query.execute(self.graphql_client.clone()).await
16935 }
16936 pub async fn source(&self) -> Result<String, DaggerError> {
16938 let query = self.selection.select("source");
16939 query.execute(self.graphql_client.clone()).await
16940 }
16941 pub async fn debug(&self) -> Result<bool, DaggerError> {
16943 let query = self.selection.select("debug");
16944 query.execute(self.graphql_client.clone()).await
16945 }
16946}
16947impl Node for SdkConfig {
16948 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16949 let query = self.selection.select("id");
16950 let graphql_client = self.graphql_client.clone();
16951 async move { query.execute(graphql_client).await }
16952 }
16953}
16954#[derive(Clone)]
16955pub struct ScalarTypeDef {
16956 pub proc: Option<Arc<DaggerSessionProc>>,
16957 pub selection: Selection,
16958 pub graphql_client: DynGraphQLClient,
16959}
16960impl IntoID<Id> for ScalarTypeDef {
16961 fn into_id(
16962 self,
16963 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16964 Box::pin(async move { self.id().await })
16965 }
16966}
16967impl Loadable for ScalarTypeDef {
16968 fn graphql_type() -> &'static str {
16969 "ScalarTypeDef"
16970 }
16971 fn from_query(
16972 proc: Option<Arc<DaggerSessionProc>>,
16973 selection: Selection,
16974 graphql_client: DynGraphQLClient,
16975 ) -> Self {
16976 Self {
16977 proc,
16978 selection,
16979 graphql_client,
16980 }
16981 }
16982}
16983impl ScalarTypeDef {
16984 pub async fn id(&self) -> Result<Id, DaggerError> {
16986 let query = self.selection.select("id");
16987 query.execute(self.graphql_client.clone()).await
16988 }
16989 pub async fn name(&self) -> Result<String, DaggerError> {
16991 let query = self.selection.select("name");
16992 query.execute(self.graphql_client.clone()).await
16993 }
16994 pub async fn description(&self) -> Result<String, DaggerError> {
16996 let query = self.selection.select("description");
16997 query.execute(self.graphql_client.clone()).await
16998 }
16999 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
17001 let query = self.selection.select("sourceModuleName");
17002 query.execute(self.graphql_client.clone()).await
17003 }
17004}
17005impl Node for ScalarTypeDef {
17006 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17007 let query = self.selection.select("id");
17008 let graphql_client = self.graphql_client.clone();
17009 async move { query.execute(graphql_client).await }
17010 }
17011}
17012#[derive(Clone)]
17013pub struct Schema {
17014 pub proc: Option<Arc<DaggerSessionProc>>,
17015 pub selection: Selection,
17016 pub graphql_client: DynGraphQLClient,
17017}
17018impl IntoID<Id> for Schema {
17019 fn into_id(
17020 self,
17021 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17022 Box::pin(async move { self.id().await })
17023 }
17024}
17025impl Loadable for Schema {
17026 fn graphql_type() -> &'static str {
17027 "Schema"
17028 }
17029 fn from_query(
17030 proc: Option<Arc<DaggerSessionProc>>,
17031 selection: Selection,
17032 graphql_client: DynGraphQLClient,
17033 ) -> Self {
17034 Self {
17035 proc,
17036 selection,
17037 graphql_client,
17038 }
17039 }
17040}
17041impl Schema {
17042 pub async fn id(&self) -> Result<Id, DaggerError> {
17044 let query = self.selection.select("id");
17045 query.execute(self.graphql_client.clone()).await
17046 }
17047 pub async fn contents(&self) -> Result<Json, DaggerError> {
17049 let query = self.selection.select("contents");
17050 query.execute(self.graphql_client.clone()).await
17051 }
17052 pub fn merge(&self, module_types: Json, module_name: impl Into<String>) -> Schema {
17059 let mut query = self.selection.select("merge");
17060 query = query.arg("moduleTypes", module_types);
17061 query = query.arg("moduleName", module_name.into());
17062 Schema {
17063 proc: self.proc.clone(),
17064 selection: query,
17065 graphql_client: self.graphql_client.clone(),
17066 }
17067 }
17068}
17069impl Node for Schema {
17070 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17071 let query = self.selection.select("id");
17072 let graphql_client = self.graphql_client.clone();
17073 async move { query.execute(graphql_client).await }
17074 }
17075}
17076#[derive(Clone)]
17077pub struct SearchResult {
17078 pub proc: Option<Arc<DaggerSessionProc>>,
17079 pub selection: Selection,
17080 pub graphql_client: DynGraphQLClient,
17081}
17082impl IntoID<Id> for SearchResult {
17083 fn into_id(
17084 self,
17085 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17086 Box::pin(async move { self.id().await })
17087 }
17088}
17089impl Loadable for SearchResult {
17090 fn graphql_type() -> &'static str {
17091 "SearchResult"
17092 }
17093 fn from_query(
17094 proc: Option<Arc<DaggerSessionProc>>,
17095 selection: Selection,
17096 graphql_client: DynGraphQLClient,
17097 ) -> Self {
17098 Self {
17099 proc,
17100 selection,
17101 graphql_client,
17102 }
17103 }
17104}
17105impl SearchResult {
17106 pub async fn id(&self) -> Result<Id, DaggerError> {
17108 let query = self.selection.select("id");
17109 query.execute(self.graphql_client.clone()).await
17110 }
17111 pub async fn file_path(&self) -> Result<String, DaggerError> {
17113 let query = self.selection.select("filePath");
17114 query.execute(self.graphql_client.clone()).await
17115 }
17116 pub async fn line_number(&self) -> Result<isize, DaggerError> {
17118 let query = self.selection.select("lineNumber");
17119 query.execute(self.graphql_client.clone()).await
17120 }
17121 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
17123 let query = self.selection.select("absoluteOffset");
17124 query.execute(self.graphql_client.clone()).await
17125 }
17126 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
17128 let query = self.selection.select("matchedLines");
17129 query.execute(self.graphql_client.clone()).await
17130 }
17131 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
17133 let query = self.selection.select("submatches");
17134 let query = query.select("id");
17135 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17136 Ok(ids
17137 .into_iter()
17138 .map(|id| SearchSubmatch {
17139 proc: self.proc.clone(),
17140 selection: crate::querybuilder::query()
17141 .select("node")
17142 .arg("id", &id.0)
17143 .inline_fragment("SearchSubmatch"),
17144 graphql_client: self.graphql_client.clone(),
17145 })
17146 .collect())
17147 }
17148}
17149impl Node for SearchResult {
17150 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17151 let query = self.selection.select("id");
17152 let graphql_client = self.graphql_client.clone();
17153 async move { query.execute(graphql_client).await }
17154 }
17155}
17156#[derive(Clone)]
17157pub struct SearchSubmatch {
17158 pub proc: Option<Arc<DaggerSessionProc>>,
17159 pub selection: Selection,
17160 pub graphql_client: DynGraphQLClient,
17161}
17162impl IntoID<Id> for SearchSubmatch {
17163 fn into_id(
17164 self,
17165 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17166 Box::pin(async move { self.id().await })
17167 }
17168}
17169impl Loadable for SearchSubmatch {
17170 fn graphql_type() -> &'static str {
17171 "SearchSubmatch"
17172 }
17173 fn from_query(
17174 proc: Option<Arc<DaggerSessionProc>>,
17175 selection: Selection,
17176 graphql_client: DynGraphQLClient,
17177 ) -> Self {
17178 Self {
17179 proc,
17180 selection,
17181 graphql_client,
17182 }
17183 }
17184}
17185impl SearchSubmatch {
17186 pub async fn id(&self) -> Result<Id, DaggerError> {
17188 let query = self.selection.select("id");
17189 query.execute(self.graphql_client.clone()).await
17190 }
17191 pub async fn text(&self) -> Result<String, DaggerError> {
17193 let query = self.selection.select("text");
17194 query.execute(self.graphql_client.clone()).await
17195 }
17196 pub async fn start(&self) -> Result<isize, DaggerError> {
17198 let query = self.selection.select("start");
17199 query.execute(self.graphql_client.clone()).await
17200 }
17201 pub async fn end(&self) -> Result<isize, DaggerError> {
17203 let query = self.selection.select("end");
17204 query.execute(self.graphql_client.clone()).await
17205 }
17206}
17207impl Node for SearchSubmatch {
17208 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17209 let query = self.selection.select("id");
17210 let graphql_client = self.graphql_client.clone();
17211 async move { query.execute(graphql_client).await }
17212 }
17213}
17214#[derive(Clone)]
17215pub struct Secret {
17216 pub proc: Option<Arc<DaggerSessionProc>>,
17217 pub selection: Selection,
17218 pub graphql_client: DynGraphQLClient,
17219}
17220impl IntoID<Id> for Secret {
17221 fn into_id(
17222 self,
17223 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17224 Box::pin(async move { self.id().await })
17225 }
17226}
17227impl Loadable for Secret {
17228 fn graphql_type() -> &'static str {
17229 "Secret"
17230 }
17231 fn from_query(
17232 proc: Option<Arc<DaggerSessionProc>>,
17233 selection: Selection,
17234 graphql_client: DynGraphQLClient,
17235 ) -> Self {
17236 Self {
17237 proc,
17238 selection,
17239 graphql_client,
17240 }
17241 }
17242}
17243impl Secret {
17244 pub async fn id(&self) -> Result<Id, DaggerError> {
17246 let query = self.selection.select("id");
17247 query.execute(self.graphql_client.clone()).await
17248 }
17249 pub async fn name(&self) -> Result<String, DaggerError> {
17251 let query = self.selection.select("name");
17252 query.execute(self.graphql_client.clone()).await
17253 }
17254 pub async fn uri(&self) -> Result<String, DaggerError> {
17256 let query = self.selection.select("uri");
17257 query.execute(self.graphql_client.clone()).await
17258 }
17259 pub async fn plaintext(&self) -> Result<String, DaggerError> {
17261 let query = self.selection.select("plaintext");
17262 query.execute(self.graphql_client.clone()).await
17263 }
17264}
17265impl Node for Secret {
17266 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17267 let query = self.selection.select("id");
17268 let graphql_client = self.graphql_client.clone();
17269 async move { query.execute(graphql_client).await }
17270 }
17271}
17272#[derive(Clone)]
17273pub struct Service {
17274 pub proc: Option<Arc<DaggerSessionProc>>,
17275 pub selection: Selection,
17276 pub graphql_client: DynGraphQLClient,
17277}
17278#[derive(Builder, Debug, PartialEq)]
17279pub struct ServicePortsOpts {
17280 #[builder(setter(into, strip_option), default)]
17282 pub declared: Option<bool>,
17283}
17284#[derive(Builder, Debug, PartialEq)]
17285pub struct ServiceEndpointOpts<'a> {
17286 #[builder(setter(into, strip_option), default)]
17288 pub port: Option<isize>,
17289 #[builder(setter(into, strip_option), default)]
17291 pub scheme: Option<&'a str>,
17292}
17293#[derive(Builder, Debug, PartialEq)]
17294pub struct ServiceUpOpts {
17295 #[builder(setter(into, strip_option), default)]
17298 pub ports: Option<Vec<PortForward>>,
17299 #[builder(setter(into, strip_option), default)]
17301 pub random: Option<bool>,
17302}
17303#[derive(Builder, Debug, PartialEq)]
17304pub struct ServiceStopOpts {
17305 #[builder(setter(into, strip_option), default)]
17307 pub kill: Option<bool>,
17308}
17309#[derive(Builder, Debug, PartialEq)]
17310pub struct ServiceTerminalOpts<'a> {
17311 #[builder(setter(into, strip_option), default)]
17312 pub cmd: Option<Vec<&'a str>>,
17313}
17314impl IntoID<Id> for Service {
17315 fn into_id(
17316 self,
17317 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17318 Box::pin(async move { self.id().await })
17319 }
17320}
17321impl Loadable for Service {
17322 fn graphql_type() -> &'static str {
17323 "Service"
17324 }
17325 fn from_query(
17326 proc: Option<Arc<DaggerSessionProc>>,
17327 selection: Selection,
17328 graphql_client: DynGraphQLClient,
17329 ) -> Self {
17330 Self {
17331 proc,
17332 selection,
17333 graphql_client,
17334 }
17335 }
17336}
17337impl Service {
17338 pub async fn id(&self) -> Result<Id, DaggerError> {
17340 let query = self.selection.select("id");
17341 query.execute(self.graphql_client.clone()).await
17342 }
17343 pub async fn sync(&self) -> Result<Service, DaggerError> {
17345 let query = self.selection.select("sync");
17346 let id: Id = query.execute(self.graphql_client.clone()).await?;
17347 Ok(Service {
17348 proc: self.proc.clone(),
17349 selection: query
17350 .root()
17351 .select("node")
17352 .arg("id", &id.0)
17353 .inline_fragment("Service"),
17354 graphql_client: self.graphql_client.clone(),
17355 })
17356 }
17357 pub async fn hostname(&self) -> Result<String, DaggerError> {
17359 let query = self.selection.select("hostname");
17360 query.execute(self.graphql_client.clone()).await
17361 }
17362 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
17368 let mut query = self.selection.select("withHostname");
17369 query = query.arg("hostname", hostname.into());
17370 Service {
17371 proc: self.proc.clone(),
17372 selection: query,
17373 graphql_client: self.graphql_client.clone(),
17374 }
17375 }
17376 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
17382 let query = self.selection.select("ports");
17383 let query = query.select("id");
17384 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17385 Ok(ids
17386 .into_iter()
17387 .map(|id| Port {
17388 proc: self.proc.clone(),
17389 selection: crate::querybuilder::query()
17390 .select("node")
17391 .arg("id", &id.0)
17392 .inline_fragment("Port"),
17393 graphql_client: self.graphql_client.clone(),
17394 })
17395 .collect())
17396 }
17397 pub async fn ports_opts(&self, opts: ServicePortsOpts) -> Result<Vec<Port>, DaggerError> {
17403 let mut query = self.selection.select("ports");
17404 if let Some(declared) = opts.declared {
17405 query = query.arg("declared", declared);
17406 }
17407 let query = query.select("id");
17408 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
17409 Ok(ids
17410 .into_iter()
17411 .map(|id| Port {
17412 proc: self.proc.clone(),
17413 selection: crate::querybuilder::query()
17414 .select("node")
17415 .arg("id", &id.0)
17416 .inline_fragment("Port"),
17417 graphql_client: self.graphql_client.clone(),
17418 })
17419 .collect())
17420 }
17421 pub async fn endpoint(&self) -> Result<String, DaggerError> {
17429 let query = self.selection.select("endpoint");
17430 query.execute(self.graphql_client.clone()).await
17431 }
17432 pub async fn endpoint_opts<'a>(
17440 &self,
17441 opts: ServiceEndpointOpts<'a>,
17442 ) -> Result<String, DaggerError> {
17443 let mut query = self.selection.select("endpoint");
17444 if let Some(port) = opts.port {
17445 query = query.arg("port", port);
17446 }
17447 if let Some(scheme) = opts.scheme {
17448 query = query.arg("scheme", scheme);
17449 }
17450 query.execute(self.graphql_client.clone()).await
17451 }
17452 pub async fn start(&self) -> Result<Service, DaggerError> {
17455 let query = self.selection.select("start");
17456 let id: Id = query.execute(self.graphql_client.clone()).await?;
17457 Ok(Service {
17458 proc: self.proc.clone(),
17459 selection: query
17460 .root()
17461 .select("node")
17462 .arg("id", &id.0)
17463 .inline_fragment("Service"),
17464 graphql_client: self.graphql_client.clone(),
17465 })
17466 }
17467 pub async fn up(&self) -> Result<Void, DaggerError> {
17473 let query = self.selection.select("up");
17474 query.execute(self.graphql_client.clone()).await
17475 }
17476 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
17482 let mut query = self.selection.select("up");
17483 if let Some(ports) = opts.ports {
17484 query = query.arg("ports", ports);
17485 }
17486 if let Some(random) = opts.random {
17487 query = query.arg("random", random);
17488 }
17489 query.execute(self.graphql_client.clone()).await
17490 }
17491 pub async fn stop(&self) -> Result<Service, DaggerError> {
17497 let query = self.selection.select("stop");
17498 let id: Id = query.execute(self.graphql_client.clone()).await?;
17499 Ok(Service {
17500 proc: self.proc.clone(),
17501 selection: query
17502 .root()
17503 .select("node")
17504 .arg("id", &id.0)
17505 .inline_fragment("Service"),
17506 graphql_client: self.graphql_client.clone(),
17507 })
17508 }
17509 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
17515 let mut query = self.selection.select("stop");
17516 if let Some(kill) = opts.kill {
17517 query = query.arg("kill", kill);
17518 }
17519 let id: Id = query.execute(self.graphql_client.clone()).await?;
17520 Ok(Service {
17521 proc: self.proc.clone(),
17522 selection: query
17523 .root()
17524 .select("node")
17525 .arg("id", &id.0)
17526 .inline_fragment("Service"),
17527 graphql_client: self.graphql_client.clone(),
17528 })
17529 }
17530 pub fn terminal(&self) -> Service {
17535 let query = self.selection.select("terminal");
17536 Service {
17537 proc: self.proc.clone(),
17538 selection: query,
17539 graphql_client: self.graphql_client.clone(),
17540 }
17541 }
17542 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
17547 let mut query = self.selection.select("terminal");
17548 if let Some(cmd) = opts.cmd {
17549 query = query.arg("cmd", cmd);
17550 }
17551 Service {
17552 proc: self.proc.clone(),
17553 selection: query,
17554 graphql_client: self.graphql_client.clone(),
17555 }
17556 }
17557}
17558impl Node for Service {
17559 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17560 let query = self.selection.select("id");
17561 let graphql_client = self.graphql_client.clone();
17562 async move { query.execute(graphql_client).await }
17563 }
17564}
17565impl Syncer for Service {
17566 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17567 let query = self.selection.select("id");
17568 let graphql_client = self.graphql_client.clone();
17569 async move { query.execute(graphql_client).await }
17570 }
17571 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17572 let query = self.selection.select("sync");
17573 let proc = self.proc.clone();
17574 let graphql_client = self.graphql_client.clone();
17575 async move {
17576 let id: Id = query.execute(graphql_client.clone()).await?;
17577 Ok(Self {
17578 proc,
17579 selection: query
17580 .root()
17581 .select("node")
17582 .arg("id", &id.0)
17583 .inline_fragment("Service"),
17584 graphql_client,
17585 })
17586 }
17587 }
17588}
17589#[derive(Clone)]
17590pub struct Socket {
17591 pub proc: Option<Arc<DaggerSessionProc>>,
17592 pub selection: Selection,
17593 pub graphql_client: DynGraphQLClient,
17594}
17595impl IntoID<Id> for Socket {
17596 fn into_id(
17597 self,
17598 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17599 Box::pin(async move { self.id().await })
17600 }
17601}
17602impl Loadable for Socket {
17603 fn graphql_type() -> &'static str {
17604 "Socket"
17605 }
17606 fn from_query(
17607 proc: Option<Arc<DaggerSessionProc>>,
17608 selection: Selection,
17609 graphql_client: DynGraphQLClient,
17610 ) -> Self {
17611 Self {
17612 proc,
17613 selection,
17614 graphql_client,
17615 }
17616 }
17617}
17618impl Socket {
17619 pub async fn id(&self) -> Result<Id, DaggerError> {
17621 let query = self.selection.select("id");
17622 query.execute(self.graphql_client.clone()).await
17623 }
17624}
17625impl Node for Socket {
17626 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17627 let query = self.selection.select("id");
17628 let graphql_client = self.graphql_client.clone();
17629 async move { query.execute(graphql_client).await }
17630 }
17631}
17632#[derive(Clone)]
17633pub struct SourceMap {
17634 pub proc: Option<Arc<DaggerSessionProc>>,
17635 pub selection: Selection,
17636 pub graphql_client: DynGraphQLClient,
17637}
17638impl IntoID<Id> for SourceMap {
17639 fn into_id(
17640 self,
17641 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17642 Box::pin(async move { self.id().await })
17643 }
17644}
17645impl Loadable for SourceMap {
17646 fn graphql_type() -> &'static str {
17647 "SourceMap"
17648 }
17649 fn from_query(
17650 proc: Option<Arc<DaggerSessionProc>>,
17651 selection: Selection,
17652 graphql_client: DynGraphQLClient,
17653 ) -> Self {
17654 Self {
17655 proc,
17656 selection,
17657 graphql_client,
17658 }
17659 }
17660}
17661impl SourceMap {
17662 pub async fn id(&self) -> Result<Id, DaggerError> {
17664 let query = self.selection.select("id");
17665 query.execute(self.graphql_client.clone()).await
17666 }
17667 pub async fn module(&self) -> Result<String, DaggerError> {
17669 let query = self.selection.select("module");
17670 query.execute(self.graphql_client.clone()).await
17671 }
17672 pub async fn filename(&self) -> Result<String, DaggerError> {
17674 let query = self.selection.select("filename");
17675 query.execute(self.graphql_client.clone()).await
17676 }
17677 pub async fn line(&self) -> Result<isize, DaggerError> {
17679 let query = self.selection.select("line");
17680 query.execute(self.graphql_client.clone()).await
17681 }
17682 pub async fn column(&self) -> Result<isize, DaggerError> {
17684 let query = self.selection.select("column");
17685 query.execute(self.graphql_client.clone()).await
17686 }
17687 pub async fn url(&self) -> Result<String, DaggerError> {
17689 let query = self.selection.select("url");
17690 query.execute(self.graphql_client.clone()).await
17691 }
17692}
17693impl Node for SourceMap {
17694 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17695 let query = self.selection.select("id");
17696 let graphql_client = self.graphql_client.clone();
17697 async move { query.execute(graphql_client).await }
17698 }
17699}
17700#[derive(Clone)]
17701pub struct Stat {
17702 pub proc: Option<Arc<DaggerSessionProc>>,
17703 pub selection: Selection,
17704 pub graphql_client: DynGraphQLClient,
17705}
17706impl IntoID<Id> for Stat {
17707 fn into_id(
17708 self,
17709 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17710 Box::pin(async move { self.id().await })
17711 }
17712}
17713impl Loadable for Stat {
17714 fn graphql_type() -> &'static str {
17715 "Stat"
17716 }
17717 fn from_query(
17718 proc: Option<Arc<DaggerSessionProc>>,
17719 selection: Selection,
17720 graphql_client: DynGraphQLClient,
17721 ) -> Self {
17722 Self {
17723 proc,
17724 selection,
17725 graphql_client,
17726 }
17727 }
17728}
17729impl Stat {
17730 pub async fn id(&self) -> Result<Id, DaggerError> {
17732 let query = self.selection.select("id");
17733 query.execute(self.graphql_client.clone()).await
17734 }
17735 pub async fn size(&self) -> Result<isize, DaggerError> {
17737 let query = self.selection.select("size");
17738 query.execute(self.graphql_client.clone()).await
17739 }
17740 pub async fn name(&self) -> Result<String, DaggerError> {
17742 let query = self.selection.select("name");
17743 query.execute(self.graphql_client.clone()).await
17744 }
17745 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
17747 let query = self.selection.select("fileType");
17748 query.execute(self.graphql_client.clone()).await
17749 }
17750 pub async fn permissions(&self) -> Result<isize, DaggerError> {
17752 let query = self.selection.select("permissions");
17753 query.execute(self.graphql_client.clone()).await
17754 }
17755}
17756impl Node for Stat {
17757 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17758 let query = self.selection.select("id");
17759 let graphql_client = self.graphql_client.clone();
17760 async move { query.execute(graphql_client).await }
17761 }
17762}
17763#[derive(Clone)]
17764pub struct Terminal {
17765 pub proc: Option<Arc<DaggerSessionProc>>,
17766 pub selection: Selection,
17767 pub graphql_client: DynGraphQLClient,
17768}
17769impl IntoID<Id> for Terminal {
17770 fn into_id(
17771 self,
17772 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17773 Box::pin(async move { self.id().await })
17774 }
17775}
17776impl Loadable for Terminal {
17777 fn graphql_type() -> &'static str {
17778 "Terminal"
17779 }
17780 fn from_query(
17781 proc: Option<Arc<DaggerSessionProc>>,
17782 selection: Selection,
17783 graphql_client: DynGraphQLClient,
17784 ) -> Self {
17785 Self {
17786 proc,
17787 selection,
17788 graphql_client,
17789 }
17790 }
17791}
17792impl Terminal {
17793 pub async fn id(&self) -> Result<Id, DaggerError> {
17795 let query = self.selection.select("id");
17796 query.execute(self.graphql_client.clone()).await
17797 }
17798 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
17801 let query = self.selection.select("sync");
17802 let id: Id = query.execute(self.graphql_client.clone()).await?;
17803 Ok(Terminal {
17804 proc: self.proc.clone(),
17805 selection: query
17806 .root()
17807 .select("node")
17808 .arg("id", &id.0)
17809 .inline_fragment("Terminal"),
17810 graphql_client: self.graphql_client.clone(),
17811 })
17812 }
17813}
17814impl Node for Terminal {
17815 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17816 let query = self.selection.select("id");
17817 let graphql_client = self.graphql_client.clone();
17818 async move { query.execute(graphql_client).await }
17819 }
17820}
17821impl Syncer for Terminal {
17822 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
17823 let query = self.selection.select("id");
17824 let graphql_client = self.graphql_client.clone();
17825 async move { query.execute(graphql_client).await }
17826 }
17827 fn sync(&self) -> impl core::future::Future<Output = Result<Self, DaggerError>> + Send {
17828 let query = self.selection.select("sync");
17829 let proc = self.proc.clone();
17830 let graphql_client = self.graphql_client.clone();
17831 async move {
17832 let id: Id = query.execute(graphql_client.clone()).await?;
17833 Ok(Self {
17834 proc,
17835 selection: query
17836 .root()
17837 .select("node")
17838 .arg("id", &id.0)
17839 .inline_fragment("Terminal"),
17840 graphql_client,
17841 })
17842 }
17843 }
17844}
17845#[derive(Clone)]
17846pub struct TypeDef {
17847 pub proc: Option<Arc<DaggerSessionProc>>,
17848 pub selection: Selection,
17849 pub graphql_client: DynGraphQLClient,
17850}
17851#[derive(Builder, Debug, PartialEq)]
17852pub struct TypeDefWithScalarOpts<'a> {
17853 #[builder(setter(into, strip_option), default)]
17854 pub description: Option<&'a str>,
17855}
17856#[derive(Builder, Debug, PartialEq)]
17857pub struct TypeDefWithObjectOpts<'a> {
17858 #[builder(setter(into, strip_option), default)]
17859 pub deprecated: Option<&'a str>,
17860 #[builder(setter(into, strip_option), default)]
17861 pub description: Option<&'a str>,
17862 #[builder(setter(into, strip_option), default)]
17863 pub source_map: Option<Id>,
17864}
17865#[derive(Builder, Debug, PartialEq)]
17866pub struct TypeDefWithInterfaceOpts<'a> {
17867 #[builder(setter(into, strip_option), default)]
17868 pub description: Option<&'a str>,
17869 #[builder(setter(into, strip_option), default)]
17870 pub source_map: Option<Id>,
17871}
17872#[derive(Builder, Debug, PartialEq)]
17873pub struct TypeDefWithFieldOpts<'a> {
17874 #[builder(setter(into, strip_option), default)]
17876 pub deprecated: Option<&'a str>,
17877 #[builder(setter(into, strip_option), default)]
17879 pub description: Option<&'a str>,
17880 #[builder(setter(into, strip_option), default)]
17882 pub source_map: Option<Id>,
17883}
17884#[derive(Builder, Debug, PartialEq)]
17885pub struct TypeDefWithEnumOpts<'a> {
17886 #[builder(setter(into, strip_option), default)]
17888 pub description: Option<&'a str>,
17889 #[builder(setter(into, strip_option), default)]
17891 pub source_map: Option<Id>,
17892}
17893#[derive(Builder, Debug, PartialEq)]
17894pub struct TypeDefWithEnumValueOpts<'a> {
17895 #[builder(setter(into, strip_option), default)]
17897 pub deprecated: Option<&'a str>,
17898 #[builder(setter(into, strip_option), default)]
17900 pub description: Option<&'a str>,
17901 #[builder(setter(into, strip_option), default)]
17903 pub source_map: Option<Id>,
17904}
17905#[derive(Builder, Debug, PartialEq)]
17906pub struct TypeDefWithEnumMemberOpts<'a> {
17907 #[builder(setter(into, strip_option), default)]
17909 pub deprecated: Option<&'a str>,
17910 #[builder(setter(into, strip_option), default)]
17912 pub description: Option<&'a str>,
17913 #[builder(setter(into, strip_option), default)]
17915 pub source_map: Option<Id>,
17916 #[builder(setter(into, strip_option), default)]
17918 pub value: Option<&'a str>,
17919}
17920impl IntoID<Id> for TypeDef {
17921 fn into_id(
17922 self,
17923 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
17924 Box::pin(async move { self.id().await })
17925 }
17926}
17927impl Loadable for TypeDef {
17928 fn graphql_type() -> &'static str {
17929 "TypeDef"
17930 }
17931 fn from_query(
17932 proc: Option<Arc<DaggerSessionProc>>,
17933 selection: Selection,
17934 graphql_client: DynGraphQLClient,
17935 ) -> Self {
17936 Self {
17937 proc,
17938 selection,
17939 graphql_client,
17940 }
17941 }
17942}
17943impl TypeDef {
17944 pub async fn id(&self) -> Result<Id, DaggerError> {
17946 let query = self.selection.select("id");
17947 query.execute(self.graphql_client.clone()).await
17948 }
17949 pub fn with_collection(&self) -> TypeDef {
17951 let query = self.selection.select("withCollection");
17952 TypeDef {
17953 proc: self.proc.clone(),
17954 selection: query,
17955 graphql_client: self.graphql_client.clone(),
17956 }
17957 }
17958 pub fn with_collection_keys(&self, name: impl Into<String>) -> TypeDef {
17960 let mut query = self.selection.select("withCollectionKeys");
17961 query = query.arg("name", name.into());
17962 TypeDef {
17963 proc: self.proc.clone(),
17964 selection: query,
17965 graphql_client: self.graphql_client.clone(),
17966 }
17967 }
17968 pub fn with_collection_get(&self, name: impl Into<String>) -> TypeDef {
17970 let mut query = self.selection.select("withCollectionGet");
17971 query = query.arg("name", name.into());
17972 TypeDef {
17973 proc: self.proc.clone(),
17974 selection: query,
17975 graphql_client: self.graphql_client.clone(),
17976 }
17977 }
17978 pub fn with_collection_delta(&self, name: impl Into<String>) -> TypeDef {
17980 let mut query = self.selection.select("withCollectionDelta");
17981 query = query.arg("name", name.into());
17982 TypeDef {
17983 proc: self.proc.clone(),
17984 selection: query,
17985 graphql_client: self.graphql_client.clone(),
17986 }
17987 }
17988 pub async fn as_collection(&self) -> Result<Option<CollectionTypeDef>, DaggerError> {
17990 let query = self.selection.select("asCollection");
17991 let query = query.select("id");
17992 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
17993 Ok(id.map(|id| CollectionTypeDef {
17994 proc: self.proc.clone(),
17995 selection: query
17996 .root()
17997 .select("node")
17998 .arg("id", &id.0)
17999 .inline_fragment("CollectionTypeDef"),
18000 graphql_client: self.graphql_client.clone(),
18001 }))
18002 }
18003 pub async fn name(&self) -> Result<String, DaggerError> {
18005 let query = self.selection.select("name");
18006 query.execute(self.graphql_client.clone()).await
18007 }
18008 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
18010 let query = self.selection.select("kind");
18011 query.execute(self.graphql_client.clone()).await
18012 }
18013 pub async fn optional(&self) -> Result<bool, DaggerError> {
18015 let query = self.selection.select("optional");
18016 query.execute(self.graphql_client.clone()).await
18017 }
18018 pub fn with_optional(&self, optional: bool) -> TypeDef {
18020 let mut query = self.selection.select("withOptional");
18021 query = query.arg("optional", optional);
18022 TypeDef {
18023 proc: self.proc.clone(),
18024 selection: query,
18025 graphql_client: self.graphql_client.clone(),
18026 }
18027 }
18028 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
18030 let mut query = self.selection.select("withKind");
18031 query = query.arg("kind", kind);
18032 TypeDef {
18033 proc: self.proc.clone(),
18034 selection: query,
18035 graphql_client: self.graphql_client.clone(),
18036 }
18037 }
18038 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
18044 let mut query = self.selection.select("withScalar");
18045 query = query.arg("name", name.into());
18046 TypeDef {
18047 proc: self.proc.clone(),
18048 selection: query,
18049 graphql_client: self.graphql_client.clone(),
18050 }
18051 }
18052 pub fn with_scalar_opts<'a>(
18058 &self,
18059 name: impl Into<String>,
18060 opts: TypeDefWithScalarOpts<'a>,
18061 ) -> TypeDef {
18062 let mut query = self.selection.select("withScalar");
18063 query = query.arg("name", name.into());
18064 if let Some(description) = opts.description {
18065 query = query.arg("description", description);
18066 }
18067 TypeDef {
18068 proc: self.proc.clone(),
18069 selection: query,
18070 graphql_client: self.graphql_client.clone(),
18071 }
18072 }
18073 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
18075 let mut query = self.selection.select("withListOf");
18076 query = query.arg_lazy(
18077 "elementType",
18078 Box::new(move || {
18079 let element_type = element_type.clone();
18080 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
18081 }),
18082 );
18083 TypeDef {
18084 proc: self.proc.clone(),
18085 selection: query,
18086 graphql_client: self.graphql_client.clone(),
18087 }
18088 }
18089 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
18096 let mut query = self.selection.select("withObject");
18097 query = query.arg("name", name.into());
18098 TypeDef {
18099 proc: self.proc.clone(),
18100 selection: query,
18101 graphql_client: self.graphql_client.clone(),
18102 }
18103 }
18104 pub fn with_object_opts<'a>(
18111 &self,
18112 name: impl Into<String>,
18113 opts: TypeDefWithObjectOpts<'a>,
18114 ) -> TypeDef {
18115 let mut query = self.selection.select("withObject");
18116 query = query.arg("name", name.into());
18117 if let Some(description) = opts.description {
18118 query = query.arg("description", description);
18119 }
18120 if let Some(source_map) = opts.source_map {
18121 query = query.arg("sourceMap", source_map);
18122 }
18123 if let Some(deprecated) = opts.deprecated {
18124 query = query.arg("deprecated", deprecated);
18125 }
18126 TypeDef {
18127 proc: self.proc.clone(),
18128 selection: query,
18129 graphql_client: self.graphql_client.clone(),
18130 }
18131 }
18132 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
18138 let mut query = self.selection.select("withInterface");
18139 query = query.arg("name", name.into());
18140 TypeDef {
18141 proc: self.proc.clone(),
18142 selection: query,
18143 graphql_client: self.graphql_client.clone(),
18144 }
18145 }
18146 pub fn with_interface_opts<'a>(
18152 &self,
18153 name: impl Into<String>,
18154 opts: TypeDefWithInterfaceOpts<'a>,
18155 ) -> TypeDef {
18156 let mut query = self.selection.select("withInterface");
18157 query = query.arg("name", name.into());
18158 if let Some(description) = opts.description {
18159 query = query.arg("description", description);
18160 }
18161 if let Some(source_map) = opts.source_map {
18162 query = query.arg("sourceMap", source_map);
18163 }
18164 TypeDef {
18165 proc: self.proc.clone(),
18166 selection: query,
18167 graphql_client: self.graphql_client.clone(),
18168 }
18169 }
18170 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
18178 let mut query = self.selection.select("withField");
18179 query = query.arg("name", name.into());
18180 query = query.arg_lazy(
18181 "typeDef",
18182 Box::new(move || {
18183 let type_def = type_def.clone();
18184 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
18185 }),
18186 );
18187 TypeDef {
18188 proc: self.proc.clone(),
18189 selection: query,
18190 graphql_client: self.graphql_client.clone(),
18191 }
18192 }
18193 pub fn with_field_opts<'a>(
18201 &self,
18202 name: impl Into<String>,
18203 type_def: impl IntoID<Id>,
18204 opts: TypeDefWithFieldOpts<'a>,
18205 ) -> TypeDef {
18206 let mut query = self.selection.select("withField");
18207 query = query.arg("name", name.into());
18208 query = query.arg_lazy(
18209 "typeDef",
18210 Box::new(move || {
18211 let type_def = type_def.clone();
18212 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
18213 }),
18214 );
18215 if let Some(description) = opts.description {
18216 query = query.arg("description", description);
18217 }
18218 if let Some(source_map) = opts.source_map {
18219 query = query.arg("sourceMap", source_map);
18220 }
18221 if let Some(deprecated) = opts.deprecated {
18222 query = query.arg("deprecated", deprecated);
18223 }
18224 TypeDef {
18225 proc: self.proc.clone(),
18226 selection: query,
18227 graphql_client: self.graphql_client.clone(),
18228 }
18229 }
18230 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
18232 let mut query = self.selection.select("withFunction");
18233 query = query.arg_lazy(
18234 "function",
18235 Box::new(move || {
18236 let function = function.clone();
18237 Box::pin(async move { function.into_id().await.unwrap().quote() })
18238 }),
18239 );
18240 TypeDef {
18241 proc: self.proc.clone(),
18242 selection: query,
18243 graphql_client: self.graphql_client.clone(),
18244 }
18245 }
18246 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
18248 let mut query = self.selection.select("withConstructor");
18249 query = query.arg_lazy(
18250 "function",
18251 Box::new(move || {
18252 let function = function.clone();
18253 Box::pin(async move { function.into_id().await.unwrap().quote() })
18254 }),
18255 );
18256 TypeDef {
18257 proc: self.proc.clone(),
18258 selection: query,
18259 graphql_client: self.graphql_client.clone(),
18260 }
18261 }
18262 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
18270 let mut query = self.selection.select("withEnum");
18271 query = query.arg("name", name.into());
18272 TypeDef {
18273 proc: self.proc.clone(),
18274 selection: query,
18275 graphql_client: self.graphql_client.clone(),
18276 }
18277 }
18278 pub fn with_enum_opts<'a>(
18286 &self,
18287 name: impl Into<String>,
18288 opts: TypeDefWithEnumOpts<'a>,
18289 ) -> TypeDef {
18290 let mut query = self.selection.select("withEnum");
18291 query = query.arg("name", name.into());
18292 if let Some(description) = opts.description {
18293 query = query.arg("description", description);
18294 }
18295 if let Some(source_map) = opts.source_map {
18296 query = query.arg("sourceMap", source_map);
18297 }
18298 TypeDef {
18299 proc: self.proc.clone(),
18300 selection: query,
18301 graphql_client: self.graphql_client.clone(),
18302 }
18303 }
18304 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
18311 let mut query = self.selection.select("withEnumValue");
18312 query = query.arg("value", value.into());
18313 TypeDef {
18314 proc: self.proc.clone(),
18315 selection: query,
18316 graphql_client: self.graphql_client.clone(),
18317 }
18318 }
18319 pub fn with_enum_value_opts<'a>(
18326 &self,
18327 value: impl Into<String>,
18328 opts: TypeDefWithEnumValueOpts<'a>,
18329 ) -> TypeDef {
18330 let mut query = self.selection.select("withEnumValue");
18331 query = query.arg("value", value.into());
18332 if let Some(description) = opts.description {
18333 query = query.arg("description", description);
18334 }
18335 if let Some(source_map) = opts.source_map {
18336 query = query.arg("sourceMap", source_map);
18337 }
18338 if let Some(deprecated) = opts.deprecated {
18339 query = query.arg("deprecated", deprecated);
18340 }
18341 TypeDef {
18342 proc: self.proc.clone(),
18343 selection: query,
18344 graphql_client: self.graphql_client.clone(),
18345 }
18346 }
18347 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
18354 let mut query = self.selection.select("withEnumMember");
18355 query = query.arg("name", name.into());
18356 TypeDef {
18357 proc: self.proc.clone(),
18358 selection: query,
18359 graphql_client: self.graphql_client.clone(),
18360 }
18361 }
18362 pub fn with_enum_member_opts<'a>(
18369 &self,
18370 name: impl Into<String>,
18371 opts: TypeDefWithEnumMemberOpts<'a>,
18372 ) -> TypeDef {
18373 let mut query = self.selection.select("withEnumMember");
18374 query = query.arg("name", name.into());
18375 if let Some(value) = opts.value {
18376 query = query.arg("value", value);
18377 }
18378 if let Some(description) = opts.description {
18379 query = query.arg("description", description);
18380 }
18381 if let Some(source_map) = opts.source_map {
18382 query = query.arg("sourceMap", source_map);
18383 }
18384 if let Some(deprecated) = opts.deprecated {
18385 query = query.arg("deprecated", deprecated);
18386 }
18387 TypeDef {
18388 proc: self.proc.clone(),
18389 selection: query,
18390 graphql_client: self.graphql_client.clone(),
18391 }
18392 }
18393 pub async fn as_list(&self) -> Result<Option<ListTypeDef>, DaggerError> {
18395 let query = self.selection.select("asList");
18396 let query = query.select("id");
18397 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18398 Ok(id.map(|id| ListTypeDef {
18399 proc: self.proc.clone(),
18400 selection: query
18401 .root()
18402 .select("node")
18403 .arg("id", &id.0)
18404 .inline_fragment("ListTypeDef"),
18405 graphql_client: self.graphql_client.clone(),
18406 }))
18407 }
18408 pub async fn as_object(&self) -> Result<Option<ObjectTypeDef>, DaggerError> {
18410 let query = self.selection.select("asObject");
18411 let query = query.select("id");
18412 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18413 Ok(id.map(|id| ObjectTypeDef {
18414 proc: self.proc.clone(),
18415 selection: query
18416 .root()
18417 .select("node")
18418 .arg("id", &id.0)
18419 .inline_fragment("ObjectTypeDef"),
18420 graphql_client: self.graphql_client.clone(),
18421 }))
18422 }
18423 pub async fn as_interface(&self) -> Result<Option<InterfaceTypeDef>, DaggerError> {
18425 let query = self.selection.select("asInterface");
18426 let query = query.select("id");
18427 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18428 Ok(id.map(|id| InterfaceTypeDef {
18429 proc: self.proc.clone(),
18430 selection: query
18431 .root()
18432 .select("node")
18433 .arg("id", &id.0)
18434 .inline_fragment("InterfaceTypeDef"),
18435 graphql_client: self.graphql_client.clone(),
18436 }))
18437 }
18438 pub async fn as_input(&self) -> Result<Option<InputTypeDef>, DaggerError> {
18440 let query = self.selection.select("asInput");
18441 let query = query.select("id");
18442 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18443 Ok(id.map(|id| InputTypeDef {
18444 proc: self.proc.clone(),
18445 selection: query
18446 .root()
18447 .select("node")
18448 .arg("id", &id.0)
18449 .inline_fragment("InputTypeDef"),
18450 graphql_client: self.graphql_client.clone(),
18451 }))
18452 }
18453 pub async fn as_scalar(&self) -> Result<Option<ScalarTypeDef>, DaggerError> {
18455 let query = self.selection.select("asScalar");
18456 let query = query.select("id");
18457 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18458 Ok(id.map(|id| ScalarTypeDef {
18459 proc: self.proc.clone(),
18460 selection: query
18461 .root()
18462 .select("node")
18463 .arg("id", &id.0)
18464 .inline_fragment("ScalarTypeDef"),
18465 graphql_client: self.graphql_client.clone(),
18466 }))
18467 }
18468 pub async fn as_enum(&self) -> Result<Option<EnumTypeDef>, DaggerError> {
18470 let query = self.selection.select("asEnum");
18471 let query = query.select("id");
18472 let id: Option<Id> = query.execute(self.graphql_client.clone()).await?;
18473 Ok(id.map(|id| EnumTypeDef {
18474 proc: self.proc.clone(),
18475 selection: query
18476 .root()
18477 .select("node")
18478 .arg("id", &id.0)
18479 .inline_fragment("EnumTypeDef"),
18480 graphql_client: self.graphql_client.clone(),
18481 }))
18482 }
18483}
18484impl Node for TypeDef {
18485 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18486 let query = self.selection.select("id");
18487 let graphql_client = self.graphql_client.clone();
18488 async move { query.execute(graphql_client).await }
18489 }
18490}
18491#[derive(Clone)]
18492pub struct Volume {
18493 pub proc: Option<Arc<DaggerSessionProc>>,
18494 pub selection: Selection,
18495 pub graphql_client: DynGraphQLClient,
18496}
18497impl IntoID<Id> for Volume {
18498 fn into_id(
18499 self,
18500 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18501 Box::pin(async move { self.id().await })
18502 }
18503}
18504impl Loadable for Volume {
18505 fn graphql_type() -> &'static str {
18506 "Volume"
18507 }
18508 fn from_query(
18509 proc: Option<Arc<DaggerSessionProc>>,
18510 selection: Selection,
18511 graphql_client: DynGraphQLClient,
18512 ) -> Self {
18513 Self {
18514 proc,
18515 selection,
18516 graphql_client,
18517 }
18518 }
18519}
18520impl Volume {
18521 pub async fn id(&self) -> Result<Id, DaggerError> {
18523 let query = self.selection.select("id");
18524 query.execute(self.graphql_client.clone()).await
18525 }
18526}
18527impl Node for Volume {
18528 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
18529 let query = self.selection.select("id");
18530 let graphql_client = self.graphql_client.clone();
18531 async move { query.execute(graphql_client).await }
18532 }
18533}
18534#[derive(Clone)]
18535pub struct Workspace {
18536 pub proc: Option<Arc<DaggerSessionProc>>,
18537 pub selection: Selection,
18538 pub graphql_client: DynGraphQLClient,
18539}
18540#[derive(Builder, Debug, PartialEq)]
18541pub struct WorkspaceMigrateModuleOpts<'a> {
18542 #[builder(setter(into, strip_option), default)]
18544 pub path: Option<&'a str>,
18545}
18546#[derive(Builder, Debug, PartialEq)]
18547pub struct WorkspaceCompareCommitsFromOpts<'a> {
18548 #[builder(setter(into, strip_option), default)]
18550 pub commits: Option<Vec<&'a str>>,
18551 #[builder(setter(into, strip_option), default)]
18553 pub max_commits: Option<isize>,
18554}
18555#[derive(Builder, Debug, PartialEq)]
18556pub struct WorkspaceWithCommitsFromOpts<'a> {
18557 #[builder(setter(into, strip_option), default)]
18559 pub commits: Option<Vec<&'a str>>,
18560 #[builder(setter(into, strip_option), default)]
18562 pub max_commits: Option<isize>,
18563}
18564#[derive(Builder, Debug, PartialEq)]
18565pub struct WorkspaceWithCommitOpts<'a> {
18566 #[builder(setter(into, strip_option), default)]
18568 pub author_email: Option<&'a str>,
18569 #[builder(setter(into, strip_option), default)]
18571 pub author_name: Option<&'a str>,
18572 #[builder(setter(into, strip_option), default)]
18574 pub signoff: Option<bool>,
18575}
18576#[derive(Builder, Debug, PartialEq)]
18577pub struct WorkspaceWithResetOpts {
18578 #[builder(setter(into, strip_option), default)]
18580 pub hard: Option<bool>,
18581}
18582#[derive(Builder, Debug, PartialEq)]
18583pub struct WorkspaceDirectoryOpts<'a> {
18584 #[builder(setter(into, strip_option), default)]
18586 pub exclude: Option<Vec<&'a str>>,
18587 #[builder(setter(into, strip_option), default)]
18589 pub gitignore: Option<bool>,
18590 #[builder(setter(into, strip_option), default)]
18592 pub include: Option<Vec<&'a str>>,
18593}
18594#[derive(Builder, Debug, PartialEq)]
18595pub struct WorkspaceSearchOpts<'a> {
18596 #[builder(setter(into, strip_option), default)]
18598 pub dotall: Option<bool>,
18599 #[builder(setter(into, strip_option), default)]
18601 pub files_only: Option<bool>,
18602 #[builder(setter(into, strip_option), default)]
18604 pub globs: Option<Vec<&'a str>>,
18605 #[builder(setter(into, strip_option), default)]
18607 pub insensitive: Option<bool>,
18608 #[builder(setter(into, strip_option), default)]
18610 pub limit: Option<isize>,
18611 #[builder(setter(into, strip_option), default)]
18613 pub literal: Option<bool>,
18614 #[builder(setter(into, strip_option), default)]
18616 pub multiline: Option<bool>,
18617 #[builder(setter(into, strip_option), default)]
18619 pub paths: Option<Vec<&'a str>>,
18620 #[builder(setter(into, strip_option), default)]
18622 pub skip_hidden: Option<bool>,
18623 #[builder(setter(into, strip_option), default)]
18625 pub skip_ignored: Option<bool>,
18626}
18627#[derive(Builder, Debug, PartialEq)]
18628pub struct WorkspaceFindUpOpts<'a> {
18629 #[builder(setter(into, strip_option), default)]
18631 pub from: Option<&'a str>,
18632}
18633#[derive(Builder, Debug, PartialEq)]
18634pub struct WorkspaceFindRootsOpts<'a> {
18635 #[builder(setter(into, strip_option), default)]
18637 pub exclude: Option<Vec<&'a str>>,
18638 #[builder(setter(into, strip_option), default)]
18640 pub start: Option<&'a str>,
18641}
18642#[derive(Builder, Debug, PartialEq)]
18643pub struct WorkspaceWithNewFileOpts {
18644 #[builder(setter(into, strip_option), default)]
18646 pub permissions: Option<isize>,
18647}
18648#[derive(Builder, Debug, PartialEq)]
18649pub struct WorkspaceWithFileOpts {
18650 #[builder(setter(into, strip_option), default)]
18652 pub permissions: Option<isize>,
18653}
18654#[derive(Builder, Debug, PartialEq)]
18655pub struct WorkspaceWithPatchFileOpts {
18656 #[builder(setter(into, strip_option), default)]
18658 pub on_conflict: Option<PatchConflict>,
18659}
18660#[derive(Builder, Debug, PartialEq)]
18661pub struct WorkspaceWithModuleOpts<'a> {
18662 #[builder(setter(into, strip_option), default)]
18664 pub here: Option<bool>,
18665 #[builder(setter(into, strip_option), default)]
18667 pub name: Option<&'a str>,
18668}
18669#[derive(Builder, Debug, PartialEq)]
18670pub struct WorkspaceWithoutModuleOpts {
18671 #[builder(setter(into, strip_option), default)]
18673 pub here: Option<bool>,
18674}
18675#[derive(Builder, Debug, PartialEq)]
18676pub struct WorkspaceWithSdkOpts<'a> {
18677 #[builder(setter(into, strip_option), default)]
18679 pub as_sdk_name: Option<&'a str>,
18680 #[builder(setter(into, strip_option), default)]
18682 pub here: Option<bool>,
18683 #[builder(setter(into, strip_option), default)]
18685 pub name: Option<&'a str>,
18686}
18687#[derive(Builder, Debug, PartialEq)]
18688pub struct WorkspaceWithoutSdkOpts {
18689 #[builder(setter(into, strip_option), default)]
18691 pub here: Option<bool>,
18692}
18693#[derive(Builder, Debug, PartialEq)]
18694pub struct WorkspaceWithInitModuleOpts<'a> {
18695 #[builder(setter(into, strip_option), default)]
18697 pub entrypoint: Option<bool>,
18698 #[builder(setter(into, strip_option), default)]
18700 pub install: Option<bool>,
18701 #[builder(setter(into, strip_option), default)]
18703 pub main: Option<bool>,
18704 #[builder(setter(into, strip_option), default)]
18706 pub name: Option<&'a str>,
18707 #[builder(setter(into, strip_option), default)]
18709 pub path: Option<&'a str>,
18710 #[builder(setter(into, strip_option), default)]
18712 pub settings: Option<Json>,
18713}
18714#[derive(Builder, Debug, PartialEq)]
18715pub struct WorkspaceWithClientOpts<'a> {
18716 #[builder(setter(into, strip_option), default)]
18718 pub sdk: Option<&'a str>,
18719 #[builder(setter(into, strip_option), default)]
18721 pub settings: Option<Json>,
18722}
18723#[derive(Builder, Debug, PartialEq)]
18724pub struct WorkspaceWithoutClientOpts<'a> {
18725 #[builder(setter(into, strip_option), default)]
18727 pub sdk: Option<&'a str>,
18728}
18729#[derive(Builder, Debug, PartialEq)]
18730pub struct WorkspaceWithUpdatedClientsOpts<'a> {
18731 #[builder(setter(into, strip_option), default)]
18733 pub all: Option<bool>,
18734 #[builder(setter(into, strip_option), default)]
18736 pub modules: Option<Vec<&'a str>>,
18737 #[builder(setter(into, strip_option), default)]
18739 pub sdk: Option<&'a str>,
18740}
18741#[derive(Builder, Debug, PartialEq)]
18742pub struct WorkspaceWithConfigValueOpts<'a> {
18743 #[builder(setter(into, strip_option), default)]
18745 pub here: Option<bool>,
18746 #[builder(setter(into, strip_option), default)]
18748 pub values: Option<Vec<&'a str>>,
18749}
18750#[derive(Builder, Debug, PartialEq)]
18751pub struct WorkspaceWithoutConfigValueOpts {
18752 #[builder(setter(into, strip_option), default)]
18754 pub here: Option<bool>,
18755}
18756#[derive(Builder, Debug, PartialEq)]
18757pub struct WorkspaceWithConfigEnvOpts {
18758 #[builder(setter(into, strip_option), default)]
18760 pub here: Option<bool>,
18761}
18762#[derive(Builder, Debug, PartialEq)]
18763pub struct WorkspaceWithoutConfigEnvOpts {
18764 #[builder(setter(into, strip_option), default)]
18766 pub here: Option<bool>,
18767}
18768#[derive(Builder, Debug, PartialEq)]
18769pub struct WorkspaceWithUpdatedLockOpts {
18770 #[builder(setter(into, strip_option), default)]
18772 pub no_generate: Option<bool>,
18773}
18774#[derive(Builder, Debug, PartialEq)]
18775pub struct WorkspaceWithUpdatedModulesOpts<'a> {
18776 #[builder(setter(into, strip_option), default)]
18778 pub names: Option<Vec<&'a str>>,
18779 #[builder(setter(into, strip_option), default)]
18781 pub source: Option<&'a str>,
18782 #[builder(setter(into, strip_option), default)]
18784 pub version: Option<&'a str>,
18785}
18786#[derive(Builder, Debug, PartialEq)]
18787pub struct WorkspaceChangesOpts {
18788 #[builder(setter(into, strip_option), default)]
18790 pub from: Option<Id>,
18791}
18792#[derive(Builder, Debug, PartialEq)]
18793pub struct WorkspaceExportOpts<'a> {
18794 #[builder(setter(into, strip_option), default)]
18796 pub from: Option<Id>,
18797 #[builder(setter(into, strip_option), default)]
18799 pub path: Option<&'a str>,
18800}
18801#[derive(Builder, Debug, PartialEq)]
18802pub struct WorkspaceConfigReadOpts<'a> {
18803 #[builder(setter(into, strip_option), default)]
18805 pub effective: Option<bool>,
18806 #[builder(setter(into, strip_option), default)]
18808 pub key: Option<&'a str>,
18809}
18810#[derive(Builder, Debug, PartialEq)]
18811pub struct WorkspaceArtifactsOpts<'a> {
18812 #[builder(setter(into, strip_option), default)]
18814 pub include: Option<Vec<&'a str>>,
18815}
18816#[derive(Builder, Debug, PartialEq)]
18817pub struct WorkspaceMigrateOpts<'a> {
18818 #[builder(setter(into, strip_option), default)]
18820 pub modules: Option<Vec<&'a str>>,
18821}
18822impl IntoID<Id> for Workspace {
18823 fn into_id(
18824 self,
18825 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
18826 Box::pin(async move { self.id().await })
18827 }
18828}
18829impl Loadable for Workspace {
18830 fn graphql_type() -> &'static str {
18831 "Workspace"
18832 }
18833 fn from_query(
18834 proc: Option<Arc<DaggerSessionProc>>,
18835 selection: Selection,
18836 graphql_client: DynGraphQLClient,
18837 ) -> Self {
18838 Self {
18839 proc,
18840 selection,
18841 graphql_client,
18842 }
18843 }
18844}
18845impl Workspace {
18846 pub async fn id(&self) -> Result<Id, DaggerError> {
18848 let query = self.selection.select("id");
18849 query.execute(self.graphql_client.clone()).await
18850 }
18851 pub fn resolve(&self, value: impl Into<String>) -> Address {
18860 let mut query = self.selection.select("resolve");
18861 query = query.arg("value", value.into());
18862 Address {
18863 proc: self.proc.clone(),
18864 selection: query,
18865 graphql_client: self.graphql_client.clone(),
18866 }
18867 }
18868 pub fn with_initialized(&self) -> Workspace {
18871 let query = self.selection.select("withInitialized");
18872 Workspace {
18873 proc: self.proc.clone(),
18874 selection: query,
18875 graphql_client: self.graphql_client.clone(),
18876 }
18877 }
18878 pub fn migrate_module(&self) -> WorkspaceMigration {
18885 let query = self.selection.select("migrateModule");
18886 WorkspaceMigration {
18887 proc: self.proc.clone(),
18888 selection: query,
18889 graphql_client: self.graphql_client.clone(),
18890 }
18891 }
18892 pub fn migrate_module_opts<'a>(
18899 &self,
18900 opts: WorkspaceMigrateModuleOpts<'a>,
18901 ) -> WorkspaceMigration {
18902 let mut query = self.selection.select("migrateModule");
18903 if let Some(path) = opts.path {
18904 query = query.arg("path", path);
18905 }
18906 WorkspaceMigration {
18907 proc: self.proc.clone(),
18908 selection: query,
18909 graphql_client: self.graphql_client.clone(),
18910 }
18911 }
18912 pub async fn compare_commits_from(
18921 &self,
18922 source: impl IntoID<Id>,
18923 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18924 let mut query = self.selection.select("compareCommitsFrom");
18925 query = query.arg_lazy(
18926 "source",
18927 Box::new(move || {
18928 let source = source.clone();
18929 Box::pin(async move { source.into_id().await.unwrap().quote() })
18930 }),
18931 );
18932 let query = query.select("id");
18933 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18934 Ok(ids
18935 .into_iter()
18936 .map(|id| WorkspaceCommitPick {
18937 proc: self.proc.clone(),
18938 selection: crate::querybuilder::query()
18939 .select("node")
18940 .arg("id", &id.0)
18941 .inline_fragment("WorkspaceCommitPick"),
18942 graphql_client: self.graphql_client.clone(),
18943 })
18944 .collect())
18945 }
18946 pub async fn compare_commits_from_opts<'a>(
18955 &self,
18956 source: impl IntoID<Id>,
18957 opts: WorkspaceCompareCommitsFromOpts<'a>,
18958 ) -> Result<Vec<WorkspaceCommitPick>, DaggerError> {
18959 let mut query = self.selection.select("compareCommitsFrom");
18960 query = query.arg_lazy(
18961 "source",
18962 Box::new(move || {
18963 let source = source.clone();
18964 Box::pin(async move { source.into_id().await.unwrap().quote() })
18965 }),
18966 );
18967 if let Some(commits) = opts.commits {
18968 query = query.arg("commits", commits);
18969 }
18970 if let Some(max_commits) = opts.max_commits {
18971 query = query.arg("maxCommits", max_commits);
18972 }
18973 let query = query.select("id");
18974 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
18975 Ok(ids
18976 .into_iter()
18977 .map(|id| WorkspaceCommitPick {
18978 proc: self.proc.clone(),
18979 selection: crate::querybuilder::query()
18980 .select("node")
18981 .arg("id", &id.0)
18982 .inline_fragment("WorkspaceCommitPick"),
18983 graphql_client: self.graphql_client.clone(),
18984 })
18985 .collect())
18986 }
18987 pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace {
18997 let mut query = self.selection.select("withCommitsFrom");
18998 query = query.arg_lazy(
18999 "source",
19000 Box::new(move || {
19001 let source = source.clone();
19002 Box::pin(async move { source.into_id().await.unwrap().quote() })
19003 }),
19004 );
19005 Workspace {
19006 proc: self.proc.clone(),
19007 selection: query,
19008 graphql_client: self.graphql_client.clone(),
19009 }
19010 }
19011 pub fn with_commits_from_opts<'a>(
19021 &self,
19022 source: impl IntoID<Id>,
19023 opts: WorkspaceWithCommitsFromOpts<'a>,
19024 ) -> Workspace {
19025 let mut query = self.selection.select("withCommitsFrom");
19026 query = query.arg_lazy(
19027 "source",
19028 Box::new(move || {
19029 let source = source.clone();
19030 Box::pin(async move { source.into_id().await.unwrap().quote() })
19031 }),
19032 );
19033 if let Some(commits) = opts.commits {
19034 query = query.arg("commits", commits);
19035 }
19036 if let Some(max_commits) = opts.max_commits {
19037 query = query.arg("maxCommits", max_commits);
19038 }
19039 Workspace {
19040 proc: self.proc.clone(),
19041 selection: query,
19042 graphql_client: self.graphql_client.clone(),
19043 }
19044 }
19045 pub fn with_commit(
19057 &self,
19058 changes: impl IntoID<Id>,
19059 message: impl Into<String>,
19060 date: impl Into<String>,
19061 ) -> Workspace {
19062 let mut query = self.selection.select("withCommit");
19063 query = query.arg_lazy(
19064 "changes",
19065 Box::new(move || {
19066 let changes = changes.clone();
19067 Box::pin(async move { changes.into_id().await.unwrap().quote() })
19068 }),
19069 );
19070 query = query.arg("message", message.into());
19071 query = query.arg("date", date.into());
19072 Workspace {
19073 proc: self.proc.clone(),
19074 selection: query,
19075 graphql_client: self.graphql_client.clone(),
19076 }
19077 }
19078 pub fn with_commit_opts<'a>(
19090 &self,
19091 changes: impl IntoID<Id>,
19092 message: impl Into<String>,
19093 date: impl Into<String>,
19094 opts: WorkspaceWithCommitOpts<'a>,
19095 ) -> Workspace {
19096 let mut query = self.selection.select("withCommit");
19097 query = query.arg_lazy(
19098 "changes",
19099 Box::new(move || {
19100 let changes = changes.clone();
19101 Box::pin(async move { changes.into_id().await.unwrap().quote() })
19102 }),
19103 );
19104 query = query.arg("message", message.into());
19105 query = query.arg("date", date.into());
19106 if let Some(author_name) = opts.author_name {
19107 query = query.arg("authorName", author_name);
19108 }
19109 if let Some(author_email) = opts.author_email {
19110 query = query.arg("authorEmail", author_email);
19111 }
19112 if let Some(signoff) = opts.signoff {
19113 query = query.arg("signoff", signoff);
19114 }
19115 Workspace {
19116 proc: self.proc.clone(),
19117 selection: query,
19118 graphql_client: self.graphql_client.clone(),
19119 }
19120 }
19121 pub fn with_reset(&self, commit: impl Into<String>) -> Workspace {
19131 let mut query = self.selection.select("withReset");
19132 query = query.arg("commit", commit.into());
19133 Workspace {
19134 proc: self.proc.clone(),
19135 selection: query,
19136 graphql_client: self.graphql_client.clone(),
19137 }
19138 }
19139 pub fn with_reset_opts(
19149 &self,
19150 commit: impl Into<String>,
19151 opts: WorkspaceWithResetOpts,
19152 ) -> Workspace {
19153 let mut query = self.selection.select("withReset");
19154 query = query.arg("commit", commit.into());
19155 if let Some(hard) = opts.hard {
19156 query = query.arg("hard", hard);
19157 }
19158 Workspace {
19159 proc: self.proc.clone(),
19160 selection: query,
19161 graphql_client: self.graphql_client.clone(),
19162 }
19163 }
19164 pub fn snapshot(&self) -> Workspace {
19170 let query = self.selection.select("snapshot");
19171 Workspace {
19172 proc: self.proc.clone(),
19173 selection: query,
19174 graphql_client: self.graphql_client.clone(),
19175 }
19176 }
19177 pub fn with_config_paths(
19184 &self,
19185 config_file: impl Into<String>,
19186 lock_file: impl Into<String>,
19187 ) -> Workspace {
19188 let mut query = self.selection.select("withConfigPaths");
19189 query = query.arg("configFile", config_file.into());
19190 query = query.arg("lockFile", lock_file.into());
19191 Workspace {
19192 proc: self.proc.clone(),
19193 selection: query,
19194 graphql_client: self.graphql_client.clone(),
19195 }
19196 }
19197 pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace {
19203 let mut query = self.selection.select("withConfigEnvironment");
19204 query = query.arg("name", name.into());
19205 Workspace {
19206 proc: self.proc.clone(),
19207 selection: query,
19208 graphql_client: self.graphql_client.clone(),
19209 }
19210 }
19211 pub fn with_user_config(&self) -> Workspace {
19215 let query = self.selection.select("withUserConfig");
19216 Workspace {
19217 proc: self.proc.clone(),
19218 selection: query,
19219 graphql_client: self.graphql_client.clone(),
19220 }
19221 }
19222 pub async fn config_file(&self) -> Result<String, DaggerError> {
19224 let query = self.selection.select("configFile");
19225 query.execute(self.graphql_client.clone()).await
19226 }
19227 pub fn directory(&self, path: impl Into<String>) -> Directory {
19235 let mut query = self.selection.select("directory");
19236 query = query.arg("path", path.into());
19237 Directory {
19238 proc: self.proc.clone(),
19239 selection: query,
19240 graphql_client: self.graphql_client.clone(),
19241 }
19242 }
19243 pub fn directory_opts<'a>(
19251 &self,
19252 path: impl Into<String>,
19253 opts: WorkspaceDirectoryOpts<'a>,
19254 ) -> Directory {
19255 let mut query = self.selection.select("directory");
19256 query = query.arg("path", path.into());
19257 if let Some(exclude) = opts.exclude {
19258 query = query.arg("exclude", exclude);
19259 }
19260 if let Some(include) = opts.include {
19261 query = query.arg("include", include);
19262 }
19263 if let Some(gitignore) = opts.gitignore {
19264 query = query.arg("gitignore", gitignore);
19265 }
19266 Directory {
19267 proc: self.proc.clone(),
19268 selection: query,
19269 graphql_client: self.graphql_client.clone(),
19270 }
19271 }
19272 pub fn file(&self, path: impl Into<String>) -> File {
19279 let mut query = self.selection.select("file");
19280 query = query.arg("path", path.into());
19281 File {
19282 proc: self.proc.clone(),
19283 selection: query,
19284 graphql_client: self.graphql_client.clone(),
19285 }
19286 }
19287 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
19294 let mut query = self.selection.select("glob");
19295 query = query.arg("pattern", pattern.into());
19296 query.execute(self.graphql_client.clone()).await
19297 }
19298 pub async fn search(
19307 &self,
19308 pattern: impl Into<String>,
19309 ) -> Result<Vec<SearchResult>, DaggerError> {
19310 let mut query = self.selection.select("search");
19311 query = query.arg("pattern", pattern.into());
19312 let query = query.select("id");
19313 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19314 Ok(ids
19315 .into_iter()
19316 .map(|id| SearchResult {
19317 proc: self.proc.clone(),
19318 selection: crate::querybuilder::query()
19319 .select("node")
19320 .arg("id", &id.0)
19321 .inline_fragment("SearchResult"),
19322 graphql_client: self.graphql_client.clone(),
19323 })
19324 .collect())
19325 }
19326 pub async fn search_opts<'a>(
19335 &self,
19336 pattern: impl Into<String>,
19337 opts: WorkspaceSearchOpts<'a>,
19338 ) -> Result<Vec<SearchResult>, DaggerError> {
19339 let mut query = self.selection.select("search");
19340 query = query.arg("pattern", pattern.into());
19341 if let Some(paths) = opts.paths {
19342 query = query.arg("paths", paths);
19343 }
19344 if let Some(globs) = opts.globs {
19345 query = query.arg("globs", globs);
19346 }
19347 if let Some(literal) = opts.literal {
19348 query = query.arg("literal", literal);
19349 }
19350 if let Some(multiline) = opts.multiline {
19351 query = query.arg("multiline", multiline);
19352 }
19353 if let Some(dotall) = opts.dotall {
19354 query = query.arg("dotall", dotall);
19355 }
19356 if let Some(insensitive) = opts.insensitive {
19357 query = query.arg("insensitive", insensitive);
19358 }
19359 if let Some(skip_ignored) = opts.skip_ignored {
19360 query = query.arg("skipIgnored", skip_ignored);
19361 }
19362 if let Some(skip_hidden) = opts.skip_hidden {
19363 query = query.arg("skipHidden", skip_hidden);
19364 }
19365 if let Some(files_only) = opts.files_only {
19366 query = query.arg("filesOnly", files_only);
19367 }
19368 if let Some(limit) = opts.limit {
19369 query = query.arg("limit", limit);
19370 }
19371 let query = query.select("id");
19372 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
19373 Ok(ids
19374 .into_iter()
19375 .map(|id| SearchResult {
19376 proc: self.proc.clone(),
19377 selection: crate::querybuilder::query()
19378 .select("node")
19379 .arg("id", &id.0)
19380 .inline_fragment("SearchResult"),
19381 graphql_client: self.graphql_client.clone(),
19382 })
19383 .collect())
19384 }
19385 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
19395 let mut query = self.selection.select("findUp");
19396 query = query.arg("name", name.into());
19397 query.execute(self.graphql_client.clone()).await
19398 }
19399 pub async fn find_up_opts<'a>(
19409 &self,
19410 name: impl Into<String>,
19411 opts: WorkspaceFindUpOpts<'a>,
19412 ) -> Result<String, DaggerError> {
19413 let mut query = self.selection.select("findUp");
19414 query = query.arg("name", name.into());
19415 if let Some(from) = opts.from {
19416 query = query.arg("from", from);
19417 }
19418 query.execute(self.graphql_client.clone()).await
19419 }
19420 pub async fn find_roots(
19429 &self,
19430 markers: Vec<impl Into<String>>,
19431 ) -> Result<Vec<String>, DaggerError> {
19432 let mut query = self.selection.select("findRoots");
19433 query = query.arg(
19434 "markers",
19435 markers
19436 .into_iter()
19437 .map(|i| i.into())
19438 .collect::<Vec<String>>(),
19439 );
19440 query.execute(self.graphql_client.clone()).await
19441 }
19442 pub async fn find_roots_opts<'a>(
19451 &self,
19452 markers: Vec<impl Into<String>>,
19453 opts: WorkspaceFindRootsOpts<'a>,
19454 ) -> Result<Vec<String>, DaggerError> {
19455 let mut query = self.selection.select("findRoots");
19456 query = query.arg(
19457 "markers",
19458 markers
19459 .into_iter()
19460 .map(|i| i.into())
19461 .collect::<Vec<String>>(),
19462 );
19463 if let Some(start) = opts.start {
19464 query = query.arg("start", start);
19465 }
19466 if let Some(exclude) = opts.exclude {
19467 query = query.arg("exclude", exclude);
19468 }
19469 query.execute(self.graphql_client.clone()).await
19470 }
19471 pub fn git(&self) -> WorkspaceGit {
19473 let query = self.selection.select("git");
19474 WorkspaceGit {
19475 proc: self.proc.clone(),
19476 selection: query,
19477 graphql_client: self.graphql_client.clone(),
19478 }
19479 }
19480 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Workspace {
19488 let mut query = self.selection.select("withNewFile");
19489 query = query.arg("path", path.into());
19490 query = query.arg("contents", contents.into());
19491 Workspace {
19492 proc: self.proc.clone(),
19493 selection: query,
19494 graphql_client: self.graphql_client.clone(),
19495 }
19496 }
19497 pub fn with_new_file_opts(
19505 &self,
19506 path: impl Into<String>,
19507 contents: impl Into<String>,
19508 opts: WorkspaceWithNewFileOpts,
19509 ) -> Workspace {
19510 let mut query = self.selection.select("withNewFile");
19511 query = query.arg("path", path.into());
19512 query = query.arg("contents", contents.into());
19513 if let Some(permissions) = opts.permissions {
19514 query = query.arg("permissions", permissions);
19515 }
19516 Workspace {
19517 proc: self.proc.clone(),
19518 selection: query,
19519 graphql_client: self.graphql_client.clone(),
19520 }
19521 }
19522 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19530 let mut query = self.selection.select("withFile");
19531 query = query.arg("path", path.into());
19532 query = query.arg_lazy(
19533 "source",
19534 Box::new(move || {
19535 let source = source.clone();
19536 Box::pin(async move { source.into_id().await.unwrap().quote() })
19537 }),
19538 );
19539 Workspace {
19540 proc: self.proc.clone(),
19541 selection: query,
19542 graphql_client: self.graphql_client.clone(),
19543 }
19544 }
19545 pub fn with_file_opts(
19553 &self,
19554 path: impl Into<String>,
19555 source: impl IntoID<Id>,
19556 opts: WorkspaceWithFileOpts,
19557 ) -> Workspace {
19558 let mut query = self.selection.select("withFile");
19559 query = query.arg("path", path.into());
19560 query = query.arg_lazy(
19561 "source",
19562 Box::new(move || {
19563 let source = source.clone();
19564 Box::pin(async move { source.into_id().await.unwrap().quote() })
19565 }),
19566 );
19567 if let Some(permissions) = opts.permissions {
19568 query = query.arg("permissions", permissions);
19569 }
19570 Workspace {
19571 proc: self.proc.clone(),
19572 selection: query,
19573 graphql_client: self.graphql_client.clone(),
19574 }
19575 }
19576 pub fn with_new_directory(
19584 &self,
19585 path: impl Into<String>,
19586 source: impl IntoID<Id>,
19587 ) -> Workspace {
19588 let mut query = self.selection.select("withNewDirectory");
19589 query = query.arg("path", path.into());
19590 query = query.arg_lazy(
19591 "source",
19592 Box::new(move || {
19593 let source = source.clone();
19594 Box::pin(async move { source.into_id().await.unwrap().quote() })
19595 }),
19596 );
19597 Workspace {
19598 proc: self.proc.clone(),
19599 selection: query,
19600 graphql_client: self.graphql_client.clone(),
19601 }
19602 }
19603 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19611 let mut query = self.selection.select("withDirectory");
19612 query = query.arg("path", path.into());
19613 query = query.arg_lazy(
19614 "source",
19615 Box::new(move || {
19616 let source = source.clone();
19617 Box::pin(async move { source.into_id().await.unwrap().quote() })
19618 }),
19619 );
19620 Workspace {
19621 proc: self.proc.clone(),
19622 selection: query,
19623 graphql_client: self.graphql_client.clone(),
19624 }
19625 }
19626 pub fn without_file(&self, path: impl Into<String>) -> Workspace {
19632 let mut query = self.selection.select("withoutFile");
19633 query = query.arg("path", path.into());
19634 Workspace {
19635 proc: self.proc.clone(),
19636 selection: query,
19637 graphql_client: self.graphql_client.clone(),
19638 }
19639 }
19640 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Workspace {
19646 let mut query = self.selection.select("withoutFiles");
19647 query = query.arg(
19648 "paths",
19649 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
19650 );
19651 Workspace {
19652 proc: self.proc.clone(),
19653 selection: query,
19654 graphql_client: self.graphql_client.clone(),
19655 }
19656 }
19657 pub fn without_directory(&self, path: impl Into<String>) -> Workspace {
19663 let mut query = self.selection.select("withoutDirectory");
19664 query = query.arg("path", path.into());
19665 Workspace {
19666 proc: self.proc.clone(),
19667 selection: query,
19668 graphql_client: self.graphql_client.clone(),
19669 }
19670 }
19671 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace {
19677 let mut query = self.selection.select("withChanges");
19678 query = query.arg_lazy(
19679 "changes",
19680 Box::new(move || {
19681 let changes = changes.clone();
19682 Box::pin(async move { changes.into_id().await.unwrap().quote() })
19683 }),
19684 );
19685 Workspace {
19686 proc: self.proc.clone(),
19687 selection: query,
19688 graphql_client: self.graphql_client.clone(),
19689 }
19690 }
19691 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Workspace {
19699 let mut query = self.selection.select("withPatchFile");
19700 query = query.arg_lazy(
19701 "patch",
19702 Box::new(move || {
19703 let patch = patch.clone();
19704 Box::pin(async move { patch.into_id().await.unwrap().quote() })
19705 }),
19706 );
19707 Workspace {
19708 proc: self.proc.clone(),
19709 selection: query,
19710 graphql_client: self.graphql_client.clone(),
19711 }
19712 }
19713 pub fn with_patch_file_opts(
19721 &self,
19722 patch: impl IntoID<Id>,
19723 opts: WorkspaceWithPatchFileOpts,
19724 ) -> Workspace {
19725 let mut query = self.selection.select("withPatchFile");
19726 query = query.arg_lazy(
19727 "patch",
19728 Box::new(move || {
19729 let patch = patch.clone();
19730 Box::pin(async move { patch.into_id().await.unwrap().quote() })
19731 }),
19732 );
19733 if let Some(on_conflict) = opts.on_conflict {
19734 query = query.arg("onConflict", on_conflict);
19735 }
19736 Workspace {
19737 proc: self.proc.clone(),
19738 selection: query,
19739 graphql_client: self.graphql_client.clone(),
19740 }
19741 }
19742 pub fn with_workdir(&self, path: impl Into<String>) -> Workspace {
19748 let mut query = self.selection.select("withWorkdir");
19749 query = query.arg("path", path.into());
19750 Workspace {
19751 proc: self.proc.clone(),
19752 selection: query,
19753 graphql_client: self.graphql_client.clone(),
19754 }
19755 }
19756 pub fn with_mounted_directory(
19764 &self,
19765 path: impl Into<String>,
19766 source: impl IntoID<Id>,
19767 ) -> Workspace {
19768 let mut query = self.selection.select("withMountedDirectory");
19769 query = query.arg("path", path.into());
19770 query = query.arg_lazy(
19771 "source",
19772 Box::new(move || {
19773 let source = source.clone();
19774 Box::pin(async move { source.into_id().await.unwrap().quote() })
19775 }),
19776 );
19777 Workspace {
19778 proc: self.proc.clone(),
19779 selection: query,
19780 graphql_client: self.graphql_client.clone(),
19781 }
19782 }
19783 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Workspace {
19791 let mut query = self.selection.select("withMountedFile");
19792 query = query.arg("path", path.into());
19793 query = query.arg_lazy(
19794 "source",
19795 Box::new(move || {
19796 let source = source.clone();
19797 Box::pin(async move { source.into_id().await.unwrap().quote() })
19798 }),
19799 );
19800 Workspace {
19801 proc: self.proc.clone(),
19802 selection: query,
19803 graphql_client: self.graphql_client.clone(),
19804 }
19805 }
19806 pub fn without_mount(&self, path: impl Into<String>) -> Workspace {
19813 let mut query = self.selection.select("withoutMount");
19814 query = query.arg("path", path.into());
19815 Workspace {
19816 proc: self.proc.clone(),
19817 selection: query,
19818 graphql_client: self.graphql_client.clone(),
19819 }
19820 }
19821 pub fn with_module(&self, r#ref: impl Into<String>) -> Workspace {
19829 let mut query = self.selection.select("withModule");
19830 query = query.arg("ref", r#ref.into());
19831 Workspace {
19832 proc: self.proc.clone(),
19833 selection: query,
19834 graphql_client: self.graphql_client.clone(),
19835 }
19836 }
19837 pub fn with_module_opts<'a>(
19845 &self,
19846 r#ref: impl Into<String>,
19847 opts: WorkspaceWithModuleOpts<'a>,
19848 ) -> Workspace {
19849 let mut query = self.selection.select("withModule");
19850 query = query.arg("ref", r#ref.into());
19851 if let Some(name) = opts.name {
19852 query = query.arg("name", name);
19853 }
19854 if let Some(here) = opts.here {
19855 query = query.arg("here", here);
19856 }
19857 Workspace {
19858 proc: self.proc.clone(),
19859 selection: query,
19860 graphql_client: self.graphql_client.clone(),
19861 }
19862 }
19863 pub fn without_module(&self, name: impl Into<String>) -> Workspace {
19871 let mut query = self.selection.select("withoutModule");
19872 query = query.arg("name", name.into());
19873 Workspace {
19874 proc: self.proc.clone(),
19875 selection: query,
19876 graphql_client: self.graphql_client.clone(),
19877 }
19878 }
19879 pub fn without_module_opts(
19887 &self,
19888 name: impl Into<String>,
19889 opts: WorkspaceWithoutModuleOpts,
19890 ) -> Workspace {
19891 let mut query = self.selection.select("withoutModule");
19892 query = query.arg("name", name.into());
19893 if let Some(here) = opts.here {
19894 query = query.arg("here", here);
19895 }
19896 Workspace {
19897 proc: self.proc.clone(),
19898 selection: query,
19899 graphql_client: self.graphql_client.clone(),
19900 }
19901 }
19902 pub fn with_sdk(&self, r#ref: impl Into<String>) -> Workspace {
19909 let mut query = self.selection.select("withSDK");
19910 query = query.arg("ref", r#ref.into());
19911 Workspace {
19912 proc: self.proc.clone(),
19913 selection: query,
19914 graphql_client: self.graphql_client.clone(),
19915 }
19916 }
19917 pub fn with_sdk_opts<'a>(
19924 &self,
19925 r#ref: impl Into<String>,
19926 opts: WorkspaceWithSdkOpts<'a>,
19927 ) -> Workspace {
19928 let mut query = self.selection.select("withSDK");
19929 query = query.arg("ref", r#ref.into());
19930 if let Some(name) = opts.name {
19931 query = query.arg("name", name);
19932 }
19933 if let Some(here) = opts.here {
19934 query = query.arg("here", here);
19935 }
19936 if let Some(as_sdk_name) = opts.as_sdk_name {
19937 query = query.arg("asSdkName", as_sdk_name);
19938 }
19939 Workspace {
19940 proc: self.proc.clone(),
19941 selection: query,
19942 graphql_client: self.graphql_client.clone(),
19943 }
19944 }
19945 pub fn without_sdk(&self, name: impl Into<String>) -> Workspace {
19952 let mut query = self.selection.select("withoutSDK");
19953 query = query.arg("name", name.into());
19954 Workspace {
19955 proc: self.proc.clone(),
19956 selection: query,
19957 graphql_client: self.graphql_client.clone(),
19958 }
19959 }
19960 pub fn without_sdk_opts(
19967 &self,
19968 name: impl Into<String>,
19969 opts: WorkspaceWithoutSdkOpts,
19970 ) -> Workspace {
19971 let mut query = self.selection.select("withoutSDK");
19972 query = query.arg("name", name.into());
19973 if let Some(here) = opts.here {
19974 query = query.arg("here", here);
19975 }
19976 Workspace {
19977 proc: self.proc.clone(),
19978 selection: query,
19979 graphql_client: self.graphql_client.clone(),
19980 }
19981 }
19982 pub fn with_main(&self, name: impl Into<String>) -> Workspace {
19989 let mut query = self.selection.select("withMain");
19990 query = query.arg("name", name.into());
19991 Workspace {
19992 proc: self.proc.clone(),
19993 selection: query,
19994 graphql_client: self.graphql_client.clone(),
19995 }
19996 }
19997 pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace {
20003 let mut query = self.selection.select("withEntrypoint");
20004 query = query.arg("name", name.into());
20005 Workspace {
20006 proc: self.proc.clone(),
20007 selection: query,
20008 graphql_client: self.graphql_client.clone(),
20009 }
20010 }
20011 pub fn without_main(&self) -> Workspace {
20013 let query = self.selection.select("withoutMain");
20014 Workspace {
20015 proc: self.proc.clone(),
20016 selection: query,
20017 graphql_client: self.graphql_client.clone(),
20018 }
20019 }
20020 pub fn without_entrypoint(&self) -> Workspace {
20022 let query = self.selection.select("withoutEntrypoint");
20023 Workspace {
20024 proc: self.proc.clone(),
20025 selection: query,
20026 graphql_client: self.graphql_client.clone(),
20027 }
20028 }
20029 pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace {
20037 let mut query = self.selection.select("withInitModule");
20038 query = query.arg("sdk", sdk.into());
20039 Workspace {
20040 proc: self.proc.clone(),
20041 selection: query,
20042 graphql_client: self.graphql_client.clone(),
20043 }
20044 }
20045 pub fn with_init_module_opts<'a>(
20053 &self,
20054 sdk: impl Into<String>,
20055 opts: WorkspaceWithInitModuleOpts<'a>,
20056 ) -> Workspace {
20057 let mut query = self.selection.select("withInitModule");
20058 query = query.arg("sdk", sdk.into());
20059 if let Some(name) = opts.name {
20060 query = query.arg("name", name);
20061 }
20062 if let Some(path) = opts.path {
20063 query = query.arg("path", path);
20064 }
20065 if let Some(install) = opts.install {
20066 query = query.arg("install", install);
20067 }
20068 if let Some(main) = opts.main {
20069 query = query.arg("main", main);
20070 }
20071 if let Some(entrypoint) = opts.entrypoint {
20072 query = query.arg("entrypoint", entrypoint);
20073 }
20074 if let Some(settings) = opts.settings {
20075 query = query.arg("settings", settings);
20076 }
20077 Workspace {
20078 proc: self.proc.clone(),
20079 selection: query,
20080 graphql_client: self.graphql_client.clone(),
20081 }
20082 }
20083 pub async fn detect_scope(&self, sdk: impl Into<String>) -> Result<String, DaggerError> {
20089 let mut query = self.selection.select("detectScope");
20090 query = query.arg("sdk", sdk.into());
20091 query.execute(self.graphql_client.clone()).await
20092 }
20093 pub fn with_client(&self, module: impl Into<String>) -> Workspace {
20101 let mut query = self.selection.select("withClient");
20102 query = query.arg("module", module.into());
20103 Workspace {
20104 proc: self.proc.clone(),
20105 selection: query,
20106 graphql_client: self.graphql_client.clone(),
20107 }
20108 }
20109 pub fn with_client_opts<'a>(
20117 &self,
20118 module: impl Into<String>,
20119 opts: WorkspaceWithClientOpts<'a>,
20120 ) -> Workspace {
20121 let mut query = self.selection.select("withClient");
20122 query = query.arg("module", module.into());
20123 if let Some(sdk) = opts.sdk {
20124 query = query.arg("sdk", sdk);
20125 }
20126 if let Some(settings) = opts.settings {
20127 query = query.arg("settings", settings);
20128 }
20129 Workspace {
20130 proc: self.proc.clone(),
20131 selection: query,
20132 graphql_client: self.graphql_client.clone(),
20133 }
20134 }
20135 pub fn without_client(&self, module: impl Into<String>) -> Workspace {
20144 let mut query = self.selection.select("withoutClient");
20145 query = query.arg("module", module.into());
20146 Workspace {
20147 proc: self.proc.clone(),
20148 selection: query,
20149 graphql_client: self.graphql_client.clone(),
20150 }
20151 }
20152 pub fn without_client_opts<'a>(
20161 &self,
20162 module: impl Into<String>,
20163 opts: WorkspaceWithoutClientOpts<'a>,
20164 ) -> Workspace {
20165 let mut query = self.selection.select("withoutClient");
20166 query = query.arg("module", module.into());
20167 if let Some(sdk) = opts.sdk {
20168 query = query.arg("sdk", sdk);
20169 }
20170 Workspace {
20171 proc: self.proc.clone(),
20172 selection: query,
20173 graphql_client: self.graphql_client.clone(),
20174 }
20175 }
20176 pub fn with_updated_clients(&self) -> Workspace {
20184 let query = self.selection.select("withUpdatedClients");
20185 Workspace {
20186 proc: self.proc.clone(),
20187 selection: query,
20188 graphql_client: self.graphql_client.clone(),
20189 }
20190 }
20191 pub fn with_updated_clients_opts<'a>(
20199 &self,
20200 opts: WorkspaceWithUpdatedClientsOpts<'a>,
20201 ) -> Workspace {
20202 let mut query = self.selection.select("withUpdatedClients");
20203 if let Some(modules) = opts.modules {
20204 query = query.arg("modules", modules);
20205 }
20206 if let Some(all) = opts.all {
20207 query = query.arg("all", all);
20208 }
20209 if let Some(sdk) = opts.sdk {
20210 query = query.arg("sdk", sdk);
20211 }
20212 Workspace {
20213 proc: self.proc.clone(),
20214 selection: query,
20215 graphql_client: self.graphql_client.clone(),
20216 }
20217 }
20218 pub fn with_config_value(&self, key: impl Into<String>, value: impl Into<String>) -> Workspace {
20227 let mut query = self.selection.select("withConfigValue");
20228 query = query.arg("key", key.into());
20229 query = query.arg("value", value.into());
20230 Workspace {
20231 proc: self.proc.clone(),
20232 selection: query,
20233 graphql_client: self.graphql_client.clone(),
20234 }
20235 }
20236 pub fn with_config_value_opts<'a>(
20245 &self,
20246 key: impl Into<String>,
20247 value: impl Into<String>,
20248 opts: WorkspaceWithConfigValueOpts<'a>,
20249 ) -> Workspace {
20250 let mut query = self.selection.select("withConfigValue");
20251 query = query.arg("key", key.into());
20252 query = query.arg("value", value.into());
20253 if let Some(values) = opts.values {
20254 query = query.arg("values", values);
20255 }
20256 if let Some(here) = opts.here {
20257 query = query.arg("here", here);
20258 }
20259 Workspace {
20260 proc: self.proc.clone(),
20261 selection: query,
20262 graphql_client: self.graphql_client.clone(),
20263 }
20264 }
20265 pub fn without_config_value(&self, key: impl Into<String>) -> Workspace {
20274 let mut query = self.selection.select("withoutConfigValue");
20275 query = query.arg("key", key.into());
20276 Workspace {
20277 proc: self.proc.clone(),
20278 selection: query,
20279 graphql_client: self.graphql_client.clone(),
20280 }
20281 }
20282 pub fn without_config_value_opts(
20291 &self,
20292 key: impl Into<String>,
20293 opts: WorkspaceWithoutConfigValueOpts,
20294 ) -> Workspace {
20295 let mut query = self.selection.select("withoutConfigValue");
20296 query = query.arg("key", key.into());
20297 if let Some(here) = opts.here {
20298 query = query.arg("here", here);
20299 }
20300 Workspace {
20301 proc: self.proc.clone(),
20302 selection: query,
20303 graphql_client: self.graphql_client.clone(),
20304 }
20305 }
20306 pub fn with_config_env(&self, name: impl Into<String>) -> Workspace {
20313 let mut query = self.selection.select("withConfigEnv");
20314 query = query.arg("name", name.into());
20315 Workspace {
20316 proc: self.proc.clone(),
20317 selection: query,
20318 graphql_client: self.graphql_client.clone(),
20319 }
20320 }
20321 pub fn with_config_env_opts(
20328 &self,
20329 name: impl Into<String>,
20330 opts: WorkspaceWithConfigEnvOpts,
20331 ) -> Workspace {
20332 let mut query = self.selection.select("withConfigEnv");
20333 query = query.arg("name", name.into());
20334 if let Some(here) = opts.here {
20335 query = query.arg("here", here);
20336 }
20337 Workspace {
20338 proc: self.proc.clone(),
20339 selection: query,
20340 graphql_client: self.graphql_client.clone(),
20341 }
20342 }
20343 pub fn without_config_env(&self, name: impl Into<String>) -> Workspace {
20350 let mut query = self.selection.select("withoutConfigEnv");
20351 query = query.arg("name", name.into());
20352 Workspace {
20353 proc: self.proc.clone(),
20354 selection: query,
20355 graphql_client: self.graphql_client.clone(),
20356 }
20357 }
20358 pub fn without_config_env_opts(
20365 &self,
20366 name: impl Into<String>,
20367 opts: WorkspaceWithoutConfigEnvOpts,
20368 ) -> Workspace {
20369 let mut query = self.selection.select("withoutConfigEnv");
20370 query = query.arg("name", name.into());
20371 if let Some(here) = opts.here {
20372 query = query.arg("here", here);
20373 }
20374 Workspace {
20375 proc: self.proc.clone(),
20376 selection: query,
20377 graphql_client: self.graphql_client.clone(),
20378 }
20379 }
20380 pub fn with_updated_lock(&self) -> Workspace {
20387 let query = self.selection.select("withUpdatedLock");
20388 Workspace {
20389 proc: self.proc.clone(),
20390 selection: query,
20391 graphql_client: self.graphql_client.clone(),
20392 }
20393 }
20394 pub fn with_updated_lock_opts(&self, opts: WorkspaceWithUpdatedLockOpts) -> Workspace {
20401 let mut query = self.selection.select("withUpdatedLock");
20402 if let Some(no_generate) = opts.no_generate {
20403 query = query.arg("noGenerate", no_generate);
20404 }
20405 Workspace {
20406 proc: self.proc.clone(),
20407 selection: query,
20408 graphql_client: self.graphql_client.clone(),
20409 }
20410 }
20411 pub fn with_updated_modules(&self) -> Workspace {
20418 let query = self.selection.select("withUpdatedModules");
20419 Workspace {
20420 proc: self.proc.clone(),
20421 selection: query,
20422 graphql_client: self.graphql_client.clone(),
20423 }
20424 }
20425 pub fn with_updated_modules_opts<'a>(
20432 &self,
20433 opts: WorkspaceWithUpdatedModulesOpts<'a>,
20434 ) -> Workspace {
20435 let mut query = self.selection.select("withUpdatedModules");
20436 if let Some(names) = opts.names {
20437 query = query.arg("names", names);
20438 }
20439 if let Some(version) = opts.version {
20440 query = query.arg("version", version);
20441 }
20442 if let Some(source) = opts.source {
20443 query = query.arg("source", source);
20444 }
20445 Workspace {
20446 proc: self.proc.clone(),
20447 selection: query,
20448 graphql_client: self.graphql_client.clone(),
20449 }
20450 }
20451 pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError> {
20453 let query = self.selection.select("sdks");
20454 let query = query.select("id");
20455 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20456 Ok(ids
20457 .into_iter()
20458 .map(|id| WorkspaceSdk {
20459 proc: self.proc.clone(),
20460 selection: crate::querybuilder::query()
20461 .select("node")
20462 .arg("id", &id.0)
20463 .inline_fragment("WorkspaceSDK"),
20464 graphql_client: self.graphql_client.clone(),
20465 })
20466 .collect())
20467 }
20468 pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk {
20474 let mut query = self.selection.select("sdk");
20475 query = query.arg("name", name.into());
20476 WorkspaceSdk {
20477 proc: self.proc.clone(),
20478 selection: query,
20479 graphql_client: self.graphql_client.clone(),
20480 }
20481 }
20482 pub fn changes(&self) -> Changeset {
20489 let query = self.selection.select("changes");
20490 Changeset {
20491 proc: self.proc.clone(),
20492 selection: query,
20493 graphql_client: self.graphql_client.clone(),
20494 }
20495 }
20496 pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset {
20503 let mut query = self.selection.select("changes");
20504 if let Some(from) = opts.from {
20505 query = query.arg("from", from);
20506 }
20507 Changeset {
20508 proc: self.proc.clone(),
20509 selection: query,
20510 graphql_client: self.graphql_client.clone(),
20511 }
20512 }
20513 pub async fn export(&self) -> Result<Void, DaggerError> {
20522 let query = self.selection.select("export");
20523 query.execute(self.graphql_client.clone()).await
20524 }
20525 pub async fn export_opts<'a>(
20534 &self,
20535 opts: WorkspaceExportOpts<'a>,
20536 ) -> Result<Void, DaggerError> {
20537 let mut query = self.selection.select("export");
20538 if let Some(path) = opts.path {
20539 query = query.arg("path", path);
20540 }
20541 if let Some(from) = opts.from {
20542 query = query.arg("from", from);
20543 }
20544 query.execute(self.graphql_client.clone()).await
20545 }
20546 pub async fn config_read(&self) -> Result<String, DaggerError> {
20555 let query = self.selection.select("configRead");
20556 query.execute(self.graphql_client.clone()).await
20557 }
20558 pub async fn config_read_opts<'a>(
20567 &self,
20568 opts: WorkspaceConfigReadOpts<'a>,
20569 ) -> Result<String, DaggerError> {
20570 let mut query = self.selection.select("configRead");
20571 if let Some(key) = opts.key {
20572 query = query.arg("key", key);
20573 }
20574 if let Some(effective) = opts.effective {
20575 query = query.arg("effective", effective);
20576 }
20577 query.execute(self.graphql_client.clone()).await
20578 }
20579 pub async fn main(&self) -> Result<String, DaggerError> {
20582 let query = self.selection.select("main");
20583 query.execute(self.graphql_client.clone()).await
20584 }
20585 pub async fn entrypoint(&self) -> Result<String, DaggerError> {
20587 let query = self.selection.select("entrypoint");
20588 query.execute(self.graphql_client.clone()).await
20589 }
20590 pub async fn env_list(&self) -> Result<Vec<String>, DaggerError> {
20592 let query = self.selection.select("envList");
20593 query.execute(self.graphql_client.clone()).await
20594 }
20595 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
20598 let query = self.selection.select("modules");
20599 let query = query.select("id");
20600 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20601 Ok(ids
20602 .into_iter()
20603 .map(|id| WorkspaceModule {
20604 proc: self.proc.clone(),
20605 selection: crate::querybuilder::query()
20606 .select("node")
20607 .arg("id", &id.0)
20608 .inline_fragment("WorkspaceModule"),
20609 graphql_client: self.graphql_client.clone(),
20610 })
20611 .collect())
20612 }
20613 pub fn module(&self, name: impl Into<String>) -> WorkspaceModule {
20620 let mut query = self.selection.select("module");
20621 query = query.arg("name", name.into());
20622 WorkspaceModule {
20623 proc: self.proc.clone(),
20624 selection: query,
20625 graphql_client: self.graphql_client.clone(),
20626 }
20627 }
20628 pub fn module_source(&self, path: impl Into<String>) -> ModuleSource {
20636 let mut query = self.selection.select("moduleSource");
20637 query = query.arg("path", path.into());
20638 ModuleSource {
20639 proc: self.proc.clone(),
20640 selection: query,
20641 graphql_client: self.graphql_client.clone(),
20642 }
20643 }
20644 pub async fn cwd(&self) -> Result<String, DaggerError> {
20648 let query = self.selection.select("cwd");
20649 query.execute(self.graphql_client.clone()).await
20650 }
20651 pub fn artifacts(&self) -> Artifacts {
20658 let query = self.selection.select("artifacts");
20659 Artifacts {
20660 proc: self.proc.clone(),
20661 selection: query,
20662 graphql_client: self.graphql_client.clone(),
20663 }
20664 }
20665 pub fn artifacts_opts<'a>(&self, opts: WorkspaceArtifactsOpts<'a>) -> Artifacts {
20672 let mut query = self.selection.select("artifacts");
20673 if let Some(include) = opts.include {
20674 query = query.arg("include", include);
20675 }
20676 Artifacts {
20677 proc: self.proc.clone(),
20678 selection: query,
20679 graphql_client: self.graphql_client.clone(),
20680 }
20681 }
20682 pub fn migrate(&self) -> WorkspaceMigration {
20690 let query = self.selection.select("migrate");
20691 WorkspaceMigration {
20692 proc: self.proc.clone(),
20693 selection: query,
20694 graphql_client: self.graphql_client.clone(),
20695 }
20696 }
20697 pub fn migrate_opts<'a>(&self, opts: WorkspaceMigrateOpts<'a>) -> WorkspaceMigration {
20705 let mut query = self.selection.select("migrate");
20706 if let Some(modules) = opts.modules {
20707 query = query.arg("modules", modules);
20708 }
20709 WorkspaceMigration {
20710 proc: self.proc.clone(),
20711 selection: query,
20712 graphql_client: self.graphql_client.clone(),
20713 }
20714 }
20715 pub async fn address(&self) -> Result<String, DaggerError> {
20717 let query = self.selection.select("address");
20718 query.execute(self.graphql_client.clone()).await
20719 }
20720}
20721impl Node for Workspace {
20722 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20723 let query = self.selection.select("id");
20724 let graphql_client = self.graphql_client.clone();
20725 async move { query.execute(graphql_client).await }
20726 }
20727}
20728#[derive(Clone)]
20729pub struct WorkspaceCommitPick {
20730 pub proc: Option<Arc<DaggerSessionProc>>,
20731 pub selection: Selection,
20732 pub graphql_client: DynGraphQLClient,
20733}
20734impl IntoID<Id> for WorkspaceCommitPick {
20735 fn into_id(
20736 self,
20737 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20738 Box::pin(async move { self.id().await })
20739 }
20740}
20741impl Loadable for WorkspaceCommitPick {
20742 fn graphql_type() -> &'static str {
20743 "WorkspaceCommitPick"
20744 }
20745 fn from_query(
20746 proc: Option<Arc<DaggerSessionProc>>,
20747 selection: Selection,
20748 graphql_client: DynGraphQLClient,
20749 ) -> Self {
20750 Self {
20751 proc,
20752 selection,
20753 graphql_client,
20754 }
20755 }
20756}
20757impl WorkspaceCommitPick {
20758 pub async fn id(&self) -> Result<Id, DaggerError> {
20760 let query = self.selection.select("id");
20761 query.execute(self.graphql_client.clone()).await
20762 }
20763 pub fn commit(&self) -> GitCommit {
20765 let query = self.selection.select("commit");
20766 GitCommit {
20767 proc: self.proc.clone(),
20768 selection: query,
20769 graphql_client: self.graphql_client.clone(),
20770 }
20771 }
20772 pub async fn status(&self) -> Result<WorkspaceCommitPickStatus, DaggerError> {
20774 let query = self.selection.select("status");
20775 query.execute(self.graphql_client.clone()).await
20776 }
20777 pub async fn reason(&self) -> Result<WorkspaceCommitPickReason, DaggerError> {
20779 let query = self.selection.select("reason");
20780 query.execute(self.graphql_client.clone()).await
20781 }
20782 pub async fn conflict_paths(&self) -> Result<Vec<String>, DaggerError> {
20784 let query = self.selection.select("conflictPaths");
20785 query.execute(self.graphql_client.clone()).await
20786 }
20787}
20788impl Node for WorkspaceCommitPick {
20789 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20790 let query = self.selection.select("id");
20791 let graphql_client = self.graphql_client.clone();
20792 async move { query.execute(graphql_client).await }
20793 }
20794}
20795#[derive(Clone)]
20796pub struct WorkspaceGit {
20797 pub proc: Option<Arc<DaggerSessionProc>>,
20798 pub selection: Selection,
20799 pub graphql_client: DynGraphQLClient,
20800}
20801impl IntoID<Id> for WorkspaceGit {
20802 fn into_id(
20803 self,
20804 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20805 Box::pin(async move { self.id().await })
20806 }
20807}
20808impl Loadable for WorkspaceGit {
20809 fn graphql_type() -> &'static str {
20810 "WorkspaceGit"
20811 }
20812 fn from_query(
20813 proc: Option<Arc<DaggerSessionProc>>,
20814 selection: Selection,
20815 graphql_client: DynGraphQLClient,
20816 ) -> Self {
20817 Self {
20818 proc,
20819 selection,
20820 graphql_client,
20821 }
20822 }
20823}
20824impl WorkspaceGit {
20825 pub async fn id(&self) -> Result<Id, DaggerError> {
20827 let query = self.selection.select("id");
20828 query.execute(self.graphql_client.clone()).await
20829 }
20830 pub fn head(&self) -> GitRef {
20832 let query = self.selection.select("head");
20833 GitRef {
20834 proc: self.proc.clone(),
20835 selection: query,
20836 graphql_client: self.graphql_client.clone(),
20837 }
20838 }
20839 pub fn directory(&self) -> Directory {
20843 let query = self.selection.select("directory");
20844 Directory {
20845 proc: self.proc.clone(),
20846 selection: query,
20847 graphql_client: self.graphql_client.clone(),
20848 }
20849 }
20850 pub fn uncommitted(&self) -> Changeset {
20852 let query = self.selection.select("uncommitted");
20853 Changeset {
20854 proc: self.proc.clone(),
20855 selection: query,
20856 graphql_client: self.graphql_client.clone(),
20857 }
20858 }
20859}
20860impl Node for WorkspaceGit {
20861 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20862 let query = self.selection.select("id");
20863 let graphql_client = self.graphql_client.clone();
20864 async move { query.execute(graphql_client).await }
20865 }
20866}
20867#[derive(Clone)]
20868pub struct WorkspaceMigration {
20869 pub proc: Option<Arc<DaggerSessionProc>>,
20870 pub selection: Selection,
20871 pub graphql_client: DynGraphQLClient,
20872}
20873impl IntoID<Id> for WorkspaceMigration {
20874 fn into_id(
20875 self,
20876 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20877 Box::pin(async move { self.id().await })
20878 }
20879}
20880impl Loadable for WorkspaceMigration {
20881 fn graphql_type() -> &'static str {
20882 "WorkspaceMigration"
20883 }
20884 fn from_query(
20885 proc: Option<Arc<DaggerSessionProc>>,
20886 selection: Selection,
20887 graphql_client: DynGraphQLClient,
20888 ) -> Self {
20889 Self {
20890 proc,
20891 selection,
20892 graphql_client,
20893 }
20894 }
20895}
20896impl WorkspaceMigration {
20897 pub async fn id(&self) -> Result<Id, DaggerError> {
20899 let query = self.selection.select("id");
20900 query.execute(self.graphql_client.clone()).await
20901 }
20902 pub fn changes(&self) -> Changeset {
20904 let query = self.selection.select("changes");
20905 Changeset {
20906 proc: self.proc.clone(),
20907 selection: query,
20908 graphql_client: self.graphql_client.clone(),
20909 }
20910 }
20911 pub async fn steps(&self) -> Result<Vec<WorkspaceMigrationStep>, DaggerError> {
20913 let query = self.selection.select("steps");
20914 let query = query.select("id");
20915 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
20916 Ok(ids
20917 .into_iter()
20918 .map(|id| WorkspaceMigrationStep {
20919 proc: self.proc.clone(),
20920 selection: crate::querybuilder::query()
20921 .select("node")
20922 .arg("id", &id.0)
20923 .inline_fragment("WorkspaceMigrationStep"),
20924 graphql_client: self.graphql_client.clone(),
20925 })
20926 .collect())
20927 }
20928 pub async fn module_candidates(&self) -> Result<Vec<String>, DaggerError> {
20930 let query = self.selection.select("moduleCandidates");
20931 query.execute(self.graphql_client.clone()).await
20932 }
20933 pub async fn config_file(&self) -> Result<String, DaggerError> {
20935 let query = self.selection.select("configFile");
20936 query.execute(self.graphql_client.clone()).await
20937 }
20938}
20939impl Node for WorkspaceMigration {
20940 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
20941 let query = self.selection.select("id");
20942 let graphql_client = self.graphql_client.clone();
20943 async move { query.execute(graphql_client).await }
20944 }
20945}
20946#[derive(Clone)]
20947pub struct WorkspaceMigrationStep {
20948 pub proc: Option<Arc<DaggerSessionProc>>,
20949 pub selection: Selection,
20950 pub graphql_client: DynGraphQLClient,
20951}
20952impl IntoID<Id> for WorkspaceMigrationStep {
20953 fn into_id(
20954 self,
20955 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
20956 Box::pin(async move { self.id().await })
20957 }
20958}
20959impl Loadable for WorkspaceMigrationStep {
20960 fn graphql_type() -> &'static str {
20961 "WorkspaceMigrationStep"
20962 }
20963 fn from_query(
20964 proc: Option<Arc<DaggerSessionProc>>,
20965 selection: Selection,
20966 graphql_client: DynGraphQLClient,
20967 ) -> Self {
20968 Self {
20969 proc,
20970 selection,
20971 graphql_client,
20972 }
20973 }
20974}
20975impl WorkspaceMigrationStep {
20976 pub async fn id(&self) -> Result<Id, DaggerError> {
20978 let query = self.selection.select("id");
20979 query.execute(self.graphql_client.clone()).await
20980 }
20981 pub async fn code(&self) -> Result<String, DaggerError> {
20983 let query = self.selection.select("code");
20984 query.execute(self.graphql_client.clone()).await
20985 }
20986 pub async fn description(&self) -> Result<String, DaggerError> {
20988 let query = self.selection.select("description");
20989 query.execute(self.graphql_client.clone()).await
20990 }
20991 pub async fn warnings(&self) -> Result<Vec<String>, DaggerError> {
20993 let query = self.selection.select("warnings");
20994 query.execute(self.graphql_client.clone()).await
20995 }
20996 pub fn changes(&self) -> Changeset {
20998 let query = self.selection.select("changes");
20999 Changeset {
21000 proc: self.proc.clone(),
21001 selection: query,
21002 graphql_client: self.graphql_client.clone(),
21003 }
21004 }
21005}
21006impl Node for WorkspaceMigrationStep {
21007 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21008 let query = self.selection.select("id");
21009 let graphql_client = self.graphql_client.clone();
21010 async move { query.execute(graphql_client).await }
21011 }
21012}
21013#[derive(Clone)]
21014pub struct WorkspaceModule {
21015 pub proc: Option<Arc<DaggerSessionProc>>,
21016 pub selection: Selection,
21017 pub graphql_client: DynGraphQLClient,
21018}
21019impl IntoID<Id> for WorkspaceModule {
21020 fn into_id(
21021 self,
21022 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21023 Box::pin(async move { self.id().await })
21024 }
21025}
21026impl Loadable for WorkspaceModule {
21027 fn graphql_type() -> &'static str {
21028 "WorkspaceModule"
21029 }
21030 fn from_query(
21031 proc: Option<Arc<DaggerSessionProc>>,
21032 selection: Selection,
21033 graphql_client: DynGraphQLClient,
21034 ) -> Self {
21035 Self {
21036 proc,
21037 selection,
21038 graphql_client,
21039 }
21040 }
21041}
21042impl WorkspaceModule {
21043 pub async fn id(&self) -> Result<Id, DaggerError> {
21045 let query = self.selection.select("id");
21046 query.execute(self.graphql_client.clone()).await
21047 }
21048 pub async fn entrypoint(&self) -> Result<bool, DaggerError> {
21050 let query = self.selection.select("entrypoint");
21051 query.execute(self.graphql_client.clone()).await
21052 }
21053 pub async fn settings(&self) -> Result<Vec<WorkspaceModuleSetting>, DaggerError> {
21055 let query = self.selection.select("settings");
21056 let query = query.select("id");
21057 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21058 Ok(ids
21059 .into_iter()
21060 .map(|id| WorkspaceModuleSetting {
21061 proc: self.proc.clone(),
21062 selection: crate::querybuilder::query()
21063 .select("node")
21064 .arg("id", &id.0)
21065 .inline_fragment("WorkspaceModuleSetting"),
21066 graphql_client: self.graphql_client.clone(),
21067 })
21068 .collect())
21069 }
21070 pub async fn functions(&self) -> Result<Vec<String>, DaggerError> {
21072 let query = self.selection.select("functions");
21073 query.execute(self.graphql_client.clone()).await
21074 }
21075 pub async fn name(&self) -> Result<String, DaggerError> {
21077 let query = self.selection.select("name");
21078 query.execute(self.graphql_client.clone()).await
21079 }
21080 pub async fn main(&self) -> Result<bool, DaggerError> {
21082 let query = self.selection.select("main");
21083 query.execute(self.graphql_client.clone()).await
21084 }
21085 pub async fn source(&self) -> Result<String, DaggerError> {
21087 let query = self.selection.select("source");
21088 query.execute(self.graphql_client.clone()).await
21089 }
21090}
21091impl Node for WorkspaceModule {
21092 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21093 let query = self.selection.select("id");
21094 let graphql_client = self.graphql_client.clone();
21095 async move { query.execute(graphql_client).await }
21096 }
21097}
21098#[derive(Clone)]
21099pub struct WorkspaceModuleSetting {
21100 pub proc: Option<Arc<DaggerSessionProc>>,
21101 pub selection: Selection,
21102 pub graphql_client: DynGraphQLClient,
21103}
21104impl IntoID<Id> for WorkspaceModuleSetting {
21105 fn into_id(
21106 self,
21107 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21108 Box::pin(async move { self.id().await })
21109 }
21110}
21111impl Loadable for WorkspaceModuleSetting {
21112 fn graphql_type() -> &'static str {
21113 "WorkspaceModuleSetting"
21114 }
21115 fn from_query(
21116 proc: Option<Arc<DaggerSessionProc>>,
21117 selection: Selection,
21118 graphql_client: DynGraphQLClient,
21119 ) -> Self {
21120 Self {
21121 proc,
21122 selection,
21123 graphql_client,
21124 }
21125 }
21126}
21127impl WorkspaceModuleSetting {
21128 pub async fn id(&self) -> Result<Id, DaggerError> {
21130 let query = self.selection.select("id");
21131 query.execute(self.graphql_client.clone()).await
21132 }
21133 pub async fn key(&self) -> Result<String, DaggerError> {
21135 let query = self.selection.select("key");
21136 query.execute(self.graphql_client.clone()).await
21137 }
21138 pub async fn value(&self) -> Result<String, DaggerError> {
21140 let query = self.selection.select("value");
21141 query.execute(self.graphql_client.clone()).await
21142 }
21143 pub async fn description(&self) -> Result<String, DaggerError> {
21145 let query = self.selection.select("description");
21146 query.execute(self.graphql_client.clone()).await
21147 }
21148 pub async fn default_value(&self) -> Result<String, DaggerError> {
21150 let query = self.selection.select("defaultValue");
21151 query.execute(self.graphql_client.clone()).await
21152 }
21153 pub async fn is_string(&self) -> Result<bool, DaggerError> {
21155 let query = self.selection.select("isString");
21156 query.execute(self.graphql_client.clone()).await
21157 }
21158 pub async fn is_list(&self) -> Result<bool, DaggerError> {
21160 let query = self.selection.select("isList");
21161 query.execute(self.graphql_client.clone()).await
21162 }
21163 pub async fn is_object(&self) -> Result<bool, DaggerError> {
21165 let query = self.selection.select("isObject");
21166 query.execute(self.graphql_client.clone()).await
21167 }
21168}
21169impl Node for WorkspaceModuleSetting {
21170 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21171 let query = self.selection.select("id");
21172 let graphql_client = self.graphql_client.clone();
21173 async move { query.execute(graphql_client).await }
21174 }
21175}
21176#[derive(Clone)]
21177pub struct WorkspaceSdk {
21178 pub proc: Option<Arc<DaggerSessionProc>>,
21179 pub selection: Selection,
21180 pub graphql_client: DynGraphQLClient,
21181}
21182impl IntoID<Id> for WorkspaceSdk {
21183 fn into_id(
21184 self,
21185 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
21186 Box::pin(async move { self.id().await })
21187 }
21188}
21189impl Loadable for WorkspaceSdk {
21190 fn graphql_type() -> &'static str {
21191 "WorkspaceSDK"
21192 }
21193 fn from_query(
21194 proc: Option<Arc<DaggerSessionProc>>,
21195 selection: Selection,
21196 graphql_client: DynGraphQLClient,
21197 ) -> Self {
21198 Self {
21199 proc,
21200 selection,
21201 graphql_client,
21202 }
21203 }
21204}
21205impl WorkspaceSdk {
21206 pub async fn id(&self) -> Result<Id, DaggerError> {
21208 let query = self.selection.select("id");
21209 query.execute(self.graphql_client.clone()).await
21210 }
21211 pub fn generate(&self) -> Changeset {
21213 let query = self.selection.select("generate");
21214 Changeset {
21215 proc: self.proc.clone(),
21216 selection: query,
21217 graphql_client: self.graphql_client.clone(),
21218 }
21219 }
21220 pub async fn name(&self) -> Result<String, DaggerError> {
21222 let query = self.selection.select("name");
21223 query.execute(self.graphql_client.clone()).await
21224 }
21225 pub async fn r#ref(&self) -> Result<String, DaggerError> {
21227 let query = self.selection.select("ref");
21228 query.execute(self.graphql_client.clone()).await
21229 }
21230 pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
21232 let query = self.selection.select("modules");
21233 let query = query.select("id");
21234 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21235 Ok(ids
21236 .into_iter()
21237 .map(|id| WorkspaceModule {
21238 proc: self.proc.clone(),
21239 selection: crate::querybuilder::query()
21240 .select("node")
21241 .arg("id", &id.0)
21242 .inline_fragment("WorkspaceModule"),
21243 graphql_client: self.graphql_client.clone(),
21244 })
21245 .collect())
21246 }
21247 pub async fn clients(&self) -> Result<Vec<WorkspaceModule>, DaggerError> {
21249 let query = self.selection.select("clients");
21250 let query = query.select("id");
21251 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
21252 Ok(ids
21253 .into_iter()
21254 .map(|id| WorkspaceModule {
21255 proc: self.proc.clone(),
21256 selection: crate::querybuilder::query()
21257 .select("node")
21258 .arg("id", &id.0)
21259 .inline_fragment("WorkspaceModule"),
21260 graphql_client: self.graphql_client.clone(),
21261 })
21262 .collect())
21263 }
21264}
21265impl Node for WorkspaceSdk {
21266 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
21267 let query = self.selection.select("id");
21268 let graphql_client = self.graphql_client.clone();
21269 async move { query.execute(graphql_client).await }
21270 }
21271}
21272#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21273pub enum AcronymStyle {
21274 #[serde(rename = "CAPITALIZED")]
21275 Capitalized,
21276 #[serde(rename = "UPPERCASE")]
21277 Uppercase,
21278}
21279#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21280pub enum AgentMessageDelivery {
21281 #[serde(rename = "QUEUED")]
21282 Queued,
21283 #[serde(rename = "STARTED")]
21284 Started,
21285 #[serde(rename = "STEERED")]
21286 Steered,
21287}
21288#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21289pub enum AgentState {
21290 #[serde(rename = "FAILED")]
21291 Failed,
21292 #[serde(rename = "IDLE")]
21293 Idle,
21294 #[serde(rename = "PAUSED")]
21295 Paused,
21296 #[serde(rename = "RUNNING")]
21297 Running,
21298 #[serde(rename = "STOPPED")]
21299 Stopped,
21300 #[serde(rename = "WAITING_INPUT")]
21301 WaitingInput,
21302}
21303#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21304pub enum ArtifactDimensionKind {
21305 #[serde(rename = "COLLECTION")]
21306 Collection,
21307 #[serde(rename = "MODULE")]
21308 Module,
21309 #[serde(rename = "TYPE")]
21310 Type,
21311}
21312#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21313pub enum CacheSharingMode {
21314 #[serde(rename = "LOCKED")]
21315 Locked,
21316 #[serde(rename = "PRIVATE")]
21317 Private,
21318 #[serde(rename = "SHARED")]
21319 Shared,
21320}
21321#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21322pub enum Casing {
21323 #[serde(rename = "CAMEL")]
21324 Camel,
21325 #[serde(rename = "FLAT")]
21326 Flat,
21327 #[serde(rename = "KEBAB")]
21328 Kebab,
21329 #[serde(rename = "PASCAL")]
21330 Pascal,
21331 #[serde(rename = "SCREAMING_SNAKE")]
21332 ScreamingSnake,
21333 #[serde(rename = "SNAKE")]
21334 Snake,
21335}
21336#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21337pub enum ChangesetMergeConflict {
21338 #[serde(rename = "FAIL")]
21339 Fail,
21340 #[serde(rename = "FAIL_EARLY")]
21341 FailEarly,
21342 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21343 LeaveConflictMarkers,
21344 #[serde(rename = "PREFER_OURS")]
21345 PreferOurs,
21346 #[serde(rename = "PREFER_THEIRS")]
21347 PreferTheirs,
21348}
21349#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21350pub enum ChangesetsMergeConflict {
21351 #[serde(rename = "FAIL")]
21352 Fail,
21353 #[serde(rename = "FAIL_EARLY")]
21354 FailEarly,
21355}
21356#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21357pub enum DiffStatKind {
21358 #[serde(rename = "ADDED")]
21359 Added,
21360 #[serde(rename = "MODIFIED")]
21361 Modified,
21362 #[serde(rename = "REMOVED")]
21363 Removed,
21364 #[serde(rename = "RENAMED")]
21365 Renamed,
21366}
21367#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21368pub enum ExistsType {
21369 #[serde(rename = "DIRECTORY_TYPE")]
21370 DirectoryType,
21371 #[serde(rename = "REGULAR_TYPE")]
21372 RegularType,
21373 #[serde(rename = "SYMLINK_TYPE")]
21374 SymlinkType,
21375}
21376#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21377pub enum FileType {
21378 #[serde(rename = "DIRECTORY")]
21379 Directory,
21380 #[serde(rename = "DIRECTORY_TYPE")]
21381 DirectoryType,
21382 #[serde(rename = "REGULAR")]
21383 Regular,
21384 #[serde(rename = "REGULAR_TYPE")]
21385 RegularType,
21386 #[serde(rename = "SYMLINK")]
21387 Symlink,
21388 #[serde(rename = "SYMLINK_TYPE")]
21389 SymlinkType,
21390 #[serde(rename = "UNKNOWN")]
21391 Unknown,
21392}
21393#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21394pub enum FunctionCachePolicy {
21395 #[serde(rename = "Default")]
21396 Default,
21397 #[serde(rename = "Never")]
21398 Never,
21399 #[serde(rename = "PerSession")]
21400 PerSession,
21401}
21402#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21403pub enum GitPushDisposition {
21404 #[serde(rename = "CREATED")]
21405 Created,
21406 #[serde(rename = "FAST_FORWARD")]
21407 FastForward,
21408 #[serde(rename = "FORCED")]
21409 Forced,
21410 #[serde(rename = "UP_TO_DATE")]
21411 UpToDate,
21412}
21413#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21414pub enum IdentifierWordKind {
21415 #[serde(rename = "ACRONYM")]
21416 Acronym,
21417 #[serde(rename = "TERM")]
21418 Term,
21419 #[serde(rename = "WORD")]
21420 Word,
21421}
21422#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21423pub enum ImageLayerCompression {
21424 #[serde(rename = "EStarGZ")]
21425 EStarGz,
21426 #[serde(rename = "ESTARGZ")]
21427 Estargz,
21428 #[serde(rename = "Gzip")]
21429 Gzip,
21430 #[serde(rename = "Uncompressed")]
21431 Uncompressed,
21432 #[serde(rename = "Zstd")]
21433 Zstd,
21434}
21435#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21436pub enum ImageMediaTypes {
21437 #[serde(rename = "DOCKER")]
21438 Docker,
21439 #[serde(rename = "DockerMediaTypes")]
21440 DockerMediaTypes,
21441 #[serde(rename = "OCI")]
21442 Oci,
21443 #[serde(rename = "OCIMediaTypes")]
21444 OciMediaTypes,
21445}
21446#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21447pub enum LlmContentBlockKind {
21448 #[serde(rename = "AUDIO")]
21449 Audio,
21450 #[serde(rename = "DOCUMENT")]
21451 Document,
21452 #[serde(rename = "IMAGE")]
21453 Image,
21454 #[serde(rename = "TEXT")]
21455 Text,
21456 #[serde(rename = "THINKING")]
21457 Thinking,
21458 #[serde(rename = "TOOL_CALL")]
21459 ToolCall,
21460 #[serde(rename = "TOOL_RESULT")]
21461 ToolResult,
21462}
21463#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21464pub enum LlmMessageOriginKind {
21465 #[serde(rename = "AGENT")]
21466 Agent,
21467 #[serde(rename = "EVENT")]
21468 Event,
21469 #[serde(rename = "USER")]
21470 User,
21471}
21472#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21473pub enum LlmMessageRole {
21474 #[serde(rename = "ASSISTANT")]
21475 Assistant,
21476 #[serde(rename = "SYSTEM")]
21477 System,
21478 #[serde(rename = "USER")]
21479 User,
21480}
21481#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21482pub enum ModuleSourceExperimentalFeature {
21483 #[serde(rename = "SELF_CALLS")]
21484 SelfCalls,
21485}
21486#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21487pub enum ModuleSourceKind {
21488 #[serde(rename = "DIR")]
21489 Dir,
21490 #[serde(rename = "DIR_SOURCE")]
21491 DirSource,
21492 #[serde(rename = "GIT")]
21493 Git,
21494 #[serde(rename = "GIT_SOURCE")]
21495 GitSource,
21496 #[serde(rename = "LOCAL")]
21497 Local,
21498 #[serde(rename = "LOCAL_SOURCE")]
21499 LocalSource,
21500}
21501#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21502pub enum NetworkProtocol {
21503 #[serde(rename = "TCP")]
21504 Tcp,
21505 #[serde(rename = "UDP")]
21506 Udp,
21507}
21508#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21509pub enum PatchConflict {
21510 #[serde(rename = "FAIL")]
21511 Fail,
21512 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
21513 LeaveConflictMarkers,
21514}
21515#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21516pub enum RegistryProtocol {
21517 #[serde(rename = "HTTP")]
21518 Http,
21519 #[serde(rename = "HTTPS")]
21520 Https,
21521}
21522#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21523pub enum ReturnType {
21524 #[serde(rename = "ANY")]
21525 Any,
21526 #[serde(rename = "FAILURE")]
21527 Failure,
21528 #[serde(rename = "SUCCESS")]
21529 Success,
21530}
21531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21532pub enum TypeDefKind {
21533 #[serde(rename = "BOOLEAN")]
21534 Boolean,
21535 #[serde(rename = "BOOLEAN_KIND")]
21536 BooleanKind,
21537 #[serde(rename = "ENUM")]
21538 Enum,
21539 #[serde(rename = "ENUM_KIND")]
21540 EnumKind,
21541 #[serde(rename = "FLOAT")]
21542 Float,
21543 #[serde(rename = "FLOAT_KIND")]
21544 FloatKind,
21545 #[serde(rename = "INPUT")]
21546 Input,
21547 #[serde(rename = "INPUT_KIND")]
21548 InputKind,
21549 #[serde(rename = "INTEGER")]
21550 Integer,
21551 #[serde(rename = "INTEGER_KIND")]
21552 IntegerKind,
21553 #[serde(rename = "INTERFACE")]
21554 Interface,
21555 #[serde(rename = "INTERFACE_KIND")]
21556 InterfaceKind,
21557 #[serde(rename = "LIST")]
21558 List,
21559 #[serde(rename = "LIST_KIND")]
21560 ListKind,
21561 #[serde(rename = "OBJECT")]
21562 Object,
21563 #[serde(rename = "OBJECT_KIND")]
21564 ObjectKind,
21565 #[serde(rename = "SCALAR")]
21566 Scalar,
21567 #[serde(rename = "SCALAR_KIND")]
21568 ScalarKind,
21569 #[serde(rename = "STRING")]
21570 String,
21571 #[serde(rename = "STRING_KIND")]
21572 StringKind,
21573 #[serde(rename = "VOID")]
21574 Void,
21575 #[serde(rename = "VOID_KIND")]
21576 VoidKind,
21577}
21578#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21579pub enum WorkspaceCommitPickReason {
21580 #[serde(rename = "CONTENT")]
21581 Content,
21582 #[serde(rename = "DIRTY")]
21583 Dirty,
21584 #[serde(rename = "NONE")]
21585 None,
21586}
21587#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
21588pub enum WorkspaceCommitPickStatus {
21589 #[serde(rename = "CONFLICT")]
21590 Conflict,
21591 #[serde(rename = "PICKABLE")]
21592 Pickable,
21593 #[serde(rename = "PICKED")]
21594 Picked,
21595 #[serde(rename = "REDUNDANT")]
21596 Redundant,
21597}