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 ContainerFromOpts {
1594 #[builder(setter(into, strip_option), default)]
1597 pub registry_service: Option<Id>,
1598}
1599#[derive(Builder, Debug, PartialEq)]
1600pub struct ContainerImportOpts<'a> {
1601 #[builder(setter(into, strip_option), default)]
1603 pub tag: Option<&'a str>,
1604}
1605#[derive(Builder, Debug, PartialEq)]
1606pub struct ContainerPublishOpts {
1607 #[builder(setter(into, strip_option), default)]
1610 pub forced_compression: Option<ImageLayerCompression>,
1611 #[builder(setter(into, strip_option), default)]
1614 pub media_types: Option<ImageMediaTypes>,
1615 #[builder(setter(into, strip_option), default)]
1618 pub platform_variants: Option<Vec<Id>>,
1619 #[builder(setter(into, strip_option), default)]
1622 pub registry_service: Option<Id>,
1623}
1624#[derive(Builder, Debug, PartialEq)]
1625pub struct ContainerStatOpts {
1626 #[builder(setter(into, strip_option), default)]
1628 pub do_not_follow_symlinks: Option<bool>,
1629}
1630#[derive(Builder, Debug, PartialEq)]
1631pub struct ContainerTerminalOpts<'a> {
1632 #[builder(setter(into, strip_option), default)]
1634 pub cmd: Option<Vec<&'a str>>,
1635 #[builder(setter(into, strip_option), default)]
1637 pub experimental_privileged_nesting: Option<bool>,
1638 #[builder(setter(into, strip_option), default)]
1640 pub insecure_root_capabilities: Option<bool>,
1641}
1642#[derive(Builder, Debug, PartialEq)]
1643pub struct ContainerUpOpts<'a> {
1644 #[builder(setter(into, strip_option), default)]
1647 pub args: Option<Vec<&'a str>>,
1648 #[builder(setter(into, strip_option), default)]
1650 pub expand: Option<bool>,
1651 #[builder(setter(into, strip_option), default)]
1653 pub experimental_privileged_nesting: Option<bool>,
1654 #[builder(setter(into, strip_option), default)]
1656 pub insecure_root_capabilities: Option<bool>,
1657 #[builder(setter(into, strip_option), default)]
1660 pub no_init: Option<bool>,
1661 #[builder(setter(into, strip_option), default)]
1664 pub ports: Option<Vec<PortForward>>,
1665 #[builder(setter(into, strip_option), default)]
1667 pub random: Option<bool>,
1668 #[builder(setter(into, strip_option), default)]
1670 pub use_entrypoint: Option<bool>,
1671}
1672#[derive(Builder, Debug, PartialEq)]
1673pub struct ContainerWithDefaultTerminalCmdOpts {
1674 #[builder(setter(into, strip_option), default)]
1676 pub experimental_privileged_nesting: Option<bool>,
1677 #[builder(setter(into, strip_option), default)]
1679 pub insecure_root_capabilities: Option<bool>,
1680}
1681#[derive(Builder, Debug, PartialEq)]
1682pub struct ContainerWithDirectoryOpts<'a> {
1683 #[builder(setter(into, strip_option), default)]
1685 pub exclude: Option<Vec<&'a str>>,
1686 #[builder(setter(into, strip_option), default)]
1688 pub expand: Option<bool>,
1689 #[builder(setter(into, strip_option), default)]
1691 pub gitignore: Option<bool>,
1692 #[builder(setter(into, strip_option), default)]
1694 pub include: Option<Vec<&'a str>>,
1695 #[builder(setter(into, strip_option), default)]
1699 pub owner: Option<&'a str>,
1700 #[builder(setter(into, strip_option), default)]
1701 pub permissions: Option<isize>,
1702}
1703#[derive(Builder, Debug, PartialEq)]
1704pub struct ContainerWithDockerHealthcheckOpts<'a> {
1705 #[builder(setter(into, strip_option), default)]
1707 pub interval: Option<&'a str>,
1708 #[builder(setter(into, strip_option), default)]
1710 pub retries: Option<isize>,
1711 #[builder(setter(into, strip_option), default)]
1713 pub shell: Option<bool>,
1714 #[builder(setter(into, strip_option), default)]
1716 pub start_interval: Option<&'a str>,
1717 #[builder(setter(into, strip_option), default)]
1719 pub start_period: Option<&'a str>,
1720 #[builder(setter(into, strip_option), default)]
1722 pub timeout: Option<&'a str>,
1723}
1724#[derive(Builder, Debug, PartialEq)]
1725pub struct ContainerWithEntrypointOpts {
1726 #[builder(setter(into, strip_option), default)]
1728 pub keep_default_args: Option<bool>,
1729}
1730#[derive(Builder, Debug, PartialEq)]
1731pub struct ContainerWithEnvVariableOpts {
1732 #[builder(setter(into, strip_option), default)]
1734 pub expand: Option<bool>,
1735}
1736#[derive(Builder, Debug, PartialEq)]
1737pub struct ContainerWithExecOpts<'a> {
1738 #[builder(setter(into, strip_option), default)]
1740 pub expand: Option<bool>,
1741 #[builder(setter(into, strip_option), default)]
1743 pub expect: Option<ReturnType>,
1744 #[builder(setter(into, strip_option), default)]
1746 pub experimental_privileged_nesting: Option<bool>,
1747 #[builder(setter(into, strip_option), default)]
1750 pub insecure_root_capabilities: Option<bool>,
1751 #[builder(setter(into, strip_option), default)]
1754 pub no_init: Option<bool>,
1755 #[builder(setter(into, strip_option), default)]
1757 pub redirect_stderr: Option<&'a str>,
1758 #[builder(setter(into, strip_option), default)]
1760 pub redirect_stdin: Option<&'a str>,
1761 #[builder(setter(into, strip_option), default)]
1763 pub redirect_stdout: Option<&'a str>,
1764 #[builder(setter(into, strip_option), default)]
1766 pub stdin: Option<&'a str>,
1767 #[builder(setter(into, strip_option), default)]
1769 pub use_entrypoint: Option<bool>,
1770}
1771#[derive(Builder, Debug, PartialEq)]
1772pub struct ContainerWithExposedPortOpts<'a> {
1773 #[builder(setter(into, strip_option), default)]
1775 pub description: Option<&'a str>,
1776 #[builder(setter(into, strip_option), default)]
1778 pub experimental_skip_healthcheck: Option<bool>,
1779 #[builder(setter(into, strip_option), default)]
1781 pub protocol: Option<NetworkProtocol>,
1782}
1783#[derive(Builder, Debug, PartialEq)]
1784pub struct ContainerWithFileOpts<'a> {
1785 #[builder(setter(into, strip_option), default)]
1787 pub expand: Option<bool>,
1788 #[builder(setter(into, strip_option), default)]
1792 pub owner: Option<&'a str>,
1793 #[builder(setter(into, strip_option), default)]
1795 pub permissions: Option<isize>,
1796}
1797#[derive(Builder, Debug, PartialEq)]
1798pub struct ContainerWithFilesOpts<'a> {
1799 #[builder(setter(into, strip_option), default)]
1801 pub expand: Option<bool>,
1802 #[builder(setter(into, strip_option), default)]
1806 pub owner: Option<&'a str>,
1807 #[builder(setter(into, strip_option), default)]
1809 pub permissions: Option<isize>,
1810}
1811#[derive(Builder, Debug, PartialEq)]
1812pub struct ContainerWithMountedCacheOpts<'a> {
1813 #[builder(setter(into, strip_option), default)]
1815 pub expand: Option<bool>,
1816 #[builder(setter(into, strip_option), default)]
1821 pub owner: Option<&'a str>,
1822 #[builder(setter(into, strip_option), default)]
1824 pub sharing: Option<CacheSharingMode>,
1825 #[builder(setter(into, strip_option), default)]
1827 pub source: Option<Id>,
1828}
1829#[derive(Builder, Debug, PartialEq)]
1830pub struct ContainerWithMountedDirectoryOpts<'a> {
1831 #[builder(setter(into, strip_option), default)]
1833 pub expand: Option<bool>,
1834 #[builder(setter(into, strip_option), default)]
1838 pub owner: Option<&'a str>,
1839 #[builder(setter(into, strip_option), default)]
1841 pub read_only: Option<bool>,
1842}
1843#[derive(Builder, Debug, PartialEq)]
1844pub struct ContainerWithMountedFileOpts<'a> {
1845 #[builder(setter(into, strip_option), default)]
1847 pub expand: Option<bool>,
1848 #[builder(setter(into, strip_option), default)]
1852 pub owner: Option<&'a str>,
1853}
1854#[derive(Builder, Debug, PartialEq)]
1855pub struct ContainerWithMountedSecretOpts<'a> {
1856 #[builder(setter(into, strip_option), default)]
1858 pub expand: Option<bool>,
1859 #[builder(setter(into, strip_option), default)]
1862 pub mode: Option<isize>,
1863 #[builder(setter(into, strip_option), default)]
1867 pub owner: Option<&'a str>,
1868}
1869#[derive(Builder, Debug, PartialEq)]
1870pub struct ContainerWithMountedTempOpts {
1871 #[builder(setter(into, strip_option), default)]
1873 pub expand: Option<bool>,
1874 #[builder(setter(into, strip_option), default)]
1876 pub size: Option<isize>,
1877}
1878#[derive(Builder, Debug, PartialEq)]
1879pub struct ContainerWithNewFileOpts<'a> {
1880 #[builder(setter(into, strip_option), default)]
1882 pub expand: Option<bool>,
1883 #[builder(setter(into, strip_option), default)]
1887 pub owner: Option<&'a str>,
1888 #[builder(setter(into, strip_option), default)]
1890 pub permissions: Option<isize>,
1891}
1892#[derive(Builder, Debug, PartialEq)]
1893pub struct ContainerWithSymlinkOpts {
1894 #[builder(setter(into, strip_option), default)]
1896 pub expand: Option<bool>,
1897}
1898#[derive(Builder, Debug, PartialEq)]
1899pub struct ContainerWithUnixSocketOpts<'a> {
1900 #[builder(setter(into, strip_option), default)]
1902 pub expand: Option<bool>,
1903 #[builder(setter(into, strip_option), default)]
1907 pub owner: Option<&'a str>,
1908}
1909#[derive(Builder, Debug, PartialEq)]
1910pub struct ContainerWithWorkdirOpts {
1911 #[builder(setter(into, strip_option), default)]
1913 pub expand: Option<bool>,
1914}
1915#[derive(Builder, Debug, PartialEq)]
1916pub struct ContainerWithoutDirectoryOpts {
1917 #[builder(setter(into, strip_option), default)]
1919 pub expand: Option<bool>,
1920}
1921#[derive(Builder, Debug, PartialEq)]
1922pub struct ContainerWithoutEntrypointOpts {
1923 #[builder(setter(into, strip_option), default)]
1925 pub keep_default_args: Option<bool>,
1926}
1927#[derive(Builder, Debug, PartialEq)]
1928pub struct ContainerWithoutExposedPortOpts {
1929 #[builder(setter(into, strip_option), default)]
1931 pub protocol: Option<NetworkProtocol>,
1932}
1933#[derive(Builder, Debug, PartialEq)]
1934pub struct ContainerWithoutFileOpts {
1935 #[builder(setter(into, strip_option), default)]
1937 pub expand: Option<bool>,
1938}
1939#[derive(Builder, Debug, PartialEq)]
1940pub struct ContainerWithoutFilesOpts {
1941 #[builder(setter(into, strip_option), default)]
1943 pub expand: Option<bool>,
1944}
1945#[derive(Builder, Debug, PartialEq)]
1946pub struct ContainerWithoutMountOpts {
1947 #[builder(setter(into, strip_option), default)]
1949 pub expand: Option<bool>,
1950}
1951#[derive(Builder, Debug, PartialEq)]
1952pub struct ContainerWithoutUnixSocketOpts {
1953 #[builder(setter(into, strip_option), default)]
1955 pub expand: Option<bool>,
1956}
1957impl IntoID<Id> for Container {
1958 fn into_id(
1959 self,
1960 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1961 Box::pin(async move { self.id().await })
1962 }
1963}
1964impl Loadable for Container {
1965 fn graphql_type() -> &'static str {
1966 "Container"
1967 }
1968 fn from_query(
1969 proc: Option<Arc<DaggerSessionProc>>,
1970 selection: Selection,
1971 graphql_client: DynGraphQLClient,
1972 ) -> Self {
1973 Self {
1974 proc,
1975 selection,
1976 graphql_client,
1977 }
1978 }
1979}
1980impl Container {
1981 pub fn as_service(&self) -> Service {
1988 let query = self.selection.select("asService");
1989 Service {
1990 proc: self.proc.clone(),
1991 selection: query,
1992 graphql_client: self.graphql_client.clone(),
1993 }
1994 }
1995 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2002 let mut query = self.selection.select("asService");
2003 if let Some(args) = opts.args {
2004 query = query.arg("args", args);
2005 }
2006 if let Some(use_entrypoint) = opts.use_entrypoint {
2007 query = query.arg("useEntrypoint", use_entrypoint);
2008 }
2009 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2010 query = query.arg(
2011 "experimentalPrivilegedNesting",
2012 experimental_privileged_nesting,
2013 );
2014 }
2015 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2016 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2017 }
2018 if let Some(expand) = opts.expand {
2019 query = query.arg("expand", expand);
2020 }
2021 if let Some(no_init) = opts.no_init {
2022 query = query.arg("noInit", no_init);
2023 }
2024 Service {
2025 proc: self.proc.clone(),
2026 selection: query,
2027 graphql_client: self.graphql_client.clone(),
2028 }
2029 }
2030 pub fn as_tarball(&self) -> File {
2036 let query = self.selection.select("asTarball");
2037 File {
2038 proc: self.proc.clone(),
2039 selection: query,
2040 graphql_client: self.graphql_client.clone(),
2041 }
2042 }
2043 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2049 let mut query = self.selection.select("asTarball");
2050 if let Some(platform_variants) = opts.platform_variants {
2051 query = query.arg("platformVariants", platform_variants);
2052 }
2053 if let Some(forced_compression) = opts.forced_compression {
2054 query = query.arg("forcedCompression", forced_compression);
2055 }
2056 if let Some(media_types) = opts.media_types {
2057 query = query.arg("mediaTypes", media_types);
2058 }
2059 File {
2060 proc: self.proc.clone(),
2061 selection: query,
2062 graphql_client: self.graphql_client.clone(),
2063 }
2064 }
2065 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2068 let query = self.selection.select("combinedOutput");
2069 query.execute(self.graphql_client.clone()).await
2070 }
2071 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2073 let query = self.selection.select("defaultArgs");
2074 query.execute(self.graphql_client.clone()).await
2075 }
2076 pub fn directory(&self, path: impl Into<String>) -> Directory {
2084 let mut query = self.selection.select("directory");
2085 query = query.arg("path", path.into());
2086 Directory {
2087 proc: self.proc.clone(),
2088 selection: query,
2089 graphql_client: self.graphql_client.clone(),
2090 }
2091 }
2092 pub fn directory_opts(
2100 &self,
2101 path: impl Into<String>,
2102 opts: ContainerDirectoryOpts,
2103 ) -> Directory {
2104 let mut query = self.selection.select("directory");
2105 query = query.arg("path", path.into());
2106 if let Some(expand) = opts.expand {
2107 query = query.arg("expand", expand);
2108 }
2109 Directory {
2110 proc: self.proc.clone(),
2111 selection: query,
2112 graphql_client: self.graphql_client.clone(),
2113 }
2114 }
2115 pub fn docker_healthcheck(&self) -> HealthcheckConfig {
2117 let query = self.selection.select("dockerHealthcheck");
2118 HealthcheckConfig {
2119 proc: self.proc.clone(),
2120 selection: query,
2121 graphql_client: self.graphql_client.clone(),
2122 }
2123 }
2124 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2126 let query = self.selection.select("entrypoint");
2127 query.execute(self.graphql_client.clone()).await
2128 }
2129 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2135 let mut query = self.selection.select("envVariable");
2136 query = query.arg("name", name.into());
2137 query.execute(self.graphql_client.clone()).await
2138 }
2139 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2141 let query = self.selection.select("envVariables");
2142 let query = query.select("id");
2143 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2144 Ok(ids
2145 .into_iter()
2146 .map(|id| EnvVariable {
2147 proc: self.proc.clone(),
2148 selection: crate::querybuilder::query()
2149 .select("node")
2150 .arg("id", &id.0)
2151 .inline_fragment("EnvVariable"),
2152 graphql_client: self.graphql_client.clone(),
2153 })
2154 .collect())
2155 }
2156 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2163 let mut query = self.selection.select("exists");
2164 query = query.arg("path", path.into());
2165 query.execute(self.graphql_client.clone()).await
2166 }
2167 pub async fn exists_opts(
2174 &self,
2175 path: impl Into<String>,
2176 opts: ContainerExistsOpts,
2177 ) -> Result<bool, DaggerError> {
2178 let mut query = self.selection.select("exists");
2179 query = query.arg("path", path.into());
2180 if let Some(expected_type) = opts.expected_type {
2181 query = query.arg("expectedType", expected_type);
2182 }
2183 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2184 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2185 }
2186 if let Some(expand) = opts.expand {
2187 query = query.arg("expand", expand);
2188 }
2189 query.execute(self.graphql_client.clone()).await
2190 }
2191 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2194 let query = self.selection.select("exitCode");
2195 query.execute(self.graphql_client.clone()).await
2196 }
2197 pub fn experimental_with_all_gp_us(&self) -> Container {
2201 let query = self.selection.select("experimentalWithAllGPUs");
2202 Container {
2203 proc: self.proc.clone(),
2204 selection: query,
2205 graphql_client: self.graphql_client.clone(),
2206 }
2207 }
2208 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2216 let mut query = self.selection.select("experimentalWithGPU");
2217 query = query.arg(
2218 "devices",
2219 devices
2220 .into_iter()
2221 .map(|i| i.into())
2222 .collect::<Vec<String>>(),
2223 );
2224 Container {
2225 proc: self.proc.clone(),
2226 selection: query,
2227 graphql_client: self.graphql_client.clone(),
2228 }
2229 }
2230 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2240 let mut query = self.selection.select("export");
2241 query = query.arg("path", path.into());
2242 query.execute(self.graphql_client.clone()).await
2243 }
2244 pub async fn export_opts(
2254 &self,
2255 path: impl Into<String>,
2256 opts: ContainerExportOpts,
2257 ) -> Result<String, DaggerError> {
2258 let mut query = self.selection.select("export");
2259 query = query.arg("path", path.into());
2260 if let Some(platform_variants) = opts.platform_variants {
2261 query = query.arg("platformVariants", platform_variants);
2262 }
2263 if let Some(forced_compression) = opts.forced_compression {
2264 query = query.arg("forcedCompression", forced_compression);
2265 }
2266 if let Some(media_types) = opts.media_types {
2267 query = query.arg("mediaTypes", media_types);
2268 }
2269 if let Some(expand) = opts.expand {
2270 query = query.arg("expand", expand);
2271 }
2272 query.execute(self.graphql_client.clone()).await
2273 }
2274 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2281 let mut query = self.selection.select("exportImage");
2282 query = query.arg("name", name.into());
2283 query.execute(self.graphql_client.clone()).await
2284 }
2285 pub async fn export_image_opts(
2292 &self,
2293 name: impl Into<String>,
2294 opts: ContainerExportImageOpts,
2295 ) -> Result<Void, DaggerError> {
2296 let mut query = self.selection.select("exportImage");
2297 query = query.arg("name", name.into());
2298 if let Some(platform_variants) = opts.platform_variants {
2299 query = query.arg("platformVariants", platform_variants);
2300 }
2301 if let Some(forced_compression) = opts.forced_compression {
2302 query = query.arg("forcedCompression", forced_compression);
2303 }
2304 if let Some(media_types) = opts.media_types {
2305 query = query.arg("mediaTypes", media_types);
2306 }
2307 query.execute(self.graphql_client.clone()).await
2308 }
2309 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2312 let query = self.selection.select("exposedPorts");
2313 let query = query.select("id");
2314 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2315 Ok(ids
2316 .into_iter()
2317 .map(|id| Port {
2318 proc: self.proc.clone(),
2319 selection: crate::querybuilder::query()
2320 .select("node")
2321 .arg("id", &id.0)
2322 .inline_fragment("Port"),
2323 graphql_client: self.graphql_client.clone(),
2324 })
2325 .collect())
2326 }
2327 pub fn file(&self, path: impl Into<String>) -> File {
2335 let mut query = self.selection.select("file");
2336 query = query.arg("path", path.into());
2337 File {
2338 proc: self.proc.clone(),
2339 selection: query,
2340 graphql_client: self.graphql_client.clone(),
2341 }
2342 }
2343 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2351 let mut query = self.selection.select("file");
2352 query = query.arg("path", path.into());
2353 if let Some(expand) = opts.expand {
2354 query = query.arg("expand", expand);
2355 }
2356 File {
2357 proc: self.proc.clone(),
2358 selection: query,
2359 graphql_client: self.graphql_client.clone(),
2360 }
2361 }
2362 pub fn from(&self, address: impl Into<String>) -> Container {
2369 let mut query = self.selection.select("from");
2370 query = query.arg("address", address.into());
2371 Container {
2372 proc: self.proc.clone(),
2373 selection: query,
2374 graphql_client: self.graphql_client.clone(),
2375 }
2376 }
2377 pub fn from_opts(&self, address: impl Into<String>, opts: ContainerFromOpts) -> Container {
2384 let mut query = self.selection.select("from");
2385 query = query.arg("address", address.into());
2386 if let Some(registry_service) = opts.registry_service {
2387 query = query.arg("registryService", registry_service);
2388 }
2389 Container {
2390 proc: self.proc.clone(),
2391 selection: query,
2392 graphql_client: self.graphql_client.clone(),
2393 }
2394 }
2395 pub async fn id(&self) -> Result<Id, DaggerError> {
2397 let query = self.selection.select("id");
2398 query.execute(self.graphql_client.clone()).await
2399 }
2400 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2402 let query = self.selection.select("imageRef");
2403 query.execute(self.graphql_client.clone()).await
2404 }
2405 pub fn import(&self, source: impl IntoID<Id>) -> Container {
2412 let mut query = self.selection.select("import");
2413 query = query.arg_lazy(
2414 "source",
2415 Box::new(move || {
2416 let source = source.clone();
2417 Box::pin(async move { source.into_id().await.unwrap().quote() })
2418 }),
2419 );
2420 Container {
2421 proc: self.proc.clone(),
2422 selection: query,
2423 graphql_client: self.graphql_client.clone(),
2424 }
2425 }
2426 pub fn import_opts<'a>(
2433 &self,
2434 source: impl IntoID<Id>,
2435 opts: ContainerImportOpts<'a>,
2436 ) -> Container {
2437 let mut query = self.selection.select("import");
2438 query = query.arg_lazy(
2439 "source",
2440 Box::new(move || {
2441 let source = source.clone();
2442 Box::pin(async move { source.into_id().await.unwrap().quote() })
2443 }),
2444 );
2445 if let Some(tag) = opts.tag {
2446 query = query.arg("tag", tag);
2447 }
2448 Container {
2449 proc: self.proc.clone(),
2450 selection: query,
2451 graphql_client: self.graphql_client.clone(),
2452 }
2453 }
2454 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2460 let mut query = self.selection.select("label");
2461 query = query.arg("name", name.into());
2462 query.execute(self.graphql_client.clone()).await
2463 }
2464 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2466 let query = self.selection.select("labels");
2467 let query = query.select("id");
2468 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2469 Ok(ids
2470 .into_iter()
2471 .map(|id| Label {
2472 proc: self.proc.clone(),
2473 selection: crate::querybuilder::query()
2474 .select("node")
2475 .arg("id", &id.0)
2476 .inline_fragment("Label"),
2477 graphql_client: self.graphql_client.clone(),
2478 })
2479 .collect())
2480 }
2481 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2483 let query = self.selection.select("mounts");
2484 query.execute(self.graphql_client.clone()).await
2485 }
2486 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2488 let query = self.selection.select("platform");
2489 query.execute(self.graphql_client.clone()).await
2490 }
2491 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2501 let mut query = self.selection.select("publish");
2502 query = query.arg("address", address.into());
2503 query.execute(self.graphql_client.clone()).await
2504 }
2505 pub async fn publish_opts(
2515 &self,
2516 address: impl Into<String>,
2517 opts: ContainerPublishOpts,
2518 ) -> Result<String, DaggerError> {
2519 let mut query = self.selection.select("publish");
2520 query = query.arg("address", address.into());
2521 if let Some(platform_variants) = opts.platform_variants {
2522 query = query.arg("platformVariants", platform_variants);
2523 }
2524 if let Some(forced_compression) = opts.forced_compression {
2525 query = query.arg("forcedCompression", forced_compression);
2526 }
2527 if let Some(media_types) = opts.media_types {
2528 query = query.arg("mediaTypes", media_types);
2529 }
2530 if let Some(registry_service) = opts.registry_service {
2531 query = query.arg("registryService", registry_service);
2532 }
2533 query.execute(self.graphql_client.clone()).await
2534 }
2535 pub fn rootfs(&self) -> Directory {
2537 let query = self.selection.select("rootfs");
2538 Directory {
2539 proc: self.proc.clone(),
2540 selection: query,
2541 graphql_client: self.graphql_client.clone(),
2542 }
2543 }
2544 pub fn stat(&self, path: impl Into<String>) -> Stat {
2551 let mut query = self.selection.select("stat");
2552 query = query.arg("path", path.into());
2553 Stat {
2554 proc: self.proc.clone(),
2555 selection: query,
2556 graphql_client: self.graphql_client.clone(),
2557 }
2558 }
2559 pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
2566 let mut query = self.selection.select("stat");
2567 query = query.arg("path", path.into());
2568 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2569 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2570 }
2571 Stat {
2572 proc: self.proc.clone(),
2573 selection: query,
2574 graphql_client: self.graphql_client.clone(),
2575 }
2576 }
2577 pub async fn stderr(&self) -> Result<String, DaggerError> {
2580 let query = self.selection.select("stderr");
2581 query.execute(self.graphql_client.clone()).await
2582 }
2583 pub async fn stdout(&self) -> Result<String, DaggerError> {
2586 let query = self.selection.select("stdout");
2587 query.execute(self.graphql_client.clone()).await
2588 }
2589 pub async fn sync(&self) -> Result<Container, DaggerError> {
2592 let query = self.selection.select("sync");
2593 let id: Id = query.execute(self.graphql_client.clone()).await?;
2594 Ok(Container {
2595 proc: self.proc.clone(),
2596 selection: query
2597 .root()
2598 .select("node")
2599 .arg("id", &id.0)
2600 .inline_fragment("Container"),
2601 graphql_client: self.graphql_client.clone(),
2602 })
2603 }
2604 pub fn terminal(&self) -> Container {
2610 let query = self.selection.select("terminal");
2611 Container {
2612 proc: self.proc.clone(),
2613 selection: query,
2614 graphql_client: self.graphql_client.clone(),
2615 }
2616 }
2617 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2623 let mut query = self.selection.select("terminal");
2624 if let Some(cmd) = opts.cmd {
2625 query = query.arg("cmd", cmd);
2626 }
2627 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2628 query = query.arg(
2629 "experimentalPrivilegedNesting",
2630 experimental_privileged_nesting,
2631 );
2632 }
2633 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2634 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2635 }
2636 Container {
2637 proc: self.proc.clone(),
2638 selection: query,
2639 graphql_client: self.graphql_client.clone(),
2640 }
2641 }
2642 pub async fn up(&self) -> Result<Void, DaggerError> {
2649 let query = self.selection.select("up");
2650 query.execute(self.graphql_client.clone()).await
2651 }
2652 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2659 let mut query = self.selection.select("up");
2660 if let Some(random) = opts.random {
2661 query = query.arg("random", random);
2662 }
2663 if let Some(ports) = opts.ports {
2664 query = query.arg("ports", ports);
2665 }
2666 if let Some(args) = opts.args {
2667 query = query.arg("args", args);
2668 }
2669 if let Some(use_entrypoint) = opts.use_entrypoint {
2670 query = query.arg("useEntrypoint", use_entrypoint);
2671 }
2672 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2673 query = query.arg(
2674 "experimentalPrivilegedNesting",
2675 experimental_privileged_nesting,
2676 );
2677 }
2678 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2679 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2680 }
2681 if let Some(expand) = opts.expand {
2682 query = query.arg("expand", expand);
2683 }
2684 if let Some(no_init) = opts.no_init {
2685 query = query.arg("noInit", no_init);
2686 }
2687 query.execute(self.graphql_client.clone()).await
2688 }
2689 pub async fn user(&self) -> Result<String, DaggerError> {
2691 let query = self.selection.select("user");
2692 query.execute(self.graphql_client.clone()).await
2693 }
2694 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2701 let mut query = self.selection.select("withAnnotation");
2702 query = query.arg("name", name.into());
2703 query = query.arg("value", value.into());
2704 Container {
2705 proc: self.proc.clone(),
2706 selection: query,
2707 graphql_client: self.graphql_client.clone(),
2708 }
2709 }
2710 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2716 let mut query = self.selection.select("withDefaultArgs");
2717 query = query.arg(
2718 "args",
2719 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2720 );
2721 Container {
2722 proc: self.proc.clone(),
2723 selection: query,
2724 graphql_client: self.graphql_client.clone(),
2725 }
2726 }
2727 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2734 let mut query = self.selection.select("withDefaultTerminalCmd");
2735 query = query.arg(
2736 "args",
2737 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2738 );
2739 Container {
2740 proc: self.proc.clone(),
2741 selection: query,
2742 graphql_client: self.graphql_client.clone(),
2743 }
2744 }
2745 pub fn with_default_terminal_cmd_opts(
2752 &self,
2753 args: Vec<impl Into<String>>,
2754 opts: ContainerWithDefaultTerminalCmdOpts,
2755 ) -> Container {
2756 let mut query = self.selection.select("withDefaultTerminalCmd");
2757 query = query.arg(
2758 "args",
2759 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2760 );
2761 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2762 query = query.arg(
2763 "experimentalPrivilegedNesting",
2764 experimental_privileged_nesting,
2765 );
2766 }
2767 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2768 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2769 }
2770 Container {
2771 proc: self.proc.clone(),
2772 selection: query,
2773 graphql_client: self.graphql_client.clone(),
2774 }
2775 }
2776 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2784 let mut query = self.selection.select("withDirectory");
2785 query = query.arg("path", path.into());
2786 query = query.arg_lazy(
2787 "source",
2788 Box::new(move || {
2789 let source = source.clone();
2790 Box::pin(async move { source.into_id().await.unwrap().quote() })
2791 }),
2792 );
2793 Container {
2794 proc: self.proc.clone(),
2795 selection: query,
2796 graphql_client: self.graphql_client.clone(),
2797 }
2798 }
2799 pub fn with_directory_opts<'a>(
2807 &self,
2808 path: impl Into<String>,
2809 source: impl IntoID<Id>,
2810 opts: ContainerWithDirectoryOpts<'a>,
2811 ) -> Container {
2812 let mut query = self.selection.select("withDirectory");
2813 query = query.arg("path", path.into());
2814 query = query.arg_lazy(
2815 "source",
2816 Box::new(move || {
2817 let source = source.clone();
2818 Box::pin(async move { source.into_id().await.unwrap().quote() })
2819 }),
2820 );
2821 if let Some(exclude) = opts.exclude {
2822 query = query.arg("exclude", exclude);
2823 }
2824 if let Some(include) = opts.include {
2825 query = query.arg("include", include);
2826 }
2827 if let Some(gitignore) = opts.gitignore {
2828 query = query.arg("gitignore", gitignore);
2829 }
2830 if let Some(owner) = opts.owner {
2831 query = query.arg("owner", owner);
2832 }
2833 if let Some(expand) = opts.expand {
2834 query = query.arg("expand", expand);
2835 }
2836 if let Some(permissions) = opts.permissions {
2837 query = query.arg("permissions", permissions);
2838 }
2839 Container {
2840 proc: self.proc.clone(),
2841 selection: query,
2842 graphql_client: self.graphql_client.clone(),
2843 }
2844 }
2845 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2852 let mut query = self.selection.select("withDockerHealthcheck");
2853 query = query.arg(
2854 "args",
2855 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2856 );
2857 Container {
2858 proc: self.proc.clone(),
2859 selection: query,
2860 graphql_client: self.graphql_client.clone(),
2861 }
2862 }
2863 pub fn with_docker_healthcheck_opts<'a>(
2870 &self,
2871 args: Vec<impl Into<String>>,
2872 opts: ContainerWithDockerHealthcheckOpts<'a>,
2873 ) -> Container {
2874 let mut query = self.selection.select("withDockerHealthcheck");
2875 query = query.arg(
2876 "args",
2877 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2878 );
2879 if let Some(shell) = opts.shell {
2880 query = query.arg("shell", shell);
2881 }
2882 if let Some(interval) = opts.interval {
2883 query = query.arg("interval", interval);
2884 }
2885 if let Some(timeout) = opts.timeout {
2886 query = query.arg("timeout", timeout);
2887 }
2888 if let Some(start_period) = opts.start_period {
2889 query = query.arg("startPeriod", start_period);
2890 }
2891 if let Some(start_interval) = opts.start_interval {
2892 query = query.arg("startInterval", start_interval);
2893 }
2894 if let Some(retries) = opts.retries {
2895 query = query.arg("retries", retries);
2896 }
2897 Container {
2898 proc: self.proc.clone(),
2899 selection: query,
2900 graphql_client: self.graphql_client.clone(),
2901 }
2902 }
2903 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2910 let mut query = self.selection.select("withEntrypoint");
2911 query = query.arg(
2912 "args",
2913 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2914 );
2915 Container {
2916 proc: self.proc.clone(),
2917 selection: query,
2918 graphql_client: self.graphql_client.clone(),
2919 }
2920 }
2921 pub fn with_entrypoint_opts(
2928 &self,
2929 args: Vec<impl Into<String>>,
2930 opts: ContainerWithEntrypointOpts,
2931 ) -> Container {
2932 let mut query = self.selection.select("withEntrypoint");
2933 query = query.arg(
2934 "args",
2935 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2936 );
2937 if let Some(keep_default_args) = opts.keep_default_args {
2938 query = query.arg("keepDefaultArgs", keep_default_args);
2939 }
2940 Container {
2941 proc: self.proc.clone(),
2942 selection: query,
2943 graphql_client: self.graphql_client.clone(),
2944 }
2945 }
2946 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2952 let mut query = self.selection.select("withEnvFileVariables");
2953 query = query.arg_lazy(
2954 "source",
2955 Box::new(move || {
2956 let source = source.clone();
2957 Box::pin(async move { source.into_id().await.unwrap().quote() })
2958 }),
2959 );
2960 Container {
2961 proc: self.proc.clone(),
2962 selection: query,
2963 graphql_client: self.graphql_client.clone(),
2964 }
2965 }
2966 pub fn with_env_variable(
2974 &self,
2975 name: impl Into<String>,
2976 value: impl Into<String>,
2977 ) -> Container {
2978 let mut query = self.selection.select("withEnvVariable");
2979 query = query.arg("name", name.into());
2980 query = query.arg("value", value.into());
2981 Container {
2982 proc: self.proc.clone(),
2983 selection: query,
2984 graphql_client: self.graphql_client.clone(),
2985 }
2986 }
2987 pub fn with_env_variable_opts(
2995 &self,
2996 name: impl Into<String>,
2997 value: impl Into<String>,
2998 opts: ContainerWithEnvVariableOpts,
2999 ) -> Container {
3000 let mut query = self.selection.select("withEnvVariable");
3001 query = query.arg("name", name.into());
3002 query = query.arg("value", value.into());
3003 if let Some(expand) = opts.expand {
3004 query = query.arg("expand", expand);
3005 }
3006 Container {
3007 proc: self.proc.clone(),
3008 selection: query,
3009 graphql_client: self.graphql_client.clone(),
3010 }
3011 }
3012 pub fn with_error(&self, err: impl Into<String>) -> Container {
3018 let mut query = self.selection.select("withError");
3019 query = query.arg("err", err.into());
3020 Container {
3021 proc: self.proc.clone(),
3022 selection: query,
3023 graphql_client: self.graphql_client.clone(),
3024 }
3025 }
3026 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3037 let mut query = self.selection.select("withExec");
3038 query = query.arg(
3039 "args",
3040 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3041 );
3042 Container {
3043 proc: self.proc.clone(),
3044 selection: query,
3045 graphql_client: self.graphql_client.clone(),
3046 }
3047 }
3048 pub fn with_exec_opts<'a>(
3059 &self,
3060 args: Vec<impl Into<String>>,
3061 opts: ContainerWithExecOpts<'a>,
3062 ) -> Container {
3063 let mut query = self.selection.select("withExec");
3064 query = query.arg(
3065 "args",
3066 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3067 );
3068 if let Some(use_entrypoint) = opts.use_entrypoint {
3069 query = query.arg("useEntrypoint", use_entrypoint);
3070 }
3071 if let Some(stdin) = opts.stdin {
3072 query = query.arg("stdin", stdin);
3073 }
3074 if let Some(redirect_stdin) = opts.redirect_stdin {
3075 query = query.arg("redirectStdin", redirect_stdin);
3076 }
3077 if let Some(redirect_stdout) = opts.redirect_stdout {
3078 query = query.arg("redirectStdout", redirect_stdout);
3079 }
3080 if let Some(redirect_stderr) = opts.redirect_stderr {
3081 query = query.arg("redirectStderr", redirect_stderr);
3082 }
3083 if let Some(expect) = opts.expect {
3084 query = query.arg("expect", expect);
3085 }
3086 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3087 query = query.arg(
3088 "experimentalPrivilegedNesting",
3089 experimental_privileged_nesting,
3090 );
3091 }
3092 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3093 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3094 }
3095 if let Some(expand) = opts.expand {
3096 query = query.arg("expand", expand);
3097 }
3098 if let Some(no_init) = opts.no_init {
3099 query = query.arg("noInit", no_init);
3100 }
3101 Container {
3102 proc: self.proc.clone(),
3103 selection: query,
3104 graphql_client: self.graphql_client.clone(),
3105 }
3106 }
3107 pub fn with_exposed_port(&self, port: isize) -> Container {
3117 let mut query = self.selection.select("withExposedPort");
3118 query = query.arg("port", port);
3119 Container {
3120 proc: self.proc.clone(),
3121 selection: query,
3122 graphql_client: self.graphql_client.clone(),
3123 }
3124 }
3125 pub fn with_exposed_port_opts<'a>(
3135 &self,
3136 port: isize,
3137 opts: ContainerWithExposedPortOpts<'a>,
3138 ) -> Container {
3139 let mut query = self.selection.select("withExposedPort");
3140 query = query.arg("port", port);
3141 if let Some(protocol) = opts.protocol {
3142 query = query.arg("protocol", protocol);
3143 }
3144 if let Some(description) = opts.description {
3145 query = query.arg("description", description);
3146 }
3147 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3148 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3149 }
3150 Container {
3151 proc: self.proc.clone(),
3152 selection: query,
3153 graphql_client: self.graphql_client.clone(),
3154 }
3155 }
3156 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3164 let mut query = self.selection.select("withFile");
3165 query = query.arg("path", path.into());
3166 query = query.arg_lazy(
3167 "source",
3168 Box::new(move || {
3169 let source = source.clone();
3170 Box::pin(async move { source.into_id().await.unwrap().quote() })
3171 }),
3172 );
3173 Container {
3174 proc: self.proc.clone(),
3175 selection: query,
3176 graphql_client: self.graphql_client.clone(),
3177 }
3178 }
3179 pub fn with_file_opts<'a>(
3187 &self,
3188 path: impl Into<String>,
3189 source: impl IntoID<Id>,
3190 opts: ContainerWithFileOpts<'a>,
3191 ) -> Container {
3192 let mut query = self.selection.select("withFile");
3193 query = query.arg("path", path.into());
3194 query = query.arg_lazy(
3195 "source",
3196 Box::new(move || {
3197 let source = source.clone();
3198 Box::pin(async move { source.into_id().await.unwrap().quote() })
3199 }),
3200 );
3201 if let Some(permissions) = opts.permissions {
3202 query = query.arg("permissions", permissions);
3203 }
3204 if let Some(owner) = opts.owner {
3205 query = query.arg("owner", owner);
3206 }
3207 if let Some(expand) = opts.expand {
3208 query = query.arg("expand", expand);
3209 }
3210 Container {
3211 proc: self.proc.clone(),
3212 selection: query,
3213 graphql_client: self.graphql_client.clone(),
3214 }
3215 }
3216 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3224 let mut query = self.selection.select("withFiles");
3225 query = query.arg("path", path.into());
3226 query = query.arg("sources", sources);
3227 Container {
3228 proc: self.proc.clone(),
3229 selection: query,
3230 graphql_client: self.graphql_client.clone(),
3231 }
3232 }
3233 pub fn with_files_opts<'a>(
3241 &self,
3242 path: impl Into<String>,
3243 sources: Vec<Id>,
3244 opts: ContainerWithFilesOpts<'a>,
3245 ) -> Container {
3246 let mut query = self.selection.select("withFiles");
3247 query = query.arg("path", path.into());
3248 query = query.arg("sources", sources);
3249 if let Some(permissions) = opts.permissions {
3250 query = query.arg("permissions", permissions);
3251 }
3252 if let Some(owner) = opts.owner {
3253 query = query.arg("owner", owner);
3254 }
3255 if let Some(expand) = opts.expand {
3256 query = query.arg("expand", expand);
3257 }
3258 Container {
3259 proc: self.proc.clone(),
3260 selection: query,
3261 graphql_client: self.graphql_client.clone(),
3262 }
3263 }
3264 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3271 let mut query = self.selection.select("withLabel");
3272 query = query.arg("name", name.into());
3273 query = query.arg("value", value.into());
3274 Container {
3275 proc: self.proc.clone(),
3276 selection: query,
3277 graphql_client: self.graphql_client.clone(),
3278 }
3279 }
3280 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3288 let mut query = self.selection.select("withMountedCache");
3289 query = query.arg("path", path.into());
3290 query = query.arg_lazy(
3291 "cache",
3292 Box::new(move || {
3293 let cache = cache.clone();
3294 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3295 }),
3296 );
3297 Container {
3298 proc: self.proc.clone(),
3299 selection: query,
3300 graphql_client: self.graphql_client.clone(),
3301 }
3302 }
3303 pub fn with_mounted_cache_opts<'a>(
3311 &self,
3312 path: impl Into<String>,
3313 cache: impl IntoID<Id>,
3314 opts: ContainerWithMountedCacheOpts<'a>,
3315 ) -> Container {
3316 let mut query = self.selection.select("withMountedCache");
3317 query = query.arg("path", path.into());
3318 query = query.arg_lazy(
3319 "cache",
3320 Box::new(move || {
3321 let cache = cache.clone();
3322 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3323 }),
3324 );
3325 if let Some(source) = opts.source {
3326 query = query.arg("source", source);
3327 }
3328 if let Some(sharing) = opts.sharing {
3329 query = query.arg("sharing", sharing);
3330 }
3331 if let Some(owner) = opts.owner {
3332 query = query.arg("owner", owner);
3333 }
3334 if let Some(expand) = opts.expand {
3335 query = query.arg("expand", expand);
3336 }
3337 Container {
3338 proc: self.proc.clone(),
3339 selection: query,
3340 graphql_client: self.graphql_client.clone(),
3341 }
3342 }
3343 pub fn with_mounted_directory(
3351 &self,
3352 path: impl Into<String>,
3353 source: impl IntoID<Id>,
3354 ) -> Container {
3355 let mut query = self.selection.select("withMountedDirectory");
3356 query = query.arg("path", path.into());
3357 query = query.arg_lazy(
3358 "source",
3359 Box::new(move || {
3360 let source = source.clone();
3361 Box::pin(async move { source.into_id().await.unwrap().quote() })
3362 }),
3363 );
3364 Container {
3365 proc: self.proc.clone(),
3366 selection: query,
3367 graphql_client: self.graphql_client.clone(),
3368 }
3369 }
3370 pub fn with_mounted_directory_opts<'a>(
3378 &self,
3379 path: impl Into<String>,
3380 source: impl IntoID<Id>,
3381 opts: ContainerWithMountedDirectoryOpts<'a>,
3382 ) -> Container {
3383 let mut query = self.selection.select("withMountedDirectory");
3384 query = query.arg("path", path.into());
3385 query = query.arg_lazy(
3386 "source",
3387 Box::new(move || {
3388 let source = source.clone();
3389 Box::pin(async move { source.into_id().await.unwrap().quote() })
3390 }),
3391 );
3392 if let Some(owner) = opts.owner {
3393 query = query.arg("owner", owner);
3394 }
3395 if let Some(read_only) = opts.read_only {
3396 query = query.arg("readOnly", read_only);
3397 }
3398 if let Some(expand) = opts.expand {
3399 query = query.arg("expand", expand);
3400 }
3401 Container {
3402 proc: self.proc.clone(),
3403 selection: query,
3404 graphql_client: self.graphql_client.clone(),
3405 }
3406 }
3407 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3415 let mut query = self.selection.select("withMountedFile");
3416 query = query.arg("path", path.into());
3417 query = query.arg_lazy(
3418 "source",
3419 Box::new(move || {
3420 let source = source.clone();
3421 Box::pin(async move { source.into_id().await.unwrap().quote() })
3422 }),
3423 );
3424 Container {
3425 proc: self.proc.clone(),
3426 selection: query,
3427 graphql_client: self.graphql_client.clone(),
3428 }
3429 }
3430 pub fn with_mounted_file_opts<'a>(
3438 &self,
3439 path: impl Into<String>,
3440 source: impl IntoID<Id>,
3441 opts: ContainerWithMountedFileOpts<'a>,
3442 ) -> Container {
3443 let mut query = self.selection.select("withMountedFile");
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 if let Some(owner) = opts.owner {
3453 query = query.arg("owner", owner);
3454 }
3455 if let Some(expand) = opts.expand {
3456 query = query.arg("expand", expand);
3457 }
3458 Container {
3459 proc: self.proc.clone(),
3460 selection: query,
3461 graphql_client: self.graphql_client.clone(),
3462 }
3463 }
3464 pub fn with_mounted_secret(
3472 &self,
3473 path: impl Into<String>,
3474 source: impl IntoID<Id>,
3475 ) -> Container {
3476 let mut query = self.selection.select("withMountedSecret");
3477 query = query.arg("path", path.into());
3478 query = query.arg_lazy(
3479 "source",
3480 Box::new(move || {
3481 let source = source.clone();
3482 Box::pin(async move { source.into_id().await.unwrap().quote() })
3483 }),
3484 );
3485 Container {
3486 proc: self.proc.clone(),
3487 selection: query,
3488 graphql_client: self.graphql_client.clone(),
3489 }
3490 }
3491 pub fn with_mounted_secret_opts<'a>(
3499 &self,
3500 path: impl Into<String>,
3501 source: impl IntoID<Id>,
3502 opts: ContainerWithMountedSecretOpts<'a>,
3503 ) -> Container {
3504 let mut query = self.selection.select("withMountedSecret");
3505 query = query.arg("path", path.into());
3506 query = query.arg_lazy(
3507 "source",
3508 Box::new(move || {
3509 let source = source.clone();
3510 Box::pin(async move { source.into_id().await.unwrap().quote() })
3511 }),
3512 );
3513 if let Some(owner) = opts.owner {
3514 query = query.arg("owner", owner);
3515 }
3516 if let Some(mode) = opts.mode {
3517 query = query.arg("mode", mode);
3518 }
3519 if let Some(expand) = opts.expand {
3520 query = query.arg("expand", expand);
3521 }
3522 Container {
3523 proc: self.proc.clone(),
3524 selection: query,
3525 graphql_client: self.graphql_client.clone(),
3526 }
3527 }
3528 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3535 let mut query = self.selection.select("withMountedTemp");
3536 query = query.arg("path", path.into());
3537 Container {
3538 proc: self.proc.clone(),
3539 selection: query,
3540 graphql_client: self.graphql_client.clone(),
3541 }
3542 }
3543 pub fn with_mounted_temp_opts(
3550 &self,
3551 path: impl Into<String>,
3552 opts: ContainerWithMountedTempOpts,
3553 ) -> Container {
3554 let mut query = self.selection.select("withMountedTemp");
3555 query = query.arg("path", path.into());
3556 if let Some(size) = opts.size {
3557 query = query.arg("size", size);
3558 }
3559 if let Some(expand) = opts.expand {
3560 query = query.arg("expand", expand);
3561 }
3562 Container {
3563 proc: self.proc.clone(),
3564 selection: query,
3565 graphql_client: self.graphql_client.clone(),
3566 }
3567 }
3568 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3576 let mut query = self.selection.select("withNewFile");
3577 query = query.arg("path", path.into());
3578 query = query.arg("contents", contents.into());
3579 Container {
3580 proc: self.proc.clone(),
3581 selection: query,
3582 graphql_client: self.graphql_client.clone(),
3583 }
3584 }
3585 pub fn with_new_file_opts<'a>(
3593 &self,
3594 path: impl Into<String>,
3595 contents: impl Into<String>,
3596 opts: ContainerWithNewFileOpts<'a>,
3597 ) -> Container {
3598 let mut query = self.selection.select("withNewFile");
3599 query = query.arg("path", path.into());
3600 query = query.arg("contents", contents.into());
3601 if let Some(permissions) = opts.permissions {
3602 query = query.arg("permissions", permissions);
3603 }
3604 if let Some(owner) = opts.owner {
3605 query = query.arg("owner", owner);
3606 }
3607 if let Some(expand) = opts.expand {
3608 query = query.arg("expand", expand);
3609 }
3610 Container {
3611 proc: self.proc.clone(),
3612 selection: query,
3613 graphql_client: self.graphql_client.clone(),
3614 }
3615 }
3616 pub fn with_registry_auth(
3624 &self,
3625 address: impl Into<String>,
3626 username: impl Into<String>,
3627 secret: impl IntoID<Id>,
3628 ) -> Container {
3629 let mut query = self.selection.select("withRegistryAuth");
3630 query = query.arg("address", address.into());
3631 query = query.arg("username", username.into());
3632 query = query.arg_lazy(
3633 "secret",
3634 Box::new(move || {
3635 let secret = secret.clone();
3636 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3637 }),
3638 );
3639 Container {
3640 proc: self.proc.clone(),
3641 selection: query,
3642 graphql_client: self.graphql_client.clone(),
3643 }
3644 }
3645 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3651 let mut query = self.selection.select("withRootfs");
3652 query = query.arg_lazy(
3653 "directory",
3654 Box::new(move || {
3655 let directory = directory.clone();
3656 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3657 }),
3658 );
3659 Container {
3660 proc: self.proc.clone(),
3661 selection: query,
3662 graphql_client: self.graphql_client.clone(),
3663 }
3664 }
3665 pub fn with_secret_variable(
3672 &self,
3673 name: impl Into<String>,
3674 secret: impl IntoID<Id>,
3675 ) -> Container {
3676 let mut query = self.selection.select("withSecretVariable");
3677 query = query.arg("name", name.into());
3678 query = query.arg_lazy(
3679 "secret",
3680 Box::new(move || {
3681 let secret = secret.clone();
3682 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3683 }),
3684 );
3685 Container {
3686 proc: self.proc.clone(),
3687 selection: query,
3688 graphql_client: self.graphql_client.clone(),
3689 }
3690 }
3691 pub fn with_service_binding(
3701 &self,
3702 alias: impl Into<String>,
3703 service: impl IntoID<Id>,
3704 ) -> Container {
3705 let mut query = self.selection.select("withServiceBinding");
3706 query = query.arg("alias", alias.into());
3707 query = query.arg_lazy(
3708 "service",
3709 Box::new(move || {
3710 let service = service.clone();
3711 Box::pin(async move { service.into_id().await.unwrap().quote() })
3712 }),
3713 );
3714 Container {
3715 proc: self.proc.clone(),
3716 selection: query,
3717 graphql_client: self.graphql_client.clone(),
3718 }
3719 }
3720 pub fn with_symlink(
3728 &self,
3729 target: impl Into<String>,
3730 link_name: impl Into<String>,
3731 ) -> Container {
3732 let mut query = self.selection.select("withSymlink");
3733 query = query.arg("target", target.into());
3734 query = query.arg("linkName", link_name.into());
3735 Container {
3736 proc: self.proc.clone(),
3737 selection: query,
3738 graphql_client: self.graphql_client.clone(),
3739 }
3740 }
3741 pub fn with_symlink_opts(
3749 &self,
3750 target: impl Into<String>,
3751 link_name: impl Into<String>,
3752 opts: ContainerWithSymlinkOpts,
3753 ) -> Container {
3754 let mut query = self.selection.select("withSymlink");
3755 query = query.arg("target", target.into());
3756 query = query.arg("linkName", link_name.into());
3757 if let Some(expand) = opts.expand {
3758 query = query.arg("expand", expand);
3759 }
3760 Container {
3761 proc: self.proc.clone(),
3762 selection: query,
3763 graphql_client: self.graphql_client.clone(),
3764 }
3765 }
3766 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3774 let mut query = self.selection.select("withUnixSocket");
3775 query = query.arg("path", path.into());
3776 query = query.arg_lazy(
3777 "source",
3778 Box::new(move || {
3779 let source = source.clone();
3780 Box::pin(async move { source.into_id().await.unwrap().quote() })
3781 }),
3782 );
3783 Container {
3784 proc: self.proc.clone(),
3785 selection: query,
3786 graphql_client: self.graphql_client.clone(),
3787 }
3788 }
3789 pub fn with_unix_socket_opts<'a>(
3797 &self,
3798 path: impl Into<String>,
3799 source: impl IntoID<Id>,
3800 opts: ContainerWithUnixSocketOpts<'a>,
3801 ) -> Container {
3802 let mut query = self.selection.select("withUnixSocket");
3803 query = query.arg("path", path.into());
3804 query = query.arg_lazy(
3805 "source",
3806 Box::new(move || {
3807 let source = source.clone();
3808 Box::pin(async move { source.into_id().await.unwrap().quote() })
3809 }),
3810 );
3811 if let Some(owner) = opts.owner {
3812 query = query.arg("owner", owner);
3813 }
3814 if let Some(expand) = opts.expand {
3815 query = query.arg("expand", expand);
3816 }
3817 Container {
3818 proc: self.proc.clone(),
3819 selection: query,
3820 graphql_client: self.graphql_client.clone(),
3821 }
3822 }
3823 pub fn with_user(&self, name: impl Into<String>) -> Container {
3829 let mut query = self.selection.select("withUser");
3830 query = query.arg("name", name.into());
3831 Container {
3832 proc: self.proc.clone(),
3833 selection: query,
3834 graphql_client: self.graphql_client.clone(),
3835 }
3836 }
3837 pub fn with_volatile_variable(
3845 &self,
3846 name: impl Into<String>,
3847 value: impl Into<String>,
3848 ) -> Container {
3849 let mut query = self.selection.select("withVolatileVariable");
3850 query = query.arg("name", name.into());
3851 query = query.arg("value", value.into());
3852 Container {
3853 proc: self.proc.clone(),
3854 selection: query,
3855 graphql_client: self.graphql_client.clone(),
3856 }
3857 }
3858 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3865 let mut query = self.selection.select("withWorkdir");
3866 query = query.arg("path", path.into());
3867 Container {
3868 proc: self.proc.clone(),
3869 selection: query,
3870 graphql_client: self.graphql_client.clone(),
3871 }
3872 }
3873 pub fn with_workdir_opts(
3880 &self,
3881 path: impl Into<String>,
3882 opts: ContainerWithWorkdirOpts,
3883 ) -> Container {
3884 let mut query = self.selection.select("withWorkdir");
3885 query = query.arg("path", path.into());
3886 if let Some(expand) = opts.expand {
3887 query = query.arg("expand", expand);
3888 }
3889 Container {
3890 proc: self.proc.clone(),
3891 selection: query,
3892 graphql_client: self.graphql_client.clone(),
3893 }
3894 }
3895 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3901 let mut query = self.selection.select("withoutAnnotation");
3902 query = query.arg("name", name.into());
3903 Container {
3904 proc: self.proc.clone(),
3905 selection: query,
3906 graphql_client: self.graphql_client.clone(),
3907 }
3908 }
3909 pub fn without_default_args(&self) -> Container {
3911 let query = self.selection.select("withoutDefaultArgs");
3912 Container {
3913 proc: self.proc.clone(),
3914 selection: query,
3915 graphql_client: self.graphql_client.clone(),
3916 }
3917 }
3918 pub fn without_directory(&self, path: impl Into<String>) -> Container {
3925 let mut query = self.selection.select("withoutDirectory");
3926 query = query.arg("path", path.into());
3927 Container {
3928 proc: self.proc.clone(),
3929 selection: query,
3930 graphql_client: self.graphql_client.clone(),
3931 }
3932 }
3933 pub fn without_directory_opts(
3940 &self,
3941 path: impl Into<String>,
3942 opts: ContainerWithoutDirectoryOpts,
3943 ) -> Container {
3944 let mut query = self.selection.select("withoutDirectory");
3945 query = query.arg("path", path.into());
3946 if let Some(expand) = opts.expand {
3947 query = query.arg("expand", expand);
3948 }
3949 Container {
3950 proc: self.proc.clone(),
3951 selection: query,
3952 graphql_client: self.graphql_client.clone(),
3953 }
3954 }
3955 pub fn without_docker_healthcheck(&self) -> Container {
3957 let query = self.selection.select("withoutDockerHealthcheck");
3958 Container {
3959 proc: self.proc.clone(),
3960 selection: query,
3961 graphql_client: self.graphql_client.clone(),
3962 }
3963 }
3964 pub fn without_entrypoint(&self) -> Container {
3970 let query = self.selection.select("withoutEntrypoint");
3971 Container {
3972 proc: self.proc.clone(),
3973 selection: query,
3974 graphql_client: self.graphql_client.clone(),
3975 }
3976 }
3977 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3983 let mut query = self.selection.select("withoutEntrypoint");
3984 if let Some(keep_default_args) = opts.keep_default_args {
3985 query = query.arg("keepDefaultArgs", keep_default_args);
3986 }
3987 Container {
3988 proc: self.proc.clone(),
3989 selection: query,
3990 graphql_client: self.graphql_client.clone(),
3991 }
3992 }
3993 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3999 let mut query = self.selection.select("withoutEnvVariable");
4000 query = query.arg("name", name.into());
4001 Container {
4002 proc: self.proc.clone(),
4003 selection: query,
4004 graphql_client: self.graphql_client.clone(),
4005 }
4006 }
4007 pub fn without_exposed_port(&self, port: isize) -> Container {
4014 let mut query = self.selection.select("withoutExposedPort");
4015 query = query.arg("port", port);
4016 Container {
4017 proc: self.proc.clone(),
4018 selection: query,
4019 graphql_client: self.graphql_client.clone(),
4020 }
4021 }
4022 pub fn without_exposed_port_opts(
4029 &self,
4030 port: isize,
4031 opts: ContainerWithoutExposedPortOpts,
4032 ) -> Container {
4033 let mut query = self.selection.select("withoutExposedPort");
4034 query = query.arg("port", port);
4035 if let Some(protocol) = opts.protocol {
4036 query = query.arg("protocol", protocol);
4037 }
4038 Container {
4039 proc: self.proc.clone(),
4040 selection: query,
4041 graphql_client: self.graphql_client.clone(),
4042 }
4043 }
4044 pub fn without_file(&self, path: impl Into<String>) -> Container {
4051 let mut query = self.selection.select("withoutFile");
4052 query = query.arg("path", path.into());
4053 Container {
4054 proc: self.proc.clone(),
4055 selection: query,
4056 graphql_client: self.graphql_client.clone(),
4057 }
4058 }
4059 pub fn without_file_opts(
4066 &self,
4067 path: impl Into<String>,
4068 opts: ContainerWithoutFileOpts,
4069 ) -> Container {
4070 let mut query = self.selection.select("withoutFile");
4071 query = query.arg("path", path.into());
4072 if let Some(expand) = opts.expand {
4073 query = query.arg("expand", expand);
4074 }
4075 Container {
4076 proc: self.proc.clone(),
4077 selection: query,
4078 graphql_client: self.graphql_client.clone(),
4079 }
4080 }
4081 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4088 let mut query = self.selection.select("withoutFiles");
4089 query = query.arg(
4090 "paths",
4091 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4092 );
4093 Container {
4094 proc: self.proc.clone(),
4095 selection: query,
4096 graphql_client: self.graphql_client.clone(),
4097 }
4098 }
4099 pub fn without_files_opts(
4106 &self,
4107 paths: Vec<impl Into<String>>,
4108 opts: ContainerWithoutFilesOpts,
4109 ) -> Container {
4110 let mut query = self.selection.select("withoutFiles");
4111 query = query.arg(
4112 "paths",
4113 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4114 );
4115 if let Some(expand) = opts.expand {
4116 query = query.arg("expand", expand);
4117 }
4118 Container {
4119 proc: self.proc.clone(),
4120 selection: query,
4121 graphql_client: self.graphql_client.clone(),
4122 }
4123 }
4124 pub fn without_label(&self, name: impl Into<String>) -> Container {
4130 let mut query = self.selection.select("withoutLabel");
4131 query = query.arg("name", name.into());
4132 Container {
4133 proc: self.proc.clone(),
4134 selection: query,
4135 graphql_client: self.graphql_client.clone(),
4136 }
4137 }
4138 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4145 let mut query = self.selection.select("withoutMount");
4146 query = query.arg("path", path.into());
4147 Container {
4148 proc: self.proc.clone(),
4149 selection: query,
4150 graphql_client: self.graphql_client.clone(),
4151 }
4152 }
4153 pub fn without_mount_opts(
4160 &self,
4161 path: impl Into<String>,
4162 opts: ContainerWithoutMountOpts,
4163 ) -> Container {
4164 let mut query = self.selection.select("withoutMount");
4165 query = query.arg("path", path.into());
4166 if let Some(expand) = opts.expand {
4167 query = query.arg("expand", expand);
4168 }
4169 Container {
4170 proc: self.proc.clone(),
4171 selection: query,
4172 graphql_client: self.graphql_client.clone(),
4173 }
4174 }
4175 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4183 let mut query = self.selection.select("withoutRegistryAuth");
4184 query = query.arg("address", address.into());
4185 Container {
4186 proc: self.proc.clone(),
4187 selection: query,
4188 graphql_client: self.graphql_client.clone(),
4189 }
4190 }
4191 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4197 let mut query = self.selection.select("withoutSecretVariable");
4198 query = query.arg("name", name.into());
4199 Container {
4200 proc: self.proc.clone(),
4201 selection: query,
4202 graphql_client: self.graphql_client.clone(),
4203 }
4204 }
4205 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4212 let mut query = self.selection.select("withoutUnixSocket");
4213 query = query.arg("path", path.into());
4214 Container {
4215 proc: self.proc.clone(),
4216 selection: query,
4217 graphql_client: self.graphql_client.clone(),
4218 }
4219 }
4220 pub fn without_unix_socket_opts(
4227 &self,
4228 path: impl Into<String>,
4229 opts: ContainerWithoutUnixSocketOpts,
4230 ) -> Container {
4231 let mut query = self.selection.select("withoutUnixSocket");
4232 query = query.arg("path", path.into());
4233 if let Some(expand) = opts.expand {
4234 query = query.arg("expand", expand);
4235 }
4236 Container {
4237 proc: self.proc.clone(),
4238 selection: query,
4239 graphql_client: self.graphql_client.clone(),
4240 }
4241 }
4242 pub fn without_user(&self) -> Container {
4245 let query = self.selection.select("withoutUser");
4246 Container {
4247 proc: self.proc.clone(),
4248 selection: query,
4249 graphql_client: self.graphql_client.clone(),
4250 }
4251 }
4252 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4258 let mut query = self.selection.select("withoutVolatileVariable");
4259 query = query.arg("name", name.into());
4260 Container {
4261 proc: self.proc.clone(),
4262 selection: query,
4263 graphql_client: self.graphql_client.clone(),
4264 }
4265 }
4266 pub fn without_workdir(&self) -> Container {
4269 let query = self.selection.select("withoutWorkdir");
4270 Container {
4271 proc: self.proc.clone(),
4272 selection: query,
4273 graphql_client: self.graphql_client.clone(),
4274 }
4275 }
4276 pub async fn workdir(&self) -> Result<String, DaggerError> {
4278 let query = self.selection.select("workdir");
4279 query.execute(self.graphql_client.clone()).await
4280 }
4281}
4282impl Exportable for Container {
4283 fn export(
4284 &self,
4285 path: impl Into<String>,
4286 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4287 let mut query = self.selection.select("export");
4288 query = query.arg("path", path.into());
4289 let graphql_client = self.graphql_client.clone();
4290 async move { query.execute(graphql_client).await }
4291 }
4292 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4293 let query = self.selection.select("id");
4294 let graphql_client = self.graphql_client.clone();
4295 async move { query.execute(graphql_client).await }
4296 }
4297}
4298impl Node for Container {
4299 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4300 let query = self.selection.select("id");
4301 let graphql_client = self.graphql_client.clone();
4302 async move { query.execute(graphql_client).await }
4303 }
4304}
4305impl Syncer for Container {
4306 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4307 let query = self.selection.select("id");
4308 let graphql_client = self.graphql_client.clone();
4309 async move { query.execute(graphql_client).await }
4310 }
4311 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4312 let query = self.selection.select("sync");
4313 let graphql_client = self.graphql_client.clone();
4314 async move { query.execute(graphql_client).await }
4315 }
4316}
4317#[derive(Clone)]
4318pub struct CurrentModule {
4319 pub proc: Option<Arc<DaggerSessionProc>>,
4320 pub selection: Selection,
4321 pub graphql_client: DynGraphQLClient,
4322}
4323#[derive(Builder, Debug, PartialEq)]
4324pub struct CurrentModuleGeneratorsOpts<'a> {
4325 #[builder(setter(into, strip_option), default)]
4327 pub include: Option<Vec<&'a str>>,
4328}
4329#[derive(Builder, Debug, PartialEq)]
4330pub struct CurrentModuleWorkdirOpts<'a> {
4331 #[builder(setter(into, strip_option), default)]
4333 pub exclude: Option<Vec<&'a str>>,
4334 #[builder(setter(into, strip_option), default)]
4336 pub gitignore: Option<bool>,
4337 #[builder(setter(into, strip_option), default)]
4339 pub include: Option<Vec<&'a str>>,
4340}
4341impl IntoID<Id> for CurrentModule {
4342 fn into_id(
4343 self,
4344 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4345 Box::pin(async move { self.id().await })
4346 }
4347}
4348impl Loadable for CurrentModule {
4349 fn graphql_type() -> &'static str {
4350 "CurrentModule"
4351 }
4352 fn from_query(
4353 proc: Option<Arc<DaggerSessionProc>>,
4354 selection: Selection,
4355 graphql_client: DynGraphQLClient,
4356 ) -> Self {
4357 Self {
4358 proc,
4359 selection,
4360 graphql_client,
4361 }
4362 }
4363}
4364impl CurrentModule {
4365 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4367 let query = self.selection.select("dependencies");
4368 let query = query.select("id");
4369 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4370 Ok(ids
4371 .into_iter()
4372 .map(|id| Module {
4373 proc: self.proc.clone(),
4374 selection: crate::querybuilder::query()
4375 .select("node")
4376 .arg("id", &id.0)
4377 .inline_fragment("Module"),
4378 graphql_client: self.graphql_client.clone(),
4379 })
4380 .collect())
4381 }
4382 pub fn generated_context_directory(&self) -> Directory {
4384 let query = self.selection.select("generatedContextDirectory");
4385 Directory {
4386 proc: self.proc.clone(),
4387 selection: query,
4388 graphql_client: self.graphql_client.clone(),
4389 }
4390 }
4391 pub fn generators(&self) -> GeneratorGroup {
4397 let query = self.selection.select("generators");
4398 GeneratorGroup {
4399 proc: self.proc.clone(),
4400 selection: query,
4401 graphql_client: self.graphql_client.clone(),
4402 }
4403 }
4404 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4410 let mut query = self.selection.select("generators");
4411 if let Some(include) = opts.include {
4412 query = query.arg("include", include);
4413 }
4414 GeneratorGroup {
4415 proc: self.proc.clone(),
4416 selection: query,
4417 graphql_client: self.graphql_client.clone(),
4418 }
4419 }
4420 pub async fn id(&self) -> Result<Id, DaggerError> {
4422 let query = self.selection.select("id");
4423 query.execute(self.graphql_client.clone()).await
4424 }
4425 pub async fn name(&self) -> Result<String, DaggerError> {
4427 let query = self.selection.select("name");
4428 query.execute(self.graphql_client.clone()).await
4429 }
4430 pub fn source(&self) -> Directory {
4432 let query = self.selection.select("source");
4433 Directory {
4434 proc: self.proc.clone(),
4435 selection: query,
4436 graphql_client: self.graphql_client.clone(),
4437 }
4438 }
4439 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4446 let mut query = self.selection.select("workdir");
4447 query = query.arg("path", path.into());
4448 Directory {
4449 proc: self.proc.clone(),
4450 selection: query,
4451 graphql_client: self.graphql_client.clone(),
4452 }
4453 }
4454 pub fn workdir_opts<'a>(
4461 &self,
4462 path: impl Into<String>,
4463 opts: CurrentModuleWorkdirOpts<'a>,
4464 ) -> Directory {
4465 let mut query = self.selection.select("workdir");
4466 query = query.arg("path", path.into());
4467 if let Some(exclude) = opts.exclude {
4468 query = query.arg("exclude", exclude);
4469 }
4470 if let Some(include) = opts.include {
4471 query = query.arg("include", include);
4472 }
4473 if let Some(gitignore) = opts.gitignore {
4474 query = query.arg("gitignore", gitignore);
4475 }
4476 Directory {
4477 proc: self.proc.clone(),
4478 selection: query,
4479 graphql_client: self.graphql_client.clone(),
4480 }
4481 }
4482 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4488 let mut query = self.selection.select("workdirFile");
4489 query = query.arg("path", path.into());
4490 File {
4491 proc: self.proc.clone(),
4492 selection: query,
4493 graphql_client: self.graphql_client.clone(),
4494 }
4495 }
4496}
4497impl Node for CurrentModule {
4498 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4499 let query = self.selection.select("id");
4500 let graphql_client = self.graphql_client.clone();
4501 async move { query.execute(graphql_client).await }
4502 }
4503}
4504#[derive(Clone)]
4505pub struct DiffStat {
4506 pub proc: Option<Arc<DaggerSessionProc>>,
4507 pub selection: Selection,
4508 pub graphql_client: DynGraphQLClient,
4509}
4510impl IntoID<Id> for DiffStat {
4511 fn into_id(
4512 self,
4513 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4514 Box::pin(async move { self.id().await })
4515 }
4516}
4517impl Loadable for DiffStat {
4518 fn graphql_type() -> &'static str {
4519 "DiffStat"
4520 }
4521 fn from_query(
4522 proc: Option<Arc<DaggerSessionProc>>,
4523 selection: Selection,
4524 graphql_client: DynGraphQLClient,
4525 ) -> Self {
4526 Self {
4527 proc,
4528 selection,
4529 graphql_client,
4530 }
4531 }
4532}
4533impl DiffStat {
4534 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4536 let query = self.selection.select("addedLines");
4537 query.execute(self.graphql_client.clone()).await
4538 }
4539 pub async fn id(&self) -> Result<Id, DaggerError> {
4541 let query = self.selection.select("id");
4542 query.execute(self.graphql_client.clone()).await
4543 }
4544 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4546 let query = self.selection.select("kind");
4547 query.execute(self.graphql_client.clone()).await
4548 }
4549 pub async fn old_path(&self) -> Result<String, DaggerError> {
4551 let query = self.selection.select("oldPath");
4552 query.execute(self.graphql_client.clone()).await
4553 }
4554 pub async fn path(&self) -> Result<String, DaggerError> {
4556 let query = self.selection.select("path");
4557 query.execute(self.graphql_client.clone()).await
4558 }
4559 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4561 let query = self.selection.select("removedLines");
4562 query.execute(self.graphql_client.clone()).await
4563 }
4564}
4565impl Node for DiffStat {
4566 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4567 let query = self.selection.select("id");
4568 let graphql_client = self.graphql_client.clone();
4569 async move { query.execute(graphql_client).await }
4570 }
4571}
4572#[derive(Clone)]
4573pub struct Directory {
4574 pub proc: Option<Arc<DaggerSessionProc>>,
4575 pub selection: Selection,
4576 pub graphql_client: DynGraphQLClient,
4577}
4578#[derive(Builder, Debug, PartialEq)]
4579pub struct DirectoryAsModuleOpts<'a> {
4580 #[builder(setter(into, strip_option), default)]
4583 pub source_root_path: Option<&'a str>,
4584}
4585#[derive(Builder, Debug, PartialEq)]
4586pub struct DirectoryAsModuleSourceOpts<'a> {
4587 #[builder(setter(into, strip_option), default)]
4590 pub source_root_path: Option<&'a str>,
4591}
4592#[derive(Builder, Debug, PartialEq)]
4593pub struct DirectoryDockerBuildOpts<'a> {
4594 #[builder(setter(into, strip_option), default)]
4596 pub build_args: Option<Vec<BuildArg>>,
4597 #[builder(setter(into, strip_option), default)]
4599 pub dockerfile: Option<&'a str>,
4600 #[builder(setter(into, strip_option), default)]
4603 pub no_init: Option<bool>,
4604 #[builder(setter(into, strip_option), default)]
4606 pub platform: Option<Platform>,
4607 #[builder(setter(into, strip_option), default)]
4610 pub secrets: Option<Vec<Id>>,
4611 #[builder(setter(into, strip_option), default)]
4615 pub ssh: Option<Id>,
4616 #[builder(setter(into, strip_option), default)]
4618 pub target: Option<&'a str>,
4619}
4620#[derive(Builder, Debug, PartialEq)]
4621pub struct DirectoryEntriesOpts<'a> {
4622 #[builder(setter(into, strip_option), default)]
4624 pub path: Option<&'a str>,
4625}
4626#[derive(Builder, Debug, PartialEq)]
4627pub struct DirectoryExistsOpts {
4628 #[builder(setter(into, strip_option), default)]
4630 pub do_not_follow_symlinks: Option<bool>,
4631 #[builder(setter(into, strip_option), default)]
4633 pub expected_type: Option<ExistsType>,
4634}
4635#[derive(Builder, Debug, PartialEq)]
4636pub struct DirectoryExportOpts {
4637 #[builder(setter(into, strip_option), default)]
4639 pub wipe: Option<bool>,
4640}
4641#[derive(Builder, Debug, PartialEq)]
4642pub struct DirectoryFilterOpts<'a> {
4643 #[builder(setter(into, strip_option), default)]
4645 pub exclude: Option<Vec<&'a str>>,
4646 #[builder(setter(into, strip_option), default)]
4648 pub gitignore: Option<bool>,
4649 #[builder(setter(into, strip_option), default)]
4651 pub include: Option<Vec<&'a str>>,
4652}
4653#[derive(Builder, Debug, PartialEq)]
4654pub struct DirectorySearchOpts<'a> {
4655 #[builder(setter(into, strip_option), default)]
4657 pub dotall: Option<bool>,
4658 #[builder(setter(into, strip_option), default)]
4660 pub files_only: Option<bool>,
4661 #[builder(setter(into, strip_option), default)]
4663 pub globs: Option<Vec<&'a str>>,
4664 #[builder(setter(into, strip_option), default)]
4666 pub insensitive: Option<bool>,
4667 #[builder(setter(into, strip_option), default)]
4669 pub limit: Option<isize>,
4670 #[builder(setter(into, strip_option), default)]
4672 pub literal: Option<bool>,
4673 #[builder(setter(into, strip_option), default)]
4675 pub multiline: Option<bool>,
4676 #[builder(setter(into, strip_option), default)]
4678 pub paths: Option<Vec<&'a str>>,
4679 #[builder(setter(into, strip_option), default)]
4681 pub skip_hidden: Option<bool>,
4682 #[builder(setter(into, strip_option), default)]
4684 pub skip_ignored: Option<bool>,
4685}
4686#[derive(Builder, Debug, PartialEq)]
4687pub struct DirectoryStatOpts {
4688 #[builder(setter(into, strip_option), default)]
4690 pub do_not_follow_symlinks: Option<bool>,
4691}
4692#[derive(Builder, Debug, PartialEq)]
4693pub struct DirectoryTerminalOpts<'a> {
4694 #[builder(setter(into, strip_option), default)]
4696 pub cmd: Option<Vec<&'a str>>,
4697 #[builder(setter(into, strip_option), default)]
4699 pub container: Option<Id>,
4700 #[builder(setter(into, strip_option), default)]
4702 pub experimental_privileged_nesting: Option<bool>,
4703 #[builder(setter(into, strip_option), default)]
4705 pub insecure_root_capabilities: Option<bool>,
4706}
4707#[derive(Builder, Debug, PartialEq)]
4708pub struct DirectoryWithDirectoryOpts<'a> {
4709 #[builder(setter(into, strip_option), default)]
4711 pub exclude: Option<Vec<&'a str>>,
4712 #[builder(setter(into, strip_option), default)]
4714 pub gitignore: Option<bool>,
4715 #[builder(setter(into, strip_option), default)]
4717 pub include: Option<Vec<&'a str>>,
4718 #[builder(setter(into, strip_option), default)]
4722 pub owner: Option<&'a str>,
4723 #[builder(setter(into, strip_option), default)]
4725 pub permissions: Option<isize>,
4726}
4727#[derive(Builder, Debug, PartialEq)]
4728pub struct DirectoryWithFileOpts<'a> {
4729 #[builder(setter(into, strip_option), default)]
4733 pub owner: Option<&'a str>,
4734 #[builder(setter(into, strip_option), default)]
4736 pub permissions: Option<isize>,
4737}
4738#[derive(Builder, Debug, PartialEq)]
4739pub struct DirectoryWithFilesOpts {
4740 #[builder(setter(into, strip_option), default)]
4742 pub permissions: Option<isize>,
4743}
4744#[derive(Builder, Debug, PartialEq)]
4745pub struct DirectoryWithNewDirectoryOpts {
4746 #[builder(setter(into, strip_option), default)]
4748 pub permissions: Option<isize>,
4749}
4750#[derive(Builder, Debug, PartialEq)]
4751pub struct DirectoryWithNewFileOpts {
4752 #[builder(setter(into, strip_option), default)]
4754 pub permissions: Option<isize>,
4755}
4756impl IntoID<Id> for Directory {
4757 fn into_id(
4758 self,
4759 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4760 Box::pin(async move { self.id().await })
4761 }
4762}
4763impl Loadable for Directory {
4764 fn graphql_type() -> &'static str {
4765 "Directory"
4766 }
4767 fn from_query(
4768 proc: Option<Arc<DaggerSessionProc>>,
4769 selection: Selection,
4770 graphql_client: DynGraphQLClient,
4771 ) -> Self {
4772 Self {
4773 proc,
4774 selection,
4775 graphql_client,
4776 }
4777 }
4778}
4779impl Directory {
4780 pub fn as_git(&self) -> GitRepository {
4782 let query = self.selection.select("asGit");
4783 GitRepository {
4784 proc: self.proc.clone(),
4785 selection: query,
4786 graphql_client: self.graphql_client.clone(),
4787 }
4788 }
4789 pub fn as_module(&self) -> Module {
4795 let query = self.selection.select("asModule");
4796 Module {
4797 proc: self.proc.clone(),
4798 selection: query,
4799 graphql_client: self.graphql_client.clone(),
4800 }
4801 }
4802 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4808 let mut query = self.selection.select("asModule");
4809 if let Some(source_root_path) = opts.source_root_path {
4810 query = query.arg("sourceRootPath", source_root_path);
4811 }
4812 Module {
4813 proc: self.proc.clone(),
4814 selection: query,
4815 graphql_client: self.graphql_client.clone(),
4816 }
4817 }
4818 pub fn as_module_source(&self) -> ModuleSource {
4824 let query = self.selection.select("asModuleSource");
4825 ModuleSource {
4826 proc: self.proc.clone(),
4827 selection: query,
4828 graphql_client: self.graphql_client.clone(),
4829 }
4830 }
4831 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4837 let mut query = self.selection.select("asModuleSource");
4838 if let Some(source_root_path) = opts.source_root_path {
4839 query = query.arg("sourceRootPath", source_root_path);
4840 }
4841 ModuleSource {
4842 proc: self.proc.clone(),
4843 selection: query,
4844 graphql_client: self.graphql_client.clone(),
4845 }
4846 }
4847 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4854 let mut query = self.selection.select("changes");
4855 query = query.arg_lazy(
4856 "from",
4857 Box::new(move || {
4858 let from = from.clone();
4859 Box::pin(async move { from.into_id().await.unwrap().quote() })
4860 }),
4861 );
4862 Changeset {
4863 proc: self.proc.clone(),
4864 selection: query,
4865 graphql_client: self.graphql_client.clone(),
4866 }
4867 }
4868 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4879 let mut query = self.selection.select("chown");
4880 query = query.arg("path", path.into());
4881 query = query.arg("owner", owner.into());
4882 Directory {
4883 proc: self.proc.clone(),
4884 selection: query,
4885 graphql_client: self.graphql_client.clone(),
4886 }
4887 }
4888 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4894 let mut query = self.selection.select("diff");
4895 query = query.arg_lazy(
4896 "other",
4897 Box::new(move || {
4898 let other = other.clone();
4899 Box::pin(async move { other.into_id().await.unwrap().quote() })
4900 }),
4901 );
4902 Directory {
4903 proc: self.proc.clone(),
4904 selection: query,
4905 graphql_client: self.graphql_client.clone(),
4906 }
4907 }
4908 pub async fn digest(&self) -> Result<String, DaggerError> {
4910 let query = self.selection.select("digest");
4911 query.execute(self.graphql_client.clone()).await
4912 }
4913 pub fn directory(&self, path: impl Into<String>) -> Directory {
4919 let mut query = self.selection.select("directory");
4920 query = query.arg("path", path.into());
4921 Directory {
4922 proc: self.proc.clone(),
4923 selection: query,
4924 graphql_client: self.graphql_client.clone(),
4925 }
4926 }
4927 pub fn docker_build(&self) -> Container {
4933 let query = self.selection.select("dockerBuild");
4934 Container {
4935 proc: self.proc.clone(),
4936 selection: query,
4937 graphql_client: self.graphql_client.clone(),
4938 }
4939 }
4940 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4946 let mut query = self.selection.select("dockerBuild");
4947 if let Some(dockerfile) = opts.dockerfile {
4948 query = query.arg("dockerfile", dockerfile);
4949 }
4950 if let Some(platform) = opts.platform {
4951 query = query.arg("platform", platform);
4952 }
4953 if let Some(build_args) = opts.build_args {
4954 query = query.arg("buildArgs", build_args);
4955 }
4956 if let Some(target) = opts.target {
4957 query = query.arg("target", target);
4958 }
4959 if let Some(secrets) = opts.secrets {
4960 query = query.arg("secrets", secrets);
4961 }
4962 if let Some(no_init) = opts.no_init {
4963 query = query.arg("noInit", no_init);
4964 }
4965 if let Some(ssh) = opts.ssh {
4966 query = query.arg("ssh", ssh);
4967 }
4968 Container {
4969 proc: self.proc.clone(),
4970 selection: query,
4971 graphql_client: self.graphql_client.clone(),
4972 }
4973 }
4974 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4980 let query = self.selection.select("entries");
4981 query.execute(self.graphql_client.clone()).await
4982 }
4983 pub async fn entries_opts<'a>(
4989 &self,
4990 opts: DirectoryEntriesOpts<'a>,
4991 ) -> Result<Vec<String>, DaggerError> {
4992 let mut query = self.selection.select("entries");
4993 if let Some(path) = opts.path {
4994 query = query.arg("path", path);
4995 }
4996 query.execute(self.graphql_client.clone()).await
4997 }
4998 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5005 let mut query = self.selection.select("exists");
5006 query = query.arg("path", path.into());
5007 query.execute(self.graphql_client.clone()).await
5008 }
5009 pub async fn exists_opts(
5016 &self,
5017 path: impl Into<String>,
5018 opts: DirectoryExistsOpts,
5019 ) -> Result<bool, DaggerError> {
5020 let mut query = self.selection.select("exists");
5021 query = query.arg("path", path.into());
5022 if let Some(expected_type) = opts.expected_type {
5023 query = query.arg("expectedType", expected_type);
5024 }
5025 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5026 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5027 }
5028 query.execute(self.graphql_client.clone()).await
5029 }
5030 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5037 let mut query = self.selection.select("export");
5038 query = query.arg("path", path.into());
5039 query.execute(self.graphql_client.clone()).await
5040 }
5041 pub async fn export_opts(
5048 &self,
5049 path: impl Into<String>,
5050 opts: DirectoryExportOpts,
5051 ) -> Result<String, DaggerError> {
5052 let mut query = self.selection.select("export");
5053 query = query.arg("path", path.into());
5054 if let Some(wipe) = opts.wipe {
5055 query = query.arg("wipe", wipe);
5056 }
5057 query.execute(self.graphql_client.clone()).await
5058 }
5059 pub fn file(&self, path: impl Into<String>) -> File {
5065 let mut query = self.selection.select("file");
5066 query = query.arg("path", path.into());
5067 File {
5068 proc: self.proc.clone(),
5069 selection: query,
5070 graphql_client: self.graphql_client.clone(),
5071 }
5072 }
5073 pub fn filter(&self) -> Directory {
5079 let query = self.selection.select("filter");
5080 Directory {
5081 proc: self.proc.clone(),
5082 selection: query,
5083 graphql_client: self.graphql_client.clone(),
5084 }
5085 }
5086 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5092 let mut query = self.selection.select("filter");
5093 if let Some(exclude) = opts.exclude {
5094 query = query.arg("exclude", exclude);
5095 }
5096 if let Some(include) = opts.include {
5097 query = query.arg("include", include);
5098 }
5099 if let Some(gitignore) = opts.gitignore {
5100 query = query.arg("gitignore", gitignore);
5101 }
5102 Directory {
5103 proc: self.proc.clone(),
5104 selection: query,
5105 graphql_client: self.graphql_client.clone(),
5106 }
5107 }
5108 pub async fn find_up(
5115 &self,
5116 name: impl Into<String>,
5117 start: impl Into<String>,
5118 ) -> Result<String, DaggerError> {
5119 let mut query = self.selection.select("findUp");
5120 query = query.arg("name", name.into());
5121 query = query.arg("start", start.into());
5122 query.execute(self.graphql_client.clone()).await
5123 }
5124 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5130 let mut query = self.selection.select("glob");
5131 query = query.arg("pattern", pattern.into());
5132 query.execute(self.graphql_client.clone()).await
5133 }
5134 pub async fn id(&self) -> Result<Id, DaggerError> {
5136 let query = self.selection.select("id");
5137 query.execute(self.graphql_client.clone()).await
5138 }
5139 pub async fn name(&self) -> Result<String, DaggerError> {
5141 let query = self.selection.select("name");
5142 query.execute(self.graphql_client.clone()).await
5143 }
5144 pub async fn search(
5152 &self,
5153 pattern: impl Into<String>,
5154 ) -> Result<Vec<SearchResult>, DaggerError> {
5155 let mut query = self.selection.select("search");
5156 query = query.arg("pattern", pattern.into());
5157 let query = query.select("id");
5158 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5159 Ok(ids
5160 .into_iter()
5161 .map(|id| SearchResult {
5162 proc: self.proc.clone(),
5163 selection: crate::querybuilder::query()
5164 .select("node")
5165 .arg("id", &id.0)
5166 .inline_fragment("SearchResult"),
5167 graphql_client: self.graphql_client.clone(),
5168 })
5169 .collect())
5170 }
5171 pub async fn search_opts<'a>(
5179 &self,
5180 pattern: impl Into<String>,
5181 opts: DirectorySearchOpts<'a>,
5182 ) -> Result<Vec<SearchResult>, DaggerError> {
5183 let mut query = self.selection.select("search");
5184 query = query.arg("pattern", pattern.into());
5185 if let Some(paths) = opts.paths {
5186 query = query.arg("paths", paths);
5187 }
5188 if let Some(globs) = opts.globs {
5189 query = query.arg("globs", globs);
5190 }
5191 if let Some(literal) = opts.literal {
5192 query = query.arg("literal", literal);
5193 }
5194 if let Some(multiline) = opts.multiline {
5195 query = query.arg("multiline", multiline);
5196 }
5197 if let Some(dotall) = opts.dotall {
5198 query = query.arg("dotall", dotall);
5199 }
5200 if let Some(insensitive) = opts.insensitive {
5201 query = query.arg("insensitive", insensitive);
5202 }
5203 if let Some(skip_ignored) = opts.skip_ignored {
5204 query = query.arg("skipIgnored", skip_ignored);
5205 }
5206 if let Some(skip_hidden) = opts.skip_hidden {
5207 query = query.arg("skipHidden", skip_hidden);
5208 }
5209 if let Some(files_only) = opts.files_only {
5210 query = query.arg("filesOnly", files_only);
5211 }
5212 if let Some(limit) = opts.limit {
5213 query = query.arg("limit", limit);
5214 }
5215 let query = query.select("id");
5216 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5217 Ok(ids
5218 .into_iter()
5219 .map(|id| SearchResult {
5220 proc: self.proc.clone(),
5221 selection: crate::querybuilder::query()
5222 .select("node")
5223 .arg("id", &id.0)
5224 .inline_fragment("SearchResult"),
5225 graphql_client: self.graphql_client.clone(),
5226 })
5227 .collect())
5228 }
5229 pub fn stat(&self, path: impl Into<String>) -> Stat {
5236 let mut query = self.selection.select("stat");
5237 query = query.arg("path", path.into());
5238 Stat {
5239 proc: self.proc.clone(),
5240 selection: query,
5241 graphql_client: self.graphql_client.clone(),
5242 }
5243 }
5244 pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5251 let mut query = self.selection.select("stat");
5252 query = query.arg("path", path.into());
5253 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5254 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5255 }
5256 Stat {
5257 proc: self.proc.clone(),
5258 selection: query,
5259 graphql_client: self.graphql_client.clone(),
5260 }
5261 }
5262 pub async fn sync(&self) -> Result<Directory, DaggerError> {
5264 let query = self.selection.select("sync");
5265 let id: Id = query.execute(self.graphql_client.clone()).await?;
5266 Ok(Directory {
5267 proc: self.proc.clone(),
5268 selection: query
5269 .root()
5270 .select("node")
5271 .arg("id", &id.0)
5272 .inline_fragment("Directory"),
5273 graphql_client: self.graphql_client.clone(),
5274 })
5275 }
5276 pub fn terminal(&self) -> Directory {
5282 let query = self.selection.select("terminal");
5283 Directory {
5284 proc: self.proc.clone(),
5285 selection: query,
5286 graphql_client: self.graphql_client.clone(),
5287 }
5288 }
5289 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5295 let mut query = self.selection.select("terminal");
5296 if let Some(container) = opts.container {
5297 query = query.arg("container", container);
5298 }
5299 if let Some(cmd) = opts.cmd {
5300 query = query.arg("cmd", cmd);
5301 }
5302 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5303 query = query.arg(
5304 "experimentalPrivilegedNesting",
5305 experimental_privileged_nesting,
5306 );
5307 }
5308 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5309 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5310 }
5311 Directory {
5312 proc: self.proc.clone(),
5313 selection: query,
5314 graphql_client: self.graphql_client.clone(),
5315 }
5316 }
5317 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5323 let mut query = self.selection.select("withChanges");
5324 query = query.arg_lazy(
5325 "changes",
5326 Box::new(move || {
5327 let changes = changes.clone();
5328 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5329 }),
5330 );
5331 Directory {
5332 proc: self.proc.clone(),
5333 selection: query,
5334 graphql_client: self.graphql_client.clone(),
5335 }
5336 }
5337 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5345 let mut query = self.selection.select("withDirectory");
5346 query = query.arg("path", path.into());
5347 query = query.arg_lazy(
5348 "source",
5349 Box::new(move || {
5350 let source = source.clone();
5351 Box::pin(async move { source.into_id().await.unwrap().quote() })
5352 }),
5353 );
5354 Directory {
5355 proc: self.proc.clone(),
5356 selection: query,
5357 graphql_client: self.graphql_client.clone(),
5358 }
5359 }
5360 pub fn with_directory_opts<'a>(
5368 &self,
5369 path: impl Into<String>,
5370 source: impl IntoID<Id>,
5371 opts: DirectoryWithDirectoryOpts<'a>,
5372 ) -> Directory {
5373 let mut query = self.selection.select("withDirectory");
5374 query = query.arg("path", path.into());
5375 query = query.arg_lazy(
5376 "source",
5377 Box::new(move || {
5378 let source = source.clone();
5379 Box::pin(async move { source.into_id().await.unwrap().quote() })
5380 }),
5381 );
5382 if let Some(exclude) = opts.exclude {
5383 query = query.arg("exclude", exclude);
5384 }
5385 if let Some(include) = opts.include {
5386 query = query.arg("include", include);
5387 }
5388 if let Some(gitignore) = opts.gitignore {
5389 query = query.arg("gitignore", gitignore);
5390 }
5391 if let Some(owner) = opts.owner {
5392 query = query.arg("owner", owner);
5393 }
5394 if let Some(permissions) = opts.permissions {
5395 query = query.arg("permissions", permissions);
5396 }
5397 Directory {
5398 proc: self.proc.clone(),
5399 selection: query,
5400 graphql_client: self.graphql_client.clone(),
5401 }
5402 }
5403 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5409 let mut query = self.selection.select("withError");
5410 query = query.arg("err", err.into());
5411 Directory {
5412 proc: self.proc.clone(),
5413 selection: query,
5414 graphql_client: self.graphql_client.clone(),
5415 }
5416 }
5417 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5425 let mut query = self.selection.select("withFile");
5426 query = query.arg("path", path.into());
5427 query = query.arg_lazy(
5428 "source",
5429 Box::new(move || {
5430 let source = source.clone();
5431 Box::pin(async move { source.into_id().await.unwrap().quote() })
5432 }),
5433 );
5434 Directory {
5435 proc: self.proc.clone(),
5436 selection: query,
5437 graphql_client: self.graphql_client.clone(),
5438 }
5439 }
5440 pub fn with_file_opts<'a>(
5448 &self,
5449 path: impl Into<String>,
5450 source: impl IntoID<Id>,
5451 opts: DirectoryWithFileOpts<'a>,
5452 ) -> Directory {
5453 let mut query = self.selection.select("withFile");
5454 query = query.arg("path", path.into());
5455 query = query.arg_lazy(
5456 "source",
5457 Box::new(move || {
5458 let source = source.clone();
5459 Box::pin(async move { source.into_id().await.unwrap().quote() })
5460 }),
5461 );
5462 if let Some(permissions) = opts.permissions {
5463 query = query.arg("permissions", permissions);
5464 }
5465 if let Some(owner) = opts.owner {
5466 query = query.arg("owner", owner);
5467 }
5468 Directory {
5469 proc: self.proc.clone(),
5470 selection: query,
5471 graphql_client: self.graphql_client.clone(),
5472 }
5473 }
5474 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5482 let mut query = self.selection.select("withFiles");
5483 query = query.arg("path", path.into());
5484 query = query.arg("sources", sources);
5485 Directory {
5486 proc: self.proc.clone(),
5487 selection: query,
5488 graphql_client: self.graphql_client.clone(),
5489 }
5490 }
5491 pub fn with_files_opts(
5499 &self,
5500 path: impl Into<String>,
5501 sources: Vec<Id>,
5502 opts: DirectoryWithFilesOpts,
5503 ) -> Directory {
5504 let mut query = self.selection.select("withFiles");
5505 query = query.arg("path", path.into());
5506 query = query.arg("sources", sources);
5507 if let Some(permissions) = opts.permissions {
5508 query = query.arg("permissions", permissions);
5509 }
5510 Directory {
5511 proc: self.proc.clone(),
5512 selection: query,
5513 graphql_client: self.graphql_client.clone(),
5514 }
5515 }
5516 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5523 let mut query = self.selection.select("withNewDirectory");
5524 query = query.arg("path", path.into());
5525 Directory {
5526 proc: self.proc.clone(),
5527 selection: query,
5528 graphql_client: self.graphql_client.clone(),
5529 }
5530 }
5531 pub fn with_new_directory_opts(
5538 &self,
5539 path: impl Into<String>,
5540 opts: DirectoryWithNewDirectoryOpts,
5541 ) -> Directory {
5542 let mut query = self.selection.select("withNewDirectory");
5543 query = query.arg("path", path.into());
5544 if let Some(permissions) = opts.permissions {
5545 query = query.arg("permissions", permissions);
5546 }
5547 Directory {
5548 proc: self.proc.clone(),
5549 selection: query,
5550 graphql_client: self.graphql_client.clone(),
5551 }
5552 }
5553 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5561 let mut query = self.selection.select("withNewFile");
5562 query = query.arg("path", path.into());
5563 query = query.arg("contents", contents.into());
5564 Directory {
5565 proc: self.proc.clone(),
5566 selection: query,
5567 graphql_client: self.graphql_client.clone(),
5568 }
5569 }
5570 pub fn with_new_file_opts(
5578 &self,
5579 path: impl Into<String>,
5580 contents: impl Into<String>,
5581 opts: DirectoryWithNewFileOpts,
5582 ) -> Directory {
5583 let mut query = self.selection.select("withNewFile");
5584 query = query.arg("path", path.into());
5585 query = query.arg("contents", contents.into());
5586 if let Some(permissions) = opts.permissions {
5587 query = query.arg("permissions", permissions);
5588 }
5589 Directory {
5590 proc: self.proc.clone(),
5591 selection: query,
5592 graphql_client: self.graphql_client.clone(),
5593 }
5594 }
5595 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5601 let mut query = self.selection.select("withPatch");
5602 query = query.arg("patch", patch.into());
5603 Directory {
5604 proc: self.proc.clone(),
5605 selection: query,
5606 graphql_client: self.graphql_client.clone(),
5607 }
5608 }
5609 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5615 let mut query = self.selection.select("withPatchFile");
5616 query = query.arg_lazy(
5617 "patch",
5618 Box::new(move || {
5619 let patch = patch.clone();
5620 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5621 }),
5622 );
5623 Directory {
5624 proc: self.proc.clone(),
5625 selection: query,
5626 graphql_client: self.graphql_client.clone(),
5627 }
5628 }
5629 pub fn with_symlink(
5636 &self,
5637 target: impl Into<String>,
5638 link_name: impl Into<String>,
5639 ) -> Directory {
5640 let mut query = self.selection.select("withSymlink");
5641 query = query.arg("target", target.into());
5642 query = query.arg("linkName", link_name.into());
5643 Directory {
5644 proc: self.proc.clone(),
5645 selection: query,
5646 graphql_client: self.graphql_client.clone(),
5647 }
5648 }
5649 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5657 let mut query = self.selection.select("withTimestamps");
5658 query = query.arg("timestamp", timestamp);
5659 Directory {
5660 proc: self.proc.clone(),
5661 selection: query,
5662 graphql_client: self.graphql_client.clone(),
5663 }
5664 }
5665 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5671 let mut query = self.selection.select("withoutDirectory");
5672 query = query.arg("path", path.into());
5673 Directory {
5674 proc: self.proc.clone(),
5675 selection: query,
5676 graphql_client: self.graphql_client.clone(),
5677 }
5678 }
5679 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5685 let mut query = self.selection.select("withoutFile");
5686 query = query.arg("path", path.into());
5687 Directory {
5688 proc: self.proc.clone(),
5689 selection: query,
5690 graphql_client: self.graphql_client.clone(),
5691 }
5692 }
5693 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5699 let mut query = self.selection.select("withoutFiles");
5700 query = query.arg(
5701 "paths",
5702 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5703 );
5704 Directory {
5705 proc: self.proc.clone(),
5706 selection: query,
5707 graphql_client: self.graphql_client.clone(),
5708 }
5709 }
5710}
5711impl Exportable for Directory {
5712 fn export(
5713 &self,
5714 path: impl Into<String>,
5715 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5716 let mut query = self.selection.select("export");
5717 query = query.arg("path", path.into());
5718 let graphql_client = self.graphql_client.clone();
5719 async move { query.execute(graphql_client).await }
5720 }
5721 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5722 let query = self.selection.select("id");
5723 let graphql_client = self.graphql_client.clone();
5724 async move { query.execute(graphql_client).await }
5725 }
5726}
5727impl Node for Directory {
5728 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5729 let query = self.selection.select("id");
5730 let graphql_client = self.graphql_client.clone();
5731 async move { query.execute(graphql_client).await }
5732 }
5733}
5734impl Syncer for Directory {
5735 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5736 let query = self.selection.select("id");
5737 let graphql_client = self.graphql_client.clone();
5738 async move { query.execute(graphql_client).await }
5739 }
5740 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5741 let query = self.selection.select("sync");
5742 let graphql_client = self.graphql_client.clone();
5743 async move { query.execute(graphql_client).await }
5744 }
5745}
5746#[derive(Clone)]
5747pub struct Engine {
5748 pub proc: Option<Arc<DaggerSessionProc>>,
5749 pub selection: Selection,
5750 pub graphql_client: DynGraphQLClient,
5751}
5752impl IntoID<Id> for Engine {
5753 fn into_id(
5754 self,
5755 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5756 Box::pin(async move { self.id().await })
5757 }
5758}
5759impl Loadable for Engine {
5760 fn graphql_type() -> &'static str {
5761 "Engine"
5762 }
5763 fn from_query(
5764 proc: Option<Arc<DaggerSessionProc>>,
5765 selection: Selection,
5766 graphql_client: DynGraphQLClient,
5767 ) -> Self {
5768 Self {
5769 proc,
5770 selection,
5771 graphql_client,
5772 }
5773 }
5774}
5775impl Engine {
5776 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5778 let query = self.selection.select("clients");
5779 query.execute(self.graphql_client.clone()).await
5780 }
5781 pub async fn id(&self) -> Result<Id, DaggerError> {
5783 let query = self.selection.select("id");
5784 query.execute(self.graphql_client.clone()).await
5785 }
5786 pub fn local_cache(&self) -> EngineCache {
5788 let query = self.selection.select("localCache");
5789 EngineCache {
5790 proc: self.proc.clone(),
5791 selection: query,
5792 graphql_client: self.graphql_client.clone(),
5793 }
5794 }
5795 pub async fn name(&self) -> Result<String, DaggerError> {
5797 let query = self.selection.select("name");
5798 query.execute(self.graphql_client.clone()).await
5799 }
5800}
5801impl Node for Engine {
5802 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5803 let query = self.selection.select("id");
5804 let graphql_client = self.graphql_client.clone();
5805 async move { query.execute(graphql_client).await }
5806 }
5807}
5808#[derive(Clone)]
5809pub struct EngineCache {
5810 pub proc: Option<Arc<DaggerSessionProc>>,
5811 pub selection: Selection,
5812 pub graphql_client: DynGraphQLClient,
5813}
5814#[derive(Builder, Debug, PartialEq)]
5815pub struct EngineCacheEntrySetOpts<'a> {
5816 #[builder(setter(into, strip_option), default)]
5817 pub key: Option<&'a str>,
5818}
5819#[derive(Builder, Debug, PartialEq)]
5820pub struct EngineCachePruneOpts<'a> {
5821 #[builder(setter(into, strip_option), default)]
5823 pub max_used_space: Option<&'a str>,
5824 #[builder(setter(into, strip_option), default)]
5826 pub min_free_space: Option<&'a str>,
5827 #[builder(setter(into, strip_option), default)]
5829 pub reserved_space: Option<&'a str>,
5830 #[builder(setter(into, strip_option), default)]
5832 pub target_space: Option<&'a str>,
5833 #[builder(setter(into, strip_option), default)]
5835 pub use_default_policy: Option<bool>,
5836}
5837impl IntoID<Id> for EngineCache {
5838 fn into_id(
5839 self,
5840 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5841 Box::pin(async move { self.id().await })
5842 }
5843}
5844impl Loadable for EngineCache {
5845 fn graphql_type() -> &'static str {
5846 "EngineCache"
5847 }
5848 fn from_query(
5849 proc: Option<Arc<DaggerSessionProc>>,
5850 selection: Selection,
5851 graphql_client: DynGraphQLClient,
5852 ) -> Self {
5853 Self {
5854 proc,
5855 selection,
5856 graphql_client,
5857 }
5858 }
5859}
5860impl EngineCache {
5861 pub fn entry_set(&self) -> EngineCacheEntrySet {
5867 let query = self.selection.select("entrySet");
5868 EngineCacheEntrySet {
5869 proc: self.proc.clone(),
5870 selection: query,
5871 graphql_client: self.graphql_client.clone(),
5872 }
5873 }
5874 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5880 let mut query = self.selection.select("entrySet");
5881 if let Some(key) = opts.key {
5882 query = query.arg("key", key);
5883 }
5884 EngineCacheEntrySet {
5885 proc: self.proc.clone(),
5886 selection: query,
5887 graphql_client: self.graphql_client.clone(),
5888 }
5889 }
5890 pub async fn id(&self) -> Result<Id, DaggerError> {
5892 let query = self.selection.select("id");
5893 query.execute(self.graphql_client.clone()).await
5894 }
5895 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5897 let query = self.selection.select("maxUsedSpace");
5898 query.execute(self.graphql_client.clone()).await
5899 }
5900 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5902 let query = self.selection.select("minFreeSpace");
5903 query.execute(self.graphql_client.clone()).await
5904 }
5905 pub async fn prune(&self) -> Result<Void, DaggerError> {
5911 let query = self.selection.select("prune");
5912 query.execute(self.graphql_client.clone()).await
5913 }
5914 pub async fn prune_opts<'a>(
5920 &self,
5921 opts: EngineCachePruneOpts<'a>,
5922 ) -> Result<Void, DaggerError> {
5923 let mut query = self.selection.select("prune");
5924 if let Some(use_default_policy) = opts.use_default_policy {
5925 query = query.arg("useDefaultPolicy", use_default_policy);
5926 }
5927 if let Some(max_used_space) = opts.max_used_space {
5928 query = query.arg("maxUsedSpace", max_used_space);
5929 }
5930 if let Some(reserved_space) = opts.reserved_space {
5931 query = query.arg("reservedSpace", reserved_space);
5932 }
5933 if let Some(min_free_space) = opts.min_free_space {
5934 query = query.arg("minFreeSpace", min_free_space);
5935 }
5936 if let Some(target_space) = opts.target_space {
5937 query = query.arg("targetSpace", target_space);
5938 }
5939 query.execute(self.graphql_client.clone()).await
5940 }
5941 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5943 let query = self.selection.select("reservedSpace");
5944 query.execute(self.graphql_client.clone()).await
5945 }
5946 pub async fn target_space(&self) -> Result<isize, DaggerError> {
5948 let query = self.selection.select("targetSpace");
5949 query.execute(self.graphql_client.clone()).await
5950 }
5951}
5952impl Node for EngineCache {
5953 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5954 let query = self.selection.select("id");
5955 let graphql_client = self.graphql_client.clone();
5956 async move { query.execute(graphql_client).await }
5957 }
5958}
5959#[derive(Clone)]
5960pub struct EngineCacheEntry {
5961 pub proc: Option<Arc<DaggerSessionProc>>,
5962 pub selection: Selection,
5963 pub graphql_client: DynGraphQLClient,
5964}
5965impl IntoID<Id> for EngineCacheEntry {
5966 fn into_id(
5967 self,
5968 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5969 Box::pin(async move { self.id().await })
5970 }
5971}
5972impl Loadable for EngineCacheEntry {
5973 fn graphql_type() -> &'static str {
5974 "EngineCacheEntry"
5975 }
5976 fn from_query(
5977 proc: Option<Arc<DaggerSessionProc>>,
5978 selection: Selection,
5979 graphql_client: DynGraphQLClient,
5980 ) -> Self {
5981 Self {
5982 proc,
5983 selection,
5984 graphql_client,
5985 }
5986 }
5987}
5988impl EngineCacheEntry {
5989 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5991 let query = self.selection.select("activelyUsed");
5992 query.execute(self.graphql_client.clone()).await
5993 }
5994 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5996 let query = self.selection.select("createdTimeUnixNano");
5997 query.execute(self.graphql_client.clone()).await
5998 }
5999 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
6001 let query = self.selection.select("dagqlCall");
6002 query.execute(self.graphql_client.clone()).await
6003 }
6004 pub async fn description(&self) -> Result<String, DaggerError> {
6006 let query = self.selection.select("description");
6007 query.execute(self.graphql_client.clone()).await
6008 }
6009 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6011 let query = self.selection.select("diskSpaceBytes");
6012 query.execute(self.graphql_client.clone()).await
6013 }
6014 pub async fn id(&self) -> Result<Id, DaggerError> {
6016 let query = self.selection.select("id");
6017 query.execute(self.graphql_client.clone()).await
6018 }
6019 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6021 let query = self.selection.select("mostRecentUseTimeUnixNano");
6022 query.execute(self.graphql_client.clone()).await
6023 }
6024 pub async fn record_type(&self) -> Result<String, DaggerError> {
6026 let query = self.selection.select("recordType");
6027 query.execute(self.graphql_client.clone()).await
6028 }
6029 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
6031 let query = self.selection.select("recordTypes");
6032 query.execute(self.graphql_client.clone()).await
6033 }
6034}
6035impl Node for EngineCacheEntry {
6036 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6037 let query = self.selection.select("id");
6038 let graphql_client = self.graphql_client.clone();
6039 async move { query.execute(graphql_client).await }
6040 }
6041}
6042#[derive(Clone)]
6043pub struct EngineCacheEntrySet {
6044 pub proc: Option<Arc<DaggerSessionProc>>,
6045 pub selection: Selection,
6046 pub graphql_client: DynGraphQLClient,
6047}
6048impl IntoID<Id> for EngineCacheEntrySet {
6049 fn into_id(
6050 self,
6051 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6052 Box::pin(async move { self.id().await })
6053 }
6054}
6055impl Loadable for EngineCacheEntrySet {
6056 fn graphql_type() -> &'static str {
6057 "EngineCacheEntrySet"
6058 }
6059 fn from_query(
6060 proc: Option<Arc<DaggerSessionProc>>,
6061 selection: Selection,
6062 graphql_client: DynGraphQLClient,
6063 ) -> Self {
6064 Self {
6065 proc,
6066 selection,
6067 graphql_client,
6068 }
6069 }
6070}
6071impl EngineCacheEntrySet {
6072 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6074 let query = self.selection.select("diskSpaceBytes");
6075 query.execute(self.graphql_client.clone()).await
6076 }
6077 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6079 let query = self.selection.select("entries");
6080 let query = query.select("id");
6081 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6082 Ok(ids
6083 .into_iter()
6084 .map(|id| EngineCacheEntry {
6085 proc: self.proc.clone(),
6086 selection: crate::querybuilder::query()
6087 .select("node")
6088 .arg("id", &id.0)
6089 .inline_fragment("EngineCacheEntry"),
6090 graphql_client: self.graphql_client.clone(),
6091 })
6092 .collect())
6093 }
6094 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6096 let query = self.selection.select("entryCount");
6097 query.execute(self.graphql_client.clone()).await
6098 }
6099 pub async fn id(&self) -> Result<Id, DaggerError> {
6101 let query = self.selection.select("id");
6102 query.execute(self.graphql_client.clone()).await
6103 }
6104}
6105impl Node for EngineCacheEntrySet {
6106 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6107 let query = self.selection.select("id");
6108 let graphql_client = self.graphql_client.clone();
6109 async move { query.execute(graphql_client).await }
6110 }
6111}
6112#[derive(Clone)]
6113pub struct EnumTypeDef {
6114 pub proc: Option<Arc<DaggerSessionProc>>,
6115 pub selection: Selection,
6116 pub graphql_client: DynGraphQLClient,
6117}
6118impl IntoID<Id> for EnumTypeDef {
6119 fn into_id(
6120 self,
6121 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6122 Box::pin(async move { self.id().await })
6123 }
6124}
6125impl Loadable for EnumTypeDef {
6126 fn graphql_type() -> &'static str {
6127 "EnumTypeDef"
6128 }
6129 fn from_query(
6130 proc: Option<Arc<DaggerSessionProc>>,
6131 selection: Selection,
6132 graphql_client: DynGraphQLClient,
6133 ) -> Self {
6134 Self {
6135 proc,
6136 selection,
6137 graphql_client,
6138 }
6139 }
6140}
6141impl EnumTypeDef {
6142 pub async fn description(&self) -> Result<String, DaggerError> {
6144 let query = self.selection.select("description");
6145 query.execute(self.graphql_client.clone()).await
6146 }
6147 pub async fn id(&self) -> Result<Id, DaggerError> {
6149 let query = self.selection.select("id");
6150 query.execute(self.graphql_client.clone()).await
6151 }
6152 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6154 let query = self.selection.select("members");
6155 let query = query.select("id");
6156 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6157 Ok(ids
6158 .into_iter()
6159 .map(|id| EnumValueTypeDef {
6160 proc: self.proc.clone(),
6161 selection: crate::querybuilder::query()
6162 .select("node")
6163 .arg("id", &id.0)
6164 .inline_fragment("EnumValueTypeDef"),
6165 graphql_client: self.graphql_client.clone(),
6166 })
6167 .collect())
6168 }
6169 pub async fn name(&self) -> Result<String, DaggerError> {
6171 let query = self.selection.select("name");
6172 query.execute(self.graphql_client.clone()).await
6173 }
6174 pub fn source_map(&self) -> SourceMap {
6176 let query = self.selection.select("sourceMap");
6177 SourceMap {
6178 proc: self.proc.clone(),
6179 selection: query,
6180 graphql_client: self.graphql_client.clone(),
6181 }
6182 }
6183 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6185 let query = self.selection.select("sourceModuleName");
6186 query.execute(self.graphql_client.clone()).await
6187 }
6188 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6190 let query = self.selection.select("values");
6191 let query = query.select("id");
6192 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6193 Ok(ids
6194 .into_iter()
6195 .map(|id| EnumValueTypeDef {
6196 proc: self.proc.clone(),
6197 selection: crate::querybuilder::query()
6198 .select("node")
6199 .arg("id", &id.0)
6200 .inline_fragment("EnumValueTypeDef"),
6201 graphql_client: self.graphql_client.clone(),
6202 })
6203 .collect())
6204 }
6205}
6206impl Node for EnumTypeDef {
6207 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6208 let query = self.selection.select("id");
6209 let graphql_client = self.graphql_client.clone();
6210 async move { query.execute(graphql_client).await }
6211 }
6212}
6213#[derive(Clone)]
6214pub struct EnumValueTypeDef {
6215 pub proc: Option<Arc<DaggerSessionProc>>,
6216 pub selection: Selection,
6217 pub graphql_client: DynGraphQLClient,
6218}
6219impl IntoID<Id> for EnumValueTypeDef {
6220 fn into_id(
6221 self,
6222 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6223 Box::pin(async move { self.id().await })
6224 }
6225}
6226impl Loadable for EnumValueTypeDef {
6227 fn graphql_type() -> &'static str {
6228 "EnumValueTypeDef"
6229 }
6230 fn from_query(
6231 proc: Option<Arc<DaggerSessionProc>>,
6232 selection: Selection,
6233 graphql_client: DynGraphQLClient,
6234 ) -> Self {
6235 Self {
6236 proc,
6237 selection,
6238 graphql_client,
6239 }
6240 }
6241}
6242impl EnumValueTypeDef {
6243 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6245 let query = self.selection.select("deprecated");
6246 query.execute(self.graphql_client.clone()).await
6247 }
6248 pub async fn description(&self) -> Result<String, DaggerError> {
6250 let query = self.selection.select("description");
6251 query.execute(self.graphql_client.clone()).await
6252 }
6253 pub async fn id(&self) -> Result<Id, DaggerError> {
6255 let query = self.selection.select("id");
6256 query.execute(self.graphql_client.clone()).await
6257 }
6258 pub async fn name(&self) -> Result<String, DaggerError> {
6260 let query = self.selection.select("name");
6261 query.execute(self.graphql_client.clone()).await
6262 }
6263 pub fn source_map(&self) -> SourceMap {
6265 let query = self.selection.select("sourceMap");
6266 SourceMap {
6267 proc: self.proc.clone(),
6268 selection: query,
6269 graphql_client: self.graphql_client.clone(),
6270 }
6271 }
6272 pub async fn value(&self) -> Result<String, DaggerError> {
6274 let query = self.selection.select("value");
6275 query.execute(self.graphql_client.clone()).await
6276 }
6277}
6278impl Node for EnumValueTypeDef {
6279 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6280 let query = self.selection.select("id");
6281 let graphql_client = self.graphql_client.clone();
6282 async move { query.execute(graphql_client).await }
6283 }
6284}
6285#[derive(Clone)]
6286pub struct Env {
6287 pub proc: Option<Arc<DaggerSessionProc>>,
6288 pub selection: Selection,
6289 pub graphql_client: DynGraphQLClient,
6290}
6291#[derive(Builder, Debug, PartialEq)]
6292pub struct EnvChecksOpts<'a> {
6293 #[builder(setter(into, strip_option), default)]
6295 pub include: Option<Vec<&'a str>>,
6296 #[builder(setter(into, strip_option), default)]
6298 pub no_generate: Option<bool>,
6299}
6300#[derive(Builder, Debug, PartialEq)]
6301pub struct EnvServicesOpts<'a> {
6302 #[builder(setter(into, strip_option), default)]
6304 pub include: Option<Vec<&'a str>>,
6305}
6306impl IntoID<Id> for Env {
6307 fn into_id(
6308 self,
6309 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6310 Box::pin(async move { self.id().await })
6311 }
6312}
6313impl Loadable for Env {
6314 fn graphql_type() -> &'static str {
6315 "Env"
6316 }
6317 fn from_query(
6318 proc: Option<Arc<DaggerSessionProc>>,
6319 selection: Selection,
6320 graphql_client: DynGraphQLClient,
6321 ) -> Self {
6322 Self {
6323 proc,
6324 selection,
6325 graphql_client,
6326 }
6327 }
6328}
6329impl Env {
6330 pub fn check(&self, name: impl Into<String>) -> Check {
6336 let mut query = self.selection.select("check");
6337 query = query.arg("name", name.into());
6338 Check {
6339 proc: self.proc.clone(),
6340 selection: query,
6341 graphql_client: self.graphql_client.clone(),
6342 }
6343 }
6344 pub fn checks(&self) -> CheckGroup {
6350 let query = self.selection.select("checks");
6351 CheckGroup {
6352 proc: self.proc.clone(),
6353 selection: query,
6354 graphql_client: self.graphql_client.clone(),
6355 }
6356 }
6357 pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6363 let mut query = self.selection.select("checks");
6364 if let Some(include) = opts.include {
6365 query = query.arg("include", include);
6366 }
6367 if let Some(no_generate) = opts.no_generate {
6368 query = query.arg("noGenerate", no_generate);
6369 }
6370 CheckGroup {
6371 proc: self.proc.clone(),
6372 selection: query,
6373 graphql_client: self.graphql_client.clone(),
6374 }
6375 }
6376 pub async fn id(&self) -> Result<Id, DaggerError> {
6378 let query = self.selection.select("id");
6379 query.execute(self.graphql_client.clone()).await
6380 }
6381 pub fn input(&self, name: impl Into<String>) -> Binding {
6383 let mut query = self.selection.select("input");
6384 query = query.arg("name", name.into());
6385 Binding {
6386 proc: self.proc.clone(),
6387 selection: query,
6388 graphql_client: self.graphql_client.clone(),
6389 }
6390 }
6391 pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6393 let query = self.selection.select("inputs");
6394 let query = query.select("id");
6395 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6396 Ok(ids
6397 .into_iter()
6398 .map(|id| Binding {
6399 proc: self.proc.clone(),
6400 selection: crate::querybuilder::query()
6401 .select("node")
6402 .arg("id", &id.0)
6403 .inline_fragment("Binding"),
6404 graphql_client: self.graphql_client.clone(),
6405 })
6406 .collect())
6407 }
6408 pub fn output(&self, name: impl Into<String>) -> Binding {
6410 let mut query = self.selection.select("output");
6411 query = query.arg("name", name.into());
6412 Binding {
6413 proc: self.proc.clone(),
6414 selection: query,
6415 graphql_client: self.graphql_client.clone(),
6416 }
6417 }
6418 pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6420 let query = self.selection.select("outputs");
6421 let query = query.select("id");
6422 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6423 Ok(ids
6424 .into_iter()
6425 .map(|id| Binding {
6426 proc: self.proc.clone(),
6427 selection: crate::querybuilder::query()
6428 .select("node")
6429 .arg("id", &id.0)
6430 .inline_fragment("Binding"),
6431 graphql_client: self.graphql_client.clone(),
6432 })
6433 .collect())
6434 }
6435 pub fn services(&self) -> UpGroup {
6441 let query = self.selection.select("services");
6442 UpGroup {
6443 proc: self.proc.clone(),
6444 selection: query,
6445 graphql_client: self.graphql_client.clone(),
6446 }
6447 }
6448 pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6454 let mut query = self.selection.select("services");
6455 if let Some(include) = opts.include {
6456 query = query.arg("include", include);
6457 }
6458 UpGroup {
6459 proc: self.proc.clone(),
6460 selection: query,
6461 graphql_client: self.graphql_client.clone(),
6462 }
6463 }
6464 pub fn with_address_input(
6472 &self,
6473 name: impl Into<String>,
6474 value: impl IntoID<Id>,
6475 description: impl Into<String>,
6476 ) -> Env {
6477 let mut query = self.selection.select("withAddressInput");
6478 query = query.arg("name", name.into());
6479 query = query.arg_lazy(
6480 "value",
6481 Box::new(move || {
6482 let value = value.clone();
6483 Box::pin(async move { value.into_id().await.unwrap().quote() })
6484 }),
6485 );
6486 query = query.arg("description", description.into());
6487 Env {
6488 proc: self.proc.clone(),
6489 selection: query,
6490 graphql_client: self.graphql_client.clone(),
6491 }
6492 }
6493 pub fn with_address_output(
6500 &self,
6501 name: impl Into<String>,
6502 description: impl Into<String>,
6503 ) -> Env {
6504 let mut query = self.selection.select("withAddressOutput");
6505 query = query.arg("name", name.into());
6506 query = query.arg("description", description.into());
6507 Env {
6508 proc: self.proc.clone(),
6509 selection: query,
6510 graphql_client: self.graphql_client.clone(),
6511 }
6512 }
6513 pub fn with_cache_volume_input(
6521 &self,
6522 name: impl Into<String>,
6523 value: impl IntoID<Id>,
6524 description: impl Into<String>,
6525 ) -> Env {
6526 let mut query = self.selection.select("withCacheVolumeInput");
6527 query = query.arg("name", name.into());
6528 query = query.arg_lazy(
6529 "value",
6530 Box::new(move || {
6531 let value = value.clone();
6532 Box::pin(async move { value.into_id().await.unwrap().quote() })
6533 }),
6534 );
6535 query = query.arg("description", description.into());
6536 Env {
6537 proc: self.proc.clone(),
6538 selection: query,
6539 graphql_client: self.graphql_client.clone(),
6540 }
6541 }
6542 pub fn with_cache_volume_output(
6549 &self,
6550 name: impl Into<String>,
6551 description: impl Into<String>,
6552 ) -> Env {
6553 let mut query = self.selection.select("withCacheVolumeOutput");
6554 query = query.arg("name", name.into());
6555 query = query.arg("description", description.into());
6556 Env {
6557 proc: self.proc.clone(),
6558 selection: query,
6559 graphql_client: self.graphql_client.clone(),
6560 }
6561 }
6562 pub fn with_changeset_input(
6570 &self,
6571 name: impl Into<String>,
6572 value: impl IntoID<Id>,
6573 description: impl Into<String>,
6574 ) -> Env {
6575 let mut query = self.selection.select("withChangesetInput");
6576 query = query.arg("name", name.into());
6577 query = query.arg_lazy(
6578 "value",
6579 Box::new(move || {
6580 let value = value.clone();
6581 Box::pin(async move { value.into_id().await.unwrap().quote() })
6582 }),
6583 );
6584 query = query.arg("description", description.into());
6585 Env {
6586 proc: self.proc.clone(),
6587 selection: query,
6588 graphql_client: self.graphql_client.clone(),
6589 }
6590 }
6591 pub fn with_changeset_output(
6598 &self,
6599 name: impl Into<String>,
6600 description: impl Into<String>,
6601 ) -> Env {
6602 let mut query = self.selection.select("withChangesetOutput");
6603 query = query.arg("name", name.into());
6604 query = query.arg("description", description.into());
6605 Env {
6606 proc: self.proc.clone(),
6607 selection: query,
6608 graphql_client: self.graphql_client.clone(),
6609 }
6610 }
6611 pub fn with_check_group_input(
6619 &self,
6620 name: impl Into<String>,
6621 value: impl IntoID<Id>,
6622 description: impl Into<String>,
6623 ) -> Env {
6624 let mut query = self.selection.select("withCheckGroupInput");
6625 query = query.arg("name", name.into());
6626 query = query.arg_lazy(
6627 "value",
6628 Box::new(move || {
6629 let value = value.clone();
6630 Box::pin(async move { value.into_id().await.unwrap().quote() })
6631 }),
6632 );
6633 query = query.arg("description", description.into());
6634 Env {
6635 proc: self.proc.clone(),
6636 selection: query,
6637 graphql_client: self.graphql_client.clone(),
6638 }
6639 }
6640 pub fn with_check_group_output(
6647 &self,
6648 name: impl Into<String>,
6649 description: impl Into<String>,
6650 ) -> Env {
6651 let mut query = self.selection.select("withCheckGroupOutput");
6652 query = query.arg("name", name.into());
6653 query = query.arg("description", description.into());
6654 Env {
6655 proc: self.proc.clone(),
6656 selection: query,
6657 graphql_client: self.graphql_client.clone(),
6658 }
6659 }
6660 pub fn with_check_input(
6668 &self,
6669 name: impl Into<String>,
6670 value: impl IntoID<Id>,
6671 description: impl Into<String>,
6672 ) -> Env {
6673 let mut query = self.selection.select("withCheckInput");
6674 query = query.arg("name", name.into());
6675 query = query.arg_lazy(
6676 "value",
6677 Box::new(move || {
6678 let value = value.clone();
6679 Box::pin(async move { value.into_id().await.unwrap().quote() })
6680 }),
6681 );
6682 query = query.arg("description", description.into());
6683 Env {
6684 proc: self.proc.clone(),
6685 selection: query,
6686 graphql_client: self.graphql_client.clone(),
6687 }
6688 }
6689 pub fn with_check_output(
6696 &self,
6697 name: impl Into<String>,
6698 description: impl Into<String>,
6699 ) -> Env {
6700 let mut query = self.selection.select("withCheckOutput");
6701 query = query.arg("name", name.into());
6702 query = query.arg("description", description.into());
6703 Env {
6704 proc: self.proc.clone(),
6705 selection: query,
6706 graphql_client: self.graphql_client.clone(),
6707 }
6708 }
6709 pub fn with_cloud_input(
6717 &self,
6718 name: impl Into<String>,
6719 value: impl IntoID<Id>,
6720 description: impl Into<String>,
6721 ) -> Env {
6722 let mut query = self.selection.select("withCloudInput");
6723 query = query.arg("name", name.into());
6724 query = query.arg_lazy(
6725 "value",
6726 Box::new(move || {
6727 let value = value.clone();
6728 Box::pin(async move { value.into_id().await.unwrap().quote() })
6729 }),
6730 );
6731 query = query.arg("description", description.into());
6732 Env {
6733 proc: self.proc.clone(),
6734 selection: query,
6735 graphql_client: self.graphql_client.clone(),
6736 }
6737 }
6738 pub fn with_cloud_output(
6745 &self,
6746 name: impl Into<String>,
6747 description: impl Into<String>,
6748 ) -> Env {
6749 let mut query = self.selection.select("withCloudOutput");
6750 query = query.arg("name", name.into());
6751 query = query.arg("description", description.into());
6752 Env {
6753 proc: self.proc.clone(),
6754 selection: query,
6755 graphql_client: self.graphql_client.clone(),
6756 }
6757 }
6758 pub fn with_container_input(
6766 &self,
6767 name: impl Into<String>,
6768 value: impl IntoID<Id>,
6769 description: impl Into<String>,
6770 ) -> Env {
6771 let mut query = self.selection.select("withContainerInput");
6772 query = query.arg("name", name.into());
6773 query = query.arg_lazy(
6774 "value",
6775 Box::new(move || {
6776 let value = value.clone();
6777 Box::pin(async move { value.into_id().await.unwrap().quote() })
6778 }),
6779 );
6780 query = query.arg("description", description.into());
6781 Env {
6782 proc: self.proc.clone(),
6783 selection: query,
6784 graphql_client: self.graphql_client.clone(),
6785 }
6786 }
6787 pub fn with_container_output(
6794 &self,
6795 name: impl Into<String>,
6796 description: impl Into<String>,
6797 ) -> Env {
6798 let mut query = self.selection.select("withContainerOutput");
6799 query = query.arg("name", name.into());
6800 query = query.arg("description", description.into());
6801 Env {
6802 proc: self.proc.clone(),
6803 selection: query,
6804 graphql_client: self.graphql_client.clone(),
6805 }
6806 }
6807 pub fn with_current_module(&self) -> Env {
6810 let query = self.selection.select("withCurrentModule");
6811 Env {
6812 proc: self.proc.clone(),
6813 selection: query,
6814 graphql_client: self.graphql_client.clone(),
6815 }
6816 }
6817 pub fn with_diff_stat_input(
6825 &self,
6826 name: impl Into<String>,
6827 value: impl IntoID<Id>,
6828 description: impl Into<String>,
6829 ) -> Env {
6830 let mut query = self.selection.select("withDiffStatInput");
6831 query = query.arg("name", name.into());
6832 query = query.arg_lazy(
6833 "value",
6834 Box::new(move || {
6835 let value = value.clone();
6836 Box::pin(async move { value.into_id().await.unwrap().quote() })
6837 }),
6838 );
6839 query = query.arg("description", description.into());
6840 Env {
6841 proc: self.proc.clone(),
6842 selection: query,
6843 graphql_client: self.graphql_client.clone(),
6844 }
6845 }
6846 pub fn with_diff_stat_output(
6853 &self,
6854 name: impl Into<String>,
6855 description: impl Into<String>,
6856 ) -> Env {
6857 let mut query = self.selection.select("withDiffStatOutput");
6858 query = query.arg("name", name.into());
6859 query = query.arg("description", description.into());
6860 Env {
6861 proc: self.proc.clone(),
6862 selection: query,
6863 graphql_client: self.graphql_client.clone(),
6864 }
6865 }
6866 pub fn with_directory_input(
6874 &self,
6875 name: impl Into<String>,
6876 value: impl IntoID<Id>,
6877 description: impl Into<String>,
6878 ) -> Env {
6879 let mut query = self.selection.select("withDirectoryInput");
6880 query = query.arg("name", name.into());
6881 query = query.arg_lazy(
6882 "value",
6883 Box::new(move || {
6884 let value = value.clone();
6885 Box::pin(async move { value.into_id().await.unwrap().quote() })
6886 }),
6887 );
6888 query = query.arg("description", description.into());
6889 Env {
6890 proc: self.proc.clone(),
6891 selection: query,
6892 graphql_client: self.graphql_client.clone(),
6893 }
6894 }
6895 pub fn with_directory_output(
6902 &self,
6903 name: impl Into<String>,
6904 description: impl Into<String>,
6905 ) -> Env {
6906 let mut query = self.selection.select("withDirectoryOutput");
6907 query = query.arg("name", name.into());
6908 query = query.arg("description", description.into());
6909 Env {
6910 proc: self.proc.clone(),
6911 selection: query,
6912 graphql_client: self.graphql_client.clone(),
6913 }
6914 }
6915 pub fn with_env_file_input(
6923 &self,
6924 name: impl Into<String>,
6925 value: impl IntoID<Id>,
6926 description: impl Into<String>,
6927 ) -> Env {
6928 let mut query = self.selection.select("withEnvFileInput");
6929 query = query.arg("name", name.into());
6930 query = query.arg_lazy(
6931 "value",
6932 Box::new(move || {
6933 let value = value.clone();
6934 Box::pin(async move { value.into_id().await.unwrap().quote() })
6935 }),
6936 );
6937 query = query.arg("description", description.into());
6938 Env {
6939 proc: self.proc.clone(),
6940 selection: query,
6941 graphql_client: self.graphql_client.clone(),
6942 }
6943 }
6944 pub fn with_env_file_output(
6951 &self,
6952 name: impl Into<String>,
6953 description: impl Into<String>,
6954 ) -> Env {
6955 let mut query = self.selection.select("withEnvFileOutput");
6956 query = query.arg("name", name.into());
6957 query = query.arg("description", description.into());
6958 Env {
6959 proc: self.proc.clone(),
6960 selection: query,
6961 graphql_client: self.graphql_client.clone(),
6962 }
6963 }
6964 pub fn with_env_input(
6972 &self,
6973 name: impl Into<String>,
6974 value: impl IntoID<Id>,
6975 description: impl Into<String>,
6976 ) -> Env {
6977 let mut query = self.selection.select("withEnvInput");
6978 query = query.arg("name", name.into());
6979 query = query.arg_lazy(
6980 "value",
6981 Box::new(move || {
6982 let value = value.clone();
6983 Box::pin(async move { value.into_id().await.unwrap().quote() })
6984 }),
6985 );
6986 query = query.arg("description", description.into());
6987 Env {
6988 proc: self.proc.clone(),
6989 selection: query,
6990 graphql_client: self.graphql_client.clone(),
6991 }
6992 }
6993 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7000 let mut query = self.selection.select("withEnvOutput");
7001 query = query.arg("name", name.into());
7002 query = query.arg("description", description.into());
7003 Env {
7004 proc: self.proc.clone(),
7005 selection: query,
7006 graphql_client: self.graphql_client.clone(),
7007 }
7008 }
7009 pub fn with_file_input(
7017 &self,
7018 name: impl Into<String>,
7019 value: impl IntoID<Id>,
7020 description: impl Into<String>,
7021 ) -> Env {
7022 let mut query = self.selection.select("withFileInput");
7023 query = query.arg("name", name.into());
7024 query = query.arg_lazy(
7025 "value",
7026 Box::new(move || {
7027 let value = value.clone();
7028 Box::pin(async move { value.into_id().await.unwrap().quote() })
7029 }),
7030 );
7031 query = query.arg("description", description.into());
7032 Env {
7033 proc: self.proc.clone(),
7034 selection: query,
7035 graphql_client: self.graphql_client.clone(),
7036 }
7037 }
7038 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7045 let mut query = self.selection.select("withFileOutput");
7046 query = query.arg("name", name.into());
7047 query = query.arg("description", description.into());
7048 Env {
7049 proc: self.proc.clone(),
7050 selection: query,
7051 graphql_client: self.graphql_client.clone(),
7052 }
7053 }
7054 pub fn with_generator_group_input(
7062 &self,
7063 name: impl Into<String>,
7064 value: impl IntoID<Id>,
7065 description: impl Into<String>,
7066 ) -> Env {
7067 let mut query = self.selection.select("withGeneratorGroupInput");
7068 query = query.arg("name", name.into());
7069 query = query.arg_lazy(
7070 "value",
7071 Box::new(move || {
7072 let value = value.clone();
7073 Box::pin(async move { value.into_id().await.unwrap().quote() })
7074 }),
7075 );
7076 query = query.arg("description", description.into());
7077 Env {
7078 proc: self.proc.clone(),
7079 selection: query,
7080 graphql_client: self.graphql_client.clone(),
7081 }
7082 }
7083 pub fn with_generator_group_output(
7090 &self,
7091 name: impl Into<String>,
7092 description: impl Into<String>,
7093 ) -> Env {
7094 let mut query = self.selection.select("withGeneratorGroupOutput");
7095 query = query.arg("name", name.into());
7096 query = query.arg("description", description.into());
7097 Env {
7098 proc: self.proc.clone(),
7099 selection: query,
7100 graphql_client: self.graphql_client.clone(),
7101 }
7102 }
7103 pub fn with_generator_input(
7111 &self,
7112 name: impl Into<String>,
7113 value: impl IntoID<Id>,
7114 description: impl Into<String>,
7115 ) -> Env {
7116 let mut query = self.selection.select("withGeneratorInput");
7117 query = query.arg("name", name.into());
7118 query = query.arg_lazy(
7119 "value",
7120 Box::new(move || {
7121 let value = value.clone();
7122 Box::pin(async move { value.into_id().await.unwrap().quote() })
7123 }),
7124 );
7125 query = query.arg("description", description.into());
7126 Env {
7127 proc: self.proc.clone(),
7128 selection: query,
7129 graphql_client: self.graphql_client.clone(),
7130 }
7131 }
7132 pub fn with_generator_output(
7139 &self,
7140 name: impl Into<String>,
7141 description: impl Into<String>,
7142 ) -> Env {
7143 let mut query = self.selection.select("withGeneratorOutput");
7144 query = query.arg("name", name.into());
7145 query = query.arg("description", description.into());
7146 Env {
7147 proc: self.proc.clone(),
7148 selection: query,
7149 graphql_client: self.graphql_client.clone(),
7150 }
7151 }
7152 pub fn with_git_ref_input(
7160 &self,
7161 name: impl Into<String>,
7162 value: impl IntoID<Id>,
7163 description: impl Into<String>,
7164 ) -> Env {
7165 let mut query = self.selection.select("withGitRefInput");
7166 query = query.arg("name", name.into());
7167 query = query.arg_lazy(
7168 "value",
7169 Box::new(move || {
7170 let value = value.clone();
7171 Box::pin(async move { value.into_id().await.unwrap().quote() })
7172 }),
7173 );
7174 query = query.arg("description", description.into());
7175 Env {
7176 proc: self.proc.clone(),
7177 selection: query,
7178 graphql_client: self.graphql_client.clone(),
7179 }
7180 }
7181 pub fn with_git_ref_output(
7188 &self,
7189 name: impl Into<String>,
7190 description: impl Into<String>,
7191 ) -> Env {
7192 let mut query = self.selection.select("withGitRefOutput");
7193 query = query.arg("name", name.into());
7194 query = query.arg("description", description.into());
7195 Env {
7196 proc: self.proc.clone(),
7197 selection: query,
7198 graphql_client: self.graphql_client.clone(),
7199 }
7200 }
7201 pub fn with_git_repository_input(
7209 &self,
7210 name: impl Into<String>,
7211 value: impl IntoID<Id>,
7212 description: impl Into<String>,
7213 ) -> Env {
7214 let mut query = self.selection.select("withGitRepositoryInput");
7215 query = query.arg("name", name.into());
7216 query = query.arg_lazy(
7217 "value",
7218 Box::new(move || {
7219 let value = value.clone();
7220 Box::pin(async move { value.into_id().await.unwrap().quote() })
7221 }),
7222 );
7223 query = query.arg("description", description.into());
7224 Env {
7225 proc: self.proc.clone(),
7226 selection: query,
7227 graphql_client: self.graphql_client.clone(),
7228 }
7229 }
7230 pub fn with_git_repository_output(
7237 &self,
7238 name: impl Into<String>,
7239 description: impl Into<String>,
7240 ) -> Env {
7241 let mut query = self.selection.select("withGitRepositoryOutput");
7242 query = query.arg("name", name.into());
7243 query = query.arg("description", description.into());
7244 Env {
7245 proc: self.proc.clone(),
7246 selection: query,
7247 graphql_client: self.graphql_client.clone(),
7248 }
7249 }
7250 pub fn with_http_state_input(
7258 &self,
7259 name: impl Into<String>,
7260 value: impl IntoID<Id>,
7261 description: impl Into<String>,
7262 ) -> Env {
7263 let mut query = self.selection.select("withHTTPStateInput");
7264 query = query.arg("name", name.into());
7265 query = query.arg_lazy(
7266 "value",
7267 Box::new(move || {
7268 let value = value.clone();
7269 Box::pin(async move { value.into_id().await.unwrap().quote() })
7270 }),
7271 );
7272 query = query.arg("description", description.into());
7273 Env {
7274 proc: self.proc.clone(),
7275 selection: query,
7276 graphql_client: self.graphql_client.clone(),
7277 }
7278 }
7279 pub fn with_http_state_output(
7286 &self,
7287 name: impl Into<String>,
7288 description: impl Into<String>,
7289 ) -> Env {
7290 let mut query = self.selection.select("withHTTPStateOutput");
7291 query = query.arg("name", name.into());
7292 query = query.arg("description", description.into());
7293 Env {
7294 proc: self.proc.clone(),
7295 selection: query,
7296 graphql_client: self.graphql_client.clone(),
7297 }
7298 }
7299 pub fn with_json_value_input(
7307 &self,
7308 name: impl Into<String>,
7309 value: impl IntoID<Id>,
7310 description: impl Into<String>,
7311 ) -> Env {
7312 let mut query = self.selection.select("withJSONValueInput");
7313 query = query.arg("name", name.into());
7314 query = query.arg_lazy(
7315 "value",
7316 Box::new(move || {
7317 let value = value.clone();
7318 Box::pin(async move { value.into_id().await.unwrap().quote() })
7319 }),
7320 );
7321 query = query.arg("description", description.into());
7322 Env {
7323 proc: self.proc.clone(),
7324 selection: query,
7325 graphql_client: self.graphql_client.clone(),
7326 }
7327 }
7328 pub fn with_json_value_output(
7335 &self,
7336 name: impl Into<String>,
7337 description: impl Into<String>,
7338 ) -> Env {
7339 let mut query = self.selection.select("withJSONValueOutput");
7340 query = query.arg("name", name.into());
7341 query = query.arg("description", description.into());
7342 Env {
7343 proc: self.proc.clone(),
7344 selection: query,
7345 graphql_client: self.graphql_client.clone(),
7346 }
7347 }
7348 pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7351 let mut query = self.selection.select("withMainModule");
7352 query = query.arg_lazy(
7353 "module",
7354 Box::new(move || {
7355 let module = module.clone();
7356 Box::pin(async move { module.into_id().await.unwrap().quote() })
7357 }),
7358 );
7359 Env {
7360 proc: self.proc.clone(),
7361 selection: query,
7362 graphql_client: self.graphql_client.clone(),
7363 }
7364 }
7365 pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7368 let mut query = self.selection.select("withModule");
7369 query = query.arg_lazy(
7370 "module",
7371 Box::new(move || {
7372 let module = module.clone();
7373 Box::pin(async move { module.into_id().await.unwrap().quote() })
7374 }),
7375 );
7376 Env {
7377 proc: self.proc.clone(),
7378 selection: query,
7379 graphql_client: self.graphql_client.clone(),
7380 }
7381 }
7382 pub fn with_module_config_client_input(
7390 &self,
7391 name: impl Into<String>,
7392 value: impl IntoID<Id>,
7393 description: impl Into<String>,
7394 ) -> Env {
7395 let mut query = self.selection.select("withModuleConfigClientInput");
7396 query = query.arg("name", name.into());
7397 query = query.arg_lazy(
7398 "value",
7399 Box::new(move || {
7400 let value = value.clone();
7401 Box::pin(async move { value.into_id().await.unwrap().quote() })
7402 }),
7403 );
7404 query = query.arg("description", description.into());
7405 Env {
7406 proc: self.proc.clone(),
7407 selection: query,
7408 graphql_client: self.graphql_client.clone(),
7409 }
7410 }
7411 pub fn with_module_config_client_output(
7418 &self,
7419 name: impl Into<String>,
7420 description: impl Into<String>,
7421 ) -> Env {
7422 let mut query = self.selection.select("withModuleConfigClientOutput");
7423 query = query.arg("name", name.into());
7424 query = query.arg("description", description.into());
7425 Env {
7426 proc: self.proc.clone(),
7427 selection: query,
7428 graphql_client: self.graphql_client.clone(),
7429 }
7430 }
7431 pub fn with_module_input(
7439 &self,
7440 name: impl Into<String>,
7441 value: impl IntoID<Id>,
7442 description: impl Into<String>,
7443 ) -> Env {
7444 let mut query = self.selection.select("withModuleInput");
7445 query = query.arg("name", name.into());
7446 query = query.arg_lazy(
7447 "value",
7448 Box::new(move || {
7449 let value = value.clone();
7450 Box::pin(async move { value.into_id().await.unwrap().quote() })
7451 }),
7452 );
7453 query = query.arg("description", description.into());
7454 Env {
7455 proc: self.proc.clone(),
7456 selection: query,
7457 graphql_client: self.graphql_client.clone(),
7458 }
7459 }
7460 pub fn with_module_output(
7467 &self,
7468 name: impl Into<String>,
7469 description: impl Into<String>,
7470 ) -> Env {
7471 let mut query = self.selection.select("withModuleOutput");
7472 query = query.arg("name", name.into());
7473 query = query.arg("description", description.into());
7474 Env {
7475 proc: self.proc.clone(),
7476 selection: query,
7477 graphql_client: self.graphql_client.clone(),
7478 }
7479 }
7480 pub fn with_module_source_input(
7488 &self,
7489 name: impl Into<String>,
7490 value: impl IntoID<Id>,
7491 description: impl Into<String>,
7492 ) -> Env {
7493 let mut query = self.selection.select("withModuleSourceInput");
7494 query = query.arg("name", name.into());
7495 query = query.arg_lazy(
7496 "value",
7497 Box::new(move || {
7498 let value = value.clone();
7499 Box::pin(async move { value.into_id().await.unwrap().quote() })
7500 }),
7501 );
7502 query = query.arg("description", description.into());
7503 Env {
7504 proc: self.proc.clone(),
7505 selection: query,
7506 graphql_client: self.graphql_client.clone(),
7507 }
7508 }
7509 pub fn with_module_source_output(
7516 &self,
7517 name: impl Into<String>,
7518 description: impl Into<String>,
7519 ) -> Env {
7520 let mut query = self.selection.select("withModuleSourceOutput");
7521 query = query.arg("name", name.into());
7522 query = query.arg("description", description.into());
7523 Env {
7524 proc: self.proc.clone(),
7525 selection: query,
7526 graphql_client: self.graphql_client.clone(),
7527 }
7528 }
7529 pub fn with_search_result_input(
7537 &self,
7538 name: impl Into<String>,
7539 value: impl IntoID<Id>,
7540 description: impl Into<String>,
7541 ) -> Env {
7542 let mut query = self.selection.select("withSearchResultInput");
7543 query = query.arg("name", name.into());
7544 query = query.arg_lazy(
7545 "value",
7546 Box::new(move || {
7547 let value = value.clone();
7548 Box::pin(async move { value.into_id().await.unwrap().quote() })
7549 }),
7550 );
7551 query = query.arg("description", description.into());
7552 Env {
7553 proc: self.proc.clone(),
7554 selection: query,
7555 graphql_client: self.graphql_client.clone(),
7556 }
7557 }
7558 pub fn with_search_result_output(
7565 &self,
7566 name: impl Into<String>,
7567 description: impl Into<String>,
7568 ) -> Env {
7569 let mut query = self.selection.select("withSearchResultOutput");
7570 query = query.arg("name", name.into());
7571 query = query.arg("description", description.into());
7572 Env {
7573 proc: self.proc.clone(),
7574 selection: query,
7575 graphql_client: self.graphql_client.clone(),
7576 }
7577 }
7578 pub fn with_search_submatch_input(
7586 &self,
7587 name: impl Into<String>,
7588 value: impl IntoID<Id>,
7589 description: impl Into<String>,
7590 ) -> Env {
7591 let mut query = self.selection.select("withSearchSubmatchInput");
7592 query = query.arg("name", name.into());
7593 query = query.arg_lazy(
7594 "value",
7595 Box::new(move || {
7596 let value = value.clone();
7597 Box::pin(async move { value.into_id().await.unwrap().quote() })
7598 }),
7599 );
7600 query = query.arg("description", description.into());
7601 Env {
7602 proc: self.proc.clone(),
7603 selection: query,
7604 graphql_client: self.graphql_client.clone(),
7605 }
7606 }
7607 pub fn with_search_submatch_output(
7614 &self,
7615 name: impl Into<String>,
7616 description: impl Into<String>,
7617 ) -> Env {
7618 let mut query = self.selection.select("withSearchSubmatchOutput");
7619 query = query.arg("name", name.into());
7620 query = query.arg("description", description.into());
7621 Env {
7622 proc: self.proc.clone(),
7623 selection: query,
7624 graphql_client: self.graphql_client.clone(),
7625 }
7626 }
7627 pub fn with_secret_input(
7635 &self,
7636 name: impl Into<String>,
7637 value: impl IntoID<Id>,
7638 description: impl Into<String>,
7639 ) -> Env {
7640 let mut query = self.selection.select("withSecretInput");
7641 query = query.arg("name", name.into());
7642 query = query.arg_lazy(
7643 "value",
7644 Box::new(move || {
7645 let value = value.clone();
7646 Box::pin(async move { value.into_id().await.unwrap().quote() })
7647 }),
7648 );
7649 query = query.arg("description", description.into());
7650 Env {
7651 proc: self.proc.clone(),
7652 selection: query,
7653 graphql_client: self.graphql_client.clone(),
7654 }
7655 }
7656 pub fn with_secret_output(
7663 &self,
7664 name: impl Into<String>,
7665 description: impl Into<String>,
7666 ) -> Env {
7667 let mut query = self.selection.select("withSecretOutput");
7668 query = query.arg("name", name.into());
7669 query = query.arg("description", description.into());
7670 Env {
7671 proc: self.proc.clone(),
7672 selection: query,
7673 graphql_client: self.graphql_client.clone(),
7674 }
7675 }
7676 pub fn with_service_input(
7684 &self,
7685 name: impl Into<String>,
7686 value: impl IntoID<Id>,
7687 description: impl Into<String>,
7688 ) -> Env {
7689 let mut query = self.selection.select("withServiceInput");
7690 query = query.arg("name", name.into());
7691 query = query.arg_lazy(
7692 "value",
7693 Box::new(move || {
7694 let value = value.clone();
7695 Box::pin(async move { value.into_id().await.unwrap().quote() })
7696 }),
7697 );
7698 query = query.arg("description", description.into());
7699 Env {
7700 proc: self.proc.clone(),
7701 selection: query,
7702 graphql_client: self.graphql_client.clone(),
7703 }
7704 }
7705 pub fn with_service_output(
7712 &self,
7713 name: impl Into<String>,
7714 description: impl Into<String>,
7715 ) -> Env {
7716 let mut query = self.selection.select("withServiceOutput");
7717 query = query.arg("name", name.into());
7718 query = query.arg("description", description.into());
7719 Env {
7720 proc: self.proc.clone(),
7721 selection: query,
7722 graphql_client: self.graphql_client.clone(),
7723 }
7724 }
7725 pub fn with_socket_input(
7733 &self,
7734 name: impl Into<String>,
7735 value: impl IntoID<Id>,
7736 description: impl Into<String>,
7737 ) -> Env {
7738 let mut query = self.selection.select("withSocketInput");
7739 query = query.arg("name", name.into());
7740 query = query.arg_lazy(
7741 "value",
7742 Box::new(move || {
7743 let value = value.clone();
7744 Box::pin(async move { value.into_id().await.unwrap().quote() })
7745 }),
7746 );
7747 query = query.arg("description", description.into());
7748 Env {
7749 proc: self.proc.clone(),
7750 selection: query,
7751 graphql_client: self.graphql_client.clone(),
7752 }
7753 }
7754 pub fn with_socket_output(
7761 &self,
7762 name: impl Into<String>,
7763 description: impl Into<String>,
7764 ) -> Env {
7765 let mut query = self.selection.select("withSocketOutput");
7766 query = query.arg("name", name.into());
7767 query = query.arg("description", description.into());
7768 Env {
7769 proc: self.proc.clone(),
7770 selection: query,
7771 graphql_client: self.graphql_client.clone(),
7772 }
7773 }
7774 pub fn with_stat_input(
7782 &self,
7783 name: impl Into<String>,
7784 value: impl IntoID<Id>,
7785 description: impl Into<String>,
7786 ) -> Env {
7787 let mut query = self.selection.select("withStatInput");
7788 query = query.arg("name", name.into());
7789 query = query.arg_lazy(
7790 "value",
7791 Box::new(move || {
7792 let value = value.clone();
7793 Box::pin(async move { value.into_id().await.unwrap().quote() })
7794 }),
7795 );
7796 query = query.arg("description", description.into());
7797 Env {
7798 proc: self.proc.clone(),
7799 selection: query,
7800 graphql_client: self.graphql_client.clone(),
7801 }
7802 }
7803 pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7810 let mut query = self.selection.select("withStatOutput");
7811 query = query.arg("name", name.into());
7812 query = query.arg("description", description.into());
7813 Env {
7814 proc: self.proc.clone(),
7815 selection: query,
7816 graphql_client: self.graphql_client.clone(),
7817 }
7818 }
7819 pub fn with_string_input(
7827 &self,
7828 name: impl Into<String>,
7829 value: impl Into<String>,
7830 description: impl Into<String>,
7831 ) -> Env {
7832 let mut query = self.selection.select("withStringInput");
7833 query = query.arg("name", name.into());
7834 query = query.arg("value", value.into());
7835 query = query.arg("description", description.into());
7836 Env {
7837 proc: self.proc.clone(),
7838 selection: query,
7839 graphql_client: self.graphql_client.clone(),
7840 }
7841 }
7842 pub fn with_string_output(
7849 &self,
7850 name: impl Into<String>,
7851 description: impl Into<String>,
7852 ) -> Env {
7853 let mut query = self.selection.select("withStringOutput");
7854 query = query.arg("name", name.into());
7855 query = query.arg("description", description.into());
7856 Env {
7857 proc: self.proc.clone(),
7858 selection: query,
7859 graphql_client: self.graphql_client.clone(),
7860 }
7861 }
7862 pub fn with_up_group_input(
7870 &self,
7871 name: impl Into<String>,
7872 value: impl IntoID<Id>,
7873 description: impl Into<String>,
7874 ) -> Env {
7875 let mut query = self.selection.select("withUpGroupInput");
7876 query = query.arg("name", name.into());
7877 query = query.arg_lazy(
7878 "value",
7879 Box::new(move || {
7880 let value = value.clone();
7881 Box::pin(async move { value.into_id().await.unwrap().quote() })
7882 }),
7883 );
7884 query = query.arg("description", description.into());
7885 Env {
7886 proc: self.proc.clone(),
7887 selection: query,
7888 graphql_client: self.graphql_client.clone(),
7889 }
7890 }
7891 pub fn with_up_group_output(
7898 &self,
7899 name: impl Into<String>,
7900 description: impl Into<String>,
7901 ) -> Env {
7902 let mut query = self.selection.select("withUpGroupOutput");
7903 query = query.arg("name", name.into());
7904 query = query.arg("description", description.into());
7905 Env {
7906 proc: self.proc.clone(),
7907 selection: query,
7908 graphql_client: self.graphql_client.clone(),
7909 }
7910 }
7911 pub fn with_up_input(
7919 &self,
7920 name: impl Into<String>,
7921 value: impl IntoID<Id>,
7922 description: impl Into<String>,
7923 ) -> Env {
7924 let mut query = self.selection.select("withUpInput");
7925 query = query.arg("name", name.into());
7926 query = query.arg_lazy(
7927 "value",
7928 Box::new(move || {
7929 let value = value.clone();
7930 Box::pin(async move { value.into_id().await.unwrap().quote() })
7931 }),
7932 );
7933 query = query.arg("description", description.into());
7934 Env {
7935 proc: self.proc.clone(),
7936 selection: query,
7937 graphql_client: self.graphql_client.clone(),
7938 }
7939 }
7940 pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7947 let mut query = self.selection.select("withUpOutput");
7948 query = query.arg("name", name.into());
7949 query = query.arg("description", description.into());
7950 Env {
7951 proc: self.proc.clone(),
7952 selection: query,
7953 graphql_client: self.graphql_client.clone(),
7954 }
7955 }
7956 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
7962 let mut query = self.selection.select("withWorkspace");
7963 query = query.arg_lazy(
7964 "workspace",
7965 Box::new(move || {
7966 let workspace = workspace.clone();
7967 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7968 }),
7969 );
7970 Env {
7971 proc: self.proc.clone(),
7972 selection: query,
7973 graphql_client: self.graphql_client.clone(),
7974 }
7975 }
7976 pub fn with_workspace_input(
7984 &self,
7985 name: impl Into<String>,
7986 value: impl IntoID<Id>,
7987 description: impl Into<String>,
7988 ) -> Env {
7989 let mut query = self.selection.select("withWorkspaceInput");
7990 query = query.arg("name", name.into());
7991 query = query.arg_lazy(
7992 "value",
7993 Box::new(move || {
7994 let value = value.clone();
7995 Box::pin(async move { value.into_id().await.unwrap().quote() })
7996 }),
7997 );
7998 query = query.arg("description", description.into());
7999 Env {
8000 proc: self.proc.clone(),
8001 selection: query,
8002 graphql_client: self.graphql_client.clone(),
8003 }
8004 }
8005 pub fn with_workspace_output(
8012 &self,
8013 name: impl Into<String>,
8014 description: impl Into<String>,
8015 ) -> Env {
8016 let mut query = self.selection.select("withWorkspaceOutput");
8017 query = query.arg("name", name.into());
8018 query = query.arg("description", description.into());
8019 Env {
8020 proc: self.proc.clone(),
8021 selection: query,
8022 graphql_client: self.graphql_client.clone(),
8023 }
8024 }
8025 pub fn without_outputs(&self) -> Env {
8027 let query = self.selection.select("withoutOutputs");
8028 Env {
8029 proc: self.proc.clone(),
8030 selection: query,
8031 graphql_client: self.graphql_client.clone(),
8032 }
8033 }
8034 pub fn workspace(&self) -> Directory {
8035 let query = self.selection.select("workspace");
8036 Directory {
8037 proc: self.proc.clone(),
8038 selection: query,
8039 graphql_client: self.graphql_client.clone(),
8040 }
8041 }
8042}
8043impl Node for Env {
8044 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8045 let query = self.selection.select("id");
8046 let graphql_client = self.graphql_client.clone();
8047 async move { query.execute(graphql_client).await }
8048 }
8049}
8050#[derive(Clone)]
8051pub struct EnvFile {
8052 pub proc: Option<Arc<DaggerSessionProc>>,
8053 pub selection: Selection,
8054 pub graphql_client: DynGraphQLClient,
8055}
8056#[derive(Builder, Debug, PartialEq)]
8057pub struct EnvFileGetOpts {
8058 #[builder(setter(into, strip_option), default)]
8060 pub raw: Option<bool>,
8061}
8062#[derive(Builder, Debug, PartialEq)]
8063pub struct EnvFileVariablesOpts {
8064 #[builder(setter(into, strip_option), default)]
8066 pub raw: Option<bool>,
8067}
8068impl IntoID<Id> for EnvFile {
8069 fn into_id(
8070 self,
8071 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8072 Box::pin(async move { self.id().await })
8073 }
8074}
8075impl Loadable for EnvFile {
8076 fn graphql_type() -> &'static str {
8077 "EnvFile"
8078 }
8079 fn from_query(
8080 proc: Option<Arc<DaggerSessionProc>>,
8081 selection: Selection,
8082 graphql_client: DynGraphQLClient,
8083 ) -> Self {
8084 Self {
8085 proc,
8086 selection,
8087 graphql_client,
8088 }
8089 }
8090}
8091impl EnvFile {
8092 pub fn as_file(&self) -> File {
8094 let query = self.selection.select("asFile");
8095 File {
8096 proc: self.proc.clone(),
8097 selection: query,
8098 graphql_client: self.graphql_client.clone(),
8099 }
8100 }
8101 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8107 let mut query = self.selection.select("exists");
8108 query = query.arg("name", name.into());
8109 query.execute(self.graphql_client.clone()).await
8110 }
8111 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8118 let mut query = self.selection.select("get");
8119 query = query.arg("name", name.into());
8120 query.execute(self.graphql_client.clone()).await
8121 }
8122 pub async fn get_opts(
8129 &self,
8130 name: impl Into<String>,
8131 opts: EnvFileGetOpts,
8132 ) -> Result<String, DaggerError> {
8133 let mut query = self.selection.select("get");
8134 query = query.arg("name", name.into());
8135 if let Some(raw) = opts.raw {
8136 query = query.arg("raw", raw);
8137 }
8138 query.execute(self.graphql_client.clone()).await
8139 }
8140 pub async fn id(&self) -> Result<Id, DaggerError> {
8142 let query = self.selection.select("id");
8143 query.execute(self.graphql_client.clone()).await
8144 }
8145 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8151 let mut query = self.selection.select("namespace");
8152 query = query.arg("prefix", prefix.into());
8153 EnvFile {
8154 proc: self.proc.clone(),
8155 selection: query,
8156 graphql_client: self.graphql_client.clone(),
8157 }
8158 }
8159 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8165 let query = self.selection.select("variables");
8166 let query = query.select("id");
8167 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8168 Ok(ids
8169 .into_iter()
8170 .map(|id| EnvVariable {
8171 proc: self.proc.clone(),
8172 selection: crate::querybuilder::query()
8173 .select("node")
8174 .arg("id", &id.0)
8175 .inline_fragment("EnvVariable"),
8176 graphql_client: self.graphql_client.clone(),
8177 })
8178 .collect())
8179 }
8180 pub async fn variables_opts(
8186 &self,
8187 opts: EnvFileVariablesOpts,
8188 ) -> Result<Vec<EnvVariable>, DaggerError> {
8189 let mut query = self.selection.select("variables");
8190 if let Some(raw) = opts.raw {
8191 query = query.arg("raw", raw);
8192 }
8193 let query = query.select("id");
8194 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8195 Ok(ids
8196 .into_iter()
8197 .map(|id| EnvVariable {
8198 proc: self.proc.clone(),
8199 selection: crate::querybuilder::query()
8200 .select("node")
8201 .arg("id", &id.0)
8202 .inline_fragment("EnvVariable"),
8203 graphql_client: self.graphql_client.clone(),
8204 })
8205 .collect())
8206 }
8207 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8214 let mut query = self.selection.select("withVariable");
8215 query = query.arg("name", name.into());
8216 query = query.arg("value", value.into());
8217 EnvFile {
8218 proc: self.proc.clone(),
8219 selection: query,
8220 graphql_client: self.graphql_client.clone(),
8221 }
8222 }
8223 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8229 let mut query = self.selection.select("withoutVariable");
8230 query = query.arg("name", name.into());
8231 EnvFile {
8232 proc: self.proc.clone(),
8233 selection: query,
8234 graphql_client: self.graphql_client.clone(),
8235 }
8236 }
8237}
8238impl Node for EnvFile {
8239 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8240 let query = self.selection.select("id");
8241 let graphql_client = self.graphql_client.clone();
8242 async move { query.execute(graphql_client).await }
8243 }
8244}
8245#[derive(Clone)]
8246pub struct EnvVariable {
8247 pub proc: Option<Arc<DaggerSessionProc>>,
8248 pub selection: Selection,
8249 pub graphql_client: DynGraphQLClient,
8250}
8251impl IntoID<Id> for EnvVariable {
8252 fn into_id(
8253 self,
8254 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8255 Box::pin(async move { self.id().await })
8256 }
8257}
8258impl Loadable for EnvVariable {
8259 fn graphql_type() -> &'static str {
8260 "EnvVariable"
8261 }
8262 fn from_query(
8263 proc: Option<Arc<DaggerSessionProc>>,
8264 selection: Selection,
8265 graphql_client: DynGraphQLClient,
8266 ) -> Self {
8267 Self {
8268 proc,
8269 selection,
8270 graphql_client,
8271 }
8272 }
8273}
8274impl EnvVariable {
8275 pub async fn id(&self) -> Result<Id, DaggerError> {
8277 let query = self.selection.select("id");
8278 query.execute(self.graphql_client.clone()).await
8279 }
8280 pub async fn name(&self) -> Result<String, DaggerError> {
8282 let query = self.selection.select("name");
8283 query.execute(self.graphql_client.clone()).await
8284 }
8285 pub async fn value(&self) -> Result<String, DaggerError> {
8287 let query = self.selection.select("value");
8288 query.execute(self.graphql_client.clone()).await
8289 }
8290}
8291impl Node for EnvVariable {
8292 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8293 let query = self.selection.select("id");
8294 let graphql_client = self.graphql_client.clone();
8295 async move { query.execute(graphql_client).await }
8296 }
8297}
8298#[derive(Clone)]
8299pub struct Error {
8300 pub proc: Option<Arc<DaggerSessionProc>>,
8301 pub selection: Selection,
8302 pub graphql_client: DynGraphQLClient,
8303}
8304impl IntoID<Id> for Error {
8305 fn into_id(
8306 self,
8307 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8308 Box::pin(async move { self.id().await })
8309 }
8310}
8311impl Loadable for Error {
8312 fn graphql_type() -> &'static str {
8313 "Error"
8314 }
8315 fn from_query(
8316 proc: Option<Arc<DaggerSessionProc>>,
8317 selection: Selection,
8318 graphql_client: DynGraphQLClient,
8319 ) -> Self {
8320 Self {
8321 proc,
8322 selection,
8323 graphql_client,
8324 }
8325 }
8326}
8327impl Error {
8328 pub async fn id(&self) -> Result<Id, DaggerError> {
8330 let query = self.selection.select("id");
8331 query.execute(self.graphql_client.clone()).await
8332 }
8333 pub async fn message(&self) -> Result<String, DaggerError> {
8335 let query = self.selection.select("message");
8336 query.execute(self.graphql_client.clone()).await
8337 }
8338 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8340 let query = self.selection.select("values");
8341 let query = query.select("id");
8342 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8343 Ok(ids
8344 .into_iter()
8345 .map(|id| ErrorValue {
8346 proc: self.proc.clone(),
8347 selection: crate::querybuilder::query()
8348 .select("node")
8349 .arg("id", &id.0)
8350 .inline_fragment("ErrorValue"),
8351 graphql_client: self.graphql_client.clone(),
8352 })
8353 .collect())
8354 }
8355 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8362 let mut query = self.selection.select("withValue");
8363 query = query.arg("name", name.into());
8364 query = query.arg("value", value);
8365 Error {
8366 proc: self.proc.clone(),
8367 selection: query,
8368 graphql_client: self.graphql_client.clone(),
8369 }
8370 }
8371}
8372impl Node for Error {
8373 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8374 let query = self.selection.select("id");
8375 let graphql_client = self.graphql_client.clone();
8376 async move { query.execute(graphql_client).await }
8377 }
8378}
8379#[derive(Clone)]
8380pub struct ErrorValue {
8381 pub proc: Option<Arc<DaggerSessionProc>>,
8382 pub selection: Selection,
8383 pub graphql_client: DynGraphQLClient,
8384}
8385impl IntoID<Id> for ErrorValue {
8386 fn into_id(
8387 self,
8388 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8389 Box::pin(async move { self.id().await })
8390 }
8391}
8392impl Loadable for ErrorValue {
8393 fn graphql_type() -> &'static str {
8394 "ErrorValue"
8395 }
8396 fn from_query(
8397 proc: Option<Arc<DaggerSessionProc>>,
8398 selection: Selection,
8399 graphql_client: DynGraphQLClient,
8400 ) -> Self {
8401 Self {
8402 proc,
8403 selection,
8404 graphql_client,
8405 }
8406 }
8407}
8408impl ErrorValue {
8409 pub async fn id(&self) -> Result<Id, DaggerError> {
8411 let query = self.selection.select("id");
8412 query.execute(self.graphql_client.clone()).await
8413 }
8414 pub async fn name(&self) -> Result<String, DaggerError> {
8416 let query = self.selection.select("name");
8417 query.execute(self.graphql_client.clone()).await
8418 }
8419 pub async fn value(&self) -> Result<Json, DaggerError> {
8421 let query = self.selection.select("value");
8422 query.execute(self.graphql_client.clone()).await
8423 }
8424}
8425impl Node for ErrorValue {
8426 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8427 let query = self.selection.select("id");
8428 let graphql_client = self.graphql_client.clone();
8429 async move { query.execute(graphql_client).await }
8430 }
8431}
8432#[derive(Clone)]
8433pub struct FieldTypeDef {
8434 pub proc: Option<Arc<DaggerSessionProc>>,
8435 pub selection: Selection,
8436 pub graphql_client: DynGraphQLClient,
8437}
8438impl IntoID<Id> for FieldTypeDef {
8439 fn into_id(
8440 self,
8441 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8442 Box::pin(async move { self.id().await })
8443 }
8444}
8445impl Loadable for FieldTypeDef {
8446 fn graphql_type() -> &'static str {
8447 "FieldTypeDef"
8448 }
8449 fn from_query(
8450 proc: Option<Arc<DaggerSessionProc>>,
8451 selection: Selection,
8452 graphql_client: DynGraphQLClient,
8453 ) -> Self {
8454 Self {
8455 proc,
8456 selection,
8457 graphql_client,
8458 }
8459 }
8460}
8461impl FieldTypeDef {
8462 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8464 let query = self.selection.select("deprecated");
8465 query.execute(self.graphql_client.clone()).await
8466 }
8467 pub async fn description(&self) -> Result<String, DaggerError> {
8469 let query = self.selection.select("description");
8470 query.execute(self.graphql_client.clone()).await
8471 }
8472 pub async fn id(&self) -> Result<Id, DaggerError> {
8474 let query = self.selection.select("id");
8475 query.execute(self.graphql_client.clone()).await
8476 }
8477 pub async fn name(&self) -> Result<String, DaggerError> {
8479 let query = self.selection.select("name");
8480 query.execute(self.graphql_client.clone()).await
8481 }
8482 pub fn source_map(&self) -> SourceMap {
8484 let query = self.selection.select("sourceMap");
8485 SourceMap {
8486 proc: self.proc.clone(),
8487 selection: query,
8488 graphql_client: self.graphql_client.clone(),
8489 }
8490 }
8491 pub fn type_def(&self) -> TypeDef {
8493 let query = self.selection.select("typeDef");
8494 TypeDef {
8495 proc: self.proc.clone(),
8496 selection: query,
8497 graphql_client: self.graphql_client.clone(),
8498 }
8499 }
8500}
8501impl Node for FieldTypeDef {
8502 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8503 let query = self.selection.select("id");
8504 let graphql_client = self.graphql_client.clone();
8505 async move { query.execute(graphql_client).await }
8506 }
8507}
8508#[derive(Clone)]
8509pub struct File {
8510 pub proc: Option<Arc<DaggerSessionProc>>,
8511 pub selection: Selection,
8512 pub graphql_client: DynGraphQLClient,
8513}
8514#[derive(Builder, Debug, PartialEq)]
8515pub struct FileAsEnvFileOpts {
8516 #[builder(setter(into, strip_option), default)]
8518 pub expand: Option<bool>,
8519}
8520#[derive(Builder, Debug, PartialEq)]
8521pub struct FileContentsOpts {
8522 #[builder(setter(into, strip_option), default)]
8524 pub limit_lines: Option<isize>,
8525 #[builder(setter(into, strip_option), default)]
8527 pub offset_lines: Option<isize>,
8528}
8529#[derive(Builder, Debug, PartialEq)]
8530pub struct FileDigestOpts {
8531 #[builder(setter(into, strip_option), default)]
8533 pub exclude_metadata: Option<bool>,
8534}
8535#[derive(Builder, Debug, PartialEq)]
8536pub struct FileExportOpts {
8537 #[builder(setter(into, strip_option), default)]
8539 pub allow_parent_dir_path: Option<bool>,
8540}
8541#[derive(Builder, Debug, PartialEq)]
8542pub struct FileSearchOpts<'a> {
8543 #[builder(setter(into, strip_option), default)]
8545 pub dotall: Option<bool>,
8546 #[builder(setter(into, strip_option), default)]
8548 pub files_only: Option<bool>,
8549 #[builder(setter(into, strip_option), default)]
8550 pub globs: Option<Vec<&'a str>>,
8551 #[builder(setter(into, strip_option), default)]
8553 pub insensitive: Option<bool>,
8554 #[builder(setter(into, strip_option), default)]
8556 pub limit: Option<isize>,
8557 #[builder(setter(into, strip_option), default)]
8559 pub literal: Option<bool>,
8560 #[builder(setter(into, strip_option), default)]
8562 pub multiline: Option<bool>,
8563 #[builder(setter(into, strip_option), default)]
8564 pub paths: Option<Vec<&'a str>>,
8565 #[builder(setter(into, strip_option), default)]
8567 pub skip_hidden: Option<bool>,
8568 #[builder(setter(into, strip_option), default)]
8570 pub skip_ignored: Option<bool>,
8571}
8572#[derive(Builder, Debug, PartialEq)]
8573pub struct FileWithReplacedOpts {
8574 #[builder(setter(into, strip_option), default)]
8576 pub all: Option<bool>,
8577 #[builder(setter(into, strip_option), default)]
8579 pub first_from: Option<isize>,
8580}
8581impl IntoID<Id> for File {
8582 fn into_id(
8583 self,
8584 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8585 Box::pin(async move { self.id().await })
8586 }
8587}
8588impl Loadable for File {
8589 fn graphql_type() -> &'static str {
8590 "File"
8591 }
8592 fn from_query(
8593 proc: Option<Arc<DaggerSessionProc>>,
8594 selection: Selection,
8595 graphql_client: DynGraphQLClient,
8596 ) -> Self {
8597 Self {
8598 proc,
8599 selection,
8600 graphql_client,
8601 }
8602 }
8603}
8604impl File {
8605 pub fn as_env_file(&self) -> EnvFile {
8611 let query = self.selection.select("asEnvFile");
8612 EnvFile {
8613 proc: self.proc.clone(),
8614 selection: query,
8615 graphql_client: self.graphql_client.clone(),
8616 }
8617 }
8618 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8624 let mut query = self.selection.select("asEnvFile");
8625 if let Some(expand) = opts.expand {
8626 query = query.arg("expand", expand);
8627 }
8628 EnvFile {
8629 proc: self.proc.clone(),
8630 selection: query,
8631 graphql_client: self.graphql_client.clone(),
8632 }
8633 }
8634 pub fn as_json(&self) -> JsonValue {
8636 let query = self.selection.select("asJSON");
8637 JsonValue {
8638 proc: self.proc.clone(),
8639 selection: query,
8640 graphql_client: self.graphql_client.clone(),
8641 }
8642 }
8643 pub fn chown(&self, owner: impl Into<String>) -> File {
8653 let mut query = self.selection.select("chown");
8654 query = query.arg("owner", owner.into());
8655 File {
8656 proc: self.proc.clone(),
8657 selection: query,
8658 graphql_client: self.graphql_client.clone(),
8659 }
8660 }
8661 pub async fn contents(&self) -> Result<String, DaggerError> {
8667 let query = self.selection.select("contents");
8668 query.execute(self.graphql_client.clone()).await
8669 }
8670 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8676 let mut query = self.selection.select("contents");
8677 if let Some(offset_lines) = opts.offset_lines {
8678 query = query.arg("offsetLines", offset_lines);
8679 }
8680 if let Some(limit_lines) = opts.limit_lines {
8681 query = query.arg("limitLines", limit_lines);
8682 }
8683 query.execute(self.graphql_client.clone()).await
8684 }
8685 pub async fn digest(&self) -> Result<String, DaggerError> {
8691 let query = self.selection.select("digest");
8692 query.execute(self.graphql_client.clone()).await
8693 }
8694 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8700 let mut query = self.selection.select("digest");
8701 if let Some(exclude_metadata) = opts.exclude_metadata {
8702 query = query.arg("excludeMetadata", exclude_metadata);
8703 }
8704 query.execute(self.graphql_client.clone()).await
8705 }
8706 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8713 let mut query = self.selection.select("export");
8714 query = query.arg("path", path.into());
8715 query.execute(self.graphql_client.clone()).await
8716 }
8717 pub async fn export_opts(
8724 &self,
8725 path: impl Into<String>,
8726 opts: FileExportOpts,
8727 ) -> Result<String, DaggerError> {
8728 let mut query = self.selection.select("export");
8729 query = query.arg("path", path.into());
8730 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8731 query = query.arg("allowParentDirPath", allow_parent_dir_path);
8732 }
8733 query.execute(self.graphql_client.clone()).await
8734 }
8735 pub async fn id(&self) -> Result<Id, DaggerError> {
8737 let query = self.selection.select("id");
8738 query.execute(self.graphql_client.clone()).await
8739 }
8740 pub async fn name(&self) -> Result<String, DaggerError> {
8742 let query = self.selection.select("name");
8743 query.execute(self.graphql_client.clone()).await
8744 }
8745 pub async fn search(
8753 &self,
8754 pattern: impl Into<String>,
8755 ) -> Result<Vec<SearchResult>, DaggerError> {
8756 let mut query = self.selection.select("search");
8757 query = query.arg("pattern", pattern.into());
8758 let query = query.select("id");
8759 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8760 Ok(ids
8761 .into_iter()
8762 .map(|id| SearchResult {
8763 proc: self.proc.clone(),
8764 selection: crate::querybuilder::query()
8765 .select("node")
8766 .arg("id", &id.0)
8767 .inline_fragment("SearchResult"),
8768 graphql_client: self.graphql_client.clone(),
8769 })
8770 .collect())
8771 }
8772 pub async fn search_opts<'a>(
8780 &self,
8781 pattern: impl Into<String>,
8782 opts: FileSearchOpts<'a>,
8783 ) -> Result<Vec<SearchResult>, DaggerError> {
8784 let mut query = self.selection.select("search");
8785 query = query.arg("pattern", pattern.into());
8786 if let Some(literal) = opts.literal {
8787 query = query.arg("literal", literal);
8788 }
8789 if let Some(multiline) = opts.multiline {
8790 query = query.arg("multiline", multiline);
8791 }
8792 if let Some(dotall) = opts.dotall {
8793 query = query.arg("dotall", dotall);
8794 }
8795 if let Some(insensitive) = opts.insensitive {
8796 query = query.arg("insensitive", insensitive);
8797 }
8798 if let Some(skip_ignored) = opts.skip_ignored {
8799 query = query.arg("skipIgnored", skip_ignored);
8800 }
8801 if let Some(skip_hidden) = opts.skip_hidden {
8802 query = query.arg("skipHidden", skip_hidden);
8803 }
8804 if let Some(files_only) = opts.files_only {
8805 query = query.arg("filesOnly", files_only);
8806 }
8807 if let Some(limit) = opts.limit {
8808 query = query.arg("limit", limit);
8809 }
8810 if let Some(paths) = opts.paths {
8811 query = query.arg("paths", paths);
8812 }
8813 if let Some(globs) = opts.globs {
8814 query = query.arg("globs", globs);
8815 }
8816 let query = query.select("id");
8817 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8818 Ok(ids
8819 .into_iter()
8820 .map(|id| SearchResult {
8821 proc: self.proc.clone(),
8822 selection: crate::querybuilder::query()
8823 .select("node")
8824 .arg("id", &id.0)
8825 .inline_fragment("SearchResult"),
8826 graphql_client: self.graphql_client.clone(),
8827 })
8828 .collect())
8829 }
8830 pub async fn size(&self) -> Result<isize, DaggerError> {
8832 let query = self.selection.select("size");
8833 query.execute(self.graphql_client.clone()).await
8834 }
8835 pub fn stat(&self) -> Stat {
8837 let query = self.selection.select("stat");
8838 Stat {
8839 proc: self.proc.clone(),
8840 selection: query,
8841 graphql_client: self.graphql_client.clone(),
8842 }
8843 }
8844 pub async fn sync(&self) -> Result<File, DaggerError> {
8846 let query = self.selection.select("sync");
8847 let id: Id = query.execute(self.graphql_client.clone()).await?;
8848 Ok(File {
8849 proc: self.proc.clone(),
8850 selection: query
8851 .root()
8852 .select("node")
8853 .arg("id", &id.0)
8854 .inline_fragment("File"),
8855 graphql_client: self.graphql_client.clone(),
8856 })
8857 }
8858 pub fn with_name(&self, name: impl Into<String>) -> File {
8864 let mut query = self.selection.select("withName");
8865 query = query.arg("name", name.into());
8866 File {
8867 proc: self.proc.clone(),
8868 selection: query,
8869 graphql_client: self.graphql_client.clone(),
8870 }
8871 }
8872 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8884 let mut query = self.selection.select("withReplaced");
8885 query = query.arg("search", search.into());
8886 query = query.arg("replacement", replacement.into());
8887 File {
8888 proc: self.proc.clone(),
8889 selection: query,
8890 graphql_client: self.graphql_client.clone(),
8891 }
8892 }
8893 pub fn with_replaced_opts(
8905 &self,
8906 search: impl Into<String>,
8907 replacement: impl Into<String>,
8908 opts: FileWithReplacedOpts,
8909 ) -> File {
8910 let mut query = self.selection.select("withReplaced");
8911 query = query.arg("search", search.into());
8912 query = query.arg("replacement", replacement.into());
8913 if let Some(all) = opts.all {
8914 query = query.arg("all", all);
8915 }
8916 if let Some(first_from) = opts.first_from {
8917 query = query.arg("firstFrom", first_from);
8918 }
8919 File {
8920 proc: self.proc.clone(),
8921 selection: query,
8922 graphql_client: self.graphql_client.clone(),
8923 }
8924 }
8925 pub fn with_timestamps(&self, timestamp: isize) -> File {
8933 let mut query = self.selection.select("withTimestamps");
8934 query = query.arg("timestamp", timestamp);
8935 File {
8936 proc: self.proc.clone(),
8937 selection: query,
8938 graphql_client: self.graphql_client.clone(),
8939 }
8940 }
8941}
8942impl Exportable for File {
8943 fn export(
8944 &self,
8945 path: impl Into<String>,
8946 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
8947 let mut query = self.selection.select("export");
8948 query = query.arg("path", path.into());
8949 let graphql_client = self.graphql_client.clone();
8950 async move { query.execute(graphql_client).await }
8951 }
8952 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8953 let query = self.selection.select("id");
8954 let graphql_client = self.graphql_client.clone();
8955 async move { query.execute(graphql_client).await }
8956 }
8957}
8958impl Node for File {
8959 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8960 let query = self.selection.select("id");
8961 let graphql_client = self.graphql_client.clone();
8962 async move { query.execute(graphql_client).await }
8963 }
8964}
8965impl Syncer for File {
8966 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8967 let query = self.selection.select("id");
8968 let graphql_client = self.graphql_client.clone();
8969 async move { query.execute(graphql_client).await }
8970 }
8971 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8972 let query = self.selection.select("sync");
8973 let graphql_client = self.graphql_client.clone();
8974 async move { query.execute(graphql_client).await }
8975 }
8976}
8977#[derive(Clone)]
8978pub struct Function {
8979 pub proc: Option<Arc<DaggerSessionProc>>,
8980 pub selection: Selection,
8981 pub graphql_client: DynGraphQLClient,
8982}
8983#[derive(Builder, Debug, PartialEq)]
8984pub struct FunctionWithArgOpts<'a> {
8985 #[builder(setter(into, strip_option), default)]
8986 pub default_address: Option<&'a str>,
8987 #[builder(setter(into, strip_option), default)]
8989 pub default_path: Option<&'a str>,
8990 #[builder(setter(into, strip_option), default)]
8992 pub default_value: Option<Json>,
8993 #[builder(setter(into, strip_option), default)]
8995 pub deprecated: Option<&'a str>,
8996 #[builder(setter(into, strip_option), default)]
8998 pub description: Option<&'a str>,
8999 #[builder(setter(into, strip_option), default)]
9001 pub ignore: Option<Vec<&'a str>>,
9002 #[builder(setter(into, strip_option), default)]
9004 pub source_map: Option<Id>,
9005}
9006#[derive(Builder, Debug, PartialEq)]
9007pub struct FunctionWithCachePolicyOpts<'a> {
9008 #[builder(setter(into, strip_option), default)]
9010 pub time_to_live: Option<&'a str>,
9011}
9012#[derive(Builder, Debug, PartialEq)]
9013pub struct FunctionWithDeprecatedOpts<'a> {
9014 #[builder(setter(into, strip_option), default)]
9016 pub reason: Option<&'a str>,
9017}
9018impl IntoID<Id> for Function {
9019 fn into_id(
9020 self,
9021 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9022 Box::pin(async move { self.id().await })
9023 }
9024}
9025impl Loadable for Function {
9026 fn graphql_type() -> &'static str {
9027 "Function"
9028 }
9029 fn from_query(
9030 proc: Option<Arc<DaggerSessionProc>>,
9031 selection: Selection,
9032 graphql_client: DynGraphQLClient,
9033 ) -> Self {
9034 Self {
9035 proc,
9036 selection,
9037 graphql_client,
9038 }
9039 }
9040}
9041impl Function {
9042 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9044 let query = self.selection.select("args");
9045 let query = query.select("id");
9046 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9047 Ok(ids
9048 .into_iter()
9049 .map(|id| FunctionArg {
9050 proc: self.proc.clone(),
9051 selection: crate::querybuilder::query()
9052 .select("node")
9053 .arg("id", &id.0)
9054 .inline_fragment("FunctionArg"),
9055 graphql_client: self.graphql_client.clone(),
9056 })
9057 .collect())
9058 }
9059 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9061 let query = self.selection.select("deprecated");
9062 query.execute(self.graphql_client.clone()).await
9063 }
9064 pub async fn description(&self) -> Result<String, DaggerError> {
9066 let query = self.selection.select("description");
9067 query.execute(self.graphql_client.clone()).await
9068 }
9069 pub async fn id(&self) -> Result<Id, DaggerError> {
9071 let query = self.selection.select("id");
9072 query.execute(self.graphql_client.clone()).await
9073 }
9074 pub async fn name(&self) -> Result<String, DaggerError> {
9076 let query = self.selection.select("name");
9077 query.execute(self.graphql_client.clone()).await
9078 }
9079 pub fn return_type(&self) -> TypeDef {
9081 let query = self.selection.select("returnType");
9082 TypeDef {
9083 proc: self.proc.clone(),
9084 selection: query,
9085 graphql_client: self.graphql_client.clone(),
9086 }
9087 }
9088 pub fn source_map(&self) -> SourceMap {
9090 let query = self.selection.select("sourceMap");
9091 SourceMap {
9092 proc: self.proc.clone(),
9093 selection: query,
9094 graphql_client: self.graphql_client.clone(),
9095 }
9096 }
9097 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9099 let query = self.selection.select("sourceModuleName");
9100 query.execute(self.graphql_client.clone()).await
9101 }
9102 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9110 let mut query = self.selection.select("withArg");
9111 query = query.arg("name", name.into());
9112 query = query.arg_lazy(
9113 "typeDef",
9114 Box::new(move || {
9115 let type_def = type_def.clone();
9116 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9117 }),
9118 );
9119 Function {
9120 proc: self.proc.clone(),
9121 selection: query,
9122 graphql_client: self.graphql_client.clone(),
9123 }
9124 }
9125 pub fn with_arg_opts<'a>(
9133 &self,
9134 name: impl Into<String>,
9135 type_def: impl IntoID<Id>,
9136 opts: FunctionWithArgOpts<'a>,
9137 ) -> Function {
9138 let mut query = self.selection.select("withArg");
9139 query = query.arg("name", name.into());
9140 query = query.arg_lazy(
9141 "typeDef",
9142 Box::new(move || {
9143 let type_def = type_def.clone();
9144 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9145 }),
9146 );
9147 if let Some(description) = opts.description {
9148 query = query.arg("description", description);
9149 }
9150 if let Some(default_value) = opts.default_value {
9151 query = query.arg("defaultValue", default_value);
9152 }
9153 if let Some(default_path) = opts.default_path {
9154 query = query.arg("defaultPath", default_path);
9155 }
9156 if let Some(ignore) = opts.ignore {
9157 query = query.arg("ignore", ignore);
9158 }
9159 if let Some(source_map) = opts.source_map {
9160 query = query.arg("sourceMap", source_map);
9161 }
9162 if let Some(deprecated) = opts.deprecated {
9163 query = query.arg("deprecated", deprecated);
9164 }
9165 if let Some(default_address) = opts.default_address {
9166 query = query.arg("defaultAddress", default_address);
9167 }
9168 Function {
9169 proc: self.proc.clone(),
9170 selection: query,
9171 graphql_client: self.graphql_client.clone(),
9172 }
9173 }
9174 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9181 let mut query = self.selection.select("withCachePolicy");
9182 query = query.arg("policy", policy);
9183 Function {
9184 proc: self.proc.clone(),
9185 selection: query,
9186 graphql_client: self.graphql_client.clone(),
9187 }
9188 }
9189 pub fn with_cache_policy_opts<'a>(
9196 &self,
9197 policy: FunctionCachePolicy,
9198 opts: FunctionWithCachePolicyOpts<'a>,
9199 ) -> Function {
9200 let mut query = self.selection.select("withCachePolicy");
9201 query = query.arg("policy", policy);
9202 if let Some(time_to_live) = opts.time_to_live {
9203 query = query.arg("timeToLive", time_to_live);
9204 }
9205 Function {
9206 proc: self.proc.clone(),
9207 selection: query,
9208 graphql_client: self.graphql_client.clone(),
9209 }
9210 }
9211 pub fn with_check(&self) -> Function {
9213 let query = self.selection.select("withCheck");
9214 Function {
9215 proc: self.proc.clone(),
9216 selection: query,
9217 graphql_client: self.graphql_client.clone(),
9218 }
9219 }
9220 pub fn with_deprecated(&self) -> Function {
9226 let query = self.selection.select("withDeprecated");
9227 Function {
9228 proc: self.proc.clone(),
9229 selection: query,
9230 graphql_client: self.graphql_client.clone(),
9231 }
9232 }
9233 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9239 let mut query = self.selection.select("withDeprecated");
9240 if let Some(reason) = opts.reason {
9241 query = query.arg("reason", reason);
9242 }
9243 Function {
9244 proc: self.proc.clone(),
9245 selection: query,
9246 graphql_client: self.graphql_client.clone(),
9247 }
9248 }
9249 pub fn with_description(&self, description: impl Into<String>) -> Function {
9255 let mut query = self.selection.select("withDescription");
9256 query = query.arg("description", description.into());
9257 Function {
9258 proc: self.proc.clone(),
9259 selection: query,
9260 graphql_client: self.graphql_client.clone(),
9261 }
9262 }
9263 pub fn with_generator(&self) -> Function {
9265 let query = self.selection.select("withGenerator");
9266 Function {
9267 proc: self.proc.clone(),
9268 selection: query,
9269 graphql_client: self.graphql_client.clone(),
9270 }
9271 }
9272 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9278 let mut query = self.selection.select("withSourceMap");
9279 query = query.arg_lazy(
9280 "sourceMap",
9281 Box::new(move || {
9282 let source_map = source_map.clone();
9283 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9284 }),
9285 );
9286 Function {
9287 proc: self.proc.clone(),
9288 selection: query,
9289 graphql_client: self.graphql_client.clone(),
9290 }
9291 }
9292 pub fn with_up(&self) -> Function {
9294 let query = self.selection.select("withUp");
9295 Function {
9296 proc: self.proc.clone(),
9297 selection: query,
9298 graphql_client: self.graphql_client.clone(),
9299 }
9300 }
9301}
9302impl Node for Function {
9303 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9304 let query = self.selection.select("id");
9305 let graphql_client = self.graphql_client.clone();
9306 async move { query.execute(graphql_client).await }
9307 }
9308}
9309#[derive(Clone)]
9310pub struct FunctionArg {
9311 pub proc: Option<Arc<DaggerSessionProc>>,
9312 pub selection: Selection,
9313 pub graphql_client: DynGraphQLClient,
9314}
9315impl IntoID<Id> for FunctionArg {
9316 fn into_id(
9317 self,
9318 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9319 Box::pin(async move { self.id().await })
9320 }
9321}
9322impl Loadable for FunctionArg {
9323 fn graphql_type() -> &'static str {
9324 "FunctionArg"
9325 }
9326 fn from_query(
9327 proc: Option<Arc<DaggerSessionProc>>,
9328 selection: Selection,
9329 graphql_client: DynGraphQLClient,
9330 ) -> Self {
9331 Self {
9332 proc,
9333 selection,
9334 graphql_client,
9335 }
9336 }
9337}
9338impl FunctionArg {
9339 pub async fn default_address(&self) -> Result<String, DaggerError> {
9341 let query = self.selection.select("defaultAddress");
9342 query.execute(self.graphql_client.clone()).await
9343 }
9344 pub async fn default_path(&self) -> Result<String, DaggerError> {
9346 let query = self.selection.select("defaultPath");
9347 query.execute(self.graphql_client.clone()).await
9348 }
9349 pub async fn default_value(&self) -> Result<Json, DaggerError> {
9351 let query = self.selection.select("defaultValue");
9352 query.execute(self.graphql_client.clone()).await
9353 }
9354 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9356 let query = self.selection.select("deprecated");
9357 query.execute(self.graphql_client.clone()).await
9358 }
9359 pub async fn description(&self) -> Result<String, DaggerError> {
9361 let query = self.selection.select("description");
9362 query.execute(self.graphql_client.clone()).await
9363 }
9364 pub async fn id(&self) -> Result<Id, DaggerError> {
9366 let query = self.selection.select("id");
9367 query.execute(self.graphql_client.clone()).await
9368 }
9369 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9371 let query = self.selection.select("ignore");
9372 query.execute(self.graphql_client.clone()).await
9373 }
9374 pub async fn name(&self) -> Result<String, DaggerError> {
9376 let query = self.selection.select("name");
9377 query.execute(self.graphql_client.clone()).await
9378 }
9379 pub fn source_map(&self) -> SourceMap {
9381 let query = self.selection.select("sourceMap");
9382 SourceMap {
9383 proc: self.proc.clone(),
9384 selection: query,
9385 graphql_client: self.graphql_client.clone(),
9386 }
9387 }
9388 pub fn type_def(&self) -> TypeDef {
9390 let query = self.selection.select("typeDef");
9391 TypeDef {
9392 proc: self.proc.clone(),
9393 selection: query,
9394 graphql_client: self.graphql_client.clone(),
9395 }
9396 }
9397}
9398impl Node for FunctionArg {
9399 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9400 let query = self.selection.select("id");
9401 let graphql_client = self.graphql_client.clone();
9402 async move { query.execute(graphql_client).await }
9403 }
9404}
9405#[derive(Clone)]
9406pub struct FunctionCall {
9407 pub proc: Option<Arc<DaggerSessionProc>>,
9408 pub selection: Selection,
9409 pub graphql_client: DynGraphQLClient,
9410}
9411impl IntoID<Id> for FunctionCall {
9412 fn into_id(
9413 self,
9414 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9415 Box::pin(async move { self.id().await })
9416 }
9417}
9418impl Loadable for FunctionCall {
9419 fn graphql_type() -> &'static str {
9420 "FunctionCall"
9421 }
9422 fn from_query(
9423 proc: Option<Arc<DaggerSessionProc>>,
9424 selection: Selection,
9425 graphql_client: DynGraphQLClient,
9426 ) -> Self {
9427 Self {
9428 proc,
9429 selection,
9430 graphql_client,
9431 }
9432 }
9433}
9434impl FunctionCall {
9435 pub async fn id(&self) -> Result<Id, DaggerError> {
9437 let query = self.selection.select("id");
9438 query.execute(self.graphql_client.clone()).await
9439 }
9440 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9442 let query = self.selection.select("inputArgs");
9443 let query = query.select("id");
9444 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9445 Ok(ids
9446 .into_iter()
9447 .map(|id| FunctionCallArgValue {
9448 proc: self.proc.clone(),
9449 selection: crate::querybuilder::query()
9450 .select("node")
9451 .arg("id", &id.0)
9452 .inline_fragment("FunctionCallArgValue"),
9453 graphql_client: self.graphql_client.clone(),
9454 })
9455 .collect())
9456 }
9457 pub async fn name(&self) -> Result<String, DaggerError> {
9459 let query = self.selection.select("name");
9460 query.execute(self.graphql_client.clone()).await
9461 }
9462 pub async fn parent(&self) -> Result<Json, DaggerError> {
9464 let query = self.selection.select("parent");
9465 query.execute(self.graphql_client.clone()).await
9466 }
9467 pub async fn parent_name(&self) -> Result<String, DaggerError> {
9469 let query = self.selection.select("parentName");
9470 query.execute(self.graphql_client.clone()).await
9471 }
9472 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9478 let mut query = self.selection.select("returnError");
9479 query = query.arg_lazy(
9480 "error",
9481 Box::new(move || {
9482 let error = error.clone();
9483 Box::pin(async move { error.into_id().await.unwrap().quote() })
9484 }),
9485 );
9486 query.execute(self.graphql_client.clone()).await
9487 }
9488 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9494 let mut query = self.selection.select("returnValue");
9495 query = query.arg("value", value);
9496 query.execute(self.graphql_client.clone()).await
9497 }
9498}
9499impl Node for FunctionCall {
9500 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9501 let query = self.selection.select("id");
9502 let graphql_client = self.graphql_client.clone();
9503 async move { query.execute(graphql_client).await }
9504 }
9505}
9506#[derive(Clone)]
9507pub struct FunctionCallArgValue {
9508 pub proc: Option<Arc<DaggerSessionProc>>,
9509 pub selection: Selection,
9510 pub graphql_client: DynGraphQLClient,
9511}
9512impl IntoID<Id> for FunctionCallArgValue {
9513 fn into_id(
9514 self,
9515 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9516 Box::pin(async move { self.id().await })
9517 }
9518}
9519impl Loadable for FunctionCallArgValue {
9520 fn graphql_type() -> &'static str {
9521 "FunctionCallArgValue"
9522 }
9523 fn from_query(
9524 proc: Option<Arc<DaggerSessionProc>>,
9525 selection: Selection,
9526 graphql_client: DynGraphQLClient,
9527 ) -> Self {
9528 Self {
9529 proc,
9530 selection,
9531 graphql_client,
9532 }
9533 }
9534}
9535impl FunctionCallArgValue {
9536 pub async fn id(&self) -> Result<Id, DaggerError> {
9538 let query = self.selection.select("id");
9539 query.execute(self.graphql_client.clone()).await
9540 }
9541 pub async fn name(&self) -> Result<String, DaggerError> {
9543 let query = self.selection.select("name");
9544 query.execute(self.graphql_client.clone()).await
9545 }
9546 pub async fn value(&self) -> Result<Json, DaggerError> {
9548 let query = self.selection.select("value");
9549 query.execute(self.graphql_client.clone()).await
9550 }
9551}
9552impl Node for FunctionCallArgValue {
9553 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9554 let query = self.selection.select("id");
9555 let graphql_client = self.graphql_client.clone();
9556 async move { query.execute(graphql_client).await }
9557 }
9558}
9559#[derive(Clone)]
9560pub struct GeneratedCode {
9561 pub proc: Option<Arc<DaggerSessionProc>>,
9562 pub selection: Selection,
9563 pub graphql_client: DynGraphQLClient,
9564}
9565impl IntoID<Id> for GeneratedCode {
9566 fn into_id(
9567 self,
9568 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9569 Box::pin(async move { self.id().await })
9570 }
9571}
9572impl Loadable for GeneratedCode {
9573 fn graphql_type() -> &'static str {
9574 "GeneratedCode"
9575 }
9576 fn from_query(
9577 proc: Option<Arc<DaggerSessionProc>>,
9578 selection: Selection,
9579 graphql_client: DynGraphQLClient,
9580 ) -> Self {
9581 Self {
9582 proc,
9583 selection,
9584 graphql_client,
9585 }
9586 }
9587}
9588impl GeneratedCode {
9589 pub fn code(&self) -> Directory {
9591 let query = self.selection.select("code");
9592 Directory {
9593 proc: self.proc.clone(),
9594 selection: query,
9595 graphql_client: self.graphql_client.clone(),
9596 }
9597 }
9598 pub async fn id(&self) -> Result<Id, DaggerError> {
9600 let query = self.selection.select("id");
9601 query.execute(self.graphql_client.clone()).await
9602 }
9603 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9605 let query = self.selection.select("vcsGeneratedPaths");
9606 query.execute(self.graphql_client.clone()).await
9607 }
9608 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9610 let query = self.selection.select("vcsIgnoredPaths");
9611 query.execute(self.graphql_client.clone()).await
9612 }
9613 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9615 let mut query = self.selection.select("withVCSGeneratedPaths");
9616 query = query.arg(
9617 "paths",
9618 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9619 );
9620 GeneratedCode {
9621 proc: self.proc.clone(),
9622 selection: query,
9623 graphql_client: self.graphql_client.clone(),
9624 }
9625 }
9626 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9628 let mut query = self.selection.select("withVCSIgnoredPaths");
9629 query = query.arg(
9630 "paths",
9631 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9632 );
9633 GeneratedCode {
9634 proc: self.proc.clone(),
9635 selection: query,
9636 graphql_client: self.graphql_client.clone(),
9637 }
9638 }
9639}
9640impl Node for GeneratedCode {
9641 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9642 let query = self.selection.select("id");
9643 let graphql_client = self.graphql_client.clone();
9644 async move { query.execute(graphql_client).await }
9645 }
9646}
9647#[derive(Clone)]
9648pub struct Generator {
9649 pub proc: Option<Arc<DaggerSessionProc>>,
9650 pub selection: Selection,
9651 pub graphql_client: DynGraphQLClient,
9652}
9653impl IntoID<Id> for Generator {
9654 fn into_id(
9655 self,
9656 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9657 Box::pin(async move { self.id().await })
9658 }
9659}
9660impl Loadable for Generator {
9661 fn graphql_type() -> &'static str {
9662 "Generator"
9663 }
9664 fn from_query(
9665 proc: Option<Arc<DaggerSessionProc>>,
9666 selection: Selection,
9667 graphql_client: DynGraphQLClient,
9668 ) -> Self {
9669 Self {
9670 proc,
9671 selection,
9672 graphql_client,
9673 }
9674 }
9675}
9676impl Generator {
9677 pub fn changes(&self) -> Changeset {
9679 let query = self.selection.select("changes");
9680 Changeset {
9681 proc: self.proc.clone(),
9682 selection: query,
9683 graphql_client: self.graphql_client.clone(),
9684 }
9685 }
9686 pub async fn completed(&self) -> Result<bool, DaggerError> {
9688 let query = self.selection.select("completed");
9689 query.execute(self.graphql_client.clone()).await
9690 }
9691 pub async fn description(&self) -> Result<String, DaggerError> {
9693 let query = self.selection.select("description");
9694 query.execute(self.graphql_client.clone()).await
9695 }
9696 pub async fn id(&self) -> Result<Id, DaggerError> {
9698 let query = self.selection.select("id");
9699 query.execute(self.graphql_client.clone()).await
9700 }
9701 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9703 let query = self.selection.select("isEmpty");
9704 query.execute(self.graphql_client.clone()).await
9705 }
9706 pub async fn name(&self) -> Result<String, DaggerError> {
9708 let query = self.selection.select("name");
9709 query.execute(self.graphql_client.clone()).await
9710 }
9711 pub fn original_module(&self) -> Module {
9713 let query = self.selection.select("originalModule");
9714 Module {
9715 proc: self.proc.clone(),
9716 selection: query,
9717 graphql_client: self.graphql_client.clone(),
9718 }
9719 }
9720 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9722 let query = self.selection.select("path");
9723 query.execute(self.graphql_client.clone()).await
9724 }
9725 pub fn run(&self) -> Generator {
9727 let query = self.selection.select("run");
9728 Generator {
9729 proc: self.proc.clone(),
9730 selection: query,
9731 graphql_client: self.graphql_client.clone(),
9732 }
9733 }
9734}
9735impl Node for Generator {
9736 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9737 let query = self.selection.select("id");
9738 let graphql_client = self.graphql_client.clone();
9739 async move { query.execute(graphql_client).await }
9740 }
9741}
9742#[derive(Clone)]
9743pub struct GeneratorGroup {
9744 pub proc: Option<Arc<DaggerSessionProc>>,
9745 pub selection: Selection,
9746 pub graphql_client: DynGraphQLClient,
9747}
9748#[derive(Builder, Debug, PartialEq)]
9749pub struct GeneratorGroupChangesOpts {
9750 #[builder(setter(into, strip_option), default)]
9752 pub on_conflict: Option<ChangesetsMergeConflict>,
9753}
9754impl IntoID<Id> for GeneratorGroup {
9755 fn into_id(
9756 self,
9757 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9758 Box::pin(async move { self.id().await })
9759 }
9760}
9761impl Loadable for GeneratorGroup {
9762 fn graphql_type() -> &'static str {
9763 "GeneratorGroup"
9764 }
9765 fn from_query(
9766 proc: Option<Arc<DaggerSessionProc>>,
9767 selection: Selection,
9768 graphql_client: DynGraphQLClient,
9769 ) -> Self {
9770 Self {
9771 proc,
9772 selection,
9773 graphql_client,
9774 }
9775 }
9776}
9777impl GeneratorGroup {
9778 pub fn changes(&self) -> Changeset {
9786 let query = self.selection.select("changes");
9787 Changeset {
9788 proc: self.proc.clone(),
9789 selection: query,
9790 graphql_client: self.graphql_client.clone(),
9791 }
9792 }
9793 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9801 let mut query = self.selection.select("changes");
9802 if let Some(on_conflict) = opts.on_conflict {
9803 query = query.arg("onConflict", on_conflict);
9804 }
9805 Changeset {
9806 proc: self.proc.clone(),
9807 selection: query,
9808 graphql_client: self.graphql_client.clone(),
9809 }
9810 }
9811 pub async fn id(&self) -> Result<Id, DaggerError> {
9813 let query = self.selection.select("id");
9814 query.execute(self.graphql_client.clone()).await
9815 }
9816 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9818 let query = self.selection.select("isEmpty");
9819 query.execute(self.graphql_client.clone()).await
9820 }
9821 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9823 let query = self.selection.select("list");
9824 let query = query.select("id");
9825 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9826 Ok(ids
9827 .into_iter()
9828 .map(|id| Generator {
9829 proc: self.proc.clone(),
9830 selection: crate::querybuilder::query()
9831 .select("node")
9832 .arg("id", &id.0)
9833 .inline_fragment("Generator"),
9834 graphql_client: self.graphql_client.clone(),
9835 })
9836 .collect())
9837 }
9838 pub fn run(&self) -> GeneratorGroup {
9840 let query = self.selection.select("run");
9841 GeneratorGroup {
9842 proc: self.proc.clone(),
9843 selection: query,
9844 graphql_client: self.graphql_client.clone(),
9845 }
9846 }
9847}
9848impl Node for GeneratorGroup {
9849 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9850 let query = self.selection.select("id");
9851 let graphql_client = self.graphql_client.clone();
9852 async move { query.execute(graphql_client).await }
9853 }
9854}
9855#[derive(Clone)]
9856pub struct GitRef {
9857 pub proc: Option<Arc<DaggerSessionProc>>,
9858 pub selection: Selection,
9859 pub graphql_client: DynGraphQLClient,
9860}
9861#[derive(Builder, Debug, PartialEq)]
9862pub struct GitRefTreeOpts {
9863 #[builder(setter(into, strip_option), default)]
9865 pub depth: Option<isize>,
9866 #[builder(setter(into, strip_option), default)]
9868 pub discard_git_dir: Option<bool>,
9869 #[builder(setter(into, strip_option), default)]
9871 pub include_tags: Option<bool>,
9872}
9873impl IntoID<Id> for GitRef {
9874 fn into_id(
9875 self,
9876 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9877 Box::pin(async move { self.id().await })
9878 }
9879}
9880impl Loadable for GitRef {
9881 fn graphql_type() -> &'static str {
9882 "GitRef"
9883 }
9884 fn from_query(
9885 proc: Option<Arc<DaggerSessionProc>>,
9886 selection: Selection,
9887 graphql_client: DynGraphQLClient,
9888 ) -> Self {
9889 Self {
9890 proc,
9891 selection,
9892 graphql_client,
9893 }
9894 }
9895}
9896impl GitRef {
9897 pub async fn commit(&self) -> Result<String, DaggerError> {
9899 let query = self.selection.select("commit");
9900 query.execute(self.graphql_client.clone()).await
9901 }
9902 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9908 let mut query = self.selection.select("commonAncestor");
9909 query = query.arg_lazy(
9910 "other",
9911 Box::new(move || {
9912 let other = other.clone();
9913 Box::pin(async move { other.into_id().await.unwrap().quote() })
9914 }),
9915 );
9916 GitRef {
9917 proc: self.proc.clone(),
9918 selection: query,
9919 graphql_client: self.graphql_client.clone(),
9920 }
9921 }
9922 pub async fn id(&self) -> Result<Id, DaggerError> {
9924 let query = self.selection.select("id");
9925 query.execute(self.graphql_client.clone()).await
9926 }
9927 pub async fn r#ref(&self) -> Result<String, DaggerError> {
9929 let query = self.selection.select("ref");
9930 query.execute(self.graphql_client.clone()).await
9931 }
9932 pub fn tree(&self) -> Directory {
9938 let query = self.selection.select("tree");
9939 Directory {
9940 proc: self.proc.clone(),
9941 selection: query,
9942 graphql_client: self.graphql_client.clone(),
9943 }
9944 }
9945 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9951 let mut query = self.selection.select("tree");
9952 if let Some(discard_git_dir) = opts.discard_git_dir {
9953 query = query.arg("discardGitDir", discard_git_dir);
9954 }
9955 if let Some(depth) = opts.depth {
9956 query = query.arg("depth", depth);
9957 }
9958 if let Some(include_tags) = opts.include_tags {
9959 query = query.arg("includeTags", include_tags);
9960 }
9961 Directory {
9962 proc: self.proc.clone(),
9963 selection: query,
9964 graphql_client: self.graphql_client.clone(),
9965 }
9966 }
9967}
9968impl Node for GitRef {
9969 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9970 let query = self.selection.select("id");
9971 let graphql_client = self.graphql_client.clone();
9972 async move { query.execute(graphql_client).await }
9973 }
9974}
9975#[derive(Clone)]
9976pub struct GitRepository {
9977 pub proc: Option<Arc<DaggerSessionProc>>,
9978 pub selection: Selection,
9979 pub graphql_client: DynGraphQLClient,
9980}
9981#[derive(Builder, Debug, PartialEq)]
9982pub struct GitRepositoryBranchesOpts<'a> {
9983 #[builder(setter(into, strip_option), default)]
9985 pub patterns: Option<Vec<&'a str>>,
9986}
9987#[derive(Builder, Debug, PartialEq)]
9988pub struct GitRepositoryTagsOpts<'a> {
9989 #[builder(setter(into, strip_option), default)]
9991 pub patterns: Option<Vec<&'a str>>,
9992}
9993impl IntoID<Id> for GitRepository {
9994 fn into_id(
9995 self,
9996 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9997 Box::pin(async move { self.id().await })
9998 }
9999}
10000impl Loadable for GitRepository {
10001 fn graphql_type() -> &'static str {
10002 "GitRepository"
10003 }
10004 fn from_query(
10005 proc: Option<Arc<DaggerSessionProc>>,
10006 selection: Selection,
10007 graphql_client: DynGraphQLClient,
10008 ) -> Self {
10009 Self {
10010 proc,
10011 selection,
10012 graphql_client,
10013 }
10014 }
10015}
10016impl GitRepository {
10017 pub fn branch(&self, name: impl Into<String>) -> GitRef {
10023 let mut query = self.selection.select("branch");
10024 query = query.arg("name", name.into());
10025 GitRef {
10026 proc: self.proc.clone(),
10027 selection: query,
10028 graphql_client: self.graphql_client.clone(),
10029 }
10030 }
10031 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10037 let query = self.selection.select("branches");
10038 query.execute(self.graphql_client.clone()).await
10039 }
10040 pub async fn branches_opts<'a>(
10046 &self,
10047 opts: GitRepositoryBranchesOpts<'a>,
10048 ) -> Result<Vec<String>, DaggerError> {
10049 let mut query = self.selection.select("branches");
10050 if let Some(patterns) = opts.patterns {
10051 query = query.arg("patterns", patterns);
10052 }
10053 query.execute(self.graphql_client.clone()).await
10054 }
10055 pub fn commit(&self, id: impl Into<String>) -> GitRef {
10061 let mut query = self.selection.select("commit");
10062 query = query.arg("id", id.into());
10063 GitRef {
10064 proc: self.proc.clone(),
10065 selection: query,
10066 graphql_client: self.graphql_client.clone(),
10067 }
10068 }
10069 pub fn head(&self) -> GitRef {
10071 let query = self.selection.select("head");
10072 GitRef {
10073 proc: self.proc.clone(),
10074 selection: query,
10075 graphql_client: self.graphql_client.clone(),
10076 }
10077 }
10078 pub async fn id(&self) -> Result<Id, DaggerError> {
10080 let query = self.selection.select("id");
10081 query.execute(self.graphql_client.clone()).await
10082 }
10083 pub fn latest_version(&self) -> GitRef {
10085 let query = self.selection.select("latestVersion");
10086 GitRef {
10087 proc: self.proc.clone(),
10088 selection: query,
10089 graphql_client: self.graphql_client.clone(),
10090 }
10091 }
10092 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10098 let mut query = self.selection.select("ref");
10099 query = query.arg("name", name.into());
10100 GitRef {
10101 proc: self.proc.clone(),
10102 selection: query,
10103 graphql_client: self.graphql_client.clone(),
10104 }
10105 }
10106 pub fn tag(&self, name: impl Into<String>) -> GitRef {
10112 let mut query = self.selection.select("tag");
10113 query = query.arg("name", name.into());
10114 GitRef {
10115 proc: self.proc.clone(),
10116 selection: query,
10117 graphql_client: self.graphql_client.clone(),
10118 }
10119 }
10120 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10126 let query = self.selection.select("tags");
10127 query.execute(self.graphql_client.clone()).await
10128 }
10129 pub async fn tags_opts<'a>(
10135 &self,
10136 opts: GitRepositoryTagsOpts<'a>,
10137 ) -> Result<Vec<String>, DaggerError> {
10138 let mut query = self.selection.select("tags");
10139 if let Some(patterns) = opts.patterns {
10140 query = query.arg("patterns", patterns);
10141 }
10142 query.execute(self.graphql_client.clone()).await
10143 }
10144 pub fn uncommitted(&self) -> Changeset {
10146 let query = self.selection.select("uncommitted");
10147 Changeset {
10148 proc: self.proc.clone(),
10149 selection: query,
10150 graphql_client: self.graphql_client.clone(),
10151 }
10152 }
10153 pub async fn url(&self) -> Result<String, DaggerError> {
10155 let query = self.selection.select("url");
10156 query.execute(self.graphql_client.clone()).await
10157 }
10158}
10159impl Node for GitRepository {
10160 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10161 let query = self.selection.select("id");
10162 let graphql_client = self.graphql_client.clone();
10163 async move { query.execute(graphql_client).await }
10164 }
10165}
10166#[derive(Clone)]
10167pub struct HttpState {
10168 pub proc: Option<Arc<DaggerSessionProc>>,
10169 pub selection: Selection,
10170 pub graphql_client: DynGraphQLClient,
10171}
10172impl IntoID<Id> for HttpState {
10173 fn into_id(
10174 self,
10175 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10176 Box::pin(async move { self.id().await })
10177 }
10178}
10179impl Loadable for HttpState {
10180 fn graphql_type() -> &'static str {
10181 "HTTPState"
10182 }
10183 fn from_query(
10184 proc: Option<Arc<DaggerSessionProc>>,
10185 selection: Selection,
10186 graphql_client: DynGraphQLClient,
10187 ) -> Self {
10188 Self {
10189 proc,
10190 selection,
10191 graphql_client,
10192 }
10193 }
10194}
10195impl HttpState {
10196 pub async fn id(&self) -> Result<Id, DaggerError> {
10198 let query = self.selection.select("id");
10199 query.execute(self.graphql_client.clone()).await
10200 }
10201}
10202impl Node for HttpState {
10203 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10204 let query = self.selection.select("id");
10205 let graphql_client = self.graphql_client.clone();
10206 async move { query.execute(graphql_client).await }
10207 }
10208}
10209#[derive(Clone)]
10210pub struct HealthcheckConfig {
10211 pub proc: Option<Arc<DaggerSessionProc>>,
10212 pub selection: Selection,
10213 pub graphql_client: DynGraphQLClient,
10214}
10215impl IntoID<Id> for HealthcheckConfig {
10216 fn into_id(
10217 self,
10218 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10219 Box::pin(async move { self.id().await })
10220 }
10221}
10222impl Loadable for HealthcheckConfig {
10223 fn graphql_type() -> &'static str {
10224 "HealthcheckConfig"
10225 }
10226 fn from_query(
10227 proc: Option<Arc<DaggerSessionProc>>,
10228 selection: Selection,
10229 graphql_client: DynGraphQLClient,
10230 ) -> Self {
10231 Self {
10232 proc,
10233 selection,
10234 graphql_client,
10235 }
10236 }
10237}
10238impl HealthcheckConfig {
10239 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10241 let query = self.selection.select("args");
10242 query.execute(self.graphql_client.clone()).await
10243 }
10244 pub async fn id(&self) -> Result<Id, DaggerError> {
10246 let query = self.selection.select("id");
10247 query.execute(self.graphql_client.clone()).await
10248 }
10249 pub async fn interval(&self) -> Result<String, DaggerError> {
10251 let query = self.selection.select("interval");
10252 query.execute(self.graphql_client.clone()).await
10253 }
10254 pub async fn retries(&self) -> Result<isize, DaggerError> {
10256 let query = self.selection.select("retries");
10257 query.execute(self.graphql_client.clone()).await
10258 }
10259 pub async fn shell(&self) -> Result<bool, DaggerError> {
10261 let query = self.selection.select("shell");
10262 query.execute(self.graphql_client.clone()).await
10263 }
10264 pub async fn start_interval(&self) -> Result<String, DaggerError> {
10266 let query = self.selection.select("startInterval");
10267 query.execute(self.graphql_client.clone()).await
10268 }
10269 pub async fn start_period(&self) -> Result<String, DaggerError> {
10271 let query = self.selection.select("startPeriod");
10272 query.execute(self.graphql_client.clone()).await
10273 }
10274 pub async fn timeout(&self) -> Result<String, DaggerError> {
10276 let query = self.selection.select("timeout");
10277 query.execute(self.graphql_client.clone()).await
10278 }
10279}
10280impl Node for HealthcheckConfig {
10281 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10282 let query = self.selection.select("id");
10283 let graphql_client = self.graphql_client.clone();
10284 async move { query.execute(graphql_client).await }
10285 }
10286}
10287#[derive(Clone)]
10288pub struct Host {
10289 pub proc: Option<Arc<DaggerSessionProc>>,
10290 pub selection: Selection,
10291 pub graphql_client: DynGraphQLClient,
10292}
10293#[derive(Builder, Debug, PartialEq)]
10294pub struct HostDirectoryOpts<'a> {
10295 #[builder(setter(into, strip_option), default)]
10297 pub exclude: Option<Vec<&'a str>>,
10298 #[builder(setter(into, strip_option), default)]
10300 pub gitignore: Option<bool>,
10301 #[builder(setter(into, strip_option), default)]
10303 pub include: Option<Vec<&'a str>>,
10304 #[builder(setter(into, strip_option), default)]
10306 pub no_cache: Option<bool>,
10307}
10308#[derive(Builder, Debug, PartialEq)]
10309pub struct HostFileOpts {
10310 #[builder(setter(into, strip_option), default)]
10312 pub no_cache: Option<bool>,
10313}
10314#[derive(Builder, Debug, PartialEq)]
10315pub struct HostFindUpOpts {
10316 #[builder(setter(into, strip_option), default)]
10317 pub no_cache: Option<bool>,
10318}
10319#[derive(Builder, Debug, PartialEq)]
10320pub struct HostServiceOpts<'a> {
10321 #[builder(setter(into, strip_option), default)]
10323 pub host: Option<&'a str>,
10324}
10325#[derive(Builder, Debug, PartialEq)]
10326pub struct HostTunnelOpts {
10327 #[builder(setter(into, strip_option), default)]
10330 pub native: Option<bool>,
10331 #[builder(setter(into, strip_option), default)]
10336 pub ports: Option<Vec<PortForward>>,
10337}
10338impl IntoID<Id> for Host {
10339 fn into_id(
10340 self,
10341 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10342 Box::pin(async move { self.id().await })
10343 }
10344}
10345impl Loadable for Host {
10346 fn graphql_type() -> &'static str {
10347 "Host"
10348 }
10349 fn from_query(
10350 proc: Option<Arc<DaggerSessionProc>>,
10351 selection: Selection,
10352 graphql_client: DynGraphQLClient,
10353 ) -> Self {
10354 Self {
10355 proc,
10356 selection,
10357 graphql_client,
10358 }
10359 }
10360}
10361impl Host {
10362 pub fn container_image(&self, name: impl Into<String>) -> Container {
10368 let mut query = self.selection.select("containerImage");
10369 query = query.arg("name", name.into());
10370 Container {
10371 proc: self.proc.clone(),
10372 selection: query,
10373 graphql_client: self.graphql_client.clone(),
10374 }
10375 }
10376 pub fn directory(&self, path: impl Into<String>) -> Directory {
10383 let mut query = self.selection.select("directory");
10384 query = query.arg("path", path.into());
10385 Directory {
10386 proc: self.proc.clone(),
10387 selection: query,
10388 graphql_client: self.graphql_client.clone(),
10389 }
10390 }
10391 pub fn directory_opts<'a>(
10398 &self,
10399 path: impl Into<String>,
10400 opts: HostDirectoryOpts<'a>,
10401 ) -> Directory {
10402 let mut query = self.selection.select("directory");
10403 query = query.arg("path", path.into());
10404 if let Some(exclude) = opts.exclude {
10405 query = query.arg("exclude", exclude);
10406 }
10407 if let Some(include) = opts.include {
10408 query = query.arg("include", include);
10409 }
10410 if let Some(no_cache) = opts.no_cache {
10411 query = query.arg("noCache", no_cache);
10412 }
10413 if let Some(gitignore) = opts.gitignore {
10414 query = query.arg("gitignore", gitignore);
10415 }
10416 Directory {
10417 proc: self.proc.clone(),
10418 selection: query,
10419 graphql_client: self.graphql_client.clone(),
10420 }
10421 }
10422 pub fn file(&self, path: impl Into<String>) -> File {
10429 let mut query = self.selection.select("file");
10430 query = query.arg("path", path.into());
10431 File {
10432 proc: self.proc.clone(),
10433 selection: query,
10434 graphql_client: self.graphql_client.clone(),
10435 }
10436 }
10437 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10444 let mut query = self.selection.select("file");
10445 query = query.arg("path", path.into());
10446 if let Some(no_cache) = opts.no_cache {
10447 query = query.arg("noCache", no_cache);
10448 }
10449 File {
10450 proc: self.proc.clone(),
10451 selection: query,
10452 graphql_client: self.graphql_client.clone(),
10453 }
10454 }
10455 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10462 let mut query = self.selection.select("findUp");
10463 query = query.arg("name", name.into());
10464 query.execute(self.graphql_client.clone()).await
10465 }
10466 pub async fn find_up_opts(
10473 &self,
10474 name: impl Into<String>,
10475 opts: HostFindUpOpts,
10476 ) -> Result<String, DaggerError> {
10477 let mut query = self.selection.select("findUp");
10478 query = query.arg("name", name.into());
10479 if let Some(no_cache) = opts.no_cache {
10480 query = query.arg("noCache", no_cache);
10481 }
10482 query.execute(self.graphql_client.clone()).await
10483 }
10484 pub async fn id(&self) -> Result<Id, DaggerError> {
10486 let query = self.selection.select("id");
10487 query.execute(self.graphql_client.clone()).await
10488 }
10489 pub fn service(&self, ports: Vec<PortForward>) -> Service {
10500 let mut query = self.selection.select("service");
10501 query = query.arg("ports", ports);
10502 Service {
10503 proc: self.proc.clone(),
10504 selection: query,
10505 graphql_client: self.graphql_client.clone(),
10506 }
10507 }
10508 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10519 let mut query = self.selection.select("service");
10520 query = query.arg("ports", ports);
10521 if let Some(host) = opts.host {
10522 query = query.arg("host", host);
10523 }
10524 Service {
10525 proc: self.proc.clone(),
10526 selection: query,
10527 graphql_client: self.graphql_client.clone(),
10528 }
10529 }
10530 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10537 let mut query = self.selection.select("tunnel");
10538 query = query.arg_lazy(
10539 "service",
10540 Box::new(move || {
10541 let service = service.clone();
10542 Box::pin(async move { service.into_id().await.unwrap().quote() })
10543 }),
10544 );
10545 Service {
10546 proc: self.proc.clone(),
10547 selection: query,
10548 graphql_client: self.graphql_client.clone(),
10549 }
10550 }
10551 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10558 let mut query = self.selection.select("tunnel");
10559 query = query.arg_lazy(
10560 "service",
10561 Box::new(move || {
10562 let service = service.clone();
10563 Box::pin(async move { service.into_id().await.unwrap().quote() })
10564 }),
10565 );
10566 if let Some(native) = opts.native {
10567 query = query.arg("native", native);
10568 }
10569 if let Some(ports) = opts.ports {
10570 query = query.arg("ports", ports);
10571 }
10572 Service {
10573 proc: self.proc.clone(),
10574 selection: query,
10575 graphql_client: self.graphql_client.clone(),
10576 }
10577 }
10578 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10584 let mut query = self.selection.select("unixSocket");
10585 query = query.arg("path", path.into());
10586 Socket {
10587 proc: self.proc.clone(),
10588 selection: query,
10589 graphql_client: self.graphql_client.clone(),
10590 }
10591 }
10592}
10593impl Node for Host {
10594 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10595 let query = self.selection.select("id");
10596 let graphql_client = self.graphql_client.clone();
10597 async move { query.execute(graphql_client).await }
10598 }
10599}
10600#[derive(Clone)]
10601pub struct InputTypeDef {
10602 pub proc: Option<Arc<DaggerSessionProc>>,
10603 pub selection: Selection,
10604 pub graphql_client: DynGraphQLClient,
10605}
10606impl IntoID<Id> for InputTypeDef {
10607 fn into_id(
10608 self,
10609 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10610 Box::pin(async move { self.id().await })
10611 }
10612}
10613impl Loadable for InputTypeDef {
10614 fn graphql_type() -> &'static str {
10615 "InputTypeDef"
10616 }
10617 fn from_query(
10618 proc: Option<Arc<DaggerSessionProc>>,
10619 selection: Selection,
10620 graphql_client: DynGraphQLClient,
10621 ) -> Self {
10622 Self {
10623 proc,
10624 selection,
10625 graphql_client,
10626 }
10627 }
10628}
10629impl InputTypeDef {
10630 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10632 let query = self.selection.select("fields");
10633 let query = query.select("id");
10634 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10635 Ok(ids
10636 .into_iter()
10637 .map(|id| FieldTypeDef {
10638 proc: self.proc.clone(),
10639 selection: crate::querybuilder::query()
10640 .select("node")
10641 .arg("id", &id.0)
10642 .inline_fragment("FieldTypeDef"),
10643 graphql_client: self.graphql_client.clone(),
10644 })
10645 .collect())
10646 }
10647 pub async fn id(&self) -> Result<Id, DaggerError> {
10649 let query = self.selection.select("id");
10650 query.execute(self.graphql_client.clone()).await
10651 }
10652 pub async fn name(&self) -> Result<String, DaggerError> {
10654 let query = self.selection.select("name");
10655 query.execute(self.graphql_client.clone()).await
10656 }
10657}
10658impl Node for InputTypeDef {
10659 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10660 let query = self.selection.select("id");
10661 let graphql_client = self.graphql_client.clone();
10662 async move { query.execute(graphql_client).await }
10663 }
10664}
10665#[derive(Clone)]
10666pub struct InterfaceTypeDef {
10667 pub proc: Option<Arc<DaggerSessionProc>>,
10668 pub selection: Selection,
10669 pub graphql_client: DynGraphQLClient,
10670}
10671impl IntoID<Id> for InterfaceTypeDef {
10672 fn into_id(
10673 self,
10674 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10675 Box::pin(async move { self.id().await })
10676 }
10677}
10678impl Loadable for InterfaceTypeDef {
10679 fn graphql_type() -> &'static str {
10680 "InterfaceTypeDef"
10681 }
10682 fn from_query(
10683 proc: Option<Arc<DaggerSessionProc>>,
10684 selection: Selection,
10685 graphql_client: DynGraphQLClient,
10686 ) -> Self {
10687 Self {
10688 proc,
10689 selection,
10690 graphql_client,
10691 }
10692 }
10693}
10694impl InterfaceTypeDef {
10695 pub async fn description(&self) -> Result<String, DaggerError> {
10697 let query = self.selection.select("description");
10698 query.execute(self.graphql_client.clone()).await
10699 }
10700 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10702 let query = self.selection.select("functions");
10703 let query = query.select("id");
10704 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10705 Ok(ids
10706 .into_iter()
10707 .map(|id| Function {
10708 proc: self.proc.clone(),
10709 selection: crate::querybuilder::query()
10710 .select("node")
10711 .arg("id", &id.0)
10712 .inline_fragment("Function"),
10713 graphql_client: self.graphql_client.clone(),
10714 })
10715 .collect())
10716 }
10717 pub async fn id(&self) -> Result<Id, DaggerError> {
10719 let query = self.selection.select("id");
10720 query.execute(self.graphql_client.clone()).await
10721 }
10722 pub async fn name(&self) -> Result<String, DaggerError> {
10724 let query = self.selection.select("name");
10725 query.execute(self.graphql_client.clone()).await
10726 }
10727 pub fn source_map(&self) -> SourceMap {
10729 let query = self.selection.select("sourceMap");
10730 SourceMap {
10731 proc: self.proc.clone(),
10732 selection: query,
10733 graphql_client: self.graphql_client.clone(),
10734 }
10735 }
10736 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10738 let query = self.selection.select("sourceModuleName");
10739 query.execute(self.graphql_client.clone()).await
10740 }
10741}
10742impl Node for InterfaceTypeDef {
10743 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10744 let query = self.selection.select("id");
10745 let graphql_client = self.graphql_client.clone();
10746 async move { query.execute(graphql_client).await }
10747 }
10748}
10749#[derive(Clone)]
10750pub struct JsonValue {
10751 pub proc: Option<Arc<DaggerSessionProc>>,
10752 pub selection: Selection,
10753 pub graphql_client: DynGraphQLClient,
10754}
10755#[derive(Builder, Debug, PartialEq)]
10756pub struct JsonValueContentsOpts<'a> {
10757 #[builder(setter(into, strip_option), default)]
10759 pub indent: Option<&'a str>,
10760 #[builder(setter(into, strip_option), default)]
10762 pub pretty: Option<bool>,
10763}
10764impl IntoID<Id> for JsonValue {
10765 fn into_id(
10766 self,
10767 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10768 Box::pin(async move { self.id().await })
10769 }
10770}
10771impl Loadable for JsonValue {
10772 fn graphql_type() -> &'static str {
10773 "JSONValue"
10774 }
10775 fn from_query(
10776 proc: Option<Arc<DaggerSessionProc>>,
10777 selection: Selection,
10778 graphql_client: DynGraphQLClient,
10779 ) -> Self {
10780 Self {
10781 proc,
10782 selection,
10783 graphql_client,
10784 }
10785 }
10786}
10787impl JsonValue {
10788 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10790 let query = self.selection.select("asArray");
10791 let query = query.select("id");
10792 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10793 Ok(ids
10794 .into_iter()
10795 .map(|id| JsonValue {
10796 proc: self.proc.clone(),
10797 selection: crate::querybuilder::query()
10798 .select("node")
10799 .arg("id", &id.0)
10800 .inline_fragment("JSONValue"),
10801 graphql_client: self.graphql_client.clone(),
10802 })
10803 .collect())
10804 }
10805 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10807 let query = self.selection.select("asBoolean");
10808 query.execute(self.graphql_client.clone()).await
10809 }
10810 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10812 let query = self.selection.select("asInteger");
10813 query.execute(self.graphql_client.clone()).await
10814 }
10815 pub async fn as_string(&self) -> Result<String, DaggerError> {
10817 let query = self.selection.select("asString");
10818 query.execute(self.graphql_client.clone()).await
10819 }
10820 pub async fn contents(&self) -> Result<Json, DaggerError> {
10826 let query = self.selection.select("contents");
10827 query.execute(self.graphql_client.clone()).await
10828 }
10829 pub async fn contents_opts<'a>(
10835 &self,
10836 opts: JsonValueContentsOpts<'a>,
10837 ) -> Result<Json, DaggerError> {
10838 let mut query = self.selection.select("contents");
10839 if let Some(pretty) = opts.pretty {
10840 query = query.arg("pretty", pretty);
10841 }
10842 if let Some(indent) = opts.indent {
10843 query = query.arg("indent", indent);
10844 }
10845 query.execute(self.graphql_client.clone()).await
10846 }
10847 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10853 let mut query = self.selection.select("field");
10854 query = query.arg(
10855 "path",
10856 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10857 );
10858 JsonValue {
10859 proc: self.proc.clone(),
10860 selection: query,
10861 graphql_client: self.graphql_client.clone(),
10862 }
10863 }
10864 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10866 let query = self.selection.select("fields");
10867 query.execute(self.graphql_client.clone()).await
10868 }
10869 pub async fn id(&self) -> Result<Id, DaggerError> {
10871 let query = self.selection.select("id");
10872 query.execute(self.graphql_client.clone()).await
10873 }
10874 pub fn new_boolean(&self, value: bool) -> JsonValue {
10880 let mut query = self.selection.select("newBoolean");
10881 query = query.arg("value", value);
10882 JsonValue {
10883 proc: self.proc.clone(),
10884 selection: query,
10885 graphql_client: self.graphql_client.clone(),
10886 }
10887 }
10888 pub fn new_integer(&self, value: isize) -> JsonValue {
10894 let mut query = self.selection.select("newInteger");
10895 query = query.arg("value", value);
10896 JsonValue {
10897 proc: self.proc.clone(),
10898 selection: query,
10899 graphql_client: self.graphql_client.clone(),
10900 }
10901 }
10902 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10908 let mut query = self.selection.select("newString");
10909 query = query.arg("value", value.into());
10910 JsonValue {
10911 proc: self.proc.clone(),
10912 selection: query,
10913 graphql_client: self.graphql_client.clone(),
10914 }
10915 }
10916 pub fn with_contents(&self, contents: Json) -> JsonValue {
10922 let mut query = self.selection.select("withContents");
10923 query = query.arg("contents", contents);
10924 JsonValue {
10925 proc: self.proc.clone(),
10926 selection: query,
10927 graphql_client: self.graphql_client.clone(),
10928 }
10929 }
10930 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10937 let mut query = self.selection.select("withField");
10938 query = query.arg(
10939 "path",
10940 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10941 );
10942 query = query.arg_lazy(
10943 "value",
10944 Box::new(move || {
10945 let value = value.clone();
10946 Box::pin(async move { value.into_id().await.unwrap().quote() })
10947 }),
10948 );
10949 JsonValue {
10950 proc: self.proc.clone(),
10951 selection: query,
10952 graphql_client: self.graphql_client.clone(),
10953 }
10954 }
10955}
10956impl Node for JsonValue {
10957 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10958 let query = self.selection.select("id");
10959 let graphql_client = self.graphql_client.clone();
10960 async move { query.execute(graphql_client).await }
10961 }
10962}
10963#[derive(Clone)]
10964pub struct Llm {
10965 pub proc: Option<Arc<DaggerSessionProc>>,
10966 pub selection: Selection,
10967 pub graphql_client: DynGraphQLClient,
10968}
10969impl IntoID<Id> for Llm {
10970 fn into_id(
10971 self,
10972 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10973 Box::pin(async move { self.id().await })
10974 }
10975}
10976impl Loadable for Llm {
10977 fn graphql_type() -> &'static str {
10978 "LLM"
10979 }
10980 fn from_query(
10981 proc: Option<Arc<DaggerSessionProc>>,
10982 selection: Selection,
10983 graphql_client: DynGraphQLClient,
10984 ) -> Self {
10985 Self {
10986 proc,
10987 selection,
10988 graphql_client,
10989 }
10990 }
10991}
10992impl Llm {
10993 pub fn attempt(&self, number: isize) -> Llm {
10995 let mut query = self.selection.select("attempt");
10996 query = query.arg("number", number);
10997 Llm {
10998 proc: self.proc.clone(),
10999 selection: query,
11000 graphql_client: self.graphql_client.clone(),
11001 }
11002 }
11003 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
11005 let mut query = self.selection.select("bindResult");
11006 query = query.arg("name", name.into());
11007 Binding {
11008 proc: self.proc.clone(),
11009 selection: query,
11010 graphql_client: self.graphql_client.clone(),
11011 }
11012 }
11013 pub fn env(&self) -> Env {
11015 let query = self.selection.select("env");
11016 Env {
11017 proc: self.proc.clone(),
11018 selection: query,
11019 graphql_client: self.graphql_client.clone(),
11020 }
11021 }
11022 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
11024 let query = self.selection.select("hasPrompt");
11025 query.execute(self.graphql_client.clone()).await
11026 }
11027 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
11029 let query = self.selection.select("history");
11030 query.execute(self.graphql_client.clone()).await
11031 }
11032 pub async fn history_json(&self) -> Result<Json, DaggerError> {
11034 let query = self.selection.select("historyJSON");
11035 query.execute(self.graphql_client.clone()).await
11036 }
11037 pub async fn id(&self) -> Result<Id, DaggerError> {
11039 let query = self.selection.select("id");
11040 query.execute(self.graphql_client.clone()).await
11041 }
11042 pub async fn last_reply(&self) -> Result<String, DaggerError> {
11044 let query = self.selection.select("lastReply");
11045 query.execute(self.graphql_client.clone()).await
11046 }
11047 pub fn r#loop(&self) -> Llm {
11049 let query = self.selection.select("loop");
11050 Llm {
11051 proc: self.proc.clone(),
11052 selection: query,
11053 graphql_client: self.graphql_client.clone(),
11054 }
11055 }
11056 pub async fn model(&self) -> Result<String, DaggerError> {
11058 let query = self.selection.select("model");
11059 query.execute(self.graphql_client.clone()).await
11060 }
11061 pub async fn provider(&self) -> Result<String, DaggerError> {
11063 let query = self.selection.select("provider");
11064 query.execute(self.graphql_client.clone()).await
11065 }
11066 pub async fn step(&self) -> Result<Llm, DaggerError> {
11068 let query = self.selection.select("step");
11069 let id: Id = query.execute(self.graphql_client.clone()).await?;
11070 Ok(Llm {
11071 proc: self.proc.clone(),
11072 selection: query
11073 .root()
11074 .select("node")
11075 .arg("id", &id.0)
11076 .inline_fragment("LLM"),
11077 graphql_client: self.graphql_client.clone(),
11078 })
11079 }
11080 pub async fn sync(&self) -> Result<Llm, DaggerError> {
11082 let query = self.selection.select("sync");
11083 let id: Id = query.execute(self.graphql_client.clone()).await?;
11084 Ok(Llm {
11085 proc: self.proc.clone(),
11086 selection: query
11087 .root()
11088 .select("node")
11089 .arg("id", &id.0)
11090 .inline_fragment("LLM"),
11091 graphql_client: self.graphql_client.clone(),
11092 })
11093 }
11094 pub fn token_usage(&self) -> LlmTokenUsage {
11096 let query = self.selection.select("tokenUsage");
11097 LlmTokenUsage {
11098 proc: self.proc.clone(),
11099 selection: query,
11100 graphql_client: self.graphql_client.clone(),
11101 }
11102 }
11103 pub async fn tools(&self) -> Result<String, DaggerError> {
11105 let query = self.selection.select("tools");
11106 query.execute(self.graphql_client.clone()).await
11107 }
11108 pub fn with_blocked_function(
11117 &self,
11118 type_name: impl Into<String>,
11119 function: impl Into<String>,
11120 ) -> Llm {
11121 let mut query = self.selection.select("withBlockedFunction");
11122 query = query.arg("typeName", type_name.into());
11123 query = query.arg("function", function.into());
11124 Llm {
11125 proc: self.proc.clone(),
11126 selection: query,
11127 graphql_client: self.graphql_client.clone(),
11128 }
11129 }
11130 pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11132 let mut query = self.selection.select("withEnv");
11133 query = query.arg_lazy(
11134 "env",
11135 Box::new(move || {
11136 let env = env.clone();
11137 Box::pin(async move { env.into_id().await.unwrap().quote() })
11138 }),
11139 );
11140 Llm {
11141 proc: self.proc.clone(),
11142 selection: query,
11143 graphql_client: self.graphql_client.clone(),
11144 }
11145 }
11146 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11153 let mut query = self.selection.select("withMCPServer");
11154 query = query.arg("name", name.into());
11155 query = query.arg_lazy(
11156 "service",
11157 Box::new(move || {
11158 let service = service.clone();
11159 Box::pin(async move { service.into_id().await.unwrap().quote() })
11160 }),
11161 );
11162 Llm {
11163 proc: self.proc.clone(),
11164 selection: query,
11165 graphql_client: self.graphql_client.clone(),
11166 }
11167 }
11168 pub fn with_model(&self, model: impl Into<String>) -> Llm {
11174 let mut query = self.selection.select("withModel");
11175 query = query.arg("model", model.into());
11176 Llm {
11177 proc: self.proc.clone(),
11178 selection: query,
11179 graphql_client: self.graphql_client.clone(),
11180 }
11181 }
11182 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11188 let mut query = self.selection.select("withPrompt");
11189 query = query.arg("prompt", prompt.into());
11190 Llm {
11191 proc: self.proc.clone(),
11192 selection: query,
11193 graphql_client: self.graphql_client.clone(),
11194 }
11195 }
11196 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11202 let mut query = self.selection.select("withPromptFile");
11203 query = query.arg_lazy(
11204 "file",
11205 Box::new(move || {
11206 let file = file.clone();
11207 Box::pin(async move { file.into_id().await.unwrap().quote() })
11208 }),
11209 );
11210 Llm {
11211 proc: self.proc.clone(),
11212 selection: query,
11213 graphql_client: self.graphql_client.clone(),
11214 }
11215 }
11216 pub fn with_static_tools(&self) -> Llm {
11218 let query = self.selection.select("withStaticTools");
11219 Llm {
11220 proc: self.proc.clone(),
11221 selection: query,
11222 graphql_client: self.graphql_client.clone(),
11223 }
11224 }
11225 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11231 let mut query = self.selection.select("withSystemPrompt");
11232 query = query.arg("prompt", prompt.into());
11233 Llm {
11234 proc: self.proc.clone(),
11235 selection: query,
11236 graphql_client: self.graphql_client.clone(),
11237 }
11238 }
11239 pub fn without_default_system_prompt(&self) -> Llm {
11241 let query = self.selection.select("withoutDefaultSystemPrompt");
11242 Llm {
11243 proc: self.proc.clone(),
11244 selection: query,
11245 graphql_client: self.graphql_client.clone(),
11246 }
11247 }
11248 pub fn without_message_history(&self) -> Llm {
11250 let query = self.selection.select("withoutMessageHistory");
11251 Llm {
11252 proc: self.proc.clone(),
11253 selection: query,
11254 graphql_client: self.graphql_client.clone(),
11255 }
11256 }
11257 pub fn without_system_prompts(&self) -> Llm {
11259 let query = self.selection.select("withoutSystemPrompts");
11260 Llm {
11261 proc: self.proc.clone(),
11262 selection: query,
11263 graphql_client: self.graphql_client.clone(),
11264 }
11265 }
11266}
11267impl Node for Llm {
11268 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11269 let query = self.selection.select("id");
11270 let graphql_client = self.graphql_client.clone();
11271 async move { query.execute(graphql_client).await }
11272 }
11273}
11274impl Syncer for Llm {
11275 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11276 let query = self.selection.select("id");
11277 let graphql_client = self.graphql_client.clone();
11278 async move { query.execute(graphql_client).await }
11279 }
11280 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11281 let query = self.selection.select("sync");
11282 let graphql_client = self.graphql_client.clone();
11283 async move { query.execute(graphql_client).await }
11284 }
11285}
11286#[derive(Clone)]
11287pub struct LlmTokenUsage {
11288 pub proc: Option<Arc<DaggerSessionProc>>,
11289 pub selection: Selection,
11290 pub graphql_client: DynGraphQLClient,
11291}
11292impl IntoID<Id> for LlmTokenUsage {
11293 fn into_id(
11294 self,
11295 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11296 Box::pin(async move { self.id().await })
11297 }
11298}
11299impl Loadable for LlmTokenUsage {
11300 fn graphql_type() -> &'static str {
11301 "LLMTokenUsage"
11302 }
11303 fn from_query(
11304 proc: Option<Arc<DaggerSessionProc>>,
11305 selection: Selection,
11306 graphql_client: DynGraphQLClient,
11307 ) -> Self {
11308 Self {
11309 proc,
11310 selection,
11311 graphql_client,
11312 }
11313 }
11314}
11315impl LlmTokenUsage {
11316 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11317 let query = self.selection.select("cachedTokenReads");
11318 query.execute(self.graphql_client.clone()).await
11319 }
11320 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11321 let query = self.selection.select("cachedTokenWrites");
11322 query.execute(self.graphql_client.clone()).await
11323 }
11324 pub async fn id(&self) -> Result<Id, DaggerError> {
11326 let query = self.selection.select("id");
11327 query.execute(self.graphql_client.clone()).await
11328 }
11329 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11330 let query = self.selection.select("inputTokens");
11331 query.execute(self.graphql_client.clone()).await
11332 }
11333 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11334 let query = self.selection.select("outputTokens");
11335 query.execute(self.graphql_client.clone()).await
11336 }
11337 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11338 let query = self.selection.select("totalTokens");
11339 query.execute(self.graphql_client.clone()).await
11340 }
11341}
11342impl Node for LlmTokenUsage {
11343 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11344 let query = self.selection.select("id");
11345 let graphql_client = self.graphql_client.clone();
11346 async move { query.execute(graphql_client).await }
11347 }
11348}
11349#[derive(Clone)]
11350pub struct Label {
11351 pub proc: Option<Arc<DaggerSessionProc>>,
11352 pub selection: Selection,
11353 pub graphql_client: DynGraphQLClient,
11354}
11355impl IntoID<Id> for Label {
11356 fn into_id(
11357 self,
11358 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11359 Box::pin(async move { self.id().await })
11360 }
11361}
11362impl Loadable for Label {
11363 fn graphql_type() -> &'static str {
11364 "Label"
11365 }
11366 fn from_query(
11367 proc: Option<Arc<DaggerSessionProc>>,
11368 selection: Selection,
11369 graphql_client: DynGraphQLClient,
11370 ) -> Self {
11371 Self {
11372 proc,
11373 selection,
11374 graphql_client,
11375 }
11376 }
11377}
11378impl Label {
11379 pub async fn id(&self) -> Result<Id, DaggerError> {
11381 let query = self.selection.select("id");
11382 query.execute(self.graphql_client.clone()).await
11383 }
11384 pub async fn name(&self) -> Result<String, DaggerError> {
11386 let query = self.selection.select("name");
11387 query.execute(self.graphql_client.clone()).await
11388 }
11389 pub async fn value(&self) -> Result<String, DaggerError> {
11391 let query = self.selection.select("value");
11392 query.execute(self.graphql_client.clone()).await
11393 }
11394}
11395impl Node for Label {
11396 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11397 let query = self.selection.select("id");
11398 let graphql_client = self.graphql_client.clone();
11399 async move { query.execute(graphql_client).await }
11400 }
11401}
11402#[derive(Clone)]
11403pub struct ListTypeDef {
11404 pub proc: Option<Arc<DaggerSessionProc>>,
11405 pub selection: Selection,
11406 pub graphql_client: DynGraphQLClient,
11407}
11408impl IntoID<Id> for ListTypeDef {
11409 fn into_id(
11410 self,
11411 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11412 Box::pin(async move { self.id().await })
11413 }
11414}
11415impl Loadable for ListTypeDef {
11416 fn graphql_type() -> &'static str {
11417 "ListTypeDef"
11418 }
11419 fn from_query(
11420 proc: Option<Arc<DaggerSessionProc>>,
11421 selection: Selection,
11422 graphql_client: DynGraphQLClient,
11423 ) -> Self {
11424 Self {
11425 proc,
11426 selection,
11427 graphql_client,
11428 }
11429 }
11430}
11431impl ListTypeDef {
11432 pub fn element_type_def(&self) -> TypeDef {
11434 let query = self.selection.select("elementTypeDef");
11435 TypeDef {
11436 proc: self.proc.clone(),
11437 selection: query,
11438 graphql_client: self.graphql_client.clone(),
11439 }
11440 }
11441 pub async fn id(&self) -> Result<Id, DaggerError> {
11443 let query = self.selection.select("id");
11444 query.execute(self.graphql_client.clone()).await
11445 }
11446}
11447impl Node for ListTypeDef {
11448 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11449 let query = self.selection.select("id");
11450 let graphql_client = self.graphql_client.clone();
11451 async move { query.execute(graphql_client).await }
11452 }
11453}
11454#[derive(Clone)]
11455pub struct Module {
11456 pub proc: Option<Arc<DaggerSessionProc>>,
11457 pub selection: Selection,
11458 pub graphql_client: DynGraphQLClient,
11459}
11460#[derive(Builder, Debug, PartialEq)]
11461pub struct ModuleChecksOpts<'a> {
11462 #[builder(setter(into, strip_option), default)]
11464 pub include: Option<Vec<&'a str>>,
11465 #[builder(setter(into, strip_option), default)]
11467 pub no_generate: Option<bool>,
11468}
11469#[derive(Builder, Debug, PartialEq)]
11470pub struct ModuleGeneratorsOpts<'a> {
11471 #[builder(setter(into, strip_option), default)]
11473 pub include: Option<Vec<&'a str>>,
11474}
11475#[derive(Builder, Debug, PartialEq)]
11476pub struct ModuleServeOpts {
11477 #[builder(setter(into, strip_option), default)]
11479 pub entrypoint: Option<bool>,
11480 #[builder(setter(into, strip_option), default)]
11482 pub include_dependencies: Option<bool>,
11483}
11484#[derive(Builder, Debug, PartialEq)]
11485pub struct ModuleServicesOpts<'a> {
11486 #[builder(setter(into, strip_option), default)]
11488 pub include: Option<Vec<&'a str>>,
11489}
11490impl IntoID<Id> for Module {
11491 fn into_id(
11492 self,
11493 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11494 Box::pin(async move { self.id().await })
11495 }
11496}
11497impl Loadable for Module {
11498 fn graphql_type() -> &'static str {
11499 "Module"
11500 }
11501 fn from_query(
11502 proc: Option<Arc<DaggerSessionProc>>,
11503 selection: Selection,
11504 graphql_client: DynGraphQLClient,
11505 ) -> Self {
11506 Self {
11507 proc,
11508 selection,
11509 graphql_client,
11510 }
11511 }
11512}
11513impl Module {
11514 pub fn check(&self, name: impl Into<String>) -> Check {
11520 let mut query = self.selection.select("check");
11521 query = query.arg("name", name.into());
11522 Check {
11523 proc: self.proc.clone(),
11524 selection: query,
11525 graphql_client: self.graphql_client.clone(),
11526 }
11527 }
11528 pub fn checks(&self) -> CheckGroup {
11534 let query = self.selection.select("checks");
11535 CheckGroup {
11536 proc: self.proc.clone(),
11537 selection: query,
11538 graphql_client: self.graphql_client.clone(),
11539 }
11540 }
11541 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11547 let mut query = self.selection.select("checks");
11548 if let Some(include) = opts.include {
11549 query = query.arg("include", include);
11550 }
11551 if let Some(no_generate) = opts.no_generate {
11552 query = query.arg("noGenerate", no_generate);
11553 }
11554 CheckGroup {
11555 proc: self.proc.clone(),
11556 selection: query,
11557 graphql_client: self.graphql_client.clone(),
11558 }
11559 }
11560 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11562 let query = self.selection.select("dependencies");
11563 let query = query.select("id");
11564 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11565 Ok(ids
11566 .into_iter()
11567 .map(|id| Module {
11568 proc: self.proc.clone(),
11569 selection: crate::querybuilder::query()
11570 .select("node")
11571 .arg("id", &id.0)
11572 .inline_fragment("Module"),
11573 graphql_client: self.graphql_client.clone(),
11574 })
11575 .collect())
11576 }
11577 pub async fn description(&self) -> Result<String, DaggerError> {
11579 let query = self.selection.select("description");
11580 query.execute(self.graphql_client.clone()).await
11581 }
11582 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11584 let query = self.selection.select("enums");
11585 let query = query.select("id");
11586 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11587 Ok(ids
11588 .into_iter()
11589 .map(|id| TypeDef {
11590 proc: self.proc.clone(),
11591 selection: crate::querybuilder::query()
11592 .select("node")
11593 .arg("id", &id.0)
11594 .inline_fragment("TypeDef"),
11595 graphql_client: self.graphql_client.clone(),
11596 })
11597 .collect())
11598 }
11599 pub fn generated_context_directory(&self) -> Directory {
11601 let query = self.selection.select("generatedContextDirectory");
11602 Directory {
11603 proc: self.proc.clone(),
11604 selection: query,
11605 graphql_client: self.graphql_client.clone(),
11606 }
11607 }
11608 pub fn generator(&self, name: impl Into<String>) -> Generator {
11614 let mut query = self.selection.select("generator");
11615 query = query.arg("name", name.into());
11616 Generator {
11617 proc: self.proc.clone(),
11618 selection: query,
11619 graphql_client: self.graphql_client.clone(),
11620 }
11621 }
11622 pub fn generators(&self) -> GeneratorGroup {
11628 let query = self.selection.select("generators");
11629 GeneratorGroup {
11630 proc: self.proc.clone(),
11631 selection: query,
11632 graphql_client: self.graphql_client.clone(),
11633 }
11634 }
11635 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11641 let mut query = self.selection.select("generators");
11642 if let Some(include) = opts.include {
11643 query = query.arg("include", include);
11644 }
11645 GeneratorGroup {
11646 proc: self.proc.clone(),
11647 selection: query,
11648 graphql_client: self.graphql_client.clone(),
11649 }
11650 }
11651 pub async fn id(&self) -> Result<Id, DaggerError> {
11653 let query = self.selection.select("id");
11654 query.execute(self.graphql_client.clone()).await
11655 }
11656 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11658 let query = self.selection.select("interfaces");
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 introspection_schema_json(&self) -> File {
11677 let query = self.selection.select("introspectionSchemaJSON");
11678 File {
11679 proc: self.proc.clone(),
11680 selection: query,
11681 graphql_client: self.graphql_client.clone(),
11682 }
11683 }
11684 pub async fn name(&self) -> Result<String, DaggerError> {
11686 let query = self.selection.select("name");
11687 query.execute(self.graphql_client.clone()).await
11688 }
11689 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11691 let query = self.selection.select("objects");
11692 let query = query.select("id");
11693 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11694 Ok(ids
11695 .into_iter()
11696 .map(|id| TypeDef {
11697 proc: self.proc.clone(),
11698 selection: crate::querybuilder::query()
11699 .select("node")
11700 .arg("id", &id.0)
11701 .inline_fragment("TypeDef"),
11702 graphql_client: self.graphql_client.clone(),
11703 })
11704 .collect())
11705 }
11706 pub fn runtime(&self) -> Container {
11708 let query = self.selection.select("runtime");
11709 Container {
11710 proc: self.proc.clone(),
11711 selection: query,
11712 graphql_client: self.graphql_client.clone(),
11713 }
11714 }
11715 pub fn sdk(&self) -> SdkConfig {
11717 let query = self.selection.select("sdk");
11718 SdkConfig {
11719 proc: self.proc.clone(),
11720 selection: query,
11721 graphql_client: self.graphql_client.clone(),
11722 }
11723 }
11724 pub async fn serve(&self) -> Result<Void, DaggerError> {
11731 let query = self.selection.select("serve");
11732 query.execute(self.graphql_client.clone()).await
11733 }
11734 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11741 let mut query = self.selection.select("serve");
11742 if let Some(include_dependencies) = opts.include_dependencies {
11743 query = query.arg("includeDependencies", include_dependencies);
11744 }
11745 if let Some(entrypoint) = opts.entrypoint {
11746 query = query.arg("entrypoint", entrypoint);
11747 }
11748 query.execute(self.graphql_client.clone()).await
11749 }
11750 pub fn services(&self) -> UpGroup {
11756 let query = self.selection.select("services");
11757 UpGroup {
11758 proc: self.proc.clone(),
11759 selection: query,
11760 graphql_client: self.graphql_client.clone(),
11761 }
11762 }
11763 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11769 let mut query = self.selection.select("services");
11770 if let Some(include) = opts.include {
11771 query = query.arg("include", include);
11772 }
11773 UpGroup {
11774 proc: self.proc.clone(),
11775 selection: query,
11776 graphql_client: self.graphql_client.clone(),
11777 }
11778 }
11779 pub fn source(&self) -> ModuleSource {
11781 let query = self.selection.select("source");
11782 ModuleSource {
11783 proc: self.proc.clone(),
11784 selection: query,
11785 graphql_client: self.graphql_client.clone(),
11786 }
11787 }
11788 pub async fn sync(&self) -> Result<Module, DaggerError> {
11790 let query = self.selection.select("sync");
11791 let id: Id = query.execute(self.graphql_client.clone()).await?;
11792 Ok(Module {
11793 proc: self.proc.clone(),
11794 selection: query
11795 .root()
11796 .select("node")
11797 .arg("id", &id.0)
11798 .inline_fragment("Module"),
11799 graphql_client: self.graphql_client.clone(),
11800 })
11801 }
11802 pub fn user_defaults(&self) -> EnvFile {
11804 let query = self.selection.select("userDefaults");
11805 EnvFile {
11806 proc: self.proc.clone(),
11807 selection: query,
11808 graphql_client: self.graphql_client.clone(),
11809 }
11810 }
11811 pub fn with_description(&self, description: impl Into<String>) -> Module {
11817 let mut query = self.selection.select("withDescription");
11818 query = query.arg("description", description.into());
11819 Module {
11820 proc: self.proc.clone(),
11821 selection: query,
11822 graphql_client: self.graphql_client.clone(),
11823 }
11824 }
11825 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11827 let mut query = self.selection.select("withEnum");
11828 query = query.arg_lazy(
11829 "enum",
11830 Box::new(move || {
11831 let r#enum = r#enum.clone();
11832 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11833 }),
11834 );
11835 Module {
11836 proc: self.proc.clone(),
11837 selection: query,
11838 graphql_client: self.graphql_client.clone(),
11839 }
11840 }
11841 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11843 let mut query = self.selection.select("withInterface");
11844 query = query.arg_lazy(
11845 "iface",
11846 Box::new(move || {
11847 let iface = iface.clone();
11848 Box::pin(async move { iface.into_id().await.unwrap().quote() })
11849 }),
11850 );
11851 Module {
11852 proc: self.proc.clone(),
11853 selection: query,
11854 graphql_client: self.graphql_client.clone(),
11855 }
11856 }
11857 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11859 let mut query = self.selection.select("withObject");
11860 query = query.arg_lazy(
11861 "object",
11862 Box::new(move || {
11863 let object = object.clone();
11864 Box::pin(async move { object.into_id().await.unwrap().quote() })
11865 }),
11866 );
11867 Module {
11868 proc: self.proc.clone(),
11869 selection: query,
11870 graphql_client: self.graphql_client.clone(),
11871 }
11872 }
11873}
11874impl Node for Module {
11875 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11876 let query = self.selection.select("id");
11877 let graphql_client = self.graphql_client.clone();
11878 async move { query.execute(graphql_client).await }
11879 }
11880}
11881impl Syncer for Module {
11882 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11883 let query = self.selection.select("id");
11884 let graphql_client = self.graphql_client.clone();
11885 async move { query.execute(graphql_client).await }
11886 }
11887 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11888 let query = self.selection.select("sync");
11889 let graphql_client = self.graphql_client.clone();
11890 async move { query.execute(graphql_client).await }
11891 }
11892}
11893#[derive(Clone)]
11894pub struct ModuleConfigClient {
11895 pub proc: Option<Arc<DaggerSessionProc>>,
11896 pub selection: Selection,
11897 pub graphql_client: DynGraphQLClient,
11898}
11899impl IntoID<Id> for ModuleConfigClient {
11900 fn into_id(
11901 self,
11902 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11903 Box::pin(async move { self.id().await })
11904 }
11905}
11906impl Loadable for ModuleConfigClient {
11907 fn graphql_type() -> &'static str {
11908 "ModuleConfigClient"
11909 }
11910 fn from_query(
11911 proc: Option<Arc<DaggerSessionProc>>,
11912 selection: Selection,
11913 graphql_client: DynGraphQLClient,
11914 ) -> Self {
11915 Self {
11916 proc,
11917 selection,
11918 graphql_client,
11919 }
11920 }
11921}
11922impl ModuleConfigClient {
11923 pub async fn directory(&self) -> Result<String, DaggerError> {
11925 let query = self.selection.select("directory");
11926 query.execute(self.graphql_client.clone()).await
11927 }
11928 pub async fn generator(&self) -> Result<String, DaggerError> {
11930 let query = self.selection.select("generator");
11931 query.execute(self.graphql_client.clone()).await
11932 }
11933 pub async fn id(&self) -> Result<Id, DaggerError> {
11935 let query = self.selection.select("id");
11936 query.execute(self.graphql_client.clone()).await
11937 }
11938}
11939impl Node for ModuleConfigClient {
11940 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11941 let query = self.selection.select("id");
11942 let graphql_client = self.graphql_client.clone();
11943 async move { query.execute(graphql_client).await }
11944 }
11945}
11946#[derive(Clone)]
11947pub struct ModuleSource {
11948 pub proc: Option<Arc<DaggerSessionProc>>,
11949 pub selection: Selection,
11950 pub graphql_client: DynGraphQLClient,
11951}
11952impl IntoID<Id> for ModuleSource {
11953 fn into_id(
11954 self,
11955 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11956 Box::pin(async move { self.id().await })
11957 }
11958}
11959impl Loadable for ModuleSource {
11960 fn graphql_type() -> &'static str {
11961 "ModuleSource"
11962 }
11963 fn from_query(
11964 proc: Option<Arc<DaggerSessionProc>>,
11965 selection: Selection,
11966 graphql_client: DynGraphQLClient,
11967 ) -> Self {
11968 Self {
11969 proc,
11970 selection,
11971 graphql_client,
11972 }
11973 }
11974}
11975impl ModuleSource {
11976 pub fn as_module(&self) -> Module {
11978 let query = self.selection.select("asModule");
11979 Module {
11980 proc: self.proc.clone(),
11981 selection: query,
11982 graphql_client: self.graphql_client.clone(),
11983 }
11984 }
11985 pub async fn as_string(&self) -> Result<String, DaggerError> {
11987 let query = self.selection.select("asString");
11988 query.execute(self.graphql_client.clone()).await
11989 }
11990 pub fn blueprint(&self) -> ModuleSource {
11992 let query = self.selection.select("blueprint");
11993 ModuleSource {
11994 proc: self.proc.clone(),
11995 selection: query,
11996 graphql_client: self.graphql_client.clone(),
11997 }
11998 }
11999 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
12001 let query = self.selection.select("cloneRef");
12002 query.execute(self.graphql_client.clone()).await
12003 }
12004 pub async fn commit(&self) -> Result<String, DaggerError> {
12006 let query = self.selection.select("commit");
12007 query.execute(self.graphql_client.clone()).await
12008 }
12009 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
12011 let query = self.selection.select("configClients");
12012 let query = query.select("id");
12013 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12014 Ok(ids
12015 .into_iter()
12016 .map(|id| ModuleConfigClient {
12017 proc: self.proc.clone(),
12018 selection: crate::querybuilder::query()
12019 .select("node")
12020 .arg("id", &id.0)
12021 .inline_fragment("ModuleConfigClient"),
12022 graphql_client: self.graphql_client.clone(),
12023 })
12024 .collect())
12025 }
12026 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
12028 let query = self.selection.select("configExists");
12029 query.execute(self.graphql_client.clone()).await
12030 }
12031 pub fn context_directory(&self) -> Directory {
12033 let query = self.selection.select("contextDirectory");
12034 Directory {
12035 proc: self.proc.clone(),
12036 selection: query,
12037 graphql_client: self.graphql_client.clone(),
12038 }
12039 }
12040 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12042 let query = self.selection.select("dependencies");
12043 let query = query.select("id");
12044 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12045 Ok(ids
12046 .into_iter()
12047 .map(|id| ModuleSource {
12048 proc: self.proc.clone(),
12049 selection: crate::querybuilder::query()
12050 .select("node")
12051 .arg("id", &id.0)
12052 .inline_fragment("ModuleSource"),
12053 graphql_client: self.graphql_client.clone(),
12054 })
12055 .collect())
12056 }
12057 pub async fn digest(&self) -> Result<String, DaggerError> {
12059 let query = self.selection.select("digest");
12060 query.execute(self.graphql_client.clone()).await
12061 }
12062 pub fn directory(&self, path: impl Into<String>) -> Directory {
12068 let mut query = self.selection.select("directory");
12069 query = query.arg("path", path.into());
12070 Directory {
12071 proc: self.proc.clone(),
12072 selection: query,
12073 graphql_client: self.graphql_client.clone(),
12074 }
12075 }
12076 pub async fn engine_version(&self) -> Result<String, DaggerError> {
12078 let query = self.selection.select("engineVersion");
12079 query.execute(self.graphql_client.clone()).await
12080 }
12081 pub fn generated_context_changeset(&self) -> Changeset {
12083 let query = self.selection.select("generatedContextChangeset");
12084 Changeset {
12085 proc: self.proc.clone(),
12086 selection: query,
12087 graphql_client: self.graphql_client.clone(),
12088 }
12089 }
12090 pub fn generated_context_directory(&self) -> Directory {
12092 let query = self.selection.select("generatedContextDirectory");
12093 Directory {
12094 proc: self.proc.clone(),
12095 selection: query,
12096 graphql_client: self.graphql_client.clone(),
12097 }
12098 }
12099 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12101 let query = self.selection.select("htmlRepoURL");
12102 query.execute(self.graphql_client.clone()).await
12103 }
12104 pub async fn html_url(&self) -> Result<String, DaggerError> {
12106 let query = self.selection.select("htmlURL");
12107 query.execute(self.graphql_client.clone()).await
12108 }
12109 pub async fn id(&self) -> Result<Id, DaggerError> {
12111 let query = self.selection.select("id");
12112 query.execute(self.graphql_client.clone()).await
12113 }
12114 pub fn introspection_schema_json(&self) -> File {
12118 let query = self.selection.select("introspectionSchemaJSON");
12119 File {
12120 proc: self.proc.clone(),
12121 selection: query,
12122 graphql_client: self.graphql_client.clone(),
12123 }
12124 }
12125 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12127 let query = self.selection.select("kind");
12128 query.execute(self.graphql_client.clone()).await
12129 }
12130 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12132 let query = self.selection.select("localContextDirectoryPath");
12133 query.execute(self.graphql_client.clone()).await
12134 }
12135 pub async fn module_name(&self) -> Result<String, DaggerError> {
12137 let query = self.selection.select("moduleName");
12138 query.execute(self.graphql_client.clone()).await
12139 }
12140 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12142 let query = self.selection.select("moduleOriginalName");
12143 query.execute(self.graphql_client.clone()).await
12144 }
12145 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12147 let query = self.selection.select("originalSubpath");
12148 query.execute(self.graphql_client.clone()).await
12149 }
12150 pub async fn pin(&self) -> Result<String, DaggerError> {
12152 let query = self.selection.select("pin");
12153 query.execute(self.graphql_client.clone()).await
12154 }
12155 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12157 let query = self.selection.select("repoRootPath");
12158 query.execute(self.graphql_client.clone()).await
12159 }
12160 pub fn sdk(&self) -> SdkConfig {
12162 let query = self.selection.select("sdk");
12163 SdkConfig {
12164 proc: self.proc.clone(),
12165 selection: query,
12166 graphql_client: self.graphql_client.clone(),
12167 }
12168 }
12169 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12171 let query = self.selection.select("sourceRootSubpath");
12172 query.execute(self.graphql_client.clone()).await
12173 }
12174 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12176 let query = self.selection.select("sourceSubpath");
12177 query.execute(self.graphql_client.clone()).await
12178 }
12179 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12181 let query = self.selection.select("sync");
12182 let id: Id = query.execute(self.graphql_client.clone()).await?;
12183 Ok(ModuleSource {
12184 proc: self.proc.clone(),
12185 selection: query
12186 .root()
12187 .select("node")
12188 .arg("id", &id.0)
12189 .inline_fragment("ModuleSource"),
12190 graphql_client: self.graphql_client.clone(),
12191 })
12192 }
12193 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12195 let query = self.selection.select("toolchains");
12196 let query = query.select("id");
12197 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12198 Ok(ids
12199 .into_iter()
12200 .map(|id| ModuleSource {
12201 proc: self.proc.clone(),
12202 selection: crate::querybuilder::query()
12203 .select("node")
12204 .arg("id", &id.0)
12205 .inline_fragment("ModuleSource"),
12206 graphql_client: self.graphql_client.clone(),
12207 })
12208 .collect())
12209 }
12210 pub fn user_defaults(&self) -> EnvFile {
12212 let query = self.selection.select("userDefaults");
12213 EnvFile {
12214 proc: self.proc.clone(),
12215 selection: query,
12216 graphql_client: self.graphql_client.clone(),
12217 }
12218 }
12219 pub async fn version(&self) -> Result<String, DaggerError> {
12221 let query = self.selection.select("version");
12222 query.execute(self.graphql_client.clone()).await
12223 }
12224 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12230 let mut query = self.selection.select("withBlueprint");
12231 query = query.arg_lazy(
12232 "blueprint",
12233 Box::new(move || {
12234 let blueprint = blueprint.clone();
12235 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12236 }),
12237 );
12238 ModuleSource {
12239 proc: self.proc.clone(),
12240 selection: query,
12241 graphql_client: self.graphql_client.clone(),
12242 }
12243 }
12244 pub fn with_client(
12251 &self,
12252 generator: impl Into<String>,
12253 output_dir: impl Into<String>,
12254 ) -> ModuleSource {
12255 let mut query = self.selection.select("withClient");
12256 query = query.arg("generator", generator.into());
12257 query = query.arg("outputDir", output_dir.into());
12258 ModuleSource {
12259 proc: self.proc.clone(),
12260 selection: query,
12261 graphql_client: self.graphql_client.clone(),
12262 }
12263 }
12264 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12270 let mut query = self.selection.select("withDependencies");
12271 query = query.arg("dependencies", dependencies);
12272 ModuleSource {
12273 proc: self.proc.clone(),
12274 selection: query,
12275 graphql_client: self.graphql_client.clone(),
12276 }
12277 }
12278 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12284 let mut query = self.selection.select("withEngineVersion");
12285 query = query.arg("version", version.into());
12286 ModuleSource {
12287 proc: self.proc.clone(),
12288 selection: query,
12289 graphql_client: self.graphql_client.clone(),
12290 }
12291 }
12292 pub fn with_experimental_features(
12298 &self,
12299 features: Vec<ModuleSourceExperimentalFeature>,
12300 ) -> ModuleSource {
12301 let mut query = self.selection.select("withExperimentalFeatures");
12302 query = query.arg("features", features);
12303 ModuleSource {
12304 proc: self.proc.clone(),
12305 selection: query,
12306 graphql_client: self.graphql_client.clone(),
12307 }
12308 }
12309 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12315 let mut query = self.selection.select("withIncludes");
12316 query = query.arg(
12317 "patterns",
12318 patterns
12319 .into_iter()
12320 .map(|i| i.into())
12321 .collect::<Vec<String>>(),
12322 );
12323 ModuleSource {
12324 proc: self.proc.clone(),
12325 selection: query,
12326 graphql_client: self.graphql_client.clone(),
12327 }
12328 }
12329 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12335 let mut query = self.selection.select("withName");
12336 query = query.arg("name", name.into());
12337 ModuleSource {
12338 proc: self.proc.clone(),
12339 selection: query,
12340 graphql_client: self.graphql_client.clone(),
12341 }
12342 }
12343 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12349 let mut query = self.selection.select("withSDK");
12350 query = query.arg("source", source.into());
12351 ModuleSource {
12352 proc: self.proc.clone(),
12353 selection: query,
12354 graphql_client: self.graphql_client.clone(),
12355 }
12356 }
12357 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12363 let mut query = self.selection.select("withSourceSubpath");
12364 query = query.arg("path", path.into());
12365 ModuleSource {
12366 proc: self.proc.clone(),
12367 selection: query,
12368 graphql_client: self.graphql_client.clone(),
12369 }
12370 }
12371 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12377 let mut query = self.selection.select("withToolchains");
12378 query = query.arg("toolchains", toolchains);
12379 ModuleSource {
12380 proc: self.proc.clone(),
12381 selection: query,
12382 graphql_client: self.graphql_client.clone(),
12383 }
12384 }
12385 pub fn with_update_blueprint(&self) -> ModuleSource {
12387 let query = self.selection.select("withUpdateBlueprint");
12388 ModuleSource {
12389 proc: self.proc.clone(),
12390 selection: query,
12391 graphql_client: self.graphql_client.clone(),
12392 }
12393 }
12394 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12400 let mut query = self.selection.select("withUpdateDependencies");
12401 query = query.arg(
12402 "dependencies",
12403 dependencies
12404 .into_iter()
12405 .map(|i| i.into())
12406 .collect::<Vec<String>>(),
12407 );
12408 ModuleSource {
12409 proc: self.proc.clone(),
12410 selection: query,
12411 graphql_client: self.graphql_client.clone(),
12412 }
12413 }
12414 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12420 let mut query = self.selection.select("withUpdateToolchains");
12421 query = query.arg(
12422 "toolchains",
12423 toolchains
12424 .into_iter()
12425 .map(|i| i.into())
12426 .collect::<Vec<String>>(),
12427 );
12428 ModuleSource {
12429 proc: self.proc.clone(),
12430 selection: query,
12431 graphql_client: self.graphql_client.clone(),
12432 }
12433 }
12434 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12440 let mut query = self.selection.select("withUpdatedClients");
12441 query = query.arg(
12442 "clients",
12443 clients
12444 .into_iter()
12445 .map(|i| i.into())
12446 .collect::<Vec<String>>(),
12447 );
12448 ModuleSource {
12449 proc: self.proc.clone(),
12450 selection: query,
12451 graphql_client: self.graphql_client.clone(),
12452 }
12453 }
12454 pub fn without_blueprint(&self) -> ModuleSource {
12456 let query = self.selection.select("withoutBlueprint");
12457 ModuleSource {
12458 proc: self.proc.clone(),
12459 selection: query,
12460 graphql_client: self.graphql_client.clone(),
12461 }
12462 }
12463 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12469 let mut query = self.selection.select("withoutClient");
12470 query = query.arg("path", path.into());
12471 ModuleSource {
12472 proc: self.proc.clone(),
12473 selection: query,
12474 graphql_client: self.graphql_client.clone(),
12475 }
12476 }
12477 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12483 let mut query = self.selection.select("withoutDependencies");
12484 query = query.arg(
12485 "dependencies",
12486 dependencies
12487 .into_iter()
12488 .map(|i| i.into())
12489 .collect::<Vec<String>>(),
12490 );
12491 ModuleSource {
12492 proc: self.proc.clone(),
12493 selection: query,
12494 graphql_client: self.graphql_client.clone(),
12495 }
12496 }
12497 pub fn without_experimental_features(
12503 &self,
12504 features: Vec<ModuleSourceExperimentalFeature>,
12505 ) -> ModuleSource {
12506 let mut query = self.selection.select("withoutExperimentalFeatures");
12507 query = query.arg("features", features);
12508 ModuleSource {
12509 proc: self.proc.clone(),
12510 selection: query,
12511 graphql_client: self.graphql_client.clone(),
12512 }
12513 }
12514 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12520 let mut query = self.selection.select("withoutToolchains");
12521 query = query.arg(
12522 "toolchains",
12523 toolchains
12524 .into_iter()
12525 .map(|i| i.into())
12526 .collect::<Vec<String>>(),
12527 );
12528 ModuleSource {
12529 proc: self.proc.clone(),
12530 selection: query,
12531 graphql_client: self.graphql_client.clone(),
12532 }
12533 }
12534}
12535impl Node for ModuleSource {
12536 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12537 let query = self.selection.select("id");
12538 let graphql_client = self.graphql_client.clone();
12539 async move { query.execute(graphql_client).await }
12540 }
12541}
12542impl Syncer for ModuleSource {
12543 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12544 let query = self.selection.select("id");
12545 let graphql_client = self.graphql_client.clone();
12546 async move { query.execute(graphql_client).await }
12547 }
12548 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12549 let query = self.selection.select("sync");
12550 let graphql_client = self.graphql_client.clone();
12551 async move { query.execute(graphql_client).await }
12552 }
12553}
12554#[derive(Clone)]
12555pub struct ObjectTypeDef {
12556 pub proc: Option<Arc<DaggerSessionProc>>,
12557 pub selection: Selection,
12558 pub graphql_client: DynGraphQLClient,
12559}
12560impl IntoID<Id> for ObjectTypeDef {
12561 fn into_id(
12562 self,
12563 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12564 Box::pin(async move { self.id().await })
12565 }
12566}
12567impl Loadable for ObjectTypeDef {
12568 fn graphql_type() -> &'static str {
12569 "ObjectTypeDef"
12570 }
12571 fn from_query(
12572 proc: Option<Arc<DaggerSessionProc>>,
12573 selection: Selection,
12574 graphql_client: DynGraphQLClient,
12575 ) -> Self {
12576 Self {
12577 proc,
12578 selection,
12579 graphql_client,
12580 }
12581 }
12582}
12583impl ObjectTypeDef {
12584 pub fn constructor(&self) -> Function {
12586 let query = self.selection.select("constructor");
12587 Function {
12588 proc: self.proc.clone(),
12589 selection: query,
12590 graphql_client: self.graphql_client.clone(),
12591 }
12592 }
12593 pub async fn deprecated(&self) -> Result<String, DaggerError> {
12595 let query = self.selection.select("deprecated");
12596 query.execute(self.graphql_client.clone()).await
12597 }
12598 pub async fn description(&self) -> Result<String, DaggerError> {
12600 let query = self.selection.select("description");
12601 query.execute(self.graphql_client.clone()).await
12602 }
12603 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12605 let query = self.selection.select("fields");
12606 let query = query.select("id");
12607 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12608 Ok(ids
12609 .into_iter()
12610 .map(|id| FieldTypeDef {
12611 proc: self.proc.clone(),
12612 selection: crate::querybuilder::query()
12613 .select("node")
12614 .arg("id", &id.0)
12615 .inline_fragment("FieldTypeDef"),
12616 graphql_client: self.graphql_client.clone(),
12617 })
12618 .collect())
12619 }
12620 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12622 let query = self.selection.select("functions");
12623 let query = query.select("id");
12624 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12625 Ok(ids
12626 .into_iter()
12627 .map(|id| Function {
12628 proc: self.proc.clone(),
12629 selection: crate::querybuilder::query()
12630 .select("node")
12631 .arg("id", &id.0)
12632 .inline_fragment("Function"),
12633 graphql_client: self.graphql_client.clone(),
12634 })
12635 .collect())
12636 }
12637 pub async fn id(&self) -> Result<Id, DaggerError> {
12639 let query = self.selection.select("id");
12640 query.execute(self.graphql_client.clone()).await
12641 }
12642 pub async fn name(&self) -> Result<String, DaggerError> {
12644 let query = self.selection.select("name");
12645 query.execute(self.graphql_client.clone()).await
12646 }
12647 pub fn source_map(&self) -> SourceMap {
12649 let query = self.selection.select("sourceMap");
12650 SourceMap {
12651 proc: self.proc.clone(),
12652 selection: query,
12653 graphql_client: self.graphql_client.clone(),
12654 }
12655 }
12656 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12658 let query = self.selection.select("sourceModuleName");
12659 query.execute(self.graphql_client.clone()).await
12660 }
12661}
12662impl Node for ObjectTypeDef {
12663 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12664 let query = self.selection.select("id");
12665 let graphql_client = self.graphql_client.clone();
12666 async move { query.execute(graphql_client).await }
12667 }
12668}
12669#[derive(Clone)]
12670pub struct Port {
12671 pub proc: Option<Arc<DaggerSessionProc>>,
12672 pub selection: Selection,
12673 pub graphql_client: DynGraphQLClient,
12674}
12675impl IntoID<Id> for Port {
12676 fn into_id(
12677 self,
12678 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12679 Box::pin(async move { self.id().await })
12680 }
12681}
12682impl Loadable for Port {
12683 fn graphql_type() -> &'static str {
12684 "Port"
12685 }
12686 fn from_query(
12687 proc: Option<Arc<DaggerSessionProc>>,
12688 selection: Selection,
12689 graphql_client: DynGraphQLClient,
12690 ) -> Self {
12691 Self {
12692 proc,
12693 selection,
12694 graphql_client,
12695 }
12696 }
12697}
12698impl Port {
12699 pub async fn description(&self) -> Result<String, DaggerError> {
12701 let query = self.selection.select("description");
12702 query.execute(self.graphql_client.clone()).await
12703 }
12704 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12706 let query = self.selection.select("experimentalSkipHealthcheck");
12707 query.execute(self.graphql_client.clone()).await
12708 }
12709 pub async fn id(&self) -> Result<Id, DaggerError> {
12711 let query = self.selection.select("id");
12712 query.execute(self.graphql_client.clone()).await
12713 }
12714 pub async fn port(&self) -> Result<isize, DaggerError> {
12716 let query = self.selection.select("port");
12717 query.execute(self.graphql_client.clone()).await
12718 }
12719 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12721 let query = self.selection.select("protocol");
12722 query.execute(self.graphql_client.clone()).await
12723 }
12724}
12725impl Node for Port {
12726 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12727 let query = self.selection.select("id");
12728 let graphql_client = self.graphql_client.clone();
12729 async move { query.execute(graphql_client).await }
12730 }
12731}
12732#[derive(Clone)]
12733pub struct Query {
12734 pub proc: Option<Arc<DaggerSessionProc>>,
12735 pub selection: Selection,
12736 pub graphql_client: DynGraphQLClient,
12737}
12738#[derive(Builder, Debug, PartialEq)]
12739pub struct QueryCacheVolumeOpts<'a> {
12740 #[builder(setter(into, strip_option), default)]
12744 pub owner: Option<&'a str>,
12745 #[builder(setter(into, strip_option), default)]
12747 pub sharing: Option<CacheSharingMode>,
12748 #[builder(setter(into, strip_option), default)]
12750 pub source: Option<Id>,
12751}
12752#[derive(Builder, Debug, PartialEq)]
12753pub struct QueryContainerOpts {
12754 #[builder(setter(into, strip_option), default)]
12756 pub platform: Option<Platform>,
12757}
12758#[derive(Builder, Debug, PartialEq)]
12759pub struct QueryCurrentTypeDefsOpts {
12760 #[builder(setter(into, strip_option), default)]
12763 pub hide_core: Option<bool>,
12764 #[builder(setter(into, strip_option), default)]
12766 pub return_all_types: Option<bool>,
12767}
12768#[derive(Builder, Debug, PartialEq)]
12769pub struct QueryEnvOpts {
12770 #[builder(setter(into, strip_option), default)]
12772 pub privileged: Option<bool>,
12773 #[builder(setter(into, strip_option), default)]
12775 pub writable: Option<bool>,
12776}
12777#[derive(Builder, Debug, PartialEq)]
12778pub struct QueryEnvFileOpts {
12779 #[builder(setter(into, strip_option), default)]
12781 pub expand: Option<bool>,
12782}
12783#[derive(Builder, Debug, PartialEq)]
12784pub struct QueryFileOpts {
12785 #[builder(setter(into, strip_option), default)]
12787 pub permissions: Option<isize>,
12788}
12789#[derive(Builder, Debug, PartialEq)]
12790pub struct QueryGitOpts<'a> {
12791 #[builder(setter(into, strip_option), default)]
12793 pub experimental_service_host: Option<Id>,
12794 #[builder(setter(into, strip_option), default)]
12796 pub http_auth_header: Option<Id>,
12797 #[builder(setter(into, strip_option), default)]
12799 pub http_auth_token: Option<Id>,
12800 #[builder(setter(into, strip_option), default)]
12802 pub http_auth_username: Option<&'a str>,
12803 #[builder(setter(into, strip_option), default)]
12805 pub keep_git_dir: Option<bool>,
12806 #[builder(setter(into, strip_option), default)]
12808 pub ssh_auth_socket: Option<Id>,
12809 #[builder(setter(into, strip_option), default)]
12811 pub ssh_known_hosts: Option<&'a str>,
12812}
12813#[derive(Builder, Debug, PartialEq)]
12814pub struct QueryHttpOpts<'a> {
12815 #[builder(setter(into, strip_option), default)]
12817 pub auth_header: Option<Id>,
12818 #[builder(setter(into, strip_option), default)]
12820 pub checksum: Option<&'a str>,
12821 #[builder(setter(into, strip_option), default)]
12823 pub experimental_service_host: Option<Id>,
12824 #[builder(setter(into, strip_option), default)]
12826 pub name: Option<&'a str>,
12827 #[builder(setter(into, strip_option), default)]
12829 pub permissions: Option<isize>,
12830}
12831#[derive(Builder, Debug, PartialEq)]
12832pub struct QueryLlmOpts<'a> {
12833 #[builder(setter(into, strip_option), default)]
12835 pub max_api_calls: Option<isize>,
12836 #[builder(setter(into, strip_option), default)]
12838 pub model: Option<&'a str>,
12839}
12840#[derive(Builder, Debug, PartialEq)]
12841pub struct QueryModuleSourceOpts<'a> {
12842 #[builder(setter(into, strip_option), default)]
12844 pub allow_not_exists: Option<bool>,
12845 #[builder(setter(into, strip_option), default)]
12847 pub disable_find_up: Option<bool>,
12848 #[builder(setter(into, strip_option), default)]
12850 pub ref_pin: Option<&'a str>,
12851 #[builder(setter(into, strip_option), default)]
12853 pub require_kind: Option<ModuleSourceKind>,
12854}
12855#[derive(Builder, Debug, PartialEq)]
12856pub struct QuerySecretOpts<'a> {
12857 #[builder(setter(into, strip_option), default)]
12861 pub cache_key: Option<&'a str>,
12862}
12863impl IntoID<Id> for Query {
12864 fn into_id(
12865 self,
12866 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12867 Box::pin(async move { self.id().await })
12868 }
12869}
12870impl Loadable for Query {
12871 fn graphql_type() -> &'static str {
12872 "Query"
12873 }
12874 fn from_query(
12875 proc: Option<Arc<DaggerSessionProc>>,
12876 selection: Selection,
12877 graphql_client: DynGraphQLClient,
12878 ) -> Self {
12879 Self {
12880 proc,
12881 selection,
12882 graphql_client,
12883 }
12884 }
12885}
12886impl Query {
12887 pub fn address(&self, value: impl Into<String>) -> Address {
12889 let mut query = self.selection.select("address");
12890 query = query.arg("value", value.into());
12891 Address {
12892 proc: self.proc.clone(),
12893 selection: query,
12894 graphql_client: self.graphql_client.clone(),
12895 }
12896 }
12897 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12904 let mut query = self.selection.select("cacheVolume");
12905 query = query.arg("key", key.into());
12906 CacheVolume {
12907 proc: self.proc.clone(),
12908 selection: query,
12909 graphql_client: self.graphql_client.clone(),
12910 }
12911 }
12912 pub fn cache_volume_opts<'a>(
12919 &self,
12920 key: impl Into<String>,
12921 opts: QueryCacheVolumeOpts<'a>,
12922 ) -> CacheVolume {
12923 let mut query = self.selection.select("cacheVolume");
12924 query = query.arg("key", key.into());
12925 if let Some(source) = opts.source {
12926 query = query.arg("source", source);
12927 }
12928 if let Some(sharing) = opts.sharing {
12929 query = query.arg("sharing", sharing);
12930 }
12931 if let Some(owner) = opts.owner {
12932 query = query.arg("owner", owner);
12933 }
12934 CacheVolume {
12935 proc: self.proc.clone(),
12936 selection: query,
12937 graphql_client: self.graphql_client.clone(),
12938 }
12939 }
12940 pub fn changeset(&self) -> Changeset {
12942 let query = self.selection.select("changeset");
12943 Changeset {
12944 proc: self.proc.clone(),
12945 selection: query,
12946 graphql_client: self.graphql_client.clone(),
12947 }
12948 }
12949 pub fn cloud(&self) -> Cloud {
12951 let query = self.selection.select("cloud");
12952 Cloud {
12953 proc: self.proc.clone(),
12954 selection: query,
12955 graphql_client: self.graphql_client.clone(),
12956 }
12957 }
12958 pub fn container(&self) -> Container {
12965 let query = self.selection.select("container");
12966 Container {
12967 proc: self.proc.clone(),
12968 selection: query,
12969 graphql_client: self.graphql_client.clone(),
12970 }
12971 }
12972 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12979 let mut query = self.selection.select("container");
12980 if let Some(platform) = opts.platform {
12981 query = query.arg("platform", platform);
12982 }
12983 Container {
12984 proc: self.proc.clone(),
12985 selection: query,
12986 graphql_client: self.graphql_client.clone(),
12987 }
12988 }
12989 pub fn current_env(&self) -> Env {
12993 let query = self.selection.select("currentEnv");
12994 Env {
12995 proc: self.proc.clone(),
12996 selection: query,
12997 graphql_client: self.graphql_client.clone(),
12998 }
12999 }
13000 pub fn current_function_call(&self) -> FunctionCall {
13003 let query = self.selection.select("currentFunctionCall");
13004 FunctionCall {
13005 proc: self.proc.clone(),
13006 selection: query,
13007 graphql_client: self.graphql_client.clone(),
13008 }
13009 }
13010 pub fn current_module(&self) -> CurrentModule {
13012 let query = self.selection.select("currentModule");
13013 CurrentModule {
13014 proc: self.proc.clone(),
13015 selection: query,
13016 graphql_client: self.graphql_client.clone(),
13017 }
13018 }
13019 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
13025 let query = self.selection.select("currentTypeDefs");
13026 let query = query.select("id");
13027 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13028 Ok(ids
13029 .into_iter()
13030 .map(|id| TypeDef {
13031 proc: self.proc.clone(),
13032 selection: crate::querybuilder::query()
13033 .select("node")
13034 .arg("id", &id.0)
13035 .inline_fragment("TypeDef"),
13036 graphql_client: self.graphql_client.clone(),
13037 })
13038 .collect())
13039 }
13040 pub async fn current_type_defs_opts(
13046 &self,
13047 opts: QueryCurrentTypeDefsOpts,
13048 ) -> Result<Vec<TypeDef>, DaggerError> {
13049 let mut query = self.selection.select("currentTypeDefs");
13050 if let Some(return_all_types) = opts.return_all_types {
13051 query = query.arg("returnAllTypes", return_all_types);
13052 }
13053 if let Some(hide_core) = opts.hide_core {
13054 query = query.arg("hideCore", hide_core);
13055 }
13056 let query = query.select("id");
13057 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13058 Ok(ids
13059 .into_iter()
13060 .map(|id| TypeDef {
13061 proc: self.proc.clone(),
13062 selection: crate::querybuilder::query()
13063 .select("node")
13064 .arg("id", &id.0)
13065 .inline_fragment("TypeDef"),
13066 graphql_client: self.graphql_client.clone(),
13067 })
13068 .collect())
13069 }
13070 pub fn current_workspace(&self) -> Workspace {
13072 let query = self.selection.select("currentWorkspace");
13073 Workspace {
13074 proc: self.proc.clone(),
13075 selection: query,
13076 graphql_client: self.graphql_client.clone(),
13077 }
13078 }
13079 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13081 let query = self.selection.select("defaultPlatform");
13082 query.execute(self.graphql_client.clone()).await
13083 }
13084 pub fn directory(&self) -> Directory {
13086 let query = self.selection.select("directory");
13087 Directory {
13088 proc: self.proc.clone(),
13089 selection: query,
13090 graphql_client: self.graphql_client.clone(),
13091 }
13092 }
13093 pub fn engine(&self) -> Engine {
13095 let query = self.selection.select("engine");
13096 Engine {
13097 proc: self.proc.clone(),
13098 selection: query,
13099 graphql_client: self.graphql_client.clone(),
13100 }
13101 }
13102 pub fn env(&self) -> Env {
13108 let query = self.selection.select("env");
13109 Env {
13110 proc: self.proc.clone(),
13111 selection: query,
13112 graphql_client: self.graphql_client.clone(),
13113 }
13114 }
13115 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13121 let mut query = self.selection.select("env");
13122 if let Some(privileged) = opts.privileged {
13123 query = query.arg("privileged", privileged);
13124 }
13125 if let Some(writable) = opts.writable {
13126 query = query.arg("writable", writable);
13127 }
13128 Env {
13129 proc: self.proc.clone(),
13130 selection: query,
13131 graphql_client: self.graphql_client.clone(),
13132 }
13133 }
13134 pub fn env_file(&self) -> EnvFile {
13140 let query = self.selection.select("envFile");
13141 EnvFile {
13142 proc: self.proc.clone(),
13143 selection: query,
13144 graphql_client: self.graphql_client.clone(),
13145 }
13146 }
13147 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13153 let mut query = self.selection.select("envFile");
13154 if let Some(expand) = opts.expand {
13155 query = query.arg("expand", expand);
13156 }
13157 EnvFile {
13158 proc: self.proc.clone(),
13159 selection: query,
13160 graphql_client: self.graphql_client.clone(),
13161 }
13162 }
13163 pub fn error(&self, message: impl Into<String>) -> Error {
13169 let mut query = self.selection.select("error");
13170 query = query.arg("message", message.into());
13171 Error {
13172 proc: self.proc.clone(),
13173 selection: query,
13174 graphql_client: self.graphql_client.clone(),
13175 }
13176 }
13177 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13185 let mut query = self.selection.select("file");
13186 query = query.arg("name", name.into());
13187 query = query.arg("contents", contents.into());
13188 File {
13189 proc: self.proc.clone(),
13190 selection: query,
13191 graphql_client: self.graphql_client.clone(),
13192 }
13193 }
13194 pub fn file_opts(
13202 &self,
13203 name: impl Into<String>,
13204 contents: impl Into<String>,
13205 opts: QueryFileOpts,
13206 ) -> File {
13207 let mut query = self.selection.select("file");
13208 query = query.arg("name", name.into());
13209 query = query.arg("contents", contents.into());
13210 if let Some(permissions) = opts.permissions {
13211 query = query.arg("permissions", permissions);
13212 }
13213 File {
13214 proc: self.proc.clone(),
13215 selection: query,
13216 graphql_client: self.graphql_client.clone(),
13217 }
13218 }
13219 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13226 let mut query = self.selection.select("function");
13227 query = query.arg("name", name.into());
13228 query = query.arg_lazy(
13229 "returnType",
13230 Box::new(move || {
13231 let return_type = return_type.clone();
13232 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13233 }),
13234 );
13235 Function {
13236 proc: self.proc.clone(),
13237 selection: query,
13238 graphql_client: self.graphql_client.clone(),
13239 }
13240 }
13241 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13243 let mut query = self.selection.select("generatedCode");
13244 query = query.arg_lazy(
13245 "code",
13246 Box::new(move || {
13247 let code = code.clone();
13248 Box::pin(async move { code.into_id().await.unwrap().quote() })
13249 }),
13250 );
13251 GeneratedCode {
13252 proc: self.proc.clone(),
13253 selection: query,
13254 graphql_client: self.graphql_client.clone(),
13255 }
13256 }
13257 pub fn git(&self, url: impl Into<String>) -> GitRepository {
13268 let mut query = self.selection.select("git");
13269 query = query.arg("url", url.into());
13270 GitRepository {
13271 proc: self.proc.clone(),
13272 selection: query,
13273 graphql_client: self.graphql_client.clone(),
13274 }
13275 }
13276 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13287 let mut query = self.selection.select("git");
13288 query = query.arg("url", url.into());
13289 if let Some(keep_git_dir) = opts.keep_git_dir {
13290 query = query.arg("keepGitDir", keep_git_dir);
13291 }
13292 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13293 query = query.arg("sshKnownHosts", ssh_known_hosts);
13294 }
13295 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13296 query = query.arg("sshAuthSocket", ssh_auth_socket);
13297 }
13298 if let Some(http_auth_username) = opts.http_auth_username {
13299 query = query.arg("httpAuthUsername", http_auth_username);
13300 }
13301 if let Some(http_auth_token) = opts.http_auth_token {
13302 query = query.arg("httpAuthToken", http_auth_token);
13303 }
13304 if let Some(http_auth_header) = opts.http_auth_header {
13305 query = query.arg("httpAuthHeader", http_auth_header);
13306 }
13307 if let Some(experimental_service_host) = opts.experimental_service_host {
13308 query = query.arg("experimentalServiceHost", experimental_service_host);
13309 }
13310 GitRepository {
13311 proc: self.proc.clone(),
13312 selection: query,
13313 graphql_client: self.graphql_client.clone(),
13314 }
13315 }
13316 pub fn host(&self) -> Host {
13318 let query = self.selection.select("host");
13319 Host {
13320 proc: self.proc.clone(),
13321 selection: query,
13322 graphql_client: self.graphql_client.clone(),
13323 }
13324 }
13325 pub fn http(&self, url: impl Into<String>) -> File {
13332 let mut query = self.selection.select("http");
13333 query = query.arg("url", url.into());
13334 File {
13335 proc: self.proc.clone(),
13336 selection: query,
13337 graphql_client: self.graphql_client.clone(),
13338 }
13339 }
13340 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13347 let mut query = self.selection.select("http");
13348 query = query.arg("url", url.into());
13349 if let Some(name) = opts.name {
13350 query = query.arg("name", name);
13351 }
13352 if let Some(permissions) = opts.permissions {
13353 query = query.arg("permissions", permissions);
13354 }
13355 if let Some(checksum) = opts.checksum {
13356 query = query.arg("checksum", checksum);
13357 }
13358 if let Some(auth_header) = opts.auth_header {
13359 query = query.arg("authHeader", auth_header);
13360 }
13361 if let Some(experimental_service_host) = opts.experimental_service_host {
13362 query = query.arg("experimentalServiceHost", experimental_service_host);
13363 }
13364 File {
13365 proc: self.proc.clone(),
13366 selection: query,
13367 graphql_client: self.graphql_client.clone(),
13368 }
13369 }
13370 pub async fn id(&self) -> Result<Id, DaggerError> {
13372 let query = self.selection.select("id");
13373 query.execute(self.graphql_client.clone()).await
13374 }
13375 pub fn json(&self) -> JsonValue {
13377 let query = self.selection.select("json");
13378 JsonValue {
13379 proc: self.proc.clone(),
13380 selection: query,
13381 graphql_client: self.graphql_client.clone(),
13382 }
13383 }
13384 pub fn llm(&self) -> Llm {
13390 let query = self.selection.select("llm");
13391 Llm {
13392 proc: self.proc.clone(),
13393 selection: query,
13394 graphql_client: self.graphql_client.clone(),
13395 }
13396 }
13397 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13403 let mut query = self.selection.select("llm");
13404 if let Some(model) = opts.model {
13405 query = query.arg("model", model);
13406 }
13407 if let Some(max_api_calls) = opts.max_api_calls {
13408 query = query.arg("maxAPICalls", max_api_calls);
13409 }
13410 Llm {
13411 proc: self.proc.clone(),
13412 selection: query,
13413 graphql_client: self.graphql_client.clone(),
13414 }
13415 }
13416 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13418 let mut query = self.selection.select("loadAddressFromID");
13419 query = query.arg_lazy(
13420 "id",
13421 Box::new(move || {
13422 let id = id.clone();
13423 Box::pin(async move { id.into_id().await.unwrap().quote() })
13424 }),
13425 );
13426 Address {
13427 proc: self.proc.clone(),
13428 selection: query,
13429 graphql_client: self.graphql_client.clone(),
13430 }
13431 }
13432 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13434 let mut query = self.selection.select("loadBindingFromID");
13435 query = query.arg_lazy(
13436 "id",
13437 Box::new(move || {
13438 let id = id.clone();
13439 Box::pin(async move { id.into_id().await.unwrap().quote() })
13440 }),
13441 );
13442 Binding {
13443 proc: self.proc.clone(),
13444 selection: query,
13445 graphql_client: self.graphql_client.clone(),
13446 }
13447 }
13448 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13450 let mut query = self.selection.select("loadCacheVolumeFromID");
13451 query = query.arg_lazy(
13452 "id",
13453 Box::new(move || {
13454 let id = id.clone();
13455 Box::pin(async move { id.into_id().await.unwrap().quote() })
13456 }),
13457 );
13458 CacheVolume {
13459 proc: self.proc.clone(),
13460 selection: query,
13461 graphql_client: self.graphql_client.clone(),
13462 }
13463 }
13464 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13466 let mut query = self.selection.select("loadChangesetFromID");
13467 query = query.arg_lazy(
13468 "id",
13469 Box::new(move || {
13470 let id = id.clone();
13471 Box::pin(async move { id.into_id().await.unwrap().quote() })
13472 }),
13473 );
13474 Changeset {
13475 proc: self.proc.clone(),
13476 selection: query,
13477 graphql_client: self.graphql_client.clone(),
13478 }
13479 }
13480 pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13482 let mut query = self.selection.select("loadCheckFromID");
13483 query = query.arg_lazy(
13484 "id",
13485 Box::new(move || {
13486 let id = id.clone();
13487 Box::pin(async move { id.into_id().await.unwrap().quote() })
13488 }),
13489 );
13490 Check {
13491 proc: self.proc.clone(),
13492 selection: query,
13493 graphql_client: self.graphql_client.clone(),
13494 }
13495 }
13496 pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13498 let mut query = self.selection.select("loadCheckGroupFromID");
13499 query = query.arg_lazy(
13500 "id",
13501 Box::new(move || {
13502 let id = id.clone();
13503 Box::pin(async move { id.into_id().await.unwrap().quote() })
13504 }),
13505 );
13506 CheckGroup {
13507 proc: self.proc.clone(),
13508 selection: query,
13509 graphql_client: self.graphql_client.clone(),
13510 }
13511 }
13512 pub fn load_client_filesync_mirror_from_id(
13514 &self,
13515 id: impl IntoID<ClientFilesyncMirrorId>,
13516 ) -> ClientFilesyncMirror {
13517 let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13518 query = query.arg_lazy(
13519 "id",
13520 Box::new(move || {
13521 let id = id.clone();
13522 Box::pin(async move { id.into_id().await.unwrap().quote() })
13523 }),
13524 );
13525 ClientFilesyncMirror {
13526 proc: self.proc.clone(),
13527 selection: query,
13528 graphql_client: self.graphql_client.clone(),
13529 }
13530 }
13531 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13533 let mut query = self.selection.select("loadCloudFromID");
13534 query = query.arg_lazy(
13535 "id",
13536 Box::new(move || {
13537 let id = id.clone();
13538 Box::pin(async move { id.into_id().await.unwrap().quote() })
13539 }),
13540 );
13541 Cloud {
13542 proc: self.proc.clone(),
13543 selection: query,
13544 graphql_client: self.graphql_client.clone(),
13545 }
13546 }
13547 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13549 let mut query = self.selection.select("loadContainerFromID");
13550 query = query.arg_lazy(
13551 "id",
13552 Box::new(move || {
13553 let id = id.clone();
13554 Box::pin(async move { id.into_id().await.unwrap().quote() })
13555 }),
13556 );
13557 Container {
13558 proc: self.proc.clone(),
13559 selection: query,
13560 graphql_client: self.graphql_client.clone(),
13561 }
13562 }
13563 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13565 let mut query = self.selection.select("loadCurrentModuleFromID");
13566 query = query.arg_lazy(
13567 "id",
13568 Box::new(move || {
13569 let id = id.clone();
13570 Box::pin(async move { id.into_id().await.unwrap().quote() })
13571 }),
13572 );
13573 CurrentModule {
13574 proc: self.proc.clone(),
13575 selection: query,
13576 graphql_client: self.graphql_client.clone(),
13577 }
13578 }
13579 pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13581 let mut query = self.selection.select("loadDiffStatFromID");
13582 query = query.arg_lazy(
13583 "id",
13584 Box::new(move || {
13585 let id = id.clone();
13586 Box::pin(async move { id.into_id().await.unwrap().quote() })
13587 }),
13588 );
13589 DiffStat {
13590 proc: self.proc.clone(),
13591 selection: query,
13592 graphql_client: self.graphql_client.clone(),
13593 }
13594 }
13595 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13597 let mut query = self.selection.select("loadDirectoryFromID");
13598 query = query.arg_lazy(
13599 "id",
13600 Box::new(move || {
13601 let id = id.clone();
13602 Box::pin(async move { id.into_id().await.unwrap().quote() })
13603 }),
13604 );
13605 Directory {
13606 proc: self.proc.clone(),
13607 selection: query,
13608 graphql_client: self.graphql_client.clone(),
13609 }
13610 }
13611 pub fn load_engine_cache_entry_from_id(
13613 &self,
13614 id: impl IntoID<EngineCacheEntryId>,
13615 ) -> EngineCacheEntry {
13616 let mut query = self.selection.select("loadEngineCacheEntryFromID");
13617 query = query.arg_lazy(
13618 "id",
13619 Box::new(move || {
13620 let id = id.clone();
13621 Box::pin(async move { id.into_id().await.unwrap().quote() })
13622 }),
13623 );
13624 EngineCacheEntry {
13625 proc: self.proc.clone(),
13626 selection: query,
13627 graphql_client: self.graphql_client.clone(),
13628 }
13629 }
13630 pub fn load_engine_cache_entry_set_from_id(
13632 &self,
13633 id: impl IntoID<EngineCacheEntrySetId>,
13634 ) -> EngineCacheEntrySet {
13635 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13636 query = query.arg_lazy(
13637 "id",
13638 Box::new(move || {
13639 let id = id.clone();
13640 Box::pin(async move { id.into_id().await.unwrap().quote() })
13641 }),
13642 );
13643 EngineCacheEntrySet {
13644 proc: self.proc.clone(),
13645 selection: query,
13646 graphql_client: self.graphql_client.clone(),
13647 }
13648 }
13649 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13651 let mut query = self.selection.select("loadEngineCacheFromID");
13652 query = query.arg_lazy(
13653 "id",
13654 Box::new(move || {
13655 let id = id.clone();
13656 Box::pin(async move { id.into_id().await.unwrap().quote() })
13657 }),
13658 );
13659 EngineCache {
13660 proc: self.proc.clone(),
13661 selection: query,
13662 graphql_client: self.graphql_client.clone(),
13663 }
13664 }
13665 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13667 let mut query = self.selection.select("loadEngineFromID");
13668 query = query.arg_lazy(
13669 "id",
13670 Box::new(move || {
13671 let id = id.clone();
13672 Box::pin(async move { id.into_id().await.unwrap().quote() })
13673 }),
13674 );
13675 Engine {
13676 proc: self.proc.clone(),
13677 selection: query,
13678 graphql_client: self.graphql_client.clone(),
13679 }
13680 }
13681 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13683 let mut query = self.selection.select("loadEnumTypeDefFromID");
13684 query = query.arg_lazy(
13685 "id",
13686 Box::new(move || {
13687 let id = id.clone();
13688 Box::pin(async move { id.into_id().await.unwrap().quote() })
13689 }),
13690 );
13691 EnumTypeDef {
13692 proc: self.proc.clone(),
13693 selection: query,
13694 graphql_client: self.graphql_client.clone(),
13695 }
13696 }
13697 pub fn load_enum_value_type_def_from_id(
13699 &self,
13700 id: impl IntoID<EnumValueTypeDefId>,
13701 ) -> EnumValueTypeDef {
13702 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13703 query = query.arg_lazy(
13704 "id",
13705 Box::new(move || {
13706 let id = id.clone();
13707 Box::pin(async move { id.into_id().await.unwrap().quote() })
13708 }),
13709 );
13710 EnumValueTypeDef {
13711 proc: self.proc.clone(),
13712 selection: query,
13713 graphql_client: self.graphql_client.clone(),
13714 }
13715 }
13716 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13718 let mut query = self.selection.select("loadEnvFileFromID");
13719 query = query.arg_lazy(
13720 "id",
13721 Box::new(move || {
13722 let id = id.clone();
13723 Box::pin(async move { id.into_id().await.unwrap().quote() })
13724 }),
13725 );
13726 EnvFile {
13727 proc: self.proc.clone(),
13728 selection: query,
13729 graphql_client: self.graphql_client.clone(),
13730 }
13731 }
13732 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13734 let mut query = self.selection.select("loadEnvFromID");
13735 query = query.arg_lazy(
13736 "id",
13737 Box::new(move || {
13738 let id = id.clone();
13739 Box::pin(async move { id.into_id().await.unwrap().quote() })
13740 }),
13741 );
13742 Env {
13743 proc: self.proc.clone(),
13744 selection: query,
13745 graphql_client: self.graphql_client.clone(),
13746 }
13747 }
13748 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13750 let mut query = self.selection.select("loadEnvVariableFromID");
13751 query = query.arg_lazy(
13752 "id",
13753 Box::new(move || {
13754 let id = id.clone();
13755 Box::pin(async move { id.into_id().await.unwrap().quote() })
13756 }),
13757 );
13758 EnvVariable {
13759 proc: self.proc.clone(),
13760 selection: query,
13761 graphql_client: self.graphql_client.clone(),
13762 }
13763 }
13764 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13766 let mut query = self.selection.select("loadErrorFromID");
13767 query = query.arg_lazy(
13768 "id",
13769 Box::new(move || {
13770 let id = id.clone();
13771 Box::pin(async move { id.into_id().await.unwrap().quote() })
13772 }),
13773 );
13774 Error {
13775 proc: self.proc.clone(),
13776 selection: query,
13777 graphql_client: self.graphql_client.clone(),
13778 }
13779 }
13780 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13782 let mut query = self.selection.select("loadErrorValueFromID");
13783 query = query.arg_lazy(
13784 "id",
13785 Box::new(move || {
13786 let id = id.clone();
13787 Box::pin(async move { id.into_id().await.unwrap().quote() })
13788 }),
13789 );
13790 ErrorValue {
13791 proc: self.proc.clone(),
13792 selection: query,
13793 graphql_client: self.graphql_client.clone(),
13794 }
13795 }
13796 pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13798 let mut query = self.selection.select("loadExportableFromID");
13799 query = query.arg_lazy(
13800 "id",
13801 Box::new(move || {
13802 let id = id.clone();
13803 Box::pin(async move { id.into_id().await.unwrap().quote() })
13804 }),
13805 );
13806 ExportableClient {
13807 proc: self.proc.clone(),
13808 selection: query,
13809 graphql_client: self.graphql_client.clone(),
13810 }
13811 }
13812 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13814 let mut query = self.selection.select("loadFieldTypeDefFromID");
13815 query = query.arg_lazy(
13816 "id",
13817 Box::new(move || {
13818 let id = id.clone();
13819 Box::pin(async move { id.into_id().await.unwrap().quote() })
13820 }),
13821 );
13822 FieldTypeDef {
13823 proc: self.proc.clone(),
13824 selection: query,
13825 graphql_client: self.graphql_client.clone(),
13826 }
13827 }
13828 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13830 let mut query = self.selection.select("loadFileFromID");
13831 query = query.arg_lazy(
13832 "id",
13833 Box::new(move || {
13834 let id = id.clone();
13835 Box::pin(async move { id.into_id().await.unwrap().quote() })
13836 }),
13837 );
13838 File {
13839 proc: self.proc.clone(),
13840 selection: query,
13841 graphql_client: self.graphql_client.clone(),
13842 }
13843 }
13844 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13846 let mut query = self.selection.select("loadFunctionArgFromID");
13847 query = query.arg_lazy(
13848 "id",
13849 Box::new(move || {
13850 let id = id.clone();
13851 Box::pin(async move { id.into_id().await.unwrap().quote() })
13852 }),
13853 );
13854 FunctionArg {
13855 proc: self.proc.clone(),
13856 selection: query,
13857 graphql_client: self.graphql_client.clone(),
13858 }
13859 }
13860 pub fn load_function_call_arg_value_from_id(
13862 &self,
13863 id: impl IntoID<FunctionCallArgValueId>,
13864 ) -> FunctionCallArgValue {
13865 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13866 query = query.arg_lazy(
13867 "id",
13868 Box::new(move || {
13869 let id = id.clone();
13870 Box::pin(async move { id.into_id().await.unwrap().quote() })
13871 }),
13872 );
13873 FunctionCallArgValue {
13874 proc: self.proc.clone(),
13875 selection: query,
13876 graphql_client: self.graphql_client.clone(),
13877 }
13878 }
13879 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13881 let mut query = self.selection.select("loadFunctionCallFromID");
13882 query = query.arg_lazy(
13883 "id",
13884 Box::new(move || {
13885 let id = id.clone();
13886 Box::pin(async move { id.into_id().await.unwrap().quote() })
13887 }),
13888 );
13889 FunctionCall {
13890 proc: self.proc.clone(),
13891 selection: query,
13892 graphql_client: self.graphql_client.clone(),
13893 }
13894 }
13895 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13897 let mut query = self.selection.select("loadFunctionFromID");
13898 query = query.arg_lazy(
13899 "id",
13900 Box::new(move || {
13901 let id = id.clone();
13902 Box::pin(async move { id.into_id().await.unwrap().quote() })
13903 }),
13904 );
13905 Function {
13906 proc: self.proc.clone(),
13907 selection: query,
13908 graphql_client: self.graphql_client.clone(),
13909 }
13910 }
13911 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13913 let mut query = self.selection.select("loadGeneratedCodeFromID");
13914 query = query.arg_lazy(
13915 "id",
13916 Box::new(move || {
13917 let id = id.clone();
13918 Box::pin(async move { id.into_id().await.unwrap().quote() })
13919 }),
13920 );
13921 GeneratedCode {
13922 proc: self.proc.clone(),
13923 selection: query,
13924 graphql_client: self.graphql_client.clone(),
13925 }
13926 }
13927 pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13929 let mut query = self.selection.select("loadGeneratorFromID");
13930 query = query.arg_lazy(
13931 "id",
13932 Box::new(move || {
13933 let id = id.clone();
13934 Box::pin(async move { id.into_id().await.unwrap().quote() })
13935 }),
13936 );
13937 Generator {
13938 proc: self.proc.clone(),
13939 selection: query,
13940 graphql_client: self.graphql_client.clone(),
13941 }
13942 }
13943 pub fn load_generator_group_from_id(
13945 &self,
13946 id: impl IntoID<GeneratorGroupId>,
13947 ) -> GeneratorGroup {
13948 let mut query = self.selection.select("loadGeneratorGroupFromID");
13949 query = query.arg_lazy(
13950 "id",
13951 Box::new(move || {
13952 let id = id.clone();
13953 Box::pin(async move { id.into_id().await.unwrap().quote() })
13954 }),
13955 );
13956 GeneratorGroup {
13957 proc: self.proc.clone(),
13958 selection: query,
13959 graphql_client: self.graphql_client.clone(),
13960 }
13961 }
13962 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13964 let mut query = self.selection.select("loadGitRefFromID");
13965 query = query.arg_lazy(
13966 "id",
13967 Box::new(move || {
13968 let id = id.clone();
13969 Box::pin(async move { id.into_id().await.unwrap().quote() })
13970 }),
13971 );
13972 GitRef {
13973 proc: self.proc.clone(),
13974 selection: query,
13975 graphql_client: self.graphql_client.clone(),
13976 }
13977 }
13978 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13980 let mut query = self.selection.select("loadGitRepositoryFromID");
13981 query = query.arg_lazy(
13982 "id",
13983 Box::new(move || {
13984 let id = id.clone();
13985 Box::pin(async move { id.into_id().await.unwrap().quote() })
13986 }),
13987 );
13988 GitRepository {
13989 proc: self.proc.clone(),
13990 selection: query,
13991 graphql_client: self.graphql_client.clone(),
13992 }
13993 }
13994 pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
13996 let mut query = self.selection.select("loadHTTPStateFromID");
13997 query = query.arg_lazy(
13998 "id",
13999 Box::new(move || {
14000 let id = id.clone();
14001 Box::pin(async move { id.into_id().await.unwrap().quote() })
14002 }),
14003 );
14004 HttpState {
14005 proc: self.proc.clone(),
14006 selection: query,
14007 graphql_client: self.graphql_client.clone(),
14008 }
14009 }
14010 pub fn load_healthcheck_config_from_id(
14012 &self,
14013 id: impl IntoID<HealthcheckConfigId>,
14014 ) -> HealthcheckConfig {
14015 let mut query = self.selection.select("loadHealthcheckConfigFromID");
14016 query = query.arg_lazy(
14017 "id",
14018 Box::new(move || {
14019 let id = id.clone();
14020 Box::pin(async move { id.into_id().await.unwrap().quote() })
14021 }),
14022 );
14023 HealthcheckConfig {
14024 proc: self.proc.clone(),
14025 selection: query,
14026 graphql_client: self.graphql_client.clone(),
14027 }
14028 }
14029 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
14031 let mut query = self.selection.select("loadHostFromID");
14032 query = query.arg_lazy(
14033 "id",
14034 Box::new(move || {
14035 let id = id.clone();
14036 Box::pin(async move { id.into_id().await.unwrap().quote() })
14037 }),
14038 );
14039 Host {
14040 proc: self.proc.clone(),
14041 selection: query,
14042 graphql_client: self.graphql_client.clone(),
14043 }
14044 }
14045 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14047 let mut query = self.selection.select("loadInputTypeDefFromID");
14048 query = query.arg_lazy(
14049 "id",
14050 Box::new(move || {
14051 let id = id.clone();
14052 Box::pin(async move { id.into_id().await.unwrap().quote() })
14053 }),
14054 );
14055 InputTypeDef {
14056 proc: self.proc.clone(),
14057 selection: query,
14058 graphql_client: self.graphql_client.clone(),
14059 }
14060 }
14061 pub fn load_interface_type_def_from_id(
14063 &self,
14064 id: impl IntoID<InterfaceTypeDefId>,
14065 ) -> InterfaceTypeDef {
14066 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14067 query = query.arg_lazy(
14068 "id",
14069 Box::new(move || {
14070 let id = id.clone();
14071 Box::pin(async move { id.into_id().await.unwrap().quote() })
14072 }),
14073 );
14074 InterfaceTypeDef {
14075 proc: self.proc.clone(),
14076 selection: query,
14077 graphql_client: self.graphql_client.clone(),
14078 }
14079 }
14080 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14082 let mut query = self.selection.select("loadJSONValueFromID");
14083 query = query.arg_lazy(
14084 "id",
14085 Box::new(move || {
14086 let id = id.clone();
14087 Box::pin(async move { id.into_id().await.unwrap().quote() })
14088 }),
14089 );
14090 JsonValue {
14091 proc: self.proc.clone(),
14092 selection: query,
14093 graphql_client: self.graphql_client.clone(),
14094 }
14095 }
14096 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14098 let mut query = self.selection.select("loadLLMFromID");
14099 query = query.arg_lazy(
14100 "id",
14101 Box::new(move || {
14102 let id = id.clone();
14103 Box::pin(async move { id.into_id().await.unwrap().quote() })
14104 }),
14105 );
14106 Llm {
14107 proc: self.proc.clone(),
14108 selection: query,
14109 graphql_client: self.graphql_client.clone(),
14110 }
14111 }
14112 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14114 let mut query = self.selection.select("loadLLMTokenUsageFromID");
14115 query = query.arg_lazy(
14116 "id",
14117 Box::new(move || {
14118 let id = id.clone();
14119 Box::pin(async move { id.into_id().await.unwrap().quote() })
14120 }),
14121 );
14122 LlmTokenUsage {
14123 proc: self.proc.clone(),
14124 selection: query,
14125 graphql_client: self.graphql_client.clone(),
14126 }
14127 }
14128 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14130 let mut query = self.selection.select("loadLabelFromID");
14131 query = query.arg_lazy(
14132 "id",
14133 Box::new(move || {
14134 let id = id.clone();
14135 Box::pin(async move { id.into_id().await.unwrap().quote() })
14136 }),
14137 );
14138 Label {
14139 proc: self.proc.clone(),
14140 selection: query,
14141 graphql_client: self.graphql_client.clone(),
14142 }
14143 }
14144 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14146 let mut query = self.selection.select("loadListTypeDefFromID");
14147 query = query.arg_lazy(
14148 "id",
14149 Box::new(move || {
14150 let id = id.clone();
14151 Box::pin(async move { id.into_id().await.unwrap().quote() })
14152 }),
14153 );
14154 ListTypeDef {
14155 proc: self.proc.clone(),
14156 selection: query,
14157 graphql_client: self.graphql_client.clone(),
14158 }
14159 }
14160 pub fn load_module_config_client_from_id(
14162 &self,
14163 id: impl IntoID<ModuleConfigClientId>,
14164 ) -> ModuleConfigClient {
14165 let mut query = self.selection.select("loadModuleConfigClientFromID");
14166 query = query.arg_lazy(
14167 "id",
14168 Box::new(move || {
14169 let id = id.clone();
14170 Box::pin(async move { id.into_id().await.unwrap().quote() })
14171 }),
14172 );
14173 ModuleConfigClient {
14174 proc: self.proc.clone(),
14175 selection: query,
14176 graphql_client: self.graphql_client.clone(),
14177 }
14178 }
14179 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14181 let mut query = self.selection.select("loadModuleFromID");
14182 query = query.arg_lazy(
14183 "id",
14184 Box::new(move || {
14185 let id = id.clone();
14186 Box::pin(async move { id.into_id().await.unwrap().quote() })
14187 }),
14188 );
14189 Module {
14190 proc: self.proc.clone(),
14191 selection: query,
14192 graphql_client: self.graphql_client.clone(),
14193 }
14194 }
14195 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14197 let mut query = self.selection.select("loadModuleSourceFromID");
14198 query = query.arg_lazy(
14199 "id",
14200 Box::new(move || {
14201 let id = id.clone();
14202 Box::pin(async move { id.into_id().await.unwrap().quote() })
14203 }),
14204 );
14205 ModuleSource {
14206 proc: self.proc.clone(),
14207 selection: query,
14208 graphql_client: self.graphql_client.clone(),
14209 }
14210 }
14211 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14213 let mut query = self.selection.select("loadObjectTypeDefFromID");
14214 query = query.arg_lazy(
14215 "id",
14216 Box::new(move || {
14217 let id = id.clone();
14218 Box::pin(async move { id.into_id().await.unwrap().quote() })
14219 }),
14220 );
14221 ObjectTypeDef {
14222 proc: self.proc.clone(),
14223 selection: query,
14224 graphql_client: self.graphql_client.clone(),
14225 }
14226 }
14227 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14229 let mut query = self.selection.select("loadPortFromID");
14230 query = query.arg_lazy(
14231 "id",
14232 Box::new(move || {
14233 let id = id.clone();
14234 Box::pin(async move { id.into_id().await.unwrap().quote() })
14235 }),
14236 );
14237 Port {
14238 proc: self.proc.clone(),
14239 selection: query,
14240 graphql_client: self.graphql_client.clone(),
14241 }
14242 }
14243 pub fn load_remote_git_mirror_from_id(
14245 &self,
14246 id: impl IntoID<RemoteGitMirrorId>,
14247 ) -> RemoteGitMirror {
14248 let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14249 query = query.arg_lazy(
14250 "id",
14251 Box::new(move || {
14252 let id = id.clone();
14253 Box::pin(async move { id.into_id().await.unwrap().quote() })
14254 }),
14255 );
14256 RemoteGitMirror {
14257 proc: self.proc.clone(),
14258 selection: query,
14259 graphql_client: self.graphql_client.clone(),
14260 }
14261 }
14262 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14264 let mut query = self.selection.select("loadSDKConfigFromID");
14265 query = query.arg_lazy(
14266 "id",
14267 Box::new(move || {
14268 let id = id.clone();
14269 Box::pin(async move { id.into_id().await.unwrap().quote() })
14270 }),
14271 );
14272 SdkConfig {
14273 proc: self.proc.clone(),
14274 selection: query,
14275 graphql_client: self.graphql_client.clone(),
14276 }
14277 }
14278 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14280 let mut query = self.selection.select("loadScalarTypeDefFromID");
14281 query = query.arg_lazy(
14282 "id",
14283 Box::new(move || {
14284 let id = id.clone();
14285 Box::pin(async move { id.into_id().await.unwrap().quote() })
14286 }),
14287 );
14288 ScalarTypeDef {
14289 proc: self.proc.clone(),
14290 selection: query,
14291 graphql_client: self.graphql_client.clone(),
14292 }
14293 }
14294 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14296 let mut query = self.selection.select("loadSearchResultFromID");
14297 query = query.arg_lazy(
14298 "id",
14299 Box::new(move || {
14300 let id = id.clone();
14301 Box::pin(async move { id.into_id().await.unwrap().quote() })
14302 }),
14303 );
14304 SearchResult {
14305 proc: self.proc.clone(),
14306 selection: query,
14307 graphql_client: self.graphql_client.clone(),
14308 }
14309 }
14310 pub fn load_search_submatch_from_id(
14312 &self,
14313 id: impl IntoID<SearchSubmatchId>,
14314 ) -> SearchSubmatch {
14315 let mut query = self.selection.select("loadSearchSubmatchFromID");
14316 query = query.arg_lazy(
14317 "id",
14318 Box::new(move || {
14319 let id = id.clone();
14320 Box::pin(async move { id.into_id().await.unwrap().quote() })
14321 }),
14322 );
14323 SearchSubmatch {
14324 proc: self.proc.clone(),
14325 selection: query,
14326 graphql_client: self.graphql_client.clone(),
14327 }
14328 }
14329 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14331 let mut query = self.selection.select("loadSecretFromID");
14332 query = query.arg_lazy(
14333 "id",
14334 Box::new(move || {
14335 let id = id.clone();
14336 Box::pin(async move { id.into_id().await.unwrap().quote() })
14337 }),
14338 );
14339 Secret {
14340 proc: self.proc.clone(),
14341 selection: query,
14342 graphql_client: self.graphql_client.clone(),
14343 }
14344 }
14345 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14347 let mut query = self.selection.select("loadServiceFromID");
14348 query = query.arg_lazy(
14349 "id",
14350 Box::new(move || {
14351 let id = id.clone();
14352 Box::pin(async move { id.into_id().await.unwrap().quote() })
14353 }),
14354 );
14355 Service {
14356 proc: self.proc.clone(),
14357 selection: query,
14358 graphql_client: self.graphql_client.clone(),
14359 }
14360 }
14361 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14363 let mut query = self.selection.select("loadSocketFromID");
14364 query = query.arg_lazy(
14365 "id",
14366 Box::new(move || {
14367 let id = id.clone();
14368 Box::pin(async move { id.into_id().await.unwrap().quote() })
14369 }),
14370 );
14371 Socket {
14372 proc: self.proc.clone(),
14373 selection: query,
14374 graphql_client: self.graphql_client.clone(),
14375 }
14376 }
14377 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14379 let mut query = self.selection.select("loadSourceMapFromID");
14380 query = query.arg_lazy(
14381 "id",
14382 Box::new(move || {
14383 let id = id.clone();
14384 Box::pin(async move { id.into_id().await.unwrap().quote() })
14385 }),
14386 );
14387 SourceMap {
14388 proc: self.proc.clone(),
14389 selection: query,
14390 graphql_client: self.graphql_client.clone(),
14391 }
14392 }
14393 pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14395 let mut query = self.selection.select("loadStatFromID");
14396 query = query.arg_lazy(
14397 "id",
14398 Box::new(move || {
14399 let id = id.clone();
14400 Box::pin(async move { id.into_id().await.unwrap().quote() })
14401 }),
14402 );
14403 Stat {
14404 proc: self.proc.clone(),
14405 selection: query,
14406 graphql_client: self.graphql_client.clone(),
14407 }
14408 }
14409 pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14411 let mut query = self.selection.select("loadSyncerFromID");
14412 query = query.arg_lazy(
14413 "id",
14414 Box::new(move || {
14415 let id = id.clone();
14416 Box::pin(async move { id.into_id().await.unwrap().quote() })
14417 }),
14418 );
14419 SyncerClient {
14420 proc: self.proc.clone(),
14421 selection: query,
14422 graphql_client: self.graphql_client.clone(),
14423 }
14424 }
14425 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14427 let mut query = self.selection.select("loadTerminalFromID");
14428 query = query.arg_lazy(
14429 "id",
14430 Box::new(move || {
14431 let id = id.clone();
14432 Box::pin(async move { id.into_id().await.unwrap().quote() })
14433 }),
14434 );
14435 Terminal {
14436 proc: self.proc.clone(),
14437 selection: query,
14438 graphql_client: self.graphql_client.clone(),
14439 }
14440 }
14441 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14443 let mut query = self.selection.select("loadTypeDefFromID");
14444 query = query.arg_lazy(
14445 "id",
14446 Box::new(move || {
14447 let id = id.clone();
14448 Box::pin(async move { id.into_id().await.unwrap().quote() })
14449 }),
14450 );
14451 TypeDef {
14452 proc: self.proc.clone(),
14453 selection: query,
14454 graphql_client: self.graphql_client.clone(),
14455 }
14456 }
14457 pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14459 let mut query = self.selection.select("loadUpFromID");
14460 query = query.arg_lazy(
14461 "id",
14462 Box::new(move || {
14463 let id = id.clone();
14464 Box::pin(async move { id.into_id().await.unwrap().quote() })
14465 }),
14466 );
14467 Up {
14468 proc: self.proc.clone(),
14469 selection: query,
14470 graphql_client: self.graphql_client.clone(),
14471 }
14472 }
14473 pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14475 let mut query = self.selection.select("loadUpGroupFromID");
14476 query = query.arg_lazy(
14477 "id",
14478 Box::new(move || {
14479 let id = id.clone();
14480 Box::pin(async move { id.into_id().await.unwrap().quote() })
14481 }),
14482 );
14483 UpGroup {
14484 proc: self.proc.clone(),
14485 selection: query,
14486 graphql_client: self.graphql_client.clone(),
14487 }
14488 }
14489 pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14491 let mut query = self.selection.select("loadWorkspaceFromID");
14492 query = query.arg_lazy(
14493 "id",
14494 Box::new(move || {
14495 let id = id.clone();
14496 Box::pin(async move { id.into_id().await.unwrap().quote() })
14497 }),
14498 );
14499 Workspace {
14500 proc: self.proc.clone(),
14501 selection: query,
14502 graphql_client: self.graphql_client.clone(),
14503 }
14504 }
14505 pub fn module(&self) -> Module {
14507 let query = self.selection.select("module");
14508 Module {
14509 proc: self.proc.clone(),
14510 selection: query,
14511 graphql_client: self.graphql_client.clone(),
14512 }
14513 }
14514 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14521 let mut query = self.selection.select("moduleSource");
14522 query = query.arg("refString", ref_string.into());
14523 ModuleSource {
14524 proc: self.proc.clone(),
14525 selection: query,
14526 graphql_client: self.graphql_client.clone(),
14527 }
14528 }
14529 pub fn module_source_opts<'a>(
14536 &self,
14537 ref_string: impl Into<String>,
14538 opts: QueryModuleSourceOpts<'a>,
14539 ) -> ModuleSource {
14540 let mut query = self.selection.select("moduleSource");
14541 query = query.arg("refString", ref_string.into());
14542 if let Some(ref_pin) = opts.ref_pin {
14543 query = query.arg("refPin", ref_pin);
14544 }
14545 if let Some(disable_find_up) = opts.disable_find_up {
14546 query = query.arg("disableFindUp", disable_find_up);
14547 }
14548 if let Some(allow_not_exists) = opts.allow_not_exists {
14549 query = query.arg("allowNotExists", allow_not_exists);
14550 }
14551 if let Some(require_kind) = opts.require_kind {
14552 query = query.arg("requireKind", require_kind);
14553 }
14554 ModuleSource {
14555 proc: self.proc.clone(),
14556 selection: query,
14557 graphql_client: self.graphql_client.clone(),
14558 }
14559 }
14560 pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14562 let mut query = self.selection.select("node");
14563 query = query.arg_lazy(
14564 "id",
14565 Box::new(move || {
14566 let id = id.clone();
14567 Box::pin(async move { id.into_id().await.unwrap().quote() })
14568 }),
14569 );
14570 NodeClient {
14571 proc: self.proc.clone(),
14572 selection: query,
14573 graphql_client: self.graphql_client.clone(),
14574 }
14575 }
14576 pub fn secret(&self, uri: impl Into<String>) -> Secret {
14583 let mut query = self.selection.select("secret");
14584 query = query.arg("uri", uri.into());
14585 Secret {
14586 proc: self.proc.clone(),
14587 selection: query,
14588 graphql_client: self.graphql_client.clone(),
14589 }
14590 }
14591 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14598 let mut query = self.selection.select("secret");
14599 query = query.arg("uri", uri.into());
14600 if let Some(cache_key) = opts.cache_key {
14601 query = query.arg("cacheKey", cache_key);
14602 }
14603 Secret {
14604 proc: self.proc.clone(),
14605 selection: query,
14606 graphql_client: self.graphql_client.clone(),
14607 }
14608 }
14609 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14617 let mut query = self.selection.select("setSecret");
14618 query = query.arg("name", name.into());
14619 query = query.arg("plaintext", plaintext.into());
14620 Secret {
14621 proc: self.proc.clone(),
14622 selection: query,
14623 graphql_client: self.graphql_client.clone(),
14624 }
14625 }
14626 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14634 let mut query = self.selection.select("sourceMap");
14635 query = query.arg("filename", filename.into());
14636 query = query.arg("line", line);
14637 query = query.arg("column", column);
14638 SourceMap {
14639 proc: self.proc.clone(),
14640 selection: query,
14641 graphql_client: self.graphql_client.clone(),
14642 }
14643 }
14644 pub fn type_def(&self) -> TypeDef {
14646 let query = self.selection.select("typeDef");
14647 TypeDef {
14648 proc: self.proc.clone(),
14649 selection: query,
14650 graphql_client: self.graphql_client.clone(),
14651 }
14652 }
14653 pub async fn version(&self) -> Result<String, DaggerError> {
14655 let query = self.selection.select("version");
14656 query.execute(self.graphql_client.clone()).await
14657 }
14658}
14659impl Node for Query {
14660 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14661 let query = self.selection.select("id");
14662 let graphql_client = self.graphql_client.clone();
14663 async move { query.execute(graphql_client).await }
14664 }
14665}
14666#[derive(Clone)]
14667pub struct RemoteGitMirror {
14668 pub proc: Option<Arc<DaggerSessionProc>>,
14669 pub selection: Selection,
14670 pub graphql_client: DynGraphQLClient,
14671}
14672impl IntoID<Id> for RemoteGitMirror {
14673 fn into_id(
14674 self,
14675 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14676 Box::pin(async move { self.id().await })
14677 }
14678}
14679impl Loadable for RemoteGitMirror {
14680 fn graphql_type() -> &'static str {
14681 "RemoteGitMirror"
14682 }
14683 fn from_query(
14684 proc: Option<Arc<DaggerSessionProc>>,
14685 selection: Selection,
14686 graphql_client: DynGraphQLClient,
14687 ) -> Self {
14688 Self {
14689 proc,
14690 selection,
14691 graphql_client,
14692 }
14693 }
14694}
14695impl RemoteGitMirror {
14696 pub async fn id(&self) -> Result<Id, DaggerError> {
14698 let query = self.selection.select("id");
14699 query.execute(self.graphql_client.clone()).await
14700 }
14701}
14702impl Node for RemoteGitMirror {
14703 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14704 let query = self.selection.select("id");
14705 let graphql_client = self.graphql_client.clone();
14706 async move { query.execute(graphql_client).await }
14707 }
14708}
14709#[derive(Clone)]
14710pub struct SdkConfig {
14711 pub proc: Option<Arc<DaggerSessionProc>>,
14712 pub selection: Selection,
14713 pub graphql_client: DynGraphQLClient,
14714}
14715impl IntoID<Id> for SdkConfig {
14716 fn into_id(
14717 self,
14718 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14719 Box::pin(async move { self.id().await })
14720 }
14721}
14722impl Loadable for SdkConfig {
14723 fn graphql_type() -> &'static str {
14724 "SDKConfig"
14725 }
14726 fn from_query(
14727 proc: Option<Arc<DaggerSessionProc>>,
14728 selection: Selection,
14729 graphql_client: DynGraphQLClient,
14730 ) -> Self {
14731 Self {
14732 proc,
14733 selection,
14734 graphql_client,
14735 }
14736 }
14737}
14738impl SdkConfig {
14739 pub async fn debug(&self) -> Result<bool, DaggerError> {
14741 let query = self.selection.select("debug");
14742 query.execute(self.graphql_client.clone()).await
14743 }
14744 pub async fn id(&self) -> Result<Id, DaggerError> {
14746 let query = self.selection.select("id");
14747 query.execute(self.graphql_client.clone()).await
14748 }
14749 pub async fn source(&self) -> Result<String, DaggerError> {
14751 let query = self.selection.select("source");
14752 query.execute(self.graphql_client.clone()).await
14753 }
14754}
14755impl Node for SdkConfig {
14756 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14757 let query = self.selection.select("id");
14758 let graphql_client = self.graphql_client.clone();
14759 async move { query.execute(graphql_client).await }
14760 }
14761}
14762#[derive(Clone)]
14763pub struct ScalarTypeDef {
14764 pub proc: Option<Arc<DaggerSessionProc>>,
14765 pub selection: Selection,
14766 pub graphql_client: DynGraphQLClient,
14767}
14768impl IntoID<Id> for ScalarTypeDef {
14769 fn into_id(
14770 self,
14771 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14772 Box::pin(async move { self.id().await })
14773 }
14774}
14775impl Loadable for ScalarTypeDef {
14776 fn graphql_type() -> &'static str {
14777 "ScalarTypeDef"
14778 }
14779 fn from_query(
14780 proc: Option<Arc<DaggerSessionProc>>,
14781 selection: Selection,
14782 graphql_client: DynGraphQLClient,
14783 ) -> Self {
14784 Self {
14785 proc,
14786 selection,
14787 graphql_client,
14788 }
14789 }
14790}
14791impl ScalarTypeDef {
14792 pub async fn description(&self) -> Result<String, DaggerError> {
14794 let query = self.selection.select("description");
14795 query.execute(self.graphql_client.clone()).await
14796 }
14797 pub async fn id(&self) -> Result<Id, DaggerError> {
14799 let query = self.selection.select("id");
14800 query.execute(self.graphql_client.clone()).await
14801 }
14802 pub async fn name(&self) -> Result<String, DaggerError> {
14804 let query = self.selection.select("name");
14805 query.execute(self.graphql_client.clone()).await
14806 }
14807 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14809 let query = self.selection.select("sourceModuleName");
14810 query.execute(self.graphql_client.clone()).await
14811 }
14812}
14813impl Node for ScalarTypeDef {
14814 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14815 let query = self.selection.select("id");
14816 let graphql_client = self.graphql_client.clone();
14817 async move { query.execute(graphql_client).await }
14818 }
14819}
14820#[derive(Clone)]
14821pub struct SearchResult {
14822 pub proc: Option<Arc<DaggerSessionProc>>,
14823 pub selection: Selection,
14824 pub graphql_client: DynGraphQLClient,
14825}
14826impl IntoID<Id> for SearchResult {
14827 fn into_id(
14828 self,
14829 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14830 Box::pin(async move { self.id().await })
14831 }
14832}
14833impl Loadable for SearchResult {
14834 fn graphql_type() -> &'static str {
14835 "SearchResult"
14836 }
14837 fn from_query(
14838 proc: Option<Arc<DaggerSessionProc>>,
14839 selection: Selection,
14840 graphql_client: DynGraphQLClient,
14841 ) -> Self {
14842 Self {
14843 proc,
14844 selection,
14845 graphql_client,
14846 }
14847 }
14848}
14849impl SearchResult {
14850 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14852 let query = self.selection.select("absoluteOffset");
14853 query.execute(self.graphql_client.clone()).await
14854 }
14855 pub async fn file_path(&self) -> Result<String, DaggerError> {
14857 let query = self.selection.select("filePath");
14858 query.execute(self.graphql_client.clone()).await
14859 }
14860 pub async fn id(&self) -> Result<Id, DaggerError> {
14862 let query = self.selection.select("id");
14863 query.execute(self.graphql_client.clone()).await
14864 }
14865 pub async fn line_number(&self) -> Result<isize, DaggerError> {
14867 let query = self.selection.select("lineNumber");
14868 query.execute(self.graphql_client.clone()).await
14869 }
14870 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14872 let query = self.selection.select("matchedLines");
14873 query.execute(self.graphql_client.clone()).await
14874 }
14875 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14877 let query = self.selection.select("submatches");
14878 let query = query.select("id");
14879 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14880 Ok(ids
14881 .into_iter()
14882 .map(|id| SearchSubmatch {
14883 proc: self.proc.clone(),
14884 selection: crate::querybuilder::query()
14885 .select("node")
14886 .arg("id", &id.0)
14887 .inline_fragment("SearchSubmatch"),
14888 graphql_client: self.graphql_client.clone(),
14889 })
14890 .collect())
14891 }
14892}
14893impl Node for SearchResult {
14894 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14895 let query = self.selection.select("id");
14896 let graphql_client = self.graphql_client.clone();
14897 async move { query.execute(graphql_client).await }
14898 }
14899}
14900#[derive(Clone)]
14901pub struct SearchSubmatch {
14902 pub proc: Option<Arc<DaggerSessionProc>>,
14903 pub selection: Selection,
14904 pub graphql_client: DynGraphQLClient,
14905}
14906impl IntoID<Id> for SearchSubmatch {
14907 fn into_id(
14908 self,
14909 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14910 Box::pin(async move { self.id().await })
14911 }
14912}
14913impl Loadable for SearchSubmatch {
14914 fn graphql_type() -> &'static str {
14915 "SearchSubmatch"
14916 }
14917 fn from_query(
14918 proc: Option<Arc<DaggerSessionProc>>,
14919 selection: Selection,
14920 graphql_client: DynGraphQLClient,
14921 ) -> Self {
14922 Self {
14923 proc,
14924 selection,
14925 graphql_client,
14926 }
14927 }
14928}
14929impl SearchSubmatch {
14930 pub async fn end(&self) -> Result<isize, DaggerError> {
14932 let query = self.selection.select("end");
14933 query.execute(self.graphql_client.clone()).await
14934 }
14935 pub async fn id(&self) -> Result<Id, DaggerError> {
14937 let query = self.selection.select("id");
14938 query.execute(self.graphql_client.clone()).await
14939 }
14940 pub async fn start(&self) -> Result<isize, DaggerError> {
14942 let query = self.selection.select("start");
14943 query.execute(self.graphql_client.clone()).await
14944 }
14945 pub async fn text(&self) -> Result<String, DaggerError> {
14947 let query = self.selection.select("text");
14948 query.execute(self.graphql_client.clone()).await
14949 }
14950}
14951impl Node for SearchSubmatch {
14952 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14953 let query = self.selection.select("id");
14954 let graphql_client = self.graphql_client.clone();
14955 async move { query.execute(graphql_client).await }
14956 }
14957}
14958#[derive(Clone)]
14959pub struct Secret {
14960 pub proc: Option<Arc<DaggerSessionProc>>,
14961 pub selection: Selection,
14962 pub graphql_client: DynGraphQLClient,
14963}
14964impl IntoID<Id> for Secret {
14965 fn into_id(
14966 self,
14967 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14968 Box::pin(async move { self.id().await })
14969 }
14970}
14971impl Loadable for Secret {
14972 fn graphql_type() -> &'static str {
14973 "Secret"
14974 }
14975 fn from_query(
14976 proc: Option<Arc<DaggerSessionProc>>,
14977 selection: Selection,
14978 graphql_client: DynGraphQLClient,
14979 ) -> Self {
14980 Self {
14981 proc,
14982 selection,
14983 graphql_client,
14984 }
14985 }
14986}
14987impl Secret {
14988 pub async fn id(&self) -> Result<Id, DaggerError> {
14990 let query = self.selection.select("id");
14991 query.execute(self.graphql_client.clone()).await
14992 }
14993 pub async fn name(&self) -> Result<String, DaggerError> {
14995 let query = self.selection.select("name");
14996 query.execute(self.graphql_client.clone()).await
14997 }
14998 pub async fn plaintext(&self) -> Result<String, DaggerError> {
15000 let query = self.selection.select("plaintext");
15001 query.execute(self.graphql_client.clone()).await
15002 }
15003 pub async fn uri(&self) -> Result<String, DaggerError> {
15005 let query = self.selection.select("uri");
15006 query.execute(self.graphql_client.clone()).await
15007 }
15008}
15009impl Node for Secret {
15010 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15011 let query = self.selection.select("id");
15012 let graphql_client = self.graphql_client.clone();
15013 async move { query.execute(graphql_client).await }
15014 }
15015}
15016#[derive(Clone)]
15017pub struct Service {
15018 pub proc: Option<Arc<DaggerSessionProc>>,
15019 pub selection: Selection,
15020 pub graphql_client: DynGraphQLClient,
15021}
15022#[derive(Builder, Debug, PartialEq)]
15023pub struct ServiceEndpointOpts<'a> {
15024 #[builder(setter(into, strip_option), default)]
15026 pub port: Option<isize>,
15027 #[builder(setter(into, strip_option), default)]
15029 pub scheme: Option<&'a str>,
15030}
15031#[derive(Builder, Debug, PartialEq)]
15032pub struct ServiceStopOpts {
15033 #[builder(setter(into, strip_option), default)]
15035 pub kill: Option<bool>,
15036}
15037#[derive(Builder, Debug, PartialEq)]
15038pub struct ServiceTerminalOpts<'a> {
15039 #[builder(setter(into, strip_option), default)]
15040 pub cmd: Option<Vec<&'a str>>,
15041}
15042#[derive(Builder, Debug, PartialEq)]
15043pub struct ServiceUpOpts {
15044 #[builder(setter(into, strip_option), default)]
15047 pub ports: Option<Vec<PortForward>>,
15048 #[builder(setter(into, strip_option), default)]
15050 pub random: Option<bool>,
15051}
15052impl IntoID<Id> for Service {
15053 fn into_id(
15054 self,
15055 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15056 Box::pin(async move { self.id().await })
15057 }
15058}
15059impl Loadable for Service {
15060 fn graphql_type() -> &'static str {
15061 "Service"
15062 }
15063 fn from_query(
15064 proc: Option<Arc<DaggerSessionProc>>,
15065 selection: Selection,
15066 graphql_client: DynGraphQLClient,
15067 ) -> Self {
15068 Self {
15069 proc,
15070 selection,
15071 graphql_client,
15072 }
15073 }
15074}
15075impl Service {
15076 pub async fn endpoint(&self) -> Result<String, DaggerError> {
15084 let query = self.selection.select("endpoint");
15085 query.execute(self.graphql_client.clone()).await
15086 }
15087 pub async fn endpoint_opts<'a>(
15095 &self,
15096 opts: ServiceEndpointOpts<'a>,
15097 ) -> Result<String, DaggerError> {
15098 let mut query = self.selection.select("endpoint");
15099 if let Some(port) = opts.port {
15100 query = query.arg("port", port);
15101 }
15102 if let Some(scheme) = opts.scheme {
15103 query = query.arg("scheme", scheme);
15104 }
15105 query.execute(self.graphql_client.clone()).await
15106 }
15107 pub async fn hostname(&self) -> Result<String, DaggerError> {
15109 let query = self.selection.select("hostname");
15110 query.execute(self.graphql_client.clone()).await
15111 }
15112 pub async fn id(&self) -> Result<Id, DaggerError> {
15114 let query = self.selection.select("id");
15115 query.execute(self.graphql_client.clone()).await
15116 }
15117 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15119 let query = self.selection.select("ports");
15120 let query = query.select("id");
15121 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15122 Ok(ids
15123 .into_iter()
15124 .map(|id| Port {
15125 proc: self.proc.clone(),
15126 selection: crate::querybuilder::query()
15127 .select("node")
15128 .arg("id", &id.0)
15129 .inline_fragment("Port"),
15130 graphql_client: self.graphql_client.clone(),
15131 })
15132 .collect())
15133 }
15134 pub async fn start(&self) -> Result<Service, DaggerError> {
15137 let query = self.selection.select("start");
15138 let id: Id = query.execute(self.graphql_client.clone()).await?;
15139 Ok(Service {
15140 proc: self.proc.clone(),
15141 selection: query
15142 .root()
15143 .select("node")
15144 .arg("id", &id.0)
15145 .inline_fragment("Service"),
15146 graphql_client: self.graphql_client.clone(),
15147 })
15148 }
15149 pub async fn stop(&self) -> Result<Service, DaggerError> {
15155 let query = self.selection.select("stop");
15156 let id: Id = query.execute(self.graphql_client.clone()).await?;
15157 Ok(Service {
15158 proc: self.proc.clone(),
15159 selection: query
15160 .root()
15161 .select("node")
15162 .arg("id", &id.0)
15163 .inline_fragment("Service"),
15164 graphql_client: self.graphql_client.clone(),
15165 })
15166 }
15167 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15173 let mut query = self.selection.select("stop");
15174 if let Some(kill) = opts.kill {
15175 query = query.arg("kill", kill);
15176 }
15177 let id: Id = query.execute(self.graphql_client.clone()).await?;
15178 Ok(Service {
15179 proc: self.proc.clone(),
15180 selection: query
15181 .root()
15182 .select("node")
15183 .arg("id", &id.0)
15184 .inline_fragment("Service"),
15185 graphql_client: self.graphql_client.clone(),
15186 })
15187 }
15188 pub async fn sync(&self) -> Result<Service, DaggerError> {
15190 let query = self.selection.select("sync");
15191 let id: Id = query.execute(self.graphql_client.clone()).await?;
15192 Ok(Service {
15193 proc: self.proc.clone(),
15194 selection: query
15195 .root()
15196 .select("node")
15197 .arg("id", &id.0)
15198 .inline_fragment("Service"),
15199 graphql_client: self.graphql_client.clone(),
15200 })
15201 }
15202 pub fn terminal(&self) -> Service {
15207 let query = self.selection.select("terminal");
15208 Service {
15209 proc: self.proc.clone(),
15210 selection: query,
15211 graphql_client: self.graphql_client.clone(),
15212 }
15213 }
15214 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15219 let mut query = self.selection.select("terminal");
15220 if let Some(cmd) = opts.cmd {
15221 query = query.arg("cmd", cmd);
15222 }
15223 Service {
15224 proc: self.proc.clone(),
15225 selection: query,
15226 graphql_client: self.graphql_client.clone(),
15227 }
15228 }
15229 pub async fn up(&self) -> Result<Void, DaggerError> {
15235 let query = self.selection.select("up");
15236 query.execute(self.graphql_client.clone()).await
15237 }
15238 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15244 let mut query = self.selection.select("up");
15245 if let Some(ports) = opts.ports {
15246 query = query.arg("ports", ports);
15247 }
15248 if let Some(random) = opts.random {
15249 query = query.arg("random", random);
15250 }
15251 query.execute(self.graphql_client.clone()).await
15252 }
15253 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15259 let mut query = self.selection.select("withHostname");
15260 query = query.arg("hostname", hostname.into());
15261 Service {
15262 proc: self.proc.clone(),
15263 selection: query,
15264 graphql_client: self.graphql_client.clone(),
15265 }
15266 }
15267}
15268impl Node for Service {
15269 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15270 let query = self.selection.select("id");
15271 let graphql_client = self.graphql_client.clone();
15272 async move { query.execute(graphql_client).await }
15273 }
15274}
15275impl Syncer for Service {
15276 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15277 let query = self.selection.select("id");
15278 let graphql_client = self.graphql_client.clone();
15279 async move { query.execute(graphql_client).await }
15280 }
15281 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15282 let query = self.selection.select("sync");
15283 let graphql_client = self.graphql_client.clone();
15284 async move { query.execute(graphql_client).await }
15285 }
15286}
15287#[derive(Clone)]
15288pub struct Socket {
15289 pub proc: Option<Arc<DaggerSessionProc>>,
15290 pub selection: Selection,
15291 pub graphql_client: DynGraphQLClient,
15292}
15293impl IntoID<Id> for Socket {
15294 fn into_id(
15295 self,
15296 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15297 Box::pin(async move { self.id().await })
15298 }
15299}
15300impl Loadable for Socket {
15301 fn graphql_type() -> &'static str {
15302 "Socket"
15303 }
15304 fn from_query(
15305 proc: Option<Arc<DaggerSessionProc>>,
15306 selection: Selection,
15307 graphql_client: DynGraphQLClient,
15308 ) -> Self {
15309 Self {
15310 proc,
15311 selection,
15312 graphql_client,
15313 }
15314 }
15315}
15316impl Socket {
15317 pub async fn id(&self) -> Result<Id, DaggerError> {
15319 let query = self.selection.select("id");
15320 query.execute(self.graphql_client.clone()).await
15321 }
15322}
15323impl Node for Socket {
15324 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15325 let query = self.selection.select("id");
15326 let graphql_client = self.graphql_client.clone();
15327 async move { query.execute(graphql_client).await }
15328 }
15329}
15330#[derive(Clone)]
15331pub struct SourceMap {
15332 pub proc: Option<Arc<DaggerSessionProc>>,
15333 pub selection: Selection,
15334 pub graphql_client: DynGraphQLClient,
15335}
15336impl IntoID<Id> for SourceMap {
15337 fn into_id(
15338 self,
15339 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15340 Box::pin(async move { self.id().await })
15341 }
15342}
15343impl Loadable for SourceMap {
15344 fn graphql_type() -> &'static str {
15345 "SourceMap"
15346 }
15347 fn from_query(
15348 proc: Option<Arc<DaggerSessionProc>>,
15349 selection: Selection,
15350 graphql_client: DynGraphQLClient,
15351 ) -> Self {
15352 Self {
15353 proc,
15354 selection,
15355 graphql_client,
15356 }
15357 }
15358}
15359impl SourceMap {
15360 pub async fn column(&self) -> Result<isize, DaggerError> {
15362 let query = self.selection.select("column");
15363 query.execute(self.graphql_client.clone()).await
15364 }
15365 pub async fn filename(&self) -> Result<String, DaggerError> {
15367 let query = self.selection.select("filename");
15368 query.execute(self.graphql_client.clone()).await
15369 }
15370 pub async fn id(&self) -> Result<Id, DaggerError> {
15372 let query = self.selection.select("id");
15373 query.execute(self.graphql_client.clone()).await
15374 }
15375 pub async fn line(&self) -> Result<isize, DaggerError> {
15377 let query = self.selection.select("line");
15378 query.execute(self.graphql_client.clone()).await
15379 }
15380 pub async fn module(&self) -> Result<String, DaggerError> {
15382 let query = self.selection.select("module");
15383 query.execute(self.graphql_client.clone()).await
15384 }
15385 pub async fn url(&self) -> Result<String, DaggerError> {
15387 let query = self.selection.select("url");
15388 query.execute(self.graphql_client.clone()).await
15389 }
15390}
15391impl Node for SourceMap {
15392 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15393 let query = self.selection.select("id");
15394 let graphql_client = self.graphql_client.clone();
15395 async move { query.execute(graphql_client).await }
15396 }
15397}
15398#[derive(Clone)]
15399pub struct Stat {
15400 pub proc: Option<Arc<DaggerSessionProc>>,
15401 pub selection: Selection,
15402 pub graphql_client: DynGraphQLClient,
15403}
15404impl IntoID<Id> for Stat {
15405 fn into_id(
15406 self,
15407 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15408 Box::pin(async move { self.id().await })
15409 }
15410}
15411impl Loadable for Stat {
15412 fn graphql_type() -> &'static str {
15413 "Stat"
15414 }
15415 fn from_query(
15416 proc: Option<Arc<DaggerSessionProc>>,
15417 selection: Selection,
15418 graphql_client: DynGraphQLClient,
15419 ) -> Self {
15420 Self {
15421 proc,
15422 selection,
15423 graphql_client,
15424 }
15425 }
15426}
15427impl Stat {
15428 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15430 let query = self.selection.select("fileType");
15431 query.execute(self.graphql_client.clone()).await
15432 }
15433 pub async fn id(&self) -> Result<Id, DaggerError> {
15435 let query = self.selection.select("id");
15436 query.execute(self.graphql_client.clone()).await
15437 }
15438 pub async fn name(&self) -> Result<String, DaggerError> {
15440 let query = self.selection.select("name");
15441 query.execute(self.graphql_client.clone()).await
15442 }
15443 pub async fn permissions(&self) -> Result<isize, DaggerError> {
15445 let query = self.selection.select("permissions");
15446 query.execute(self.graphql_client.clone()).await
15447 }
15448 pub async fn size(&self) -> Result<isize, DaggerError> {
15450 let query = self.selection.select("size");
15451 query.execute(self.graphql_client.clone()).await
15452 }
15453}
15454impl Node for Stat {
15455 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15456 let query = self.selection.select("id");
15457 let graphql_client = self.graphql_client.clone();
15458 async move { query.execute(graphql_client).await }
15459 }
15460}
15461#[derive(Clone)]
15462pub struct Terminal {
15463 pub proc: Option<Arc<DaggerSessionProc>>,
15464 pub selection: Selection,
15465 pub graphql_client: DynGraphQLClient,
15466}
15467impl IntoID<Id> for Terminal {
15468 fn into_id(
15469 self,
15470 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15471 Box::pin(async move { self.id().await })
15472 }
15473}
15474impl Loadable for Terminal {
15475 fn graphql_type() -> &'static str {
15476 "Terminal"
15477 }
15478 fn from_query(
15479 proc: Option<Arc<DaggerSessionProc>>,
15480 selection: Selection,
15481 graphql_client: DynGraphQLClient,
15482 ) -> Self {
15483 Self {
15484 proc,
15485 selection,
15486 graphql_client,
15487 }
15488 }
15489}
15490impl Terminal {
15491 pub async fn id(&self) -> Result<Id, DaggerError> {
15493 let query = self.selection.select("id");
15494 query.execute(self.graphql_client.clone()).await
15495 }
15496 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15499 let query = self.selection.select("sync");
15500 let id: Id = query.execute(self.graphql_client.clone()).await?;
15501 Ok(Terminal {
15502 proc: self.proc.clone(),
15503 selection: query
15504 .root()
15505 .select("node")
15506 .arg("id", &id.0)
15507 .inline_fragment("Terminal"),
15508 graphql_client: self.graphql_client.clone(),
15509 })
15510 }
15511}
15512impl Node for Terminal {
15513 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15514 let query = self.selection.select("id");
15515 let graphql_client = self.graphql_client.clone();
15516 async move { query.execute(graphql_client).await }
15517 }
15518}
15519impl Syncer for Terminal {
15520 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15521 let query = self.selection.select("id");
15522 let graphql_client = self.graphql_client.clone();
15523 async move { query.execute(graphql_client).await }
15524 }
15525 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15526 let query = self.selection.select("sync");
15527 let graphql_client = self.graphql_client.clone();
15528 async move { query.execute(graphql_client).await }
15529 }
15530}
15531#[derive(Clone)]
15532pub struct TypeDef {
15533 pub proc: Option<Arc<DaggerSessionProc>>,
15534 pub selection: Selection,
15535 pub graphql_client: DynGraphQLClient,
15536}
15537#[derive(Builder, Debug, PartialEq)]
15538pub struct TypeDefWithEnumOpts<'a> {
15539 #[builder(setter(into, strip_option), default)]
15541 pub description: Option<&'a str>,
15542 #[builder(setter(into, strip_option), default)]
15544 pub source_map: Option<Id>,
15545}
15546#[derive(Builder, Debug, PartialEq)]
15547pub struct TypeDefWithEnumMemberOpts<'a> {
15548 #[builder(setter(into, strip_option), default)]
15550 pub deprecated: Option<&'a str>,
15551 #[builder(setter(into, strip_option), default)]
15553 pub description: Option<&'a str>,
15554 #[builder(setter(into, strip_option), default)]
15556 pub source_map: Option<Id>,
15557 #[builder(setter(into, strip_option), default)]
15559 pub value: Option<&'a str>,
15560}
15561#[derive(Builder, Debug, PartialEq)]
15562pub struct TypeDefWithEnumValueOpts<'a> {
15563 #[builder(setter(into, strip_option), default)]
15565 pub deprecated: Option<&'a str>,
15566 #[builder(setter(into, strip_option), default)]
15568 pub description: Option<&'a str>,
15569 #[builder(setter(into, strip_option), default)]
15571 pub source_map: Option<Id>,
15572}
15573#[derive(Builder, Debug, PartialEq)]
15574pub struct TypeDefWithFieldOpts<'a> {
15575 #[builder(setter(into, strip_option), default)]
15577 pub deprecated: Option<&'a str>,
15578 #[builder(setter(into, strip_option), default)]
15580 pub description: Option<&'a str>,
15581 #[builder(setter(into, strip_option), default)]
15583 pub source_map: Option<Id>,
15584}
15585#[derive(Builder, Debug, PartialEq)]
15586pub struct TypeDefWithInterfaceOpts<'a> {
15587 #[builder(setter(into, strip_option), default)]
15588 pub description: Option<&'a str>,
15589 #[builder(setter(into, strip_option), default)]
15590 pub source_map: Option<Id>,
15591}
15592#[derive(Builder, Debug, PartialEq)]
15593pub struct TypeDefWithObjectOpts<'a> {
15594 #[builder(setter(into, strip_option), default)]
15595 pub deprecated: Option<&'a str>,
15596 #[builder(setter(into, strip_option), default)]
15597 pub description: Option<&'a str>,
15598 #[builder(setter(into, strip_option), default)]
15599 pub source_map: Option<Id>,
15600}
15601#[derive(Builder, Debug, PartialEq)]
15602pub struct TypeDefWithScalarOpts<'a> {
15603 #[builder(setter(into, strip_option), default)]
15604 pub description: Option<&'a str>,
15605}
15606impl IntoID<Id> for TypeDef {
15607 fn into_id(
15608 self,
15609 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15610 Box::pin(async move { self.id().await })
15611 }
15612}
15613impl Loadable for TypeDef {
15614 fn graphql_type() -> &'static str {
15615 "TypeDef"
15616 }
15617 fn from_query(
15618 proc: Option<Arc<DaggerSessionProc>>,
15619 selection: Selection,
15620 graphql_client: DynGraphQLClient,
15621 ) -> Self {
15622 Self {
15623 proc,
15624 selection,
15625 graphql_client,
15626 }
15627 }
15628}
15629impl TypeDef {
15630 pub fn as_enum(&self) -> EnumTypeDef {
15632 let query = self.selection.select("asEnum");
15633 EnumTypeDef {
15634 proc: self.proc.clone(),
15635 selection: query,
15636 graphql_client: self.graphql_client.clone(),
15637 }
15638 }
15639 pub fn as_input(&self) -> InputTypeDef {
15641 let query = self.selection.select("asInput");
15642 InputTypeDef {
15643 proc: self.proc.clone(),
15644 selection: query,
15645 graphql_client: self.graphql_client.clone(),
15646 }
15647 }
15648 pub fn as_interface(&self) -> InterfaceTypeDef {
15650 let query = self.selection.select("asInterface");
15651 InterfaceTypeDef {
15652 proc: self.proc.clone(),
15653 selection: query,
15654 graphql_client: self.graphql_client.clone(),
15655 }
15656 }
15657 pub fn as_list(&self) -> ListTypeDef {
15659 let query = self.selection.select("asList");
15660 ListTypeDef {
15661 proc: self.proc.clone(),
15662 selection: query,
15663 graphql_client: self.graphql_client.clone(),
15664 }
15665 }
15666 pub fn as_object(&self) -> ObjectTypeDef {
15668 let query = self.selection.select("asObject");
15669 ObjectTypeDef {
15670 proc: self.proc.clone(),
15671 selection: query,
15672 graphql_client: self.graphql_client.clone(),
15673 }
15674 }
15675 pub fn as_scalar(&self) -> ScalarTypeDef {
15677 let query = self.selection.select("asScalar");
15678 ScalarTypeDef {
15679 proc: self.proc.clone(),
15680 selection: query,
15681 graphql_client: self.graphql_client.clone(),
15682 }
15683 }
15684 pub async fn id(&self) -> Result<Id, DaggerError> {
15686 let query = self.selection.select("id");
15687 query.execute(self.graphql_client.clone()).await
15688 }
15689 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15691 let query = self.selection.select("kind");
15692 query.execute(self.graphql_client.clone()).await
15693 }
15694 pub async fn name(&self) -> Result<String, DaggerError> {
15696 let query = self.selection.select("name");
15697 query.execute(self.graphql_client.clone()).await
15698 }
15699 pub async fn optional(&self) -> Result<bool, DaggerError> {
15701 let query = self.selection.select("optional");
15702 query.execute(self.graphql_client.clone()).await
15703 }
15704 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15706 let mut query = self.selection.select("withConstructor");
15707 query = query.arg_lazy(
15708 "function",
15709 Box::new(move || {
15710 let function = function.clone();
15711 Box::pin(async move { function.into_id().await.unwrap().quote() })
15712 }),
15713 );
15714 TypeDef {
15715 proc: self.proc.clone(),
15716 selection: query,
15717 graphql_client: self.graphql_client.clone(),
15718 }
15719 }
15720 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15728 let mut query = self.selection.select("withEnum");
15729 query = query.arg("name", name.into());
15730 TypeDef {
15731 proc: self.proc.clone(),
15732 selection: query,
15733 graphql_client: self.graphql_client.clone(),
15734 }
15735 }
15736 pub fn with_enum_opts<'a>(
15744 &self,
15745 name: impl Into<String>,
15746 opts: TypeDefWithEnumOpts<'a>,
15747 ) -> TypeDef {
15748 let mut query = self.selection.select("withEnum");
15749 query = query.arg("name", name.into());
15750 if let Some(description) = opts.description {
15751 query = query.arg("description", description);
15752 }
15753 if let Some(source_map) = opts.source_map {
15754 query = query.arg("sourceMap", source_map);
15755 }
15756 TypeDef {
15757 proc: self.proc.clone(),
15758 selection: query,
15759 graphql_client: self.graphql_client.clone(),
15760 }
15761 }
15762 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15769 let mut query = self.selection.select("withEnumMember");
15770 query = query.arg("name", name.into());
15771 TypeDef {
15772 proc: self.proc.clone(),
15773 selection: query,
15774 graphql_client: self.graphql_client.clone(),
15775 }
15776 }
15777 pub fn with_enum_member_opts<'a>(
15784 &self,
15785 name: impl Into<String>,
15786 opts: TypeDefWithEnumMemberOpts<'a>,
15787 ) -> TypeDef {
15788 let mut query = self.selection.select("withEnumMember");
15789 query = query.arg("name", name.into());
15790 if let Some(value) = opts.value {
15791 query = query.arg("value", value);
15792 }
15793 if let Some(description) = opts.description {
15794 query = query.arg("description", description);
15795 }
15796 if let Some(source_map) = opts.source_map {
15797 query = query.arg("sourceMap", source_map);
15798 }
15799 if let Some(deprecated) = opts.deprecated {
15800 query = query.arg("deprecated", deprecated);
15801 }
15802 TypeDef {
15803 proc: self.proc.clone(),
15804 selection: query,
15805 graphql_client: self.graphql_client.clone(),
15806 }
15807 }
15808 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15815 let mut query = self.selection.select("withEnumValue");
15816 query = query.arg("value", value.into());
15817 TypeDef {
15818 proc: self.proc.clone(),
15819 selection: query,
15820 graphql_client: self.graphql_client.clone(),
15821 }
15822 }
15823 pub fn with_enum_value_opts<'a>(
15830 &self,
15831 value: impl Into<String>,
15832 opts: TypeDefWithEnumValueOpts<'a>,
15833 ) -> TypeDef {
15834 let mut query = self.selection.select("withEnumValue");
15835 query = query.arg("value", value.into());
15836 if let Some(description) = opts.description {
15837 query = query.arg("description", description);
15838 }
15839 if let Some(source_map) = opts.source_map {
15840 query = query.arg("sourceMap", source_map);
15841 }
15842 if let Some(deprecated) = opts.deprecated {
15843 query = query.arg("deprecated", deprecated);
15844 }
15845 TypeDef {
15846 proc: self.proc.clone(),
15847 selection: query,
15848 graphql_client: self.graphql_client.clone(),
15849 }
15850 }
15851 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
15859 let mut query = self.selection.select("withField");
15860 query = query.arg("name", name.into());
15861 query = query.arg_lazy(
15862 "typeDef",
15863 Box::new(move || {
15864 let type_def = type_def.clone();
15865 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15866 }),
15867 );
15868 TypeDef {
15869 proc: self.proc.clone(),
15870 selection: query,
15871 graphql_client: self.graphql_client.clone(),
15872 }
15873 }
15874 pub fn with_field_opts<'a>(
15882 &self,
15883 name: impl Into<String>,
15884 type_def: impl IntoID<Id>,
15885 opts: TypeDefWithFieldOpts<'a>,
15886 ) -> TypeDef {
15887 let mut query = self.selection.select("withField");
15888 query = query.arg("name", name.into());
15889 query = query.arg_lazy(
15890 "typeDef",
15891 Box::new(move || {
15892 let type_def = type_def.clone();
15893 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15894 }),
15895 );
15896 if let Some(description) = opts.description {
15897 query = query.arg("description", description);
15898 }
15899 if let Some(source_map) = opts.source_map {
15900 query = query.arg("sourceMap", source_map);
15901 }
15902 if let Some(deprecated) = opts.deprecated {
15903 query = query.arg("deprecated", deprecated);
15904 }
15905 TypeDef {
15906 proc: self.proc.clone(),
15907 selection: query,
15908 graphql_client: self.graphql_client.clone(),
15909 }
15910 }
15911 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15913 let mut query = self.selection.select("withFunction");
15914 query = query.arg_lazy(
15915 "function",
15916 Box::new(move || {
15917 let function = function.clone();
15918 Box::pin(async move { function.into_id().await.unwrap().quote() })
15919 }),
15920 );
15921 TypeDef {
15922 proc: self.proc.clone(),
15923 selection: query,
15924 graphql_client: self.graphql_client.clone(),
15925 }
15926 }
15927 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15933 let mut query = self.selection.select("withInterface");
15934 query = query.arg("name", name.into());
15935 TypeDef {
15936 proc: self.proc.clone(),
15937 selection: query,
15938 graphql_client: self.graphql_client.clone(),
15939 }
15940 }
15941 pub fn with_interface_opts<'a>(
15947 &self,
15948 name: impl Into<String>,
15949 opts: TypeDefWithInterfaceOpts<'a>,
15950 ) -> TypeDef {
15951 let mut query = self.selection.select("withInterface");
15952 query = query.arg("name", name.into());
15953 if let Some(description) = opts.description {
15954 query = query.arg("description", description);
15955 }
15956 if let Some(source_map) = opts.source_map {
15957 query = query.arg("sourceMap", source_map);
15958 }
15959 TypeDef {
15960 proc: self.proc.clone(),
15961 selection: query,
15962 graphql_client: self.graphql_client.clone(),
15963 }
15964 }
15965 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15967 let mut query = self.selection.select("withKind");
15968 query = query.arg("kind", kind);
15969 TypeDef {
15970 proc: self.proc.clone(),
15971 selection: query,
15972 graphql_client: self.graphql_client.clone(),
15973 }
15974 }
15975 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15977 let mut query = self.selection.select("withListOf");
15978 query = query.arg_lazy(
15979 "elementType",
15980 Box::new(move || {
15981 let element_type = element_type.clone();
15982 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15983 }),
15984 );
15985 TypeDef {
15986 proc: self.proc.clone(),
15987 selection: query,
15988 graphql_client: self.graphql_client.clone(),
15989 }
15990 }
15991 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15998 let mut query = self.selection.select("withObject");
15999 query = query.arg("name", name.into());
16000 TypeDef {
16001 proc: self.proc.clone(),
16002 selection: query,
16003 graphql_client: self.graphql_client.clone(),
16004 }
16005 }
16006 pub fn with_object_opts<'a>(
16013 &self,
16014 name: impl Into<String>,
16015 opts: TypeDefWithObjectOpts<'a>,
16016 ) -> TypeDef {
16017 let mut query = self.selection.select("withObject");
16018 query = query.arg("name", name.into());
16019 if let Some(description) = opts.description {
16020 query = query.arg("description", description);
16021 }
16022 if let Some(source_map) = opts.source_map {
16023 query = query.arg("sourceMap", source_map);
16024 }
16025 if let Some(deprecated) = opts.deprecated {
16026 query = query.arg("deprecated", deprecated);
16027 }
16028 TypeDef {
16029 proc: self.proc.clone(),
16030 selection: query,
16031 graphql_client: self.graphql_client.clone(),
16032 }
16033 }
16034 pub fn with_optional(&self, optional: bool) -> TypeDef {
16036 let mut query = self.selection.select("withOptional");
16037 query = query.arg("optional", optional);
16038 TypeDef {
16039 proc: self.proc.clone(),
16040 selection: query,
16041 graphql_client: self.graphql_client.clone(),
16042 }
16043 }
16044 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16050 let mut query = self.selection.select("withScalar");
16051 query = query.arg("name", name.into());
16052 TypeDef {
16053 proc: self.proc.clone(),
16054 selection: query,
16055 graphql_client: self.graphql_client.clone(),
16056 }
16057 }
16058 pub fn with_scalar_opts<'a>(
16064 &self,
16065 name: impl Into<String>,
16066 opts: TypeDefWithScalarOpts<'a>,
16067 ) -> TypeDef {
16068 let mut query = self.selection.select("withScalar");
16069 query = query.arg("name", name.into());
16070 if let Some(description) = opts.description {
16071 query = query.arg("description", description);
16072 }
16073 TypeDef {
16074 proc: self.proc.clone(),
16075 selection: query,
16076 graphql_client: self.graphql_client.clone(),
16077 }
16078 }
16079}
16080impl Node for TypeDef {
16081 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16082 let query = self.selection.select("id");
16083 let graphql_client = self.graphql_client.clone();
16084 async move { query.execute(graphql_client).await }
16085 }
16086}
16087#[derive(Clone)]
16088pub struct Up {
16089 pub proc: Option<Arc<DaggerSessionProc>>,
16090 pub selection: Selection,
16091 pub graphql_client: DynGraphQLClient,
16092}
16093impl IntoID<Id> for Up {
16094 fn into_id(
16095 self,
16096 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16097 Box::pin(async move { self.id().await })
16098 }
16099}
16100impl Loadable for Up {
16101 fn graphql_type() -> &'static str {
16102 "Up"
16103 }
16104 fn from_query(
16105 proc: Option<Arc<DaggerSessionProc>>,
16106 selection: Selection,
16107 graphql_client: DynGraphQLClient,
16108 ) -> Self {
16109 Self {
16110 proc,
16111 selection,
16112 graphql_client,
16113 }
16114 }
16115}
16116impl Up {
16117 pub async fn description(&self) -> Result<String, DaggerError> {
16119 let query = self.selection.select("description");
16120 query.execute(self.graphql_client.clone()).await
16121 }
16122 pub async fn id(&self) -> Result<Id, DaggerError> {
16124 let query = self.selection.select("id");
16125 query.execute(self.graphql_client.clone()).await
16126 }
16127 pub async fn name(&self) -> Result<String, DaggerError> {
16129 let query = self.selection.select("name");
16130 query.execute(self.graphql_client.clone()).await
16131 }
16132 pub fn original_module(&self) -> Module {
16134 let query = self.selection.select("originalModule");
16135 Module {
16136 proc: self.proc.clone(),
16137 selection: query,
16138 graphql_client: self.graphql_client.clone(),
16139 }
16140 }
16141 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16143 let query = self.selection.select("path");
16144 query.execute(self.graphql_client.clone()).await
16145 }
16146 pub fn run(&self) -> Up {
16148 let query = self.selection.select("run");
16149 Up {
16150 proc: self.proc.clone(),
16151 selection: query,
16152 graphql_client: self.graphql_client.clone(),
16153 }
16154 }
16155}
16156impl Node for Up {
16157 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16158 let query = self.selection.select("id");
16159 let graphql_client = self.graphql_client.clone();
16160 async move { query.execute(graphql_client).await }
16161 }
16162}
16163#[derive(Clone)]
16164pub struct UpGroup {
16165 pub proc: Option<Arc<DaggerSessionProc>>,
16166 pub selection: Selection,
16167 pub graphql_client: DynGraphQLClient,
16168}
16169impl IntoID<Id> for UpGroup {
16170 fn into_id(
16171 self,
16172 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16173 Box::pin(async move { self.id().await })
16174 }
16175}
16176impl Loadable for UpGroup {
16177 fn graphql_type() -> &'static str {
16178 "UpGroup"
16179 }
16180 fn from_query(
16181 proc: Option<Arc<DaggerSessionProc>>,
16182 selection: Selection,
16183 graphql_client: DynGraphQLClient,
16184 ) -> Self {
16185 Self {
16186 proc,
16187 selection,
16188 graphql_client,
16189 }
16190 }
16191}
16192impl UpGroup {
16193 pub async fn id(&self) -> Result<Id, DaggerError> {
16195 let query = self.selection.select("id");
16196 query.execute(self.graphql_client.clone()).await
16197 }
16198 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16200 let query = self.selection.select("list");
16201 let query = query.select("id");
16202 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16203 Ok(ids
16204 .into_iter()
16205 .map(|id| Up {
16206 proc: self.proc.clone(),
16207 selection: crate::querybuilder::query()
16208 .select("node")
16209 .arg("id", &id.0)
16210 .inline_fragment("Up"),
16211 graphql_client: self.graphql_client.clone(),
16212 })
16213 .collect())
16214 }
16215 pub fn run(&self) -> UpGroup {
16217 let query = self.selection.select("run");
16218 UpGroup {
16219 proc: self.proc.clone(),
16220 selection: query,
16221 graphql_client: self.graphql_client.clone(),
16222 }
16223 }
16224}
16225impl Node for UpGroup {
16226 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16227 let query = self.selection.select("id");
16228 let graphql_client = self.graphql_client.clone();
16229 async move { query.execute(graphql_client).await }
16230 }
16231}
16232#[derive(Clone)]
16233pub struct Workspace {
16234 pub proc: Option<Arc<DaggerSessionProc>>,
16235 pub selection: Selection,
16236 pub graphql_client: DynGraphQLClient,
16237}
16238#[derive(Builder, Debug, PartialEq)]
16239pub struct WorkspaceChecksOpts<'a> {
16240 #[builder(setter(into, strip_option), default)]
16242 pub include: Option<Vec<&'a str>>,
16243 #[builder(setter(into, strip_option), default)]
16245 pub no_generate: Option<bool>,
16246 #[builder(setter(into, strip_option), default)]
16248 pub only_generate: Option<bool>,
16249}
16250#[derive(Builder, Debug, PartialEq)]
16251pub struct WorkspaceDirectoryOpts<'a> {
16252 #[builder(setter(into, strip_option), default)]
16254 pub exclude: Option<Vec<&'a str>>,
16255 #[builder(setter(into, strip_option), default)]
16257 pub gitignore: Option<bool>,
16258 #[builder(setter(into, strip_option), default)]
16260 pub include: Option<Vec<&'a str>>,
16261}
16262#[derive(Builder, Debug, PartialEq)]
16263pub struct WorkspaceFindUpOpts<'a> {
16264 #[builder(setter(into, strip_option), default)]
16266 pub from: Option<&'a str>,
16267}
16268#[derive(Builder, Debug, PartialEq)]
16269pub struct WorkspaceGeneratorsOpts<'a> {
16270 #[builder(setter(into, strip_option), default)]
16272 pub include: Option<Vec<&'a str>>,
16273}
16274#[derive(Builder, Debug, PartialEq)]
16275pub struct WorkspaceServicesOpts<'a> {
16276 #[builder(setter(into, strip_option), default)]
16278 pub include: Option<Vec<&'a str>>,
16279}
16280impl IntoID<Id> for Workspace {
16281 fn into_id(
16282 self,
16283 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16284 Box::pin(async move { self.id().await })
16285 }
16286}
16287impl Loadable for Workspace {
16288 fn graphql_type() -> &'static str {
16289 "Workspace"
16290 }
16291 fn from_query(
16292 proc: Option<Arc<DaggerSessionProc>>,
16293 selection: Selection,
16294 graphql_client: DynGraphQLClient,
16295 ) -> Self {
16296 Self {
16297 proc,
16298 selection,
16299 graphql_client,
16300 }
16301 }
16302}
16303impl Workspace {
16304 pub async fn address(&self) -> Result<String, DaggerError> {
16306 let query = self.selection.select("address");
16307 query.execute(self.graphql_client.clone()).await
16308 }
16309 pub fn checks(&self) -> CheckGroup {
16315 let query = self.selection.select("checks");
16316 CheckGroup {
16317 proc: self.proc.clone(),
16318 selection: query,
16319 graphql_client: self.graphql_client.clone(),
16320 }
16321 }
16322 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16328 let mut query = self.selection.select("checks");
16329 if let Some(include) = opts.include {
16330 query = query.arg("include", include);
16331 }
16332 if let Some(no_generate) = opts.no_generate {
16333 query = query.arg("noGenerate", no_generate);
16334 }
16335 if let Some(only_generate) = opts.only_generate {
16336 query = query.arg("onlyGenerate", only_generate);
16337 }
16338 CheckGroup {
16339 proc: self.proc.clone(),
16340 selection: query,
16341 graphql_client: self.graphql_client.clone(),
16342 }
16343 }
16344 pub async fn client_id(&self) -> Result<String, DaggerError> {
16346 let query = self.selection.select("clientId");
16347 query.execute(self.graphql_client.clone()).await
16348 }
16349 pub async fn config_path(&self) -> Result<String, DaggerError> {
16351 let query = self.selection.select("configPath");
16352 query.execute(self.graphql_client.clone()).await
16353 }
16354 pub fn directory(&self, path: impl Into<String>) -> Directory {
16362 let mut query = self.selection.select("directory");
16363 query = query.arg("path", path.into());
16364 Directory {
16365 proc: self.proc.clone(),
16366 selection: query,
16367 graphql_client: self.graphql_client.clone(),
16368 }
16369 }
16370 pub fn directory_opts<'a>(
16378 &self,
16379 path: impl Into<String>,
16380 opts: WorkspaceDirectoryOpts<'a>,
16381 ) -> Directory {
16382 let mut query = self.selection.select("directory");
16383 query = query.arg("path", path.into());
16384 if let Some(exclude) = opts.exclude {
16385 query = query.arg("exclude", exclude);
16386 }
16387 if let Some(include) = opts.include {
16388 query = query.arg("include", include);
16389 }
16390 if let Some(gitignore) = opts.gitignore {
16391 query = query.arg("gitignore", gitignore);
16392 }
16393 Directory {
16394 proc: self.proc.clone(),
16395 selection: query,
16396 graphql_client: self.graphql_client.clone(),
16397 }
16398 }
16399 pub fn file(&self, path: impl Into<String>) -> File {
16406 let mut query = self.selection.select("file");
16407 query = query.arg("path", path.into());
16408 File {
16409 proc: self.proc.clone(),
16410 selection: query,
16411 graphql_client: self.graphql_client.clone(),
16412 }
16413 }
16414 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16424 let mut query = self.selection.select("findUp");
16425 query = query.arg("name", name.into());
16426 query.execute(self.graphql_client.clone()).await
16427 }
16428 pub async fn find_up_opts<'a>(
16438 &self,
16439 name: impl Into<String>,
16440 opts: WorkspaceFindUpOpts<'a>,
16441 ) -> Result<String, DaggerError> {
16442 let mut query = self.selection.select("findUp");
16443 query = query.arg("name", name.into());
16444 if let Some(from) = opts.from {
16445 query = query.arg("from", from);
16446 }
16447 query.execute(self.graphql_client.clone()).await
16448 }
16449 pub fn generators(&self) -> GeneratorGroup {
16455 let query = self.selection.select("generators");
16456 GeneratorGroup {
16457 proc: self.proc.clone(),
16458 selection: query,
16459 graphql_client: self.graphql_client.clone(),
16460 }
16461 }
16462 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16468 let mut query = self.selection.select("generators");
16469 if let Some(include) = opts.include {
16470 query = query.arg("include", include);
16471 }
16472 GeneratorGroup {
16473 proc: self.proc.clone(),
16474 selection: query,
16475 graphql_client: self.graphql_client.clone(),
16476 }
16477 }
16478 pub async fn has_config(&self) -> Result<bool, DaggerError> {
16480 let query = self.selection.select("hasConfig");
16481 query.execute(self.graphql_client.clone()).await
16482 }
16483 pub async fn id(&self) -> Result<Id, DaggerError> {
16485 let query = self.selection.select("id");
16486 query.execute(self.graphql_client.clone()).await
16487 }
16488 pub async fn initialized(&self) -> Result<bool, DaggerError> {
16490 let query = self.selection.select("initialized");
16491 query.execute(self.graphql_client.clone()).await
16492 }
16493 pub async fn path(&self) -> Result<String, DaggerError> {
16495 let query = self.selection.select("path");
16496 query.execute(self.graphql_client.clone()).await
16497 }
16498 pub fn services(&self) -> UpGroup {
16504 let query = self.selection.select("services");
16505 UpGroup {
16506 proc: self.proc.clone(),
16507 selection: query,
16508 graphql_client: self.graphql_client.clone(),
16509 }
16510 }
16511 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16517 let mut query = self.selection.select("services");
16518 if let Some(include) = opts.include {
16519 query = query.arg("include", include);
16520 }
16521 UpGroup {
16522 proc: self.proc.clone(),
16523 selection: query,
16524 graphql_client: self.graphql_client.clone(),
16525 }
16526 }
16527 pub fn update(&self) -> Changeset {
16530 let query = self.selection.select("update");
16531 Changeset {
16532 proc: self.proc.clone(),
16533 selection: query,
16534 graphql_client: self.graphql_client.clone(),
16535 }
16536 }
16537}
16538impl Node for Workspace {
16539 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16540 let query = self.selection.select("id");
16541 let graphql_client = self.graphql_client.clone();
16542 async move { query.execute(graphql_client).await }
16543 }
16544}
16545#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16546pub enum CacheSharingMode {
16547 #[serde(rename = "LOCKED")]
16548 Locked,
16549 #[serde(rename = "PRIVATE")]
16550 Private,
16551 #[serde(rename = "SHARED")]
16552 Shared,
16553}
16554#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16555pub enum ChangesetMergeConflict {
16556 #[serde(rename = "FAIL")]
16557 Fail,
16558 #[serde(rename = "FAIL_EARLY")]
16559 FailEarly,
16560 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16561 LeaveConflictMarkers,
16562 #[serde(rename = "PREFER_OURS")]
16563 PreferOurs,
16564 #[serde(rename = "PREFER_THEIRS")]
16565 PreferTheirs,
16566}
16567#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16568pub enum ChangesetsMergeConflict {
16569 #[serde(rename = "FAIL")]
16570 Fail,
16571 #[serde(rename = "FAIL_EARLY")]
16572 FailEarly,
16573}
16574#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16575pub enum DiffStatKind {
16576 #[serde(rename = "ADDED")]
16577 Added,
16578 #[serde(rename = "MODIFIED")]
16579 Modified,
16580 #[serde(rename = "REMOVED")]
16581 Removed,
16582 #[serde(rename = "RENAMED")]
16583 Renamed,
16584}
16585#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16586pub enum ExistsType {
16587 #[serde(rename = "DIRECTORY_TYPE")]
16588 DirectoryType,
16589 #[serde(rename = "REGULAR_TYPE")]
16590 RegularType,
16591 #[serde(rename = "SYMLINK_TYPE")]
16592 SymlinkType,
16593}
16594#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16595pub enum FileType {
16596 #[serde(rename = "DIRECTORY")]
16597 Directory,
16598 #[serde(rename = "DIRECTORY_TYPE")]
16599 DirectoryType,
16600 #[serde(rename = "REGULAR")]
16601 Regular,
16602 #[serde(rename = "REGULAR_TYPE")]
16603 RegularType,
16604 #[serde(rename = "SYMLINK")]
16605 Symlink,
16606 #[serde(rename = "SYMLINK_TYPE")]
16607 SymlinkType,
16608 #[serde(rename = "UNKNOWN")]
16609 Unknown,
16610}
16611#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16612pub enum FunctionCachePolicy {
16613 #[serde(rename = "Default")]
16614 Default,
16615 #[serde(rename = "Never")]
16616 Never,
16617 #[serde(rename = "PerSession")]
16618 PerSession,
16619}
16620#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16621pub enum ImageLayerCompression {
16622 #[serde(rename = "EStarGZ")]
16623 EStarGz,
16624 #[serde(rename = "ESTARGZ")]
16625 Estargz,
16626 #[serde(rename = "Gzip")]
16627 Gzip,
16628 #[serde(rename = "Uncompressed")]
16629 Uncompressed,
16630 #[serde(rename = "Zstd")]
16631 Zstd,
16632}
16633#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16634pub enum ImageMediaTypes {
16635 #[serde(rename = "DOCKER")]
16636 Docker,
16637 #[serde(rename = "DockerMediaTypes")]
16638 DockerMediaTypes,
16639 #[serde(rename = "OCI")]
16640 Oci,
16641 #[serde(rename = "OCIMediaTypes")]
16642 OciMediaTypes,
16643}
16644#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16645pub enum ModuleSourceExperimentalFeature {
16646 #[serde(rename = "SELF_CALLS")]
16647 SelfCalls,
16648}
16649#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16650pub enum ModuleSourceKind {
16651 #[serde(rename = "DIR")]
16652 Dir,
16653 #[serde(rename = "DIR_SOURCE")]
16654 DirSource,
16655 #[serde(rename = "GIT")]
16656 Git,
16657 #[serde(rename = "GIT_SOURCE")]
16658 GitSource,
16659 #[serde(rename = "LOCAL")]
16660 Local,
16661 #[serde(rename = "LOCAL_SOURCE")]
16662 LocalSource,
16663}
16664#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16665pub enum NetworkProtocol {
16666 #[serde(rename = "TCP")]
16667 Tcp,
16668 #[serde(rename = "UDP")]
16669 Udp,
16670}
16671#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16672pub enum ReturnType {
16673 #[serde(rename = "ANY")]
16674 Any,
16675 #[serde(rename = "FAILURE")]
16676 Failure,
16677 #[serde(rename = "SUCCESS")]
16678 Success,
16679}
16680#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16681pub enum TypeDefKind {
16682 #[serde(rename = "BOOLEAN")]
16683 Boolean,
16684 #[serde(rename = "BOOLEAN_KIND")]
16685 BooleanKind,
16686 #[serde(rename = "ENUM")]
16687 Enum,
16688 #[serde(rename = "ENUM_KIND")]
16689 EnumKind,
16690 #[serde(rename = "FLOAT")]
16691 Float,
16692 #[serde(rename = "FLOAT_KIND")]
16693 FloatKind,
16694 #[serde(rename = "INPUT")]
16695 Input,
16696 #[serde(rename = "INPUT_KIND")]
16697 InputKind,
16698 #[serde(rename = "INTEGER")]
16699 Integer,
16700 #[serde(rename = "INTEGER_KIND")]
16701 IntegerKind,
16702 #[serde(rename = "INTERFACE")]
16703 Interface,
16704 #[serde(rename = "INTERFACE_KIND")]
16705 InterfaceKind,
16706 #[serde(rename = "LIST")]
16707 List,
16708 #[serde(rename = "LIST_KIND")]
16709 ListKind,
16710 #[serde(rename = "OBJECT")]
16711 Object,
16712 #[serde(rename = "OBJECT_KIND")]
16713 ObjectKind,
16714 #[serde(rename = "SCALAR")]
16715 Scalar,
16716 #[serde(rename = "SCALAR_KIND")]
16717 ScalarKind,
16718 #[serde(rename = "STRING")]
16719 String,
16720 #[serde(rename = "STRING_KIND")]
16721 StringKind,
16722 #[serde(rename = "VOID")]
16723 Void,
16724 #[serde(rename = "VOID_KIND")]
16725 VoidKind,
16726}