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
13pub type AddressId = Id;
14pub type BindingId = Id;
15pub type CacheVolumeId = Id;
16pub type ChangesetId = Id;
17pub type CheckGroupId = Id;
18pub type CheckId = Id;
19pub type ClientFilesyncMirrorId = Id;
20pub type CloudId = Id;
21pub type ContainerId = Id;
22pub type CurrentModuleId = Id;
23pub type DiffStatId = Id;
24pub type DirectoryId = Id;
25pub type EngineCacheEntryId = Id;
26pub type EngineCacheEntrySetId = Id;
27pub type EngineCacheId = Id;
28pub type EngineId = Id;
29pub type EnumTypeDefId = Id;
30pub type EnumValueTypeDefId = Id;
31pub type EnvFileId = Id;
32pub type EnvId = Id;
33pub type EnvVariableId = Id;
34pub type ErrorId = Id;
35pub type ErrorValueId = Id;
36pub type ExportableId = Id;
37pub type FieldTypeDefId = Id;
38pub type FileId = Id;
39pub type FunctionArgId = Id;
40pub type FunctionCallArgValueId = Id;
41pub type FunctionCallId = Id;
42pub type FunctionId = Id;
43pub type GeneratedCodeId = Id;
44pub type GeneratorGroupId = Id;
45pub type GeneratorId = Id;
46pub type GitRefId = Id;
47pub type GitRepositoryId = Id;
48pub type HttpStateId = Id;
49pub type HealthcheckConfigId = Id;
50pub type HostId = Id;
51#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
52pub struct Id(pub String);
53impl From<&str> for Id {
54 fn from(value: &str) -> Self {
55 Self(value.to_string())
56 }
57}
58impl From<String> for Id {
59 fn from(value: String) -> Self {
60 Self(value)
61 }
62}
63impl IntoID<Id> for Id {
64 fn into_id(
65 self,
66 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
67 Box::pin(async move { Ok::<Id, DaggerError>(self) })
68 }
69}
70impl Id {
71 fn quote(&self) -> String {
72 format!("\"{}\"", self.0.clone())
73 }
74}
75pub type InputTypeDefId = Id;
76pub type InterfaceTypeDefId = Id;
77#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
78pub struct Json(pub String);
79impl From<&str> for Json {
80 fn from(value: &str) -> Self {
81 Self(value.to_string())
82 }
83}
84impl From<String> for Json {
85 fn from(value: String) -> Self {
86 Self(value)
87 }
88}
89impl Json {
90 fn quote(&self) -> String {
91 format!("\"{}\"", self.0.clone())
92 }
93}
94pub type JsonValueId = Id;
95pub type Llmid = Id;
96pub type LlmTokenUsageId = Id;
97pub type LabelId = Id;
98pub type ListTypeDefId = Id;
99pub type ModuleConfigClientId = Id;
100pub type ModuleId = Id;
101pub type ModuleSourceId = Id;
102pub type ObjectTypeDefId = Id;
103#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
104pub struct Platform(pub String);
105impl From<&str> for Platform {
106 fn from(value: &str) -> Self {
107 Self(value.to_string())
108 }
109}
110impl From<String> for Platform {
111 fn from(value: String) -> Self {
112 Self(value)
113 }
114}
115impl Platform {
116 fn quote(&self) -> String {
117 format!("\"{}\"", self.0.clone())
118 }
119}
120pub type PortId = Id;
121pub type RemoteGitMirrorId = Id;
122pub type SdkConfigId = Id;
123pub type ScalarTypeDefId = Id;
124pub type SearchResultId = Id;
125pub type SearchSubmatchId = Id;
126pub type SecretId = Id;
127pub type ServiceId = Id;
128pub type SocketId = Id;
129pub type SourceMapId = Id;
130pub type StatId = Id;
131pub type SyncerId = Id;
132pub type TerminalId = Id;
133pub type TypeDefId = Id;
134pub type UpGroupId = Id;
135pub type UpId = Id;
136#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
137pub struct Void(pub String);
138impl From<&str> for Void {
139 fn from(value: &str) -> Self {
140 Self(value.to_string())
141 }
142}
143impl From<String> for Void {
144 fn from(value: String) -> Self {
145 Self(value)
146 }
147}
148impl Void {
149 fn quote(&self) -> String {
150 format!("\"{}\"", self.0.clone())
151 }
152}
153pub type WorkspaceId = Id;
154#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
155pub struct BuildArg {
156 pub name: String,
157 pub value: String,
158}
159#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
160pub struct PipelineLabel {
161 pub name: String,
162 pub value: String,
163}
164#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
165pub struct PortForward {
166 pub backend: isize,
167 pub frontend: isize,
168 pub protocol: NetworkProtocol,
169}
170pub trait Exportable {
173 fn export(
174 &self,
175 path: impl Into<String>,
176 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
177 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
178}
179#[derive(Clone)]
180pub struct ExportableClient {
181 pub proc: Option<Arc<DaggerSessionProc>>,
182 pub selection: Selection,
183 pub graphql_client: DynGraphQLClient,
184}
185impl IntoID<Id> for ExportableClient {
186 fn into_id(
187 self,
188 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
189 Box::pin(async move { self.id().await })
190 }
191}
192impl ExportableClient {
193 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
194 let mut query = self.selection.select("export");
195 query = query.arg("path", path.into());
196 query.execute(self.graphql_client.clone()).await
197 }
198 pub async fn id(&self) -> Result<Id, DaggerError> {
199 let query = self.selection.select("id");
200 query.execute(self.graphql_client.clone()).await
201 }
202}
203impl Loadable for ExportableClient {
204 fn graphql_type() -> &'static str {
205 "Exportable"
206 }
207 fn from_query(
208 proc: Option<Arc<DaggerSessionProc>>,
209 selection: Selection,
210 graphql_client: DynGraphQLClient,
211 ) -> Self {
212 Self {
213 proc,
214 selection,
215 graphql_client,
216 }
217 }
218}
219impl Exportable for ExportableClient {
220 fn export(
221 &self,
222 path: impl Into<String>,
223 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
224 let mut query = self.selection.select("export");
225 query = query.arg("path", path.into());
226 let graphql_client = self.graphql_client.clone();
227 async move { query.execute(graphql_client).await }
228 }
229 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
230 let query = self.selection.select("id");
231 let graphql_client = self.graphql_client.clone();
232 async move { query.execute(graphql_client).await }
233 }
234}
235pub trait Node {
237 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
238}
239#[derive(Clone)]
240pub struct NodeClient {
241 pub proc: Option<Arc<DaggerSessionProc>>,
242 pub selection: Selection,
243 pub graphql_client: DynGraphQLClient,
244}
245impl IntoID<Id> for NodeClient {
246 fn into_id(
247 self,
248 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
249 Box::pin(async move { self.id().await })
250 }
251}
252impl NodeClient {
253 pub async fn id(&self) -> Result<Id, DaggerError> {
254 let query = self.selection.select("id");
255 query.execute(self.graphql_client.clone()).await
256 }
257}
258impl Loadable for NodeClient {
259 fn graphql_type() -> &'static str {
260 "Node"
261 }
262 fn from_query(
263 proc: Option<Arc<DaggerSessionProc>>,
264 selection: Selection,
265 graphql_client: DynGraphQLClient,
266 ) -> Self {
267 Self {
268 proc,
269 selection,
270 graphql_client,
271 }
272 }
273}
274impl Node for NodeClient {
275 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
276 let query = self.selection.select("id");
277 let graphql_client = self.graphql_client.clone();
278 async move { query.execute(graphql_client).await }
279 }
280}
281pub trait Syncer {
284 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
285 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
286}
287#[derive(Clone)]
288pub struct SyncerClient {
289 pub proc: Option<Arc<DaggerSessionProc>>,
290 pub selection: Selection,
291 pub graphql_client: DynGraphQLClient,
292}
293impl IntoID<Id> for SyncerClient {
294 fn into_id(
295 self,
296 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
297 Box::pin(async move { self.id().await })
298 }
299}
300impl SyncerClient {
301 pub async fn id(&self) -> Result<Id, DaggerError> {
302 let query = self.selection.select("id");
303 query.execute(self.graphql_client.clone()).await
304 }
305 pub async fn sync(&self) -> Result<Id, DaggerError> {
306 let query = self.selection.select("sync");
307 query.execute(self.graphql_client.clone()).await
308 }
309}
310impl Loadable for SyncerClient {
311 fn graphql_type() -> &'static str {
312 "Syncer"
313 }
314 fn from_query(
315 proc: Option<Arc<DaggerSessionProc>>,
316 selection: Selection,
317 graphql_client: DynGraphQLClient,
318 ) -> Self {
319 Self {
320 proc,
321 selection,
322 graphql_client,
323 }
324 }
325}
326impl Syncer for SyncerClient {
327 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
328 let query = self.selection.select("id");
329 let graphql_client = self.graphql_client.clone();
330 async move { query.execute(graphql_client).await }
331 }
332 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
333 let query = self.selection.select("sync");
334 let graphql_client = self.graphql_client.clone();
335 async move { query.execute(graphql_client).await }
336 }
337}
338#[derive(Clone)]
339pub struct Address {
340 pub proc: Option<Arc<DaggerSessionProc>>,
341 pub selection: Selection,
342 pub graphql_client: DynGraphQLClient,
343}
344#[derive(Builder, Debug, PartialEq)]
345pub struct AddressDirectoryOpts<'a> {
346 #[builder(setter(into, strip_option), default)]
347 pub exclude: Option<Vec<&'a str>>,
348 #[builder(setter(into, strip_option), default)]
349 pub gitignore: Option<bool>,
350 #[builder(setter(into, strip_option), default)]
351 pub include: Option<Vec<&'a str>>,
352 #[builder(setter(into, strip_option), default)]
353 pub no_cache: Option<bool>,
354}
355#[derive(Builder, Debug, PartialEq)]
356pub struct AddressFileOpts<'a> {
357 #[builder(setter(into, strip_option), default)]
358 pub exclude: Option<Vec<&'a str>>,
359 #[builder(setter(into, strip_option), default)]
360 pub gitignore: Option<bool>,
361 #[builder(setter(into, strip_option), default)]
362 pub include: Option<Vec<&'a str>>,
363 #[builder(setter(into, strip_option), default)]
364 pub no_cache: Option<bool>,
365}
366impl IntoID<Id> for Address {
367 fn into_id(
368 self,
369 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
370 Box::pin(async move { self.id().await })
371 }
372}
373impl Loadable for Address {
374 fn graphql_type() -> &'static str {
375 "Address"
376 }
377 fn from_query(
378 proc: Option<Arc<DaggerSessionProc>>,
379 selection: Selection,
380 graphql_client: DynGraphQLClient,
381 ) -> Self {
382 Self {
383 proc,
384 selection,
385 graphql_client,
386 }
387 }
388}
389impl Address {
390 pub fn container(&self) -> Container {
392 let query = self.selection.select("container");
393 Container {
394 proc: self.proc.clone(),
395 selection: query,
396 graphql_client: self.graphql_client.clone(),
397 }
398 }
399 pub fn directory(&self) -> Directory {
405 let query = self.selection.select("directory");
406 Directory {
407 proc: self.proc.clone(),
408 selection: query,
409 graphql_client: self.graphql_client.clone(),
410 }
411 }
412 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
418 let mut query = self.selection.select("directory");
419 if let Some(exclude) = opts.exclude {
420 query = query.arg("exclude", exclude);
421 }
422 if let Some(include) = opts.include {
423 query = query.arg("include", include);
424 }
425 if let Some(gitignore) = opts.gitignore {
426 query = query.arg("gitignore", gitignore);
427 }
428 if let Some(no_cache) = opts.no_cache {
429 query = query.arg("noCache", no_cache);
430 }
431 Directory {
432 proc: self.proc.clone(),
433 selection: query,
434 graphql_client: self.graphql_client.clone(),
435 }
436 }
437 pub fn file(&self) -> File {
443 let query = self.selection.select("file");
444 File {
445 proc: self.proc.clone(),
446 selection: query,
447 graphql_client: self.graphql_client.clone(),
448 }
449 }
450 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
456 let mut query = self.selection.select("file");
457 if let Some(exclude) = opts.exclude {
458 query = query.arg("exclude", exclude);
459 }
460 if let Some(include) = opts.include {
461 query = query.arg("include", include);
462 }
463 if let Some(gitignore) = opts.gitignore {
464 query = query.arg("gitignore", gitignore);
465 }
466 if let Some(no_cache) = opts.no_cache {
467 query = query.arg("noCache", no_cache);
468 }
469 File {
470 proc: self.proc.clone(),
471 selection: query,
472 graphql_client: self.graphql_client.clone(),
473 }
474 }
475 pub fn git_ref(&self) -> GitRef {
477 let query = self.selection.select("gitRef");
478 GitRef {
479 proc: self.proc.clone(),
480 selection: query,
481 graphql_client: self.graphql_client.clone(),
482 }
483 }
484 pub fn git_repository(&self) -> GitRepository {
486 let query = self.selection.select("gitRepository");
487 GitRepository {
488 proc: self.proc.clone(),
489 selection: query,
490 graphql_client: self.graphql_client.clone(),
491 }
492 }
493 pub async fn id(&self) -> Result<Id, DaggerError> {
495 let query = self.selection.select("id");
496 query.execute(self.graphql_client.clone()).await
497 }
498 pub fn secret(&self) -> Secret {
500 let query = self.selection.select("secret");
501 Secret {
502 proc: self.proc.clone(),
503 selection: query,
504 graphql_client: self.graphql_client.clone(),
505 }
506 }
507 pub fn service(&self) -> Service {
509 let query = self.selection.select("service");
510 Service {
511 proc: self.proc.clone(),
512 selection: query,
513 graphql_client: self.graphql_client.clone(),
514 }
515 }
516 pub fn socket(&self) -> Socket {
518 let query = self.selection.select("socket");
519 Socket {
520 proc: self.proc.clone(),
521 selection: query,
522 graphql_client: self.graphql_client.clone(),
523 }
524 }
525 pub async fn value(&self) -> Result<String, DaggerError> {
527 let query = self.selection.select("value");
528 query.execute(self.graphql_client.clone()).await
529 }
530}
531impl Node for Address {
532 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
533 let query = self.selection.select("id");
534 let graphql_client = self.graphql_client.clone();
535 async move { query.execute(graphql_client).await }
536 }
537}
538#[derive(Clone)]
539pub struct Binding {
540 pub proc: Option<Arc<DaggerSessionProc>>,
541 pub selection: Selection,
542 pub graphql_client: DynGraphQLClient,
543}
544impl IntoID<Id> for Binding {
545 fn into_id(
546 self,
547 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
548 Box::pin(async move { self.id().await })
549 }
550}
551impl Loadable for Binding {
552 fn graphql_type() -> &'static str {
553 "Binding"
554 }
555 fn from_query(
556 proc: Option<Arc<DaggerSessionProc>>,
557 selection: Selection,
558 graphql_client: DynGraphQLClient,
559 ) -> Self {
560 Self {
561 proc,
562 selection,
563 graphql_client,
564 }
565 }
566}
567impl Binding {
568 pub fn as_address(&self) -> Address {
570 let query = self.selection.select("asAddress");
571 Address {
572 proc: self.proc.clone(),
573 selection: query,
574 graphql_client: self.graphql_client.clone(),
575 }
576 }
577 pub fn as_cache_volume(&self) -> CacheVolume {
579 let query = self.selection.select("asCacheVolume");
580 CacheVolume {
581 proc: self.proc.clone(),
582 selection: query,
583 graphql_client: self.graphql_client.clone(),
584 }
585 }
586 pub fn as_changeset(&self) -> Changeset {
588 let query = self.selection.select("asChangeset");
589 Changeset {
590 proc: self.proc.clone(),
591 selection: query,
592 graphql_client: self.graphql_client.clone(),
593 }
594 }
595 pub fn as_check(&self) -> Check {
597 let query = self.selection.select("asCheck");
598 Check {
599 proc: self.proc.clone(),
600 selection: query,
601 graphql_client: self.graphql_client.clone(),
602 }
603 }
604 pub fn as_check_group(&self) -> CheckGroup {
606 let query = self.selection.select("asCheckGroup");
607 CheckGroup {
608 proc: self.proc.clone(),
609 selection: query,
610 graphql_client: self.graphql_client.clone(),
611 }
612 }
613 pub fn as_cloud(&self) -> Cloud {
615 let query = self.selection.select("asCloud");
616 Cloud {
617 proc: self.proc.clone(),
618 selection: query,
619 graphql_client: self.graphql_client.clone(),
620 }
621 }
622 pub fn as_container(&self) -> Container {
624 let query = self.selection.select("asContainer");
625 Container {
626 proc: self.proc.clone(),
627 selection: query,
628 graphql_client: self.graphql_client.clone(),
629 }
630 }
631 pub fn as_diff_stat(&self) -> DiffStat {
633 let query = self.selection.select("asDiffStat");
634 DiffStat {
635 proc: self.proc.clone(),
636 selection: query,
637 graphql_client: self.graphql_client.clone(),
638 }
639 }
640 pub fn as_directory(&self) -> Directory {
642 let query = self.selection.select("asDirectory");
643 Directory {
644 proc: self.proc.clone(),
645 selection: query,
646 graphql_client: self.graphql_client.clone(),
647 }
648 }
649 pub fn as_env(&self) -> Env {
651 let query = self.selection.select("asEnv");
652 Env {
653 proc: self.proc.clone(),
654 selection: query,
655 graphql_client: self.graphql_client.clone(),
656 }
657 }
658 pub fn as_env_file(&self) -> EnvFile {
660 let query = self.selection.select("asEnvFile");
661 EnvFile {
662 proc: self.proc.clone(),
663 selection: query,
664 graphql_client: self.graphql_client.clone(),
665 }
666 }
667 pub fn as_file(&self) -> File {
669 let query = self.selection.select("asFile");
670 File {
671 proc: self.proc.clone(),
672 selection: query,
673 graphql_client: self.graphql_client.clone(),
674 }
675 }
676 pub fn as_generator(&self) -> Generator {
678 let query = self.selection.select("asGenerator");
679 Generator {
680 proc: self.proc.clone(),
681 selection: query,
682 graphql_client: self.graphql_client.clone(),
683 }
684 }
685 pub fn as_generator_group(&self) -> GeneratorGroup {
687 let query = self.selection.select("asGeneratorGroup");
688 GeneratorGroup {
689 proc: self.proc.clone(),
690 selection: query,
691 graphql_client: self.graphql_client.clone(),
692 }
693 }
694 pub fn as_git_ref(&self) -> GitRef {
696 let query = self.selection.select("asGitRef");
697 GitRef {
698 proc: self.proc.clone(),
699 selection: query,
700 graphql_client: self.graphql_client.clone(),
701 }
702 }
703 pub fn as_git_repository(&self) -> GitRepository {
705 let query = self.selection.select("asGitRepository");
706 GitRepository {
707 proc: self.proc.clone(),
708 selection: query,
709 graphql_client: self.graphql_client.clone(),
710 }
711 }
712 pub fn as_http_state(&self) -> HttpState {
714 let query = self.selection.select("asHTTPState");
715 HttpState {
716 proc: self.proc.clone(),
717 selection: query,
718 graphql_client: self.graphql_client.clone(),
719 }
720 }
721 pub fn as_json_value(&self) -> JsonValue {
723 let query = self.selection.select("asJSONValue");
724 JsonValue {
725 proc: self.proc.clone(),
726 selection: query,
727 graphql_client: self.graphql_client.clone(),
728 }
729 }
730 pub fn as_module(&self) -> Module {
732 let query = self.selection.select("asModule");
733 Module {
734 proc: self.proc.clone(),
735 selection: query,
736 graphql_client: self.graphql_client.clone(),
737 }
738 }
739 pub fn as_module_config_client(&self) -> ModuleConfigClient {
741 let query = self.selection.select("asModuleConfigClient");
742 ModuleConfigClient {
743 proc: self.proc.clone(),
744 selection: query,
745 graphql_client: self.graphql_client.clone(),
746 }
747 }
748 pub fn as_module_source(&self) -> ModuleSource {
750 let query = self.selection.select("asModuleSource");
751 ModuleSource {
752 proc: self.proc.clone(),
753 selection: query,
754 graphql_client: self.graphql_client.clone(),
755 }
756 }
757 pub fn as_search_result(&self) -> SearchResult {
759 let query = self.selection.select("asSearchResult");
760 SearchResult {
761 proc: self.proc.clone(),
762 selection: query,
763 graphql_client: self.graphql_client.clone(),
764 }
765 }
766 pub fn as_search_submatch(&self) -> SearchSubmatch {
768 let query = self.selection.select("asSearchSubmatch");
769 SearchSubmatch {
770 proc: self.proc.clone(),
771 selection: query,
772 graphql_client: self.graphql_client.clone(),
773 }
774 }
775 pub fn as_secret(&self) -> Secret {
777 let query = self.selection.select("asSecret");
778 Secret {
779 proc: self.proc.clone(),
780 selection: query,
781 graphql_client: self.graphql_client.clone(),
782 }
783 }
784 pub fn as_service(&self) -> Service {
786 let query = self.selection.select("asService");
787 Service {
788 proc: self.proc.clone(),
789 selection: query,
790 graphql_client: self.graphql_client.clone(),
791 }
792 }
793 pub fn as_socket(&self) -> Socket {
795 let query = self.selection.select("asSocket");
796 Socket {
797 proc: self.proc.clone(),
798 selection: query,
799 graphql_client: self.graphql_client.clone(),
800 }
801 }
802 pub fn as_stat(&self) -> Stat {
804 let query = self.selection.select("asStat");
805 Stat {
806 proc: self.proc.clone(),
807 selection: query,
808 graphql_client: self.graphql_client.clone(),
809 }
810 }
811 pub async fn as_string(&self) -> Result<String, DaggerError> {
813 let query = self.selection.select("asString");
814 query.execute(self.graphql_client.clone()).await
815 }
816 pub fn as_up(&self) -> Up {
818 let query = self.selection.select("asUp");
819 Up {
820 proc: self.proc.clone(),
821 selection: query,
822 graphql_client: self.graphql_client.clone(),
823 }
824 }
825 pub fn as_up_group(&self) -> UpGroup {
827 let query = self.selection.select("asUpGroup");
828 UpGroup {
829 proc: self.proc.clone(),
830 selection: query,
831 graphql_client: self.graphql_client.clone(),
832 }
833 }
834 pub fn as_workspace(&self) -> Workspace {
836 let query = self.selection.select("asWorkspace");
837 Workspace {
838 proc: self.proc.clone(),
839 selection: query,
840 graphql_client: self.graphql_client.clone(),
841 }
842 }
843 pub async fn digest(&self) -> Result<String, DaggerError> {
845 let query = self.selection.select("digest");
846 query.execute(self.graphql_client.clone()).await
847 }
848 pub async fn id(&self) -> Result<Id, DaggerError> {
850 let query = self.selection.select("id");
851 query.execute(self.graphql_client.clone()).await
852 }
853 pub async fn is_null(&self) -> Result<bool, DaggerError> {
855 let query = self.selection.select("isNull");
856 query.execute(self.graphql_client.clone()).await
857 }
858 pub async fn name(&self) -> Result<String, DaggerError> {
860 let query = self.selection.select("name");
861 query.execute(self.graphql_client.clone()).await
862 }
863 pub async fn type_name(&self) -> Result<String, DaggerError> {
865 let query = self.selection.select("typeName");
866 query.execute(self.graphql_client.clone()).await
867 }
868}
869impl Node for Binding {
870 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
871 let query = self.selection.select("id");
872 let graphql_client = self.graphql_client.clone();
873 async move { query.execute(graphql_client).await }
874 }
875}
876#[derive(Clone)]
877pub struct CacheVolume {
878 pub proc: Option<Arc<DaggerSessionProc>>,
879 pub selection: Selection,
880 pub graphql_client: DynGraphQLClient,
881}
882impl IntoID<Id> for CacheVolume {
883 fn into_id(
884 self,
885 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
886 Box::pin(async move { self.id().await })
887 }
888}
889impl Loadable for CacheVolume {
890 fn graphql_type() -> &'static str {
891 "CacheVolume"
892 }
893 fn from_query(
894 proc: Option<Arc<DaggerSessionProc>>,
895 selection: Selection,
896 graphql_client: DynGraphQLClient,
897 ) -> Self {
898 Self {
899 proc,
900 selection,
901 graphql_client,
902 }
903 }
904}
905impl CacheVolume {
906 pub async fn id(&self) -> Result<Id, DaggerError> {
908 let query = self.selection.select("id");
909 query.execute(self.graphql_client.clone()).await
910 }
911}
912impl Node for CacheVolume {
913 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
914 let query = self.selection.select("id");
915 let graphql_client = self.graphql_client.clone();
916 async move { query.execute(graphql_client).await }
917 }
918}
919#[derive(Clone)]
920pub struct Changeset {
921 pub proc: Option<Arc<DaggerSessionProc>>,
922 pub selection: Selection,
923 pub graphql_client: DynGraphQLClient,
924}
925#[derive(Builder, Debug, PartialEq)]
926pub struct ChangesetWithChangesetOpts {
927 #[builder(setter(into, strip_option), default)]
929 pub on_conflict: Option<ChangesetMergeConflict>,
930}
931#[derive(Builder, Debug, PartialEq)]
932pub struct ChangesetWithChangesetsOpts {
933 #[builder(setter(into, strip_option), default)]
935 pub on_conflict: Option<ChangesetsMergeConflict>,
936}
937impl IntoID<Id> for Changeset {
938 fn into_id(
939 self,
940 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
941 Box::pin(async move { self.id().await })
942 }
943}
944impl Loadable for Changeset {
945 fn graphql_type() -> &'static str {
946 "Changeset"
947 }
948 fn from_query(
949 proc: Option<Arc<DaggerSessionProc>>,
950 selection: Selection,
951 graphql_client: DynGraphQLClient,
952 ) -> Self {
953 Self {
954 proc,
955 selection,
956 graphql_client,
957 }
958 }
959}
960impl Changeset {
961 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
963 let query = self.selection.select("addedPaths");
964 query.execute(self.graphql_client.clone()).await
965 }
966 pub fn after(&self) -> Directory {
968 let query = self.selection.select("after");
969 Directory {
970 proc: self.proc.clone(),
971 selection: query,
972 graphql_client: self.graphql_client.clone(),
973 }
974 }
975 pub fn as_patch(&self) -> File {
977 let query = self.selection.select("asPatch");
978 File {
979 proc: self.proc.clone(),
980 selection: query,
981 graphql_client: self.graphql_client.clone(),
982 }
983 }
984 pub fn before(&self) -> Directory {
986 let query = self.selection.select("before");
987 Directory {
988 proc: self.proc.clone(),
989 selection: query,
990 graphql_client: self.graphql_client.clone(),
991 }
992 }
993 pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
995 let query = self.selection.select("diffStats");
996 let query = query.select("id");
997 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
998 Ok(ids
999 .into_iter()
1000 .map(|id| DiffStat {
1001 proc: self.proc.clone(),
1002 selection: crate::querybuilder::query()
1003 .select("node")
1004 .arg("id", &id.0)
1005 .inline_fragment("DiffStat"),
1006 graphql_client: self.graphql_client.clone(),
1007 })
1008 .collect())
1009 }
1010 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
1016 let mut query = self.selection.select("export");
1017 query = query.arg("path", path.into());
1018 query.execute(self.graphql_client.clone()).await
1019 }
1020 pub async fn id(&self) -> Result<Id, DaggerError> {
1022 let query = self.selection.select("id");
1023 query.execute(self.graphql_client.clone()).await
1024 }
1025 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
1027 let query = self.selection.select("isEmpty");
1028 query.execute(self.graphql_client.clone()).await
1029 }
1030 pub fn layer(&self) -> Directory {
1032 let query = self.selection.select("layer");
1033 Directory {
1034 proc: self.proc.clone(),
1035 selection: query,
1036 graphql_client: self.graphql_client.clone(),
1037 }
1038 }
1039 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
1041 let query = self.selection.select("modifiedPaths");
1042 query.execute(self.graphql_client.clone()).await
1043 }
1044 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
1046 let query = self.selection.select("removedPaths");
1047 query.execute(self.graphql_client.clone()).await
1048 }
1049 pub async fn sync(&self) -> Result<Changeset, DaggerError> {
1051 let query = self.selection.select("sync");
1052 let id: Id = query.execute(self.graphql_client.clone()).await?;
1053 Ok(Changeset {
1054 proc: self.proc.clone(),
1055 selection: query
1056 .root()
1057 .select("node")
1058 .arg("id", &id.0)
1059 .inline_fragment("Changeset"),
1060 graphql_client: self.graphql_client.clone(),
1061 })
1062 }
1063 pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
1071 let mut query = self.selection.select("withChangeset");
1072 query = query.arg_lazy(
1073 "changes",
1074 Box::new(move || {
1075 let changes = changes.clone();
1076 Box::pin(async move { changes.into_id().await.unwrap().quote() })
1077 }),
1078 );
1079 Changeset {
1080 proc: self.proc.clone(),
1081 selection: query,
1082 graphql_client: self.graphql_client.clone(),
1083 }
1084 }
1085 pub fn with_changeset_opts(
1093 &self,
1094 changes: impl IntoID<Id>,
1095 opts: ChangesetWithChangesetOpts,
1096 ) -> Changeset {
1097 let mut query = self.selection.select("withChangeset");
1098 query = query.arg_lazy(
1099 "changes",
1100 Box::new(move || {
1101 let changes = changes.clone();
1102 Box::pin(async move { changes.into_id().await.unwrap().quote() })
1103 }),
1104 );
1105 if let Some(on_conflict) = opts.on_conflict {
1106 query = query.arg("onConflict", on_conflict);
1107 }
1108 Changeset {
1109 proc: self.proc.clone(),
1110 selection: query,
1111 graphql_client: self.graphql_client.clone(),
1112 }
1113 }
1114 pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
1123 let mut query = self.selection.select("withChangesets");
1124 query = query.arg("changes", changes);
1125 Changeset {
1126 proc: self.proc.clone(),
1127 selection: query,
1128 graphql_client: self.graphql_client.clone(),
1129 }
1130 }
1131 pub fn with_changesets_opts(
1140 &self,
1141 changes: Vec<Id>,
1142 opts: ChangesetWithChangesetsOpts,
1143 ) -> Changeset {
1144 let mut query = self.selection.select("withChangesets");
1145 query = query.arg("changes", changes);
1146 if let Some(on_conflict) = opts.on_conflict {
1147 query = query.arg("onConflict", on_conflict);
1148 }
1149 Changeset {
1150 proc: self.proc.clone(),
1151 selection: query,
1152 graphql_client: self.graphql_client.clone(),
1153 }
1154 }
1155}
1156impl Exportable for Changeset {
1157 fn export(
1158 &self,
1159 path: impl Into<String>,
1160 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
1161 let mut query = self.selection.select("export");
1162 query = query.arg("path", path.into());
1163 let graphql_client = self.graphql_client.clone();
1164 async move { query.execute(graphql_client).await }
1165 }
1166 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1167 let query = self.selection.select("id");
1168 let graphql_client = self.graphql_client.clone();
1169 async move { query.execute(graphql_client).await }
1170 }
1171}
1172impl Node for Changeset {
1173 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1174 let query = self.selection.select("id");
1175 let graphql_client = self.graphql_client.clone();
1176 async move { query.execute(graphql_client).await }
1177 }
1178}
1179impl Syncer for Changeset {
1180 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1181 let query = self.selection.select("id");
1182 let graphql_client = self.graphql_client.clone();
1183 async move { query.execute(graphql_client).await }
1184 }
1185 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1186 let query = self.selection.select("sync");
1187 let graphql_client = self.graphql_client.clone();
1188 async move { query.execute(graphql_client).await }
1189 }
1190}
1191#[derive(Clone)]
1192pub struct Check {
1193 pub proc: Option<Arc<DaggerSessionProc>>,
1194 pub selection: Selection,
1195 pub graphql_client: DynGraphQLClient,
1196}
1197impl IntoID<Id> for Check {
1198 fn into_id(
1199 self,
1200 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1201 Box::pin(async move { self.id().await })
1202 }
1203}
1204impl Loadable for Check {
1205 fn graphql_type() -> &'static str {
1206 "Check"
1207 }
1208 fn from_query(
1209 proc: Option<Arc<DaggerSessionProc>>,
1210 selection: Selection,
1211 graphql_client: DynGraphQLClient,
1212 ) -> Self {
1213 Self {
1214 proc,
1215 selection,
1216 graphql_client,
1217 }
1218 }
1219}
1220impl Check {
1221 pub async fn check_type(&self) -> Result<String, DaggerError> {
1223 let query = self.selection.select("checkType");
1224 query.execute(self.graphql_client.clone()).await
1225 }
1226 pub async fn completed(&self) -> Result<bool, DaggerError> {
1228 let query = self.selection.select("completed");
1229 query.execute(self.graphql_client.clone()).await
1230 }
1231 pub async fn description(&self) -> Result<String, DaggerError> {
1233 let query = self.selection.select("description");
1234 query.execute(self.graphql_client.clone()).await
1235 }
1236 pub fn error(&self) -> Error {
1238 let query = self.selection.select("error");
1239 Error {
1240 proc: self.proc.clone(),
1241 selection: query,
1242 graphql_client: self.graphql_client.clone(),
1243 }
1244 }
1245 pub async fn id(&self) -> Result<Id, DaggerError> {
1247 let query = self.selection.select("id");
1248 query.execute(self.graphql_client.clone()).await
1249 }
1250 pub async fn name(&self) -> Result<String, DaggerError> {
1252 let query = self.selection.select("name");
1253 query.execute(self.graphql_client.clone()).await
1254 }
1255 pub fn original_module(&self) -> Module {
1257 let query = self.selection.select("originalModule");
1258 Module {
1259 proc: self.proc.clone(),
1260 selection: query,
1261 graphql_client: self.graphql_client.clone(),
1262 }
1263 }
1264 pub async fn passed(&self) -> Result<bool, DaggerError> {
1266 let query = self.selection.select("passed");
1267 query.execute(self.graphql_client.clone()).await
1268 }
1269 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1271 let query = self.selection.select("path");
1272 query.execute(self.graphql_client.clone()).await
1273 }
1274 pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1276 let query = self.selection.select("resultEmoji");
1277 query.execute(self.graphql_client.clone()).await
1278 }
1279 pub fn run(&self) -> Check {
1281 let query = self.selection.select("run");
1282 Check {
1283 proc: self.proc.clone(),
1284 selection: query,
1285 graphql_client: self.graphql_client.clone(),
1286 }
1287 }
1288}
1289impl Node for Check {
1290 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1291 let query = self.selection.select("id");
1292 let graphql_client = self.graphql_client.clone();
1293 async move { query.execute(graphql_client).await }
1294 }
1295}
1296#[derive(Clone)]
1297pub struct CheckGroup {
1298 pub proc: Option<Arc<DaggerSessionProc>>,
1299 pub selection: Selection,
1300 pub graphql_client: DynGraphQLClient,
1301}
1302#[derive(Builder, Debug, PartialEq)]
1303pub struct CheckGroupRunOpts {
1304 #[builder(setter(into, strip_option), default)]
1306 pub fail_fast: Option<bool>,
1307}
1308impl IntoID<Id> for CheckGroup {
1309 fn into_id(
1310 self,
1311 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1312 Box::pin(async move { self.id().await })
1313 }
1314}
1315impl Loadable for CheckGroup {
1316 fn graphql_type() -> &'static str {
1317 "CheckGroup"
1318 }
1319 fn from_query(
1320 proc: Option<Arc<DaggerSessionProc>>,
1321 selection: Selection,
1322 graphql_client: DynGraphQLClient,
1323 ) -> Self {
1324 Self {
1325 proc,
1326 selection,
1327 graphql_client,
1328 }
1329 }
1330}
1331impl CheckGroup {
1332 pub async fn id(&self) -> Result<Id, DaggerError> {
1334 let query = self.selection.select("id");
1335 query.execute(self.graphql_client.clone()).await
1336 }
1337 pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1339 let query = self.selection.select("list");
1340 let query = query.select("id");
1341 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1342 Ok(ids
1343 .into_iter()
1344 .map(|id| Check {
1345 proc: self.proc.clone(),
1346 selection: crate::querybuilder::query()
1347 .select("node")
1348 .arg("id", &id.0)
1349 .inline_fragment("Check"),
1350 graphql_client: self.graphql_client.clone(),
1351 })
1352 .collect())
1353 }
1354 pub fn report(&self) -> File {
1356 let query = self.selection.select("report");
1357 File {
1358 proc: self.proc.clone(),
1359 selection: query,
1360 graphql_client: self.graphql_client.clone(),
1361 }
1362 }
1363 pub fn run(&self) -> CheckGroup {
1369 let query = self.selection.select("run");
1370 CheckGroup {
1371 proc: self.proc.clone(),
1372 selection: query,
1373 graphql_client: self.graphql_client.clone(),
1374 }
1375 }
1376 pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1382 let mut query = self.selection.select("run");
1383 if let Some(fail_fast) = opts.fail_fast {
1384 query = query.arg("failFast", fail_fast);
1385 }
1386 CheckGroup {
1387 proc: self.proc.clone(),
1388 selection: query,
1389 graphql_client: self.graphql_client.clone(),
1390 }
1391 }
1392}
1393impl Node for CheckGroup {
1394 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1395 let query = self.selection.select("id");
1396 let graphql_client = self.graphql_client.clone();
1397 async move { query.execute(graphql_client).await }
1398 }
1399}
1400#[derive(Clone)]
1401pub struct ClientFilesyncMirror {
1402 pub proc: Option<Arc<DaggerSessionProc>>,
1403 pub selection: Selection,
1404 pub graphql_client: DynGraphQLClient,
1405}
1406impl IntoID<Id> for ClientFilesyncMirror {
1407 fn into_id(
1408 self,
1409 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1410 Box::pin(async move { self.id().await })
1411 }
1412}
1413impl Loadable for ClientFilesyncMirror {
1414 fn graphql_type() -> &'static str {
1415 "ClientFilesyncMirror"
1416 }
1417 fn from_query(
1418 proc: Option<Arc<DaggerSessionProc>>,
1419 selection: Selection,
1420 graphql_client: DynGraphQLClient,
1421 ) -> Self {
1422 Self {
1423 proc,
1424 selection,
1425 graphql_client,
1426 }
1427 }
1428}
1429impl ClientFilesyncMirror {
1430 pub async fn id(&self) -> Result<Id, DaggerError> {
1432 let query = self.selection.select("id");
1433 query.execute(self.graphql_client.clone()).await
1434 }
1435}
1436impl Node for ClientFilesyncMirror {
1437 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1438 let query = self.selection.select("id");
1439 let graphql_client = self.graphql_client.clone();
1440 async move { query.execute(graphql_client).await }
1441 }
1442}
1443#[derive(Clone)]
1444pub struct Cloud {
1445 pub proc: Option<Arc<DaggerSessionProc>>,
1446 pub selection: Selection,
1447 pub graphql_client: DynGraphQLClient,
1448}
1449impl IntoID<Id> for Cloud {
1450 fn into_id(
1451 self,
1452 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1453 Box::pin(async move { self.id().await })
1454 }
1455}
1456impl Loadable for Cloud {
1457 fn graphql_type() -> &'static str {
1458 "Cloud"
1459 }
1460 fn from_query(
1461 proc: Option<Arc<DaggerSessionProc>>,
1462 selection: Selection,
1463 graphql_client: DynGraphQLClient,
1464 ) -> Self {
1465 Self {
1466 proc,
1467 selection,
1468 graphql_client,
1469 }
1470 }
1471}
1472impl Cloud {
1473 pub async fn id(&self) -> Result<Id, DaggerError> {
1475 let query = self.selection.select("id");
1476 query.execute(self.graphql_client.clone()).await
1477 }
1478 pub async fn trace_url(&self) -> Result<String, DaggerError> {
1480 let query = self.selection.select("traceURL");
1481 query.execute(self.graphql_client.clone()).await
1482 }
1483}
1484impl Node for Cloud {
1485 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1486 let query = self.selection.select("id");
1487 let graphql_client = self.graphql_client.clone();
1488 async move { query.execute(graphql_client).await }
1489 }
1490}
1491#[derive(Clone)]
1492pub struct Container {
1493 pub proc: Option<Arc<DaggerSessionProc>>,
1494 pub selection: Selection,
1495 pub graphql_client: DynGraphQLClient,
1496}
1497#[derive(Builder, Debug, PartialEq)]
1498pub struct ContainerAsServiceOpts<'a> {
1499 #[builder(setter(into, strip_option), default)]
1502 pub args: Option<Vec<&'a str>>,
1503 #[builder(setter(into, strip_option), default)]
1505 pub expand: Option<bool>,
1506 #[builder(setter(into, strip_option), default)]
1508 pub experimental_privileged_nesting: Option<bool>,
1509 #[builder(setter(into, strip_option), default)]
1511 pub insecure_root_capabilities: Option<bool>,
1512 #[builder(setter(into, strip_option), default)]
1515 pub no_init: Option<bool>,
1516 #[builder(setter(into, strip_option), default)]
1518 pub use_entrypoint: Option<bool>,
1519}
1520#[derive(Builder, Debug, PartialEq)]
1521pub struct ContainerAsTarballOpts {
1522 #[builder(setter(into, strip_option), default)]
1525 pub forced_compression: Option<ImageLayerCompression>,
1526 #[builder(setter(into, strip_option), default)]
1529 pub media_types: Option<ImageMediaTypes>,
1530 #[builder(setter(into, strip_option), default)]
1533 pub platform_variants: Option<Vec<Id>>,
1534}
1535#[derive(Builder, Debug, PartialEq)]
1536pub struct ContainerDirectoryOpts {
1537 #[builder(setter(into, strip_option), default)]
1539 pub expand: Option<bool>,
1540}
1541#[derive(Builder, Debug, PartialEq)]
1542pub struct ContainerExistsOpts {
1543 #[builder(setter(into, strip_option), default)]
1545 pub do_not_follow_symlinks: Option<bool>,
1546 #[builder(setter(into, strip_option), default)]
1548 pub expand: Option<bool>,
1549 #[builder(setter(into, strip_option), default)]
1551 pub expected_type: Option<ExistsType>,
1552}
1553#[derive(Builder, Debug, PartialEq)]
1554pub struct ContainerExportOpts {
1555 #[builder(setter(into, strip_option), default)]
1557 pub expand: Option<bool>,
1558 #[builder(setter(into, strip_option), default)]
1561 pub forced_compression: Option<ImageLayerCompression>,
1562 #[builder(setter(into, strip_option), default)]
1565 pub media_types: Option<ImageMediaTypes>,
1566 #[builder(setter(into, strip_option), default)]
1569 pub platform_variants: Option<Vec<Id>>,
1570}
1571#[derive(Builder, Debug, PartialEq)]
1572pub struct ContainerExportImageOpts {
1573 #[builder(setter(into, strip_option), default)]
1576 pub forced_compression: Option<ImageLayerCompression>,
1577 #[builder(setter(into, strip_option), default)]
1580 pub media_types: Option<ImageMediaTypes>,
1581 #[builder(setter(into, strip_option), default)]
1584 pub platform_variants: Option<Vec<Id>>,
1585}
1586#[derive(Builder, Debug, PartialEq)]
1587pub struct ContainerFileOpts {
1588 #[builder(setter(into, strip_option), default)]
1590 pub expand: Option<bool>,
1591}
1592#[derive(Builder, Debug, PartialEq)]
1593pub struct ContainerImportOpts<'a> {
1594 #[builder(setter(into, strip_option), default)]
1596 pub tag: Option<&'a str>,
1597}
1598#[derive(Builder, Debug, PartialEq)]
1599pub struct ContainerPublishOpts {
1600 #[builder(setter(into, strip_option), default)]
1603 pub forced_compression: Option<ImageLayerCompression>,
1604 #[builder(setter(into, strip_option), default)]
1607 pub media_types: Option<ImageMediaTypes>,
1608 #[builder(setter(into, strip_option), default)]
1611 pub platform_variants: Option<Vec<Id>>,
1612}
1613#[derive(Builder, Debug, PartialEq)]
1614pub struct ContainerStatOpts {
1615 #[builder(setter(into, strip_option), default)]
1617 pub do_not_follow_symlinks: Option<bool>,
1618}
1619#[derive(Builder, Debug, PartialEq)]
1620pub struct ContainerTerminalOpts<'a> {
1621 #[builder(setter(into, strip_option), default)]
1623 pub cmd: Option<Vec<&'a str>>,
1624 #[builder(setter(into, strip_option), default)]
1626 pub experimental_privileged_nesting: Option<bool>,
1627 #[builder(setter(into, strip_option), default)]
1629 pub insecure_root_capabilities: Option<bool>,
1630}
1631#[derive(Builder, Debug, PartialEq)]
1632pub struct ContainerUpOpts<'a> {
1633 #[builder(setter(into, strip_option), default)]
1636 pub args: Option<Vec<&'a str>>,
1637 #[builder(setter(into, strip_option), default)]
1639 pub expand: Option<bool>,
1640 #[builder(setter(into, strip_option), default)]
1642 pub experimental_privileged_nesting: Option<bool>,
1643 #[builder(setter(into, strip_option), default)]
1645 pub insecure_root_capabilities: Option<bool>,
1646 #[builder(setter(into, strip_option), default)]
1649 pub no_init: Option<bool>,
1650 #[builder(setter(into, strip_option), default)]
1653 pub ports: Option<Vec<PortForward>>,
1654 #[builder(setter(into, strip_option), default)]
1656 pub random: Option<bool>,
1657 #[builder(setter(into, strip_option), default)]
1659 pub use_entrypoint: Option<bool>,
1660}
1661#[derive(Builder, Debug, PartialEq)]
1662pub struct ContainerWithDefaultTerminalCmdOpts {
1663 #[builder(setter(into, strip_option), default)]
1665 pub experimental_privileged_nesting: Option<bool>,
1666 #[builder(setter(into, strip_option), default)]
1668 pub insecure_root_capabilities: Option<bool>,
1669}
1670#[derive(Builder, Debug, PartialEq)]
1671pub struct ContainerWithDirectoryOpts<'a> {
1672 #[builder(setter(into, strip_option), default)]
1674 pub exclude: Option<Vec<&'a str>>,
1675 #[builder(setter(into, strip_option), default)]
1677 pub expand: Option<bool>,
1678 #[builder(setter(into, strip_option), default)]
1680 pub gitignore: Option<bool>,
1681 #[builder(setter(into, strip_option), default)]
1683 pub include: Option<Vec<&'a str>>,
1684 #[builder(setter(into, strip_option), default)]
1688 pub owner: Option<&'a str>,
1689 #[builder(setter(into, strip_option), default)]
1690 pub permissions: Option<isize>,
1691}
1692#[derive(Builder, Debug, PartialEq)]
1693pub struct ContainerWithDockerHealthcheckOpts<'a> {
1694 #[builder(setter(into, strip_option), default)]
1696 pub interval: Option<&'a str>,
1697 #[builder(setter(into, strip_option), default)]
1699 pub retries: Option<isize>,
1700 #[builder(setter(into, strip_option), default)]
1702 pub shell: Option<bool>,
1703 #[builder(setter(into, strip_option), default)]
1705 pub start_interval: Option<&'a str>,
1706 #[builder(setter(into, strip_option), default)]
1708 pub start_period: Option<&'a str>,
1709 #[builder(setter(into, strip_option), default)]
1711 pub timeout: Option<&'a str>,
1712}
1713#[derive(Builder, Debug, PartialEq)]
1714pub struct ContainerWithEntrypointOpts {
1715 #[builder(setter(into, strip_option), default)]
1717 pub keep_default_args: Option<bool>,
1718}
1719#[derive(Builder, Debug, PartialEq)]
1720pub struct ContainerWithEnvVariableOpts {
1721 #[builder(setter(into, strip_option), default)]
1723 pub expand: Option<bool>,
1724}
1725#[derive(Builder, Debug, PartialEq)]
1726pub struct ContainerWithExecOpts<'a> {
1727 #[builder(setter(into, strip_option), default)]
1729 pub expand: Option<bool>,
1730 #[builder(setter(into, strip_option), default)]
1732 pub expect: Option<ReturnType>,
1733 #[builder(setter(into, strip_option), default)]
1735 pub experimental_privileged_nesting: Option<bool>,
1736 #[builder(setter(into, strip_option), default)]
1739 pub insecure_root_capabilities: Option<bool>,
1740 #[builder(setter(into, strip_option), default)]
1743 pub no_init: Option<bool>,
1744 #[builder(setter(into, strip_option), default)]
1746 pub redirect_stderr: Option<&'a str>,
1747 #[builder(setter(into, strip_option), default)]
1749 pub redirect_stdin: Option<&'a str>,
1750 #[builder(setter(into, strip_option), default)]
1752 pub redirect_stdout: Option<&'a str>,
1753 #[builder(setter(into, strip_option), default)]
1755 pub stdin: Option<&'a str>,
1756 #[builder(setter(into, strip_option), default)]
1758 pub use_entrypoint: Option<bool>,
1759}
1760#[derive(Builder, Debug, PartialEq)]
1761pub struct ContainerWithExposedPortOpts<'a> {
1762 #[builder(setter(into, strip_option), default)]
1764 pub description: Option<&'a str>,
1765 #[builder(setter(into, strip_option), default)]
1767 pub experimental_skip_healthcheck: Option<bool>,
1768 #[builder(setter(into, strip_option), default)]
1770 pub protocol: Option<NetworkProtocol>,
1771}
1772#[derive(Builder, Debug, PartialEq)]
1773pub struct ContainerWithFileOpts<'a> {
1774 #[builder(setter(into, strip_option), default)]
1776 pub expand: Option<bool>,
1777 #[builder(setter(into, strip_option), default)]
1781 pub owner: Option<&'a str>,
1782 #[builder(setter(into, strip_option), default)]
1784 pub permissions: Option<isize>,
1785}
1786#[derive(Builder, Debug, PartialEq)]
1787pub struct ContainerWithFilesOpts<'a> {
1788 #[builder(setter(into, strip_option), default)]
1790 pub expand: Option<bool>,
1791 #[builder(setter(into, strip_option), default)]
1795 pub owner: Option<&'a str>,
1796 #[builder(setter(into, strip_option), default)]
1798 pub permissions: Option<isize>,
1799}
1800#[derive(Builder, Debug, PartialEq)]
1801pub struct ContainerWithMountedCacheOpts<'a> {
1802 #[builder(setter(into, strip_option), default)]
1804 pub expand: Option<bool>,
1805 #[builder(setter(into, strip_option), default)]
1810 pub owner: Option<&'a str>,
1811 #[builder(setter(into, strip_option), default)]
1813 pub sharing: Option<CacheSharingMode>,
1814 #[builder(setter(into, strip_option), default)]
1816 pub source: Option<Id>,
1817}
1818#[derive(Builder, Debug, PartialEq)]
1819pub struct ContainerWithMountedDirectoryOpts<'a> {
1820 #[builder(setter(into, strip_option), default)]
1822 pub expand: Option<bool>,
1823 #[builder(setter(into, strip_option), default)]
1827 pub owner: Option<&'a str>,
1828 #[builder(setter(into, strip_option), default)]
1830 pub read_only: Option<bool>,
1831}
1832#[derive(Builder, Debug, PartialEq)]
1833pub struct ContainerWithMountedFileOpts<'a> {
1834 #[builder(setter(into, strip_option), default)]
1836 pub expand: Option<bool>,
1837 #[builder(setter(into, strip_option), default)]
1841 pub owner: Option<&'a str>,
1842}
1843#[derive(Builder, Debug, PartialEq)]
1844pub struct ContainerWithMountedSecretOpts<'a> {
1845 #[builder(setter(into, strip_option), default)]
1847 pub expand: Option<bool>,
1848 #[builder(setter(into, strip_option), default)]
1851 pub mode: Option<isize>,
1852 #[builder(setter(into, strip_option), default)]
1856 pub owner: Option<&'a str>,
1857}
1858#[derive(Builder, Debug, PartialEq)]
1859pub struct ContainerWithMountedTempOpts {
1860 #[builder(setter(into, strip_option), default)]
1862 pub expand: Option<bool>,
1863 #[builder(setter(into, strip_option), default)]
1865 pub size: Option<isize>,
1866}
1867#[derive(Builder, Debug, PartialEq)]
1868pub struct ContainerWithNewFileOpts<'a> {
1869 #[builder(setter(into, strip_option), default)]
1871 pub expand: Option<bool>,
1872 #[builder(setter(into, strip_option), default)]
1876 pub owner: Option<&'a str>,
1877 #[builder(setter(into, strip_option), default)]
1879 pub permissions: Option<isize>,
1880}
1881#[derive(Builder, Debug, PartialEq)]
1882pub struct ContainerWithSymlinkOpts {
1883 #[builder(setter(into, strip_option), default)]
1885 pub expand: Option<bool>,
1886}
1887#[derive(Builder, Debug, PartialEq)]
1888pub struct ContainerWithUnixSocketOpts<'a> {
1889 #[builder(setter(into, strip_option), default)]
1891 pub expand: Option<bool>,
1892 #[builder(setter(into, strip_option), default)]
1896 pub owner: Option<&'a str>,
1897}
1898#[derive(Builder, Debug, PartialEq)]
1899pub struct ContainerWithWorkdirOpts {
1900 #[builder(setter(into, strip_option), default)]
1902 pub expand: Option<bool>,
1903}
1904#[derive(Builder, Debug, PartialEq)]
1905pub struct ContainerWithoutDirectoryOpts {
1906 #[builder(setter(into, strip_option), default)]
1908 pub expand: Option<bool>,
1909}
1910#[derive(Builder, Debug, PartialEq)]
1911pub struct ContainerWithoutEntrypointOpts {
1912 #[builder(setter(into, strip_option), default)]
1914 pub keep_default_args: Option<bool>,
1915}
1916#[derive(Builder, Debug, PartialEq)]
1917pub struct ContainerWithoutExposedPortOpts {
1918 #[builder(setter(into, strip_option), default)]
1920 pub protocol: Option<NetworkProtocol>,
1921}
1922#[derive(Builder, Debug, PartialEq)]
1923pub struct ContainerWithoutFileOpts {
1924 #[builder(setter(into, strip_option), default)]
1926 pub expand: Option<bool>,
1927}
1928#[derive(Builder, Debug, PartialEq)]
1929pub struct ContainerWithoutFilesOpts {
1930 #[builder(setter(into, strip_option), default)]
1932 pub expand: Option<bool>,
1933}
1934#[derive(Builder, Debug, PartialEq)]
1935pub struct ContainerWithoutMountOpts {
1936 #[builder(setter(into, strip_option), default)]
1938 pub expand: Option<bool>,
1939}
1940#[derive(Builder, Debug, PartialEq)]
1941pub struct ContainerWithoutUnixSocketOpts {
1942 #[builder(setter(into, strip_option), default)]
1944 pub expand: Option<bool>,
1945}
1946impl IntoID<Id> for Container {
1947 fn into_id(
1948 self,
1949 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1950 Box::pin(async move { self.id().await })
1951 }
1952}
1953impl Loadable for Container {
1954 fn graphql_type() -> &'static str {
1955 "Container"
1956 }
1957 fn from_query(
1958 proc: Option<Arc<DaggerSessionProc>>,
1959 selection: Selection,
1960 graphql_client: DynGraphQLClient,
1961 ) -> Self {
1962 Self {
1963 proc,
1964 selection,
1965 graphql_client,
1966 }
1967 }
1968}
1969impl Container {
1970 pub fn as_service(&self) -> Service {
1977 let query = self.selection.select("asService");
1978 Service {
1979 proc: self.proc.clone(),
1980 selection: query,
1981 graphql_client: self.graphql_client.clone(),
1982 }
1983 }
1984 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1991 let mut query = self.selection.select("asService");
1992 if let Some(args) = opts.args {
1993 query = query.arg("args", args);
1994 }
1995 if let Some(use_entrypoint) = opts.use_entrypoint {
1996 query = query.arg("useEntrypoint", use_entrypoint);
1997 }
1998 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1999 query = query.arg(
2000 "experimentalPrivilegedNesting",
2001 experimental_privileged_nesting,
2002 );
2003 }
2004 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2005 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2006 }
2007 if let Some(expand) = opts.expand {
2008 query = query.arg("expand", expand);
2009 }
2010 if let Some(no_init) = opts.no_init {
2011 query = query.arg("noInit", no_init);
2012 }
2013 Service {
2014 proc: self.proc.clone(),
2015 selection: query,
2016 graphql_client: self.graphql_client.clone(),
2017 }
2018 }
2019 pub fn as_tarball(&self) -> File {
2025 let query = self.selection.select("asTarball");
2026 File {
2027 proc: self.proc.clone(),
2028 selection: query,
2029 graphql_client: self.graphql_client.clone(),
2030 }
2031 }
2032 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2038 let mut query = self.selection.select("asTarball");
2039 if let Some(platform_variants) = opts.platform_variants {
2040 query = query.arg("platformVariants", platform_variants);
2041 }
2042 if let Some(forced_compression) = opts.forced_compression {
2043 query = query.arg("forcedCompression", forced_compression);
2044 }
2045 if let Some(media_types) = opts.media_types {
2046 query = query.arg("mediaTypes", media_types);
2047 }
2048 File {
2049 proc: self.proc.clone(),
2050 selection: query,
2051 graphql_client: self.graphql_client.clone(),
2052 }
2053 }
2054 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2057 let query = self.selection.select("combinedOutput");
2058 query.execute(self.graphql_client.clone()).await
2059 }
2060 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2062 let query = self.selection.select("defaultArgs");
2063 query.execute(self.graphql_client.clone()).await
2064 }
2065 pub fn directory(&self, path: impl Into<String>) -> Directory {
2073 let mut query = self.selection.select("directory");
2074 query = query.arg("path", path.into());
2075 Directory {
2076 proc: self.proc.clone(),
2077 selection: query,
2078 graphql_client: self.graphql_client.clone(),
2079 }
2080 }
2081 pub fn directory_opts(
2089 &self,
2090 path: impl Into<String>,
2091 opts: ContainerDirectoryOpts,
2092 ) -> Directory {
2093 let mut query = self.selection.select("directory");
2094 query = query.arg("path", path.into());
2095 if let Some(expand) = opts.expand {
2096 query = query.arg("expand", expand);
2097 }
2098 Directory {
2099 proc: self.proc.clone(),
2100 selection: query,
2101 graphql_client: self.graphql_client.clone(),
2102 }
2103 }
2104 pub fn docker_healthcheck(&self) -> HealthcheckConfig {
2106 let query = self.selection.select("dockerHealthcheck");
2107 HealthcheckConfig {
2108 proc: self.proc.clone(),
2109 selection: query,
2110 graphql_client: self.graphql_client.clone(),
2111 }
2112 }
2113 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2115 let query = self.selection.select("entrypoint");
2116 query.execute(self.graphql_client.clone()).await
2117 }
2118 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2124 let mut query = self.selection.select("envVariable");
2125 query = query.arg("name", name.into());
2126 query.execute(self.graphql_client.clone()).await
2127 }
2128 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2130 let query = self.selection.select("envVariables");
2131 let query = query.select("id");
2132 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2133 Ok(ids
2134 .into_iter()
2135 .map(|id| EnvVariable {
2136 proc: self.proc.clone(),
2137 selection: crate::querybuilder::query()
2138 .select("node")
2139 .arg("id", &id.0)
2140 .inline_fragment("EnvVariable"),
2141 graphql_client: self.graphql_client.clone(),
2142 })
2143 .collect())
2144 }
2145 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2152 let mut query = self.selection.select("exists");
2153 query = query.arg("path", path.into());
2154 query.execute(self.graphql_client.clone()).await
2155 }
2156 pub async fn exists_opts(
2163 &self,
2164 path: impl Into<String>,
2165 opts: ContainerExistsOpts,
2166 ) -> Result<bool, DaggerError> {
2167 let mut query = self.selection.select("exists");
2168 query = query.arg("path", path.into());
2169 if let Some(expected_type) = opts.expected_type {
2170 query = query.arg("expectedType", expected_type);
2171 }
2172 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2173 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2174 }
2175 if let Some(expand) = opts.expand {
2176 query = query.arg("expand", expand);
2177 }
2178 query.execute(self.graphql_client.clone()).await
2179 }
2180 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2183 let query = self.selection.select("exitCode");
2184 query.execute(self.graphql_client.clone()).await
2185 }
2186 pub fn experimental_with_all_gp_us(&self) -> Container {
2190 let query = self.selection.select("experimentalWithAllGPUs");
2191 Container {
2192 proc: self.proc.clone(),
2193 selection: query,
2194 graphql_client: self.graphql_client.clone(),
2195 }
2196 }
2197 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2205 let mut query = self.selection.select("experimentalWithGPU");
2206 query = query.arg(
2207 "devices",
2208 devices
2209 .into_iter()
2210 .map(|i| i.into())
2211 .collect::<Vec<String>>(),
2212 );
2213 Container {
2214 proc: self.proc.clone(),
2215 selection: query,
2216 graphql_client: self.graphql_client.clone(),
2217 }
2218 }
2219 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2229 let mut query = self.selection.select("export");
2230 query = query.arg("path", path.into());
2231 query.execute(self.graphql_client.clone()).await
2232 }
2233 pub async fn export_opts(
2243 &self,
2244 path: impl Into<String>,
2245 opts: ContainerExportOpts,
2246 ) -> Result<String, DaggerError> {
2247 let mut query = self.selection.select("export");
2248 query = query.arg("path", path.into());
2249 if let Some(platform_variants) = opts.platform_variants {
2250 query = query.arg("platformVariants", platform_variants);
2251 }
2252 if let Some(forced_compression) = opts.forced_compression {
2253 query = query.arg("forcedCompression", forced_compression);
2254 }
2255 if let Some(media_types) = opts.media_types {
2256 query = query.arg("mediaTypes", media_types);
2257 }
2258 if let Some(expand) = opts.expand {
2259 query = query.arg("expand", expand);
2260 }
2261 query.execute(self.graphql_client.clone()).await
2262 }
2263 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2270 let mut query = self.selection.select("exportImage");
2271 query = query.arg("name", name.into());
2272 query.execute(self.graphql_client.clone()).await
2273 }
2274 pub async fn export_image_opts(
2281 &self,
2282 name: impl Into<String>,
2283 opts: ContainerExportImageOpts,
2284 ) -> Result<Void, DaggerError> {
2285 let mut query = self.selection.select("exportImage");
2286 query = query.arg("name", name.into());
2287 if let Some(platform_variants) = opts.platform_variants {
2288 query = query.arg("platformVariants", platform_variants);
2289 }
2290 if let Some(forced_compression) = opts.forced_compression {
2291 query = query.arg("forcedCompression", forced_compression);
2292 }
2293 if let Some(media_types) = opts.media_types {
2294 query = query.arg("mediaTypes", media_types);
2295 }
2296 query.execute(self.graphql_client.clone()).await
2297 }
2298 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2301 let query = self.selection.select("exposedPorts");
2302 let query = query.select("id");
2303 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2304 Ok(ids
2305 .into_iter()
2306 .map(|id| Port {
2307 proc: self.proc.clone(),
2308 selection: crate::querybuilder::query()
2309 .select("node")
2310 .arg("id", &id.0)
2311 .inline_fragment("Port"),
2312 graphql_client: self.graphql_client.clone(),
2313 })
2314 .collect())
2315 }
2316 pub fn file(&self, path: impl Into<String>) -> File {
2324 let mut query = self.selection.select("file");
2325 query = query.arg("path", path.into());
2326 File {
2327 proc: self.proc.clone(),
2328 selection: query,
2329 graphql_client: self.graphql_client.clone(),
2330 }
2331 }
2332 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2340 let mut query = self.selection.select("file");
2341 query = query.arg("path", path.into());
2342 if let Some(expand) = opts.expand {
2343 query = query.arg("expand", expand);
2344 }
2345 File {
2346 proc: self.proc.clone(),
2347 selection: query,
2348 graphql_client: self.graphql_client.clone(),
2349 }
2350 }
2351 pub fn from(&self, address: impl Into<String>) -> Container {
2357 let mut query = self.selection.select("from");
2358 query = query.arg("address", address.into());
2359 Container {
2360 proc: self.proc.clone(),
2361 selection: query,
2362 graphql_client: self.graphql_client.clone(),
2363 }
2364 }
2365 pub async fn id(&self) -> Result<Id, DaggerError> {
2367 let query = self.selection.select("id");
2368 query.execute(self.graphql_client.clone()).await
2369 }
2370 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2372 let query = self.selection.select("imageRef");
2373 query.execute(self.graphql_client.clone()).await
2374 }
2375 pub fn import(&self, source: impl IntoID<Id>) -> Container {
2382 let mut query = self.selection.select("import");
2383 query = query.arg_lazy(
2384 "source",
2385 Box::new(move || {
2386 let source = source.clone();
2387 Box::pin(async move { source.into_id().await.unwrap().quote() })
2388 }),
2389 );
2390 Container {
2391 proc: self.proc.clone(),
2392 selection: query,
2393 graphql_client: self.graphql_client.clone(),
2394 }
2395 }
2396 pub fn import_opts<'a>(
2403 &self,
2404 source: impl IntoID<Id>,
2405 opts: ContainerImportOpts<'a>,
2406 ) -> Container {
2407 let mut query = self.selection.select("import");
2408 query = query.arg_lazy(
2409 "source",
2410 Box::new(move || {
2411 let source = source.clone();
2412 Box::pin(async move { source.into_id().await.unwrap().quote() })
2413 }),
2414 );
2415 if let Some(tag) = opts.tag {
2416 query = query.arg("tag", tag);
2417 }
2418 Container {
2419 proc: self.proc.clone(),
2420 selection: query,
2421 graphql_client: self.graphql_client.clone(),
2422 }
2423 }
2424 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2430 let mut query = self.selection.select("label");
2431 query = query.arg("name", name.into());
2432 query.execute(self.graphql_client.clone()).await
2433 }
2434 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2436 let query = self.selection.select("labels");
2437 let query = query.select("id");
2438 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2439 Ok(ids
2440 .into_iter()
2441 .map(|id| Label {
2442 proc: self.proc.clone(),
2443 selection: crate::querybuilder::query()
2444 .select("node")
2445 .arg("id", &id.0)
2446 .inline_fragment("Label"),
2447 graphql_client: self.graphql_client.clone(),
2448 })
2449 .collect())
2450 }
2451 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2453 let query = self.selection.select("mounts");
2454 query.execute(self.graphql_client.clone()).await
2455 }
2456 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2458 let query = self.selection.select("platform");
2459 query.execute(self.graphql_client.clone()).await
2460 }
2461 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2471 let mut query = self.selection.select("publish");
2472 query = query.arg("address", address.into());
2473 query.execute(self.graphql_client.clone()).await
2474 }
2475 pub async fn publish_opts(
2485 &self,
2486 address: impl Into<String>,
2487 opts: ContainerPublishOpts,
2488 ) -> Result<String, DaggerError> {
2489 let mut query = self.selection.select("publish");
2490 query = query.arg("address", address.into());
2491 if let Some(platform_variants) = opts.platform_variants {
2492 query = query.arg("platformVariants", platform_variants);
2493 }
2494 if let Some(forced_compression) = opts.forced_compression {
2495 query = query.arg("forcedCompression", forced_compression);
2496 }
2497 if let Some(media_types) = opts.media_types {
2498 query = query.arg("mediaTypes", media_types);
2499 }
2500 query.execute(self.graphql_client.clone()).await
2501 }
2502 pub fn rootfs(&self) -> Directory {
2504 let query = self.selection.select("rootfs");
2505 Directory {
2506 proc: self.proc.clone(),
2507 selection: query,
2508 graphql_client: self.graphql_client.clone(),
2509 }
2510 }
2511 pub fn stat(&self, path: impl Into<String>) -> Stat {
2518 let mut query = self.selection.select("stat");
2519 query = query.arg("path", path.into());
2520 Stat {
2521 proc: self.proc.clone(),
2522 selection: query,
2523 graphql_client: self.graphql_client.clone(),
2524 }
2525 }
2526 pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
2533 let mut query = self.selection.select("stat");
2534 query = query.arg("path", path.into());
2535 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2536 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2537 }
2538 Stat {
2539 proc: self.proc.clone(),
2540 selection: query,
2541 graphql_client: self.graphql_client.clone(),
2542 }
2543 }
2544 pub async fn stderr(&self) -> Result<String, DaggerError> {
2547 let query = self.selection.select("stderr");
2548 query.execute(self.graphql_client.clone()).await
2549 }
2550 pub async fn stdout(&self) -> Result<String, DaggerError> {
2553 let query = self.selection.select("stdout");
2554 query.execute(self.graphql_client.clone()).await
2555 }
2556 pub async fn sync(&self) -> Result<Container, DaggerError> {
2559 let query = self.selection.select("sync");
2560 let id: Id = query.execute(self.graphql_client.clone()).await?;
2561 Ok(Container {
2562 proc: self.proc.clone(),
2563 selection: query
2564 .root()
2565 .select("node")
2566 .arg("id", &id.0)
2567 .inline_fragment("Container"),
2568 graphql_client: self.graphql_client.clone(),
2569 })
2570 }
2571 pub fn terminal(&self) -> Container {
2577 let query = self.selection.select("terminal");
2578 Container {
2579 proc: self.proc.clone(),
2580 selection: query,
2581 graphql_client: self.graphql_client.clone(),
2582 }
2583 }
2584 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2590 let mut query = self.selection.select("terminal");
2591 if let Some(cmd) = opts.cmd {
2592 query = query.arg("cmd", cmd);
2593 }
2594 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2595 query = query.arg(
2596 "experimentalPrivilegedNesting",
2597 experimental_privileged_nesting,
2598 );
2599 }
2600 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2601 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2602 }
2603 Container {
2604 proc: self.proc.clone(),
2605 selection: query,
2606 graphql_client: self.graphql_client.clone(),
2607 }
2608 }
2609 pub async fn up(&self) -> Result<Void, DaggerError> {
2616 let query = self.selection.select("up");
2617 query.execute(self.graphql_client.clone()).await
2618 }
2619 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2626 let mut query = self.selection.select("up");
2627 if let Some(random) = opts.random {
2628 query = query.arg("random", random);
2629 }
2630 if let Some(ports) = opts.ports {
2631 query = query.arg("ports", ports);
2632 }
2633 if let Some(args) = opts.args {
2634 query = query.arg("args", args);
2635 }
2636 if let Some(use_entrypoint) = opts.use_entrypoint {
2637 query = query.arg("useEntrypoint", use_entrypoint);
2638 }
2639 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2640 query = query.arg(
2641 "experimentalPrivilegedNesting",
2642 experimental_privileged_nesting,
2643 );
2644 }
2645 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2646 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2647 }
2648 if let Some(expand) = opts.expand {
2649 query = query.arg("expand", expand);
2650 }
2651 if let Some(no_init) = opts.no_init {
2652 query = query.arg("noInit", no_init);
2653 }
2654 query.execute(self.graphql_client.clone()).await
2655 }
2656 pub async fn user(&self) -> Result<String, DaggerError> {
2658 let query = self.selection.select("user");
2659 query.execute(self.graphql_client.clone()).await
2660 }
2661 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2668 let mut query = self.selection.select("withAnnotation");
2669 query = query.arg("name", name.into());
2670 query = query.arg("value", value.into());
2671 Container {
2672 proc: self.proc.clone(),
2673 selection: query,
2674 graphql_client: self.graphql_client.clone(),
2675 }
2676 }
2677 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2683 let mut query = self.selection.select("withDefaultArgs");
2684 query = query.arg(
2685 "args",
2686 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2687 );
2688 Container {
2689 proc: self.proc.clone(),
2690 selection: query,
2691 graphql_client: self.graphql_client.clone(),
2692 }
2693 }
2694 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2701 let mut query = self.selection.select("withDefaultTerminalCmd");
2702 query = query.arg(
2703 "args",
2704 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2705 );
2706 Container {
2707 proc: self.proc.clone(),
2708 selection: query,
2709 graphql_client: self.graphql_client.clone(),
2710 }
2711 }
2712 pub fn with_default_terminal_cmd_opts(
2719 &self,
2720 args: Vec<impl Into<String>>,
2721 opts: ContainerWithDefaultTerminalCmdOpts,
2722 ) -> Container {
2723 let mut query = self.selection.select("withDefaultTerminalCmd");
2724 query = query.arg(
2725 "args",
2726 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2727 );
2728 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2729 query = query.arg(
2730 "experimentalPrivilegedNesting",
2731 experimental_privileged_nesting,
2732 );
2733 }
2734 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2735 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2736 }
2737 Container {
2738 proc: self.proc.clone(),
2739 selection: query,
2740 graphql_client: self.graphql_client.clone(),
2741 }
2742 }
2743 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2751 let mut query = self.selection.select("withDirectory");
2752 query = query.arg("path", path.into());
2753 query = query.arg_lazy(
2754 "source",
2755 Box::new(move || {
2756 let source = source.clone();
2757 Box::pin(async move { source.into_id().await.unwrap().quote() })
2758 }),
2759 );
2760 Container {
2761 proc: self.proc.clone(),
2762 selection: query,
2763 graphql_client: self.graphql_client.clone(),
2764 }
2765 }
2766 pub fn with_directory_opts<'a>(
2774 &self,
2775 path: impl Into<String>,
2776 source: impl IntoID<Id>,
2777 opts: ContainerWithDirectoryOpts<'a>,
2778 ) -> Container {
2779 let mut query = self.selection.select("withDirectory");
2780 query = query.arg("path", path.into());
2781 query = query.arg_lazy(
2782 "source",
2783 Box::new(move || {
2784 let source = source.clone();
2785 Box::pin(async move { source.into_id().await.unwrap().quote() })
2786 }),
2787 );
2788 if let Some(exclude) = opts.exclude {
2789 query = query.arg("exclude", exclude);
2790 }
2791 if let Some(include) = opts.include {
2792 query = query.arg("include", include);
2793 }
2794 if let Some(gitignore) = opts.gitignore {
2795 query = query.arg("gitignore", gitignore);
2796 }
2797 if let Some(owner) = opts.owner {
2798 query = query.arg("owner", owner);
2799 }
2800 if let Some(expand) = opts.expand {
2801 query = query.arg("expand", expand);
2802 }
2803 if let Some(permissions) = opts.permissions {
2804 query = query.arg("permissions", permissions);
2805 }
2806 Container {
2807 proc: self.proc.clone(),
2808 selection: query,
2809 graphql_client: self.graphql_client.clone(),
2810 }
2811 }
2812 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2819 let mut query = self.selection.select("withDockerHealthcheck");
2820 query = query.arg(
2821 "args",
2822 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2823 );
2824 Container {
2825 proc: self.proc.clone(),
2826 selection: query,
2827 graphql_client: self.graphql_client.clone(),
2828 }
2829 }
2830 pub fn with_docker_healthcheck_opts<'a>(
2837 &self,
2838 args: Vec<impl Into<String>>,
2839 opts: ContainerWithDockerHealthcheckOpts<'a>,
2840 ) -> Container {
2841 let mut query = self.selection.select("withDockerHealthcheck");
2842 query = query.arg(
2843 "args",
2844 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2845 );
2846 if let Some(shell) = opts.shell {
2847 query = query.arg("shell", shell);
2848 }
2849 if let Some(interval) = opts.interval {
2850 query = query.arg("interval", interval);
2851 }
2852 if let Some(timeout) = opts.timeout {
2853 query = query.arg("timeout", timeout);
2854 }
2855 if let Some(start_period) = opts.start_period {
2856 query = query.arg("startPeriod", start_period);
2857 }
2858 if let Some(start_interval) = opts.start_interval {
2859 query = query.arg("startInterval", start_interval);
2860 }
2861 if let Some(retries) = opts.retries {
2862 query = query.arg("retries", retries);
2863 }
2864 Container {
2865 proc: self.proc.clone(),
2866 selection: query,
2867 graphql_client: self.graphql_client.clone(),
2868 }
2869 }
2870 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2877 let mut query = self.selection.select("withEntrypoint");
2878 query = query.arg(
2879 "args",
2880 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2881 );
2882 Container {
2883 proc: self.proc.clone(),
2884 selection: query,
2885 graphql_client: self.graphql_client.clone(),
2886 }
2887 }
2888 pub fn with_entrypoint_opts(
2895 &self,
2896 args: Vec<impl Into<String>>,
2897 opts: ContainerWithEntrypointOpts,
2898 ) -> Container {
2899 let mut query = self.selection.select("withEntrypoint");
2900 query = query.arg(
2901 "args",
2902 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2903 );
2904 if let Some(keep_default_args) = opts.keep_default_args {
2905 query = query.arg("keepDefaultArgs", keep_default_args);
2906 }
2907 Container {
2908 proc: self.proc.clone(),
2909 selection: query,
2910 graphql_client: self.graphql_client.clone(),
2911 }
2912 }
2913 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2919 let mut query = self.selection.select("withEnvFileVariables");
2920 query = query.arg_lazy(
2921 "source",
2922 Box::new(move || {
2923 let source = source.clone();
2924 Box::pin(async move { source.into_id().await.unwrap().quote() })
2925 }),
2926 );
2927 Container {
2928 proc: self.proc.clone(),
2929 selection: query,
2930 graphql_client: self.graphql_client.clone(),
2931 }
2932 }
2933 pub fn with_env_variable(
2941 &self,
2942 name: impl Into<String>,
2943 value: impl Into<String>,
2944 ) -> Container {
2945 let mut query = self.selection.select("withEnvVariable");
2946 query = query.arg("name", name.into());
2947 query = query.arg("value", value.into());
2948 Container {
2949 proc: self.proc.clone(),
2950 selection: query,
2951 graphql_client: self.graphql_client.clone(),
2952 }
2953 }
2954 pub fn with_env_variable_opts(
2962 &self,
2963 name: impl Into<String>,
2964 value: impl Into<String>,
2965 opts: ContainerWithEnvVariableOpts,
2966 ) -> Container {
2967 let mut query = self.selection.select("withEnvVariable");
2968 query = query.arg("name", name.into());
2969 query = query.arg("value", value.into());
2970 if let Some(expand) = opts.expand {
2971 query = query.arg("expand", expand);
2972 }
2973 Container {
2974 proc: self.proc.clone(),
2975 selection: query,
2976 graphql_client: self.graphql_client.clone(),
2977 }
2978 }
2979 pub fn with_error(&self, err: impl Into<String>) -> Container {
2985 let mut query = self.selection.select("withError");
2986 query = query.arg("err", err.into());
2987 Container {
2988 proc: self.proc.clone(),
2989 selection: query,
2990 graphql_client: self.graphql_client.clone(),
2991 }
2992 }
2993 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3004 let mut query = self.selection.select("withExec");
3005 query = query.arg(
3006 "args",
3007 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3008 );
3009 Container {
3010 proc: self.proc.clone(),
3011 selection: query,
3012 graphql_client: self.graphql_client.clone(),
3013 }
3014 }
3015 pub fn with_exec_opts<'a>(
3026 &self,
3027 args: Vec<impl Into<String>>,
3028 opts: ContainerWithExecOpts<'a>,
3029 ) -> Container {
3030 let mut query = self.selection.select("withExec");
3031 query = query.arg(
3032 "args",
3033 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3034 );
3035 if let Some(use_entrypoint) = opts.use_entrypoint {
3036 query = query.arg("useEntrypoint", use_entrypoint);
3037 }
3038 if let Some(stdin) = opts.stdin {
3039 query = query.arg("stdin", stdin);
3040 }
3041 if let Some(redirect_stdin) = opts.redirect_stdin {
3042 query = query.arg("redirectStdin", redirect_stdin);
3043 }
3044 if let Some(redirect_stdout) = opts.redirect_stdout {
3045 query = query.arg("redirectStdout", redirect_stdout);
3046 }
3047 if let Some(redirect_stderr) = opts.redirect_stderr {
3048 query = query.arg("redirectStderr", redirect_stderr);
3049 }
3050 if let Some(expect) = opts.expect {
3051 query = query.arg("expect", expect);
3052 }
3053 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3054 query = query.arg(
3055 "experimentalPrivilegedNesting",
3056 experimental_privileged_nesting,
3057 );
3058 }
3059 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3060 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3061 }
3062 if let Some(expand) = opts.expand {
3063 query = query.arg("expand", expand);
3064 }
3065 if let Some(no_init) = opts.no_init {
3066 query = query.arg("noInit", no_init);
3067 }
3068 Container {
3069 proc: self.proc.clone(),
3070 selection: query,
3071 graphql_client: self.graphql_client.clone(),
3072 }
3073 }
3074 pub fn with_exposed_port(&self, port: isize) -> Container {
3084 let mut query = self.selection.select("withExposedPort");
3085 query = query.arg("port", port);
3086 Container {
3087 proc: self.proc.clone(),
3088 selection: query,
3089 graphql_client: self.graphql_client.clone(),
3090 }
3091 }
3092 pub fn with_exposed_port_opts<'a>(
3102 &self,
3103 port: isize,
3104 opts: ContainerWithExposedPortOpts<'a>,
3105 ) -> Container {
3106 let mut query = self.selection.select("withExposedPort");
3107 query = query.arg("port", port);
3108 if let Some(protocol) = opts.protocol {
3109 query = query.arg("protocol", protocol);
3110 }
3111 if let Some(description) = opts.description {
3112 query = query.arg("description", description);
3113 }
3114 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3115 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3116 }
3117 Container {
3118 proc: self.proc.clone(),
3119 selection: query,
3120 graphql_client: self.graphql_client.clone(),
3121 }
3122 }
3123 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3131 let mut query = self.selection.select("withFile");
3132 query = query.arg("path", path.into());
3133 query = query.arg_lazy(
3134 "source",
3135 Box::new(move || {
3136 let source = source.clone();
3137 Box::pin(async move { source.into_id().await.unwrap().quote() })
3138 }),
3139 );
3140 Container {
3141 proc: self.proc.clone(),
3142 selection: query,
3143 graphql_client: self.graphql_client.clone(),
3144 }
3145 }
3146 pub fn with_file_opts<'a>(
3154 &self,
3155 path: impl Into<String>,
3156 source: impl IntoID<Id>,
3157 opts: ContainerWithFileOpts<'a>,
3158 ) -> Container {
3159 let mut query = self.selection.select("withFile");
3160 query = query.arg("path", path.into());
3161 query = query.arg_lazy(
3162 "source",
3163 Box::new(move || {
3164 let source = source.clone();
3165 Box::pin(async move { source.into_id().await.unwrap().quote() })
3166 }),
3167 );
3168 if let Some(permissions) = opts.permissions {
3169 query = query.arg("permissions", permissions);
3170 }
3171 if let Some(owner) = opts.owner {
3172 query = query.arg("owner", owner);
3173 }
3174 if let Some(expand) = opts.expand {
3175 query = query.arg("expand", expand);
3176 }
3177 Container {
3178 proc: self.proc.clone(),
3179 selection: query,
3180 graphql_client: self.graphql_client.clone(),
3181 }
3182 }
3183 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3191 let mut query = self.selection.select("withFiles");
3192 query = query.arg("path", path.into());
3193 query = query.arg("sources", sources);
3194 Container {
3195 proc: self.proc.clone(),
3196 selection: query,
3197 graphql_client: self.graphql_client.clone(),
3198 }
3199 }
3200 pub fn with_files_opts<'a>(
3208 &self,
3209 path: impl Into<String>,
3210 sources: Vec<Id>,
3211 opts: ContainerWithFilesOpts<'a>,
3212 ) -> Container {
3213 let mut query = self.selection.select("withFiles");
3214 query = query.arg("path", path.into());
3215 query = query.arg("sources", sources);
3216 if let Some(permissions) = opts.permissions {
3217 query = query.arg("permissions", permissions);
3218 }
3219 if let Some(owner) = opts.owner {
3220 query = query.arg("owner", owner);
3221 }
3222 if let Some(expand) = opts.expand {
3223 query = query.arg("expand", expand);
3224 }
3225 Container {
3226 proc: self.proc.clone(),
3227 selection: query,
3228 graphql_client: self.graphql_client.clone(),
3229 }
3230 }
3231 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3238 let mut query = self.selection.select("withLabel");
3239 query = query.arg("name", name.into());
3240 query = query.arg("value", value.into());
3241 Container {
3242 proc: self.proc.clone(),
3243 selection: query,
3244 graphql_client: self.graphql_client.clone(),
3245 }
3246 }
3247 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3255 let mut query = self.selection.select("withMountedCache");
3256 query = query.arg("path", path.into());
3257 query = query.arg_lazy(
3258 "cache",
3259 Box::new(move || {
3260 let cache = cache.clone();
3261 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3262 }),
3263 );
3264 Container {
3265 proc: self.proc.clone(),
3266 selection: query,
3267 graphql_client: self.graphql_client.clone(),
3268 }
3269 }
3270 pub fn with_mounted_cache_opts<'a>(
3278 &self,
3279 path: impl Into<String>,
3280 cache: impl IntoID<Id>,
3281 opts: ContainerWithMountedCacheOpts<'a>,
3282 ) -> Container {
3283 let mut query = self.selection.select("withMountedCache");
3284 query = query.arg("path", path.into());
3285 query = query.arg_lazy(
3286 "cache",
3287 Box::new(move || {
3288 let cache = cache.clone();
3289 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3290 }),
3291 );
3292 if let Some(source) = opts.source {
3293 query = query.arg("source", source);
3294 }
3295 if let Some(sharing) = opts.sharing {
3296 query = query.arg("sharing", sharing);
3297 }
3298 if let Some(owner) = opts.owner {
3299 query = query.arg("owner", owner);
3300 }
3301 if let Some(expand) = opts.expand {
3302 query = query.arg("expand", expand);
3303 }
3304 Container {
3305 proc: self.proc.clone(),
3306 selection: query,
3307 graphql_client: self.graphql_client.clone(),
3308 }
3309 }
3310 pub fn with_mounted_directory(
3318 &self,
3319 path: impl Into<String>,
3320 source: impl IntoID<Id>,
3321 ) -> Container {
3322 let mut query = self.selection.select("withMountedDirectory");
3323 query = query.arg("path", path.into());
3324 query = query.arg_lazy(
3325 "source",
3326 Box::new(move || {
3327 let source = source.clone();
3328 Box::pin(async move { source.into_id().await.unwrap().quote() })
3329 }),
3330 );
3331 Container {
3332 proc: self.proc.clone(),
3333 selection: query,
3334 graphql_client: self.graphql_client.clone(),
3335 }
3336 }
3337 pub fn with_mounted_directory_opts<'a>(
3345 &self,
3346 path: impl Into<String>,
3347 source: impl IntoID<Id>,
3348 opts: ContainerWithMountedDirectoryOpts<'a>,
3349 ) -> Container {
3350 let mut query = self.selection.select("withMountedDirectory");
3351 query = query.arg("path", path.into());
3352 query = query.arg_lazy(
3353 "source",
3354 Box::new(move || {
3355 let source = source.clone();
3356 Box::pin(async move { source.into_id().await.unwrap().quote() })
3357 }),
3358 );
3359 if let Some(owner) = opts.owner {
3360 query = query.arg("owner", owner);
3361 }
3362 if let Some(read_only) = opts.read_only {
3363 query = query.arg("readOnly", read_only);
3364 }
3365 if let Some(expand) = opts.expand {
3366 query = query.arg("expand", expand);
3367 }
3368 Container {
3369 proc: self.proc.clone(),
3370 selection: query,
3371 graphql_client: self.graphql_client.clone(),
3372 }
3373 }
3374 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3382 let mut query = self.selection.select("withMountedFile");
3383 query = query.arg("path", path.into());
3384 query = query.arg_lazy(
3385 "source",
3386 Box::new(move || {
3387 let source = source.clone();
3388 Box::pin(async move { source.into_id().await.unwrap().quote() })
3389 }),
3390 );
3391 Container {
3392 proc: self.proc.clone(),
3393 selection: query,
3394 graphql_client: self.graphql_client.clone(),
3395 }
3396 }
3397 pub fn with_mounted_file_opts<'a>(
3405 &self,
3406 path: impl Into<String>,
3407 source: impl IntoID<Id>,
3408 opts: ContainerWithMountedFileOpts<'a>,
3409 ) -> Container {
3410 let mut query = self.selection.select("withMountedFile");
3411 query = query.arg("path", path.into());
3412 query = query.arg_lazy(
3413 "source",
3414 Box::new(move || {
3415 let source = source.clone();
3416 Box::pin(async move { source.into_id().await.unwrap().quote() })
3417 }),
3418 );
3419 if let Some(owner) = opts.owner {
3420 query = query.arg("owner", owner);
3421 }
3422 if let Some(expand) = opts.expand {
3423 query = query.arg("expand", expand);
3424 }
3425 Container {
3426 proc: self.proc.clone(),
3427 selection: query,
3428 graphql_client: self.graphql_client.clone(),
3429 }
3430 }
3431 pub fn with_mounted_secret(
3439 &self,
3440 path: impl Into<String>,
3441 source: impl IntoID<Id>,
3442 ) -> Container {
3443 let mut query = self.selection.select("withMountedSecret");
3444 query = query.arg("path", path.into());
3445 query = query.arg_lazy(
3446 "source",
3447 Box::new(move || {
3448 let source = source.clone();
3449 Box::pin(async move { source.into_id().await.unwrap().quote() })
3450 }),
3451 );
3452 Container {
3453 proc: self.proc.clone(),
3454 selection: query,
3455 graphql_client: self.graphql_client.clone(),
3456 }
3457 }
3458 pub fn with_mounted_secret_opts<'a>(
3466 &self,
3467 path: impl Into<String>,
3468 source: impl IntoID<Id>,
3469 opts: ContainerWithMountedSecretOpts<'a>,
3470 ) -> Container {
3471 let mut query = self.selection.select("withMountedSecret");
3472 query = query.arg("path", path.into());
3473 query = query.arg_lazy(
3474 "source",
3475 Box::new(move || {
3476 let source = source.clone();
3477 Box::pin(async move { source.into_id().await.unwrap().quote() })
3478 }),
3479 );
3480 if let Some(owner) = opts.owner {
3481 query = query.arg("owner", owner);
3482 }
3483 if let Some(mode) = opts.mode {
3484 query = query.arg("mode", mode);
3485 }
3486 if let Some(expand) = opts.expand {
3487 query = query.arg("expand", expand);
3488 }
3489 Container {
3490 proc: self.proc.clone(),
3491 selection: query,
3492 graphql_client: self.graphql_client.clone(),
3493 }
3494 }
3495 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3502 let mut query = self.selection.select("withMountedTemp");
3503 query = query.arg("path", path.into());
3504 Container {
3505 proc: self.proc.clone(),
3506 selection: query,
3507 graphql_client: self.graphql_client.clone(),
3508 }
3509 }
3510 pub fn with_mounted_temp_opts(
3517 &self,
3518 path: impl Into<String>,
3519 opts: ContainerWithMountedTempOpts,
3520 ) -> Container {
3521 let mut query = self.selection.select("withMountedTemp");
3522 query = query.arg("path", path.into());
3523 if let Some(size) = opts.size {
3524 query = query.arg("size", size);
3525 }
3526 if let Some(expand) = opts.expand {
3527 query = query.arg("expand", expand);
3528 }
3529 Container {
3530 proc: self.proc.clone(),
3531 selection: query,
3532 graphql_client: self.graphql_client.clone(),
3533 }
3534 }
3535 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3543 let mut query = self.selection.select("withNewFile");
3544 query = query.arg("path", path.into());
3545 query = query.arg("contents", contents.into());
3546 Container {
3547 proc: self.proc.clone(),
3548 selection: query,
3549 graphql_client: self.graphql_client.clone(),
3550 }
3551 }
3552 pub fn with_new_file_opts<'a>(
3560 &self,
3561 path: impl Into<String>,
3562 contents: impl Into<String>,
3563 opts: ContainerWithNewFileOpts<'a>,
3564 ) -> Container {
3565 let mut query = self.selection.select("withNewFile");
3566 query = query.arg("path", path.into());
3567 query = query.arg("contents", contents.into());
3568 if let Some(permissions) = opts.permissions {
3569 query = query.arg("permissions", permissions);
3570 }
3571 if let Some(owner) = opts.owner {
3572 query = query.arg("owner", owner);
3573 }
3574 if let Some(expand) = opts.expand {
3575 query = query.arg("expand", expand);
3576 }
3577 Container {
3578 proc: self.proc.clone(),
3579 selection: query,
3580 graphql_client: self.graphql_client.clone(),
3581 }
3582 }
3583 pub fn with_registry_auth(
3591 &self,
3592 address: impl Into<String>,
3593 username: impl Into<String>,
3594 secret: impl IntoID<Id>,
3595 ) -> Container {
3596 let mut query = self.selection.select("withRegistryAuth");
3597 query = query.arg("address", address.into());
3598 query = query.arg("username", username.into());
3599 query = query.arg_lazy(
3600 "secret",
3601 Box::new(move || {
3602 let secret = secret.clone();
3603 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3604 }),
3605 );
3606 Container {
3607 proc: self.proc.clone(),
3608 selection: query,
3609 graphql_client: self.graphql_client.clone(),
3610 }
3611 }
3612 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3618 let mut query = self.selection.select("withRootfs");
3619 query = query.arg_lazy(
3620 "directory",
3621 Box::new(move || {
3622 let directory = directory.clone();
3623 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3624 }),
3625 );
3626 Container {
3627 proc: self.proc.clone(),
3628 selection: query,
3629 graphql_client: self.graphql_client.clone(),
3630 }
3631 }
3632 pub fn with_secret_variable(
3639 &self,
3640 name: impl Into<String>,
3641 secret: impl IntoID<Id>,
3642 ) -> Container {
3643 let mut query = self.selection.select("withSecretVariable");
3644 query = query.arg("name", name.into());
3645 query = query.arg_lazy(
3646 "secret",
3647 Box::new(move || {
3648 let secret = secret.clone();
3649 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3650 }),
3651 );
3652 Container {
3653 proc: self.proc.clone(),
3654 selection: query,
3655 graphql_client: self.graphql_client.clone(),
3656 }
3657 }
3658 pub fn with_service_binding(
3668 &self,
3669 alias: impl Into<String>,
3670 service: impl IntoID<Id>,
3671 ) -> Container {
3672 let mut query = self.selection.select("withServiceBinding");
3673 query = query.arg("alias", alias.into());
3674 query = query.arg_lazy(
3675 "service",
3676 Box::new(move || {
3677 let service = service.clone();
3678 Box::pin(async move { service.into_id().await.unwrap().quote() })
3679 }),
3680 );
3681 Container {
3682 proc: self.proc.clone(),
3683 selection: query,
3684 graphql_client: self.graphql_client.clone(),
3685 }
3686 }
3687 pub fn with_symlink(
3695 &self,
3696 target: impl Into<String>,
3697 link_name: impl Into<String>,
3698 ) -> Container {
3699 let mut query = self.selection.select("withSymlink");
3700 query = query.arg("target", target.into());
3701 query = query.arg("linkName", link_name.into());
3702 Container {
3703 proc: self.proc.clone(),
3704 selection: query,
3705 graphql_client: self.graphql_client.clone(),
3706 }
3707 }
3708 pub fn with_symlink_opts(
3716 &self,
3717 target: impl Into<String>,
3718 link_name: impl Into<String>,
3719 opts: ContainerWithSymlinkOpts,
3720 ) -> Container {
3721 let mut query = self.selection.select("withSymlink");
3722 query = query.arg("target", target.into());
3723 query = query.arg("linkName", link_name.into());
3724 if let Some(expand) = opts.expand {
3725 query = query.arg("expand", expand);
3726 }
3727 Container {
3728 proc: self.proc.clone(),
3729 selection: query,
3730 graphql_client: self.graphql_client.clone(),
3731 }
3732 }
3733 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3741 let mut query = self.selection.select("withUnixSocket");
3742 query = query.arg("path", path.into());
3743 query = query.arg_lazy(
3744 "source",
3745 Box::new(move || {
3746 let source = source.clone();
3747 Box::pin(async move { source.into_id().await.unwrap().quote() })
3748 }),
3749 );
3750 Container {
3751 proc: self.proc.clone(),
3752 selection: query,
3753 graphql_client: self.graphql_client.clone(),
3754 }
3755 }
3756 pub fn with_unix_socket_opts<'a>(
3764 &self,
3765 path: impl Into<String>,
3766 source: impl IntoID<Id>,
3767 opts: ContainerWithUnixSocketOpts<'a>,
3768 ) -> Container {
3769 let mut query = self.selection.select("withUnixSocket");
3770 query = query.arg("path", path.into());
3771 query = query.arg_lazy(
3772 "source",
3773 Box::new(move || {
3774 let source = source.clone();
3775 Box::pin(async move { source.into_id().await.unwrap().quote() })
3776 }),
3777 );
3778 if let Some(owner) = opts.owner {
3779 query = query.arg("owner", owner);
3780 }
3781 if let Some(expand) = opts.expand {
3782 query = query.arg("expand", expand);
3783 }
3784 Container {
3785 proc: self.proc.clone(),
3786 selection: query,
3787 graphql_client: self.graphql_client.clone(),
3788 }
3789 }
3790 pub fn with_user(&self, name: impl Into<String>) -> Container {
3796 let mut query = self.selection.select("withUser");
3797 query = query.arg("name", name.into());
3798 Container {
3799 proc: self.proc.clone(),
3800 selection: query,
3801 graphql_client: self.graphql_client.clone(),
3802 }
3803 }
3804 pub fn with_volatile_variable(
3812 &self,
3813 name: impl Into<String>,
3814 value: impl Into<String>,
3815 ) -> Container {
3816 let mut query = self.selection.select("withVolatileVariable");
3817 query = query.arg("name", name.into());
3818 query = query.arg("value", value.into());
3819 Container {
3820 proc: self.proc.clone(),
3821 selection: query,
3822 graphql_client: self.graphql_client.clone(),
3823 }
3824 }
3825 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3832 let mut query = self.selection.select("withWorkdir");
3833 query = query.arg("path", path.into());
3834 Container {
3835 proc: self.proc.clone(),
3836 selection: query,
3837 graphql_client: self.graphql_client.clone(),
3838 }
3839 }
3840 pub fn with_workdir_opts(
3847 &self,
3848 path: impl Into<String>,
3849 opts: ContainerWithWorkdirOpts,
3850 ) -> Container {
3851 let mut query = self.selection.select("withWorkdir");
3852 query = query.arg("path", path.into());
3853 if let Some(expand) = opts.expand {
3854 query = query.arg("expand", expand);
3855 }
3856 Container {
3857 proc: self.proc.clone(),
3858 selection: query,
3859 graphql_client: self.graphql_client.clone(),
3860 }
3861 }
3862 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3868 let mut query = self.selection.select("withoutAnnotation");
3869 query = query.arg("name", name.into());
3870 Container {
3871 proc: self.proc.clone(),
3872 selection: query,
3873 graphql_client: self.graphql_client.clone(),
3874 }
3875 }
3876 pub fn without_default_args(&self) -> Container {
3878 let query = self.selection.select("withoutDefaultArgs");
3879 Container {
3880 proc: self.proc.clone(),
3881 selection: query,
3882 graphql_client: self.graphql_client.clone(),
3883 }
3884 }
3885 pub fn without_directory(&self, path: impl Into<String>) -> Container {
3892 let mut query = self.selection.select("withoutDirectory");
3893 query = query.arg("path", path.into());
3894 Container {
3895 proc: self.proc.clone(),
3896 selection: query,
3897 graphql_client: self.graphql_client.clone(),
3898 }
3899 }
3900 pub fn without_directory_opts(
3907 &self,
3908 path: impl Into<String>,
3909 opts: ContainerWithoutDirectoryOpts,
3910 ) -> Container {
3911 let mut query = self.selection.select("withoutDirectory");
3912 query = query.arg("path", path.into());
3913 if let Some(expand) = opts.expand {
3914 query = query.arg("expand", expand);
3915 }
3916 Container {
3917 proc: self.proc.clone(),
3918 selection: query,
3919 graphql_client: self.graphql_client.clone(),
3920 }
3921 }
3922 pub fn without_docker_healthcheck(&self) -> Container {
3924 let query = self.selection.select("withoutDockerHealthcheck");
3925 Container {
3926 proc: self.proc.clone(),
3927 selection: query,
3928 graphql_client: self.graphql_client.clone(),
3929 }
3930 }
3931 pub fn without_entrypoint(&self) -> Container {
3937 let query = self.selection.select("withoutEntrypoint");
3938 Container {
3939 proc: self.proc.clone(),
3940 selection: query,
3941 graphql_client: self.graphql_client.clone(),
3942 }
3943 }
3944 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3950 let mut query = self.selection.select("withoutEntrypoint");
3951 if let Some(keep_default_args) = opts.keep_default_args {
3952 query = query.arg("keepDefaultArgs", keep_default_args);
3953 }
3954 Container {
3955 proc: self.proc.clone(),
3956 selection: query,
3957 graphql_client: self.graphql_client.clone(),
3958 }
3959 }
3960 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3966 let mut query = self.selection.select("withoutEnvVariable");
3967 query = query.arg("name", name.into());
3968 Container {
3969 proc: self.proc.clone(),
3970 selection: query,
3971 graphql_client: self.graphql_client.clone(),
3972 }
3973 }
3974 pub fn without_exposed_port(&self, port: isize) -> Container {
3981 let mut query = self.selection.select("withoutExposedPort");
3982 query = query.arg("port", port);
3983 Container {
3984 proc: self.proc.clone(),
3985 selection: query,
3986 graphql_client: self.graphql_client.clone(),
3987 }
3988 }
3989 pub fn without_exposed_port_opts(
3996 &self,
3997 port: isize,
3998 opts: ContainerWithoutExposedPortOpts,
3999 ) -> Container {
4000 let mut query = self.selection.select("withoutExposedPort");
4001 query = query.arg("port", port);
4002 if let Some(protocol) = opts.protocol {
4003 query = query.arg("protocol", protocol);
4004 }
4005 Container {
4006 proc: self.proc.clone(),
4007 selection: query,
4008 graphql_client: self.graphql_client.clone(),
4009 }
4010 }
4011 pub fn without_file(&self, path: impl Into<String>) -> Container {
4018 let mut query = self.selection.select("withoutFile");
4019 query = query.arg("path", path.into());
4020 Container {
4021 proc: self.proc.clone(),
4022 selection: query,
4023 graphql_client: self.graphql_client.clone(),
4024 }
4025 }
4026 pub fn without_file_opts(
4033 &self,
4034 path: impl Into<String>,
4035 opts: ContainerWithoutFileOpts,
4036 ) -> Container {
4037 let mut query = self.selection.select("withoutFile");
4038 query = query.arg("path", path.into());
4039 if let Some(expand) = opts.expand {
4040 query = query.arg("expand", expand);
4041 }
4042 Container {
4043 proc: self.proc.clone(),
4044 selection: query,
4045 graphql_client: self.graphql_client.clone(),
4046 }
4047 }
4048 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4055 let mut query = self.selection.select("withoutFiles");
4056 query = query.arg(
4057 "paths",
4058 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4059 );
4060 Container {
4061 proc: self.proc.clone(),
4062 selection: query,
4063 graphql_client: self.graphql_client.clone(),
4064 }
4065 }
4066 pub fn without_files_opts(
4073 &self,
4074 paths: Vec<impl Into<String>>,
4075 opts: ContainerWithoutFilesOpts,
4076 ) -> Container {
4077 let mut query = self.selection.select("withoutFiles");
4078 query = query.arg(
4079 "paths",
4080 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4081 );
4082 if let Some(expand) = opts.expand {
4083 query = query.arg("expand", expand);
4084 }
4085 Container {
4086 proc: self.proc.clone(),
4087 selection: query,
4088 graphql_client: self.graphql_client.clone(),
4089 }
4090 }
4091 pub fn without_label(&self, name: impl Into<String>) -> Container {
4097 let mut query = self.selection.select("withoutLabel");
4098 query = query.arg("name", name.into());
4099 Container {
4100 proc: self.proc.clone(),
4101 selection: query,
4102 graphql_client: self.graphql_client.clone(),
4103 }
4104 }
4105 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4112 let mut query = self.selection.select("withoutMount");
4113 query = query.arg("path", path.into());
4114 Container {
4115 proc: self.proc.clone(),
4116 selection: query,
4117 graphql_client: self.graphql_client.clone(),
4118 }
4119 }
4120 pub fn without_mount_opts(
4127 &self,
4128 path: impl Into<String>,
4129 opts: ContainerWithoutMountOpts,
4130 ) -> Container {
4131 let mut query = self.selection.select("withoutMount");
4132 query = query.arg("path", path.into());
4133 if let Some(expand) = opts.expand {
4134 query = query.arg("expand", expand);
4135 }
4136 Container {
4137 proc: self.proc.clone(),
4138 selection: query,
4139 graphql_client: self.graphql_client.clone(),
4140 }
4141 }
4142 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4150 let mut query = self.selection.select("withoutRegistryAuth");
4151 query = query.arg("address", address.into());
4152 Container {
4153 proc: self.proc.clone(),
4154 selection: query,
4155 graphql_client: self.graphql_client.clone(),
4156 }
4157 }
4158 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4164 let mut query = self.selection.select("withoutSecretVariable");
4165 query = query.arg("name", name.into());
4166 Container {
4167 proc: self.proc.clone(),
4168 selection: query,
4169 graphql_client: self.graphql_client.clone(),
4170 }
4171 }
4172 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4179 let mut query = self.selection.select("withoutUnixSocket");
4180 query = query.arg("path", path.into());
4181 Container {
4182 proc: self.proc.clone(),
4183 selection: query,
4184 graphql_client: self.graphql_client.clone(),
4185 }
4186 }
4187 pub fn without_unix_socket_opts(
4194 &self,
4195 path: impl Into<String>,
4196 opts: ContainerWithoutUnixSocketOpts,
4197 ) -> Container {
4198 let mut query = self.selection.select("withoutUnixSocket");
4199 query = query.arg("path", path.into());
4200 if let Some(expand) = opts.expand {
4201 query = query.arg("expand", expand);
4202 }
4203 Container {
4204 proc: self.proc.clone(),
4205 selection: query,
4206 graphql_client: self.graphql_client.clone(),
4207 }
4208 }
4209 pub fn without_user(&self) -> Container {
4212 let query = self.selection.select("withoutUser");
4213 Container {
4214 proc: self.proc.clone(),
4215 selection: query,
4216 graphql_client: self.graphql_client.clone(),
4217 }
4218 }
4219 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4225 let mut query = self.selection.select("withoutVolatileVariable");
4226 query = query.arg("name", name.into());
4227 Container {
4228 proc: self.proc.clone(),
4229 selection: query,
4230 graphql_client: self.graphql_client.clone(),
4231 }
4232 }
4233 pub fn without_workdir(&self) -> Container {
4236 let query = self.selection.select("withoutWorkdir");
4237 Container {
4238 proc: self.proc.clone(),
4239 selection: query,
4240 graphql_client: self.graphql_client.clone(),
4241 }
4242 }
4243 pub async fn workdir(&self) -> Result<String, DaggerError> {
4245 let query = self.selection.select("workdir");
4246 query.execute(self.graphql_client.clone()).await
4247 }
4248}
4249impl Exportable for Container {
4250 fn export(
4251 &self,
4252 path: impl Into<String>,
4253 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4254 let mut query = self.selection.select("export");
4255 query = query.arg("path", path.into());
4256 let graphql_client = self.graphql_client.clone();
4257 async move { query.execute(graphql_client).await }
4258 }
4259 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4260 let query = self.selection.select("id");
4261 let graphql_client = self.graphql_client.clone();
4262 async move { query.execute(graphql_client).await }
4263 }
4264}
4265impl Node for Container {
4266 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4267 let query = self.selection.select("id");
4268 let graphql_client = self.graphql_client.clone();
4269 async move { query.execute(graphql_client).await }
4270 }
4271}
4272impl Syncer for Container {
4273 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4274 let query = self.selection.select("id");
4275 let graphql_client = self.graphql_client.clone();
4276 async move { query.execute(graphql_client).await }
4277 }
4278 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4279 let query = self.selection.select("sync");
4280 let graphql_client = self.graphql_client.clone();
4281 async move { query.execute(graphql_client).await }
4282 }
4283}
4284#[derive(Clone)]
4285pub struct CurrentModule {
4286 pub proc: Option<Arc<DaggerSessionProc>>,
4287 pub selection: Selection,
4288 pub graphql_client: DynGraphQLClient,
4289}
4290#[derive(Builder, Debug, PartialEq)]
4291pub struct CurrentModuleGeneratorsOpts<'a> {
4292 #[builder(setter(into, strip_option), default)]
4294 pub include: Option<Vec<&'a str>>,
4295}
4296#[derive(Builder, Debug, PartialEq)]
4297pub struct CurrentModuleWorkdirOpts<'a> {
4298 #[builder(setter(into, strip_option), default)]
4300 pub exclude: Option<Vec<&'a str>>,
4301 #[builder(setter(into, strip_option), default)]
4303 pub gitignore: Option<bool>,
4304 #[builder(setter(into, strip_option), default)]
4306 pub include: Option<Vec<&'a str>>,
4307}
4308impl IntoID<Id> for CurrentModule {
4309 fn into_id(
4310 self,
4311 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4312 Box::pin(async move { self.id().await })
4313 }
4314}
4315impl Loadable for CurrentModule {
4316 fn graphql_type() -> &'static str {
4317 "CurrentModule"
4318 }
4319 fn from_query(
4320 proc: Option<Arc<DaggerSessionProc>>,
4321 selection: Selection,
4322 graphql_client: DynGraphQLClient,
4323 ) -> Self {
4324 Self {
4325 proc,
4326 selection,
4327 graphql_client,
4328 }
4329 }
4330}
4331impl CurrentModule {
4332 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4334 let query = self.selection.select("dependencies");
4335 let query = query.select("id");
4336 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4337 Ok(ids
4338 .into_iter()
4339 .map(|id| Module {
4340 proc: self.proc.clone(),
4341 selection: crate::querybuilder::query()
4342 .select("node")
4343 .arg("id", &id.0)
4344 .inline_fragment("Module"),
4345 graphql_client: self.graphql_client.clone(),
4346 })
4347 .collect())
4348 }
4349 pub fn generated_context_directory(&self) -> Directory {
4351 let query = self.selection.select("generatedContextDirectory");
4352 Directory {
4353 proc: self.proc.clone(),
4354 selection: query,
4355 graphql_client: self.graphql_client.clone(),
4356 }
4357 }
4358 pub fn generators(&self) -> GeneratorGroup {
4364 let query = self.selection.select("generators");
4365 GeneratorGroup {
4366 proc: self.proc.clone(),
4367 selection: query,
4368 graphql_client: self.graphql_client.clone(),
4369 }
4370 }
4371 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4377 let mut query = self.selection.select("generators");
4378 if let Some(include) = opts.include {
4379 query = query.arg("include", include);
4380 }
4381 GeneratorGroup {
4382 proc: self.proc.clone(),
4383 selection: query,
4384 graphql_client: self.graphql_client.clone(),
4385 }
4386 }
4387 pub async fn id(&self) -> Result<Id, DaggerError> {
4389 let query = self.selection.select("id");
4390 query.execute(self.graphql_client.clone()).await
4391 }
4392 pub async fn name(&self) -> Result<String, DaggerError> {
4394 let query = self.selection.select("name");
4395 query.execute(self.graphql_client.clone()).await
4396 }
4397 pub fn source(&self) -> Directory {
4399 let query = self.selection.select("source");
4400 Directory {
4401 proc: self.proc.clone(),
4402 selection: query,
4403 graphql_client: self.graphql_client.clone(),
4404 }
4405 }
4406 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4413 let mut query = self.selection.select("workdir");
4414 query = query.arg("path", path.into());
4415 Directory {
4416 proc: self.proc.clone(),
4417 selection: query,
4418 graphql_client: self.graphql_client.clone(),
4419 }
4420 }
4421 pub fn workdir_opts<'a>(
4428 &self,
4429 path: impl Into<String>,
4430 opts: CurrentModuleWorkdirOpts<'a>,
4431 ) -> Directory {
4432 let mut query = self.selection.select("workdir");
4433 query = query.arg("path", path.into());
4434 if let Some(exclude) = opts.exclude {
4435 query = query.arg("exclude", exclude);
4436 }
4437 if let Some(include) = opts.include {
4438 query = query.arg("include", include);
4439 }
4440 if let Some(gitignore) = opts.gitignore {
4441 query = query.arg("gitignore", gitignore);
4442 }
4443 Directory {
4444 proc: self.proc.clone(),
4445 selection: query,
4446 graphql_client: self.graphql_client.clone(),
4447 }
4448 }
4449 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4455 let mut query = self.selection.select("workdirFile");
4456 query = query.arg("path", path.into());
4457 File {
4458 proc: self.proc.clone(),
4459 selection: query,
4460 graphql_client: self.graphql_client.clone(),
4461 }
4462 }
4463}
4464impl Node for CurrentModule {
4465 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4466 let query = self.selection.select("id");
4467 let graphql_client = self.graphql_client.clone();
4468 async move { query.execute(graphql_client).await }
4469 }
4470}
4471#[derive(Clone)]
4472pub struct DiffStat {
4473 pub proc: Option<Arc<DaggerSessionProc>>,
4474 pub selection: Selection,
4475 pub graphql_client: DynGraphQLClient,
4476}
4477impl IntoID<Id> for DiffStat {
4478 fn into_id(
4479 self,
4480 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4481 Box::pin(async move { self.id().await })
4482 }
4483}
4484impl Loadable for DiffStat {
4485 fn graphql_type() -> &'static str {
4486 "DiffStat"
4487 }
4488 fn from_query(
4489 proc: Option<Arc<DaggerSessionProc>>,
4490 selection: Selection,
4491 graphql_client: DynGraphQLClient,
4492 ) -> Self {
4493 Self {
4494 proc,
4495 selection,
4496 graphql_client,
4497 }
4498 }
4499}
4500impl DiffStat {
4501 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4503 let query = self.selection.select("addedLines");
4504 query.execute(self.graphql_client.clone()).await
4505 }
4506 pub async fn id(&self) -> Result<Id, DaggerError> {
4508 let query = self.selection.select("id");
4509 query.execute(self.graphql_client.clone()).await
4510 }
4511 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4513 let query = self.selection.select("kind");
4514 query.execute(self.graphql_client.clone()).await
4515 }
4516 pub async fn old_path(&self) -> Result<String, DaggerError> {
4518 let query = self.selection.select("oldPath");
4519 query.execute(self.graphql_client.clone()).await
4520 }
4521 pub async fn path(&self) -> Result<String, DaggerError> {
4523 let query = self.selection.select("path");
4524 query.execute(self.graphql_client.clone()).await
4525 }
4526 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4528 let query = self.selection.select("removedLines");
4529 query.execute(self.graphql_client.clone()).await
4530 }
4531}
4532impl Node for DiffStat {
4533 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4534 let query = self.selection.select("id");
4535 let graphql_client = self.graphql_client.clone();
4536 async move { query.execute(graphql_client).await }
4537 }
4538}
4539#[derive(Clone)]
4540pub struct Directory {
4541 pub proc: Option<Arc<DaggerSessionProc>>,
4542 pub selection: Selection,
4543 pub graphql_client: DynGraphQLClient,
4544}
4545#[derive(Builder, Debug, PartialEq)]
4546pub struct DirectoryAsModuleOpts<'a> {
4547 #[builder(setter(into, strip_option), default)]
4550 pub source_root_path: Option<&'a str>,
4551}
4552#[derive(Builder, Debug, PartialEq)]
4553pub struct DirectoryAsModuleSourceOpts<'a> {
4554 #[builder(setter(into, strip_option), default)]
4557 pub source_root_path: Option<&'a str>,
4558}
4559#[derive(Builder, Debug, PartialEq)]
4560pub struct DirectoryDockerBuildOpts<'a> {
4561 #[builder(setter(into, strip_option), default)]
4563 pub build_args: Option<Vec<BuildArg>>,
4564 #[builder(setter(into, strip_option), default)]
4566 pub dockerfile: Option<&'a str>,
4567 #[builder(setter(into, strip_option), default)]
4570 pub no_init: Option<bool>,
4571 #[builder(setter(into, strip_option), default)]
4573 pub platform: Option<Platform>,
4574 #[builder(setter(into, strip_option), default)]
4577 pub secrets: Option<Vec<Id>>,
4578 #[builder(setter(into, strip_option), default)]
4582 pub ssh: Option<Id>,
4583 #[builder(setter(into, strip_option), default)]
4585 pub target: Option<&'a str>,
4586}
4587#[derive(Builder, Debug, PartialEq)]
4588pub struct DirectoryEntriesOpts<'a> {
4589 #[builder(setter(into, strip_option), default)]
4591 pub path: Option<&'a str>,
4592}
4593#[derive(Builder, Debug, PartialEq)]
4594pub struct DirectoryExistsOpts {
4595 #[builder(setter(into, strip_option), default)]
4597 pub do_not_follow_symlinks: Option<bool>,
4598 #[builder(setter(into, strip_option), default)]
4600 pub expected_type: Option<ExistsType>,
4601}
4602#[derive(Builder, Debug, PartialEq)]
4603pub struct DirectoryExportOpts {
4604 #[builder(setter(into, strip_option), default)]
4606 pub wipe: Option<bool>,
4607}
4608#[derive(Builder, Debug, PartialEq)]
4609pub struct DirectoryFilterOpts<'a> {
4610 #[builder(setter(into, strip_option), default)]
4612 pub exclude: Option<Vec<&'a str>>,
4613 #[builder(setter(into, strip_option), default)]
4615 pub gitignore: Option<bool>,
4616 #[builder(setter(into, strip_option), default)]
4618 pub include: Option<Vec<&'a str>>,
4619}
4620#[derive(Builder, Debug, PartialEq)]
4621pub struct DirectorySearchOpts<'a> {
4622 #[builder(setter(into, strip_option), default)]
4624 pub dotall: Option<bool>,
4625 #[builder(setter(into, strip_option), default)]
4627 pub files_only: Option<bool>,
4628 #[builder(setter(into, strip_option), default)]
4630 pub globs: Option<Vec<&'a str>>,
4631 #[builder(setter(into, strip_option), default)]
4633 pub insensitive: Option<bool>,
4634 #[builder(setter(into, strip_option), default)]
4636 pub limit: Option<isize>,
4637 #[builder(setter(into, strip_option), default)]
4639 pub literal: Option<bool>,
4640 #[builder(setter(into, strip_option), default)]
4642 pub multiline: Option<bool>,
4643 #[builder(setter(into, strip_option), default)]
4645 pub paths: Option<Vec<&'a str>>,
4646 #[builder(setter(into, strip_option), default)]
4648 pub skip_hidden: Option<bool>,
4649 #[builder(setter(into, strip_option), default)]
4651 pub skip_ignored: Option<bool>,
4652}
4653#[derive(Builder, Debug, PartialEq)]
4654pub struct DirectoryStatOpts {
4655 #[builder(setter(into, strip_option), default)]
4657 pub do_not_follow_symlinks: Option<bool>,
4658}
4659#[derive(Builder, Debug, PartialEq)]
4660pub struct DirectoryTerminalOpts<'a> {
4661 #[builder(setter(into, strip_option), default)]
4663 pub cmd: Option<Vec<&'a str>>,
4664 #[builder(setter(into, strip_option), default)]
4666 pub container: Option<Id>,
4667 #[builder(setter(into, strip_option), default)]
4669 pub experimental_privileged_nesting: Option<bool>,
4670 #[builder(setter(into, strip_option), default)]
4672 pub insecure_root_capabilities: Option<bool>,
4673}
4674#[derive(Builder, Debug, PartialEq)]
4675pub struct DirectoryWithDirectoryOpts<'a> {
4676 #[builder(setter(into, strip_option), default)]
4678 pub exclude: Option<Vec<&'a str>>,
4679 #[builder(setter(into, strip_option), default)]
4681 pub gitignore: Option<bool>,
4682 #[builder(setter(into, strip_option), default)]
4684 pub include: Option<Vec<&'a str>>,
4685 #[builder(setter(into, strip_option), default)]
4689 pub owner: Option<&'a str>,
4690 #[builder(setter(into, strip_option), default)]
4692 pub permissions: Option<isize>,
4693}
4694#[derive(Builder, Debug, PartialEq)]
4695pub struct DirectoryWithFileOpts<'a> {
4696 #[builder(setter(into, strip_option), default)]
4700 pub owner: Option<&'a str>,
4701 #[builder(setter(into, strip_option), default)]
4703 pub permissions: Option<isize>,
4704}
4705#[derive(Builder, Debug, PartialEq)]
4706pub struct DirectoryWithFilesOpts {
4707 #[builder(setter(into, strip_option), default)]
4709 pub permissions: Option<isize>,
4710}
4711#[derive(Builder, Debug, PartialEq)]
4712pub struct DirectoryWithNewDirectoryOpts {
4713 #[builder(setter(into, strip_option), default)]
4715 pub permissions: Option<isize>,
4716}
4717#[derive(Builder, Debug, PartialEq)]
4718pub struct DirectoryWithNewFileOpts {
4719 #[builder(setter(into, strip_option), default)]
4721 pub permissions: Option<isize>,
4722}
4723impl IntoID<Id> for Directory {
4724 fn into_id(
4725 self,
4726 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4727 Box::pin(async move { self.id().await })
4728 }
4729}
4730impl Loadable for Directory {
4731 fn graphql_type() -> &'static str {
4732 "Directory"
4733 }
4734 fn from_query(
4735 proc: Option<Arc<DaggerSessionProc>>,
4736 selection: Selection,
4737 graphql_client: DynGraphQLClient,
4738 ) -> Self {
4739 Self {
4740 proc,
4741 selection,
4742 graphql_client,
4743 }
4744 }
4745}
4746impl Directory {
4747 pub fn as_git(&self) -> GitRepository {
4749 let query = self.selection.select("asGit");
4750 GitRepository {
4751 proc: self.proc.clone(),
4752 selection: query,
4753 graphql_client: self.graphql_client.clone(),
4754 }
4755 }
4756 pub fn as_module(&self) -> Module {
4762 let query = self.selection.select("asModule");
4763 Module {
4764 proc: self.proc.clone(),
4765 selection: query,
4766 graphql_client: self.graphql_client.clone(),
4767 }
4768 }
4769 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4775 let mut query = self.selection.select("asModule");
4776 if let Some(source_root_path) = opts.source_root_path {
4777 query = query.arg("sourceRootPath", source_root_path);
4778 }
4779 Module {
4780 proc: self.proc.clone(),
4781 selection: query,
4782 graphql_client: self.graphql_client.clone(),
4783 }
4784 }
4785 pub fn as_module_source(&self) -> ModuleSource {
4791 let query = self.selection.select("asModuleSource");
4792 ModuleSource {
4793 proc: self.proc.clone(),
4794 selection: query,
4795 graphql_client: self.graphql_client.clone(),
4796 }
4797 }
4798 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4804 let mut query = self.selection.select("asModuleSource");
4805 if let Some(source_root_path) = opts.source_root_path {
4806 query = query.arg("sourceRootPath", source_root_path);
4807 }
4808 ModuleSource {
4809 proc: self.proc.clone(),
4810 selection: query,
4811 graphql_client: self.graphql_client.clone(),
4812 }
4813 }
4814 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4821 let mut query = self.selection.select("changes");
4822 query = query.arg_lazy(
4823 "from",
4824 Box::new(move || {
4825 let from = from.clone();
4826 Box::pin(async move { from.into_id().await.unwrap().quote() })
4827 }),
4828 );
4829 Changeset {
4830 proc: self.proc.clone(),
4831 selection: query,
4832 graphql_client: self.graphql_client.clone(),
4833 }
4834 }
4835 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4846 let mut query = self.selection.select("chown");
4847 query = query.arg("path", path.into());
4848 query = query.arg("owner", owner.into());
4849 Directory {
4850 proc: self.proc.clone(),
4851 selection: query,
4852 graphql_client: self.graphql_client.clone(),
4853 }
4854 }
4855 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4861 let mut query = self.selection.select("diff");
4862 query = query.arg_lazy(
4863 "other",
4864 Box::new(move || {
4865 let other = other.clone();
4866 Box::pin(async move { other.into_id().await.unwrap().quote() })
4867 }),
4868 );
4869 Directory {
4870 proc: self.proc.clone(),
4871 selection: query,
4872 graphql_client: self.graphql_client.clone(),
4873 }
4874 }
4875 pub async fn digest(&self) -> Result<String, DaggerError> {
4877 let query = self.selection.select("digest");
4878 query.execute(self.graphql_client.clone()).await
4879 }
4880 pub fn directory(&self, path: impl Into<String>) -> Directory {
4886 let mut query = self.selection.select("directory");
4887 query = query.arg("path", path.into());
4888 Directory {
4889 proc: self.proc.clone(),
4890 selection: query,
4891 graphql_client: self.graphql_client.clone(),
4892 }
4893 }
4894 pub fn docker_build(&self) -> Container {
4900 let query = self.selection.select("dockerBuild");
4901 Container {
4902 proc: self.proc.clone(),
4903 selection: query,
4904 graphql_client: self.graphql_client.clone(),
4905 }
4906 }
4907 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4913 let mut query = self.selection.select("dockerBuild");
4914 if let Some(dockerfile) = opts.dockerfile {
4915 query = query.arg("dockerfile", dockerfile);
4916 }
4917 if let Some(platform) = opts.platform {
4918 query = query.arg("platform", platform);
4919 }
4920 if let Some(build_args) = opts.build_args {
4921 query = query.arg("buildArgs", build_args);
4922 }
4923 if let Some(target) = opts.target {
4924 query = query.arg("target", target);
4925 }
4926 if let Some(secrets) = opts.secrets {
4927 query = query.arg("secrets", secrets);
4928 }
4929 if let Some(no_init) = opts.no_init {
4930 query = query.arg("noInit", no_init);
4931 }
4932 if let Some(ssh) = opts.ssh {
4933 query = query.arg("ssh", ssh);
4934 }
4935 Container {
4936 proc: self.proc.clone(),
4937 selection: query,
4938 graphql_client: self.graphql_client.clone(),
4939 }
4940 }
4941 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4947 let query = self.selection.select("entries");
4948 query.execute(self.graphql_client.clone()).await
4949 }
4950 pub async fn entries_opts<'a>(
4956 &self,
4957 opts: DirectoryEntriesOpts<'a>,
4958 ) -> Result<Vec<String>, DaggerError> {
4959 let mut query = self.selection.select("entries");
4960 if let Some(path) = opts.path {
4961 query = query.arg("path", path);
4962 }
4963 query.execute(self.graphql_client.clone()).await
4964 }
4965 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4972 let mut query = self.selection.select("exists");
4973 query = query.arg("path", path.into());
4974 query.execute(self.graphql_client.clone()).await
4975 }
4976 pub async fn exists_opts(
4983 &self,
4984 path: impl Into<String>,
4985 opts: DirectoryExistsOpts,
4986 ) -> Result<bool, DaggerError> {
4987 let mut query = self.selection.select("exists");
4988 query = query.arg("path", path.into());
4989 if let Some(expected_type) = opts.expected_type {
4990 query = query.arg("expectedType", expected_type);
4991 }
4992 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4993 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4994 }
4995 query.execute(self.graphql_client.clone()).await
4996 }
4997 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5004 let mut query = self.selection.select("export");
5005 query = query.arg("path", path.into());
5006 query.execute(self.graphql_client.clone()).await
5007 }
5008 pub async fn export_opts(
5015 &self,
5016 path: impl Into<String>,
5017 opts: DirectoryExportOpts,
5018 ) -> Result<String, DaggerError> {
5019 let mut query = self.selection.select("export");
5020 query = query.arg("path", path.into());
5021 if let Some(wipe) = opts.wipe {
5022 query = query.arg("wipe", wipe);
5023 }
5024 query.execute(self.graphql_client.clone()).await
5025 }
5026 pub fn file(&self, path: impl Into<String>) -> File {
5032 let mut query = self.selection.select("file");
5033 query = query.arg("path", path.into());
5034 File {
5035 proc: self.proc.clone(),
5036 selection: query,
5037 graphql_client: self.graphql_client.clone(),
5038 }
5039 }
5040 pub fn filter(&self) -> Directory {
5046 let query = self.selection.select("filter");
5047 Directory {
5048 proc: self.proc.clone(),
5049 selection: query,
5050 graphql_client: self.graphql_client.clone(),
5051 }
5052 }
5053 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5059 let mut query = self.selection.select("filter");
5060 if let Some(exclude) = opts.exclude {
5061 query = query.arg("exclude", exclude);
5062 }
5063 if let Some(include) = opts.include {
5064 query = query.arg("include", include);
5065 }
5066 if let Some(gitignore) = opts.gitignore {
5067 query = query.arg("gitignore", gitignore);
5068 }
5069 Directory {
5070 proc: self.proc.clone(),
5071 selection: query,
5072 graphql_client: self.graphql_client.clone(),
5073 }
5074 }
5075 pub async fn find_up(
5082 &self,
5083 name: impl Into<String>,
5084 start: impl Into<String>,
5085 ) -> Result<String, DaggerError> {
5086 let mut query = self.selection.select("findUp");
5087 query = query.arg("name", name.into());
5088 query = query.arg("start", start.into());
5089 query.execute(self.graphql_client.clone()).await
5090 }
5091 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5097 let mut query = self.selection.select("glob");
5098 query = query.arg("pattern", pattern.into());
5099 query.execute(self.graphql_client.clone()).await
5100 }
5101 pub async fn id(&self) -> Result<Id, DaggerError> {
5103 let query = self.selection.select("id");
5104 query.execute(self.graphql_client.clone()).await
5105 }
5106 pub async fn name(&self) -> Result<String, DaggerError> {
5108 let query = self.selection.select("name");
5109 query.execute(self.graphql_client.clone()).await
5110 }
5111 pub async fn search(
5119 &self,
5120 pattern: impl Into<String>,
5121 ) -> Result<Vec<SearchResult>, DaggerError> {
5122 let mut query = self.selection.select("search");
5123 query = query.arg("pattern", pattern.into());
5124 let query = query.select("id");
5125 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5126 Ok(ids
5127 .into_iter()
5128 .map(|id| SearchResult {
5129 proc: self.proc.clone(),
5130 selection: crate::querybuilder::query()
5131 .select("node")
5132 .arg("id", &id.0)
5133 .inline_fragment("SearchResult"),
5134 graphql_client: self.graphql_client.clone(),
5135 })
5136 .collect())
5137 }
5138 pub async fn search_opts<'a>(
5146 &self,
5147 pattern: impl Into<String>,
5148 opts: DirectorySearchOpts<'a>,
5149 ) -> Result<Vec<SearchResult>, DaggerError> {
5150 let mut query = self.selection.select("search");
5151 query = query.arg("pattern", pattern.into());
5152 if let Some(paths) = opts.paths {
5153 query = query.arg("paths", paths);
5154 }
5155 if let Some(globs) = opts.globs {
5156 query = query.arg("globs", globs);
5157 }
5158 if let Some(literal) = opts.literal {
5159 query = query.arg("literal", literal);
5160 }
5161 if let Some(multiline) = opts.multiline {
5162 query = query.arg("multiline", multiline);
5163 }
5164 if let Some(dotall) = opts.dotall {
5165 query = query.arg("dotall", dotall);
5166 }
5167 if let Some(insensitive) = opts.insensitive {
5168 query = query.arg("insensitive", insensitive);
5169 }
5170 if let Some(skip_ignored) = opts.skip_ignored {
5171 query = query.arg("skipIgnored", skip_ignored);
5172 }
5173 if let Some(skip_hidden) = opts.skip_hidden {
5174 query = query.arg("skipHidden", skip_hidden);
5175 }
5176 if let Some(files_only) = opts.files_only {
5177 query = query.arg("filesOnly", files_only);
5178 }
5179 if let Some(limit) = opts.limit {
5180 query = query.arg("limit", limit);
5181 }
5182 let query = query.select("id");
5183 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5184 Ok(ids
5185 .into_iter()
5186 .map(|id| SearchResult {
5187 proc: self.proc.clone(),
5188 selection: crate::querybuilder::query()
5189 .select("node")
5190 .arg("id", &id.0)
5191 .inline_fragment("SearchResult"),
5192 graphql_client: self.graphql_client.clone(),
5193 })
5194 .collect())
5195 }
5196 pub fn stat(&self, path: impl Into<String>) -> Stat {
5203 let mut query = self.selection.select("stat");
5204 query = query.arg("path", path.into());
5205 Stat {
5206 proc: self.proc.clone(),
5207 selection: query,
5208 graphql_client: self.graphql_client.clone(),
5209 }
5210 }
5211 pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5218 let mut query = self.selection.select("stat");
5219 query = query.arg("path", path.into());
5220 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5221 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5222 }
5223 Stat {
5224 proc: self.proc.clone(),
5225 selection: query,
5226 graphql_client: self.graphql_client.clone(),
5227 }
5228 }
5229 pub async fn sync(&self) -> Result<Directory, DaggerError> {
5231 let query = self.selection.select("sync");
5232 let id: Id = query.execute(self.graphql_client.clone()).await?;
5233 Ok(Directory {
5234 proc: self.proc.clone(),
5235 selection: query
5236 .root()
5237 .select("node")
5238 .arg("id", &id.0)
5239 .inline_fragment("Directory"),
5240 graphql_client: self.graphql_client.clone(),
5241 })
5242 }
5243 pub fn terminal(&self) -> Directory {
5249 let query = self.selection.select("terminal");
5250 Directory {
5251 proc: self.proc.clone(),
5252 selection: query,
5253 graphql_client: self.graphql_client.clone(),
5254 }
5255 }
5256 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5262 let mut query = self.selection.select("terminal");
5263 if let Some(container) = opts.container {
5264 query = query.arg("container", container);
5265 }
5266 if let Some(cmd) = opts.cmd {
5267 query = query.arg("cmd", cmd);
5268 }
5269 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5270 query = query.arg(
5271 "experimentalPrivilegedNesting",
5272 experimental_privileged_nesting,
5273 );
5274 }
5275 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5276 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5277 }
5278 Directory {
5279 proc: self.proc.clone(),
5280 selection: query,
5281 graphql_client: self.graphql_client.clone(),
5282 }
5283 }
5284 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5290 let mut query = self.selection.select("withChanges");
5291 query = query.arg_lazy(
5292 "changes",
5293 Box::new(move || {
5294 let changes = changes.clone();
5295 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5296 }),
5297 );
5298 Directory {
5299 proc: self.proc.clone(),
5300 selection: query,
5301 graphql_client: self.graphql_client.clone(),
5302 }
5303 }
5304 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5312 let mut query = self.selection.select("withDirectory");
5313 query = query.arg("path", path.into());
5314 query = query.arg_lazy(
5315 "source",
5316 Box::new(move || {
5317 let source = source.clone();
5318 Box::pin(async move { source.into_id().await.unwrap().quote() })
5319 }),
5320 );
5321 Directory {
5322 proc: self.proc.clone(),
5323 selection: query,
5324 graphql_client: self.graphql_client.clone(),
5325 }
5326 }
5327 pub fn with_directory_opts<'a>(
5335 &self,
5336 path: impl Into<String>,
5337 source: impl IntoID<Id>,
5338 opts: DirectoryWithDirectoryOpts<'a>,
5339 ) -> Directory {
5340 let mut query = self.selection.select("withDirectory");
5341 query = query.arg("path", path.into());
5342 query = query.arg_lazy(
5343 "source",
5344 Box::new(move || {
5345 let source = source.clone();
5346 Box::pin(async move { source.into_id().await.unwrap().quote() })
5347 }),
5348 );
5349 if let Some(exclude) = opts.exclude {
5350 query = query.arg("exclude", exclude);
5351 }
5352 if let Some(include) = opts.include {
5353 query = query.arg("include", include);
5354 }
5355 if let Some(gitignore) = opts.gitignore {
5356 query = query.arg("gitignore", gitignore);
5357 }
5358 if let Some(owner) = opts.owner {
5359 query = query.arg("owner", owner);
5360 }
5361 if let Some(permissions) = opts.permissions {
5362 query = query.arg("permissions", permissions);
5363 }
5364 Directory {
5365 proc: self.proc.clone(),
5366 selection: query,
5367 graphql_client: self.graphql_client.clone(),
5368 }
5369 }
5370 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5376 let mut query = self.selection.select("withError");
5377 query = query.arg("err", err.into());
5378 Directory {
5379 proc: self.proc.clone(),
5380 selection: query,
5381 graphql_client: self.graphql_client.clone(),
5382 }
5383 }
5384 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5392 let mut query = self.selection.select("withFile");
5393 query = query.arg("path", path.into());
5394 query = query.arg_lazy(
5395 "source",
5396 Box::new(move || {
5397 let source = source.clone();
5398 Box::pin(async move { source.into_id().await.unwrap().quote() })
5399 }),
5400 );
5401 Directory {
5402 proc: self.proc.clone(),
5403 selection: query,
5404 graphql_client: self.graphql_client.clone(),
5405 }
5406 }
5407 pub fn with_file_opts<'a>(
5415 &self,
5416 path: impl Into<String>,
5417 source: impl IntoID<Id>,
5418 opts: DirectoryWithFileOpts<'a>,
5419 ) -> Directory {
5420 let mut query = self.selection.select("withFile");
5421 query = query.arg("path", path.into());
5422 query = query.arg_lazy(
5423 "source",
5424 Box::new(move || {
5425 let source = source.clone();
5426 Box::pin(async move { source.into_id().await.unwrap().quote() })
5427 }),
5428 );
5429 if let Some(permissions) = opts.permissions {
5430 query = query.arg("permissions", permissions);
5431 }
5432 if let Some(owner) = opts.owner {
5433 query = query.arg("owner", owner);
5434 }
5435 Directory {
5436 proc: self.proc.clone(),
5437 selection: query,
5438 graphql_client: self.graphql_client.clone(),
5439 }
5440 }
5441 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5449 let mut query = self.selection.select("withFiles");
5450 query = query.arg("path", path.into());
5451 query = query.arg("sources", sources);
5452 Directory {
5453 proc: self.proc.clone(),
5454 selection: query,
5455 graphql_client: self.graphql_client.clone(),
5456 }
5457 }
5458 pub fn with_files_opts(
5466 &self,
5467 path: impl Into<String>,
5468 sources: Vec<Id>,
5469 opts: DirectoryWithFilesOpts,
5470 ) -> Directory {
5471 let mut query = self.selection.select("withFiles");
5472 query = query.arg("path", path.into());
5473 query = query.arg("sources", sources);
5474 if let Some(permissions) = opts.permissions {
5475 query = query.arg("permissions", permissions);
5476 }
5477 Directory {
5478 proc: self.proc.clone(),
5479 selection: query,
5480 graphql_client: self.graphql_client.clone(),
5481 }
5482 }
5483 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5490 let mut query = self.selection.select("withNewDirectory");
5491 query = query.arg("path", path.into());
5492 Directory {
5493 proc: self.proc.clone(),
5494 selection: query,
5495 graphql_client: self.graphql_client.clone(),
5496 }
5497 }
5498 pub fn with_new_directory_opts(
5505 &self,
5506 path: impl Into<String>,
5507 opts: DirectoryWithNewDirectoryOpts,
5508 ) -> Directory {
5509 let mut query = self.selection.select("withNewDirectory");
5510 query = query.arg("path", path.into());
5511 if let Some(permissions) = opts.permissions {
5512 query = query.arg("permissions", permissions);
5513 }
5514 Directory {
5515 proc: self.proc.clone(),
5516 selection: query,
5517 graphql_client: self.graphql_client.clone(),
5518 }
5519 }
5520 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5528 let mut query = self.selection.select("withNewFile");
5529 query = query.arg("path", path.into());
5530 query = query.arg("contents", contents.into());
5531 Directory {
5532 proc: self.proc.clone(),
5533 selection: query,
5534 graphql_client: self.graphql_client.clone(),
5535 }
5536 }
5537 pub fn with_new_file_opts(
5545 &self,
5546 path: impl Into<String>,
5547 contents: impl Into<String>,
5548 opts: DirectoryWithNewFileOpts,
5549 ) -> Directory {
5550 let mut query = self.selection.select("withNewFile");
5551 query = query.arg("path", path.into());
5552 query = query.arg("contents", contents.into());
5553 if let Some(permissions) = opts.permissions {
5554 query = query.arg("permissions", permissions);
5555 }
5556 Directory {
5557 proc: self.proc.clone(),
5558 selection: query,
5559 graphql_client: self.graphql_client.clone(),
5560 }
5561 }
5562 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5568 let mut query = self.selection.select("withPatch");
5569 query = query.arg("patch", patch.into());
5570 Directory {
5571 proc: self.proc.clone(),
5572 selection: query,
5573 graphql_client: self.graphql_client.clone(),
5574 }
5575 }
5576 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5582 let mut query = self.selection.select("withPatchFile");
5583 query = query.arg_lazy(
5584 "patch",
5585 Box::new(move || {
5586 let patch = patch.clone();
5587 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5588 }),
5589 );
5590 Directory {
5591 proc: self.proc.clone(),
5592 selection: query,
5593 graphql_client: self.graphql_client.clone(),
5594 }
5595 }
5596 pub fn with_symlink(
5603 &self,
5604 target: impl Into<String>,
5605 link_name: impl Into<String>,
5606 ) -> Directory {
5607 let mut query = self.selection.select("withSymlink");
5608 query = query.arg("target", target.into());
5609 query = query.arg("linkName", link_name.into());
5610 Directory {
5611 proc: self.proc.clone(),
5612 selection: query,
5613 graphql_client: self.graphql_client.clone(),
5614 }
5615 }
5616 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5624 let mut query = self.selection.select("withTimestamps");
5625 query = query.arg("timestamp", timestamp);
5626 Directory {
5627 proc: self.proc.clone(),
5628 selection: query,
5629 graphql_client: self.graphql_client.clone(),
5630 }
5631 }
5632 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5638 let mut query = self.selection.select("withoutDirectory");
5639 query = query.arg("path", path.into());
5640 Directory {
5641 proc: self.proc.clone(),
5642 selection: query,
5643 graphql_client: self.graphql_client.clone(),
5644 }
5645 }
5646 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5652 let mut query = self.selection.select("withoutFile");
5653 query = query.arg("path", path.into());
5654 Directory {
5655 proc: self.proc.clone(),
5656 selection: query,
5657 graphql_client: self.graphql_client.clone(),
5658 }
5659 }
5660 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5666 let mut query = self.selection.select("withoutFiles");
5667 query = query.arg(
5668 "paths",
5669 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5670 );
5671 Directory {
5672 proc: self.proc.clone(),
5673 selection: query,
5674 graphql_client: self.graphql_client.clone(),
5675 }
5676 }
5677}
5678impl Exportable for Directory {
5679 fn export(
5680 &self,
5681 path: impl Into<String>,
5682 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5683 let mut query = self.selection.select("export");
5684 query = query.arg("path", path.into());
5685 let graphql_client = self.graphql_client.clone();
5686 async move { query.execute(graphql_client).await }
5687 }
5688 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5689 let query = self.selection.select("id");
5690 let graphql_client = self.graphql_client.clone();
5691 async move { query.execute(graphql_client).await }
5692 }
5693}
5694impl Node for Directory {
5695 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5696 let query = self.selection.select("id");
5697 let graphql_client = self.graphql_client.clone();
5698 async move { query.execute(graphql_client).await }
5699 }
5700}
5701impl Syncer for Directory {
5702 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5703 let query = self.selection.select("id");
5704 let graphql_client = self.graphql_client.clone();
5705 async move { query.execute(graphql_client).await }
5706 }
5707 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5708 let query = self.selection.select("sync");
5709 let graphql_client = self.graphql_client.clone();
5710 async move { query.execute(graphql_client).await }
5711 }
5712}
5713#[derive(Clone)]
5714pub struct Engine {
5715 pub proc: Option<Arc<DaggerSessionProc>>,
5716 pub selection: Selection,
5717 pub graphql_client: DynGraphQLClient,
5718}
5719impl IntoID<Id> for Engine {
5720 fn into_id(
5721 self,
5722 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5723 Box::pin(async move { self.id().await })
5724 }
5725}
5726impl Loadable for Engine {
5727 fn graphql_type() -> &'static str {
5728 "Engine"
5729 }
5730 fn from_query(
5731 proc: Option<Arc<DaggerSessionProc>>,
5732 selection: Selection,
5733 graphql_client: DynGraphQLClient,
5734 ) -> Self {
5735 Self {
5736 proc,
5737 selection,
5738 graphql_client,
5739 }
5740 }
5741}
5742impl Engine {
5743 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5745 let query = self.selection.select("clients");
5746 query.execute(self.graphql_client.clone()).await
5747 }
5748 pub async fn id(&self) -> Result<Id, DaggerError> {
5750 let query = self.selection.select("id");
5751 query.execute(self.graphql_client.clone()).await
5752 }
5753 pub fn local_cache(&self) -> EngineCache {
5755 let query = self.selection.select("localCache");
5756 EngineCache {
5757 proc: self.proc.clone(),
5758 selection: query,
5759 graphql_client: self.graphql_client.clone(),
5760 }
5761 }
5762 pub async fn name(&self) -> Result<String, DaggerError> {
5764 let query = self.selection.select("name");
5765 query.execute(self.graphql_client.clone()).await
5766 }
5767}
5768impl Node for Engine {
5769 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5770 let query = self.selection.select("id");
5771 let graphql_client = self.graphql_client.clone();
5772 async move { query.execute(graphql_client).await }
5773 }
5774}
5775#[derive(Clone)]
5776pub struct EngineCache {
5777 pub proc: Option<Arc<DaggerSessionProc>>,
5778 pub selection: Selection,
5779 pub graphql_client: DynGraphQLClient,
5780}
5781#[derive(Builder, Debug, PartialEq)]
5782pub struct EngineCacheEntrySetOpts<'a> {
5783 #[builder(setter(into, strip_option), default)]
5784 pub key: Option<&'a str>,
5785}
5786#[derive(Builder, Debug, PartialEq)]
5787pub struct EngineCachePruneOpts<'a> {
5788 #[builder(setter(into, strip_option), default)]
5790 pub max_used_space: Option<&'a str>,
5791 #[builder(setter(into, strip_option), default)]
5793 pub min_free_space: Option<&'a str>,
5794 #[builder(setter(into, strip_option), default)]
5796 pub reserved_space: Option<&'a str>,
5797 #[builder(setter(into, strip_option), default)]
5799 pub target_space: Option<&'a str>,
5800 #[builder(setter(into, strip_option), default)]
5802 pub use_default_policy: Option<bool>,
5803}
5804impl IntoID<Id> for EngineCache {
5805 fn into_id(
5806 self,
5807 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5808 Box::pin(async move { self.id().await })
5809 }
5810}
5811impl Loadable for EngineCache {
5812 fn graphql_type() -> &'static str {
5813 "EngineCache"
5814 }
5815 fn from_query(
5816 proc: Option<Arc<DaggerSessionProc>>,
5817 selection: Selection,
5818 graphql_client: DynGraphQLClient,
5819 ) -> Self {
5820 Self {
5821 proc,
5822 selection,
5823 graphql_client,
5824 }
5825 }
5826}
5827impl EngineCache {
5828 pub fn entry_set(&self) -> EngineCacheEntrySet {
5834 let query = self.selection.select("entrySet");
5835 EngineCacheEntrySet {
5836 proc: self.proc.clone(),
5837 selection: query,
5838 graphql_client: self.graphql_client.clone(),
5839 }
5840 }
5841 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5847 let mut query = self.selection.select("entrySet");
5848 if let Some(key) = opts.key {
5849 query = query.arg("key", key);
5850 }
5851 EngineCacheEntrySet {
5852 proc: self.proc.clone(),
5853 selection: query,
5854 graphql_client: self.graphql_client.clone(),
5855 }
5856 }
5857 pub async fn id(&self) -> Result<Id, DaggerError> {
5859 let query = self.selection.select("id");
5860 query.execute(self.graphql_client.clone()).await
5861 }
5862 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5864 let query = self.selection.select("maxUsedSpace");
5865 query.execute(self.graphql_client.clone()).await
5866 }
5867 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5869 let query = self.selection.select("minFreeSpace");
5870 query.execute(self.graphql_client.clone()).await
5871 }
5872 pub async fn prune(&self) -> Result<Void, DaggerError> {
5878 let query = self.selection.select("prune");
5879 query.execute(self.graphql_client.clone()).await
5880 }
5881 pub async fn prune_opts<'a>(
5887 &self,
5888 opts: EngineCachePruneOpts<'a>,
5889 ) -> Result<Void, DaggerError> {
5890 let mut query = self.selection.select("prune");
5891 if let Some(use_default_policy) = opts.use_default_policy {
5892 query = query.arg("useDefaultPolicy", use_default_policy);
5893 }
5894 if let Some(max_used_space) = opts.max_used_space {
5895 query = query.arg("maxUsedSpace", max_used_space);
5896 }
5897 if let Some(reserved_space) = opts.reserved_space {
5898 query = query.arg("reservedSpace", reserved_space);
5899 }
5900 if let Some(min_free_space) = opts.min_free_space {
5901 query = query.arg("minFreeSpace", min_free_space);
5902 }
5903 if let Some(target_space) = opts.target_space {
5904 query = query.arg("targetSpace", target_space);
5905 }
5906 query.execute(self.graphql_client.clone()).await
5907 }
5908 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5910 let query = self.selection.select("reservedSpace");
5911 query.execute(self.graphql_client.clone()).await
5912 }
5913 pub async fn target_space(&self) -> Result<isize, DaggerError> {
5915 let query = self.selection.select("targetSpace");
5916 query.execute(self.graphql_client.clone()).await
5917 }
5918}
5919impl Node for EngineCache {
5920 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5921 let query = self.selection.select("id");
5922 let graphql_client = self.graphql_client.clone();
5923 async move { query.execute(graphql_client).await }
5924 }
5925}
5926#[derive(Clone)]
5927pub struct EngineCacheEntry {
5928 pub proc: Option<Arc<DaggerSessionProc>>,
5929 pub selection: Selection,
5930 pub graphql_client: DynGraphQLClient,
5931}
5932impl IntoID<Id> for EngineCacheEntry {
5933 fn into_id(
5934 self,
5935 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5936 Box::pin(async move { self.id().await })
5937 }
5938}
5939impl Loadable for EngineCacheEntry {
5940 fn graphql_type() -> &'static str {
5941 "EngineCacheEntry"
5942 }
5943 fn from_query(
5944 proc: Option<Arc<DaggerSessionProc>>,
5945 selection: Selection,
5946 graphql_client: DynGraphQLClient,
5947 ) -> Self {
5948 Self {
5949 proc,
5950 selection,
5951 graphql_client,
5952 }
5953 }
5954}
5955impl EngineCacheEntry {
5956 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5958 let query = self.selection.select("activelyUsed");
5959 query.execute(self.graphql_client.clone()).await
5960 }
5961 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5963 let query = self.selection.select("createdTimeUnixNano");
5964 query.execute(self.graphql_client.clone()).await
5965 }
5966 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
5968 let query = self.selection.select("dagqlCall");
5969 query.execute(self.graphql_client.clone()).await
5970 }
5971 pub async fn description(&self) -> Result<String, DaggerError> {
5973 let query = self.selection.select("description");
5974 query.execute(self.graphql_client.clone()).await
5975 }
5976 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5978 let query = self.selection.select("diskSpaceBytes");
5979 query.execute(self.graphql_client.clone()).await
5980 }
5981 pub async fn id(&self) -> Result<Id, DaggerError> {
5983 let query = self.selection.select("id");
5984 query.execute(self.graphql_client.clone()).await
5985 }
5986 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5988 let query = self.selection.select("mostRecentUseTimeUnixNano");
5989 query.execute(self.graphql_client.clone()).await
5990 }
5991 pub async fn record_type(&self) -> Result<String, DaggerError> {
5993 let query = self.selection.select("recordType");
5994 query.execute(self.graphql_client.clone()).await
5995 }
5996 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
5998 let query = self.selection.select("recordTypes");
5999 query.execute(self.graphql_client.clone()).await
6000 }
6001}
6002impl Node for EngineCacheEntry {
6003 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6004 let query = self.selection.select("id");
6005 let graphql_client = self.graphql_client.clone();
6006 async move { query.execute(graphql_client).await }
6007 }
6008}
6009#[derive(Clone)]
6010pub struct EngineCacheEntrySet {
6011 pub proc: Option<Arc<DaggerSessionProc>>,
6012 pub selection: Selection,
6013 pub graphql_client: DynGraphQLClient,
6014}
6015impl IntoID<Id> for EngineCacheEntrySet {
6016 fn into_id(
6017 self,
6018 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6019 Box::pin(async move { self.id().await })
6020 }
6021}
6022impl Loadable for EngineCacheEntrySet {
6023 fn graphql_type() -> &'static str {
6024 "EngineCacheEntrySet"
6025 }
6026 fn from_query(
6027 proc: Option<Arc<DaggerSessionProc>>,
6028 selection: Selection,
6029 graphql_client: DynGraphQLClient,
6030 ) -> Self {
6031 Self {
6032 proc,
6033 selection,
6034 graphql_client,
6035 }
6036 }
6037}
6038impl EngineCacheEntrySet {
6039 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6041 let query = self.selection.select("diskSpaceBytes");
6042 query.execute(self.graphql_client.clone()).await
6043 }
6044 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6046 let query = self.selection.select("entries");
6047 let query = query.select("id");
6048 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6049 Ok(ids
6050 .into_iter()
6051 .map(|id| EngineCacheEntry {
6052 proc: self.proc.clone(),
6053 selection: crate::querybuilder::query()
6054 .select("node")
6055 .arg("id", &id.0)
6056 .inline_fragment("EngineCacheEntry"),
6057 graphql_client: self.graphql_client.clone(),
6058 })
6059 .collect())
6060 }
6061 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6063 let query = self.selection.select("entryCount");
6064 query.execute(self.graphql_client.clone()).await
6065 }
6066 pub async fn id(&self) -> Result<Id, DaggerError> {
6068 let query = self.selection.select("id");
6069 query.execute(self.graphql_client.clone()).await
6070 }
6071}
6072impl Node for EngineCacheEntrySet {
6073 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6074 let query = self.selection.select("id");
6075 let graphql_client = self.graphql_client.clone();
6076 async move { query.execute(graphql_client).await }
6077 }
6078}
6079#[derive(Clone)]
6080pub struct EnumTypeDef {
6081 pub proc: Option<Arc<DaggerSessionProc>>,
6082 pub selection: Selection,
6083 pub graphql_client: DynGraphQLClient,
6084}
6085impl IntoID<Id> for EnumTypeDef {
6086 fn into_id(
6087 self,
6088 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6089 Box::pin(async move { self.id().await })
6090 }
6091}
6092impl Loadable for EnumTypeDef {
6093 fn graphql_type() -> &'static str {
6094 "EnumTypeDef"
6095 }
6096 fn from_query(
6097 proc: Option<Arc<DaggerSessionProc>>,
6098 selection: Selection,
6099 graphql_client: DynGraphQLClient,
6100 ) -> Self {
6101 Self {
6102 proc,
6103 selection,
6104 graphql_client,
6105 }
6106 }
6107}
6108impl EnumTypeDef {
6109 pub async fn description(&self) -> Result<String, DaggerError> {
6111 let query = self.selection.select("description");
6112 query.execute(self.graphql_client.clone()).await
6113 }
6114 pub async fn id(&self) -> Result<Id, DaggerError> {
6116 let query = self.selection.select("id");
6117 query.execute(self.graphql_client.clone()).await
6118 }
6119 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6121 let query = self.selection.select("members");
6122 let query = query.select("id");
6123 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6124 Ok(ids
6125 .into_iter()
6126 .map(|id| EnumValueTypeDef {
6127 proc: self.proc.clone(),
6128 selection: crate::querybuilder::query()
6129 .select("node")
6130 .arg("id", &id.0)
6131 .inline_fragment("EnumValueTypeDef"),
6132 graphql_client: self.graphql_client.clone(),
6133 })
6134 .collect())
6135 }
6136 pub async fn name(&self) -> Result<String, DaggerError> {
6138 let query = self.selection.select("name");
6139 query.execute(self.graphql_client.clone()).await
6140 }
6141 pub fn source_map(&self) -> SourceMap {
6143 let query = self.selection.select("sourceMap");
6144 SourceMap {
6145 proc: self.proc.clone(),
6146 selection: query,
6147 graphql_client: self.graphql_client.clone(),
6148 }
6149 }
6150 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6152 let query = self.selection.select("sourceModuleName");
6153 query.execute(self.graphql_client.clone()).await
6154 }
6155 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6157 let query = self.selection.select("values");
6158 let query = query.select("id");
6159 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6160 Ok(ids
6161 .into_iter()
6162 .map(|id| EnumValueTypeDef {
6163 proc: self.proc.clone(),
6164 selection: crate::querybuilder::query()
6165 .select("node")
6166 .arg("id", &id.0)
6167 .inline_fragment("EnumValueTypeDef"),
6168 graphql_client: self.graphql_client.clone(),
6169 })
6170 .collect())
6171 }
6172}
6173impl Node for EnumTypeDef {
6174 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6175 let query = self.selection.select("id");
6176 let graphql_client = self.graphql_client.clone();
6177 async move { query.execute(graphql_client).await }
6178 }
6179}
6180#[derive(Clone)]
6181pub struct EnumValueTypeDef {
6182 pub proc: Option<Arc<DaggerSessionProc>>,
6183 pub selection: Selection,
6184 pub graphql_client: DynGraphQLClient,
6185}
6186impl IntoID<Id> for EnumValueTypeDef {
6187 fn into_id(
6188 self,
6189 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6190 Box::pin(async move { self.id().await })
6191 }
6192}
6193impl Loadable for EnumValueTypeDef {
6194 fn graphql_type() -> &'static str {
6195 "EnumValueTypeDef"
6196 }
6197 fn from_query(
6198 proc: Option<Arc<DaggerSessionProc>>,
6199 selection: Selection,
6200 graphql_client: DynGraphQLClient,
6201 ) -> Self {
6202 Self {
6203 proc,
6204 selection,
6205 graphql_client,
6206 }
6207 }
6208}
6209impl EnumValueTypeDef {
6210 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6212 let query = self.selection.select("deprecated");
6213 query.execute(self.graphql_client.clone()).await
6214 }
6215 pub async fn description(&self) -> Result<String, DaggerError> {
6217 let query = self.selection.select("description");
6218 query.execute(self.graphql_client.clone()).await
6219 }
6220 pub async fn id(&self) -> Result<Id, DaggerError> {
6222 let query = self.selection.select("id");
6223 query.execute(self.graphql_client.clone()).await
6224 }
6225 pub async fn name(&self) -> Result<String, DaggerError> {
6227 let query = self.selection.select("name");
6228 query.execute(self.graphql_client.clone()).await
6229 }
6230 pub fn source_map(&self) -> SourceMap {
6232 let query = self.selection.select("sourceMap");
6233 SourceMap {
6234 proc: self.proc.clone(),
6235 selection: query,
6236 graphql_client: self.graphql_client.clone(),
6237 }
6238 }
6239 pub async fn value(&self) -> Result<String, DaggerError> {
6241 let query = self.selection.select("value");
6242 query.execute(self.graphql_client.clone()).await
6243 }
6244}
6245impl Node for EnumValueTypeDef {
6246 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6247 let query = self.selection.select("id");
6248 let graphql_client = self.graphql_client.clone();
6249 async move { query.execute(graphql_client).await }
6250 }
6251}
6252#[derive(Clone)]
6253pub struct Env {
6254 pub proc: Option<Arc<DaggerSessionProc>>,
6255 pub selection: Selection,
6256 pub graphql_client: DynGraphQLClient,
6257}
6258#[derive(Builder, Debug, PartialEq)]
6259pub struct EnvChecksOpts<'a> {
6260 #[builder(setter(into, strip_option), default)]
6262 pub include: Option<Vec<&'a str>>,
6263 #[builder(setter(into, strip_option), default)]
6265 pub no_generate: Option<bool>,
6266}
6267#[derive(Builder, Debug, PartialEq)]
6268pub struct EnvServicesOpts<'a> {
6269 #[builder(setter(into, strip_option), default)]
6271 pub include: Option<Vec<&'a str>>,
6272}
6273impl IntoID<Id> for Env {
6274 fn into_id(
6275 self,
6276 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6277 Box::pin(async move { self.id().await })
6278 }
6279}
6280impl Loadable for Env {
6281 fn graphql_type() -> &'static str {
6282 "Env"
6283 }
6284 fn from_query(
6285 proc: Option<Arc<DaggerSessionProc>>,
6286 selection: Selection,
6287 graphql_client: DynGraphQLClient,
6288 ) -> Self {
6289 Self {
6290 proc,
6291 selection,
6292 graphql_client,
6293 }
6294 }
6295}
6296impl Env {
6297 pub fn check(&self, name: impl Into<String>) -> Check {
6303 let mut query = self.selection.select("check");
6304 query = query.arg("name", name.into());
6305 Check {
6306 proc: self.proc.clone(),
6307 selection: query,
6308 graphql_client: self.graphql_client.clone(),
6309 }
6310 }
6311 pub fn checks(&self) -> CheckGroup {
6317 let query = self.selection.select("checks");
6318 CheckGroup {
6319 proc: self.proc.clone(),
6320 selection: query,
6321 graphql_client: self.graphql_client.clone(),
6322 }
6323 }
6324 pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6330 let mut query = self.selection.select("checks");
6331 if let Some(include) = opts.include {
6332 query = query.arg("include", include);
6333 }
6334 if let Some(no_generate) = opts.no_generate {
6335 query = query.arg("noGenerate", no_generate);
6336 }
6337 CheckGroup {
6338 proc: self.proc.clone(),
6339 selection: query,
6340 graphql_client: self.graphql_client.clone(),
6341 }
6342 }
6343 pub async fn id(&self) -> Result<Id, DaggerError> {
6345 let query = self.selection.select("id");
6346 query.execute(self.graphql_client.clone()).await
6347 }
6348 pub fn input(&self, name: impl Into<String>) -> Binding {
6350 let mut query = self.selection.select("input");
6351 query = query.arg("name", name.into());
6352 Binding {
6353 proc: self.proc.clone(),
6354 selection: query,
6355 graphql_client: self.graphql_client.clone(),
6356 }
6357 }
6358 pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6360 let query = self.selection.select("inputs");
6361 let query = query.select("id");
6362 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6363 Ok(ids
6364 .into_iter()
6365 .map(|id| Binding {
6366 proc: self.proc.clone(),
6367 selection: crate::querybuilder::query()
6368 .select("node")
6369 .arg("id", &id.0)
6370 .inline_fragment("Binding"),
6371 graphql_client: self.graphql_client.clone(),
6372 })
6373 .collect())
6374 }
6375 pub fn output(&self, name: impl Into<String>) -> Binding {
6377 let mut query = self.selection.select("output");
6378 query = query.arg("name", name.into());
6379 Binding {
6380 proc: self.proc.clone(),
6381 selection: query,
6382 graphql_client: self.graphql_client.clone(),
6383 }
6384 }
6385 pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6387 let query = self.selection.select("outputs");
6388 let query = query.select("id");
6389 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6390 Ok(ids
6391 .into_iter()
6392 .map(|id| Binding {
6393 proc: self.proc.clone(),
6394 selection: crate::querybuilder::query()
6395 .select("node")
6396 .arg("id", &id.0)
6397 .inline_fragment("Binding"),
6398 graphql_client: self.graphql_client.clone(),
6399 })
6400 .collect())
6401 }
6402 pub fn services(&self) -> UpGroup {
6408 let query = self.selection.select("services");
6409 UpGroup {
6410 proc: self.proc.clone(),
6411 selection: query,
6412 graphql_client: self.graphql_client.clone(),
6413 }
6414 }
6415 pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6421 let mut query = self.selection.select("services");
6422 if let Some(include) = opts.include {
6423 query = query.arg("include", include);
6424 }
6425 UpGroup {
6426 proc: self.proc.clone(),
6427 selection: query,
6428 graphql_client: self.graphql_client.clone(),
6429 }
6430 }
6431 pub fn with_address_input(
6439 &self,
6440 name: impl Into<String>,
6441 value: impl IntoID<Id>,
6442 description: impl Into<String>,
6443 ) -> Env {
6444 let mut query = self.selection.select("withAddressInput");
6445 query = query.arg("name", name.into());
6446 query = query.arg_lazy(
6447 "value",
6448 Box::new(move || {
6449 let value = value.clone();
6450 Box::pin(async move { value.into_id().await.unwrap().quote() })
6451 }),
6452 );
6453 query = query.arg("description", description.into());
6454 Env {
6455 proc: self.proc.clone(),
6456 selection: query,
6457 graphql_client: self.graphql_client.clone(),
6458 }
6459 }
6460 pub fn with_address_output(
6467 &self,
6468 name: impl Into<String>,
6469 description: impl Into<String>,
6470 ) -> Env {
6471 let mut query = self.selection.select("withAddressOutput");
6472 query = query.arg("name", name.into());
6473 query = query.arg("description", description.into());
6474 Env {
6475 proc: self.proc.clone(),
6476 selection: query,
6477 graphql_client: self.graphql_client.clone(),
6478 }
6479 }
6480 pub fn with_cache_volume_input(
6488 &self,
6489 name: impl Into<String>,
6490 value: impl IntoID<Id>,
6491 description: impl Into<String>,
6492 ) -> Env {
6493 let mut query = self.selection.select("withCacheVolumeInput");
6494 query = query.arg("name", name.into());
6495 query = query.arg_lazy(
6496 "value",
6497 Box::new(move || {
6498 let value = value.clone();
6499 Box::pin(async move { value.into_id().await.unwrap().quote() })
6500 }),
6501 );
6502 query = query.arg("description", description.into());
6503 Env {
6504 proc: self.proc.clone(),
6505 selection: query,
6506 graphql_client: self.graphql_client.clone(),
6507 }
6508 }
6509 pub fn with_cache_volume_output(
6516 &self,
6517 name: impl Into<String>,
6518 description: impl Into<String>,
6519 ) -> Env {
6520 let mut query = self.selection.select("withCacheVolumeOutput");
6521 query = query.arg("name", name.into());
6522 query = query.arg("description", description.into());
6523 Env {
6524 proc: self.proc.clone(),
6525 selection: query,
6526 graphql_client: self.graphql_client.clone(),
6527 }
6528 }
6529 pub fn with_changeset_input(
6537 &self,
6538 name: impl Into<String>,
6539 value: impl IntoID<Id>,
6540 description: impl Into<String>,
6541 ) -> Env {
6542 let mut query = self.selection.select("withChangesetInput");
6543 query = query.arg("name", name.into());
6544 query = query.arg_lazy(
6545 "value",
6546 Box::new(move || {
6547 let value = value.clone();
6548 Box::pin(async move { value.into_id().await.unwrap().quote() })
6549 }),
6550 );
6551 query = query.arg("description", description.into());
6552 Env {
6553 proc: self.proc.clone(),
6554 selection: query,
6555 graphql_client: self.graphql_client.clone(),
6556 }
6557 }
6558 pub fn with_changeset_output(
6565 &self,
6566 name: impl Into<String>,
6567 description: impl Into<String>,
6568 ) -> Env {
6569 let mut query = self.selection.select("withChangesetOutput");
6570 query = query.arg("name", name.into());
6571 query = query.arg("description", description.into());
6572 Env {
6573 proc: self.proc.clone(),
6574 selection: query,
6575 graphql_client: self.graphql_client.clone(),
6576 }
6577 }
6578 pub fn with_check_group_input(
6586 &self,
6587 name: impl Into<String>,
6588 value: impl IntoID<Id>,
6589 description: impl Into<String>,
6590 ) -> Env {
6591 let mut query = self.selection.select("withCheckGroupInput");
6592 query = query.arg("name", name.into());
6593 query = query.arg_lazy(
6594 "value",
6595 Box::new(move || {
6596 let value = value.clone();
6597 Box::pin(async move { value.into_id().await.unwrap().quote() })
6598 }),
6599 );
6600 query = query.arg("description", description.into());
6601 Env {
6602 proc: self.proc.clone(),
6603 selection: query,
6604 graphql_client: self.graphql_client.clone(),
6605 }
6606 }
6607 pub fn with_check_group_output(
6614 &self,
6615 name: impl Into<String>,
6616 description: impl Into<String>,
6617 ) -> Env {
6618 let mut query = self.selection.select("withCheckGroupOutput");
6619 query = query.arg("name", name.into());
6620 query = query.arg("description", description.into());
6621 Env {
6622 proc: self.proc.clone(),
6623 selection: query,
6624 graphql_client: self.graphql_client.clone(),
6625 }
6626 }
6627 pub fn with_check_input(
6635 &self,
6636 name: impl Into<String>,
6637 value: impl IntoID<Id>,
6638 description: impl Into<String>,
6639 ) -> Env {
6640 let mut query = self.selection.select("withCheckInput");
6641 query = query.arg("name", name.into());
6642 query = query.arg_lazy(
6643 "value",
6644 Box::new(move || {
6645 let value = value.clone();
6646 Box::pin(async move { value.into_id().await.unwrap().quote() })
6647 }),
6648 );
6649 query = query.arg("description", description.into());
6650 Env {
6651 proc: self.proc.clone(),
6652 selection: query,
6653 graphql_client: self.graphql_client.clone(),
6654 }
6655 }
6656 pub fn with_check_output(
6663 &self,
6664 name: impl Into<String>,
6665 description: impl Into<String>,
6666 ) -> Env {
6667 let mut query = self.selection.select("withCheckOutput");
6668 query = query.arg("name", name.into());
6669 query = query.arg("description", description.into());
6670 Env {
6671 proc: self.proc.clone(),
6672 selection: query,
6673 graphql_client: self.graphql_client.clone(),
6674 }
6675 }
6676 pub fn with_cloud_input(
6684 &self,
6685 name: impl Into<String>,
6686 value: impl IntoID<Id>,
6687 description: impl Into<String>,
6688 ) -> Env {
6689 let mut query = self.selection.select("withCloudInput");
6690 query = query.arg("name", name.into());
6691 query = query.arg_lazy(
6692 "value",
6693 Box::new(move || {
6694 let value = value.clone();
6695 Box::pin(async move { value.into_id().await.unwrap().quote() })
6696 }),
6697 );
6698 query = query.arg("description", description.into());
6699 Env {
6700 proc: self.proc.clone(),
6701 selection: query,
6702 graphql_client: self.graphql_client.clone(),
6703 }
6704 }
6705 pub fn with_cloud_output(
6712 &self,
6713 name: impl Into<String>,
6714 description: impl Into<String>,
6715 ) -> Env {
6716 let mut query = self.selection.select("withCloudOutput");
6717 query = query.arg("name", name.into());
6718 query = query.arg("description", description.into());
6719 Env {
6720 proc: self.proc.clone(),
6721 selection: query,
6722 graphql_client: self.graphql_client.clone(),
6723 }
6724 }
6725 pub fn with_container_input(
6733 &self,
6734 name: impl Into<String>,
6735 value: impl IntoID<Id>,
6736 description: impl Into<String>,
6737 ) -> Env {
6738 let mut query = self.selection.select("withContainerInput");
6739 query = query.arg("name", name.into());
6740 query = query.arg_lazy(
6741 "value",
6742 Box::new(move || {
6743 let value = value.clone();
6744 Box::pin(async move { value.into_id().await.unwrap().quote() })
6745 }),
6746 );
6747 query = query.arg("description", description.into());
6748 Env {
6749 proc: self.proc.clone(),
6750 selection: query,
6751 graphql_client: self.graphql_client.clone(),
6752 }
6753 }
6754 pub fn with_container_output(
6761 &self,
6762 name: impl Into<String>,
6763 description: impl Into<String>,
6764 ) -> Env {
6765 let mut query = self.selection.select("withContainerOutput");
6766 query = query.arg("name", name.into());
6767 query = query.arg("description", description.into());
6768 Env {
6769 proc: self.proc.clone(),
6770 selection: query,
6771 graphql_client: self.graphql_client.clone(),
6772 }
6773 }
6774 pub fn with_current_module(&self) -> Env {
6777 let query = self.selection.select("withCurrentModule");
6778 Env {
6779 proc: self.proc.clone(),
6780 selection: query,
6781 graphql_client: self.graphql_client.clone(),
6782 }
6783 }
6784 pub fn with_diff_stat_input(
6792 &self,
6793 name: impl Into<String>,
6794 value: impl IntoID<Id>,
6795 description: impl Into<String>,
6796 ) -> Env {
6797 let mut query = self.selection.select("withDiffStatInput");
6798 query = query.arg("name", name.into());
6799 query = query.arg_lazy(
6800 "value",
6801 Box::new(move || {
6802 let value = value.clone();
6803 Box::pin(async move { value.into_id().await.unwrap().quote() })
6804 }),
6805 );
6806 query = query.arg("description", description.into());
6807 Env {
6808 proc: self.proc.clone(),
6809 selection: query,
6810 graphql_client: self.graphql_client.clone(),
6811 }
6812 }
6813 pub fn with_diff_stat_output(
6820 &self,
6821 name: impl Into<String>,
6822 description: impl Into<String>,
6823 ) -> Env {
6824 let mut query = self.selection.select("withDiffStatOutput");
6825 query = query.arg("name", name.into());
6826 query = query.arg("description", description.into());
6827 Env {
6828 proc: self.proc.clone(),
6829 selection: query,
6830 graphql_client: self.graphql_client.clone(),
6831 }
6832 }
6833 pub fn with_directory_input(
6841 &self,
6842 name: impl Into<String>,
6843 value: impl IntoID<Id>,
6844 description: impl Into<String>,
6845 ) -> Env {
6846 let mut query = self.selection.select("withDirectoryInput");
6847 query = query.arg("name", name.into());
6848 query = query.arg_lazy(
6849 "value",
6850 Box::new(move || {
6851 let value = value.clone();
6852 Box::pin(async move { value.into_id().await.unwrap().quote() })
6853 }),
6854 );
6855 query = query.arg("description", description.into());
6856 Env {
6857 proc: self.proc.clone(),
6858 selection: query,
6859 graphql_client: self.graphql_client.clone(),
6860 }
6861 }
6862 pub fn with_directory_output(
6869 &self,
6870 name: impl Into<String>,
6871 description: impl Into<String>,
6872 ) -> Env {
6873 let mut query = self.selection.select("withDirectoryOutput");
6874 query = query.arg("name", name.into());
6875 query = query.arg("description", description.into());
6876 Env {
6877 proc: self.proc.clone(),
6878 selection: query,
6879 graphql_client: self.graphql_client.clone(),
6880 }
6881 }
6882 pub fn with_env_file_input(
6890 &self,
6891 name: impl Into<String>,
6892 value: impl IntoID<Id>,
6893 description: impl Into<String>,
6894 ) -> Env {
6895 let mut query = self.selection.select("withEnvFileInput");
6896 query = query.arg("name", name.into());
6897 query = query.arg_lazy(
6898 "value",
6899 Box::new(move || {
6900 let value = value.clone();
6901 Box::pin(async move { value.into_id().await.unwrap().quote() })
6902 }),
6903 );
6904 query = query.arg("description", description.into());
6905 Env {
6906 proc: self.proc.clone(),
6907 selection: query,
6908 graphql_client: self.graphql_client.clone(),
6909 }
6910 }
6911 pub fn with_env_file_output(
6918 &self,
6919 name: impl Into<String>,
6920 description: impl Into<String>,
6921 ) -> Env {
6922 let mut query = self.selection.select("withEnvFileOutput");
6923 query = query.arg("name", name.into());
6924 query = query.arg("description", description.into());
6925 Env {
6926 proc: self.proc.clone(),
6927 selection: query,
6928 graphql_client: self.graphql_client.clone(),
6929 }
6930 }
6931 pub fn with_env_input(
6939 &self,
6940 name: impl Into<String>,
6941 value: impl IntoID<Id>,
6942 description: impl Into<String>,
6943 ) -> Env {
6944 let mut query = self.selection.select("withEnvInput");
6945 query = query.arg("name", name.into());
6946 query = query.arg_lazy(
6947 "value",
6948 Box::new(move || {
6949 let value = value.clone();
6950 Box::pin(async move { value.into_id().await.unwrap().quote() })
6951 }),
6952 );
6953 query = query.arg("description", description.into());
6954 Env {
6955 proc: self.proc.clone(),
6956 selection: query,
6957 graphql_client: self.graphql_client.clone(),
6958 }
6959 }
6960 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6967 let mut query = self.selection.select("withEnvOutput");
6968 query = query.arg("name", name.into());
6969 query = query.arg("description", description.into());
6970 Env {
6971 proc: self.proc.clone(),
6972 selection: query,
6973 graphql_client: self.graphql_client.clone(),
6974 }
6975 }
6976 pub fn with_file_input(
6984 &self,
6985 name: impl Into<String>,
6986 value: impl IntoID<Id>,
6987 description: impl Into<String>,
6988 ) -> Env {
6989 let mut query = self.selection.select("withFileInput");
6990 query = query.arg("name", name.into());
6991 query = query.arg_lazy(
6992 "value",
6993 Box::new(move || {
6994 let value = value.clone();
6995 Box::pin(async move { value.into_id().await.unwrap().quote() })
6996 }),
6997 );
6998 query = query.arg("description", description.into());
6999 Env {
7000 proc: self.proc.clone(),
7001 selection: query,
7002 graphql_client: self.graphql_client.clone(),
7003 }
7004 }
7005 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7012 let mut query = self.selection.select("withFileOutput");
7013 query = query.arg("name", name.into());
7014 query = query.arg("description", description.into());
7015 Env {
7016 proc: self.proc.clone(),
7017 selection: query,
7018 graphql_client: self.graphql_client.clone(),
7019 }
7020 }
7021 pub fn with_generator_group_input(
7029 &self,
7030 name: impl Into<String>,
7031 value: impl IntoID<Id>,
7032 description: impl Into<String>,
7033 ) -> Env {
7034 let mut query = self.selection.select("withGeneratorGroupInput");
7035 query = query.arg("name", name.into());
7036 query = query.arg_lazy(
7037 "value",
7038 Box::new(move || {
7039 let value = value.clone();
7040 Box::pin(async move { value.into_id().await.unwrap().quote() })
7041 }),
7042 );
7043 query = query.arg("description", description.into());
7044 Env {
7045 proc: self.proc.clone(),
7046 selection: query,
7047 graphql_client: self.graphql_client.clone(),
7048 }
7049 }
7050 pub fn with_generator_group_output(
7057 &self,
7058 name: impl Into<String>,
7059 description: impl Into<String>,
7060 ) -> Env {
7061 let mut query = self.selection.select("withGeneratorGroupOutput");
7062 query = query.arg("name", name.into());
7063 query = query.arg("description", description.into());
7064 Env {
7065 proc: self.proc.clone(),
7066 selection: query,
7067 graphql_client: self.graphql_client.clone(),
7068 }
7069 }
7070 pub fn with_generator_input(
7078 &self,
7079 name: impl Into<String>,
7080 value: impl IntoID<Id>,
7081 description: impl Into<String>,
7082 ) -> Env {
7083 let mut query = self.selection.select("withGeneratorInput");
7084 query = query.arg("name", name.into());
7085 query = query.arg_lazy(
7086 "value",
7087 Box::new(move || {
7088 let value = value.clone();
7089 Box::pin(async move { value.into_id().await.unwrap().quote() })
7090 }),
7091 );
7092 query = query.arg("description", description.into());
7093 Env {
7094 proc: self.proc.clone(),
7095 selection: query,
7096 graphql_client: self.graphql_client.clone(),
7097 }
7098 }
7099 pub fn with_generator_output(
7106 &self,
7107 name: impl Into<String>,
7108 description: impl Into<String>,
7109 ) -> Env {
7110 let mut query = self.selection.select("withGeneratorOutput");
7111 query = query.arg("name", name.into());
7112 query = query.arg("description", description.into());
7113 Env {
7114 proc: self.proc.clone(),
7115 selection: query,
7116 graphql_client: self.graphql_client.clone(),
7117 }
7118 }
7119 pub fn with_git_ref_input(
7127 &self,
7128 name: impl Into<String>,
7129 value: impl IntoID<Id>,
7130 description: impl Into<String>,
7131 ) -> Env {
7132 let mut query = self.selection.select("withGitRefInput");
7133 query = query.arg("name", name.into());
7134 query = query.arg_lazy(
7135 "value",
7136 Box::new(move || {
7137 let value = value.clone();
7138 Box::pin(async move { value.into_id().await.unwrap().quote() })
7139 }),
7140 );
7141 query = query.arg("description", description.into());
7142 Env {
7143 proc: self.proc.clone(),
7144 selection: query,
7145 graphql_client: self.graphql_client.clone(),
7146 }
7147 }
7148 pub fn with_git_ref_output(
7155 &self,
7156 name: impl Into<String>,
7157 description: impl Into<String>,
7158 ) -> Env {
7159 let mut query = self.selection.select("withGitRefOutput");
7160 query = query.arg("name", name.into());
7161 query = query.arg("description", description.into());
7162 Env {
7163 proc: self.proc.clone(),
7164 selection: query,
7165 graphql_client: self.graphql_client.clone(),
7166 }
7167 }
7168 pub fn with_git_repository_input(
7176 &self,
7177 name: impl Into<String>,
7178 value: impl IntoID<Id>,
7179 description: impl Into<String>,
7180 ) -> Env {
7181 let mut query = self.selection.select("withGitRepositoryInput");
7182 query = query.arg("name", name.into());
7183 query = query.arg_lazy(
7184 "value",
7185 Box::new(move || {
7186 let value = value.clone();
7187 Box::pin(async move { value.into_id().await.unwrap().quote() })
7188 }),
7189 );
7190 query = query.arg("description", description.into());
7191 Env {
7192 proc: self.proc.clone(),
7193 selection: query,
7194 graphql_client: self.graphql_client.clone(),
7195 }
7196 }
7197 pub fn with_git_repository_output(
7204 &self,
7205 name: impl Into<String>,
7206 description: impl Into<String>,
7207 ) -> Env {
7208 let mut query = self.selection.select("withGitRepositoryOutput");
7209 query = query.arg("name", name.into());
7210 query = query.arg("description", description.into());
7211 Env {
7212 proc: self.proc.clone(),
7213 selection: query,
7214 graphql_client: self.graphql_client.clone(),
7215 }
7216 }
7217 pub fn with_http_state_input(
7225 &self,
7226 name: impl Into<String>,
7227 value: impl IntoID<Id>,
7228 description: impl Into<String>,
7229 ) -> Env {
7230 let mut query = self.selection.select("withHTTPStateInput");
7231 query = query.arg("name", name.into());
7232 query = query.arg_lazy(
7233 "value",
7234 Box::new(move || {
7235 let value = value.clone();
7236 Box::pin(async move { value.into_id().await.unwrap().quote() })
7237 }),
7238 );
7239 query = query.arg("description", description.into());
7240 Env {
7241 proc: self.proc.clone(),
7242 selection: query,
7243 graphql_client: self.graphql_client.clone(),
7244 }
7245 }
7246 pub fn with_http_state_output(
7253 &self,
7254 name: impl Into<String>,
7255 description: impl Into<String>,
7256 ) -> Env {
7257 let mut query = self.selection.select("withHTTPStateOutput");
7258 query = query.arg("name", name.into());
7259 query = query.arg("description", description.into());
7260 Env {
7261 proc: self.proc.clone(),
7262 selection: query,
7263 graphql_client: self.graphql_client.clone(),
7264 }
7265 }
7266 pub fn with_json_value_input(
7274 &self,
7275 name: impl Into<String>,
7276 value: impl IntoID<Id>,
7277 description: impl Into<String>,
7278 ) -> Env {
7279 let mut query = self.selection.select("withJSONValueInput");
7280 query = query.arg("name", name.into());
7281 query = query.arg_lazy(
7282 "value",
7283 Box::new(move || {
7284 let value = value.clone();
7285 Box::pin(async move { value.into_id().await.unwrap().quote() })
7286 }),
7287 );
7288 query = query.arg("description", description.into());
7289 Env {
7290 proc: self.proc.clone(),
7291 selection: query,
7292 graphql_client: self.graphql_client.clone(),
7293 }
7294 }
7295 pub fn with_json_value_output(
7302 &self,
7303 name: impl Into<String>,
7304 description: impl Into<String>,
7305 ) -> Env {
7306 let mut query = self.selection.select("withJSONValueOutput");
7307 query = query.arg("name", name.into());
7308 query = query.arg("description", description.into());
7309 Env {
7310 proc: self.proc.clone(),
7311 selection: query,
7312 graphql_client: self.graphql_client.clone(),
7313 }
7314 }
7315 pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7318 let mut query = self.selection.select("withMainModule");
7319 query = query.arg_lazy(
7320 "module",
7321 Box::new(move || {
7322 let module = module.clone();
7323 Box::pin(async move { module.into_id().await.unwrap().quote() })
7324 }),
7325 );
7326 Env {
7327 proc: self.proc.clone(),
7328 selection: query,
7329 graphql_client: self.graphql_client.clone(),
7330 }
7331 }
7332 pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7335 let mut query = self.selection.select("withModule");
7336 query = query.arg_lazy(
7337 "module",
7338 Box::new(move || {
7339 let module = module.clone();
7340 Box::pin(async move { module.into_id().await.unwrap().quote() })
7341 }),
7342 );
7343 Env {
7344 proc: self.proc.clone(),
7345 selection: query,
7346 graphql_client: self.graphql_client.clone(),
7347 }
7348 }
7349 pub fn with_module_config_client_input(
7357 &self,
7358 name: impl Into<String>,
7359 value: impl IntoID<Id>,
7360 description: impl Into<String>,
7361 ) -> Env {
7362 let mut query = self.selection.select("withModuleConfigClientInput");
7363 query = query.arg("name", name.into());
7364 query = query.arg_lazy(
7365 "value",
7366 Box::new(move || {
7367 let value = value.clone();
7368 Box::pin(async move { value.into_id().await.unwrap().quote() })
7369 }),
7370 );
7371 query = query.arg("description", description.into());
7372 Env {
7373 proc: self.proc.clone(),
7374 selection: query,
7375 graphql_client: self.graphql_client.clone(),
7376 }
7377 }
7378 pub fn with_module_config_client_output(
7385 &self,
7386 name: impl Into<String>,
7387 description: impl Into<String>,
7388 ) -> Env {
7389 let mut query = self.selection.select("withModuleConfigClientOutput");
7390 query = query.arg("name", name.into());
7391 query = query.arg("description", description.into());
7392 Env {
7393 proc: self.proc.clone(),
7394 selection: query,
7395 graphql_client: self.graphql_client.clone(),
7396 }
7397 }
7398 pub fn with_module_input(
7406 &self,
7407 name: impl Into<String>,
7408 value: impl IntoID<Id>,
7409 description: impl Into<String>,
7410 ) -> Env {
7411 let mut query = self.selection.select("withModuleInput");
7412 query = query.arg("name", name.into());
7413 query = query.arg_lazy(
7414 "value",
7415 Box::new(move || {
7416 let value = value.clone();
7417 Box::pin(async move { value.into_id().await.unwrap().quote() })
7418 }),
7419 );
7420 query = query.arg("description", description.into());
7421 Env {
7422 proc: self.proc.clone(),
7423 selection: query,
7424 graphql_client: self.graphql_client.clone(),
7425 }
7426 }
7427 pub fn with_module_output(
7434 &self,
7435 name: impl Into<String>,
7436 description: impl Into<String>,
7437 ) -> Env {
7438 let mut query = self.selection.select("withModuleOutput");
7439 query = query.arg("name", name.into());
7440 query = query.arg("description", description.into());
7441 Env {
7442 proc: self.proc.clone(),
7443 selection: query,
7444 graphql_client: self.graphql_client.clone(),
7445 }
7446 }
7447 pub fn with_module_source_input(
7455 &self,
7456 name: impl Into<String>,
7457 value: impl IntoID<Id>,
7458 description: impl Into<String>,
7459 ) -> Env {
7460 let mut query = self.selection.select("withModuleSourceInput");
7461 query = query.arg("name", name.into());
7462 query = query.arg_lazy(
7463 "value",
7464 Box::new(move || {
7465 let value = value.clone();
7466 Box::pin(async move { value.into_id().await.unwrap().quote() })
7467 }),
7468 );
7469 query = query.arg("description", description.into());
7470 Env {
7471 proc: self.proc.clone(),
7472 selection: query,
7473 graphql_client: self.graphql_client.clone(),
7474 }
7475 }
7476 pub fn with_module_source_output(
7483 &self,
7484 name: impl Into<String>,
7485 description: impl Into<String>,
7486 ) -> Env {
7487 let mut query = self.selection.select("withModuleSourceOutput");
7488 query = query.arg("name", name.into());
7489 query = query.arg("description", description.into());
7490 Env {
7491 proc: self.proc.clone(),
7492 selection: query,
7493 graphql_client: self.graphql_client.clone(),
7494 }
7495 }
7496 pub fn with_search_result_input(
7504 &self,
7505 name: impl Into<String>,
7506 value: impl IntoID<Id>,
7507 description: impl Into<String>,
7508 ) -> Env {
7509 let mut query = self.selection.select("withSearchResultInput");
7510 query = query.arg("name", name.into());
7511 query = query.arg_lazy(
7512 "value",
7513 Box::new(move || {
7514 let value = value.clone();
7515 Box::pin(async move { value.into_id().await.unwrap().quote() })
7516 }),
7517 );
7518 query = query.arg("description", description.into());
7519 Env {
7520 proc: self.proc.clone(),
7521 selection: query,
7522 graphql_client: self.graphql_client.clone(),
7523 }
7524 }
7525 pub fn with_search_result_output(
7532 &self,
7533 name: impl Into<String>,
7534 description: impl Into<String>,
7535 ) -> Env {
7536 let mut query = self.selection.select("withSearchResultOutput");
7537 query = query.arg("name", name.into());
7538 query = query.arg("description", description.into());
7539 Env {
7540 proc: self.proc.clone(),
7541 selection: query,
7542 graphql_client: self.graphql_client.clone(),
7543 }
7544 }
7545 pub fn with_search_submatch_input(
7553 &self,
7554 name: impl Into<String>,
7555 value: impl IntoID<Id>,
7556 description: impl Into<String>,
7557 ) -> Env {
7558 let mut query = self.selection.select("withSearchSubmatchInput");
7559 query = query.arg("name", name.into());
7560 query = query.arg_lazy(
7561 "value",
7562 Box::new(move || {
7563 let value = value.clone();
7564 Box::pin(async move { value.into_id().await.unwrap().quote() })
7565 }),
7566 );
7567 query = query.arg("description", description.into());
7568 Env {
7569 proc: self.proc.clone(),
7570 selection: query,
7571 graphql_client: self.graphql_client.clone(),
7572 }
7573 }
7574 pub fn with_search_submatch_output(
7581 &self,
7582 name: impl Into<String>,
7583 description: impl Into<String>,
7584 ) -> Env {
7585 let mut query = self.selection.select("withSearchSubmatchOutput");
7586 query = query.arg("name", name.into());
7587 query = query.arg("description", description.into());
7588 Env {
7589 proc: self.proc.clone(),
7590 selection: query,
7591 graphql_client: self.graphql_client.clone(),
7592 }
7593 }
7594 pub fn with_secret_input(
7602 &self,
7603 name: impl Into<String>,
7604 value: impl IntoID<Id>,
7605 description: impl Into<String>,
7606 ) -> Env {
7607 let mut query = self.selection.select("withSecretInput");
7608 query = query.arg("name", name.into());
7609 query = query.arg_lazy(
7610 "value",
7611 Box::new(move || {
7612 let value = value.clone();
7613 Box::pin(async move { value.into_id().await.unwrap().quote() })
7614 }),
7615 );
7616 query = query.arg("description", description.into());
7617 Env {
7618 proc: self.proc.clone(),
7619 selection: query,
7620 graphql_client: self.graphql_client.clone(),
7621 }
7622 }
7623 pub fn with_secret_output(
7630 &self,
7631 name: impl Into<String>,
7632 description: impl Into<String>,
7633 ) -> Env {
7634 let mut query = self.selection.select("withSecretOutput");
7635 query = query.arg("name", name.into());
7636 query = query.arg("description", description.into());
7637 Env {
7638 proc: self.proc.clone(),
7639 selection: query,
7640 graphql_client: self.graphql_client.clone(),
7641 }
7642 }
7643 pub fn with_service_input(
7651 &self,
7652 name: impl Into<String>,
7653 value: impl IntoID<Id>,
7654 description: impl Into<String>,
7655 ) -> Env {
7656 let mut query = self.selection.select("withServiceInput");
7657 query = query.arg("name", name.into());
7658 query = query.arg_lazy(
7659 "value",
7660 Box::new(move || {
7661 let value = value.clone();
7662 Box::pin(async move { value.into_id().await.unwrap().quote() })
7663 }),
7664 );
7665 query = query.arg("description", description.into());
7666 Env {
7667 proc: self.proc.clone(),
7668 selection: query,
7669 graphql_client: self.graphql_client.clone(),
7670 }
7671 }
7672 pub fn with_service_output(
7679 &self,
7680 name: impl Into<String>,
7681 description: impl Into<String>,
7682 ) -> Env {
7683 let mut query = self.selection.select("withServiceOutput");
7684 query = query.arg("name", name.into());
7685 query = query.arg("description", description.into());
7686 Env {
7687 proc: self.proc.clone(),
7688 selection: query,
7689 graphql_client: self.graphql_client.clone(),
7690 }
7691 }
7692 pub fn with_socket_input(
7700 &self,
7701 name: impl Into<String>,
7702 value: impl IntoID<Id>,
7703 description: impl Into<String>,
7704 ) -> Env {
7705 let mut query = self.selection.select("withSocketInput");
7706 query = query.arg("name", name.into());
7707 query = query.arg_lazy(
7708 "value",
7709 Box::new(move || {
7710 let value = value.clone();
7711 Box::pin(async move { value.into_id().await.unwrap().quote() })
7712 }),
7713 );
7714 query = query.arg("description", description.into());
7715 Env {
7716 proc: self.proc.clone(),
7717 selection: query,
7718 graphql_client: self.graphql_client.clone(),
7719 }
7720 }
7721 pub fn with_socket_output(
7728 &self,
7729 name: impl Into<String>,
7730 description: impl Into<String>,
7731 ) -> Env {
7732 let mut query = self.selection.select("withSocketOutput");
7733 query = query.arg("name", name.into());
7734 query = query.arg("description", description.into());
7735 Env {
7736 proc: self.proc.clone(),
7737 selection: query,
7738 graphql_client: self.graphql_client.clone(),
7739 }
7740 }
7741 pub fn with_stat_input(
7749 &self,
7750 name: impl Into<String>,
7751 value: impl IntoID<Id>,
7752 description: impl Into<String>,
7753 ) -> Env {
7754 let mut query = self.selection.select("withStatInput");
7755 query = query.arg("name", name.into());
7756 query = query.arg_lazy(
7757 "value",
7758 Box::new(move || {
7759 let value = value.clone();
7760 Box::pin(async move { value.into_id().await.unwrap().quote() })
7761 }),
7762 );
7763 query = query.arg("description", description.into());
7764 Env {
7765 proc: self.proc.clone(),
7766 selection: query,
7767 graphql_client: self.graphql_client.clone(),
7768 }
7769 }
7770 pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7777 let mut query = self.selection.select("withStatOutput");
7778 query = query.arg("name", name.into());
7779 query = query.arg("description", description.into());
7780 Env {
7781 proc: self.proc.clone(),
7782 selection: query,
7783 graphql_client: self.graphql_client.clone(),
7784 }
7785 }
7786 pub fn with_string_input(
7794 &self,
7795 name: impl Into<String>,
7796 value: impl Into<String>,
7797 description: impl Into<String>,
7798 ) -> Env {
7799 let mut query = self.selection.select("withStringInput");
7800 query = query.arg("name", name.into());
7801 query = query.arg("value", value.into());
7802 query = query.arg("description", description.into());
7803 Env {
7804 proc: self.proc.clone(),
7805 selection: query,
7806 graphql_client: self.graphql_client.clone(),
7807 }
7808 }
7809 pub fn with_string_output(
7816 &self,
7817 name: impl Into<String>,
7818 description: impl Into<String>,
7819 ) -> Env {
7820 let mut query = self.selection.select("withStringOutput");
7821 query = query.arg("name", name.into());
7822 query = query.arg("description", description.into());
7823 Env {
7824 proc: self.proc.clone(),
7825 selection: query,
7826 graphql_client: self.graphql_client.clone(),
7827 }
7828 }
7829 pub fn with_up_group_input(
7837 &self,
7838 name: impl Into<String>,
7839 value: impl IntoID<Id>,
7840 description: impl Into<String>,
7841 ) -> Env {
7842 let mut query = self.selection.select("withUpGroupInput");
7843 query = query.arg("name", name.into());
7844 query = query.arg_lazy(
7845 "value",
7846 Box::new(move || {
7847 let value = value.clone();
7848 Box::pin(async move { value.into_id().await.unwrap().quote() })
7849 }),
7850 );
7851 query = query.arg("description", description.into());
7852 Env {
7853 proc: self.proc.clone(),
7854 selection: query,
7855 graphql_client: self.graphql_client.clone(),
7856 }
7857 }
7858 pub fn with_up_group_output(
7865 &self,
7866 name: impl Into<String>,
7867 description: impl Into<String>,
7868 ) -> Env {
7869 let mut query = self.selection.select("withUpGroupOutput");
7870 query = query.arg("name", name.into());
7871 query = query.arg("description", description.into());
7872 Env {
7873 proc: self.proc.clone(),
7874 selection: query,
7875 graphql_client: self.graphql_client.clone(),
7876 }
7877 }
7878 pub fn with_up_input(
7886 &self,
7887 name: impl Into<String>,
7888 value: impl IntoID<Id>,
7889 description: impl Into<String>,
7890 ) -> Env {
7891 let mut query = self.selection.select("withUpInput");
7892 query = query.arg("name", name.into());
7893 query = query.arg_lazy(
7894 "value",
7895 Box::new(move || {
7896 let value = value.clone();
7897 Box::pin(async move { value.into_id().await.unwrap().quote() })
7898 }),
7899 );
7900 query = query.arg("description", description.into());
7901 Env {
7902 proc: self.proc.clone(),
7903 selection: query,
7904 graphql_client: self.graphql_client.clone(),
7905 }
7906 }
7907 pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7914 let mut query = self.selection.select("withUpOutput");
7915 query = query.arg("name", name.into());
7916 query = query.arg("description", description.into());
7917 Env {
7918 proc: self.proc.clone(),
7919 selection: query,
7920 graphql_client: self.graphql_client.clone(),
7921 }
7922 }
7923 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
7929 let mut query = self.selection.select("withWorkspace");
7930 query = query.arg_lazy(
7931 "workspace",
7932 Box::new(move || {
7933 let workspace = workspace.clone();
7934 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7935 }),
7936 );
7937 Env {
7938 proc: self.proc.clone(),
7939 selection: query,
7940 graphql_client: self.graphql_client.clone(),
7941 }
7942 }
7943 pub fn with_workspace_input(
7951 &self,
7952 name: impl Into<String>,
7953 value: impl IntoID<Id>,
7954 description: impl Into<String>,
7955 ) -> Env {
7956 let mut query = self.selection.select("withWorkspaceInput");
7957 query = query.arg("name", name.into());
7958 query = query.arg_lazy(
7959 "value",
7960 Box::new(move || {
7961 let value = value.clone();
7962 Box::pin(async move { value.into_id().await.unwrap().quote() })
7963 }),
7964 );
7965 query = query.arg("description", description.into());
7966 Env {
7967 proc: self.proc.clone(),
7968 selection: query,
7969 graphql_client: self.graphql_client.clone(),
7970 }
7971 }
7972 pub fn with_workspace_output(
7979 &self,
7980 name: impl Into<String>,
7981 description: impl Into<String>,
7982 ) -> Env {
7983 let mut query = self.selection.select("withWorkspaceOutput");
7984 query = query.arg("name", name.into());
7985 query = query.arg("description", description.into());
7986 Env {
7987 proc: self.proc.clone(),
7988 selection: query,
7989 graphql_client: self.graphql_client.clone(),
7990 }
7991 }
7992 pub fn without_outputs(&self) -> Env {
7994 let query = self.selection.select("withoutOutputs");
7995 Env {
7996 proc: self.proc.clone(),
7997 selection: query,
7998 graphql_client: self.graphql_client.clone(),
7999 }
8000 }
8001 pub fn workspace(&self) -> Directory {
8002 let query = self.selection.select("workspace");
8003 Directory {
8004 proc: self.proc.clone(),
8005 selection: query,
8006 graphql_client: self.graphql_client.clone(),
8007 }
8008 }
8009}
8010impl Node for Env {
8011 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8012 let query = self.selection.select("id");
8013 let graphql_client = self.graphql_client.clone();
8014 async move { query.execute(graphql_client).await }
8015 }
8016}
8017#[derive(Clone)]
8018pub struct EnvFile {
8019 pub proc: Option<Arc<DaggerSessionProc>>,
8020 pub selection: Selection,
8021 pub graphql_client: DynGraphQLClient,
8022}
8023#[derive(Builder, Debug, PartialEq)]
8024pub struct EnvFileGetOpts {
8025 #[builder(setter(into, strip_option), default)]
8027 pub raw: Option<bool>,
8028}
8029#[derive(Builder, Debug, PartialEq)]
8030pub struct EnvFileVariablesOpts {
8031 #[builder(setter(into, strip_option), default)]
8033 pub raw: Option<bool>,
8034}
8035impl IntoID<Id> for EnvFile {
8036 fn into_id(
8037 self,
8038 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8039 Box::pin(async move { self.id().await })
8040 }
8041}
8042impl Loadable for EnvFile {
8043 fn graphql_type() -> &'static str {
8044 "EnvFile"
8045 }
8046 fn from_query(
8047 proc: Option<Arc<DaggerSessionProc>>,
8048 selection: Selection,
8049 graphql_client: DynGraphQLClient,
8050 ) -> Self {
8051 Self {
8052 proc,
8053 selection,
8054 graphql_client,
8055 }
8056 }
8057}
8058impl EnvFile {
8059 pub fn as_file(&self) -> File {
8061 let query = self.selection.select("asFile");
8062 File {
8063 proc: self.proc.clone(),
8064 selection: query,
8065 graphql_client: self.graphql_client.clone(),
8066 }
8067 }
8068 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8074 let mut query = self.selection.select("exists");
8075 query = query.arg("name", name.into());
8076 query.execute(self.graphql_client.clone()).await
8077 }
8078 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8085 let mut query = self.selection.select("get");
8086 query = query.arg("name", name.into());
8087 query.execute(self.graphql_client.clone()).await
8088 }
8089 pub async fn get_opts(
8096 &self,
8097 name: impl Into<String>,
8098 opts: EnvFileGetOpts,
8099 ) -> Result<String, DaggerError> {
8100 let mut query = self.selection.select("get");
8101 query = query.arg("name", name.into());
8102 if let Some(raw) = opts.raw {
8103 query = query.arg("raw", raw);
8104 }
8105 query.execute(self.graphql_client.clone()).await
8106 }
8107 pub async fn id(&self) -> Result<Id, DaggerError> {
8109 let query = self.selection.select("id");
8110 query.execute(self.graphql_client.clone()).await
8111 }
8112 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8118 let mut query = self.selection.select("namespace");
8119 query = query.arg("prefix", prefix.into());
8120 EnvFile {
8121 proc: self.proc.clone(),
8122 selection: query,
8123 graphql_client: self.graphql_client.clone(),
8124 }
8125 }
8126 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8132 let query = self.selection.select("variables");
8133 let query = query.select("id");
8134 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8135 Ok(ids
8136 .into_iter()
8137 .map(|id| EnvVariable {
8138 proc: self.proc.clone(),
8139 selection: crate::querybuilder::query()
8140 .select("node")
8141 .arg("id", &id.0)
8142 .inline_fragment("EnvVariable"),
8143 graphql_client: self.graphql_client.clone(),
8144 })
8145 .collect())
8146 }
8147 pub async fn variables_opts(
8153 &self,
8154 opts: EnvFileVariablesOpts,
8155 ) -> Result<Vec<EnvVariable>, DaggerError> {
8156 let mut query = self.selection.select("variables");
8157 if let Some(raw) = opts.raw {
8158 query = query.arg("raw", raw);
8159 }
8160 let query = query.select("id");
8161 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8162 Ok(ids
8163 .into_iter()
8164 .map(|id| EnvVariable {
8165 proc: self.proc.clone(),
8166 selection: crate::querybuilder::query()
8167 .select("node")
8168 .arg("id", &id.0)
8169 .inline_fragment("EnvVariable"),
8170 graphql_client: self.graphql_client.clone(),
8171 })
8172 .collect())
8173 }
8174 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8181 let mut query = self.selection.select("withVariable");
8182 query = query.arg("name", name.into());
8183 query = query.arg("value", value.into());
8184 EnvFile {
8185 proc: self.proc.clone(),
8186 selection: query,
8187 graphql_client: self.graphql_client.clone(),
8188 }
8189 }
8190 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8196 let mut query = self.selection.select("withoutVariable");
8197 query = query.arg("name", name.into());
8198 EnvFile {
8199 proc: self.proc.clone(),
8200 selection: query,
8201 graphql_client: self.graphql_client.clone(),
8202 }
8203 }
8204}
8205impl Node for EnvFile {
8206 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8207 let query = self.selection.select("id");
8208 let graphql_client = self.graphql_client.clone();
8209 async move { query.execute(graphql_client).await }
8210 }
8211}
8212#[derive(Clone)]
8213pub struct EnvVariable {
8214 pub proc: Option<Arc<DaggerSessionProc>>,
8215 pub selection: Selection,
8216 pub graphql_client: DynGraphQLClient,
8217}
8218impl IntoID<Id> for EnvVariable {
8219 fn into_id(
8220 self,
8221 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8222 Box::pin(async move { self.id().await })
8223 }
8224}
8225impl Loadable for EnvVariable {
8226 fn graphql_type() -> &'static str {
8227 "EnvVariable"
8228 }
8229 fn from_query(
8230 proc: Option<Arc<DaggerSessionProc>>,
8231 selection: Selection,
8232 graphql_client: DynGraphQLClient,
8233 ) -> Self {
8234 Self {
8235 proc,
8236 selection,
8237 graphql_client,
8238 }
8239 }
8240}
8241impl EnvVariable {
8242 pub async fn id(&self) -> Result<Id, DaggerError> {
8244 let query = self.selection.select("id");
8245 query.execute(self.graphql_client.clone()).await
8246 }
8247 pub async fn name(&self) -> Result<String, DaggerError> {
8249 let query = self.selection.select("name");
8250 query.execute(self.graphql_client.clone()).await
8251 }
8252 pub async fn value(&self) -> Result<String, DaggerError> {
8254 let query = self.selection.select("value");
8255 query.execute(self.graphql_client.clone()).await
8256 }
8257}
8258impl Node for EnvVariable {
8259 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8260 let query = self.selection.select("id");
8261 let graphql_client = self.graphql_client.clone();
8262 async move { query.execute(graphql_client).await }
8263 }
8264}
8265#[derive(Clone)]
8266pub struct Error {
8267 pub proc: Option<Arc<DaggerSessionProc>>,
8268 pub selection: Selection,
8269 pub graphql_client: DynGraphQLClient,
8270}
8271impl IntoID<Id> for Error {
8272 fn into_id(
8273 self,
8274 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8275 Box::pin(async move { self.id().await })
8276 }
8277}
8278impl Loadable for Error {
8279 fn graphql_type() -> &'static str {
8280 "Error"
8281 }
8282 fn from_query(
8283 proc: Option<Arc<DaggerSessionProc>>,
8284 selection: Selection,
8285 graphql_client: DynGraphQLClient,
8286 ) -> Self {
8287 Self {
8288 proc,
8289 selection,
8290 graphql_client,
8291 }
8292 }
8293}
8294impl Error {
8295 pub async fn id(&self) -> Result<Id, DaggerError> {
8297 let query = self.selection.select("id");
8298 query.execute(self.graphql_client.clone()).await
8299 }
8300 pub async fn message(&self) -> Result<String, DaggerError> {
8302 let query = self.selection.select("message");
8303 query.execute(self.graphql_client.clone()).await
8304 }
8305 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8307 let query = self.selection.select("values");
8308 let query = query.select("id");
8309 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8310 Ok(ids
8311 .into_iter()
8312 .map(|id| ErrorValue {
8313 proc: self.proc.clone(),
8314 selection: crate::querybuilder::query()
8315 .select("node")
8316 .arg("id", &id.0)
8317 .inline_fragment("ErrorValue"),
8318 graphql_client: self.graphql_client.clone(),
8319 })
8320 .collect())
8321 }
8322 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8329 let mut query = self.selection.select("withValue");
8330 query = query.arg("name", name.into());
8331 query = query.arg("value", value);
8332 Error {
8333 proc: self.proc.clone(),
8334 selection: query,
8335 graphql_client: self.graphql_client.clone(),
8336 }
8337 }
8338}
8339impl Node for Error {
8340 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8341 let query = self.selection.select("id");
8342 let graphql_client = self.graphql_client.clone();
8343 async move { query.execute(graphql_client).await }
8344 }
8345}
8346#[derive(Clone)]
8347pub struct ErrorValue {
8348 pub proc: Option<Arc<DaggerSessionProc>>,
8349 pub selection: Selection,
8350 pub graphql_client: DynGraphQLClient,
8351}
8352impl IntoID<Id> for ErrorValue {
8353 fn into_id(
8354 self,
8355 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8356 Box::pin(async move { self.id().await })
8357 }
8358}
8359impl Loadable for ErrorValue {
8360 fn graphql_type() -> &'static str {
8361 "ErrorValue"
8362 }
8363 fn from_query(
8364 proc: Option<Arc<DaggerSessionProc>>,
8365 selection: Selection,
8366 graphql_client: DynGraphQLClient,
8367 ) -> Self {
8368 Self {
8369 proc,
8370 selection,
8371 graphql_client,
8372 }
8373 }
8374}
8375impl ErrorValue {
8376 pub async fn id(&self) -> Result<Id, DaggerError> {
8378 let query = self.selection.select("id");
8379 query.execute(self.graphql_client.clone()).await
8380 }
8381 pub async fn name(&self) -> Result<String, DaggerError> {
8383 let query = self.selection.select("name");
8384 query.execute(self.graphql_client.clone()).await
8385 }
8386 pub async fn value(&self) -> Result<Json, DaggerError> {
8388 let query = self.selection.select("value");
8389 query.execute(self.graphql_client.clone()).await
8390 }
8391}
8392impl Node for ErrorValue {
8393 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8394 let query = self.selection.select("id");
8395 let graphql_client = self.graphql_client.clone();
8396 async move { query.execute(graphql_client).await }
8397 }
8398}
8399#[derive(Clone)]
8400pub struct FieldTypeDef {
8401 pub proc: Option<Arc<DaggerSessionProc>>,
8402 pub selection: Selection,
8403 pub graphql_client: DynGraphQLClient,
8404}
8405impl IntoID<Id> for FieldTypeDef {
8406 fn into_id(
8407 self,
8408 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8409 Box::pin(async move { self.id().await })
8410 }
8411}
8412impl Loadable for FieldTypeDef {
8413 fn graphql_type() -> &'static str {
8414 "FieldTypeDef"
8415 }
8416 fn from_query(
8417 proc: Option<Arc<DaggerSessionProc>>,
8418 selection: Selection,
8419 graphql_client: DynGraphQLClient,
8420 ) -> Self {
8421 Self {
8422 proc,
8423 selection,
8424 graphql_client,
8425 }
8426 }
8427}
8428impl FieldTypeDef {
8429 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8431 let query = self.selection.select("deprecated");
8432 query.execute(self.graphql_client.clone()).await
8433 }
8434 pub async fn description(&self) -> Result<String, DaggerError> {
8436 let query = self.selection.select("description");
8437 query.execute(self.graphql_client.clone()).await
8438 }
8439 pub async fn id(&self) -> Result<Id, DaggerError> {
8441 let query = self.selection.select("id");
8442 query.execute(self.graphql_client.clone()).await
8443 }
8444 pub async fn name(&self) -> Result<String, DaggerError> {
8446 let query = self.selection.select("name");
8447 query.execute(self.graphql_client.clone()).await
8448 }
8449 pub fn source_map(&self) -> SourceMap {
8451 let query = self.selection.select("sourceMap");
8452 SourceMap {
8453 proc: self.proc.clone(),
8454 selection: query,
8455 graphql_client: self.graphql_client.clone(),
8456 }
8457 }
8458 pub fn type_def(&self) -> TypeDef {
8460 let query = self.selection.select("typeDef");
8461 TypeDef {
8462 proc: self.proc.clone(),
8463 selection: query,
8464 graphql_client: self.graphql_client.clone(),
8465 }
8466 }
8467}
8468impl Node for FieldTypeDef {
8469 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8470 let query = self.selection.select("id");
8471 let graphql_client = self.graphql_client.clone();
8472 async move { query.execute(graphql_client).await }
8473 }
8474}
8475#[derive(Clone)]
8476pub struct File {
8477 pub proc: Option<Arc<DaggerSessionProc>>,
8478 pub selection: Selection,
8479 pub graphql_client: DynGraphQLClient,
8480}
8481#[derive(Builder, Debug, PartialEq)]
8482pub struct FileAsEnvFileOpts {
8483 #[builder(setter(into, strip_option), default)]
8485 pub expand: Option<bool>,
8486}
8487#[derive(Builder, Debug, PartialEq)]
8488pub struct FileContentsOpts {
8489 #[builder(setter(into, strip_option), default)]
8491 pub limit_lines: Option<isize>,
8492 #[builder(setter(into, strip_option), default)]
8494 pub offset_lines: Option<isize>,
8495}
8496#[derive(Builder, Debug, PartialEq)]
8497pub struct FileDigestOpts {
8498 #[builder(setter(into, strip_option), default)]
8500 pub exclude_metadata: Option<bool>,
8501}
8502#[derive(Builder, Debug, PartialEq)]
8503pub struct FileExportOpts {
8504 #[builder(setter(into, strip_option), default)]
8506 pub allow_parent_dir_path: Option<bool>,
8507}
8508#[derive(Builder, Debug, PartialEq)]
8509pub struct FileSearchOpts<'a> {
8510 #[builder(setter(into, strip_option), default)]
8512 pub dotall: Option<bool>,
8513 #[builder(setter(into, strip_option), default)]
8515 pub files_only: Option<bool>,
8516 #[builder(setter(into, strip_option), default)]
8517 pub globs: Option<Vec<&'a str>>,
8518 #[builder(setter(into, strip_option), default)]
8520 pub insensitive: Option<bool>,
8521 #[builder(setter(into, strip_option), default)]
8523 pub limit: Option<isize>,
8524 #[builder(setter(into, strip_option), default)]
8526 pub literal: Option<bool>,
8527 #[builder(setter(into, strip_option), default)]
8529 pub multiline: Option<bool>,
8530 #[builder(setter(into, strip_option), default)]
8531 pub paths: Option<Vec<&'a str>>,
8532 #[builder(setter(into, strip_option), default)]
8534 pub skip_hidden: Option<bool>,
8535 #[builder(setter(into, strip_option), default)]
8537 pub skip_ignored: Option<bool>,
8538}
8539#[derive(Builder, Debug, PartialEq)]
8540pub struct FileWithReplacedOpts {
8541 #[builder(setter(into, strip_option), default)]
8543 pub all: Option<bool>,
8544 #[builder(setter(into, strip_option), default)]
8546 pub first_from: Option<isize>,
8547}
8548impl IntoID<Id> for File {
8549 fn into_id(
8550 self,
8551 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8552 Box::pin(async move { self.id().await })
8553 }
8554}
8555impl Loadable for File {
8556 fn graphql_type() -> &'static str {
8557 "File"
8558 }
8559 fn from_query(
8560 proc: Option<Arc<DaggerSessionProc>>,
8561 selection: Selection,
8562 graphql_client: DynGraphQLClient,
8563 ) -> Self {
8564 Self {
8565 proc,
8566 selection,
8567 graphql_client,
8568 }
8569 }
8570}
8571impl File {
8572 pub fn as_env_file(&self) -> EnvFile {
8578 let query = self.selection.select("asEnvFile");
8579 EnvFile {
8580 proc: self.proc.clone(),
8581 selection: query,
8582 graphql_client: self.graphql_client.clone(),
8583 }
8584 }
8585 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8591 let mut query = self.selection.select("asEnvFile");
8592 if let Some(expand) = opts.expand {
8593 query = query.arg("expand", expand);
8594 }
8595 EnvFile {
8596 proc: self.proc.clone(),
8597 selection: query,
8598 graphql_client: self.graphql_client.clone(),
8599 }
8600 }
8601 pub fn as_json(&self) -> JsonValue {
8603 let query = self.selection.select("asJSON");
8604 JsonValue {
8605 proc: self.proc.clone(),
8606 selection: query,
8607 graphql_client: self.graphql_client.clone(),
8608 }
8609 }
8610 pub fn chown(&self, owner: impl Into<String>) -> File {
8620 let mut query = self.selection.select("chown");
8621 query = query.arg("owner", owner.into());
8622 File {
8623 proc: self.proc.clone(),
8624 selection: query,
8625 graphql_client: self.graphql_client.clone(),
8626 }
8627 }
8628 pub async fn contents(&self) -> Result<String, DaggerError> {
8634 let query = self.selection.select("contents");
8635 query.execute(self.graphql_client.clone()).await
8636 }
8637 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8643 let mut query = self.selection.select("contents");
8644 if let Some(offset_lines) = opts.offset_lines {
8645 query = query.arg("offsetLines", offset_lines);
8646 }
8647 if let Some(limit_lines) = opts.limit_lines {
8648 query = query.arg("limitLines", limit_lines);
8649 }
8650 query.execute(self.graphql_client.clone()).await
8651 }
8652 pub async fn digest(&self) -> Result<String, DaggerError> {
8658 let query = self.selection.select("digest");
8659 query.execute(self.graphql_client.clone()).await
8660 }
8661 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8667 let mut query = self.selection.select("digest");
8668 if let Some(exclude_metadata) = opts.exclude_metadata {
8669 query = query.arg("excludeMetadata", exclude_metadata);
8670 }
8671 query.execute(self.graphql_client.clone()).await
8672 }
8673 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8680 let mut query = self.selection.select("export");
8681 query = query.arg("path", path.into());
8682 query.execute(self.graphql_client.clone()).await
8683 }
8684 pub async fn export_opts(
8691 &self,
8692 path: impl Into<String>,
8693 opts: FileExportOpts,
8694 ) -> Result<String, DaggerError> {
8695 let mut query = self.selection.select("export");
8696 query = query.arg("path", path.into());
8697 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8698 query = query.arg("allowParentDirPath", allow_parent_dir_path);
8699 }
8700 query.execute(self.graphql_client.clone()).await
8701 }
8702 pub async fn id(&self) -> Result<Id, DaggerError> {
8704 let query = self.selection.select("id");
8705 query.execute(self.graphql_client.clone()).await
8706 }
8707 pub async fn name(&self) -> Result<String, DaggerError> {
8709 let query = self.selection.select("name");
8710 query.execute(self.graphql_client.clone()).await
8711 }
8712 pub async fn search(
8720 &self,
8721 pattern: impl Into<String>,
8722 ) -> Result<Vec<SearchResult>, DaggerError> {
8723 let mut query = self.selection.select("search");
8724 query = query.arg("pattern", pattern.into());
8725 let query = query.select("id");
8726 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8727 Ok(ids
8728 .into_iter()
8729 .map(|id| SearchResult {
8730 proc: self.proc.clone(),
8731 selection: crate::querybuilder::query()
8732 .select("node")
8733 .arg("id", &id.0)
8734 .inline_fragment("SearchResult"),
8735 graphql_client: self.graphql_client.clone(),
8736 })
8737 .collect())
8738 }
8739 pub async fn search_opts<'a>(
8747 &self,
8748 pattern: impl Into<String>,
8749 opts: FileSearchOpts<'a>,
8750 ) -> Result<Vec<SearchResult>, DaggerError> {
8751 let mut query = self.selection.select("search");
8752 query = query.arg("pattern", pattern.into());
8753 if let Some(literal) = opts.literal {
8754 query = query.arg("literal", literal);
8755 }
8756 if let Some(multiline) = opts.multiline {
8757 query = query.arg("multiline", multiline);
8758 }
8759 if let Some(dotall) = opts.dotall {
8760 query = query.arg("dotall", dotall);
8761 }
8762 if let Some(insensitive) = opts.insensitive {
8763 query = query.arg("insensitive", insensitive);
8764 }
8765 if let Some(skip_ignored) = opts.skip_ignored {
8766 query = query.arg("skipIgnored", skip_ignored);
8767 }
8768 if let Some(skip_hidden) = opts.skip_hidden {
8769 query = query.arg("skipHidden", skip_hidden);
8770 }
8771 if let Some(files_only) = opts.files_only {
8772 query = query.arg("filesOnly", files_only);
8773 }
8774 if let Some(limit) = opts.limit {
8775 query = query.arg("limit", limit);
8776 }
8777 if let Some(paths) = opts.paths {
8778 query = query.arg("paths", paths);
8779 }
8780 if let Some(globs) = opts.globs {
8781 query = query.arg("globs", globs);
8782 }
8783 let query = query.select("id");
8784 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8785 Ok(ids
8786 .into_iter()
8787 .map(|id| SearchResult {
8788 proc: self.proc.clone(),
8789 selection: crate::querybuilder::query()
8790 .select("node")
8791 .arg("id", &id.0)
8792 .inline_fragment("SearchResult"),
8793 graphql_client: self.graphql_client.clone(),
8794 })
8795 .collect())
8796 }
8797 pub async fn size(&self) -> Result<isize, DaggerError> {
8799 let query = self.selection.select("size");
8800 query.execute(self.graphql_client.clone()).await
8801 }
8802 pub fn stat(&self) -> Stat {
8804 let query = self.selection.select("stat");
8805 Stat {
8806 proc: self.proc.clone(),
8807 selection: query,
8808 graphql_client: self.graphql_client.clone(),
8809 }
8810 }
8811 pub async fn sync(&self) -> Result<File, DaggerError> {
8813 let query = self.selection.select("sync");
8814 let id: Id = query.execute(self.graphql_client.clone()).await?;
8815 Ok(File {
8816 proc: self.proc.clone(),
8817 selection: query
8818 .root()
8819 .select("node")
8820 .arg("id", &id.0)
8821 .inline_fragment("File"),
8822 graphql_client: self.graphql_client.clone(),
8823 })
8824 }
8825 pub fn with_name(&self, name: impl Into<String>) -> File {
8831 let mut query = self.selection.select("withName");
8832 query = query.arg("name", name.into());
8833 File {
8834 proc: self.proc.clone(),
8835 selection: query,
8836 graphql_client: self.graphql_client.clone(),
8837 }
8838 }
8839 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8851 let mut query = self.selection.select("withReplaced");
8852 query = query.arg("search", search.into());
8853 query = query.arg("replacement", replacement.into());
8854 File {
8855 proc: self.proc.clone(),
8856 selection: query,
8857 graphql_client: self.graphql_client.clone(),
8858 }
8859 }
8860 pub fn with_replaced_opts(
8872 &self,
8873 search: impl Into<String>,
8874 replacement: impl Into<String>,
8875 opts: FileWithReplacedOpts,
8876 ) -> File {
8877 let mut query = self.selection.select("withReplaced");
8878 query = query.arg("search", search.into());
8879 query = query.arg("replacement", replacement.into());
8880 if let Some(all) = opts.all {
8881 query = query.arg("all", all);
8882 }
8883 if let Some(first_from) = opts.first_from {
8884 query = query.arg("firstFrom", first_from);
8885 }
8886 File {
8887 proc: self.proc.clone(),
8888 selection: query,
8889 graphql_client: self.graphql_client.clone(),
8890 }
8891 }
8892 pub fn with_timestamps(&self, timestamp: isize) -> File {
8900 let mut query = self.selection.select("withTimestamps");
8901 query = query.arg("timestamp", timestamp);
8902 File {
8903 proc: self.proc.clone(),
8904 selection: query,
8905 graphql_client: self.graphql_client.clone(),
8906 }
8907 }
8908}
8909impl Exportable for File {
8910 fn export(
8911 &self,
8912 path: impl Into<String>,
8913 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
8914 let mut query = self.selection.select("export");
8915 query = query.arg("path", path.into());
8916 let graphql_client = self.graphql_client.clone();
8917 async move { query.execute(graphql_client).await }
8918 }
8919 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8920 let query = self.selection.select("id");
8921 let graphql_client = self.graphql_client.clone();
8922 async move { query.execute(graphql_client).await }
8923 }
8924}
8925impl Node for File {
8926 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8927 let query = self.selection.select("id");
8928 let graphql_client = self.graphql_client.clone();
8929 async move { query.execute(graphql_client).await }
8930 }
8931}
8932impl Syncer for File {
8933 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8934 let query = self.selection.select("id");
8935 let graphql_client = self.graphql_client.clone();
8936 async move { query.execute(graphql_client).await }
8937 }
8938 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8939 let query = self.selection.select("sync");
8940 let graphql_client = self.graphql_client.clone();
8941 async move { query.execute(graphql_client).await }
8942 }
8943}
8944#[derive(Clone)]
8945pub struct Function {
8946 pub proc: Option<Arc<DaggerSessionProc>>,
8947 pub selection: Selection,
8948 pub graphql_client: DynGraphQLClient,
8949}
8950#[derive(Builder, Debug, PartialEq)]
8951pub struct FunctionWithArgOpts<'a> {
8952 #[builder(setter(into, strip_option), default)]
8953 pub default_address: Option<&'a str>,
8954 #[builder(setter(into, strip_option), default)]
8956 pub default_path: Option<&'a str>,
8957 #[builder(setter(into, strip_option), default)]
8959 pub default_value: Option<Json>,
8960 #[builder(setter(into, strip_option), default)]
8962 pub deprecated: Option<&'a str>,
8963 #[builder(setter(into, strip_option), default)]
8965 pub description: Option<&'a str>,
8966 #[builder(setter(into, strip_option), default)]
8968 pub ignore: Option<Vec<&'a str>>,
8969 #[builder(setter(into, strip_option), default)]
8971 pub source_map: Option<Id>,
8972}
8973#[derive(Builder, Debug, PartialEq)]
8974pub struct FunctionWithCachePolicyOpts<'a> {
8975 #[builder(setter(into, strip_option), default)]
8977 pub time_to_live: Option<&'a str>,
8978}
8979#[derive(Builder, Debug, PartialEq)]
8980pub struct FunctionWithDeprecatedOpts<'a> {
8981 #[builder(setter(into, strip_option), default)]
8983 pub reason: Option<&'a str>,
8984}
8985impl IntoID<Id> for Function {
8986 fn into_id(
8987 self,
8988 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8989 Box::pin(async move { self.id().await })
8990 }
8991}
8992impl Loadable for Function {
8993 fn graphql_type() -> &'static str {
8994 "Function"
8995 }
8996 fn from_query(
8997 proc: Option<Arc<DaggerSessionProc>>,
8998 selection: Selection,
8999 graphql_client: DynGraphQLClient,
9000 ) -> Self {
9001 Self {
9002 proc,
9003 selection,
9004 graphql_client,
9005 }
9006 }
9007}
9008impl Function {
9009 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9011 let query = self.selection.select("args");
9012 let query = query.select("id");
9013 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9014 Ok(ids
9015 .into_iter()
9016 .map(|id| FunctionArg {
9017 proc: self.proc.clone(),
9018 selection: crate::querybuilder::query()
9019 .select("node")
9020 .arg("id", &id.0)
9021 .inline_fragment("FunctionArg"),
9022 graphql_client: self.graphql_client.clone(),
9023 })
9024 .collect())
9025 }
9026 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9028 let query = self.selection.select("deprecated");
9029 query.execute(self.graphql_client.clone()).await
9030 }
9031 pub async fn description(&self) -> Result<String, DaggerError> {
9033 let query = self.selection.select("description");
9034 query.execute(self.graphql_client.clone()).await
9035 }
9036 pub async fn id(&self) -> Result<Id, DaggerError> {
9038 let query = self.selection.select("id");
9039 query.execute(self.graphql_client.clone()).await
9040 }
9041 pub async fn name(&self) -> Result<String, DaggerError> {
9043 let query = self.selection.select("name");
9044 query.execute(self.graphql_client.clone()).await
9045 }
9046 pub fn return_type(&self) -> TypeDef {
9048 let query = self.selection.select("returnType");
9049 TypeDef {
9050 proc: self.proc.clone(),
9051 selection: query,
9052 graphql_client: self.graphql_client.clone(),
9053 }
9054 }
9055 pub fn source_map(&self) -> SourceMap {
9057 let query = self.selection.select("sourceMap");
9058 SourceMap {
9059 proc: self.proc.clone(),
9060 selection: query,
9061 graphql_client: self.graphql_client.clone(),
9062 }
9063 }
9064 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9066 let query = self.selection.select("sourceModuleName");
9067 query.execute(self.graphql_client.clone()).await
9068 }
9069 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9077 let mut query = self.selection.select("withArg");
9078 query = query.arg("name", name.into());
9079 query = query.arg_lazy(
9080 "typeDef",
9081 Box::new(move || {
9082 let type_def = type_def.clone();
9083 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9084 }),
9085 );
9086 Function {
9087 proc: self.proc.clone(),
9088 selection: query,
9089 graphql_client: self.graphql_client.clone(),
9090 }
9091 }
9092 pub fn with_arg_opts<'a>(
9100 &self,
9101 name: impl Into<String>,
9102 type_def: impl IntoID<Id>,
9103 opts: FunctionWithArgOpts<'a>,
9104 ) -> Function {
9105 let mut query = self.selection.select("withArg");
9106 query = query.arg("name", name.into());
9107 query = query.arg_lazy(
9108 "typeDef",
9109 Box::new(move || {
9110 let type_def = type_def.clone();
9111 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9112 }),
9113 );
9114 if let Some(description) = opts.description {
9115 query = query.arg("description", description);
9116 }
9117 if let Some(default_value) = opts.default_value {
9118 query = query.arg("defaultValue", default_value);
9119 }
9120 if let Some(default_path) = opts.default_path {
9121 query = query.arg("defaultPath", default_path);
9122 }
9123 if let Some(ignore) = opts.ignore {
9124 query = query.arg("ignore", ignore);
9125 }
9126 if let Some(source_map) = opts.source_map {
9127 query = query.arg("sourceMap", source_map);
9128 }
9129 if let Some(deprecated) = opts.deprecated {
9130 query = query.arg("deprecated", deprecated);
9131 }
9132 if let Some(default_address) = opts.default_address {
9133 query = query.arg("defaultAddress", default_address);
9134 }
9135 Function {
9136 proc: self.proc.clone(),
9137 selection: query,
9138 graphql_client: self.graphql_client.clone(),
9139 }
9140 }
9141 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9148 let mut query = self.selection.select("withCachePolicy");
9149 query = query.arg("policy", policy);
9150 Function {
9151 proc: self.proc.clone(),
9152 selection: query,
9153 graphql_client: self.graphql_client.clone(),
9154 }
9155 }
9156 pub fn with_cache_policy_opts<'a>(
9163 &self,
9164 policy: FunctionCachePolicy,
9165 opts: FunctionWithCachePolicyOpts<'a>,
9166 ) -> Function {
9167 let mut query = self.selection.select("withCachePolicy");
9168 query = query.arg("policy", policy);
9169 if let Some(time_to_live) = opts.time_to_live {
9170 query = query.arg("timeToLive", time_to_live);
9171 }
9172 Function {
9173 proc: self.proc.clone(),
9174 selection: query,
9175 graphql_client: self.graphql_client.clone(),
9176 }
9177 }
9178 pub fn with_check(&self) -> Function {
9180 let query = self.selection.select("withCheck");
9181 Function {
9182 proc: self.proc.clone(),
9183 selection: query,
9184 graphql_client: self.graphql_client.clone(),
9185 }
9186 }
9187 pub fn with_deprecated(&self) -> Function {
9193 let query = self.selection.select("withDeprecated");
9194 Function {
9195 proc: self.proc.clone(),
9196 selection: query,
9197 graphql_client: self.graphql_client.clone(),
9198 }
9199 }
9200 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9206 let mut query = self.selection.select("withDeprecated");
9207 if let Some(reason) = opts.reason {
9208 query = query.arg("reason", reason);
9209 }
9210 Function {
9211 proc: self.proc.clone(),
9212 selection: query,
9213 graphql_client: self.graphql_client.clone(),
9214 }
9215 }
9216 pub fn with_description(&self, description: impl Into<String>) -> Function {
9222 let mut query = self.selection.select("withDescription");
9223 query = query.arg("description", description.into());
9224 Function {
9225 proc: self.proc.clone(),
9226 selection: query,
9227 graphql_client: self.graphql_client.clone(),
9228 }
9229 }
9230 pub fn with_generator(&self) -> Function {
9232 let query = self.selection.select("withGenerator");
9233 Function {
9234 proc: self.proc.clone(),
9235 selection: query,
9236 graphql_client: self.graphql_client.clone(),
9237 }
9238 }
9239 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9245 let mut query = self.selection.select("withSourceMap");
9246 query = query.arg_lazy(
9247 "sourceMap",
9248 Box::new(move || {
9249 let source_map = source_map.clone();
9250 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9251 }),
9252 );
9253 Function {
9254 proc: self.proc.clone(),
9255 selection: query,
9256 graphql_client: self.graphql_client.clone(),
9257 }
9258 }
9259 pub fn with_up(&self) -> Function {
9261 let query = self.selection.select("withUp");
9262 Function {
9263 proc: self.proc.clone(),
9264 selection: query,
9265 graphql_client: self.graphql_client.clone(),
9266 }
9267 }
9268}
9269impl Node for Function {
9270 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9271 let query = self.selection.select("id");
9272 let graphql_client = self.graphql_client.clone();
9273 async move { query.execute(graphql_client).await }
9274 }
9275}
9276#[derive(Clone)]
9277pub struct FunctionArg {
9278 pub proc: Option<Arc<DaggerSessionProc>>,
9279 pub selection: Selection,
9280 pub graphql_client: DynGraphQLClient,
9281}
9282impl IntoID<Id> for FunctionArg {
9283 fn into_id(
9284 self,
9285 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9286 Box::pin(async move { self.id().await })
9287 }
9288}
9289impl Loadable for FunctionArg {
9290 fn graphql_type() -> &'static str {
9291 "FunctionArg"
9292 }
9293 fn from_query(
9294 proc: Option<Arc<DaggerSessionProc>>,
9295 selection: Selection,
9296 graphql_client: DynGraphQLClient,
9297 ) -> Self {
9298 Self {
9299 proc,
9300 selection,
9301 graphql_client,
9302 }
9303 }
9304}
9305impl FunctionArg {
9306 pub async fn default_address(&self) -> Result<String, DaggerError> {
9308 let query = self.selection.select("defaultAddress");
9309 query.execute(self.graphql_client.clone()).await
9310 }
9311 pub async fn default_path(&self) -> Result<String, DaggerError> {
9313 let query = self.selection.select("defaultPath");
9314 query.execute(self.graphql_client.clone()).await
9315 }
9316 pub async fn default_value(&self) -> Result<Json, DaggerError> {
9318 let query = self.selection.select("defaultValue");
9319 query.execute(self.graphql_client.clone()).await
9320 }
9321 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9323 let query = self.selection.select("deprecated");
9324 query.execute(self.graphql_client.clone()).await
9325 }
9326 pub async fn description(&self) -> Result<String, DaggerError> {
9328 let query = self.selection.select("description");
9329 query.execute(self.graphql_client.clone()).await
9330 }
9331 pub async fn id(&self) -> Result<Id, DaggerError> {
9333 let query = self.selection.select("id");
9334 query.execute(self.graphql_client.clone()).await
9335 }
9336 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9338 let query = self.selection.select("ignore");
9339 query.execute(self.graphql_client.clone()).await
9340 }
9341 pub async fn name(&self) -> Result<String, DaggerError> {
9343 let query = self.selection.select("name");
9344 query.execute(self.graphql_client.clone()).await
9345 }
9346 pub fn source_map(&self) -> SourceMap {
9348 let query = self.selection.select("sourceMap");
9349 SourceMap {
9350 proc: self.proc.clone(),
9351 selection: query,
9352 graphql_client: self.graphql_client.clone(),
9353 }
9354 }
9355 pub fn type_def(&self) -> TypeDef {
9357 let query = self.selection.select("typeDef");
9358 TypeDef {
9359 proc: self.proc.clone(),
9360 selection: query,
9361 graphql_client: self.graphql_client.clone(),
9362 }
9363 }
9364}
9365impl Node for FunctionArg {
9366 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9367 let query = self.selection.select("id");
9368 let graphql_client = self.graphql_client.clone();
9369 async move { query.execute(graphql_client).await }
9370 }
9371}
9372#[derive(Clone)]
9373pub struct FunctionCall {
9374 pub proc: Option<Arc<DaggerSessionProc>>,
9375 pub selection: Selection,
9376 pub graphql_client: DynGraphQLClient,
9377}
9378impl IntoID<Id> for FunctionCall {
9379 fn into_id(
9380 self,
9381 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9382 Box::pin(async move { self.id().await })
9383 }
9384}
9385impl Loadable for FunctionCall {
9386 fn graphql_type() -> &'static str {
9387 "FunctionCall"
9388 }
9389 fn from_query(
9390 proc: Option<Arc<DaggerSessionProc>>,
9391 selection: Selection,
9392 graphql_client: DynGraphQLClient,
9393 ) -> Self {
9394 Self {
9395 proc,
9396 selection,
9397 graphql_client,
9398 }
9399 }
9400}
9401impl FunctionCall {
9402 pub async fn id(&self) -> Result<Id, DaggerError> {
9404 let query = self.selection.select("id");
9405 query.execute(self.graphql_client.clone()).await
9406 }
9407 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9409 let query = self.selection.select("inputArgs");
9410 let query = query.select("id");
9411 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9412 Ok(ids
9413 .into_iter()
9414 .map(|id| FunctionCallArgValue {
9415 proc: self.proc.clone(),
9416 selection: crate::querybuilder::query()
9417 .select("node")
9418 .arg("id", &id.0)
9419 .inline_fragment("FunctionCallArgValue"),
9420 graphql_client: self.graphql_client.clone(),
9421 })
9422 .collect())
9423 }
9424 pub async fn name(&self) -> Result<String, DaggerError> {
9426 let query = self.selection.select("name");
9427 query.execute(self.graphql_client.clone()).await
9428 }
9429 pub async fn parent(&self) -> Result<Json, DaggerError> {
9431 let query = self.selection.select("parent");
9432 query.execute(self.graphql_client.clone()).await
9433 }
9434 pub async fn parent_name(&self) -> Result<String, DaggerError> {
9436 let query = self.selection.select("parentName");
9437 query.execute(self.graphql_client.clone()).await
9438 }
9439 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9445 let mut query = self.selection.select("returnError");
9446 query = query.arg_lazy(
9447 "error",
9448 Box::new(move || {
9449 let error = error.clone();
9450 Box::pin(async move { error.into_id().await.unwrap().quote() })
9451 }),
9452 );
9453 query.execute(self.graphql_client.clone()).await
9454 }
9455 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9461 let mut query = self.selection.select("returnValue");
9462 query = query.arg("value", value);
9463 query.execute(self.graphql_client.clone()).await
9464 }
9465}
9466impl Node for FunctionCall {
9467 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9468 let query = self.selection.select("id");
9469 let graphql_client = self.graphql_client.clone();
9470 async move { query.execute(graphql_client).await }
9471 }
9472}
9473#[derive(Clone)]
9474pub struct FunctionCallArgValue {
9475 pub proc: Option<Arc<DaggerSessionProc>>,
9476 pub selection: Selection,
9477 pub graphql_client: DynGraphQLClient,
9478}
9479impl IntoID<Id> for FunctionCallArgValue {
9480 fn into_id(
9481 self,
9482 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9483 Box::pin(async move { self.id().await })
9484 }
9485}
9486impl Loadable for FunctionCallArgValue {
9487 fn graphql_type() -> &'static str {
9488 "FunctionCallArgValue"
9489 }
9490 fn from_query(
9491 proc: Option<Arc<DaggerSessionProc>>,
9492 selection: Selection,
9493 graphql_client: DynGraphQLClient,
9494 ) -> Self {
9495 Self {
9496 proc,
9497 selection,
9498 graphql_client,
9499 }
9500 }
9501}
9502impl FunctionCallArgValue {
9503 pub async fn id(&self) -> Result<Id, DaggerError> {
9505 let query = self.selection.select("id");
9506 query.execute(self.graphql_client.clone()).await
9507 }
9508 pub async fn name(&self) -> Result<String, DaggerError> {
9510 let query = self.selection.select("name");
9511 query.execute(self.graphql_client.clone()).await
9512 }
9513 pub async fn value(&self) -> Result<Json, DaggerError> {
9515 let query = self.selection.select("value");
9516 query.execute(self.graphql_client.clone()).await
9517 }
9518}
9519impl Node for FunctionCallArgValue {
9520 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9521 let query = self.selection.select("id");
9522 let graphql_client = self.graphql_client.clone();
9523 async move { query.execute(graphql_client).await }
9524 }
9525}
9526#[derive(Clone)]
9527pub struct GeneratedCode {
9528 pub proc: Option<Arc<DaggerSessionProc>>,
9529 pub selection: Selection,
9530 pub graphql_client: DynGraphQLClient,
9531}
9532impl IntoID<Id> for GeneratedCode {
9533 fn into_id(
9534 self,
9535 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9536 Box::pin(async move { self.id().await })
9537 }
9538}
9539impl Loadable for GeneratedCode {
9540 fn graphql_type() -> &'static str {
9541 "GeneratedCode"
9542 }
9543 fn from_query(
9544 proc: Option<Arc<DaggerSessionProc>>,
9545 selection: Selection,
9546 graphql_client: DynGraphQLClient,
9547 ) -> Self {
9548 Self {
9549 proc,
9550 selection,
9551 graphql_client,
9552 }
9553 }
9554}
9555impl GeneratedCode {
9556 pub fn code(&self) -> Directory {
9558 let query = self.selection.select("code");
9559 Directory {
9560 proc: self.proc.clone(),
9561 selection: query,
9562 graphql_client: self.graphql_client.clone(),
9563 }
9564 }
9565 pub async fn id(&self) -> Result<Id, DaggerError> {
9567 let query = self.selection.select("id");
9568 query.execute(self.graphql_client.clone()).await
9569 }
9570 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9572 let query = self.selection.select("vcsGeneratedPaths");
9573 query.execute(self.graphql_client.clone()).await
9574 }
9575 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9577 let query = self.selection.select("vcsIgnoredPaths");
9578 query.execute(self.graphql_client.clone()).await
9579 }
9580 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9582 let mut query = self.selection.select("withVCSGeneratedPaths");
9583 query = query.arg(
9584 "paths",
9585 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9586 );
9587 GeneratedCode {
9588 proc: self.proc.clone(),
9589 selection: query,
9590 graphql_client: self.graphql_client.clone(),
9591 }
9592 }
9593 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9595 let mut query = self.selection.select("withVCSIgnoredPaths");
9596 query = query.arg(
9597 "paths",
9598 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9599 );
9600 GeneratedCode {
9601 proc: self.proc.clone(),
9602 selection: query,
9603 graphql_client: self.graphql_client.clone(),
9604 }
9605 }
9606}
9607impl Node for GeneratedCode {
9608 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9609 let query = self.selection.select("id");
9610 let graphql_client = self.graphql_client.clone();
9611 async move { query.execute(graphql_client).await }
9612 }
9613}
9614#[derive(Clone)]
9615pub struct Generator {
9616 pub proc: Option<Arc<DaggerSessionProc>>,
9617 pub selection: Selection,
9618 pub graphql_client: DynGraphQLClient,
9619}
9620impl IntoID<Id> for Generator {
9621 fn into_id(
9622 self,
9623 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9624 Box::pin(async move { self.id().await })
9625 }
9626}
9627impl Loadable for Generator {
9628 fn graphql_type() -> &'static str {
9629 "Generator"
9630 }
9631 fn from_query(
9632 proc: Option<Arc<DaggerSessionProc>>,
9633 selection: Selection,
9634 graphql_client: DynGraphQLClient,
9635 ) -> Self {
9636 Self {
9637 proc,
9638 selection,
9639 graphql_client,
9640 }
9641 }
9642}
9643impl Generator {
9644 pub fn changes(&self) -> Changeset {
9646 let query = self.selection.select("changes");
9647 Changeset {
9648 proc: self.proc.clone(),
9649 selection: query,
9650 graphql_client: self.graphql_client.clone(),
9651 }
9652 }
9653 pub async fn completed(&self) -> Result<bool, DaggerError> {
9655 let query = self.selection.select("completed");
9656 query.execute(self.graphql_client.clone()).await
9657 }
9658 pub async fn description(&self) -> Result<String, DaggerError> {
9660 let query = self.selection.select("description");
9661 query.execute(self.graphql_client.clone()).await
9662 }
9663 pub async fn id(&self) -> Result<Id, DaggerError> {
9665 let query = self.selection.select("id");
9666 query.execute(self.graphql_client.clone()).await
9667 }
9668 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9670 let query = self.selection.select("isEmpty");
9671 query.execute(self.graphql_client.clone()).await
9672 }
9673 pub async fn name(&self) -> Result<String, DaggerError> {
9675 let query = self.selection.select("name");
9676 query.execute(self.graphql_client.clone()).await
9677 }
9678 pub fn original_module(&self) -> Module {
9680 let query = self.selection.select("originalModule");
9681 Module {
9682 proc: self.proc.clone(),
9683 selection: query,
9684 graphql_client: self.graphql_client.clone(),
9685 }
9686 }
9687 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9689 let query = self.selection.select("path");
9690 query.execute(self.graphql_client.clone()).await
9691 }
9692 pub fn run(&self) -> Generator {
9694 let query = self.selection.select("run");
9695 Generator {
9696 proc: self.proc.clone(),
9697 selection: query,
9698 graphql_client: self.graphql_client.clone(),
9699 }
9700 }
9701}
9702impl Node for Generator {
9703 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9704 let query = self.selection.select("id");
9705 let graphql_client = self.graphql_client.clone();
9706 async move { query.execute(graphql_client).await }
9707 }
9708}
9709#[derive(Clone)]
9710pub struct GeneratorGroup {
9711 pub proc: Option<Arc<DaggerSessionProc>>,
9712 pub selection: Selection,
9713 pub graphql_client: DynGraphQLClient,
9714}
9715#[derive(Builder, Debug, PartialEq)]
9716pub struct GeneratorGroupChangesOpts {
9717 #[builder(setter(into, strip_option), default)]
9719 pub on_conflict: Option<ChangesetsMergeConflict>,
9720}
9721impl IntoID<Id> for GeneratorGroup {
9722 fn into_id(
9723 self,
9724 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9725 Box::pin(async move { self.id().await })
9726 }
9727}
9728impl Loadable for GeneratorGroup {
9729 fn graphql_type() -> &'static str {
9730 "GeneratorGroup"
9731 }
9732 fn from_query(
9733 proc: Option<Arc<DaggerSessionProc>>,
9734 selection: Selection,
9735 graphql_client: DynGraphQLClient,
9736 ) -> Self {
9737 Self {
9738 proc,
9739 selection,
9740 graphql_client,
9741 }
9742 }
9743}
9744impl GeneratorGroup {
9745 pub fn changes(&self) -> Changeset {
9753 let query = self.selection.select("changes");
9754 Changeset {
9755 proc: self.proc.clone(),
9756 selection: query,
9757 graphql_client: self.graphql_client.clone(),
9758 }
9759 }
9760 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9768 let mut query = self.selection.select("changes");
9769 if let Some(on_conflict) = opts.on_conflict {
9770 query = query.arg("onConflict", on_conflict);
9771 }
9772 Changeset {
9773 proc: self.proc.clone(),
9774 selection: query,
9775 graphql_client: self.graphql_client.clone(),
9776 }
9777 }
9778 pub async fn id(&self) -> Result<Id, DaggerError> {
9780 let query = self.selection.select("id");
9781 query.execute(self.graphql_client.clone()).await
9782 }
9783 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9785 let query = self.selection.select("isEmpty");
9786 query.execute(self.graphql_client.clone()).await
9787 }
9788 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9790 let query = self.selection.select("list");
9791 let query = query.select("id");
9792 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9793 Ok(ids
9794 .into_iter()
9795 .map(|id| Generator {
9796 proc: self.proc.clone(),
9797 selection: crate::querybuilder::query()
9798 .select("node")
9799 .arg("id", &id.0)
9800 .inline_fragment("Generator"),
9801 graphql_client: self.graphql_client.clone(),
9802 })
9803 .collect())
9804 }
9805 pub fn run(&self) -> GeneratorGroup {
9807 let query = self.selection.select("run");
9808 GeneratorGroup {
9809 proc: self.proc.clone(),
9810 selection: query,
9811 graphql_client: self.graphql_client.clone(),
9812 }
9813 }
9814}
9815impl Node for GeneratorGroup {
9816 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9817 let query = self.selection.select("id");
9818 let graphql_client = self.graphql_client.clone();
9819 async move { query.execute(graphql_client).await }
9820 }
9821}
9822#[derive(Clone)]
9823pub struct GitRef {
9824 pub proc: Option<Arc<DaggerSessionProc>>,
9825 pub selection: Selection,
9826 pub graphql_client: DynGraphQLClient,
9827}
9828#[derive(Builder, Debug, PartialEq)]
9829pub struct GitRefTreeOpts {
9830 #[builder(setter(into, strip_option), default)]
9832 pub depth: Option<isize>,
9833 #[builder(setter(into, strip_option), default)]
9835 pub discard_git_dir: Option<bool>,
9836 #[builder(setter(into, strip_option), default)]
9838 pub include_tags: Option<bool>,
9839}
9840impl IntoID<Id> for GitRef {
9841 fn into_id(
9842 self,
9843 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9844 Box::pin(async move { self.id().await })
9845 }
9846}
9847impl Loadable for GitRef {
9848 fn graphql_type() -> &'static str {
9849 "GitRef"
9850 }
9851 fn from_query(
9852 proc: Option<Arc<DaggerSessionProc>>,
9853 selection: Selection,
9854 graphql_client: DynGraphQLClient,
9855 ) -> Self {
9856 Self {
9857 proc,
9858 selection,
9859 graphql_client,
9860 }
9861 }
9862}
9863impl GitRef {
9864 pub async fn commit(&self) -> Result<String, DaggerError> {
9866 let query = self.selection.select("commit");
9867 query.execute(self.graphql_client.clone()).await
9868 }
9869 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9875 let mut query = self.selection.select("commonAncestor");
9876 query = query.arg_lazy(
9877 "other",
9878 Box::new(move || {
9879 let other = other.clone();
9880 Box::pin(async move { other.into_id().await.unwrap().quote() })
9881 }),
9882 );
9883 GitRef {
9884 proc: self.proc.clone(),
9885 selection: query,
9886 graphql_client: self.graphql_client.clone(),
9887 }
9888 }
9889 pub async fn id(&self) -> Result<Id, DaggerError> {
9891 let query = self.selection.select("id");
9892 query.execute(self.graphql_client.clone()).await
9893 }
9894 pub async fn r#ref(&self) -> Result<String, DaggerError> {
9896 let query = self.selection.select("ref");
9897 query.execute(self.graphql_client.clone()).await
9898 }
9899 pub fn tree(&self) -> Directory {
9905 let query = self.selection.select("tree");
9906 Directory {
9907 proc: self.proc.clone(),
9908 selection: query,
9909 graphql_client: self.graphql_client.clone(),
9910 }
9911 }
9912 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9918 let mut query = self.selection.select("tree");
9919 if let Some(discard_git_dir) = opts.discard_git_dir {
9920 query = query.arg("discardGitDir", discard_git_dir);
9921 }
9922 if let Some(depth) = opts.depth {
9923 query = query.arg("depth", depth);
9924 }
9925 if let Some(include_tags) = opts.include_tags {
9926 query = query.arg("includeTags", include_tags);
9927 }
9928 Directory {
9929 proc: self.proc.clone(),
9930 selection: query,
9931 graphql_client: self.graphql_client.clone(),
9932 }
9933 }
9934}
9935impl Node for GitRef {
9936 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9937 let query = self.selection.select("id");
9938 let graphql_client = self.graphql_client.clone();
9939 async move { query.execute(graphql_client).await }
9940 }
9941}
9942#[derive(Clone)]
9943pub struct GitRepository {
9944 pub proc: Option<Arc<DaggerSessionProc>>,
9945 pub selection: Selection,
9946 pub graphql_client: DynGraphQLClient,
9947}
9948#[derive(Builder, Debug, PartialEq)]
9949pub struct GitRepositoryBranchesOpts<'a> {
9950 #[builder(setter(into, strip_option), default)]
9952 pub patterns: Option<Vec<&'a str>>,
9953}
9954#[derive(Builder, Debug, PartialEq)]
9955pub struct GitRepositoryTagsOpts<'a> {
9956 #[builder(setter(into, strip_option), default)]
9958 pub patterns: Option<Vec<&'a str>>,
9959}
9960impl IntoID<Id> for GitRepository {
9961 fn into_id(
9962 self,
9963 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9964 Box::pin(async move { self.id().await })
9965 }
9966}
9967impl Loadable for GitRepository {
9968 fn graphql_type() -> &'static str {
9969 "GitRepository"
9970 }
9971 fn from_query(
9972 proc: Option<Arc<DaggerSessionProc>>,
9973 selection: Selection,
9974 graphql_client: DynGraphQLClient,
9975 ) -> Self {
9976 Self {
9977 proc,
9978 selection,
9979 graphql_client,
9980 }
9981 }
9982}
9983impl GitRepository {
9984 pub fn branch(&self, name: impl Into<String>) -> GitRef {
9990 let mut query = self.selection.select("branch");
9991 query = query.arg("name", name.into());
9992 GitRef {
9993 proc: self.proc.clone(),
9994 selection: query,
9995 graphql_client: self.graphql_client.clone(),
9996 }
9997 }
9998 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10004 let query = self.selection.select("branches");
10005 query.execute(self.graphql_client.clone()).await
10006 }
10007 pub async fn branches_opts<'a>(
10013 &self,
10014 opts: GitRepositoryBranchesOpts<'a>,
10015 ) -> Result<Vec<String>, DaggerError> {
10016 let mut query = self.selection.select("branches");
10017 if let Some(patterns) = opts.patterns {
10018 query = query.arg("patterns", patterns);
10019 }
10020 query.execute(self.graphql_client.clone()).await
10021 }
10022 pub fn commit(&self, id: impl Into<String>) -> GitRef {
10028 let mut query = self.selection.select("commit");
10029 query = query.arg("id", id.into());
10030 GitRef {
10031 proc: self.proc.clone(),
10032 selection: query,
10033 graphql_client: self.graphql_client.clone(),
10034 }
10035 }
10036 pub fn head(&self) -> GitRef {
10038 let query = self.selection.select("head");
10039 GitRef {
10040 proc: self.proc.clone(),
10041 selection: query,
10042 graphql_client: self.graphql_client.clone(),
10043 }
10044 }
10045 pub async fn id(&self) -> Result<Id, DaggerError> {
10047 let query = self.selection.select("id");
10048 query.execute(self.graphql_client.clone()).await
10049 }
10050 pub fn latest_version(&self) -> GitRef {
10052 let query = self.selection.select("latestVersion");
10053 GitRef {
10054 proc: self.proc.clone(),
10055 selection: query,
10056 graphql_client: self.graphql_client.clone(),
10057 }
10058 }
10059 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10065 let mut query = self.selection.select("ref");
10066 query = query.arg("name", name.into());
10067 GitRef {
10068 proc: self.proc.clone(),
10069 selection: query,
10070 graphql_client: self.graphql_client.clone(),
10071 }
10072 }
10073 pub fn tag(&self, name: impl Into<String>) -> GitRef {
10079 let mut query = self.selection.select("tag");
10080 query = query.arg("name", name.into());
10081 GitRef {
10082 proc: self.proc.clone(),
10083 selection: query,
10084 graphql_client: self.graphql_client.clone(),
10085 }
10086 }
10087 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10093 let query = self.selection.select("tags");
10094 query.execute(self.graphql_client.clone()).await
10095 }
10096 pub async fn tags_opts<'a>(
10102 &self,
10103 opts: GitRepositoryTagsOpts<'a>,
10104 ) -> Result<Vec<String>, DaggerError> {
10105 let mut query = self.selection.select("tags");
10106 if let Some(patterns) = opts.patterns {
10107 query = query.arg("patterns", patterns);
10108 }
10109 query.execute(self.graphql_client.clone()).await
10110 }
10111 pub fn uncommitted(&self) -> Changeset {
10113 let query = self.selection.select("uncommitted");
10114 Changeset {
10115 proc: self.proc.clone(),
10116 selection: query,
10117 graphql_client: self.graphql_client.clone(),
10118 }
10119 }
10120 pub async fn url(&self) -> Result<String, DaggerError> {
10122 let query = self.selection.select("url");
10123 query.execute(self.graphql_client.clone()).await
10124 }
10125}
10126impl Node for GitRepository {
10127 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10128 let query = self.selection.select("id");
10129 let graphql_client = self.graphql_client.clone();
10130 async move { query.execute(graphql_client).await }
10131 }
10132}
10133#[derive(Clone)]
10134pub struct HttpState {
10135 pub proc: Option<Arc<DaggerSessionProc>>,
10136 pub selection: Selection,
10137 pub graphql_client: DynGraphQLClient,
10138}
10139impl IntoID<Id> for HttpState {
10140 fn into_id(
10141 self,
10142 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10143 Box::pin(async move { self.id().await })
10144 }
10145}
10146impl Loadable for HttpState {
10147 fn graphql_type() -> &'static str {
10148 "HTTPState"
10149 }
10150 fn from_query(
10151 proc: Option<Arc<DaggerSessionProc>>,
10152 selection: Selection,
10153 graphql_client: DynGraphQLClient,
10154 ) -> Self {
10155 Self {
10156 proc,
10157 selection,
10158 graphql_client,
10159 }
10160 }
10161}
10162impl HttpState {
10163 pub async fn id(&self) -> Result<Id, DaggerError> {
10165 let query = self.selection.select("id");
10166 query.execute(self.graphql_client.clone()).await
10167 }
10168}
10169impl Node for HttpState {
10170 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10171 let query = self.selection.select("id");
10172 let graphql_client = self.graphql_client.clone();
10173 async move { query.execute(graphql_client).await }
10174 }
10175}
10176#[derive(Clone)]
10177pub struct HealthcheckConfig {
10178 pub proc: Option<Arc<DaggerSessionProc>>,
10179 pub selection: Selection,
10180 pub graphql_client: DynGraphQLClient,
10181}
10182impl IntoID<Id> for HealthcheckConfig {
10183 fn into_id(
10184 self,
10185 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10186 Box::pin(async move { self.id().await })
10187 }
10188}
10189impl Loadable for HealthcheckConfig {
10190 fn graphql_type() -> &'static str {
10191 "HealthcheckConfig"
10192 }
10193 fn from_query(
10194 proc: Option<Arc<DaggerSessionProc>>,
10195 selection: Selection,
10196 graphql_client: DynGraphQLClient,
10197 ) -> Self {
10198 Self {
10199 proc,
10200 selection,
10201 graphql_client,
10202 }
10203 }
10204}
10205impl HealthcheckConfig {
10206 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10208 let query = self.selection.select("args");
10209 query.execute(self.graphql_client.clone()).await
10210 }
10211 pub async fn id(&self) -> Result<Id, DaggerError> {
10213 let query = self.selection.select("id");
10214 query.execute(self.graphql_client.clone()).await
10215 }
10216 pub async fn interval(&self) -> Result<String, DaggerError> {
10218 let query = self.selection.select("interval");
10219 query.execute(self.graphql_client.clone()).await
10220 }
10221 pub async fn retries(&self) -> Result<isize, DaggerError> {
10223 let query = self.selection.select("retries");
10224 query.execute(self.graphql_client.clone()).await
10225 }
10226 pub async fn shell(&self) -> Result<bool, DaggerError> {
10228 let query = self.selection.select("shell");
10229 query.execute(self.graphql_client.clone()).await
10230 }
10231 pub async fn start_interval(&self) -> Result<String, DaggerError> {
10233 let query = self.selection.select("startInterval");
10234 query.execute(self.graphql_client.clone()).await
10235 }
10236 pub async fn start_period(&self) -> Result<String, DaggerError> {
10238 let query = self.selection.select("startPeriod");
10239 query.execute(self.graphql_client.clone()).await
10240 }
10241 pub async fn timeout(&self) -> Result<String, DaggerError> {
10243 let query = self.selection.select("timeout");
10244 query.execute(self.graphql_client.clone()).await
10245 }
10246}
10247impl Node for HealthcheckConfig {
10248 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10249 let query = self.selection.select("id");
10250 let graphql_client = self.graphql_client.clone();
10251 async move { query.execute(graphql_client).await }
10252 }
10253}
10254#[derive(Clone)]
10255pub struct Host {
10256 pub proc: Option<Arc<DaggerSessionProc>>,
10257 pub selection: Selection,
10258 pub graphql_client: DynGraphQLClient,
10259}
10260#[derive(Builder, Debug, PartialEq)]
10261pub struct HostDirectoryOpts<'a> {
10262 #[builder(setter(into, strip_option), default)]
10264 pub exclude: Option<Vec<&'a str>>,
10265 #[builder(setter(into, strip_option), default)]
10267 pub gitignore: Option<bool>,
10268 #[builder(setter(into, strip_option), default)]
10270 pub include: Option<Vec<&'a str>>,
10271 #[builder(setter(into, strip_option), default)]
10273 pub no_cache: Option<bool>,
10274}
10275#[derive(Builder, Debug, PartialEq)]
10276pub struct HostFileOpts {
10277 #[builder(setter(into, strip_option), default)]
10279 pub no_cache: Option<bool>,
10280}
10281#[derive(Builder, Debug, PartialEq)]
10282pub struct HostFindUpOpts {
10283 #[builder(setter(into, strip_option), default)]
10284 pub no_cache: Option<bool>,
10285}
10286#[derive(Builder, Debug, PartialEq)]
10287pub struct HostServiceOpts<'a> {
10288 #[builder(setter(into, strip_option), default)]
10290 pub host: Option<&'a str>,
10291}
10292#[derive(Builder, Debug, PartialEq)]
10293pub struct HostTunnelOpts {
10294 #[builder(setter(into, strip_option), default)]
10297 pub native: Option<bool>,
10298 #[builder(setter(into, strip_option), default)]
10303 pub ports: Option<Vec<PortForward>>,
10304}
10305impl IntoID<Id> for Host {
10306 fn into_id(
10307 self,
10308 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10309 Box::pin(async move { self.id().await })
10310 }
10311}
10312impl Loadable for Host {
10313 fn graphql_type() -> &'static str {
10314 "Host"
10315 }
10316 fn from_query(
10317 proc: Option<Arc<DaggerSessionProc>>,
10318 selection: Selection,
10319 graphql_client: DynGraphQLClient,
10320 ) -> Self {
10321 Self {
10322 proc,
10323 selection,
10324 graphql_client,
10325 }
10326 }
10327}
10328impl Host {
10329 pub fn container_image(&self, name: impl Into<String>) -> Container {
10335 let mut query = self.selection.select("containerImage");
10336 query = query.arg("name", name.into());
10337 Container {
10338 proc: self.proc.clone(),
10339 selection: query,
10340 graphql_client: self.graphql_client.clone(),
10341 }
10342 }
10343 pub fn directory(&self, path: impl Into<String>) -> Directory {
10350 let mut query = self.selection.select("directory");
10351 query = query.arg("path", path.into());
10352 Directory {
10353 proc: self.proc.clone(),
10354 selection: query,
10355 graphql_client: self.graphql_client.clone(),
10356 }
10357 }
10358 pub fn directory_opts<'a>(
10365 &self,
10366 path: impl Into<String>,
10367 opts: HostDirectoryOpts<'a>,
10368 ) -> Directory {
10369 let mut query = self.selection.select("directory");
10370 query = query.arg("path", path.into());
10371 if let Some(exclude) = opts.exclude {
10372 query = query.arg("exclude", exclude);
10373 }
10374 if let Some(include) = opts.include {
10375 query = query.arg("include", include);
10376 }
10377 if let Some(no_cache) = opts.no_cache {
10378 query = query.arg("noCache", no_cache);
10379 }
10380 if let Some(gitignore) = opts.gitignore {
10381 query = query.arg("gitignore", gitignore);
10382 }
10383 Directory {
10384 proc: self.proc.clone(),
10385 selection: query,
10386 graphql_client: self.graphql_client.clone(),
10387 }
10388 }
10389 pub fn file(&self, path: impl Into<String>) -> File {
10396 let mut query = self.selection.select("file");
10397 query = query.arg("path", path.into());
10398 File {
10399 proc: self.proc.clone(),
10400 selection: query,
10401 graphql_client: self.graphql_client.clone(),
10402 }
10403 }
10404 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10411 let mut query = self.selection.select("file");
10412 query = query.arg("path", path.into());
10413 if let Some(no_cache) = opts.no_cache {
10414 query = query.arg("noCache", no_cache);
10415 }
10416 File {
10417 proc: self.proc.clone(),
10418 selection: query,
10419 graphql_client: self.graphql_client.clone(),
10420 }
10421 }
10422 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10429 let mut query = self.selection.select("findUp");
10430 query = query.arg("name", name.into());
10431 query.execute(self.graphql_client.clone()).await
10432 }
10433 pub async fn find_up_opts(
10440 &self,
10441 name: impl Into<String>,
10442 opts: HostFindUpOpts,
10443 ) -> Result<String, DaggerError> {
10444 let mut query = self.selection.select("findUp");
10445 query = query.arg("name", name.into());
10446 if let Some(no_cache) = opts.no_cache {
10447 query = query.arg("noCache", no_cache);
10448 }
10449 query.execute(self.graphql_client.clone()).await
10450 }
10451 pub async fn id(&self) -> Result<Id, DaggerError> {
10453 let query = self.selection.select("id");
10454 query.execute(self.graphql_client.clone()).await
10455 }
10456 pub fn service(&self, ports: Vec<PortForward>) -> Service {
10467 let mut query = self.selection.select("service");
10468 query = query.arg("ports", ports);
10469 Service {
10470 proc: self.proc.clone(),
10471 selection: query,
10472 graphql_client: self.graphql_client.clone(),
10473 }
10474 }
10475 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10486 let mut query = self.selection.select("service");
10487 query = query.arg("ports", ports);
10488 if let Some(host) = opts.host {
10489 query = query.arg("host", host);
10490 }
10491 Service {
10492 proc: self.proc.clone(),
10493 selection: query,
10494 graphql_client: self.graphql_client.clone(),
10495 }
10496 }
10497 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10504 let mut query = self.selection.select("tunnel");
10505 query = query.arg_lazy(
10506 "service",
10507 Box::new(move || {
10508 let service = service.clone();
10509 Box::pin(async move { service.into_id().await.unwrap().quote() })
10510 }),
10511 );
10512 Service {
10513 proc: self.proc.clone(),
10514 selection: query,
10515 graphql_client: self.graphql_client.clone(),
10516 }
10517 }
10518 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10525 let mut query = self.selection.select("tunnel");
10526 query = query.arg_lazy(
10527 "service",
10528 Box::new(move || {
10529 let service = service.clone();
10530 Box::pin(async move { service.into_id().await.unwrap().quote() })
10531 }),
10532 );
10533 if let Some(native) = opts.native {
10534 query = query.arg("native", native);
10535 }
10536 if let Some(ports) = opts.ports {
10537 query = query.arg("ports", ports);
10538 }
10539 Service {
10540 proc: self.proc.clone(),
10541 selection: query,
10542 graphql_client: self.graphql_client.clone(),
10543 }
10544 }
10545 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10551 let mut query = self.selection.select("unixSocket");
10552 query = query.arg("path", path.into());
10553 Socket {
10554 proc: self.proc.clone(),
10555 selection: query,
10556 graphql_client: self.graphql_client.clone(),
10557 }
10558 }
10559}
10560impl Node for Host {
10561 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10562 let query = self.selection.select("id");
10563 let graphql_client = self.graphql_client.clone();
10564 async move { query.execute(graphql_client).await }
10565 }
10566}
10567#[derive(Clone)]
10568pub struct InputTypeDef {
10569 pub proc: Option<Arc<DaggerSessionProc>>,
10570 pub selection: Selection,
10571 pub graphql_client: DynGraphQLClient,
10572}
10573impl IntoID<Id> for InputTypeDef {
10574 fn into_id(
10575 self,
10576 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10577 Box::pin(async move { self.id().await })
10578 }
10579}
10580impl Loadable for InputTypeDef {
10581 fn graphql_type() -> &'static str {
10582 "InputTypeDef"
10583 }
10584 fn from_query(
10585 proc: Option<Arc<DaggerSessionProc>>,
10586 selection: Selection,
10587 graphql_client: DynGraphQLClient,
10588 ) -> Self {
10589 Self {
10590 proc,
10591 selection,
10592 graphql_client,
10593 }
10594 }
10595}
10596impl InputTypeDef {
10597 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10599 let query = self.selection.select("fields");
10600 let query = query.select("id");
10601 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10602 Ok(ids
10603 .into_iter()
10604 .map(|id| FieldTypeDef {
10605 proc: self.proc.clone(),
10606 selection: crate::querybuilder::query()
10607 .select("node")
10608 .arg("id", &id.0)
10609 .inline_fragment("FieldTypeDef"),
10610 graphql_client: self.graphql_client.clone(),
10611 })
10612 .collect())
10613 }
10614 pub async fn id(&self) -> Result<Id, DaggerError> {
10616 let query = self.selection.select("id");
10617 query.execute(self.graphql_client.clone()).await
10618 }
10619 pub async fn name(&self) -> Result<String, DaggerError> {
10621 let query = self.selection.select("name");
10622 query.execute(self.graphql_client.clone()).await
10623 }
10624}
10625impl Node for InputTypeDef {
10626 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10627 let query = self.selection.select("id");
10628 let graphql_client = self.graphql_client.clone();
10629 async move { query.execute(graphql_client).await }
10630 }
10631}
10632#[derive(Clone)]
10633pub struct InterfaceTypeDef {
10634 pub proc: Option<Arc<DaggerSessionProc>>,
10635 pub selection: Selection,
10636 pub graphql_client: DynGraphQLClient,
10637}
10638impl IntoID<Id> for InterfaceTypeDef {
10639 fn into_id(
10640 self,
10641 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10642 Box::pin(async move { self.id().await })
10643 }
10644}
10645impl Loadable for InterfaceTypeDef {
10646 fn graphql_type() -> &'static str {
10647 "InterfaceTypeDef"
10648 }
10649 fn from_query(
10650 proc: Option<Arc<DaggerSessionProc>>,
10651 selection: Selection,
10652 graphql_client: DynGraphQLClient,
10653 ) -> Self {
10654 Self {
10655 proc,
10656 selection,
10657 graphql_client,
10658 }
10659 }
10660}
10661impl InterfaceTypeDef {
10662 pub async fn description(&self) -> Result<String, DaggerError> {
10664 let query = self.selection.select("description");
10665 query.execute(self.graphql_client.clone()).await
10666 }
10667 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10669 let query = self.selection.select("functions");
10670 let query = query.select("id");
10671 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10672 Ok(ids
10673 .into_iter()
10674 .map(|id| Function {
10675 proc: self.proc.clone(),
10676 selection: crate::querybuilder::query()
10677 .select("node")
10678 .arg("id", &id.0)
10679 .inline_fragment("Function"),
10680 graphql_client: self.graphql_client.clone(),
10681 })
10682 .collect())
10683 }
10684 pub async fn id(&self) -> Result<Id, DaggerError> {
10686 let query = self.selection.select("id");
10687 query.execute(self.graphql_client.clone()).await
10688 }
10689 pub async fn name(&self) -> Result<String, DaggerError> {
10691 let query = self.selection.select("name");
10692 query.execute(self.graphql_client.clone()).await
10693 }
10694 pub fn source_map(&self) -> SourceMap {
10696 let query = self.selection.select("sourceMap");
10697 SourceMap {
10698 proc: self.proc.clone(),
10699 selection: query,
10700 graphql_client: self.graphql_client.clone(),
10701 }
10702 }
10703 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10705 let query = self.selection.select("sourceModuleName");
10706 query.execute(self.graphql_client.clone()).await
10707 }
10708}
10709impl Node for InterfaceTypeDef {
10710 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10711 let query = self.selection.select("id");
10712 let graphql_client = self.graphql_client.clone();
10713 async move { query.execute(graphql_client).await }
10714 }
10715}
10716#[derive(Clone)]
10717pub struct JsonValue {
10718 pub proc: Option<Arc<DaggerSessionProc>>,
10719 pub selection: Selection,
10720 pub graphql_client: DynGraphQLClient,
10721}
10722#[derive(Builder, Debug, PartialEq)]
10723pub struct JsonValueContentsOpts<'a> {
10724 #[builder(setter(into, strip_option), default)]
10726 pub indent: Option<&'a str>,
10727 #[builder(setter(into, strip_option), default)]
10729 pub pretty: Option<bool>,
10730}
10731impl IntoID<Id> for JsonValue {
10732 fn into_id(
10733 self,
10734 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10735 Box::pin(async move { self.id().await })
10736 }
10737}
10738impl Loadable for JsonValue {
10739 fn graphql_type() -> &'static str {
10740 "JSONValue"
10741 }
10742 fn from_query(
10743 proc: Option<Arc<DaggerSessionProc>>,
10744 selection: Selection,
10745 graphql_client: DynGraphQLClient,
10746 ) -> Self {
10747 Self {
10748 proc,
10749 selection,
10750 graphql_client,
10751 }
10752 }
10753}
10754impl JsonValue {
10755 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10757 let query = self.selection.select("asArray");
10758 let query = query.select("id");
10759 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10760 Ok(ids
10761 .into_iter()
10762 .map(|id| JsonValue {
10763 proc: self.proc.clone(),
10764 selection: crate::querybuilder::query()
10765 .select("node")
10766 .arg("id", &id.0)
10767 .inline_fragment("JSONValue"),
10768 graphql_client: self.graphql_client.clone(),
10769 })
10770 .collect())
10771 }
10772 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10774 let query = self.selection.select("asBoolean");
10775 query.execute(self.graphql_client.clone()).await
10776 }
10777 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10779 let query = self.selection.select("asInteger");
10780 query.execute(self.graphql_client.clone()).await
10781 }
10782 pub async fn as_string(&self) -> Result<String, DaggerError> {
10784 let query = self.selection.select("asString");
10785 query.execute(self.graphql_client.clone()).await
10786 }
10787 pub async fn contents(&self) -> Result<Json, DaggerError> {
10793 let query = self.selection.select("contents");
10794 query.execute(self.graphql_client.clone()).await
10795 }
10796 pub async fn contents_opts<'a>(
10802 &self,
10803 opts: JsonValueContentsOpts<'a>,
10804 ) -> Result<Json, DaggerError> {
10805 let mut query = self.selection.select("contents");
10806 if let Some(pretty) = opts.pretty {
10807 query = query.arg("pretty", pretty);
10808 }
10809 if let Some(indent) = opts.indent {
10810 query = query.arg("indent", indent);
10811 }
10812 query.execute(self.graphql_client.clone()).await
10813 }
10814 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10820 let mut query = self.selection.select("field");
10821 query = query.arg(
10822 "path",
10823 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10824 );
10825 JsonValue {
10826 proc: self.proc.clone(),
10827 selection: query,
10828 graphql_client: self.graphql_client.clone(),
10829 }
10830 }
10831 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10833 let query = self.selection.select("fields");
10834 query.execute(self.graphql_client.clone()).await
10835 }
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 new_boolean(&self, value: bool) -> JsonValue {
10847 let mut query = self.selection.select("newBoolean");
10848 query = query.arg("value", value);
10849 JsonValue {
10850 proc: self.proc.clone(),
10851 selection: query,
10852 graphql_client: self.graphql_client.clone(),
10853 }
10854 }
10855 pub fn new_integer(&self, value: isize) -> JsonValue {
10861 let mut query = self.selection.select("newInteger");
10862 query = query.arg("value", value);
10863 JsonValue {
10864 proc: self.proc.clone(),
10865 selection: query,
10866 graphql_client: self.graphql_client.clone(),
10867 }
10868 }
10869 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10875 let mut query = self.selection.select("newString");
10876 query = query.arg("value", value.into());
10877 JsonValue {
10878 proc: self.proc.clone(),
10879 selection: query,
10880 graphql_client: self.graphql_client.clone(),
10881 }
10882 }
10883 pub fn with_contents(&self, contents: Json) -> JsonValue {
10889 let mut query = self.selection.select("withContents");
10890 query = query.arg("contents", contents);
10891 JsonValue {
10892 proc: self.proc.clone(),
10893 selection: query,
10894 graphql_client: self.graphql_client.clone(),
10895 }
10896 }
10897 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10904 let mut query = self.selection.select("withField");
10905 query = query.arg(
10906 "path",
10907 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10908 );
10909 query = query.arg_lazy(
10910 "value",
10911 Box::new(move || {
10912 let value = value.clone();
10913 Box::pin(async move { value.into_id().await.unwrap().quote() })
10914 }),
10915 );
10916 JsonValue {
10917 proc: self.proc.clone(),
10918 selection: query,
10919 graphql_client: self.graphql_client.clone(),
10920 }
10921 }
10922}
10923impl Node for JsonValue {
10924 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10925 let query = self.selection.select("id");
10926 let graphql_client = self.graphql_client.clone();
10927 async move { query.execute(graphql_client).await }
10928 }
10929}
10930#[derive(Clone)]
10931pub struct Llm {
10932 pub proc: Option<Arc<DaggerSessionProc>>,
10933 pub selection: Selection,
10934 pub graphql_client: DynGraphQLClient,
10935}
10936impl IntoID<Id> for Llm {
10937 fn into_id(
10938 self,
10939 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10940 Box::pin(async move { self.id().await })
10941 }
10942}
10943impl Loadable for Llm {
10944 fn graphql_type() -> &'static str {
10945 "LLM"
10946 }
10947 fn from_query(
10948 proc: Option<Arc<DaggerSessionProc>>,
10949 selection: Selection,
10950 graphql_client: DynGraphQLClient,
10951 ) -> Self {
10952 Self {
10953 proc,
10954 selection,
10955 graphql_client,
10956 }
10957 }
10958}
10959impl Llm {
10960 pub fn attempt(&self, number: isize) -> Llm {
10962 let mut query = self.selection.select("attempt");
10963 query = query.arg("number", number);
10964 Llm {
10965 proc: self.proc.clone(),
10966 selection: query,
10967 graphql_client: self.graphql_client.clone(),
10968 }
10969 }
10970 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10972 let mut query = self.selection.select("bindResult");
10973 query = query.arg("name", name.into());
10974 Binding {
10975 proc: self.proc.clone(),
10976 selection: query,
10977 graphql_client: self.graphql_client.clone(),
10978 }
10979 }
10980 pub fn env(&self) -> Env {
10982 let query = self.selection.select("env");
10983 Env {
10984 proc: self.proc.clone(),
10985 selection: query,
10986 graphql_client: self.graphql_client.clone(),
10987 }
10988 }
10989 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10991 let query = self.selection.select("hasPrompt");
10992 query.execute(self.graphql_client.clone()).await
10993 }
10994 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10996 let query = self.selection.select("history");
10997 query.execute(self.graphql_client.clone()).await
10998 }
10999 pub async fn history_json(&self) -> Result<Json, DaggerError> {
11001 let query = self.selection.select("historyJSON");
11002 query.execute(self.graphql_client.clone()).await
11003 }
11004 pub async fn id(&self) -> Result<Id, DaggerError> {
11006 let query = self.selection.select("id");
11007 query.execute(self.graphql_client.clone()).await
11008 }
11009 pub async fn last_reply(&self) -> Result<String, DaggerError> {
11011 let query = self.selection.select("lastReply");
11012 query.execute(self.graphql_client.clone()).await
11013 }
11014 pub fn r#loop(&self) -> Llm {
11016 let query = self.selection.select("loop");
11017 Llm {
11018 proc: self.proc.clone(),
11019 selection: query,
11020 graphql_client: self.graphql_client.clone(),
11021 }
11022 }
11023 pub async fn model(&self) -> Result<String, DaggerError> {
11025 let query = self.selection.select("model");
11026 query.execute(self.graphql_client.clone()).await
11027 }
11028 pub async fn provider(&self) -> Result<String, DaggerError> {
11030 let query = self.selection.select("provider");
11031 query.execute(self.graphql_client.clone()).await
11032 }
11033 pub async fn step(&self) -> Result<Llm, DaggerError> {
11035 let query = self.selection.select("step");
11036 let id: Id = query.execute(self.graphql_client.clone()).await?;
11037 Ok(Llm {
11038 proc: self.proc.clone(),
11039 selection: query
11040 .root()
11041 .select("node")
11042 .arg("id", &id.0)
11043 .inline_fragment("LLM"),
11044 graphql_client: self.graphql_client.clone(),
11045 })
11046 }
11047 pub async fn sync(&self) -> Result<Llm, DaggerError> {
11049 let query = self.selection.select("sync");
11050 let id: Id = query.execute(self.graphql_client.clone()).await?;
11051 Ok(Llm {
11052 proc: self.proc.clone(),
11053 selection: query
11054 .root()
11055 .select("node")
11056 .arg("id", &id.0)
11057 .inline_fragment("LLM"),
11058 graphql_client: self.graphql_client.clone(),
11059 })
11060 }
11061 pub fn token_usage(&self) -> LlmTokenUsage {
11063 let query = self.selection.select("tokenUsage");
11064 LlmTokenUsage {
11065 proc: self.proc.clone(),
11066 selection: query,
11067 graphql_client: self.graphql_client.clone(),
11068 }
11069 }
11070 pub async fn tools(&self) -> Result<String, DaggerError> {
11072 let query = self.selection.select("tools");
11073 query.execute(self.graphql_client.clone()).await
11074 }
11075 pub fn with_blocked_function(
11084 &self,
11085 type_name: impl Into<String>,
11086 function: impl Into<String>,
11087 ) -> Llm {
11088 let mut query = self.selection.select("withBlockedFunction");
11089 query = query.arg("typeName", type_name.into());
11090 query = query.arg("function", function.into());
11091 Llm {
11092 proc: self.proc.clone(),
11093 selection: query,
11094 graphql_client: self.graphql_client.clone(),
11095 }
11096 }
11097 pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11099 let mut query = self.selection.select("withEnv");
11100 query = query.arg_lazy(
11101 "env",
11102 Box::new(move || {
11103 let env = env.clone();
11104 Box::pin(async move { env.into_id().await.unwrap().quote() })
11105 }),
11106 );
11107 Llm {
11108 proc: self.proc.clone(),
11109 selection: query,
11110 graphql_client: self.graphql_client.clone(),
11111 }
11112 }
11113 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11120 let mut query = self.selection.select("withMCPServer");
11121 query = query.arg("name", name.into());
11122 query = query.arg_lazy(
11123 "service",
11124 Box::new(move || {
11125 let service = service.clone();
11126 Box::pin(async move { service.into_id().await.unwrap().quote() })
11127 }),
11128 );
11129 Llm {
11130 proc: self.proc.clone(),
11131 selection: query,
11132 graphql_client: self.graphql_client.clone(),
11133 }
11134 }
11135 pub fn with_model(&self, model: impl Into<String>) -> Llm {
11141 let mut query = self.selection.select("withModel");
11142 query = query.arg("model", model.into());
11143 Llm {
11144 proc: self.proc.clone(),
11145 selection: query,
11146 graphql_client: self.graphql_client.clone(),
11147 }
11148 }
11149 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11155 let mut query = self.selection.select("withPrompt");
11156 query = query.arg("prompt", prompt.into());
11157 Llm {
11158 proc: self.proc.clone(),
11159 selection: query,
11160 graphql_client: self.graphql_client.clone(),
11161 }
11162 }
11163 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11169 let mut query = self.selection.select("withPromptFile");
11170 query = query.arg_lazy(
11171 "file",
11172 Box::new(move || {
11173 let file = file.clone();
11174 Box::pin(async move { file.into_id().await.unwrap().quote() })
11175 }),
11176 );
11177 Llm {
11178 proc: self.proc.clone(),
11179 selection: query,
11180 graphql_client: self.graphql_client.clone(),
11181 }
11182 }
11183 pub fn with_static_tools(&self) -> Llm {
11185 let query = self.selection.select("withStaticTools");
11186 Llm {
11187 proc: self.proc.clone(),
11188 selection: query,
11189 graphql_client: self.graphql_client.clone(),
11190 }
11191 }
11192 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11198 let mut query = self.selection.select("withSystemPrompt");
11199 query = query.arg("prompt", prompt.into());
11200 Llm {
11201 proc: self.proc.clone(),
11202 selection: query,
11203 graphql_client: self.graphql_client.clone(),
11204 }
11205 }
11206 pub fn without_default_system_prompt(&self) -> Llm {
11208 let query = self.selection.select("withoutDefaultSystemPrompt");
11209 Llm {
11210 proc: self.proc.clone(),
11211 selection: query,
11212 graphql_client: self.graphql_client.clone(),
11213 }
11214 }
11215 pub fn without_message_history(&self) -> Llm {
11217 let query = self.selection.select("withoutMessageHistory");
11218 Llm {
11219 proc: self.proc.clone(),
11220 selection: query,
11221 graphql_client: self.graphql_client.clone(),
11222 }
11223 }
11224 pub fn without_system_prompts(&self) -> Llm {
11226 let query = self.selection.select("withoutSystemPrompts");
11227 Llm {
11228 proc: self.proc.clone(),
11229 selection: query,
11230 graphql_client: self.graphql_client.clone(),
11231 }
11232 }
11233}
11234impl Node for Llm {
11235 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11236 let query = self.selection.select("id");
11237 let graphql_client = self.graphql_client.clone();
11238 async move { query.execute(graphql_client).await }
11239 }
11240}
11241impl Syncer for Llm {
11242 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11243 let query = self.selection.select("id");
11244 let graphql_client = self.graphql_client.clone();
11245 async move { query.execute(graphql_client).await }
11246 }
11247 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11248 let query = self.selection.select("sync");
11249 let graphql_client = self.graphql_client.clone();
11250 async move { query.execute(graphql_client).await }
11251 }
11252}
11253#[derive(Clone)]
11254pub struct LlmTokenUsage {
11255 pub proc: Option<Arc<DaggerSessionProc>>,
11256 pub selection: Selection,
11257 pub graphql_client: DynGraphQLClient,
11258}
11259impl IntoID<Id> for LlmTokenUsage {
11260 fn into_id(
11261 self,
11262 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11263 Box::pin(async move { self.id().await })
11264 }
11265}
11266impl Loadable for LlmTokenUsage {
11267 fn graphql_type() -> &'static str {
11268 "LLMTokenUsage"
11269 }
11270 fn from_query(
11271 proc: Option<Arc<DaggerSessionProc>>,
11272 selection: Selection,
11273 graphql_client: DynGraphQLClient,
11274 ) -> Self {
11275 Self {
11276 proc,
11277 selection,
11278 graphql_client,
11279 }
11280 }
11281}
11282impl LlmTokenUsage {
11283 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11284 let query = self.selection.select("cachedTokenReads");
11285 query.execute(self.graphql_client.clone()).await
11286 }
11287 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11288 let query = self.selection.select("cachedTokenWrites");
11289 query.execute(self.graphql_client.clone()).await
11290 }
11291 pub async fn id(&self) -> Result<Id, DaggerError> {
11293 let query = self.selection.select("id");
11294 query.execute(self.graphql_client.clone()).await
11295 }
11296 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11297 let query = self.selection.select("inputTokens");
11298 query.execute(self.graphql_client.clone()).await
11299 }
11300 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11301 let query = self.selection.select("outputTokens");
11302 query.execute(self.graphql_client.clone()).await
11303 }
11304 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11305 let query = self.selection.select("totalTokens");
11306 query.execute(self.graphql_client.clone()).await
11307 }
11308}
11309impl Node for LlmTokenUsage {
11310 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11311 let query = self.selection.select("id");
11312 let graphql_client = self.graphql_client.clone();
11313 async move { query.execute(graphql_client).await }
11314 }
11315}
11316#[derive(Clone)]
11317pub struct Label {
11318 pub proc: Option<Arc<DaggerSessionProc>>,
11319 pub selection: Selection,
11320 pub graphql_client: DynGraphQLClient,
11321}
11322impl IntoID<Id> for Label {
11323 fn into_id(
11324 self,
11325 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11326 Box::pin(async move { self.id().await })
11327 }
11328}
11329impl Loadable for Label {
11330 fn graphql_type() -> &'static str {
11331 "Label"
11332 }
11333 fn from_query(
11334 proc: Option<Arc<DaggerSessionProc>>,
11335 selection: Selection,
11336 graphql_client: DynGraphQLClient,
11337 ) -> Self {
11338 Self {
11339 proc,
11340 selection,
11341 graphql_client,
11342 }
11343 }
11344}
11345impl Label {
11346 pub async fn id(&self) -> Result<Id, DaggerError> {
11348 let query = self.selection.select("id");
11349 query.execute(self.graphql_client.clone()).await
11350 }
11351 pub async fn name(&self) -> Result<String, DaggerError> {
11353 let query = self.selection.select("name");
11354 query.execute(self.graphql_client.clone()).await
11355 }
11356 pub async fn value(&self) -> Result<String, DaggerError> {
11358 let query = self.selection.select("value");
11359 query.execute(self.graphql_client.clone()).await
11360 }
11361}
11362impl Node for Label {
11363 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11364 let query = self.selection.select("id");
11365 let graphql_client = self.graphql_client.clone();
11366 async move { query.execute(graphql_client).await }
11367 }
11368}
11369#[derive(Clone)]
11370pub struct ListTypeDef {
11371 pub proc: Option<Arc<DaggerSessionProc>>,
11372 pub selection: Selection,
11373 pub graphql_client: DynGraphQLClient,
11374}
11375impl IntoID<Id> for ListTypeDef {
11376 fn into_id(
11377 self,
11378 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11379 Box::pin(async move { self.id().await })
11380 }
11381}
11382impl Loadable for ListTypeDef {
11383 fn graphql_type() -> &'static str {
11384 "ListTypeDef"
11385 }
11386 fn from_query(
11387 proc: Option<Arc<DaggerSessionProc>>,
11388 selection: Selection,
11389 graphql_client: DynGraphQLClient,
11390 ) -> Self {
11391 Self {
11392 proc,
11393 selection,
11394 graphql_client,
11395 }
11396 }
11397}
11398impl ListTypeDef {
11399 pub fn element_type_def(&self) -> TypeDef {
11401 let query = self.selection.select("elementTypeDef");
11402 TypeDef {
11403 proc: self.proc.clone(),
11404 selection: query,
11405 graphql_client: self.graphql_client.clone(),
11406 }
11407 }
11408 pub async fn id(&self) -> Result<Id, DaggerError> {
11410 let query = self.selection.select("id");
11411 query.execute(self.graphql_client.clone()).await
11412 }
11413}
11414impl Node for ListTypeDef {
11415 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11416 let query = self.selection.select("id");
11417 let graphql_client = self.graphql_client.clone();
11418 async move { query.execute(graphql_client).await }
11419 }
11420}
11421#[derive(Clone)]
11422pub struct Module {
11423 pub proc: Option<Arc<DaggerSessionProc>>,
11424 pub selection: Selection,
11425 pub graphql_client: DynGraphQLClient,
11426}
11427#[derive(Builder, Debug, PartialEq)]
11428pub struct ModuleChecksOpts<'a> {
11429 #[builder(setter(into, strip_option), default)]
11431 pub include: Option<Vec<&'a str>>,
11432 #[builder(setter(into, strip_option), default)]
11434 pub no_generate: Option<bool>,
11435}
11436#[derive(Builder, Debug, PartialEq)]
11437pub struct ModuleGeneratorsOpts<'a> {
11438 #[builder(setter(into, strip_option), default)]
11440 pub include: Option<Vec<&'a str>>,
11441}
11442#[derive(Builder, Debug, PartialEq)]
11443pub struct ModuleServeOpts {
11444 #[builder(setter(into, strip_option), default)]
11446 pub entrypoint: Option<bool>,
11447 #[builder(setter(into, strip_option), default)]
11449 pub include_dependencies: Option<bool>,
11450}
11451#[derive(Builder, Debug, PartialEq)]
11452pub struct ModuleServicesOpts<'a> {
11453 #[builder(setter(into, strip_option), default)]
11455 pub include: Option<Vec<&'a str>>,
11456}
11457impl IntoID<Id> for Module {
11458 fn into_id(
11459 self,
11460 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11461 Box::pin(async move { self.id().await })
11462 }
11463}
11464impl Loadable for Module {
11465 fn graphql_type() -> &'static str {
11466 "Module"
11467 }
11468 fn from_query(
11469 proc: Option<Arc<DaggerSessionProc>>,
11470 selection: Selection,
11471 graphql_client: DynGraphQLClient,
11472 ) -> Self {
11473 Self {
11474 proc,
11475 selection,
11476 graphql_client,
11477 }
11478 }
11479}
11480impl Module {
11481 pub fn check(&self, name: impl Into<String>) -> Check {
11487 let mut query = self.selection.select("check");
11488 query = query.arg("name", name.into());
11489 Check {
11490 proc: self.proc.clone(),
11491 selection: query,
11492 graphql_client: self.graphql_client.clone(),
11493 }
11494 }
11495 pub fn checks(&self) -> CheckGroup {
11501 let query = self.selection.select("checks");
11502 CheckGroup {
11503 proc: self.proc.clone(),
11504 selection: query,
11505 graphql_client: self.graphql_client.clone(),
11506 }
11507 }
11508 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11514 let mut query = self.selection.select("checks");
11515 if let Some(include) = opts.include {
11516 query = query.arg("include", include);
11517 }
11518 if let Some(no_generate) = opts.no_generate {
11519 query = query.arg("noGenerate", no_generate);
11520 }
11521 CheckGroup {
11522 proc: self.proc.clone(),
11523 selection: query,
11524 graphql_client: self.graphql_client.clone(),
11525 }
11526 }
11527 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11529 let query = self.selection.select("dependencies");
11530 let query = query.select("id");
11531 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11532 Ok(ids
11533 .into_iter()
11534 .map(|id| Module {
11535 proc: self.proc.clone(),
11536 selection: crate::querybuilder::query()
11537 .select("node")
11538 .arg("id", &id.0)
11539 .inline_fragment("Module"),
11540 graphql_client: self.graphql_client.clone(),
11541 })
11542 .collect())
11543 }
11544 pub async fn description(&self) -> Result<String, DaggerError> {
11546 let query = self.selection.select("description");
11547 query.execute(self.graphql_client.clone()).await
11548 }
11549 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11551 let query = self.selection.select("enums");
11552 let query = query.select("id");
11553 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11554 Ok(ids
11555 .into_iter()
11556 .map(|id| TypeDef {
11557 proc: self.proc.clone(),
11558 selection: crate::querybuilder::query()
11559 .select("node")
11560 .arg("id", &id.0)
11561 .inline_fragment("TypeDef"),
11562 graphql_client: self.graphql_client.clone(),
11563 })
11564 .collect())
11565 }
11566 pub fn generated_context_directory(&self) -> Directory {
11568 let query = self.selection.select("generatedContextDirectory");
11569 Directory {
11570 proc: self.proc.clone(),
11571 selection: query,
11572 graphql_client: self.graphql_client.clone(),
11573 }
11574 }
11575 pub fn generator(&self, name: impl Into<String>) -> Generator {
11581 let mut query = self.selection.select("generator");
11582 query = query.arg("name", name.into());
11583 Generator {
11584 proc: self.proc.clone(),
11585 selection: query,
11586 graphql_client: self.graphql_client.clone(),
11587 }
11588 }
11589 pub fn generators(&self) -> GeneratorGroup {
11595 let query = self.selection.select("generators");
11596 GeneratorGroup {
11597 proc: self.proc.clone(),
11598 selection: query,
11599 graphql_client: self.graphql_client.clone(),
11600 }
11601 }
11602 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11608 let mut query = self.selection.select("generators");
11609 if let Some(include) = opts.include {
11610 query = query.arg("include", include);
11611 }
11612 GeneratorGroup {
11613 proc: self.proc.clone(),
11614 selection: query,
11615 graphql_client: self.graphql_client.clone(),
11616 }
11617 }
11618 pub async fn id(&self) -> Result<Id, DaggerError> {
11620 let query = self.selection.select("id");
11621 query.execute(self.graphql_client.clone()).await
11622 }
11623 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11625 let query = self.selection.select("interfaces");
11626 let query = query.select("id");
11627 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11628 Ok(ids
11629 .into_iter()
11630 .map(|id| TypeDef {
11631 proc: self.proc.clone(),
11632 selection: crate::querybuilder::query()
11633 .select("node")
11634 .arg("id", &id.0)
11635 .inline_fragment("TypeDef"),
11636 graphql_client: self.graphql_client.clone(),
11637 })
11638 .collect())
11639 }
11640 pub fn introspection_schema_json(&self) -> File {
11644 let query = self.selection.select("introspectionSchemaJSON");
11645 File {
11646 proc: self.proc.clone(),
11647 selection: query,
11648 graphql_client: self.graphql_client.clone(),
11649 }
11650 }
11651 pub async fn name(&self) -> Result<String, DaggerError> {
11653 let query = self.selection.select("name");
11654 query.execute(self.graphql_client.clone()).await
11655 }
11656 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11658 let query = self.selection.select("objects");
11659 let query = query.select("id");
11660 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11661 Ok(ids
11662 .into_iter()
11663 .map(|id| TypeDef {
11664 proc: self.proc.clone(),
11665 selection: crate::querybuilder::query()
11666 .select("node")
11667 .arg("id", &id.0)
11668 .inline_fragment("TypeDef"),
11669 graphql_client: self.graphql_client.clone(),
11670 })
11671 .collect())
11672 }
11673 pub fn runtime(&self) -> Container {
11675 let query = self.selection.select("runtime");
11676 Container {
11677 proc: self.proc.clone(),
11678 selection: query,
11679 graphql_client: self.graphql_client.clone(),
11680 }
11681 }
11682 pub fn sdk(&self) -> SdkConfig {
11684 let query = self.selection.select("sdk");
11685 SdkConfig {
11686 proc: self.proc.clone(),
11687 selection: query,
11688 graphql_client: self.graphql_client.clone(),
11689 }
11690 }
11691 pub async fn serve(&self) -> Result<Void, DaggerError> {
11698 let query = self.selection.select("serve");
11699 query.execute(self.graphql_client.clone()).await
11700 }
11701 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11708 let mut query = self.selection.select("serve");
11709 if let Some(include_dependencies) = opts.include_dependencies {
11710 query = query.arg("includeDependencies", include_dependencies);
11711 }
11712 if let Some(entrypoint) = opts.entrypoint {
11713 query = query.arg("entrypoint", entrypoint);
11714 }
11715 query.execute(self.graphql_client.clone()).await
11716 }
11717 pub fn services(&self) -> UpGroup {
11723 let query = self.selection.select("services");
11724 UpGroup {
11725 proc: self.proc.clone(),
11726 selection: query,
11727 graphql_client: self.graphql_client.clone(),
11728 }
11729 }
11730 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11736 let mut query = self.selection.select("services");
11737 if let Some(include) = opts.include {
11738 query = query.arg("include", include);
11739 }
11740 UpGroup {
11741 proc: self.proc.clone(),
11742 selection: query,
11743 graphql_client: self.graphql_client.clone(),
11744 }
11745 }
11746 pub fn source(&self) -> ModuleSource {
11748 let query = self.selection.select("source");
11749 ModuleSource {
11750 proc: self.proc.clone(),
11751 selection: query,
11752 graphql_client: self.graphql_client.clone(),
11753 }
11754 }
11755 pub async fn sync(&self) -> Result<Module, DaggerError> {
11757 let query = self.selection.select("sync");
11758 let id: Id = query.execute(self.graphql_client.clone()).await?;
11759 Ok(Module {
11760 proc: self.proc.clone(),
11761 selection: query
11762 .root()
11763 .select("node")
11764 .arg("id", &id.0)
11765 .inline_fragment("Module"),
11766 graphql_client: self.graphql_client.clone(),
11767 })
11768 }
11769 pub fn user_defaults(&self) -> EnvFile {
11771 let query = self.selection.select("userDefaults");
11772 EnvFile {
11773 proc: self.proc.clone(),
11774 selection: query,
11775 graphql_client: self.graphql_client.clone(),
11776 }
11777 }
11778 pub fn with_description(&self, description: impl Into<String>) -> Module {
11784 let mut query = self.selection.select("withDescription");
11785 query = query.arg("description", description.into());
11786 Module {
11787 proc: self.proc.clone(),
11788 selection: query,
11789 graphql_client: self.graphql_client.clone(),
11790 }
11791 }
11792 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11794 let mut query = self.selection.select("withEnum");
11795 query = query.arg_lazy(
11796 "enum",
11797 Box::new(move || {
11798 let r#enum = r#enum.clone();
11799 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11800 }),
11801 );
11802 Module {
11803 proc: self.proc.clone(),
11804 selection: query,
11805 graphql_client: self.graphql_client.clone(),
11806 }
11807 }
11808 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11810 let mut query = self.selection.select("withInterface");
11811 query = query.arg_lazy(
11812 "iface",
11813 Box::new(move || {
11814 let iface = iface.clone();
11815 Box::pin(async move { iface.into_id().await.unwrap().quote() })
11816 }),
11817 );
11818 Module {
11819 proc: self.proc.clone(),
11820 selection: query,
11821 graphql_client: self.graphql_client.clone(),
11822 }
11823 }
11824 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11826 let mut query = self.selection.select("withObject");
11827 query = query.arg_lazy(
11828 "object",
11829 Box::new(move || {
11830 let object = object.clone();
11831 Box::pin(async move { object.into_id().await.unwrap().quote() })
11832 }),
11833 );
11834 Module {
11835 proc: self.proc.clone(),
11836 selection: query,
11837 graphql_client: self.graphql_client.clone(),
11838 }
11839 }
11840}
11841impl Node for Module {
11842 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11843 let query = self.selection.select("id");
11844 let graphql_client = self.graphql_client.clone();
11845 async move { query.execute(graphql_client).await }
11846 }
11847}
11848impl Syncer for Module {
11849 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11850 let query = self.selection.select("id");
11851 let graphql_client = self.graphql_client.clone();
11852 async move { query.execute(graphql_client).await }
11853 }
11854 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11855 let query = self.selection.select("sync");
11856 let graphql_client = self.graphql_client.clone();
11857 async move { query.execute(graphql_client).await }
11858 }
11859}
11860#[derive(Clone)]
11861pub struct ModuleConfigClient {
11862 pub proc: Option<Arc<DaggerSessionProc>>,
11863 pub selection: Selection,
11864 pub graphql_client: DynGraphQLClient,
11865}
11866impl IntoID<Id> for ModuleConfigClient {
11867 fn into_id(
11868 self,
11869 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11870 Box::pin(async move { self.id().await })
11871 }
11872}
11873impl Loadable for ModuleConfigClient {
11874 fn graphql_type() -> &'static str {
11875 "ModuleConfigClient"
11876 }
11877 fn from_query(
11878 proc: Option<Arc<DaggerSessionProc>>,
11879 selection: Selection,
11880 graphql_client: DynGraphQLClient,
11881 ) -> Self {
11882 Self {
11883 proc,
11884 selection,
11885 graphql_client,
11886 }
11887 }
11888}
11889impl ModuleConfigClient {
11890 pub async fn directory(&self) -> Result<String, DaggerError> {
11892 let query = self.selection.select("directory");
11893 query.execute(self.graphql_client.clone()).await
11894 }
11895 pub async fn generator(&self) -> Result<String, DaggerError> {
11897 let query = self.selection.select("generator");
11898 query.execute(self.graphql_client.clone()).await
11899 }
11900 pub async fn id(&self) -> Result<Id, DaggerError> {
11902 let query = self.selection.select("id");
11903 query.execute(self.graphql_client.clone()).await
11904 }
11905}
11906impl Node for ModuleConfigClient {
11907 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11908 let query = self.selection.select("id");
11909 let graphql_client = self.graphql_client.clone();
11910 async move { query.execute(graphql_client).await }
11911 }
11912}
11913#[derive(Clone)]
11914pub struct ModuleSource {
11915 pub proc: Option<Arc<DaggerSessionProc>>,
11916 pub selection: Selection,
11917 pub graphql_client: DynGraphQLClient,
11918}
11919impl IntoID<Id> for ModuleSource {
11920 fn into_id(
11921 self,
11922 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11923 Box::pin(async move { self.id().await })
11924 }
11925}
11926impl Loadable for ModuleSource {
11927 fn graphql_type() -> &'static str {
11928 "ModuleSource"
11929 }
11930 fn from_query(
11931 proc: Option<Arc<DaggerSessionProc>>,
11932 selection: Selection,
11933 graphql_client: DynGraphQLClient,
11934 ) -> Self {
11935 Self {
11936 proc,
11937 selection,
11938 graphql_client,
11939 }
11940 }
11941}
11942impl ModuleSource {
11943 pub fn as_module(&self) -> Module {
11945 let query = self.selection.select("asModule");
11946 Module {
11947 proc: self.proc.clone(),
11948 selection: query,
11949 graphql_client: self.graphql_client.clone(),
11950 }
11951 }
11952 pub async fn as_string(&self) -> Result<String, DaggerError> {
11954 let query = self.selection.select("asString");
11955 query.execute(self.graphql_client.clone()).await
11956 }
11957 pub fn blueprint(&self) -> ModuleSource {
11959 let query = self.selection.select("blueprint");
11960 ModuleSource {
11961 proc: self.proc.clone(),
11962 selection: query,
11963 graphql_client: self.graphql_client.clone(),
11964 }
11965 }
11966 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11968 let query = self.selection.select("cloneRef");
11969 query.execute(self.graphql_client.clone()).await
11970 }
11971 pub async fn commit(&self) -> Result<String, DaggerError> {
11973 let query = self.selection.select("commit");
11974 query.execute(self.graphql_client.clone()).await
11975 }
11976 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11978 let query = self.selection.select("configClients");
11979 let query = query.select("id");
11980 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11981 Ok(ids
11982 .into_iter()
11983 .map(|id| ModuleConfigClient {
11984 proc: self.proc.clone(),
11985 selection: crate::querybuilder::query()
11986 .select("node")
11987 .arg("id", &id.0)
11988 .inline_fragment("ModuleConfigClient"),
11989 graphql_client: self.graphql_client.clone(),
11990 })
11991 .collect())
11992 }
11993 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11995 let query = self.selection.select("configExists");
11996 query.execute(self.graphql_client.clone()).await
11997 }
11998 pub fn context_directory(&self) -> Directory {
12000 let query = self.selection.select("contextDirectory");
12001 Directory {
12002 proc: self.proc.clone(),
12003 selection: query,
12004 graphql_client: self.graphql_client.clone(),
12005 }
12006 }
12007 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12009 let query = self.selection.select("dependencies");
12010 let query = query.select("id");
12011 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12012 Ok(ids
12013 .into_iter()
12014 .map(|id| ModuleSource {
12015 proc: self.proc.clone(),
12016 selection: crate::querybuilder::query()
12017 .select("node")
12018 .arg("id", &id.0)
12019 .inline_fragment("ModuleSource"),
12020 graphql_client: self.graphql_client.clone(),
12021 })
12022 .collect())
12023 }
12024 pub async fn digest(&self) -> Result<String, DaggerError> {
12026 let query = self.selection.select("digest");
12027 query.execute(self.graphql_client.clone()).await
12028 }
12029 pub fn directory(&self, path: impl Into<String>) -> Directory {
12035 let mut query = self.selection.select("directory");
12036 query = query.arg("path", path.into());
12037 Directory {
12038 proc: self.proc.clone(),
12039 selection: query,
12040 graphql_client: self.graphql_client.clone(),
12041 }
12042 }
12043 pub async fn engine_version(&self) -> Result<String, DaggerError> {
12045 let query = self.selection.select("engineVersion");
12046 query.execute(self.graphql_client.clone()).await
12047 }
12048 pub fn generated_context_changeset(&self) -> Changeset {
12050 let query = self.selection.select("generatedContextChangeset");
12051 Changeset {
12052 proc: self.proc.clone(),
12053 selection: query,
12054 graphql_client: self.graphql_client.clone(),
12055 }
12056 }
12057 pub fn generated_context_directory(&self) -> Directory {
12059 let query = self.selection.select("generatedContextDirectory");
12060 Directory {
12061 proc: self.proc.clone(),
12062 selection: query,
12063 graphql_client: self.graphql_client.clone(),
12064 }
12065 }
12066 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12068 let query = self.selection.select("htmlRepoURL");
12069 query.execute(self.graphql_client.clone()).await
12070 }
12071 pub async fn html_url(&self) -> Result<String, DaggerError> {
12073 let query = self.selection.select("htmlURL");
12074 query.execute(self.graphql_client.clone()).await
12075 }
12076 pub async fn id(&self) -> Result<Id, DaggerError> {
12078 let query = self.selection.select("id");
12079 query.execute(self.graphql_client.clone()).await
12080 }
12081 pub fn introspection_schema_json(&self) -> File {
12085 let query = self.selection.select("introspectionSchemaJSON");
12086 File {
12087 proc: self.proc.clone(),
12088 selection: query,
12089 graphql_client: self.graphql_client.clone(),
12090 }
12091 }
12092 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12094 let query = self.selection.select("kind");
12095 query.execute(self.graphql_client.clone()).await
12096 }
12097 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12099 let query = self.selection.select("localContextDirectoryPath");
12100 query.execute(self.graphql_client.clone()).await
12101 }
12102 pub async fn module_name(&self) -> Result<String, DaggerError> {
12104 let query = self.selection.select("moduleName");
12105 query.execute(self.graphql_client.clone()).await
12106 }
12107 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12109 let query = self.selection.select("moduleOriginalName");
12110 query.execute(self.graphql_client.clone()).await
12111 }
12112 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12114 let query = self.selection.select("originalSubpath");
12115 query.execute(self.graphql_client.clone()).await
12116 }
12117 pub async fn pin(&self) -> Result<String, DaggerError> {
12119 let query = self.selection.select("pin");
12120 query.execute(self.graphql_client.clone()).await
12121 }
12122 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12124 let query = self.selection.select("repoRootPath");
12125 query.execute(self.graphql_client.clone()).await
12126 }
12127 pub fn sdk(&self) -> SdkConfig {
12129 let query = self.selection.select("sdk");
12130 SdkConfig {
12131 proc: self.proc.clone(),
12132 selection: query,
12133 graphql_client: self.graphql_client.clone(),
12134 }
12135 }
12136 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12138 let query = self.selection.select("sourceRootSubpath");
12139 query.execute(self.graphql_client.clone()).await
12140 }
12141 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12143 let query = self.selection.select("sourceSubpath");
12144 query.execute(self.graphql_client.clone()).await
12145 }
12146 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12148 let query = self.selection.select("sync");
12149 let id: Id = query.execute(self.graphql_client.clone()).await?;
12150 Ok(ModuleSource {
12151 proc: self.proc.clone(),
12152 selection: query
12153 .root()
12154 .select("node")
12155 .arg("id", &id.0)
12156 .inline_fragment("ModuleSource"),
12157 graphql_client: self.graphql_client.clone(),
12158 })
12159 }
12160 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12162 let query = self.selection.select("toolchains");
12163 let query = query.select("id");
12164 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12165 Ok(ids
12166 .into_iter()
12167 .map(|id| ModuleSource {
12168 proc: self.proc.clone(),
12169 selection: crate::querybuilder::query()
12170 .select("node")
12171 .arg("id", &id.0)
12172 .inline_fragment("ModuleSource"),
12173 graphql_client: self.graphql_client.clone(),
12174 })
12175 .collect())
12176 }
12177 pub fn user_defaults(&self) -> EnvFile {
12179 let query = self.selection.select("userDefaults");
12180 EnvFile {
12181 proc: self.proc.clone(),
12182 selection: query,
12183 graphql_client: self.graphql_client.clone(),
12184 }
12185 }
12186 pub async fn version(&self) -> Result<String, DaggerError> {
12188 let query = self.selection.select("version");
12189 query.execute(self.graphql_client.clone()).await
12190 }
12191 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12197 let mut query = self.selection.select("withBlueprint");
12198 query = query.arg_lazy(
12199 "blueprint",
12200 Box::new(move || {
12201 let blueprint = blueprint.clone();
12202 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12203 }),
12204 );
12205 ModuleSource {
12206 proc: self.proc.clone(),
12207 selection: query,
12208 graphql_client: self.graphql_client.clone(),
12209 }
12210 }
12211 pub fn with_client(
12218 &self,
12219 generator: impl Into<String>,
12220 output_dir: impl Into<String>,
12221 ) -> ModuleSource {
12222 let mut query = self.selection.select("withClient");
12223 query = query.arg("generator", generator.into());
12224 query = query.arg("outputDir", output_dir.into());
12225 ModuleSource {
12226 proc: self.proc.clone(),
12227 selection: query,
12228 graphql_client: self.graphql_client.clone(),
12229 }
12230 }
12231 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12237 let mut query = self.selection.select("withDependencies");
12238 query = query.arg("dependencies", dependencies);
12239 ModuleSource {
12240 proc: self.proc.clone(),
12241 selection: query,
12242 graphql_client: self.graphql_client.clone(),
12243 }
12244 }
12245 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12251 let mut query = self.selection.select("withEngineVersion");
12252 query = query.arg("version", version.into());
12253 ModuleSource {
12254 proc: self.proc.clone(),
12255 selection: query,
12256 graphql_client: self.graphql_client.clone(),
12257 }
12258 }
12259 pub fn with_experimental_features(
12265 &self,
12266 features: Vec<ModuleSourceExperimentalFeature>,
12267 ) -> ModuleSource {
12268 let mut query = self.selection.select("withExperimentalFeatures");
12269 query = query.arg("features", features);
12270 ModuleSource {
12271 proc: self.proc.clone(),
12272 selection: query,
12273 graphql_client: self.graphql_client.clone(),
12274 }
12275 }
12276 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12282 let mut query = self.selection.select("withIncludes");
12283 query = query.arg(
12284 "patterns",
12285 patterns
12286 .into_iter()
12287 .map(|i| i.into())
12288 .collect::<Vec<String>>(),
12289 );
12290 ModuleSource {
12291 proc: self.proc.clone(),
12292 selection: query,
12293 graphql_client: self.graphql_client.clone(),
12294 }
12295 }
12296 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12302 let mut query = self.selection.select("withName");
12303 query = query.arg("name", name.into());
12304 ModuleSource {
12305 proc: self.proc.clone(),
12306 selection: query,
12307 graphql_client: self.graphql_client.clone(),
12308 }
12309 }
12310 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12316 let mut query = self.selection.select("withSDK");
12317 query = query.arg("source", source.into());
12318 ModuleSource {
12319 proc: self.proc.clone(),
12320 selection: query,
12321 graphql_client: self.graphql_client.clone(),
12322 }
12323 }
12324 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12330 let mut query = self.selection.select("withSourceSubpath");
12331 query = query.arg("path", path.into());
12332 ModuleSource {
12333 proc: self.proc.clone(),
12334 selection: query,
12335 graphql_client: self.graphql_client.clone(),
12336 }
12337 }
12338 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12344 let mut query = self.selection.select("withToolchains");
12345 query = query.arg("toolchains", toolchains);
12346 ModuleSource {
12347 proc: self.proc.clone(),
12348 selection: query,
12349 graphql_client: self.graphql_client.clone(),
12350 }
12351 }
12352 pub fn with_update_blueprint(&self) -> ModuleSource {
12354 let query = self.selection.select("withUpdateBlueprint");
12355 ModuleSource {
12356 proc: self.proc.clone(),
12357 selection: query,
12358 graphql_client: self.graphql_client.clone(),
12359 }
12360 }
12361 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12367 let mut query = self.selection.select("withUpdateDependencies");
12368 query = query.arg(
12369 "dependencies",
12370 dependencies
12371 .into_iter()
12372 .map(|i| i.into())
12373 .collect::<Vec<String>>(),
12374 );
12375 ModuleSource {
12376 proc: self.proc.clone(),
12377 selection: query,
12378 graphql_client: self.graphql_client.clone(),
12379 }
12380 }
12381 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12387 let mut query = self.selection.select("withUpdateToolchains");
12388 query = query.arg(
12389 "toolchains",
12390 toolchains
12391 .into_iter()
12392 .map(|i| i.into())
12393 .collect::<Vec<String>>(),
12394 );
12395 ModuleSource {
12396 proc: self.proc.clone(),
12397 selection: query,
12398 graphql_client: self.graphql_client.clone(),
12399 }
12400 }
12401 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12407 let mut query = self.selection.select("withUpdatedClients");
12408 query = query.arg(
12409 "clients",
12410 clients
12411 .into_iter()
12412 .map(|i| i.into())
12413 .collect::<Vec<String>>(),
12414 );
12415 ModuleSource {
12416 proc: self.proc.clone(),
12417 selection: query,
12418 graphql_client: self.graphql_client.clone(),
12419 }
12420 }
12421 pub fn without_blueprint(&self) -> ModuleSource {
12423 let query = self.selection.select("withoutBlueprint");
12424 ModuleSource {
12425 proc: self.proc.clone(),
12426 selection: query,
12427 graphql_client: self.graphql_client.clone(),
12428 }
12429 }
12430 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12436 let mut query = self.selection.select("withoutClient");
12437 query = query.arg("path", path.into());
12438 ModuleSource {
12439 proc: self.proc.clone(),
12440 selection: query,
12441 graphql_client: self.graphql_client.clone(),
12442 }
12443 }
12444 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12450 let mut query = self.selection.select("withoutDependencies");
12451 query = query.arg(
12452 "dependencies",
12453 dependencies
12454 .into_iter()
12455 .map(|i| i.into())
12456 .collect::<Vec<String>>(),
12457 );
12458 ModuleSource {
12459 proc: self.proc.clone(),
12460 selection: query,
12461 graphql_client: self.graphql_client.clone(),
12462 }
12463 }
12464 pub fn without_experimental_features(
12470 &self,
12471 features: Vec<ModuleSourceExperimentalFeature>,
12472 ) -> ModuleSource {
12473 let mut query = self.selection.select("withoutExperimentalFeatures");
12474 query = query.arg("features", features);
12475 ModuleSource {
12476 proc: self.proc.clone(),
12477 selection: query,
12478 graphql_client: self.graphql_client.clone(),
12479 }
12480 }
12481 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12487 let mut query = self.selection.select("withoutToolchains");
12488 query = query.arg(
12489 "toolchains",
12490 toolchains
12491 .into_iter()
12492 .map(|i| i.into())
12493 .collect::<Vec<String>>(),
12494 );
12495 ModuleSource {
12496 proc: self.proc.clone(),
12497 selection: query,
12498 graphql_client: self.graphql_client.clone(),
12499 }
12500 }
12501}
12502impl Node for ModuleSource {
12503 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12504 let query = self.selection.select("id");
12505 let graphql_client = self.graphql_client.clone();
12506 async move { query.execute(graphql_client).await }
12507 }
12508}
12509impl Syncer for ModuleSource {
12510 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12511 let query = self.selection.select("id");
12512 let graphql_client = self.graphql_client.clone();
12513 async move { query.execute(graphql_client).await }
12514 }
12515 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12516 let query = self.selection.select("sync");
12517 let graphql_client = self.graphql_client.clone();
12518 async move { query.execute(graphql_client).await }
12519 }
12520}
12521#[derive(Clone)]
12522pub struct ObjectTypeDef {
12523 pub proc: Option<Arc<DaggerSessionProc>>,
12524 pub selection: Selection,
12525 pub graphql_client: DynGraphQLClient,
12526}
12527impl IntoID<Id> for ObjectTypeDef {
12528 fn into_id(
12529 self,
12530 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12531 Box::pin(async move { self.id().await })
12532 }
12533}
12534impl Loadable for ObjectTypeDef {
12535 fn graphql_type() -> &'static str {
12536 "ObjectTypeDef"
12537 }
12538 fn from_query(
12539 proc: Option<Arc<DaggerSessionProc>>,
12540 selection: Selection,
12541 graphql_client: DynGraphQLClient,
12542 ) -> Self {
12543 Self {
12544 proc,
12545 selection,
12546 graphql_client,
12547 }
12548 }
12549}
12550impl ObjectTypeDef {
12551 pub fn constructor(&self) -> Function {
12553 let query = self.selection.select("constructor");
12554 Function {
12555 proc: self.proc.clone(),
12556 selection: query,
12557 graphql_client: self.graphql_client.clone(),
12558 }
12559 }
12560 pub async fn deprecated(&self) -> Result<String, DaggerError> {
12562 let query = self.selection.select("deprecated");
12563 query.execute(self.graphql_client.clone()).await
12564 }
12565 pub async fn description(&self) -> Result<String, DaggerError> {
12567 let query = self.selection.select("description");
12568 query.execute(self.graphql_client.clone()).await
12569 }
12570 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12572 let query = self.selection.select("fields");
12573 let query = query.select("id");
12574 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12575 Ok(ids
12576 .into_iter()
12577 .map(|id| FieldTypeDef {
12578 proc: self.proc.clone(),
12579 selection: crate::querybuilder::query()
12580 .select("node")
12581 .arg("id", &id.0)
12582 .inline_fragment("FieldTypeDef"),
12583 graphql_client: self.graphql_client.clone(),
12584 })
12585 .collect())
12586 }
12587 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12589 let query = self.selection.select("functions");
12590 let query = query.select("id");
12591 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12592 Ok(ids
12593 .into_iter()
12594 .map(|id| Function {
12595 proc: self.proc.clone(),
12596 selection: crate::querybuilder::query()
12597 .select("node")
12598 .arg("id", &id.0)
12599 .inline_fragment("Function"),
12600 graphql_client: self.graphql_client.clone(),
12601 })
12602 .collect())
12603 }
12604 pub async fn id(&self) -> Result<Id, DaggerError> {
12606 let query = self.selection.select("id");
12607 query.execute(self.graphql_client.clone()).await
12608 }
12609 pub async fn name(&self) -> Result<String, DaggerError> {
12611 let query = self.selection.select("name");
12612 query.execute(self.graphql_client.clone()).await
12613 }
12614 pub fn source_map(&self) -> SourceMap {
12616 let query = self.selection.select("sourceMap");
12617 SourceMap {
12618 proc: self.proc.clone(),
12619 selection: query,
12620 graphql_client: self.graphql_client.clone(),
12621 }
12622 }
12623 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12625 let query = self.selection.select("sourceModuleName");
12626 query.execute(self.graphql_client.clone()).await
12627 }
12628}
12629impl Node for ObjectTypeDef {
12630 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12631 let query = self.selection.select("id");
12632 let graphql_client = self.graphql_client.clone();
12633 async move { query.execute(graphql_client).await }
12634 }
12635}
12636#[derive(Clone)]
12637pub struct Port {
12638 pub proc: Option<Arc<DaggerSessionProc>>,
12639 pub selection: Selection,
12640 pub graphql_client: DynGraphQLClient,
12641}
12642impl IntoID<Id> for Port {
12643 fn into_id(
12644 self,
12645 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12646 Box::pin(async move { self.id().await })
12647 }
12648}
12649impl Loadable for Port {
12650 fn graphql_type() -> &'static str {
12651 "Port"
12652 }
12653 fn from_query(
12654 proc: Option<Arc<DaggerSessionProc>>,
12655 selection: Selection,
12656 graphql_client: DynGraphQLClient,
12657 ) -> Self {
12658 Self {
12659 proc,
12660 selection,
12661 graphql_client,
12662 }
12663 }
12664}
12665impl Port {
12666 pub async fn description(&self) -> Result<String, DaggerError> {
12668 let query = self.selection.select("description");
12669 query.execute(self.graphql_client.clone()).await
12670 }
12671 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12673 let query = self.selection.select("experimentalSkipHealthcheck");
12674 query.execute(self.graphql_client.clone()).await
12675 }
12676 pub async fn id(&self) -> Result<Id, DaggerError> {
12678 let query = self.selection.select("id");
12679 query.execute(self.graphql_client.clone()).await
12680 }
12681 pub async fn port(&self) -> Result<isize, DaggerError> {
12683 let query = self.selection.select("port");
12684 query.execute(self.graphql_client.clone()).await
12685 }
12686 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12688 let query = self.selection.select("protocol");
12689 query.execute(self.graphql_client.clone()).await
12690 }
12691}
12692impl Node for Port {
12693 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12694 let query = self.selection.select("id");
12695 let graphql_client = self.graphql_client.clone();
12696 async move { query.execute(graphql_client).await }
12697 }
12698}
12699#[derive(Clone)]
12700pub struct Query {
12701 pub proc: Option<Arc<DaggerSessionProc>>,
12702 pub selection: Selection,
12703 pub graphql_client: DynGraphQLClient,
12704}
12705#[derive(Builder, Debug, PartialEq)]
12706pub struct QueryCacheVolumeOpts<'a> {
12707 #[builder(setter(into, strip_option), default)]
12711 pub owner: Option<&'a str>,
12712 #[builder(setter(into, strip_option), default)]
12714 pub sharing: Option<CacheSharingMode>,
12715 #[builder(setter(into, strip_option), default)]
12717 pub source: Option<Id>,
12718}
12719#[derive(Builder, Debug, PartialEq)]
12720pub struct QueryContainerOpts {
12721 #[builder(setter(into, strip_option), default)]
12723 pub platform: Option<Platform>,
12724}
12725#[derive(Builder, Debug, PartialEq)]
12726pub struct QueryCurrentTypeDefsOpts {
12727 #[builder(setter(into, strip_option), default)]
12730 pub hide_core: Option<bool>,
12731 #[builder(setter(into, strip_option), default)]
12733 pub return_all_types: Option<bool>,
12734}
12735#[derive(Builder, Debug, PartialEq)]
12736pub struct QueryEnvOpts {
12737 #[builder(setter(into, strip_option), default)]
12739 pub privileged: Option<bool>,
12740 #[builder(setter(into, strip_option), default)]
12742 pub writable: Option<bool>,
12743}
12744#[derive(Builder, Debug, PartialEq)]
12745pub struct QueryEnvFileOpts {
12746 #[builder(setter(into, strip_option), default)]
12748 pub expand: Option<bool>,
12749}
12750#[derive(Builder, Debug, PartialEq)]
12751pub struct QueryFileOpts {
12752 #[builder(setter(into, strip_option), default)]
12754 pub permissions: Option<isize>,
12755}
12756#[derive(Builder, Debug, PartialEq)]
12757pub struct QueryGitOpts<'a> {
12758 #[builder(setter(into, strip_option), default)]
12760 pub experimental_service_host: Option<Id>,
12761 #[builder(setter(into, strip_option), default)]
12763 pub http_auth_header: Option<Id>,
12764 #[builder(setter(into, strip_option), default)]
12766 pub http_auth_token: Option<Id>,
12767 #[builder(setter(into, strip_option), default)]
12769 pub http_auth_username: Option<&'a str>,
12770 #[builder(setter(into, strip_option), default)]
12772 pub keep_git_dir: Option<bool>,
12773 #[builder(setter(into, strip_option), default)]
12775 pub ssh_auth_socket: Option<Id>,
12776 #[builder(setter(into, strip_option), default)]
12778 pub ssh_known_hosts: Option<&'a str>,
12779}
12780#[derive(Builder, Debug, PartialEq)]
12781pub struct QueryHttpOpts<'a> {
12782 #[builder(setter(into, strip_option), default)]
12784 pub auth_header: Option<Id>,
12785 #[builder(setter(into, strip_option), default)]
12787 pub checksum: Option<&'a str>,
12788 #[builder(setter(into, strip_option), default)]
12790 pub experimental_service_host: Option<Id>,
12791 #[builder(setter(into, strip_option), default)]
12793 pub name: Option<&'a str>,
12794 #[builder(setter(into, strip_option), default)]
12796 pub permissions: Option<isize>,
12797}
12798#[derive(Builder, Debug, PartialEq)]
12799pub struct QueryLlmOpts<'a> {
12800 #[builder(setter(into, strip_option), default)]
12802 pub max_api_calls: Option<isize>,
12803 #[builder(setter(into, strip_option), default)]
12805 pub model: Option<&'a str>,
12806}
12807#[derive(Builder, Debug, PartialEq)]
12808pub struct QueryModuleSourceOpts<'a> {
12809 #[builder(setter(into, strip_option), default)]
12811 pub allow_not_exists: Option<bool>,
12812 #[builder(setter(into, strip_option), default)]
12814 pub disable_find_up: Option<bool>,
12815 #[builder(setter(into, strip_option), default)]
12817 pub ref_pin: Option<&'a str>,
12818 #[builder(setter(into, strip_option), default)]
12820 pub require_kind: Option<ModuleSourceKind>,
12821}
12822#[derive(Builder, Debug, PartialEq)]
12823pub struct QuerySecretOpts<'a> {
12824 #[builder(setter(into, strip_option), default)]
12828 pub cache_key: Option<&'a str>,
12829}
12830impl IntoID<Id> for Query {
12831 fn into_id(
12832 self,
12833 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12834 Box::pin(async move { self.id().await })
12835 }
12836}
12837impl Loadable for Query {
12838 fn graphql_type() -> &'static str {
12839 "Query"
12840 }
12841 fn from_query(
12842 proc: Option<Arc<DaggerSessionProc>>,
12843 selection: Selection,
12844 graphql_client: DynGraphQLClient,
12845 ) -> Self {
12846 Self {
12847 proc,
12848 selection,
12849 graphql_client,
12850 }
12851 }
12852}
12853impl Query {
12854 pub fn address(&self, value: impl Into<String>) -> Address {
12856 let mut query = self.selection.select("address");
12857 query = query.arg("value", value.into());
12858 Address {
12859 proc: self.proc.clone(),
12860 selection: query,
12861 graphql_client: self.graphql_client.clone(),
12862 }
12863 }
12864 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12871 let mut query = self.selection.select("cacheVolume");
12872 query = query.arg("key", key.into());
12873 CacheVolume {
12874 proc: self.proc.clone(),
12875 selection: query,
12876 graphql_client: self.graphql_client.clone(),
12877 }
12878 }
12879 pub fn cache_volume_opts<'a>(
12886 &self,
12887 key: impl Into<String>,
12888 opts: QueryCacheVolumeOpts<'a>,
12889 ) -> CacheVolume {
12890 let mut query = self.selection.select("cacheVolume");
12891 query = query.arg("key", key.into());
12892 if let Some(source) = opts.source {
12893 query = query.arg("source", source);
12894 }
12895 if let Some(sharing) = opts.sharing {
12896 query = query.arg("sharing", sharing);
12897 }
12898 if let Some(owner) = opts.owner {
12899 query = query.arg("owner", owner);
12900 }
12901 CacheVolume {
12902 proc: self.proc.clone(),
12903 selection: query,
12904 graphql_client: self.graphql_client.clone(),
12905 }
12906 }
12907 pub fn changeset(&self) -> Changeset {
12909 let query = self.selection.select("changeset");
12910 Changeset {
12911 proc: self.proc.clone(),
12912 selection: query,
12913 graphql_client: self.graphql_client.clone(),
12914 }
12915 }
12916 pub fn cloud(&self) -> Cloud {
12918 let query = self.selection.select("cloud");
12919 Cloud {
12920 proc: self.proc.clone(),
12921 selection: query,
12922 graphql_client: self.graphql_client.clone(),
12923 }
12924 }
12925 pub fn container(&self) -> Container {
12932 let query = self.selection.select("container");
12933 Container {
12934 proc: self.proc.clone(),
12935 selection: query,
12936 graphql_client: self.graphql_client.clone(),
12937 }
12938 }
12939 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12946 let mut query = self.selection.select("container");
12947 if let Some(platform) = opts.platform {
12948 query = query.arg("platform", platform);
12949 }
12950 Container {
12951 proc: self.proc.clone(),
12952 selection: query,
12953 graphql_client: self.graphql_client.clone(),
12954 }
12955 }
12956 pub fn current_env(&self) -> Env {
12960 let query = self.selection.select("currentEnv");
12961 Env {
12962 proc: self.proc.clone(),
12963 selection: query,
12964 graphql_client: self.graphql_client.clone(),
12965 }
12966 }
12967 pub fn current_function_call(&self) -> FunctionCall {
12970 let query = self.selection.select("currentFunctionCall");
12971 FunctionCall {
12972 proc: self.proc.clone(),
12973 selection: query,
12974 graphql_client: self.graphql_client.clone(),
12975 }
12976 }
12977 pub fn current_module(&self) -> CurrentModule {
12979 let query = self.selection.select("currentModule");
12980 CurrentModule {
12981 proc: self.proc.clone(),
12982 selection: query,
12983 graphql_client: self.graphql_client.clone(),
12984 }
12985 }
12986 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12992 let query = self.selection.select("currentTypeDefs");
12993 let query = query.select("id");
12994 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12995 Ok(ids
12996 .into_iter()
12997 .map(|id| TypeDef {
12998 proc: self.proc.clone(),
12999 selection: crate::querybuilder::query()
13000 .select("node")
13001 .arg("id", &id.0)
13002 .inline_fragment("TypeDef"),
13003 graphql_client: self.graphql_client.clone(),
13004 })
13005 .collect())
13006 }
13007 pub async fn current_type_defs_opts(
13013 &self,
13014 opts: QueryCurrentTypeDefsOpts,
13015 ) -> Result<Vec<TypeDef>, DaggerError> {
13016 let mut query = self.selection.select("currentTypeDefs");
13017 if let Some(return_all_types) = opts.return_all_types {
13018 query = query.arg("returnAllTypes", return_all_types);
13019 }
13020 if let Some(hide_core) = opts.hide_core {
13021 query = query.arg("hideCore", hide_core);
13022 }
13023 let query = query.select("id");
13024 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13025 Ok(ids
13026 .into_iter()
13027 .map(|id| TypeDef {
13028 proc: self.proc.clone(),
13029 selection: crate::querybuilder::query()
13030 .select("node")
13031 .arg("id", &id.0)
13032 .inline_fragment("TypeDef"),
13033 graphql_client: self.graphql_client.clone(),
13034 })
13035 .collect())
13036 }
13037 pub fn current_workspace(&self) -> Workspace {
13039 let query = self.selection.select("currentWorkspace");
13040 Workspace {
13041 proc: self.proc.clone(),
13042 selection: query,
13043 graphql_client: self.graphql_client.clone(),
13044 }
13045 }
13046 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13048 let query = self.selection.select("defaultPlatform");
13049 query.execute(self.graphql_client.clone()).await
13050 }
13051 pub fn directory(&self) -> Directory {
13053 let query = self.selection.select("directory");
13054 Directory {
13055 proc: self.proc.clone(),
13056 selection: query,
13057 graphql_client: self.graphql_client.clone(),
13058 }
13059 }
13060 pub fn engine(&self) -> Engine {
13062 let query = self.selection.select("engine");
13063 Engine {
13064 proc: self.proc.clone(),
13065 selection: query,
13066 graphql_client: self.graphql_client.clone(),
13067 }
13068 }
13069 pub fn env(&self) -> Env {
13075 let query = self.selection.select("env");
13076 Env {
13077 proc: self.proc.clone(),
13078 selection: query,
13079 graphql_client: self.graphql_client.clone(),
13080 }
13081 }
13082 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13088 let mut query = self.selection.select("env");
13089 if let Some(privileged) = opts.privileged {
13090 query = query.arg("privileged", privileged);
13091 }
13092 if let Some(writable) = opts.writable {
13093 query = query.arg("writable", writable);
13094 }
13095 Env {
13096 proc: self.proc.clone(),
13097 selection: query,
13098 graphql_client: self.graphql_client.clone(),
13099 }
13100 }
13101 pub fn env_file(&self) -> EnvFile {
13107 let query = self.selection.select("envFile");
13108 EnvFile {
13109 proc: self.proc.clone(),
13110 selection: query,
13111 graphql_client: self.graphql_client.clone(),
13112 }
13113 }
13114 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13120 let mut query = self.selection.select("envFile");
13121 if let Some(expand) = opts.expand {
13122 query = query.arg("expand", expand);
13123 }
13124 EnvFile {
13125 proc: self.proc.clone(),
13126 selection: query,
13127 graphql_client: self.graphql_client.clone(),
13128 }
13129 }
13130 pub fn error(&self, message: impl Into<String>) -> Error {
13136 let mut query = self.selection.select("error");
13137 query = query.arg("message", message.into());
13138 Error {
13139 proc: self.proc.clone(),
13140 selection: query,
13141 graphql_client: self.graphql_client.clone(),
13142 }
13143 }
13144 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13152 let mut query = self.selection.select("file");
13153 query = query.arg("name", name.into());
13154 query = query.arg("contents", contents.into());
13155 File {
13156 proc: self.proc.clone(),
13157 selection: query,
13158 graphql_client: self.graphql_client.clone(),
13159 }
13160 }
13161 pub fn file_opts(
13169 &self,
13170 name: impl Into<String>,
13171 contents: impl Into<String>,
13172 opts: QueryFileOpts,
13173 ) -> File {
13174 let mut query = self.selection.select("file");
13175 query = query.arg("name", name.into());
13176 query = query.arg("contents", contents.into());
13177 if let Some(permissions) = opts.permissions {
13178 query = query.arg("permissions", permissions);
13179 }
13180 File {
13181 proc: self.proc.clone(),
13182 selection: query,
13183 graphql_client: self.graphql_client.clone(),
13184 }
13185 }
13186 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13193 let mut query = self.selection.select("function");
13194 query = query.arg("name", name.into());
13195 query = query.arg_lazy(
13196 "returnType",
13197 Box::new(move || {
13198 let return_type = return_type.clone();
13199 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13200 }),
13201 );
13202 Function {
13203 proc: self.proc.clone(),
13204 selection: query,
13205 graphql_client: self.graphql_client.clone(),
13206 }
13207 }
13208 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13210 let mut query = self.selection.select("generatedCode");
13211 query = query.arg_lazy(
13212 "code",
13213 Box::new(move || {
13214 let code = code.clone();
13215 Box::pin(async move { code.into_id().await.unwrap().quote() })
13216 }),
13217 );
13218 GeneratedCode {
13219 proc: self.proc.clone(),
13220 selection: query,
13221 graphql_client: self.graphql_client.clone(),
13222 }
13223 }
13224 pub fn git(&self, url: impl Into<String>) -> GitRepository {
13235 let mut query = self.selection.select("git");
13236 query = query.arg("url", url.into());
13237 GitRepository {
13238 proc: self.proc.clone(),
13239 selection: query,
13240 graphql_client: self.graphql_client.clone(),
13241 }
13242 }
13243 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13254 let mut query = self.selection.select("git");
13255 query = query.arg("url", url.into());
13256 if let Some(keep_git_dir) = opts.keep_git_dir {
13257 query = query.arg("keepGitDir", keep_git_dir);
13258 }
13259 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13260 query = query.arg("sshKnownHosts", ssh_known_hosts);
13261 }
13262 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13263 query = query.arg("sshAuthSocket", ssh_auth_socket);
13264 }
13265 if let Some(http_auth_username) = opts.http_auth_username {
13266 query = query.arg("httpAuthUsername", http_auth_username);
13267 }
13268 if let Some(http_auth_token) = opts.http_auth_token {
13269 query = query.arg("httpAuthToken", http_auth_token);
13270 }
13271 if let Some(http_auth_header) = opts.http_auth_header {
13272 query = query.arg("httpAuthHeader", http_auth_header);
13273 }
13274 if let Some(experimental_service_host) = opts.experimental_service_host {
13275 query = query.arg("experimentalServiceHost", experimental_service_host);
13276 }
13277 GitRepository {
13278 proc: self.proc.clone(),
13279 selection: query,
13280 graphql_client: self.graphql_client.clone(),
13281 }
13282 }
13283 pub fn host(&self) -> Host {
13285 let query = self.selection.select("host");
13286 Host {
13287 proc: self.proc.clone(),
13288 selection: query,
13289 graphql_client: self.graphql_client.clone(),
13290 }
13291 }
13292 pub fn http(&self, url: impl Into<String>) -> File {
13299 let mut query = self.selection.select("http");
13300 query = query.arg("url", url.into());
13301 File {
13302 proc: self.proc.clone(),
13303 selection: query,
13304 graphql_client: self.graphql_client.clone(),
13305 }
13306 }
13307 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13314 let mut query = self.selection.select("http");
13315 query = query.arg("url", url.into());
13316 if let Some(name) = opts.name {
13317 query = query.arg("name", name);
13318 }
13319 if let Some(permissions) = opts.permissions {
13320 query = query.arg("permissions", permissions);
13321 }
13322 if let Some(checksum) = opts.checksum {
13323 query = query.arg("checksum", checksum);
13324 }
13325 if let Some(auth_header) = opts.auth_header {
13326 query = query.arg("authHeader", auth_header);
13327 }
13328 if let Some(experimental_service_host) = opts.experimental_service_host {
13329 query = query.arg("experimentalServiceHost", experimental_service_host);
13330 }
13331 File {
13332 proc: self.proc.clone(),
13333 selection: query,
13334 graphql_client: self.graphql_client.clone(),
13335 }
13336 }
13337 pub async fn id(&self) -> Result<Id, DaggerError> {
13339 let query = self.selection.select("id");
13340 query.execute(self.graphql_client.clone()).await
13341 }
13342 pub fn json(&self) -> JsonValue {
13344 let query = self.selection.select("json");
13345 JsonValue {
13346 proc: self.proc.clone(),
13347 selection: query,
13348 graphql_client: self.graphql_client.clone(),
13349 }
13350 }
13351 pub fn llm(&self) -> Llm {
13357 let query = self.selection.select("llm");
13358 Llm {
13359 proc: self.proc.clone(),
13360 selection: query,
13361 graphql_client: self.graphql_client.clone(),
13362 }
13363 }
13364 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13370 let mut query = self.selection.select("llm");
13371 if let Some(model) = opts.model {
13372 query = query.arg("model", model);
13373 }
13374 if let Some(max_api_calls) = opts.max_api_calls {
13375 query = query.arg("maxAPICalls", max_api_calls);
13376 }
13377 Llm {
13378 proc: self.proc.clone(),
13379 selection: query,
13380 graphql_client: self.graphql_client.clone(),
13381 }
13382 }
13383 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13385 let mut query = self.selection.select("loadAddressFromID");
13386 query = query.arg_lazy(
13387 "id",
13388 Box::new(move || {
13389 let id = id.clone();
13390 Box::pin(async move { id.into_id().await.unwrap().quote() })
13391 }),
13392 );
13393 Address {
13394 proc: self.proc.clone(),
13395 selection: query,
13396 graphql_client: self.graphql_client.clone(),
13397 }
13398 }
13399 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13401 let mut query = self.selection.select("loadBindingFromID");
13402 query = query.arg_lazy(
13403 "id",
13404 Box::new(move || {
13405 let id = id.clone();
13406 Box::pin(async move { id.into_id().await.unwrap().quote() })
13407 }),
13408 );
13409 Binding {
13410 proc: self.proc.clone(),
13411 selection: query,
13412 graphql_client: self.graphql_client.clone(),
13413 }
13414 }
13415 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13417 let mut query = self.selection.select("loadCacheVolumeFromID");
13418 query = query.arg_lazy(
13419 "id",
13420 Box::new(move || {
13421 let id = id.clone();
13422 Box::pin(async move { id.into_id().await.unwrap().quote() })
13423 }),
13424 );
13425 CacheVolume {
13426 proc: self.proc.clone(),
13427 selection: query,
13428 graphql_client: self.graphql_client.clone(),
13429 }
13430 }
13431 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13433 let mut query = self.selection.select("loadChangesetFromID");
13434 query = query.arg_lazy(
13435 "id",
13436 Box::new(move || {
13437 let id = id.clone();
13438 Box::pin(async move { id.into_id().await.unwrap().quote() })
13439 }),
13440 );
13441 Changeset {
13442 proc: self.proc.clone(),
13443 selection: query,
13444 graphql_client: self.graphql_client.clone(),
13445 }
13446 }
13447 pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13449 let mut query = self.selection.select("loadCheckFromID");
13450 query = query.arg_lazy(
13451 "id",
13452 Box::new(move || {
13453 let id = id.clone();
13454 Box::pin(async move { id.into_id().await.unwrap().quote() })
13455 }),
13456 );
13457 Check {
13458 proc: self.proc.clone(),
13459 selection: query,
13460 graphql_client: self.graphql_client.clone(),
13461 }
13462 }
13463 pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13465 let mut query = self.selection.select("loadCheckGroupFromID");
13466 query = query.arg_lazy(
13467 "id",
13468 Box::new(move || {
13469 let id = id.clone();
13470 Box::pin(async move { id.into_id().await.unwrap().quote() })
13471 }),
13472 );
13473 CheckGroup {
13474 proc: self.proc.clone(),
13475 selection: query,
13476 graphql_client: self.graphql_client.clone(),
13477 }
13478 }
13479 pub fn load_client_filesync_mirror_from_id(
13481 &self,
13482 id: impl IntoID<ClientFilesyncMirrorId>,
13483 ) -> ClientFilesyncMirror {
13484 let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13485 query = query.arg_lazy(
13486 "id",
13487 Box::new(move || {
13488 let id = id.clone();
13489 Box::pin(async move { id.into_id().await.unwrap().quote() })
13490 }),
13491 );
13492 ClientFilesyncMirror {
13493 proc: self.proc.clone(),
13494 selection: query,
13495 graphql_client: self.graphql_client.clone(),
13496 }
13497 }
13498 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13500 let mut query = self.selection.select("loadCloudFromID");
13501 query = query.arg_lazy(
13502 "id",
13503 Box::new(move || {
13504 let id = id.clone();
13505 Box::pin(async move { id.into_id().await.unwrap().quote() })
13506 }),
13507 );
13508 Cloud {
13509 proc: self.proc.clone(),
13510 selection: query,
13511 graphql_client: self.graphql_client.clone(),
13512 }
13513 }
13514 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13516 let mut query = self.selection.select("loadContainerFromID");
13517 query = query.arg_lazy(
13518 "id",
13519 Box::new(move || {
13520 let id = id.clone();
13521 Box::pin(async move { id.into_id().await.unwrap().quote() })
13522 }),
13523 );
13524 Container {
13525 proc: self.proc.clone(),
13526 selection: query,
13527 graphql_client: self.graphql_client.clone(),
13528 }
13529 }
13530 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13532 let mut query = self.selection.select("loadCurrentModuleFromID");
13533 query = query.arg_lazy(
13534 "id",
13535 Box::new(move || {
13536 let id = id.clone();
13537 Box::pin(async move { id.into_id().await.unwrap().quote() })
13538 }),
13539 );
13540 CurrentModule {
13541 proc: self.proc.clone(),
13542 selection: query,
13543 graphql_client: self.graphql_client.clone(),
13544 }
13545 }
13546 pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13548 let mut query = self.selection.select("loadDiffStatFromID");
13549 query = query.arg_lazy(
13550 "id",
13551 Box::new(move || {
13552 let id = id.clone();
13553 Box::pin(async move { id.into_id().await.unwrap().quote() })
13554 }),
13555 );
13556 DiffStat {
13557 proc: self.proc.clone(),
13558 selection: query,
13559 graphql_client: self.graphql_client.clone(),
13560 }
13561 }
13562 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13564 let mut query = self.selection.select("loadDirectoryFromID");
13565 query = query.arg_lazy(
13566 "id",
13567 Box::new(move || {
13568 let id = id.clone();
13569 Box::pin(async move { id.into_id().await.unwrap().quote() })
13570 }),
13571 );
13572 Directory {
13573 proc: self.proc.clone(),
13574 selection: query,
13575 graphql_client: self.graphql_client.clone(),
13576 }
13577 }
13578 pub fn load_engine_cache_entry_from_id(
13580 &self,
13581 id: impl IntoID<EngineCacheEntryId>,
13582 ) -> EngineCacheEntry {
13583 let mut query = self.selection.select("loadEngineCacheEntryFromID");
13584 query = query.arg_lazy(
13585 "id",
13586 Box::new(move || {
13587 let id = id.clone();
13588 Box::pin(async move { id.into_id().await.unwrap().quote() })
13589 }),
13590 );
13591 EngineCacheEntry {
13592 proc: self.proc.clone(),
13593 selection: query,
13594 graphql_client: self.graphql_client.clone(),
13595 }
13596 }
13597 pub fn load_engine_cache_entry_set_from_id(
13599 &self,
13600 id: impl IntoID<EngineCacheEntrySetId>,
13601 ) -> EngineCacheEntrySet {
13602 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13603 query = query.arg_lazy(
13604 "id",
13605 Box::new(move || {
13606 let id = id.clone();
13607 Box::pin(async move { id.into_id().await.unwrap().quote() })
13608 }),
13609 );
13610 EngineCacheEntrySet {
13611 proc: self.proc.clone(),
13612 selection: query,
13613 graphql_client: self.graphql_client.clone(),
13614 }
13615 }
13616 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13618 let mut query = self.selection.select("loadEngineCacheFromID");
13619 query = query.arg_lazy(
13620 "id",
13621 Box::new(move || {
13622 let id = id.clone();
13623 Box::pin(async move { id.into_id().await.unwrap().quote() })
13624 }),
13625 );
13626 EngineCache {
13627 proc: self.proc.clone(),
13628 selection: query,
13629 graphql_client: self.graphql_client.clone(),
13630 }
13631 }
13632 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13634 let mut query = self.selection.select("loadEngineFromID");
13635 query = query.arg_lazy(
13636 "id",
13637 Box::new(move || {
13638 let id = id.clone();
13639 Box::pin(async move { id.into_id().await.unwrap().quote() })
13640 }),
13641 );
13642 Engine {
13643 proc: self.proc.clone(),
13644 selection: query,
13645 graphql_client: self.graphql_client.clone(),
13646 }
13647 }
13648 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13650 let mut query = self.selection.select("loadEnumTypeDefFromID");
13651 query = query.arg_lazy(
13652 "id",
13653 Box::new(move || {
13654 let id = id.clone();
13655 Box::pin(async move { id.into_id().await.unwrap().quote() })
13656 }),
13657 );
13658 EnumTypeDef {
13659 proc: self.proc.clone(),
13660 selection: query,
13661 graphql_client: self.graphql_client.clone(),
13662 }
13663 }
13664 pub fn load_enum_value_type_def_from_id(
13666 &self,
13667 id: impl IntoID<EnumValueTypeDefId>,
13668 ) -> EnumValueTypeDef {
13669 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13670 query = query.arg_lazy(
13671 "id",
13672 Box::new(move || {
13673 let id = id.clone();
13674 Box::pin(async move { id.into_id().await.unwrap().quote() })
13675 }),
13676 );
13677 EnumValueTypeDef {
13678 proc: self.proc.clone(),
13679 selection: query,
13680 graphql_client: self.graphql_client.clone(),
13681 }
13682 }
13683 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13685 let mut query = self.selection.select("loadEnvFileFromID");
13686 query = query.arg_lazy(
13687 "id",
13688 Box::new(move || {
13689 let id = id.clone();
13690 Box::pin(async move { id.into_id().await.unwrap().quote() })
13691 }),
13692 );
13693 EnvFile {
13694 proc: self.proc.clone(),
13695 selection: query,
13696 graphql_client: self.graphql_client.clone(),
13697 }
13698 }
13699 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13701 let mut query = self.selection.select("loadEnvFromID");
13702 query = query.arg_lazy(
13703 "id",
13704 Box::new(move || {
13705 let id = id.clone();
13706 Box::pin(async move { id.into_id().await.unwrap().quote() })
13707 }),
13708 );
13709 Env {
13710 proc: self.proc.clone(),
13711 selection: query,
13712 graphql_client: self.graphql_client.clone(),
13713 }
13714 }
13715 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13717 let mut query = self.selection.select("loadEnvVariableFromID");
13718 query = query.arg_lazy(
13719 "id",
13720 Box::new(move || {
13721 let id = id.clone();
13722 Box::pin(async move { id.into_id().await.unwrap().quote() })
13723 }),
13724 );
13725 EnvVariable {
13726 proc: self.proc.clone(),
13727 selection: query,
13728 graphql_client: self.graphql_client.clone(),
13729 }
13730 }
13731 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13733 let mut query = self.selection.select("loadErrorFromID");
13734 query = query.arg_lazy(
13735 "id",
13736 Box::new(move || {
13737 let id = id.clone();
13738 Box::pin(async move { id.into_id().await.unwrap().quote() })
13739 }),
13740 );
13741 Error {
13742 proc: self.proc.clone(),
13743 selection: query,
13744 graphql_client: self.graphql_client.clone(),
13745 }
13746 }
13747 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13749 let mut query = self.selection.select("loadErrorValueFromID");
13750 query = query.arg_lazy(
13751 "id",
13752 Box::new(move || {
13753 let id = id.clone();
13754 Box::pin(async move { id.into_id().await.unwrap().quote() })
13755 }),
13756 );
13757 ErrorValue {
13758 proc: self.proc.clone(),
13759 selection: query,
13760 graphql_client: self.graphql_client.clone(),
13761 }
13762 }
13763 pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13765 let mut query = self.selection.select("loadExportableFromID");
13766 query = query.arg_lazy(
13767 "id",
13768 Box::new(move || {
13769 let id = id.clone();
13770 Box::pin(async move { id.into_id().await.unwrap().quote() })
13771 }),
13772 );
13773 ExportableClient {
13774 proc: self.proc.clone(),
13775 selection: query,
13776 graphql_client: self.graphql_client.clone(),
13777 }
13778 }
13779 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13781 let mut query = self.selection.select("loadFieldTypeDefFromID");
13782 query = query.arg_lazy(
13783 "id",
13784 Box::new(move || {
13785 let id = id.clone();
13786 Box::pin(async move { id.into_id().await.unwrap().quote() })
13787 }),
13788 );
13789 FieldTypeDef {
13790 proc: self.proc.clone(),
13791 selection: query,
13792 graphql_client: self.graphql_client.clone(),
13793 }
13794 }
13795 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13797 let mut query = self.selection.select("loadFileFromID");
13798 query = query.arg_lazy(
13799 "id",
13800 Box::new(move || {
13801 let id = id.clone();
13802 Box::pin(async move { id.into_id().await.unwrap().quote() })
13803 }),
13804 );
13805 File {
13806 proc: self.proc.clone(),
13807 selection: query,
13808 graphql_client: self.graphql_client.clone(),
13809 }
13810 }
13811 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13813 let mut query = self.selection.select("loadFunctionArgFromID");
13814 query = query.arg_lazy(
13815 "id",
13816 Box::new(move || {
13817 let id = id.clone();
13818 Box::pin(async move { id.into_id().await.unwrap().quote() })
13819 }),
13820 );
13821 FunctionArg {
13822 proc: self.proc.clone(),
13823 selection: query,
13824 graphql_client: self.graphql_client.clone(),
13825 }
13826 }
13827 pub fn load_function_call_arg_value_from_id(
13829 &self,
13830 id: impl IntoID<FunctionCallArgValueId>,
13831 ) -> FunctionCallArgValue {
13832 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13833 query = query.arg_lazy(
13834 "id",
13835 Box::new(move || {
13836 let id = id.clone();
13837 Box::pin(async move { id.into_id().await.unwrap().quote() })
13838 }),
13839 );
13840 FunctionCallArgValue {
13841 proc: self.proc.clone(),
13842 selection: query,
13843 graphql_client: self.graphql_client.clone(),
13844 }
13845 }
13846 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13848 let mut query = self.selection.select("loadFunctionCallFromID");
13849 query = query.arg_lazy(
13850 "id",
13851 Box::new(move || {
13852 let id = id.clone();
13853 Box::pin(async move { id.into_id().await.unwrap().quote() })
13854 }),
13855 );
13856 FunctionCall {
13857 proc: self.proc.clone(),
13858 selection: query,
13859 graphql_client: self.graphql_client.clone(),
13860 }
13861 }
13862 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13864 let mut query = self.selection.select("loadFunctionFromID");
13865 query = query.arg_lazy(
13866 "id",
13867 Box::new(move || {
13868 let id = id.clone();
13869 Box::pin(async move { id.into_id().await.unwrap().quote() })
13870 }),
13871 );
13872 Function {
13873 proc: self.proc.clone(),
13874 selection: query,
13875 graphql_client: self.graphql_client.clone(),
13876 }
13877 }
13878 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13880 let mut query = self.selection.select("loadGeneratedCodeFromID");
13881 query = query.arg_lazy(
13882 "id",
13883 Box::new(move || {
13884 let id = id.clone();
13885 Box::pin(async move { id.into_id().await.unwrap().quote() })
13886 }),
13887 );
13888 GeneratedCode {
13889 proc: self.proc.clone(),
13890 selection: query,
13891 graphql_client: self.graphql_client.clone(),
13892 }
13893 }
13894 pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13896 let mut query = self.selection.select("loadGeneratorFromID");
13897 query = query.arg_lazy(
13898 "id",
13899 Box::new(move || {
13900 let id = id.clone();
13901 Box::pin(async move { id.into_id().await.unwrap().quote() })
13902 }),
13903 );
13904 Generator {
13905 proc: self.proc.clone(),
13906 selection: query,
13907 graphql_client: self.graphql_client.clone(),
13908 }
13909 }
13910 pub fn load_generator_group_from_id(
13912 &self,
13913 id: impl IntoID<GeneratorGroupId>,
13914 ) -> GeneratorGroup {
13915 let mut query = self.selection.select("loadGeneratorGroupFromID");
13916 query = query.arg_lazy(
13917 "id",
13918 Box::new(move || {
13919 let id = id.clone();
13920 Box::pin(async move { id.into_id().await.unwrap().quote() })
13921 }),
13922 );
13923 GeneratorGroup {
13924 proc: self.proc.clone(),
13925 selection: query,
13926 graphql_client: self.graphql_client.clone(),
13927 }
13928 }
13929 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13931 let mut query = self.selection.select("loadGitRefFromID");
13932 query = query.arg_lazy(
13933 "id",
13934 Box::new(move || {
13935 let id = id.clone();
13936 Box::pin(async move { id.into_id().await.unwrap().quote() })
13937 }),
13938 );
13939 GitRef {
13940 proc: self.proc.clone(),
13941 selection: query,
13942 graphql_client: self.graphql_client.clone(),
13943 }
13944 }
13945 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13947 let mut query = self.selection.select("loadGitRepositoryFromID");
13948 query = query.arg_lazy(
13949 "id",
13950 Box::new(move || {
13951 let id = id.clone();
13952 Box::pin(async move { id.into_id().await.unwrap().quote() })
13953 }),
13954 );
13955 GitRepository {
13956 proc: self.proc.clone(),
13957 selection: query,
13958 graphql_client: self.graphql_client.clone(),
13959 }
13960 }
13961 pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
13963 let mut query = self.selection.select("loadHTTPStateFromID");
13964 query = query.arg_lazy(
13965 "id",
13966 Box::new(move || {
13967 let id = id.clone();
13968 Box::pin(async move { id.into_id().await.unwrap().quote() })
13969 }),
13970 );
13971 HttpState {
13972 proc: self.proc.clone(),
13973 selection: query,
13974 graphql_client: self.graphql_client.clone(),
13975 }
13976 }
13977 pub fn load_healthcheck_config_from_id(
13979 &self,
13980 id: impl IntoID<HealthcheckConfigId>,
13981 ) -> HealthcheckConfig {
13982 let mut query = self.selection.select("loadHealthcheckConfigFromID");
13983 query = query.arg_lazy(
13984 "id",
13985 Box::new(move || {
13986 let id = id.clone();
13987 Box::pin(async move { id.into_id().await.unwrap().quote() })
13988 }),
13989 );
13990 HealthcheckConfig {
13991 proc: self.proc.clone(),
13992 selection: query,
13993 graphql_client: self.graphql_client.clone(),
13994 }
13995 }
13996 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13998 let mut query = self.selection.select("loadHostFromID");
13999 query = query.arg_lazy(
14000 "id",
14001 Box::new(move || {
14002 let id = id.clone();
14003 Box::pin(async move { id.into_id().await.unwrap().quote() })
14004 }),
14005 );
14006 Host {
14007 proc: self.proc.clone(),
14008 selection: query,
14009 graphql_client: self.graphql_client.clone(),
14010 }
14011 }
14012 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14014 let mut query = self.selection.select("loadInputTypeDefFromID");
14015 query = query.arg_lazy(
14016 "id",
14017 Box::new(move || {
14018 let id = id.clone();
14019 Box::pin(async move { id.into_id().await.unwrap().quote() })
14020 }),
14021 );
14022 InputTypeDef {
14023 proc: self.proc.clone(),
14024 selection: query,
14025 graphql_client: self.graphql_client.clone(),
14026 }
14027 }
14028 pub fn load_interface_type_def_from_id(
14030 &self,
14031 id: impl IntoID<InterfaceTypeDefId>,
14032 ) -> InterfaceTypeDef {
14033 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14034 query = query.arg_lazy(
14035 "id",
14036 Box::new(move || {
14037 let id = id.clone();
14038 Box::pin(async move { id.into_id().await.unwrap().quote() })
14039 }),
14040 );
14041 InterfaceTypeDef {
14042 proc: self.proc.clone(),
14043 selection: query,
14044 graphql_client: self.graphql_client.clone(),
14045 }
14046 }
14047 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14049 let mut query = self.selection.select("loadJSONValueFromID");
14050 query = query.arg_lazy(
14051 "id",
14052 Box::new(move || {
14053 let id = id.clone();
14054 Box::pin(async move { id.into_id().await.unwrap().quote() })
14055 }),
14056 );
14057 JsonValue {
14058 proc: self.proc.clone(),
14059 selection: query,
14060 graphql_client: self.graphql_client.clone(),
14061 }
14062 }
14063 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14065 let mut query = self.selection.select("loadLLMFromID");
14066 query = query.arg_lazy(
14067 "id",
14068 Box::new(move || {
14069 let id = id.clone();
14070 Box::pin(async move { id.into_id().await.unwrap().quote() })
14071 }),
14072 );
14073 Llm {
14074 proc: self.proc.clone(),
14075 selection: query,
14076 graphql_client: self.graphql_client.clone(),
14077 }
14078 }
14079 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14081 let mut query = self.selection.select("loadLLMTokenUsageFromID");
14082 query = query.arg_lazy(
14083 "id",
14084 Box::new(move || {
14085 let id = id.clone();
14086 Box::pin(async move { id.into_id().await.unwrap().quote() })
14087 }),
14088 );
14089 LlmTokenUsage {
14090 proc: self.proc.clone(),
14091 selection: query,
14092 graphql_client: self.graphql_client.clone(),
14093 }
14094 }
14095 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14097 let mut query = self.selection.select("loadLabelFromID");
14098 query = query.arg_lazy(
14099 "id",
14100 Box::new(move || {
14101 let id = id.clone();
14102 Box::pin(async move { id.into_id().await.unwrap().quote() })
14103 }),
14104 );
14105 Label {
14106 proc: self.proc.clone(),
14107 selection: query,
14108 graphql_client: self.graphql_client.clone(),
14109 }
14110 }
14111 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14113 let mut query = self.selection.select("loadListTypeDefFromID");
14114 query = query.arg_lazy(
14115 "id",
14116 Box::new(move || {
14117 let id = id.clone();
14118 Box::pin(async move { id.into_id().await.unwrap().quote() })
14119 }),
14120 );
14121 ListTypeDef {
14122 proc: self.proc.clone(),
14123 selection: query,
14124 graphql_client: self.graphql_client.clone(),
14125 }
14126 }
14127 pub fn load_module_config_client_from_id(
14129 &self,
14130 id: impl IntoID<ModuleConfigClientId>,
14131 ) -> ModuleConfigClient {
14132 let mut query = self.selection.select("loadModuleConfigClientFromID");
14133 query = query.arg_lazy(
14134 "id",
14135 Box::new(move || {
14136 let id = id.clone();
14137 Box::pin(async move { id.into_id().await.unwrap().quote() })
14138 }),
14139 );
14140 ModuleConfigClient {
14141 proc: self.proc.clone(),
14142 selection: query,
14143 graphql_client: self.graphql_client.clone(),
14144 }
14145 }
14146 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14148 let mut query = self.selection.select("loadModuleFromID");
14149 query = query.arg_lazy(
14150 "id",
14151 Box::new(move || {
14152 let id = id.clone();
14153 Box::pin(async move { id.into_id().await.unwrap().quote() })
14154 }),
14155 );
14156 Module {
14157 proc: self.proc.clone(),
14158 selection: query,
14159 graphql_client: self.graphql_client.clone(),
14160 }
14161 }
14162 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14164 let mut query = self.selection.select("loadModuleSourceFromID");
14165 query = query.arg_lazy(
14166 "id",
14167 Box::new(move || {
14168 let id = id.clone();
14169 Box::pin(async move { id.into_id().await.unwrap().quote() })
14170 }),
14171 );
14172 ModuleSource {
14173 proc: self.proc.clone(),
14174 selection: query,
14175 graphql_client: self.graphql_client.clone(),
14176 }
14177 }
14178 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14180 let mut query = self.selection.select("loadObjectTypeDefFromID");
14181 query = query.arg_lazy(
14182 "id",
14183 Box::new(move || {
14184 let id = id.clone();
14185 Box::pin(async move { id.into_id().await.unwrap().quote() })
14186 }),
14187 );
14188 ObjectTypeDef {
14189 proc: self.proc.clone(),
14190 selection: query,
14191 graphql_client: self.graphql_client.clone(),
14192 }
14193 }
14194 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14196 let mut query = self.selection.select("loadPortFromID");
14197 query = query.arg_lazy(
14198 "id",
14199 Box::new(move || {
14200 let id = id.clone();
14201 Box::pin(async move { id.into_id().await.unwrap().quote() })
14202 }),
14203 );
14204 Port {
14205 proc: self.proc.clone(),
14206 selection: query,
14207 graphql_client: self.graphql_client.clone(),
14208 }
14209 }
14210 pub fn load_remote_git_mirror_from_id(
14212 &self,
14213 id: impl IntoID<RemoteGitMirrorId>,
14214 ) -> RemoteGitMirror {
14215 let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14216 query = query.arg_lazy(
14217 "id",
14218 Box::new(move || {
14219 let id = id.clone();
14220 Box::pin(async move { id.into_id().await.unwrap().quote() })
14221 }),
14222 );
14223 RemoteGitMirror {
14224 proc: self.proc.clone(),
14225 selection: query,
14226 graphql_client: self.graphql_client.clone(),
14227 }
14228 }
14229 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14231 let mut query = self.selection.select("loadSDKConfigFromID");
14232 query = query.arg_lazy(
14233 "id",
14234 Box::new(move || {
14235 let id = id.clone();
14236 Box::pin(async move { id.into_id().await.unwrap().quote() })
14237 }),
14238 );
14239 SdkConfig {
14240 proc: self.proc.clone(),
14241 selection: query,
14242 graphql_client: self.graphql_client.clone(),
14243 }
14244 }
14245 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14247 let mut query = self.selection.select("loadScalarTypeDefFromID");
14248 query = query.arg_lazy(
14249 "id",
14250 Box::new(move || {
14251 let id = id.clone();
14252 Box::pin(async move { id.into_id().await.unwrap().quote() })
14253 }),
14254 );
14255 ScalarTypeDef {
14256 proc: self.proc.clone(),
14257 selection: query,
14258 graphql_client: self.graphql_client.clone(),
14259 }
14260 }
14261 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14263 let mut query = self.selection.select("loadSearchResultFromID");
14264 query = query.arg_lazy(
14265 "id",
14266 Box::new(move || {
14267 let id = id.clone();
14268 Box::pin(async move { id.into_id().await.unwrap().quote() })
14269 }),
14270 );
14271 SearchResult {
14272 proc: self.proc.clone(),
14273 selection: query,
14274 graphql_client: self.graphql_client.clone(),
14275 }
14276 }
14277 pub fn load_search_submatch_from_id(
14279 &self,
14280 id: impl IntoID<SearchSubmatchId>,
14281 ) -> SearchSubmatch {
14282 let mut query = self.selection.select("loadSearchSubmatchFromID");
14283 query = query.arg_lazy(
14284 "id",
14285 Box::new(move || {
14286 let id = id.clone();
14287 Box::pin(async move { id.into_id().await.unwrap().quote() })
14288 }),
14289 );
14290 SearchSubmatch {
14291 proc: self.proc.clone(),
14292 selection: query,
14293 graphql_client: self.graphql_client.clone(),
14294 }
14295 }
14296 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14298 let mut query = self.selection.select("loadSecretFromID");
14299 query = query.arg_lazy(
14300 "id",
14301 Box::new(move || {
14302 let id = id.clone();
14303 Box::pin(async move { id.into_id().await.unwrap().quote() })
14304 }),
14305 );
14306 Secret {
14307 proc: self.proc.clone(),
14308 selection: query,
14309 graphql_client: self.graphql_client.clone(),
14310 }
14311 }
14312 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14314 let mut query = self.selection.select("loadServiceFromID");
14315 query = query.arg_lazy(
14316 "id",
14317 Box::new(move || {
14318 let id = id.clone();
14319 Box::pin(async move { id.into_id().await.unwrap().quote() })
14320 }),
14321 );
14322 Service {
14323 proc: self.proc.clone(),
14324 selection: query,
14325 graphql_client: self.graphql_client.clone(),
14326 }
14327 }
14328 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14330 let mut query = self.selection.select("loadSocketFromID");
14331 query = query.arg_lazy(
14332 "id",
14333 Box::new(move || {
14334 let id = id.clone();
14335 Box::pin(async move { id.into_id().await.unwrap().quote() })
14336 }),
14337 );
14338 Socket {
14339 proc: self.proc.clone(),
14340 selection: query,
14341 graphql_client: self.graphql_client.clone(),
14342 }
14343 }
14344 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14346 let mut query = self.selection.select("loadSourceMapFromID");
14347 query = query.arg_lazy(
14348 "id",
14349 Box::new(move || {
14350 let id = id.clone();
14351 Box::pin(async move { id.into_id().await.unwrap().quote() })
14352 }),
14353 );
14354 SourceMap {
14355 proc: self.proc.clone(),
14356 selection: query,
14357 graphql_client: self.graphql_client.clone(),
14358 }
14359 }
14360 pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14362 let mut query = self.selection.select("loadStatFromID");
14363 query = query.arg_lazy(
14364 "id",
14365 Box::new(move || {
14366 let id = id.clone();
14367 Box::pin(async move { id.into_id().await.unwrap().quote() })
14368 }),
14369 );
14370 Stat {
14371 proc: self.proc.clone(),
14372 selection: query,
14373 graphql_client: self.graphql_client.clone(),
14374 }
14375 }
14376 pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14378 let mut query = self.selection.select("loadSyncerFromID");
14379 query = query.arg_lazy(
14380 "id",
14381 Box::new(move || {
14382 let id = id.clone();
14383 Box::pin(async move { id.into_id().await.unwrap().quote() })
14384 }),
14385 );
14386 SyncerClient {
14387 proc: self.proc.clone(),
14388 selection: query,
14389 graphql_client: self.graphql_client.clone(),
14390 }
14391 }
14392 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14394 let mut query = self.selection.select("loadTerminalFromID");
14395 query = query.arg_lazy(
14396 "id",
14397 Box::new(move || {
14398 let id = id.clone();
14399 Box::pin(async move { id.into_id().await.unwrap().quote() })
14400 }),
14401 );
14402 Terminal {
14403 proc: self.proc.clone(),
14404 selection: query,
14405 graphql_client: self.graphql_client.clone(),
14406 }
14407 }
14408 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14410 let mut query = self.selection.select("loadTypeDefFromID");
14411 query = query.arg_lazy(
14412 "id",
14413 Box::new(move || {
14414 let id = id.clone();
14415 Box::pin(async move { id.into_id().await.unwrap().quote() })
14416 }),
14417 );
14418 TypeDef {
14419 proc: self.proc.clone(),
14420 selection: query,
14421 graphql_client: self.graphql_client.clone(),
14422 }
14423 }
14424 pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14426 let mut query = self.selection.select("loadUpFromID");
14427 query = query.arg_lazy(
14428 "id",
14429 Box::new(move || {
14430 let id = id.clone();
14431 Box::pin(async move { id.into_id().await.unwrap().quote() })
14432 }),
14433 );
14434 Up {
14435 proc: self.proc.clone(),
14436 selection: query,
14437 graphql_client: self.graphql_client.clone(),
14438 }
14439 }
14440 pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14442 let mut query = self.selection.select("loadUpGroupFromID");
14443 query = query.arg_lazy(
14444 "id",
14445 Box::new(move || {
14446 let id = id.clone();
14447 Box::pin(async move { id.into_id().await.unwrap().quote() })
14448 }),
14449 );
14450 UpGroup {
14451 proc: self.proc.clone(),
14452 selection: query,
14453 graphql_client: self.graphql_client.clone(),
14454 }
14455 }
14456 pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14458 let mut query = self.selection.select("loadWorkspaceFromID");
14459 query = query.arg_lazy(
14460 "id",
14461 Box::new(move || {
14462 let id = id.clone();
14463 Box::pin(async move { id.into_id().await.unwrap().quote() })
14464 }),
14465 );
14466 Workspace {
14467 proc: self.proc.clone(),
14468 selection: query,
14469 graphql_client: self.graphql_client.clone(),
14470 }
14471 }
14472 pub fn module(&self) -> Module {
14474 let query = self.selection.select("module");
14475 Module {
14476 proc: self.proc.clone(),
14477 selection: query,
14478 graphql_client: self.graphql_client.clone(),
14479 }
14480 }
14481 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14488 let mut query = self.selection.select("moduleSource");
14489 query = query.arg("refString", ref_string.into());
14490 ModuleSource {
14491 proc: self.proc.clone(),
14492 selection: query,
14493 graphql_client: self.graphql_client.clone(),
14494 }
14495 }
14496 pub fn module_source_opts<'a>(
14503 &self,
14504 ref_string: impl Into<String>,
14505 opts: QueryModuleSourceOpts<'a>,
14506 ) -> ModuleSource {
14507 let mut query = self.selection.select("moduleSource");
14508 query = query.arg("refString", ref_string.into());
14509 if let Some(ref_pin) = opts.ref_pin {
14510 query = query.arg("refPin", ref_pin);
14511 }
14512 if let Some(disable_find_up) = opts.disable_find_up {
14513 query = query.arg("disableFindUp", disable_find_up);
14514 }
14515 if let Some(allow_not_exists) = opts.allow_not_exists {
14516 query = query.arg("allowNotExists", allow_not_exists);
14517 }
14518 if let Some(require_kind) = opts.require_kind {
14519 query = query.arg("requireKind", require_kind);
14520 }
14521 ModuleSource {
14522 proc: self.proc.clone(),
14523 selection: query,
14524 graphql_client: self.graphql_client.clone(),
14525 }
14526 }
14527 pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14529 let mut query = self.selection.select("node");
14530 query = query.arg_lazy(
14531 "id",
14532 Box::new(move || {
14533 let id = id.clone();
14534 Box::pin(async move { id.into_id().await.unwrap().quote() })
14535 }),
14536 );
14537 NodeClient {
14538 proc: self.proc.clone(),
14539 selection: query,
14540 graphql_client: self.graphql_client.clone(),
14541 }
14542 }
14543 pub fn secret(&self, uri: impl Into<String>) -> Secret {
14550 let mut query = self.selection.select("secret");
14551 query = query.arg("uri", uri.into());
14552 Secret {
14553 proc: self.proc.clone(),
14554 selection: query,
14555 graphql_client: self.graphql_client.clone(),
14556 }
14557 }
14558 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14565 let mut query = self.selection.select("secret");
14566 query = query.arg("uri", uri.into());
14567 if let Some(cache_key) = opts.cache_key {
14568 query = query.arg("cacheKey", cache_key);
14569 }
14570 Secret {
14571 proc: self.proc.clone(),
14572 selection: query,
14573 graphql_client: self.graphql_client.clone(),
14574 }
14575 }
14576 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14584 let mut query = self.selection.select("setSecret");
14585 query = query.arg("name", name.into());
14586 query = query.arg("plaintext", plaintext.into());
14587 Secret {
14588 proc: self.proc.clone(),
14589 selection: query,
14590 graphql_client: self.graphql_client.clone(),
14591 }
14592 }
14593 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14601 let mut query = self.selection.select("sourceMap");
14602 query = query.arg("filename", filename.into());
14603 query = query.arg("line", line);
14604 query = query.arg("column", column);
14605 SourceMap {
14606 proc: self.proc.clone(),
14607 selection: query,
14608 graphql_client: self.graphql_client.clone(),
14609 }
14610 }
14611 pub fn type_def(&self) -> TypeDef {
14613 let query = self.selection.select("typeDef");
14614 TypeDef {
14615 proc: self.proc.clone(),
14616 selection: query,
14617 graphql_client: self.graphql_client.clone(),
14618 }
14619 }
14620 pub async fn version(&self) -> Result<String, DaggerError> {
14622 let query = self.selection.select("version");
14623 query.execute(self.graphql_client.clone()).await
14624 }
14625}
14626impl Node for Query {
14627 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14628 let query = self.selection.select("id");
14629 let graphql_client = self.graphql_client.clone();
14630 async move { query.execute(graphql_client).await }
14631 }
14632}
14633#[derive(Clone)]
14634pub struct RemoteGitMirror {
14635 pub proc: Option<Arc<DaggerSessionProc>>,
14636 pub selection: Selection,
14637 pub graphql_client: DynGraphQLClient,
14638}
14639impl IntoID<Id> for RemoteGitMirror {
14640 fn into_id(
14641 self,
14642 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14643 Box::pin(async move { self.id().await })
14644 }
14645}
14646impl Loadable for RemoteGitMirror {
14647 fn graphql_type() -> &'static str {
14648 "RemoteGitMirror"
14649 }
14650 fn from_query(
14651 proc: Option<Arc<DaggerSessionProc>>,
14652 selection: Selection,
14653 graphql_client: DynGraphQLClient,
14654 ) -> Self {
14655 Self {
14656 proc,
14657 selection,
14658 graphql_client,
14659 }
14660 }
14661}
14662impl RemoteGitMirror {
14663 pub async fn id(&self) -> Result<Id, DaggerError> {
14665 let query = self.selection.select("id");
14666 query.execute(self.graphql_client.clone()).await
14667 }
14668}
14669impl Node for RemoteGitMirror {
14670 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14671 let query = self.selection.select("id");
14672 let graphql_client = self.graphql_client.clone();
14673 async move { query.execute(graphql_client).await }
14674 }
14675}
14676#[derive(Clone)]
14677pub struct SdkConfig {
14678 pub proc: Option<Arc<DaggerSessionProc>>,
14679 pub selection: Selection,
14680 pub graphql_client: DynGraphQLClient,
14681}
14682impl IntoID<Id> for SdkConfig {
14683 fn into_id(
14684 self,
14685 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14686 Box::pin(async move { self.id().await })
14687 }
14688}
14689impl Loadable for SdkConfig {
14690 fn graphql_type() -> &'static str {
14691 "SDKConfig"
14692 }
14693 fn from_query(
14694 proc: Option<Arc<DaggerSessionProc>>,
14695 selection: Selection,
14696 graphql_client: DynGraphQLClient,
14697 ) -> Self {
14698 Self {
14699 proc,
14700 selection,
14701 graphql_client,
14702 }
14703 }
14704}
14705impl SdkConfig {
14706 pub async fn debug(&self) -> Result<bool, DaggerError> {
14708 let query = self.selection.select("debug");
14709 query.execute(self.graphql_client.clone()).await
14710 }
14711 pub async fn id(&self) -> Result<Id, DaggerError> {
14713 let query = self.selection.select("id");
14714 query.execute(self.graphql_client.clone()).await
14715 }
14716 pub async fn source(&self) -> Result<String, DaggerError> {
14718 let query = self.selection.select("source");
14719 query.execute(self.graphql_client.clone()).await
14720 }
14721}
14722impl Node for SdkConfig {
14723 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14724 let query = self.selection.select("id");
14725 let graphql_client = self.graphql_client.clone();
14726 async move { query.execute(graphql_client).await }
14727 }
14728}
14729#[derive(Clone)]
14730pub struct ScalarTypeDef {
14731 pub proc: Option<Arc<DaggerSessionProc>>,
14732 pub selection: Selection,
14733 pub graphql_client: DynGraphQLClient,
14734}
14735impl IntoID<Id> for ScalarTypeDef {
14736 fn into_id(
14737 self,
14738 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14739 Box::pin(async move { self.id().await })
14740 }
14741}
14742impl Loadable for ScalarTypeDef {
14743 fn graphql_type() -> &'static str {
14744 "ScalarTypeDef"
14745 }
14746 fn from_query(
14747 proc: Option<Arc<DaggerSessionProc>>,
14748 selection: Selection,
14749 graphql_client: DynGraphQLClient,
14750 ) -> Self {
14751 Self {
14752 proc,
14753 selection,
14754 graphql_client,
14755 }
14756 }
14757}
14758impl ScalarTypeDef {
14759 pub async fn description(&self) -> Result<String, DaggerError> {
14761 let query = self.selection.select("description");
14762 query.execute(self.graphql_client.clone()).await
14763 }
14764 pub async fn id(&self) -> Result<Id, DaggerError> {
14766 let query = self.selection.select("id");
14767 query.execute(self.graphql_client.clone()).await
14768 }
14769 pub async fn name(&self) -> Result<String, DaggerError> {
14771 let query = self.selection.select("name");
14772 query.execute(self.graphql_client.clone()).await
14773 }
14774 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14776 let query = self.selection.select("sourceModuleName");
14777 query.execute(self.graphql_client.clone()).await
14778 }
14779}
14780impl Node for ScalarTypeDef {
14781 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14782 let query = self.selection.select("id");
14783 let graphql_client = self.graphql_client.clone();
14784 async move { query.execute(graphql_client).await }
14785 }
14786}
14787#[derive(Clone)]
14788pub struct SearchResult {
14789 pub proc: Option<Arc<DaggerSessionProc>>,
14790 pub selection: Selection,
14791 pub graphql_client: DynGraphQLClient,
14792}
14793impl IntoID<Id> for SearchResult {
14794 fn into_id(
14795 self,
14796 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14797 Box::pin(async move { self.id().await })
14798 }
14799}
14800impl Loadable for SearchResult {
14801 fn graphql_type() -> &'static str {
14802 "SearchResult"
14803 }
14804 fn from_query(
14805 proc: Option<Arc<DaggerSessionProc>>,
14806 selection: Selection,
14807 graphql_client: DynGraphQLClient,
14808 ) -> Self {
14809 Self {
14810 proc,
14811 selection,
14812 graphql_client,
14813 }
14814 }
14815}
14816impl SearchResult {
14817 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14819 let query = self.selection.select("absoluteOffset");
14820 query.execute(self.graphql_client.clone()).await
14821 }
14822 pub async fn file_path(&self) -> Result<String, DaggerError> {
14824 let query = self.selection.select("filePath");
14825 query.execute(self.graphql_client.clone()).await
14826 }
14827 pub async fn id(&self) -> Result<Id, DaggerError> {
14829 let query = self.selection.select("id");
14830 query.execute(self.graphql_client.clone()).await
14831 }
14832 pub async fn line_number(&self) -> Result<isize, DaggerError> {
14834 let query = self.selection.select("lineNumber");
14835 query.execute(self.graphql_client.clone()).await
14836 }
14837 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14839 let query = self.selection.select("matchedLines");
14840 query.execute(self.graphql_client.clone()).await
14841 }
14842 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14844 let query = self.selection.select("submatches");
14845 let query = query.select("id");
14846 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14847 Ok(ids
14848 .into_iter()
14849 .map(|id| SearchSubmatch {
14850 proc: self.proc.clone(),
14851 selection: crate::querybuilder::query()
14852 .select("node")
14853 .arg("id", &id.0)
14854 .inline_fragment("SearchSubmatch"),
14855 graphql_client: self.graphql_client.clone(),
14856 })
14857 .collect())
14858 }
14859}
14860impl Node for SearchResult {
14861 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14862 let query = self.selection.select("id");
14863 let graphql_client = self.graphql_client.clone();
14864 async move { query.execute(graphql_client).await }
14865 }
14866}
14867#[derive(Clone)]
14868pub struct SearchSubmatch {
14869 pub proc: Option<Arc<DaggerSessionProc>>,
14870 pub selection: Selection,
14871 pub graphql_client: DynGraphQLClient,
14872}
14873impl IntoID<Id> for SearchSubmatch {
14874 fn into_id(
14875 self,
14876 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14877 Box::pin(async move { self.id().await })
14878 }
14879}
14880impl Loadable for SearchSubmatch {
14881 fn graphql_type() -> &'static str {
14882 "SearchSubmatch"
14883 }
14884 fn from_query(
14885 proc: Option<Arc<DaggerSessionProc>>,
14886 selection: Selection,
14887 graphql_client: DynGraphQLClient,
14888 ) -> Self {
14889 Self {
14890 proc,
14891 selection,
14892 graphql_client,
14893 }
14894 }
14895}
14896impl SearchSubmatch {
14897 pub async fn end(&self) -> Result<isize, DaggerError> {
14899 let query = self.selection.select("end");
14900 query.execute(self.graphql_client.clone()).await
14901 }
14902 pub async fn id(&self) -> Result<Id, DaggerError> {
14904 let query = self.selection.select("id");
14905 query.execute(self.graphql_client.clone()).await
14906 }
14907 pub async fn start(&self) -> Result<isize, DaggerError> {
14909 let query = self.selection.select("start");
14910 query.execute(self.graphql_client.clone()).await
14911 }
14912 pub async fn text(&self) -> Result<String, DaggerError> {
14914 let query = self.selection.select("text");
14915 query.execute(self.graphql_client.clone()).await
14916 }
14917}
14918impl Node for SearchSubmatch {
14919 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14920 let query = self.selection.select("id");
14921 let graphql_client = self.graphql_client.clone();
14922 async move { query.execute(graphql_client).await }
14923 }
14924}
14925#[derive(Clone)]
14926pub struct Secret {
14927 pub proc: Option<Arc<DaggerSessionProc>>,
14928 pub selection: Selection,
14929 pub graphql_client: DynGraphQLClient,
14930}
14931impl IntoID<Id> for Secret {
14932 fn into_id(
14933 self,
14934 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14935 Box::pin(async move { self.id().await })
14936 }
14937}
14938impl Loadable for Secret {
14939 fn graphql_type() -> &'static str {
14940 "Secret"
14941 }
14942 fn from_query(
14943 proc: Option<Arc<DaggerSessionProc>>,
14944 selection: Selection,
14945 graphql_client: DynGraphQLClient,
14946 ) -> Self {
14947 Self {
14948 proc,
14949 selection,
14950 graphql_client,
14951 }
14952 }
14953}
14954impl Secret {
14955 pub async fn id(&self) -> Result<Id, DaggerError> {
14957 let query = self.selection.select("id");
14958 query.execute(self.graphql_client.clone()).await
14959 }
14960 pub async fn name(&self) -> Result<String, DaggerError> {
14962 let query = self.selection.select("name");
14963 query.execute(self.graphql_client.clone()).await
14964 }
14965 pub async fn plaintext(&self) -> Result<String, DaggerError> {
14967 let query = self.selection.select("plaintext");
14968 query.execute(self.graphql_client.clone()).await
14969 }
14970 pub async fn uri(&self) -> Result<String, DaggerError> {
14972 let query = self.selection.select("uri");
14973 query.execute(self.graphql_client.clone()).await
14974 }
14975}
14976impl Node for Secret {
14977 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14978 let query = self.selection.select("id");
14979 let graphql_client = self.graphql_client.clone();
14980 async move { query.execute(graphql_client).await }
14981 }
14982}
14983#[derive(Clone)]
14984pub struct Service {
14985 pub proc: Option<Arc<DaggerSessionProc>>,
14986 pub selection: Selection,
14987 pub graphql_client: DynGraphQLClient,
14988}
14989#[derive(Builder, Debug, PartialEq)]
14990pub struct ServiceEndpointOpts<'a> {
14991 #[builder(setter(into, strip_option), default)]
14993 pub port: Option<isize>,
14994 #[builder(setter(into, strip_option), default)]
14996 pub scheme: Option<&'a str>,
14997}
14998#[derive(Builder, Debug, PartialEq)]
14999pub struct ServiceStopOpts {
15000 #[builder(setter(into, strip_option), default)]
15002 pub kill: Option<bool>,
15003}
15004#[derive(Builder, Debug, PartialEq)]
15005pub struct ServiceTerminalOpts<'a> {
15006 #[builder(setter(into, strip_option), default)]
15007 pub cmd: Option<Vec<&'a str>>,
15008}
15009#[derive(Builder, Debug, PartialEq)]
15010pub struct ServiceUpOpts {
15011 #[builder(setter(into, strip_option), default)]
15014 pub ports: Option<Vec<PortForward>>,
15015 #[builder(setter(into, strip_option), default)]
15017 pub random: Option<bool>,
15018}
15019impl IntoID<Id> for Service {
15020 fn into_id(
15021 self,
15022 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15023 Box::pin(async move { self.id().await })
15024 }
15025}
15026impl Loadable for Service {
15027 fn graphql_type() -> &'static str {
15028 "Service"
15029 }
15030 fn from_query(
15031 proc: Option<Arc<DaggerSessionProc>>,
15032 selection: Selection,
15033 graphql_client: DynGraphQLClient,
15034 ) -> Self {
15035 Self {
15036 proc,
15037 selection,
15038 graphql_client,
15039 }
15040 }
15041}
15042impl Service {
15043 pub async fn endpoint(&self) -> Result<String, DaggerError> {
15051 let query = self.selection.select("endpoint");
15052 query.execute(self.graphql_client.clone()).await
15053 }
15054 pub async fn endpoint_opts<'a>(
15062 &self,
15063 opts: ServiceEndpointOpts<'a>,
15064 ) -> Result<String, DaggerError> {
15065 let mut query = self.selection.select("endpoint");
15066 if let Some(port) = opts.port {
15067 query = query.arg("port", port);
15068 }
15069 if let Some(scheme) = opts.scheme {
15070 query = query.arg("scheme", scheme);
15071 }
15072 query.execute(self.graphql_client.clone()).await
15073 }
15074 pub async fn hostname(&self) -> Result<String, DaggerError> {
15076 let query = self.selection.select("hostname");
15077 query.execute(self.graphql_client.clone()).await
15078 }
15079 pub async fn id(&self) -> Result<Id, DaggerError> {
15081 let query = self.selection.select("id");
15082 query.execute(self.graphql_client.clone()).await
15083 }
15084 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15086 let query = self.selection.select("ports");
15087 let query = query.select("id");
15088 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15089 Ok(ids
15090 .into_iter()
15091 .map(|id| Port {
15092 proc: self.proc.clone(),
15093 selection: crate::querybuilder::query()
15094 .select("node")
15095 .arg("id", &id.0)
15096 .inline_fragment("Port"),
15097 graphql_client: self.graphql_client.clone(),
15098 })
15099 .collect())
15100 }
15101 pub async fn start(&self) -> Result<Service, DaggerError> {
15104 let query = self.selection.select("start");
15105 let id: Id = query.execute(self.graphql_client.clone()).await?;
15106 Ok(Service {
15107 proc: self.proc.clone(),
15108 selection: query
15109 .root()
15110 .select("node")
15111 .arg("id", &id.0)
15112 .inline_fragment("Service"),
15113 graphql_client: self.graphql_client.clone(),
15114 })
15115 }
15116 pub async fn stop(&self) -> Result<Service, DaggerError> {
15122 let query = self.selection.select("stop");
15123 let id: Id = query.execute(self.graphql_client.clone()).await?;
15124 Ok(Service {
15125 proc: self.proc.clone(),
15126 selection: query
15127 .root()
15128 .select("node")
15129 .arg("id", &id.0)
15130 .inline_fragment("Service"),
15131 graphql_client: self.graphql_client.clone(),
15132 })
15133 }
15134 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15140 let mut query = self.selection.select("stop");
15141 if let Some(kill) = opts.kill {
15142 query = query.arg("kill", kill);
15143 }
15144 let id: Id = query.execute(self.graphql_client.clone()).await?;
15145 Ok(Service {
15146 proc: self.proc.clone(),
15147 selection: query
15148 .root()
15149 .select("node")
15150 .arg("id", &id.0)
15151 .inline_fragment("Service"),
15152 graphql_client: self.graphql_client.clone(),
15153 })
15154 }
15155 pub async fn sync(&self) -> Result<Service, DaggerError> {
15157 let query = self.selection.select("sync");
15158 let id: Id = query.execute(self.graphql_client.clone()).await?;
15159 Ok(Service {
15160 proc: self.proc.clone(),
15161 selection: query
15162 .root()
15163 .select("node")
15164 .arg("id", &id.0)
15165 .inline_fragment("Service"),
15166 graphql_client: self.graphql_client.clone(),
15167 })
15168 }
15169 pub fn terminal(&self) -> Service {
15174 let query = self.selection.select("terminal");
15175 Service {
15176 proc: self.proc.clone(),
15177 selection: query,
15178 graphql_client: self.graphql_client.clone(),
15179 }
15180 }
15181 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15186 let mut query = self.selection.select("terminal");
15187 if let Some(cmd) = opts.cmd {
15188 query = query.arg("cmd", cmd);
15189 }
15190 Service {
15191 proc: self.proc.clone(),
15192 selection: query,
15193 graphql_client: self.graphql_client.clone(),
15194 }
15195 }
15196 pub async fn up(&self) -> Result<Void, DaggerError> {
15202 let query = self.selection.select("up");
15203 query.execute(self.graphql_client.clone()).await
15204 }
15205 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15211 let mut query = self.selection.select("up");
15212 if let Some(ports) = opts.ports {
15213 query = query.arg("ports", ports);
15214 }
15215 if let Some(random) = opts.random {
15216 query = query.arg("random", random);
15217 }
15218 query.execute(self.graphql_client.clone()).await
15219 }
15220 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15226 let mut query = self.selection.select("withHostname");
15227 query = query.arg("hostname", hostname.into());
15228 Service {
15229 proc: self.proc.clone(),
15230 selection: query,
15231 graphql_client: self.graphql_client.clone(),
15232 }
15233 }
15234}
15235impl Node for Service {
15236 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15237 let query = self.selection.select("id");
15238 let graphql_client = self.graphql_client.clone();
15239 async move { query.execute(graphql_client).await }
15240 }
15241}
15242impl Syncer for Service {
15243 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15244 let query = self.selection.select("id");
15245 let graphql_client = self.graphql_client.clone();
15246 async move { query.execute(graphql_client).await }
15247 }
15248 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15249 let query = self.selection.select("sync");
15250 let graphql_client = self.graphql_client.clone();
15251 async move { query.execute(graphql_client).await }
15252 }
15253}
15254#[derive(Clone)]
15255pub struct Socket {
15256 pub proc: Option<Arc<DaggerSessionProc>>,
15257 pub selection: Selection,
15258 pub graphql_client: DynGraphQLClient,
15259}
15260impl IntoID<Id> for Socket {
15261 fn into_id(
15262 self,
15263 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15264 Box::pin(async move { self.id().await })
15265 }
15266}
15267impl Loadable for Socket {
15268 fn graphql_type() -> &'static str {
15269 "Socket"
15270 }
15271 fn from_query(
15272 proc: Option<Arc<DaggerSessionProc>>,
15273 selection: Selection,
15274 graphql_client: DynGraphQLClient,
15275 ) -> Self {
15276 Self {
15277 proc,
15278 selection,
15279 graphql_client,
15280 }
15281 }
15282}
15283impl Socket {
15284 pub async fn id(&self) -> Result<Id, DaggerError> {
15286 let query = self.selection.select("id");
15287 query.execute(self.graphql_client.clone()).await
15288 }
15289}
15290impl Node for Socket {
15291 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15292 let query = self.selection.select("id");
15293 let graphql_client = self.graphql_client.clone();
15294 async move { query.execute(graphql_client).await }
15295 }
15296}
15297#[derive(Clone)]
15298pub struct SourceMap {
15299 pub proc: Option<Arc<DaggerSessionProc>>,
15300 pub selection: Selection,
15301 pub graphql_client: DynGraphQLClient,
15302}
15303impl IntoID<Id> for SourceMap {
15304 fn into_id(
15305 self,
15306 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15307 Box::pin(async move { self.id().await })
15308 }
15309}
15310impl Loadable for SourceMap {
15311 fn graphql_type() -> &'static str {
15312 "SourceMap"
15313 }
15314 fn from_query(
15315 proc: Option<Arc<DaggerSessionProc>>,
15316 selection: Selection,
15317 graphql_client: DynGraphQLClient,
15318 ) -> Self {
15319 Self {
15320 proc,
15321 selection,
15322 graphql_client,
15323 }
15324 }
15325}
15326impl SourceMap {
15327 pub async fn column(&self) -> Result<isize, DaggerError> {
15329 let query = self.selection.select("column");
15330 query.execute(self.graphql_client.clone()).await
15331 }
15332 pub async fn filename(&self) -> Result<String, DaggerError> {
15334 let query = self.selection.select("filename");
15335 query.execute(self.graphql_client.clone()).await
15336 }
15337 pub async fn id(&self) -> Result<Id, DaggerError> {
15339 let query = self.selection.select("id");
15340 query.execute(self.graphql_client.clone()).await
15341 }
15342 pub async fn line(&self) -> Result<isize, DaggerError> {
15344 let query = self.selection.select("line");
15345 query.execute(self.graphql_client.clone()).await
15346 }
15347 pub async fn module(&self) -> Result<String, DaggerError> {
15349 let query = self.selection.select("module");
15350 query.execute(self.graphql_client.clone()).await
15351 }
15352 pub async fn url(&self) -> Result<String, DaggerError> {
15354 let query = self.selection.select("url");
15355 query.execute(self.graphql_client.clone()).await
15356 }
15357}
15358impl Node for SourceMap {
15359 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15360 let query = self.selection.select("id");
15361 let graphql_client = self.graphql_client.clone();
15362 async move { query.execute(graphql_client).await }
15363 }
15364}
15365#[derive(Clone)]
15366pub struct Stat {
15367 pub proc: Option<Arc<DaggerSessionProc>>,
15368 pub selection: Selection,
15369 pub graphql_client: DynGraphQLClient,
15370}
15371impl IntoID<Id> for Stat {
15372 fn into_id(
15373 self,
15374 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15375 Box::pin(async move { self.id().await })
15376 }
15377}
15378impl Loadable for Stat {
15379 fn graphql_type() -> &'static str {
15380 "Stat"
15381 }
15382 fn from_query(
15383 proc: Option<Arc<DaggerSessionProc>>,
15384 selection: Selection,
15385 graphql_client: DynGraphQLClient,
15386 ) -> Self {
15387 Self {
15388 proc,
15389 selection,
15390 graphql_client,
15391 }
15392 }
15393}
15394impl Stat {
15395 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15397 let query = self.selection.select("fileType");
15398 query.execute(self.graphql_client.clone()).await
15399 }
15400 pub async fn id(&self) -> Result<Id, DaggerError> {
15402 let query = self.selection.select("id");
15403 query.execute(self.graphql_client.clone()).await
15404 }
15405 pub async fn name(&self) -> Result<String, DaggerError> {
15407 let query = self.selection.select("name");
15408 query.execute(self.graphql_client.clone()).await
15409 }
15410 pub async fn permissions(&self) -> Result<isize, DaggerError> {
15412 let query = self.selection.select("permissions");
15413 query.execute(self.graphql_client.clone()).await
15414 }
15415 pub async fn size(&self) -> Result<isize, DaggerError> {
15417 let query = self.selection.select("size");
15418 query.execute(self.graphql_client.clone()).await
15419 }
15420}
15421impl Node for Stat {
15422 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15423 let query = self.selection.select("id");
15424 let graphql_client = self.graphql_client.clone();
15425 async move { query.execute(graphql_client).await }
15426 }
15427}
15428#[derive(Clone)]
15429pub struct Terminal {
15430 pub proc: Option<Arc<DaggerSessionProc>>,
15431 pub selection: Selection,
15432 pub graphql_client: DynGraphQLClient,
15433}
15434impl IntoID<Id> for Terminal {
15435 fn into_id(
15436 self,
15437 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15438 Box::pin(async move { self.id().await })
15439 }
15440}
15441impl Loadable for Terminal {
15442 fn graphql_type() -> &'static str {
15443 "Terminal"
15444 }
15445 fn from_query(
15446 proc: Option<Arc<DaggerSessionProc>>,
15447 selection: Selection,
15448 graphql_client: DynGraphQLClient,
15449 ) -> Self {
15450 Self {
15451 proc,
15452 selection,
15453 graphql_client,
15454 }
15455 }
15456}
15457impl Terminal {
15458 pub async fn id(&self) -> Result<Id, DaggerError> {
15460 let query = self.selection.select("id");
15461 query.execute(self.graphql_client.clone()).await
15462 }
15463 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15466 let query = self.selection.select("sync");
15467 let id: Id = query.execute(self.graphql_client.clone()).await?;
15468 Ok(Terminal {
15469 proc: self.proc.clone(),
15470 selection: query
15471 .root()
15472 .select("node")
15473 .arg("id", &id.0)
15474 .inline_fragment("Terminal"),
15475 graphql_client: self.graphql_client.clone(),
15476 })
15477 }
15478}
15479impl Node for Terminal {
15480 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15481 let query = self.selection.select("id");
15482 let graphql_client = self.graphql_client.clone();
15483 async move { query.execute(graphql_client).await }
15484 }
15485}
15486impl Syncer for Terminal {
15487 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15488 let query = self.selection.select("id");
15489 let graphql_client = self.graphql_client.clone();
15490 async move { query.execute(graphql_client).await }
15491 }
15492 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15493 let query = self.selection.select("sync");
15494 let graphql_client = self.graphql_client.clone();
15495 async move { query.execute(graphql_client).await }
15496 }
15497}
15498#[derive(Clone)]
15499pub struct TypeDef {
15500 pub proc: Option<Arc<DaggerSessionProc>>,
15501 pub selection: Selection,
15502 pub graphql_client: DynGraphQLClient,
15503}
15504#[derive(Builder, Debug, PartialEq)]
15505pub struct TypeDefWithEnumOpts<'a> {
15506 #[builder(setter(into, strip_option), default)]
15508 pub description: Option<&'a str>,
15509 #[builder(setter(into, strip_option), default)]
15511 pub source_map: Option<Id>,
15512}
15513#[derive(Builder, Debug, PartialEq)]
15514pub struct TypeDefWithEnumMemberOpts<'a> {
15515 #[builder(setter(into, strip_option), default)]
15517 pub deprecated: Option<&'a str>,
15518 #[builder(setter(into, strip_option), default)]
15520 pub description: Option<&'a str>,
15521 #[builder(setter(into, strip_option), default)]
15523 pub source_map: Option<Id>,
15524 #[builder(setter(into, strip_option), default)]
15526 pub value: Option<&'a str>,
15527}
15528#[derive(Builder, Debug, PartialEq)]
15529pub struct TypeDefWithEnumValueOpts<'a> {
15530 #[builder(setter(into, strip_option), default)]
15532 pub deprecated: Option<&'a str>,
15533 #[builder(setter(into, strip_option), default)]
15535 pub description: Option<&'a str>,
15536 #[builder(setter(into, strip_option), default)]
15538 pub source_map: Option<Id>,
15539}
15540#[derive(Builder, Debug, PartialEq)]
15541pub struct TypeDefWithFieldOpts<'a> {
15542 #[builder(setter(into, strip_option), default)]
15544 pub deprecated: Option<&'a str>,
15545 #[builder(setter(into, strip_option), default)]
15547 pub description: Option<&'a str>,
15548 #[builder(setter(into, strip_option), default)]
15550 pub source_map: Option<Id>,
15551}
15552#[derive(Builder, Debug, PartialEq)]
15553pub struct TypeDefWithInterfaceOpts<'a> {
15554 #[builder(setter(into, strip_option), default)]
15555 pub description: Option<&'a str>,
15556 #[builder(setter(into, strip_option), default)]
15557 pub source_map: Option<Id>,
15558}
15559#[derive(Builder, Debug, PartialEq)]
15560pub struct TypeDefWithObjectOpts<'a> {
15561 #[builder(setter(into, strip_option), default)]
15562 pub deprecated: Option<&'a str>,
15563 #[builder(setter(into, strip_option), default)]
15564 pub description: Option<&'a str>,
15565 #[builder(setter(into, strip_option), default)]
15566 pub source_map: Option<Id>,
15567}
15568#[derive(Builder, Debug, PartialEq)]
15569pub struct TypeDefWithScalarOpts<'a> {
15570 #[builder(setter(into, strip_option), default)]
15571 pub description: Option<&'a str>,
15572}
15573impl IntoID<Id> for TypeDef {
15574 fn into_id(
15575 self,
15576 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15577 Box::pin(async move { self.id().await })
15578 }
15579}
15580impl Loadable for TypeDef {
15581 fn graphql_type() -> &'static str {
15582 "TypeDef"
15583 }
15584 fn from_query(
15585 proc: Option<Arc<DaggerSessionProc>>,
15586 selection: Selection,
15587 graphql_client: DynGraphQLClient,
15588 ) -> Self {
15589 Self {
15590 proc,
15591 selection,
15592 graphql_client,
15593 }
15594 }
15595}
15596impl TypeDef {
15597 pub fn as_enum(&self) -> EnumTypeDef {
15599 let query = self.selection.select("asEnum");
15600 EnumTypeDef {
15601 proc: self.proc.clone(),
15602 selection: query,
15603 graphql_client: self.graphql_client.clone(),
15604 }
15605 }
15606 pub fn as_input(&self) -> InputTypeDef {
15608 let query = self.selection.select("asInput");
15609 InputTypeDef {
15610 proc: self.proc.clone(),
15611 selection: query,
15612 graphql_client: self.graphql_client.clone(),
15613 }
15614 }
15615 pub fn as_interface(&self) -> InterfaceTypeDef {
15617 let query = self.selection.select("asInterface");
15618 InterfaceTypeDef {
15619 proc: self.proc.clone(),
15620 selection: query,
15621 graphql_client: self.graphql_client.clone(),
15622 }
15623 }
15624 pub fn as_list(&self) -> ListTypeDef {
15626 let query = self.selection.select("asList");
15627 ListTypeDef {
15628 proc: self.proc.clone(),
15629 selection: query,
15630 graphql_client: self.graphql_client.clone(),
15631 }
15632 }
15633 pub fn as_object(&self) -> ObjectTypeDef {
15635 let query = self.selection.select("asObject");
15636 ObjectTypeDef {
15637 proc: self.proc.clone(),
15638 selection: query,
15639 graphql_client: self.graphql_client.clone(),
15640 }
15641 }
15642 pub fn as_scalar(&self) -> ScalarTypeDef {
15644 let query = self.selection.select("asScalar");
15645 ScalarTypeDef {
15646 proc: self.proc.clone(),
15647 selection: query,
15648 graphql_client: self.graphql_client.clone(),
15649 }
15650 }
15651 pub async fn id(&self) -> Result<Id, DaggerError> {
15653 let query = self.selection.select("id");
15654 query.execute(self.graphql_client.clone()).await
15655 }
15656 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15658 let query = self.selection.select("kind");
15659 query.execute(self.graphql_client.clone()).await
15660 }
15661 pub async fn name(&self) -> Result<String, DaggerError> {
15663 let query = self.selection.select("name");
15664 query.execute(self.graphql_client.clone()).await
15665 }
15666 pub async fn optional(&self) -> Result<bool, DaggerError> {
15668 let query = self.selection.select("optional");
15669 query.execute(self.graphql_client.clone()).await
15670 }
15671 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15673 let mut query = self.selection.select("withConstructor");
15674 query = query.arg_lazy(
15675 "function",
15676 Box::new(move || {
15677 let function = function.clone();
15678 Box::pin(async move { function.into_id().await.unwrap().quote() })
15679 }),
15680 );
15681 TypeDef {
15682 proc: self.proc.clone(),
15683 selection: query,
15684 graphql_client: self.graphql_client.clone(),
15685 }
15686 }
15687 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15695 let mut query = self.selection.select("withEnum");
15696 query = query.arg("name", name.into());
15697 TypeDef {
15698 proc: self.proc.clone(),
15699 selection: query,
15700 graphql_client: self.graphql_client.clone(),
15701 }
15702 }
15703 pub fn with_enum_opts<'a>(
15711 &self,
15712 name: impl Into<String>,
15713 opts: TypeDefWithEnumOpts<'a>,
15714 ) -> TypeDef {
15715 let mut query = self.selection.select("withEnum");
15716 query = query.arg("name", name.into());
15717 if let Some(description) = opts.description {
15718 query = query.arg("description", description);
15719 }
15720 if let Some(source_map) = opts.source_map {
15721 query = query.arg("sourceMap", source_map);
15722 }
15723 TypeDef {
15724 proc: self.proc.clone(),
15725 selection: query,
15726 graphql_client: self.graphql_client.clone(),
15727 }
15728 }
15729 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15736 let mut query = self.selection.select("withEnumMember");
15737 query = query.arg("name", name.into());
15738 TypeDef {
15739 proc: self.proc.clone(),
15740 selection: query,
15741 graphql_client: self.graphql_client.clone(),
15742 }
15743 }
15744 pub fn with_enum_member_opts<'a>(
15751 &self,
15752 name: impl Into<String>,
15753 opts: TypeDefWithEnumMemberOpts<'a>,
15754 ) -> TypeDef {
15755 let mut query = self.selection.select("withEnumMember");
15756 query = query.arg("name", name.into());
15757 if let Some(value) = opts.value {
15758 query = query.arg("value", value);
15759 }
15760 if let Some(description) = opts.description {
15761 query = query.arg("description", description);
15762 }
15763 if let Some(source_map) = opts.source_map {
15764 query = query.arg("sourceMap", source_map);
15765 }
15766 if let Some(deprecated) = opts.deprecated {
15767 query = query.arg("deprecated", deprecated);
15768 }
15769 TypeDef {
15770 proc: self.proc.clone(),
15771 selection: query,
15772 graphql_client: self.graphql_client.clone(),
15773 }
15774 }
15775 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15782 let mut query = self.selection.select("withEnumValue");
15783 query = query.arg("value", value.into());
15784 TypeDef {
15785 proc: self.proc.clone(),
15786 selection: query,
15787 graphql_client: self.graphql_client.clone(),
15788 }
15789 }
15790 pub fn with_enum_value_opts<'a>(
15797 &self,
15798 value: impl Into<String>,
15799 opts: TypeDefWithEnumValueOpts<'a>,
15800 ) -> TypeDef {
15801 let mut query = self.selection.select("withEnumValue");
15802 query = query.arg("value", value.into());
15803 if let Some(description) = opts.description {
15804 query = query.arg("description", description);
15805 }
15806 if let Some(source_map) = opts.source_map {
15807 query = query.arg("sourceMap", source_map);
15808 }
15809 if let Some(deprecated) = opts.deprecated {
15810 query = query.arg("deprecated", deprecated);
15811 }
15812 TypeDef {
15813 proc: self.proc.clone(),
15814 selection: query,
15815 graphql_client: self.graphql_client.clone(),
15816 }
15817 }
15818 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
15826 let mut query = self.selection.select("withField");
15827 query = query.arg("name", name.into());
15828 query = query.arg_lazy(
15829 "typeDef",
15830 Box::new(move || {
15831 let type_def = type_def.clone();
15832 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15833 }),
15834 );
15835 TypeDef {
15836 proc: self.proc.clone(),
15837 selection: query,
15838 graphql_client: self.graphql_client.clone(),
15839 }
15840 }
15841 pub fn with_field_opts<'a>(
15849 &self,
15850 name: impl Into<String>,
15851 type_def: impl IntoID<Id>,
15852 opts: TypeDefWithFieldOpts<'a>,
15853 ) -> TypeDef {
15854 let mut query = self.selection.select("withField");
15855 query = query.arg("name", name.into());
15856 query = query.arg_lazy(
15857 "typeDef",
15858 Box::new(move || {
15859 let type_def = type_def.clone();
15860 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15861 }),
15862 );
15863 if let Some(description) = opts.description {
15864 query = query.arg("description", description);
15865 }
15866 if let Some(source_map) = opts.source_map {
15867 query = query.arg("sourceMap", source_map);
15868 }
15869 if let Some(deprecated) = opts.deprecated {
15870 query = query.arg("deprecated", deprecated);
15871 }
15872 TypeDef {
15873 proc: self.proc.clone(),
15874 selection: query,
15875 graphql_client: self.graphql_client.clone(),
15876 }
15877 }
15878 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15880 let mut query = self.selection.select("withFunction");
15881 query = query.arg_lazy(
15882 "function",
15883 Box::new(move || {
15884 let function = function.clone();
15885 Box::pin(async move { function.into_id().await.unwrap().quote() })
15886 }),
15887 );
15888 TypeDef {
15889 proc: self.proc.clone(),
15890 selection: query,
15891 graphql_client: self.graphql_client.clone(),
15892 }
15893 }
15894 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15900 let mut query = self.selection.select("withInterface");
15901 query = query.arg("name", name.into());
15902 TypeDef {
15903 proc: self.proc.clone(),
15904 selection: query,
15905 graphql_client: self.graphql_client.clone(),
15906 }
15907 }
15908 pub fn with_interface_opts<'a>(
15914 &self,
15915 name: impl Into<String>,
15916 opts: TypeDefWithInterfaceOpts<'a>,
15917 ) -> TypeDef {
15918 let mut query = self.selection.select("withInterface");
15919 query = query.arg("name", name.into());
15920 if let Some(description) = opts.description {
15921 query = query.arg("description", description);
15922 }
15923 if let Some(source_map) = opts.source_map {
15924 query = query.arg("sourceMap", source_map);
15925 }
15926 TypeDef {
15927 proc: self.proc.clone(),
15928 selection: query,
15929 graphql_client: self.graphql_client.clone(),
15930 }
15931 }
15932 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15934 let mut query = self.selection.select("withKind");
15935 query = query.arg("kind", kind);
15936 TypeDef {
15937 proc: self.proc.clone(),
15938 selection: query,
15939 graphql_client: self.graphql_client.clone(),
15940 }
15941 }
15942 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15944 let mut query = self.selection.select("withListOf");
15945 query = query.arg_lazy(
15946 "elementType",
15947 Box::new(move || {
15948 let element_type = element_type.clone();
15949 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15950 }),
15951 );
15952 TypeDef {
15953 proc: self.proc.clone(),
15954 selection: query,
15955 graphql_client: self.graphql_client.clone(),
15956 }
15957 }
15958 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15965 let mut query = self.selection.select("withObject");
15966 query = query.arg("name", name.into());
15967 TypeDef {
15968 proc: self.proc.clone(),
15969 selection: query,
15970 graphql_client: self.graphql_client.clone(),
15971 }
15972 }
15973 pub fn with_object_opts<'a>(
15980 &self,
15981 name: impl Into<String>,
15982 opts: TypeDefWithObjectOpts<'a>,
15983 ) -> TypeDef {
15984 let mut query = self.selection.select("withObject");
15985 query = query.arg("name", name.into());
15986 if let Some(description) = opts.description {
15987 query = query.arg("description", description);
15988 }
15989 if let Some(source_map) = opts.source_map {
15990 query = query.arg("sourceMap", source_map);
15991 }
15992 if let Some(deprecated) = opts.deprecated {
15993 query = query.arg("deprecated", deprecated);
15994 }
15995 TypeDef {
15996 proc: self.proc.clone(),
15997 selection: query,
15998 graphql_client: self.graphql_client.clone(),
15999 }
16000 }
16001 pub fn with_optional(&self, optional: bool) -> TypeDef {
16003 let mut query = self.selection.select("withOptional");
16004 query = query.arg("optional", optional);
16005 TypeDef {
16006 proc: self.proc.clone(),
16007 selection: query,
16008 graphql_client: self.graphql_client.clone(),
16009 }
16010 }
16011 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16017 let mut query = self.selection.select("withScalar");
16018 query = query.arg("name", name.into());
16019 TypeDef {
16020 proc: self.proc.clone(),
16021 selection: query,
16022 graphql_client: self.graphql_client.clone(),
16023 }
16024 }
16025 pub fn with_scalar_opts<'a>(
16031 &self,
16032 name: impl Into<String>,
16033 opts: TypeDefWithScalarOpts<'a>,
16034 ) -> TypeDef {
16035 let mut query = self.selection.select("withScalar");
16036 query = query.arg("name", name.into());
16037 if let Some(description) = opts.description {
16038 query = query.arg("description", description);
16039 }
16040 TypeDef {
16041 proc: self.proc.clone(),
16042 selection: query,
16043 graphql_client: self.graphql_client.clone(),
16044 }
16045 }
16046}
16047impl Node for TypeDef {
16048 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16049 let query = self.selection.select("id");
16050 let graphql_client = self.graphql_client.clone();
16051 async move { query.execute(graphql_client).await }
16052 }
16053}
16054#[derive(Clone)]
16055pub struct Up {
16056 pub proc: Option<Arc<DaggerSessionProc>>,
16057 pub selection: Selection,
16058 pub graphql_client: DynGraphQLClient,
16059}
16060impl IntoID<Id> for Up {
16061 fn into_id(
16062 self,
16063 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16064 Box::pin(async move { self.id().await })
16065 }
16066}
16067impl Loadable for Up {
16068 fn graphql_type() -> &'static str {
16069 "Up"
16070 }
16071 fn from_query(
16072 proc: Option<Arc<DaggerSessionProc>>,
16073 selection: Selection,
16074 graphql_client: DynGraphQLClient,
16075 ) -> Self {
16076 Self {
16077 proc,
16078 selection,
16079 graphql_client,
16080 }
16081 }
16082}
16083impl Up {
16084 pub async fn description(&self) -> Result<String, DaggerError> {
16086 let query = self.selection.select("description");
16087 query.execute(self.graphql_client.clone()).await
16088 }
16089 pub async fn id(&self) -> Result<Id, DaggerError> {
16091 let query = self.selection.select("id");
16092 query.execute(self.graphql_client.clone()).await
16093 }
16094 pub async fn name(&self) -> Result<String, DaggerError> {
16096 let query = self.selection.select("name");
16097 query.execute(self.graphql_client.clone()).await
16098 }
16099 pub fn original_module(&self) -> Module {
16101 let query = self.selection.select("originalModule");
16102 Module {
16103 proc: self.proc.clone(),
16104 selection: query,
16105 graphql_client: self.graphql_client.clone(),
16106 }
16107 }
16108 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16110 let query = self.selection.select("path");
16111 query.execute(self.graphql_client.clone()).await
16112 }
16113 pub fn run(&self) -> Up {
16115 let query = self.selection.select("run");
16116 Up {
16117 proc: self.proc.clone(),
16118 selection: query,
16119 graphql_client: self.graphql_client.clone(),
16120 }
16121 }
16122}
16123impl Node for Up {
16124 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16125 let query = self.selection.select("id");
16126 let graphql_client = self.graphql_client.clone();
16127 async move { query.execute(graphql_client).await }
16128 }
16129}
16130#[derive(Clone)]
16131pub struct UpGroup {
16132 pub proc: Option<Arc<DaggerSessionProc>>,
16133 pub selection: Selection,
16134 pub graphql_client: DynGraphQLClient,
16135}
16136impl IntoID<Id> for UpGroup {
16137 fn into_id(
16138 self,
16139 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16140 Box::pin(async move { self.id().await })
16141 }
16142}
16143impl Loadable for UpGroup {
16144 fn graphql_type() -> &'static str {
16145 "UpGroup"
16146 }
16147 fn from_query(
16148 proc: Option<Arc<DaggerSessionProc>>,
16149 selection: Selection,
16150 graphql_client: DynGraphQLClient,
16151 ) -> Self {
16152 Self {
16153 proc,
16154 selection,
16155 graphql_client,
16156 }
16157 }
16158}
16159impl UpGroup {
16160 pub async fn id(&self) -> Result<Id, DaggerError> {
16162 let query = self.selection.select("id");
16163 query.execute(self.graphql_client.clone()).await
16164 }
16165 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16167 let query = self.selection.select("list");
16168 let query = query.select("id");
16169 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16170 Ok(ids
16171 .into_iter()
16172 .map(|id| Up {
16173 proc: self.proc.clone(),
16174 selection: crate::querybuilder::query()
16175 .select("node")
16176 .arg("id", &id.0)
16177 .inline_fragment("Up"),
16178 graphql_client: self.graphql_client.clone(),
16179 })
16180 .collect())
16181 }
16182 pub fn run(&self) -> UpGroup {
16184 let query = self.selection.select("run");
16185 UpGroup {
16186 proc: self.proc.clone(),
16187 selection: query,
16188 graphql_client: self.graphql_client.clone(),
16189 }
16190 }
16191}
16192impl Node for UpGroup {
16193 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16194 let query = self.selection.select("id");
16195 let graphql_client = self.graphql_client.clone();
16196 async move { query.execute(graphql_client).await }
16197 }
16198}
16199#[derive(Clone)]
16200pub struct Workspace {
16201 pub proc: Option<Arc<DaggerSessionProc>>,
16202 pub selection: Selection,
16203 pub graphql_client: DynGraphQLClient,
16204}
16205#[derive(Builder, Debug, PartialEq)]
16206pub struct WorkspaceChecksOpts<'a> {
16207 #[builder(setter(into, strip_option), default)]
16209 pub include: Option<Vec<&'a str>>,
16210 #[builder(setter(into, strip_option), default)]
16212 pub no_generate: Option<bool>,
16213 #[builder(setter(into, strip_option), default)]
16215 pub only_generate: Option<bool>,
16216}
16217#[derive(Builder, Debug, PartialEq)]
16218pub struct WorkspaceDirectoryOpts<'a> {
16219 #[builder(setter(into, strip_option), default)]
16221 pub exclude: Option<Vec<&'a str>>,
16222 #[builder(setter(into, strip_option), default)]
16224 pub gitignore: Option<bool>,
16225 #[builder(setter(into, strip_option), default)]
16227 pub include: Option<Vec<&'a str>>,
16228}
16229#[derive(Builder, Debug, PartialEq)]
16230pub struct WorkspaceFindUpOpts<'a> {
16231 #[builder(setter(into, strip_option), default)]
16233 pub from: Option<&'a str>,
16234}
16235#[derive(Builder, Debug, PartialEq)]
16236pub struct WorkspaceGeneratorsOpts<'a> {
16237 #[builder(setter(into, strip_option), default)]
16239 pub include: Option<Vec<&'a str>>,
16240}
16241#[derive(Builder, Debug, PartialEq)]
16242pub struct WorkspaceServicesOpts<'a> {
16243 #[builder(setter(into, strip_option), default)]
16245 pub include: Option<Vec<&'a str>>,
16246}
16247impl IntoID<Id> for Workspace {
16248 fn into_id(
16249 self,
16250 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16251 Box::pin(async move { self.id().await })
16252 }
16253}
16254impl Loadable for Workspace {
16255 fn graphql_type() -> &'static str {
16256 "Workspace"
16257 }
16258 fn from_query(
16259 proc: Option<Arc<DaggerSessionProc>>,
16260 selection: Selection,
16261 graphql_client: DynGraphQLClient,
16262 ) -> Self {
16263 Self {
16264 proc,
16265 selection,
16266 graphql_client,
16267 }
16268 }
16269}
16270impl Workspace {
16271 pub async fn address(&self) -> Result<String, DaggerError> {
16273 let query = self.selection.select("address");
16274 query.execute(self.graphql_client.clone()).await
16275 }
16276 pub fn checks(&self) -> CheckGroup {
16282 let query = self.selection.select("checks");
16283 CheckGroup {
16284 proc: self.proc.clone(),
16285 selection: query,
16286 graphql_client: self.graphql_client.clone(),
16287 }
16288 }
16289 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16295 let mut query = self.selection.select("checks");
16296 if let Some(include) = opts.include {
16297 query = query.arg("include", include);
16298 }
16299 if let Some(no_generate) = opts.no_generate {
16300 query = query.arg("noGenerate", no_generate);
16301 }
16302 if let Some(only_generate) = opts.only_generate {
16303 query = query.arg("onlyGenerate", only_generate);
16304 }
16305 CheckGroup {
16306 proc: self.proc.clone(),
16307 selection: query,
16308 graphql_client: self.graphql_client.clone(),
16309 }
16310 }
16311 pub async fn client_id(&self) -> Result<String, DaggerError> {
16313 let query = self.selection.select("clientId");
16314 query.execute(self.graphql_client.clone()).await
16315 }
16316 pub async fn config_path(&self) -> Result<String, DaggerError> {
16318 let query = self.selection.select("configPath");
16319 query.execute(self.graphql_client.clone()).await
16320 }
16321 pub fn directory(&self, path: impl Into<String>) -> Directory {
16329 let mut query = self.selection.select("directory");
16330 query = query.arg("path", path.into());
16331 Directory {
16332 proc: self.proc.clone(),
16333 selection: query,
16334 graphql_client: self.graphql_client.clone(),
16335 }
16336 }
16337 pub fn directory_opts<'a>(
16345 &self,
16346 path: impl Into<String>,
16347 opts: WorkspaceDirectoryOpts<'a>,
16348 ) -> Directory {
16349 let mut query = self.selection.select("directory");
16350 query = query.arg("path", path.into());
16351 if let Some(exclude) = opts.exclude {
16352 query = query.arg("exclude", exclude);
16353 }
16354 if let Some(include) = opts.include {
16355 query = query.arg("include", include);
16356 }
16357 if let Some(gitignore) = opts.gitignore {
16358 query = query.arg("gitignore", gitignore);
16359 }
16360 Directory {
16361 proc: self.proc.clone(),
16362 selection: query,
16363 graphql_client: self.graphql_client.clone(),
16364 }
16365 }
16366 pub fn file(&self, path: impl Into<String>) -> File {
16373 let mut query = self.selection.select("file");
16374 query = query.arg("path", path.into());
16375 File {
16376 proc: self.proc.clone(),
16377 selection: query,
16378 graphql_client: self.graphql_client.clone(),
16379 }
16380 }
16381 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16391 let mut query = self.selection.select("findUp");
16392 query = query.arg("name", name.into());
16393 query.execute(self.graphql_client.clone()).await
16394 }
16395 pub async fn find_up_opts<'a>(
16405 &self,
16406 name: impl Into<String>,
16407 opts: WorkspaceFindUpOpts<'a>,
16408 ) -> Result<String, DaggerError> {
16409 let mut query = self.selection.select("findUp");
16410 query = query.arg("name", name.into());
16411 if let Some(from) = opts.from {
16412 query = query.arg("from", from);
16413 }
16414 query.execute(self.graphql_client.clone()).await
16415 }
16416 pub fn generators(&self) -> GeneratorGroup {
16422 let query = self.selection.select("generators");
16423 GeneratorGroup {
16424 proc: self.proc.clone(),
16425 selection: query,
16426 graphql_client: self.graphql_client.clone(),
16427 }
16428 }
16429 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16435 let mut query = self.selection.select("generators");
16436 if let Some(include) = opts.include {
16437 query = query.arg("include", include);
16438 }
16439 GeneratorGroup {
16440 proc: self.proc.clone(),
16441 selection: query,
16442 graphql_client: self.graphql_client.clone(),
16443 }
16444 }
16445 pub async fn has_config(&self) -> Result<bool, DaggerError> {
16447 let query = self.selection.select("hasConfig");
16448 query.execute(self.graphql_client.clone()).await
16449 }
16450 pub async fn id(&self) -> Result<Id, DaggerError> {
16452 let query = self.selection.select("id");
16453 query.execute(self.graphql_client.clone()).await
16454 }
16455 pub async fn initialized(&self) -> Result<bool, DaggerError> {
16457 let query = self.selection.select("initialized");
16458 query.execute(self.graphql_client.clone()).await
16459 }
16460 pub async fn path(&self) -> Result<String, DaggerError> {
16462 let query = self.selection.select("path");
16463 query.execute(self.graphql_client.clone()).await
16464 }
16465 pub fn services(&self) -> UpGroup {
16471 let query = self.selection.select("services");
16472 UpGroup {
16473 proc: self.proc.clone(),
16474 selection: query,
16475 graphql_client: self.graphql_client.clone(),
16476 }
16477 }
16478 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16484 let mut query = self.selection.select("services");
16485 if let Some(include) = opts.include {
16486 query = query.arg("include", include);
16487 }
16488 UpGroup {
16489 proc: self.proc.clone(),
16490 selection: query,
16491 graphql_client: self.graphql_client.clone(),
16492 }
16493 }
16494 pub fn update(&self) -> Changeset {
16497 let query = self.selection.select("update");
16498 Changeset {
16499 proc: self.proc.clone(),
16500 selection: query,
16501 graphql_client: self.graphql_client.clone(),
16502 }
16503 }
16504}
16505impl Node for Workspace {
16506 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16507 let query = self.selection.select("id");
16508 let graphql_client = self.graphql_client.clone();
16509 async move { query.execute(graphql_client).await }
16510 }
16511}
16512#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16513pub enum CacheSharingMode {
16514 #[serde(rename = "LOCKED")]
16515 Locked,
16516 #[serde(rename = "PRIVATE")]
16517 Private,
16518 #[serde(rename = "SHARED")]
16519 Shared,
16520}
16521#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16522pub enum ChangesetMergeConflict {
16523 #[serde(rename = "FAIL")]
16524 Fail,
16525 #[serde(rename = "FAIL_EARLY")]
16526 FailEarly,
16527 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16528 LeaveConflictMarkers,
16529 #[serde(rename = "PREFER_OURS")]
16530 PreferOurs,
16531 #[serde(rename = "PREFER_THEIRS")]
16532 PreferTheirs,
16533}
16534#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16535pub enum ChangesetsMergeConflict {
16536 #[serde(rename = "FAIL")]
16537 Fail,
16538 #[serde(rename = "FAIL_EARLY")]
16539 FailEarly,
16540}
16541#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16542pub enum DiffStatKind {
16543 #[serde(rename = "ADDED")]
16544 Added,
16545 #[serde(rename = "MODIFIED")]
16546 Modified,
16547 #[serde(rename = "REMOVED")]
16548 Removed,
16549 #[serde(rename = "RENAMED")]
16550 Renamed,
16551}
16552#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16553pub enum ExistsType {
16554 #[serde(rename = "DIRECTORY_TYPE")]
16555 DirectoryType,
16556 #[serde(rename = "REGULAR_TYPE")]
16557 RegularType,
16558 #[serde(rename = "SYMLINK_TYPE")]
16559 SymlinkType,
16560}
16561#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16562pub enum FileType {
16563 #[serde(rename = "DIRECTORY")]
16564 Directory,
16565 #[serde(rename = "DIRECTORY_TYPE")]
16566 DirectoryType,
16567 #[serde(rename = "REGULAR")]
16568 Regular,
16569 #[serde(rename = "REGULAR_TYPE")]
16570 RegularType,
16571 #[serde(rename = "SYMLINK")]
16572 Symlink,
16573 #[serde(rename = "SYMLINK_TYPE")]
16574 SymlinkType,
16575 #[serde(rename = "UNKNOWN")]
16576 Unknown,
16577}
16578#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16579pub enum FunctionCachePolicy {
16580 #[serde(rename = "Default")]
16581 Default,
16582 #[serde(rename = "Never")]
16583 Never,
16584 #[serde(rename = "PerSession")]
16585 PerSession,
16586}
16587#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16588pub enum ImageLayerCompression {
16589 #[serde(rename = "EStarGZ")]
16590 EStarGz,
16591 #[serde(rename = "ESTARGZ")]
16592 Estargz,
16593 #[serde(rename = "Gzip")]
16594 Gzip,
16595 #[serde(rename = "Uncompressed")]
16596 Uncompressed,
16597 #[serde(rename = "Zstd")]
16598 Zstd,
16599}
16600#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16601pub enum ImageMediaTypes {
16602 #[serde(rename = "DOCKER")]
16603 Docker,
16604 #[serde(rename = "DockerMediaTypes")]
16605 DockerMediaTypes,
16606 #[serde(rename = "OCI")]
16607 Oci,
16608 #[serde(rename = "OCIMediaTypes")]
16609 OciMediaTypes,
16610}
16611#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16612pub enum ModuleSourceExperimentalFeature {
16613 #[serde(rename = "SELF_CALLS")]
16614 SelfCalls,
16615}
16616#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16617pub enum ModuleSourceKind {
16618 #[serde(rename = "DIR")]
16619 Dir,
16620 #[serde(rename = "DIR_SOURCE")]
16621 DirSource,
16622 #[serde(rename = "GIT")]
16623 Git,
16624 #[serde(rename = "GIT_SOURCE")]
16625 GitSource,
16626 #[serde(rename = "LOCAL")]
16627 Local,
16628 #[serde(rename = "LOCAL_SOURCE")]
16629 LocalSource,
16630}
16631#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16632pub enum NetworkProtocol {
16633 #[serde(rename = "TCP")]
16634 Tcp,
16635 #[serde(rename = "UDP")]
16636 Udp,
16637}
16638#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16639pub enum ReturnType {
16640 #[serde(rename = "ANY")]
16641 Any,
16642 #[serde(rename = "FAILURE")]
16643 Failure,
16644 #[serde(rename = "SUCCESS")]
16645 Success,
16646}
16647#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16648pub enum TypeDefKind {
16649 #[serde(rename = "BOOLEAN")]
16650 Boolean,
16651 #[serde(rename = "BOOLEAN_KIND")]
16652 BooleanKind,
16653 #[serde(rename = "ENUM")]
16654 Enum,
16655 #[serde(rename = "ENUM_KIND")]
16656 EnumKind,
16657 #[serde(rename = "FLOAT")]
16658 Float,
16659 #[serde(rename = "FLOAT_KIND")]
16660 FloatKind,
16661 #[serde(rename = "INPUT")]
16662 Input,
16663 #[serde(rename = "INPUT_KIND")]
16664 InputKind,
16665 #[serde(rename = "INTEGER")]
16666 Integer,
16667 #[serde(rename = "INTEGER_KIND")]
16668 IntegerKind,
16669 #[serde(rename = "INTERFACE")]
16670 Interface,
16671 #[serde(rename = "INTERFACE_KIND")]
16672 InterfaceKind,
16673 #[serde(rename = "LIST")]
16674 List,
16675 #[serde(rename = "LIST_KIND")]
16676 ListKind,
16677 #[serde(rename = "OBJECT")]
16678 Object,
16679 #[serde(rename = "OBJECT_KIND")]
16680 ObjectKind,
16681 #[serde(rename = "SCALAR")]
16682 Scalar,
16683 #[serde(rename = "SCALAR_KIND")]
16684 ScalarKind,
16685 #[serde(rename = "STRING")]
16686 String,
16687 #[serde(rename = "STRING_KIND")]
16688 StringKind,
16689 #[serde(rename = "VOID")]
16690 Void,
16691 #[serde(rename = "VOID_KIND")]
16692 VoidKind,
16693}