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 expected_type: Option<ExistsType>,
1549}
1550#[derive(Builder, Debug, PartialEq)]
1551pub struct ContainerExportOpts {
1552 #[builder(setter(into, strip_option), default)]
1554 pub expand: Option<bool>,
1555 #[builder(setter(into, strip_option), default)]
1558 pub forced_compression: Option<ImageLayerCompression>,
1559 #[builder(setter(into, strip_option), default)]
1562 pub media_types: Option<ImageMediaTypes>,
1563 #[builder(setter(into, strip_option), default)]
1566 pub platform_variants: Option<Vec<Id>>,
1567}
1568#[derive(Builder, Debug, PartialEq)]
1569pub struct ContainerExportImageOpts {
1570 #[builder(setter(into, strip_option), default)]
1573 pub forced_compression: Option<ImageLayerCompression>,
1574 #[builder(setter(into, strip_option), default)]
1577 pub media_types: Option<ImageMediaTypes>,
1578 #[builder(setter(into, strip_option), default)]
1581 pub platform_variants: Option<Vec<Id>>,
1582}
1583#[derive(Builder, Debug, PartialEq)]
1584pub struct ContainerFileOpts {
1585 #[builder(setter(into, strip_option), default)]
1587 pub expand: Option<bool>,
1588}
1589#[derive(Builder, Debug, PartialEq)]
1590pub struct ContainerImportOpts<'a> {
1591 #[builder(setter(into, strip_option), default)]
1593 pub tag: Option<&'a str>,
1594}
1595#[derive(Builder, Debug, PartialEq)]
1596pub struct ContainerPublishOpts {
1597 #[builder(setter(into, strip_option), default)]
1600 pub forced_compression: Option<ImageLayerCompression>,
1601 #[builder(setter(into, strip_option), default)]
1604 pub media_types: Option<ImageMediaTypes>,
1605 #[builder(setter(into, strip_option), default)]
1608 pub platform_variants: Option<Vec<Id>>,
1609}
1610#[derive(Builder, Debug, PartialEq)]
1611pub struct ContainerStatOpts {
1612 #[builder(setter(into, strip_option), default)]
1614 pub do_not_follow_symlinks: Option<bool>,
1615}
1616#[derive(Builder, Debug, PartialEq)]
1617pub struct ContainerTerminalOpts<'a> {
1618 #[builder(setter(into, strip_option), default)]
1620 pub cmd: Option<Vec<&'a str>>,
1621 #[builder(setter(into, strip_option), default)]
1623 pub experimental_privileged_nesting: Option<bool>,
1624 #[builder(setter(into, strip_option), default)]
1626 pub insecure_root_capabilities: Option<bool>,
1627}
1628#[derive(Builder, Debug, PartialEq)]
1629pub struct ContainerUpOpts<'a> {
1630 #[builder(setter(into, strip_option), default)]
1633 pub args: Option<Vec<&'a str>>,
1634 #[builder(setter(into, strip_option), default)]
1636 pub expand: Option<bool>,
1637 #[builder(setter(into, strip_option), default)]
1639 pub experimental_privileged_nesting: Option<bool>,
1640 #[builder(setter(into, strip_option), default)]
1642 pub insecure_root_capabilities: Option<bool>,
1643 #[builder(setter(into, strip_option), default)]
1646 pub no_init: Option<bool>,
1647 #[builder(setter(into, strip_option), default)]
1650 pub ports: Option<Vec<PortForward>>,
1651 #[builder(setter(into, strip_option), default)]
1653 pub random: Option<bool>,
1654 #[builder(setter(into, strip_option), default)]
1656 pub use_entrypoint: Option<bool>,
1657}
1658#[derive(Builder, Debug, PartialEq)]
1659pub struct ContainerWithDefaultTerminalCmdOpts {
1660 #[builder(setter(into, strip_option), default)]
1662 pub experimental_privileged_nesting: Option<bool>,
1663 #[builder(setter(into, strip_option), default)]
1665 pub insecure_root_capabilities: Option<bool>,
1666}
1667#[derive(Builder, Debug, PartialEq)]
1668pub struct ContainerWithDirectoryOpts<'a> {
1669 #[builder(setter(into, strip_option), default)]
1671 pub exclude: Option<Vec<&'a str>>,
1672 #[builder(setter(into, strip_option), default)]
1674 pub expand: Option<bool>,
1675 #[builder(setter(into, strip_option), default)]
1677 pub gitignore: Option<bool>,
1678 #[builder(setter(into, strip_option), default)]
1680 pub include: Option<Vec<&'a str>>,
1681 #[builder(setter(into, strip_option), default)]
1685 pub owner: Option<&'a str>,
1686 #[builder(setter(into, strip_option), default)]
1687 pub permissions: Option<isize>,
1688}
1689#[derive(Builder, Debug, PartialEq)]
1690pub struct ContainerWithDockerHealthcheckOpts<'a> {
1691 #[builder(setter(into, strip_option), default)]
1693 pub interval: Option<&'a str>,
1694 #[builder(setter(into, strip_option), default)]
1696 pub retries: Option<isize>,
1697 #[builder(setter(into, strip_option), default)]
1699 pub shell: Option<bool>,
1700 #[builder(setter(into, strip_option), default)]
1702 pub start_interval: Option<&'a str>,
1703 #[builder(setter(into, strip_option), default)]
1705 pub start_period: Option<&'a str>,
1706 #[builder(setter(into, strip_option), default)]
1708 pub timeout: Option<&'a str>,
1709}
1710#[derive(Builder, Debug, PartialEq)]
1711pub struct ContainerWithEntrypointOpts {
1712 #[builder(setter(into, strip_option), default)]
1714 pub keep_default_args: Option<bool>,
1715}
1716#[derive(Builder, Debug, PartialEq)]
1717pub struct ContainerWithEnvVariableOpts {
1718 #[builder(setter(into, strip_option), default)]
1720 pub expand: Option<bool>,
1721}
1722#[derive(Builder, Debug, PartialEq)]
1723pub struct ContainerWithExecOpts<'a> {
1724 #[builder(setter(into, strip_option), default)]
1726 pub expand: Option<bool>,
1727 #[builder(setter(into, strip_option), default)]
1729 pub expect: Option<ReturnType>,
1730 #[builder(setter(into, strip_option), default)]
1732 pub experimental_privileged_nesting: Option<bool>,
1733 #[builder(setter(into, strip_option), default)]
1736 pub insecure_root_capabilities: Option<bool>,
1737 #[builder(setter(into, strip_option), default)]
1740 pub no_init: Option<bool>,
1741 #[builder(setter(into, strip_option), default)]
1743 pub redirect_stderr: Option<&'a str>,
1744 #[builder(setter(into, strip_option), default)]
1746 pub redirect_stdin: Option<&'a str>,
1747 #[builder(setter(into, strip_option), default)]
1749 pub redirect_stdout: Option<&'a str>,
1750 #[builder(setter(into, strip_option), default)]
1752 pub stdin: Option<&'a str>,
1753 #[builder(setter(into, strip_option), default)]
1755 pub use_entrypoint: Option<bool>,
1756}
1757#[derive(Builder, Debug, PartialEq)]
1758pub struct ContainerWithExposedPortOpts<'a> {
1759 #[builder(setter(into, strip_option), default)]
1761 pub description: Option<&'a str>,
1762 #[builder(setter(into, strip_option), default)]
1764 pub experimental_skip_healthcheck: Option<bool>,
1765 #[builder(setter(into, strip_option), default)]
1767 pub protocol: Option<NetworkProtocol>,
1768}
1769#[derive(Builder, Debug, PartialEq)]
1770pub struct ContainerWithFileOpts<'a> {
1771 #[builder(setter(into, strip_option), default)]
1773 pub expand: Option<bool>,
1774 #[builder(setter(into, strip_option), default)]
1778 pub owner: Option<&'a str>,
1779 #[builder(setter(into, strip_option), default)]
1781 pub permissions: Option<isize>,
1782}
1783#[derive(Builder, Debug, PartialEq)]
1784pub struct ContainerWithFilesOpts<'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 ContainerWithMountedCacheOpts<'a> {
1799 #[builder(setter(into, strip_option), default)]
1801 pub expand: Option<bool>,
1802 #[builder(setter(into, strip_option), default)]
1807 pub owner: Option<&'a str>,
1808 #[builder(setter(into, strip_option), default)]
1810 pub sharing: Option<CacheSharingMode>,
1811 #[builder(setter(into, strip_option), default)]
1813 pub source: Option<Id>,
1814}
1815#[derive(Builder, Debug, PartialEq)]
1816pub struct ContainerWithMountedDirectoryOpts<'a> {
1817 #[builder(setter(into, strip_option), default)]
1819 pub expand: Option<bool>,
1820 #[builder(setter(into, strip_option), default)]
1824 pub owner: Option<&'a str>,
1825 #[builder(setter(into, strip_option), default)]
1827 pub read_only: Option<bool>,
1828}
1829#[derive(Builder, Debug, PartialEq)]
1830pub struct ContainerWithMountedFileOpts<'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}
1840#[derive(Builder, Debug, PartialEq)]
1841pub struct ContainerWithMountedSecretOpts<'a> {
1842 #[builder(setter(into, strip_option), default)]
1844 pub expand: Option<bool>,
1845 #[builder(setter(into, strip_option), default)]
1848 pub mode: Option<isize>,
1849 #[builder(setter(into, strip_option), default)]
1853 pub owner: Option<&'a str>,
1854}
1855#[derive(Builder, Debug, PartialEq)]
1856pub struct ContainerWithMountedTempOpts {
1857 #[builder(setter(into, strip_option), default)]
1859 pub expand: Option<bool>,
1860 #[builder(setter(into, strip_option), default)]
1862 pub size: Option<isize>,
1863}
1864#[derive(Builder, Debug, PartialEq)]
1865pub struct ContainerWithNewFileOpts<'a> {
1866 #[builder(setter(into, strip_option), default)]
1868 pub expand: Option<bool>,
1869 #[builder(setter(into, strip_option), default)]
1873 pub owner: Option<&'a str>,
1874 #[builder(setter(into, strip_option), default)]
1876 pub permissions: Option<isize>,
1877}
1878#[derive(Builder, Debug, PartialEq)]
1879pub struct ContainerWithSymlinkOpts {
1880 #[builder(setter(into, strip_option), default)]
1882 pub expand: Option<bool>,
1883}
1884#[derive(Builder, Debug, PartialEq)]
1885pub struct ContainerWithUnixSocketOpts<'a> {
1886 #[builder(setter(into, strip_option), default)]
1888 pub expand: Option<bool>,
1889 #[builder(setter(into, strip_option), default)]
1893 pub owner: Option<&'a str>,
1894}
1895#[derive(Builder, Debug, PartialEq)]
1896pub struct ContainerWithWorkdirOpts {
1897 #[builder(setter(into, strip_option), default)]
1899 pub expand: Option<bool>,
1900}
1901#[derive(Builder, Debug, PartialEq)]
1902pub struct ContainerWithoutDirectoryOpts {
1903 #[builder(setter(into, strip_option), default)]
1905 pub expand: Option<bool>,
1906}
1907#[derive(Builder, Debug, PartialEq)]
1908pub struct ContainerWithoutEntrypointOpts {
1909 #[builder(setter(into, strip_option), default)]
1911 pub keep_default_args: Option<bool>,
1912}
1913#[derive(Builder, Debug, PartialEq)]
1914pub struct ContainerWithoutExposedPortOpts {
1915 #[builder(setter(into, strip_option), default)]
1917 pub protocol: Option<NetworkProtocol>,
1918}
1919#[derive(Builder, Debug, PartialEq)]
1920pub struct ContainerWithoutFileOpts {
1921 #[builder(setter(into, strip_option), default)]
1923 pub expand: Option<bool>,
1924}
1925#[derive(Builder, Debug, PartialEq)]
1926pub struct ContainerWithoutFilesOpts {
1927 #[builder(setter(into, strip_option), default)]
1929 pub expand: Option<bool>,
1930}
1931#[derive(Builder, Debug, PartialEq)]
1932pub struct ContainerWithoutMountOpts {
1933 #[builder(setter(into, strip_option), default)]
1935 pub expand: Option<bool>,
1936}
1937#[derive(Builder, Debug, PartialEq)]
1938pub struct ContainerWithoutUnixSocketOpts {
1939 #[builder(setter(into, strip_option), default)]
1941 pub expand: Option<bool>,
1942}
1943impl IntoID<Id> for Container {
1944 fn into_id(
1945 self,
1946 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1947 Box::pin(async move { self.id().await })
1948 }
1949}
1950impl Loadable for Container {
1951 fn graphql_type() -> &'static str {
1952 "Container"
1953 }
1954 fn from_query(
1955 proc: Option<Arc<DaggerSessionProc>>,
1956 selection: Selection,
1957 graphql_client: DynGraphQLClient,
1958 ) -> Self {
1959 Self {
1960 proc,
1961 selection,
1962 graphql_client,
1963 }
1964 }
1965}
1966impl Container {
1967 pub fn as_service(&self) -> Service {
1974 let query = self.selection.select("asService");
1975 Service {
1976 proc: self.proc.clone(),
1977 selection: query,
1978 graphql_client: self.graphql_client.clone(),
1979 }
1980 }
1981 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1988 let mut query = self.selection.select("asService");
1989 if let Some(args) = opts.args {
1990 query = query.arg("args", args);
1991 }
1992 if let Some(use_entrypoint) = opts.use_entrypoint {
1993 query = query.arg("useEntrypoint", use_entrypoint);
1994 }
1995 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1996 query = query.arg(
1997 "experimentalPrivilegedNesting",
1998 experimental_privileged_nesting,
1999 );
2000 }
2001 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2002 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2003 }
2004 if let Some(expand) = opts.expand {
2005 query = query.arg("expand", expand);
2006 }
2007 if let Some(no_init) = opts.no_init {
2008 query = query.arg("noInit", no_init);
2009 }
2010 Service {
2011 proc: self.proc.clone(),
2012 selection: query,
2013 graphql_client: self.graphql_client.clone(),
2014 }
2015 }
2016 pub fn as_tarball(&self) -> File {
2022 let query = self.selection.select("asTarball");
2023 File {
2024 proc: self.proc.clone(),
2025 selection: query,
2026 graphql_client: self.graphql_client.clone(),
2027 }
2028 }
2029 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2035 let mut query = self.selection.select("asTarball");
2036 if let Some(platform_variants) = opts.platform_variants {
2037 query = query.arg("platformVariants", platform_variants);
2038 }
2039 if let Some(forced_compression) = opts.forced_compression {
2040 query = query.arg("forcedCompression", forced_compression);
2041 }
2042 if let Some(media_types) = opts.media_types {
2043 query = query.arg("mediaTypes", media_types);
2044 }
2045 File {
2046 proc: self.proc.clone(),
2047 selection: query,
2048 graphql_client: self.graphql_client.clone(),
2049 }
2050 }
2051 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2054 let query = self.selection.select("combinedOutput");
2055 query.execute(self.graphql_client.clone()).await
2056 }
2057 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2059 let query = self.selection.select("defaultArgs");
2060 query.execute(self.graphql_client.clone()).await
2061 }
2062 pub fn directory(&self, path: impl Into<String>) -> Directory {
2070 let mut query = self.selection.select("directory");
2071 query = query.arg("path", path.into());
2072 Directory {
2073 proc: self.proc.clone(),
2074 selection: query,
2075 graphql_client: self.graphql_client.clone(),
2076 }
2077 }
2078 pub fn directory_opts(
2086 &self,
2087 path: impl Into<String>,
2088 opts: ContainerDirectoryOpts,
2089 ) -> Directory {
2090 let mut query = self.selection.select("directory");
2091 query = query.arg("path", path.into());
2092 if let Some(expand) = opts.expand {
2093 query = query.arg("expand", expand);
2094 }
2095 Directory {
2096 proc: self.proc.clone(),
2097 selection: query,
2098 graphql_client: self.graphql_client.clone(),
2099 }
2100 }
2101 pub fn docker_healthcheck(&self) -> HealthcheckConfig {
2103 let query = self.selection.select("dockerHealthcheck");
2104 HealthcheckConfig {
2105 proc: self.proc.clone(),
2106 selection: query,
2107 graphql_client: self.graphql_client.clone(),
2108 }
2109 }
2110 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2112 let query = self.selection.select("entrypoint");
2113 query.execute(self.graphql_client.clone()).await
2114 }
2115 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2121 let mut query = self.selection.select("envVariable");
2122 query = query.arg("name", name.into());
2123 query.execute(self.graphql_client.clone()).await
2124 }
2125 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2127 let query = self.selection.select("envVariables");
2128 let query = query.select("id");
2129 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2130 Ok(ids
2131 .into_iter()
2132 .map(|id| EnvVariable {
2133 proc: self.proc.clone(),
2134 selection: crate::querybuilder::query()
2135 .select("node")
2136 .arg("id", &id.0)
2137 .inline_fragment("EnvVariable"),
2138 graphql_client: self.graphql_client.clone(),
2139 })
2140 .collect())
2141 }
2142 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2149 let mut query = self.selection.select("exists");
2150 query = query.arg("path", path.into());
2151 query.execute(self.graphql_client.clone()).await
2152 }
2153 pub async fn exists_opts(
2160 &self,
2161 path: impl Into<String>,
2162 opts: ContainerExistsOpts,
2163 ) -> Result<bool, DaggerError> {
2164 let mut query = self.selection.select("exists");
2165 query = query.arg("path", path.into());
2166 if let Some(expected_type) = opts.expected_type {
2167 query = query.arg("expectedType", expected_type);
2168 }
2169 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2170 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2171 }
2172 query.execute(self.graphql_client.clone()).await
2173 }
2174 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2177 let query = self.selection.select("exitCode");
2178 query.execute(self.graphql_client.clone()).await
2179 }
2180 pub fn experimental_with_all_gp_us(&self) -> Container {
2184 let query = self.selection.select("experimentalWithAllGPUs");
2185 Container {
2186 proc: self.proc.clone(),
2187 selection: query,
2188 graphql_client: self.graphql_client.clone(),
2189 }
2190 }
2191 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2199 let mut query = self.selection.select("experimentalWithGPU");
2200 query = query.arg(
2201 "devices",
2202 devices
2203 .into_iter()
2204 .map(|i| i.into())
2205 .collect::<Vec<String>>(),
2206 );
2207 Container {
2208 proc: self.proc.clone(),
2209 selection: query,
2210 graphql_client: self.graphql_client.clone(),
2211 }
2212 }
2213 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2223 let mut query = self.selection.select("export");
2224 query = query.arg("path", path.into());
2225 query.execute(self.graphql_client.clone()).await
2226 }
2227 pub async fn export_opts(
2237 &self,
2238 path: impl Into<String>,
2239 opts: ContainerExportOpts,
2240 ) -> Result<String, DaggerError> {
2241 let mut query = self.selection.select("export");
2242 query = query.arg("path", path.into());
2243 if let Some(platform_variants) = opts.platform_variants {
2244 query = query.arg("platformVariants", platform_variants);
2245 }
2246 if let Some(forced_compression) = opts.forced_compression {
2247 query = query.arg("forcedCompression", forced_compression);
2248 }
2249 if let Some(media_types) = opts.media_types {
2250 query = query.arg("mediaTypes", media_types);
2251 }
2252 if let Some(expand) = opts.expand {
2253 query = query.arg("expand", expand);
2254 }
2255 query.execute(self.graphql_client.clone()).await
2256 }
2257 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2264 let mut query = self.selection.select("exportImage");
2265 query = query.arg("name", name.into());
2266 query.execute(self.graphql_client.clone()).await
2267 }
2268 pub async fn export_image_opts(
2275 &self,
2276 name: impl Into<String>,
2277 opts: ContainerExportImageOpts,
2278 ) -> Result<Void, DaggerError> {
2279 let mut query = self.selection.select("exportImage");
2280 query = query.arg("name", name.into());
2281 if let Some(platform_variants) = opts.platform_variants {
2282 query = query.arg("platformVariants", platform_variants);
2283 }
2284 if let Some(forced_compression) = opts.forced_compression {
2285 query = query.arg("forcedCompression", forced_compression);
2286 }
2287 if let Some(media_types) = opts.media_types {
2288 query = query.arg("mediaTypes", media_types);
2289 }
2290 query.execute(self.graphql_client.clone()).await
2291 }
2292 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2295 let query = self.selection.select("exposedPorts");
2296 let query = query.select("id");
2297 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2298 Ok(ids
2299 .into_iter()
2300 .map(|id| Port {
2301 proc: self.proc.clone(),
2302 selection: crate::querybuilder::query()
2303 .select("node")
2304 .arg("id", &id.0)
2305 .inline_fragment("Port"),
2306 graphql_client: self.graphql_client.clone(),
2307 })
2308 .collect())
2309 }
2310 pub fn file(&self, path: impl Into<String>) -> File {
2318 let mut query = self.selection.select("file");
2319 query = query.arg("path", path.into());
2320 File {
2321 proc: self.proc.clone(),
2322 selection: query,
2323 graphql_client: self.graphql_client.clone(),
2324 }
2325 }
2326 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2334 let mut query = self.selection.select("file");
2335 query = query.arg("path", path.into());
2336 if let Some(expand) = opts.expand {
2337 query = query.arg("expand", expand);
2338 }
2339 File {
2340 proc: self.proc.clone(),
2341 selection: query,
2342 graphql_client: self.graphql_client.clone(),
2343 }
2344 }
2345 pub fn from(&self, address: impl Into<String>) -> Container {
2351 let mut query = self.selection.select("from");
2352 query = query.arg("address", address.into());
2353 Container {
2354 proc: self.proc.clone(),
2355 selection: query,
2356 graphql_client: self.graphql_client.clone(),
2357 }
2358 }
2359 pub async fn id(&self) -> Result<Id, DaggerError> {
2361 let query = self.selection.select("id");
2362 query.execute(self.graphql_client.clone()).await
2363 }
2364 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2366 let query = self.selection.select("imageRef");
2367 query.execute(self.graphql_client.clone()).await
2368 }
2369 pub fn import(&self, source: impl IntoID<Id>) -> Container {
2376 let mut query = self.selection.select("import");
2377 query = query.arg_lazy(
2378 "source",
2379 Box::new(move || {
2380 let source = source.clone();
2381 Box::pin(async move { source.into_id().await.unwrap().quote() })
2382 }),
2383 );
2384 Container {
2385 proc: self.proc.clone(),
2386 selection: query,
2387 graphql_client: self.graphql_client.clone(),
2388 }
2389 }
2390 pub fn import_opts<'a>(
2397 &self,
2398 source: impl IntoID<Id>,
2399 opts: ContainerImportOpts<'a>,
2400 ) -> Container {
2401 let mut query = self.selection.select("import");
2402 query = query.arg_lazy(
2403 "source",
2404 Box::new(move || {
2405 let source = source.clone();
2406 Box::pin(async move { source.into_id().await.unwrap().quote() })
2407 }),
2408 );
2409 if let Some(tag) = opts.tag {
2410 query = query.arg("tag", tag);
2411 }
2412 Container {
2413 proc: self.proc.clone(),
2414 selection: query,
2415 graphql_client: self.graphql_client.clone(),
2416 }
2417 }
2418 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2424 let mut query = self.selection.select("label");
2425 query = query.arg("name", name.into());
2426 query.execute(self.graphql_client.clone()).await
2427 }
2428 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2430 let query = self.selection.select("labels");
2431 let query = query.select("id");
2432 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2433 Ok(ids
2434 .into_iter()
2435 .map(|id| Label {
2436 proc: self.proc.clone(),
2437 selection: crate::querybuilder::query()
2438 .select("node")
2439 .arg("id", &id.0)
2440 .inline_fragment("Label"),
2441 graphql_client: self.graphql_client.clone(),
2442 })
2443 .collect())
2444 }
2445 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2447 let query = self.selection.select("mounts");
2448 query.execute(self.graphql_client.clone()).await
2449 }
2450 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2452 let query = self.selection.select("platform");
2453 query.execute(self.graphql_client.clone()).await
2454 }
2455 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2465 let mut query = self.selection.select("publish");
2466 query = query.arg("address", address.into());
2467 query.execute(self.graphql_client.clone()).await
2468 }
2469 pub async fn publish_opts(
2479 &self,
2480 address: impl Into<String>,
2481 opts: ContainerPublishOpts,
2482 ) -> Result<String, DaggerError> {
2483 let mut query = self.selection.select("publish");
2484 query = query.arg("address", address.into());
2485 if let Some(platform_variants) = opts.platform_variants {
2486 query = query.arg("platformVariants", platform_variants);
2487 }
2488 if let Some(forced_compression) = opts.forced_compression {
2489 query = query.arg("forcedCompression", forced_compression);
2490 }
2491 if let Some(media_types) = opts.media_types {
2492 query = query.arg("mediaTypes", media_types);
2493 }
2494 query.execute(self.graphql_client.clone()).await
2495 }
2496 pub fn rootfs(&self) -> Directory {
2498 let query = self.selection.select("rootfs");
2499 Directory {
2500 proc: self.proc.clone(),
2501 selection: query,
2502 graphql_client: self.graphql_client.clone(),
2503 }
2504 }
2505 pub fn stat(&self, path: impl Into<String>) -> Stat {
2512 let mut query = self.selection.select("stat");
2513 query = query.arg("path", path.into());
2514 Stat {
2515 proc: self.proc.clone(),
2516 selection: query,
2517 graphql_client: self.graphql_client.clone(),
2518 }
2519 }
2520 pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
2527 let mut query = self.selection.select("stat");
2528 query = query.arg("path", path.into());
2529 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2530 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2531 }
2532 Stat {
2533 proc: self.proc.clone(),
2534 selection: query,
2535 graphql_client: self.graphql_client.clone(),
2536 }
2537 }
2538 pub async fn stderr(&self) -> Result<String, DaggerError> {
2541 let query = self.selection.select("stderr");
2542 query.execute(self.graphql_client.clone()).await
2543 }
2544 pub async fn stdout(&self) -> Result<String, DaggerError> {
2547 let query = self.selection.select("stdout");
2548 query.execute(self.graphql_client.clone()).await
2549 }
2550 pub async fn sync(&self) -> Result<Container, DaggerError> {
2553 let query = self.selection.select("sync");
2554 let id: Id = query.execute(self.graphql_client.clone()).await?;
2555 Ok(Container {
2556 proc: self.proc.clone(),
2557 selection: query
2558 .root()
2559 .select("node")
2560 .arg("id", &id.0)
2561 .inline_fragment("Container"),
2562 graphql_client: self.graphql_client.clone(),
2563 })
2564 }
2565 pub fn terminal(&self) -> Container {
2571 let query = self.selection.select("terminal");
2572 Container {
2573 proc: self.proc.clone(),
2574 selection: query,
2575 graphql_client: self.graphql_client.clone(),
2576 }
2577 }
2578 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2584 let mut query = self.selection.select("terminal");
2585 if let Some(cmd) = opts.cmd {
2586 query = query.arg("cmd", cmd);
2587 }
2588 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2589 query = query.arg(
2590 "experimentalPrivilegedNesting",
2591 experimental_privileged_nesting,
2592 );
2593 }
2594 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2595 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2596 }
2597 Container {
2598 proc: self.proc.clone(),
2599 selection: query,
2600 graphql_client: self.graphql_client.clone(),
2601 }
2602 }
2603 pub async fn up(&self) -> Result<Void, DaggerError> {
2610 let query = self.selection.select("up");
2611 query.execute(self.graphql_client.clone()).await
2612 }
2613 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2620 let mut query = self.selection.select("up");
2621 if let Some(random) = opts.random {
2622 query = query.arg("random", random);
2623 }
2624 if let Some(ports) = opts.ports {
2625 query = query.arg("ports", ports);
2626 }
2627 if let Some(args) = opts.args {
2628 query = query.arg("args", args);
2629 }
2630 if let Some(use_entrypoint) = opts.use_entrypoint {
2631 query = query.arg("useEntrypoint", use_entrypoint);
2632 }
2633 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2634 query = query.arg(
2635 "experimentalPrivilegedNesting",
2636 experimental_privileged_nesting,
2637 );
2638 }
2639 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2640 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2641 }
2642 if let Some(expand) = opts.expand {
2643 query = query.arg("expand", expand);
2644 }
2645 if let Some(no_init) = opts.no_init {
2646 query = query.arg("noInit", no_init);
2647 }
2648 query.execute(self.graphql_client.clone()).await
2649 }
2650 pub async fn user(&self) -> Result<String, DaggerError> {
2652 let query = self.selection.select("user");
2653 query.execute(self.graphql_client.clone()).await
2654 }
2655 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2662 let mut query = self.selection.select("withAnnotation");
2663 query = query.arg("name", name.into());
2664 query = query.arg("value", value.into());
2665 Container {
2666 proc: self.proc.clone(),
2667 selection: query,
2668 graphql_client: self.graphql_client.clone(),
2669 }
2670 }
2671 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2677 let mut query = self.selection.select("withDefaultArgs");
2678 query = query.arg(
2679 "args",
2680 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2681 );
2682 Container {
2683 proc: self.proc.clone(),
2684 selection: query,
2685 graphql_client: self.graphql_client.clone(),
2686 }
2687 }
2688 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2695 let mut query = self.selection.select("withDefaultTerminalCmd");
2696 query = query.arg(
2697 "args",
2698 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2699 );
2700 Container {
2701 proc: self.proc.clone(),
2702 selection: query,
2703 graphql_client: self.graphql_client.clone(),
2704 }
2705 }
2706 pub fn with_default_terminal_cmd_opts(
2713 &self,
2714 args: Vec<impl Into<String>>,
2715 opts: ContainerWithDefaultTerminalCmdOpts,
2716 ) -> Container {
2717 let mut query = self.selection.select("withDefaultTerminalCmd");
2718 query = query.arg(
2719 "args",
2720 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2721 );
2722 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2723 query = query.arg(
2724 "experimentalPrivilegedNesting",
2725 experimental_privileged_nesting,
2726 );
2727 }
2728 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2729 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2730 }
2731 Container {
2732 proc: self.proc.clone(),
2733 selection: query,
2734 graphql_client: self.graphql_client.clone(),
2735 }
2736 }
2737 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2745 let mut query = self.selection.select("withDirectory");
2746 query = query.arg("path", path.into());
2747 query = query.arg_lazy(
2748 "source",
2749 Box::new(move || {
2750 let source = source.clone();
2751 Box::pin(async move { source.into_id().await.unwrap().quote() })
2752 }),
2753 );
2754 Container {
2755 proc: self.proc.clone(),
2756 selection: query,
2757 graphql_client: self.graphql_client.clone(),
2758 }
2759 }
2760 pub fn with_directory_opts<'a>(
2768 &self,
2769 path: impl Into<String>,
2770 source: impl IntoID<Id>,
2771 opts: ContainerWithDirectoryOpts<'a>,
2772 ) -> Container {
2773 let mut query = self.selection.select("withDirectory");
2774 query = query.arg("path", path.into());
2775 query = query.arg_lazy(
2776 "source",
2777 Box::new(move || {
2778 let source = source.clone();
2779 Box::pin(async move { source.into_id().await.unwrap().quote() })
2780 }),
2781 );
2782 if let Some(exclude) = opts.exclude {
2783 query = query.arg("exclude", exclude);
2784 }
2785 if let Some(include) = opts.include {
2786 query = query.arg("include", include);
2787 }
2788 if let Some(gitignore) = opts.gitignore {
2789 query = query.arg("gitignore", gitignore);
2790 }
2791 if let Some(owner) = opts.owner {
2792 query = query.arg("owner", owner);
2793 }
2794 if let Some(expand) = opts.expand {
2795 query = query.arg("expand", expand);
2796 }
2797 if let Some(permissions) = opts.permissions {
2798 query = query.arg("permissions", permissions);
2799 }
2800 Container {
2801 proc: self.proc.clone(),
2802 selection: query,
2803 graphql_client: self.graphql_client.clone(),
2804 }
2805 }
2806 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2813 let mut query = self.selection.select("withDockerHealthcheck");
2814 query = query.arg(
2815 "args",
2816 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2817 );
2818 Container {
2819 proc: self.proc.clone(),
2820 selection: query,
2821 graphql_client: self.graphql_client.clone(),
2822 }
2823 }
2824 pub fn with_docker_healthcheck_opts<'a>(
2831 &self,
2832 args: Vec<impl Into<String>>,
2833 opts: ContainerWithDockerHealthcheckOpts<'a>,
2834 ) -> Container {
2835 let mut query = self.selection.select("withDockerHealthcheck");
2836 query = query.arg(
2837 "args",
2838 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2839 );
2840 if let Some(shell) = opts.shell {
2841 query = query.arg("shell", shell);
2842 }
2843 if let Some(interval) = opts.interval {
2844 query = query.arg("interval", interval);
2845 }
2846 if let Some(timeout) = opts.timeout {
2847 query = query.arg("timeout", timeout);
2848 }
2849 if let Some(start_period) = opts.start_period {
2850 query = query.arg("startPeriod", start_period);
2851 }
2852 if let Some(start_interval) = opts.start_interval {
2853 query = query.arg("startInterval", start_interval);
2854 }
2855 if let Some(retries) = opts.retries {
2856 query = query.arg("retries", retries);
2857 }
2858 Container {
2859 proc: self.proc.clone(),
2860 selection: query,
2861 graphql_client: self.graphql_client.clone(),
2862 }
2863 }
2864 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2871 let mut query = self.selection.select("withEntrypoint");
2872 query = query.arg(
2873 "args",
2874 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2875 );
2876 Container {
2877 proc: self.proc.clone(),
2878 selection: query,
2879 graphql_client: self.graphql_client.clone(),
2880 }
2881 }
2882 pub fn with_entrypoint_opts(
2889 &self,
2890 args: Vec<impl Into<String>>,
2891 opts: ContainerWithEntrypointOpts,
2892 ) -> Container {
2893 let mut query = self.selection.select("withEntrypoint");
2894 query = query.arg(
2895 "args",
2896 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2897 );
2898 if let Some(keep_default_args) = opts.keep_default_args {
2899 query = query.arg("keepDefaultArgs", keep_default_args);
2900 }
2901 Container {
2902 proc: self.proc.clone(),
2903 selection: query,
2904 graphql_client: self.graphql_client.clone(),
2905 }
2906 }
2907 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2913 let mut query = self.selection.select("withEnvFileVariables");
2914 query = query.arg_lazy(
2915 "source",
2916 Box::new(move || {
2917 let source = source.clone();
2918 Box::pin(async move { source.into_id().await.unwrap().quote() })
2919 }),
2920 );
2921 Container {
2922 proc: self.proc.clone(),
2923 selection: query,
2924 graphql_client: self.graphql_client.clone(),
2925 }
2926 }
2927 pub fn with_env_variable(
2935 &self,
2936 name: impl Into<String>,
2937 value: impl Into<String>,
2938 ) -> Container {
2939 let mut query = self.selection.select("withEnvVariable");
2940 query = query.arg("name", name.into());
2941 query = query.arg("value", value.into());
2942 Container {
2943 proc: self.proc.clone(),
2944 selection: query,
2945 graphql_client: self.graphql_client.clone(),
2946 }
2947 }
2948 pub fn with_env_variable_opts(
2956 &self,
2957 name: impl Into<String>,
2958 value: impl Into<String>,
2959 opts: ContainerWithEnvVariableOpts,
2960 ) -> Container {
2961 let mut query = self.selection.select("withEnvVariable");
2962 query = query.arg("name", name.into());
2963 query = query.arg("value", value.into());
2964 if let Some(expand) = opts.expand {
2965 query = query.arg("expand", expand);
2966 }
2967 Container {
2968 proc: self.proc.clone(),
2969 selection: query,
2970 graphql_client: self.graphql_client.clone(),
2971 }
2972 }
2973 pub fn with_error(&self, err: impl Into<String>) -> Container {
2979 let mut query = self.selection.select("withError");
2980 query = query.arg("err", err.into());
2981 Container {
2982 proc: self.proc.clone(),
2983 selection: query,
2984 graphql_client: self.graphql_client.clone(),
2985 }
2986 }
2987 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
2998 let mut query = self.selection.select("withExec");
2999 query = query.arg(
3000 "args",
3001 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3002 );
3003 Container {
3004 proc: self.proc.clone(),
3005 selection: query,
3006 graphql_client: self.graphql_client.clone(),
3007 }
3008 }
3009 pub fn with_exec_opts<'a>(
3020 &self,
3021 args: Vec<impl Into<String>>,
3022 opts: ContainerWithExecOpts<'a>,
3023 ) -> Container {
3024 let mut query = self.selection.select("withExec");
3025 query = query.arg(
3026 "args",
3027 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3028 );
3029 if let Some(use_entrypoint) = opts.use_entrypoint {
3030 query = query.arg("useEntrypoint", use_entrypoint);
3031 }
3032 if let Some(stdin) = opts.stdin {
3033 query = query.arg("stdin", stdin);
3034 }
3035 if let Some(redirect_stdin) = opts.redirect_stdin {
3036 query = query.arg("redirectStdin", redirect_stdin);
3037 }
3038 if let Some(redirect_stdout) = opts.redirect_stdout {
3039 query = query.arg("redirectStdout", redirect_stdout);
3040 }
3041 if let Some(redirect_stderr) = opts.redirect_stderr {
3042 query = query.arg("redirectStderr", redirect_stderr);
3043 }
3044 if let Some(expect) = opts.expect {
3045 query = query.arg("expect", expect);
3046 }
3047 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3048 query = query.arg(
3049 "experimentalPrivilegedNesting",
3050 experimental_privileged_nesting,
3051 );
3052 }
3053 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3054 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3055 }
3056 if let Some(expand) = opts.expand {
3057 query = query.arg("expand", expand);
3058 }
3059 if let Some(no_init) = opts.no_init {
3060 query = query.arg("noInit", no_init);
3061 }
3062 Container {
3063 proc: self.proc.clone(),
3064 selection: query,
3065 graphql_client: self.graphql_client.clone(),
3066 }
3067 }
3068 pub fn with_exposed_port(&self, port: isize) -> Container {
3078 let mut query = self.selection.select("withExposedPort");
3079 query = query.arg("port", port);
3080 Container {
3081 proc: self.proc.clone(),
3082 selection: query,
3083 graphql_client: self.graphql_client.clone(),
3084 }
3085 }
3086 pub fn with_exposed_port_opts<'a>(
3096 &self,
3097 port: isize,
3098 opts: ContainerWithExposedPortOpts<'a>,
3099 ) -> Container {
3100 let mut query = self.selection.select("withExposedPort");
3101 query = query.arg("port", port);
3102 if let Some(protocol) = opts.protocol {
3103 query = query.arg("protocol", protocol);
3104 }
3105 if let Some(description) = opts.description {
3106 query = query.arg("description", description);
3107 }
3108 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3109 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3110 }
3111 Container {
3112 proc: self.proc.clone(),
3113 selection: query,
3114 graphql_client: self.graphql_client.clone(),
3115 }
3116 }
3117 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3125 let mut query = self.selection.select("withFile");
3126 query = query.arg("path", path.into());
3127 query = query.arg_lazy(
3128 "source",
3129 Box::new(move || {
3130 let source = source.clone();
3131 Box::pin(async move { source.into_id().await.unwrap().quote() })
3132 }),
3133 );
3134 Container {
3135 proc: self.proc.clone(),
3136 selection: query,
3137 graphql_client: self.graphql_client.clone(),
3138 }
3139 }
3140 pub fn with_file_opts<'a>(
3148 &self,
3149 path: impl Into<String>,
3150 source: impl IntoID<Id>,
3151 opts: ContainerWithFileOpts<'a>,
3152 ) -> Container {
3153 let mut query = self.selection.select("withFile");
3154 query = query.arg("path", path.into());
3155 query = query.arg_lazy(
3156 "source",
3157 Box::new(move || {
3158 let source = source.clone();
3159 Box::pin(async move { source.into_id().await.unwrap().quote() })
3160 }),
3161 );
3162 if let Some(permissions) = opts.permissions {
3163 query = query.arg("permissions", permissions);
3164 }
3165 if let Some(owner) = opts.owner {
3166 query = query.arg("owner", owner);
3167 }
3168 if let Some(expand) = opts.expand {
3169 query = query.arg("expand", expand);
3170 }
3171 Container {
3172 proc: self.proc.clone(),
3173 selection: query,
3174 graphql_client: self.graphql_client.clone(),
3175 }
3176 }
3177 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3185 let mut query = self.selection.select("withFiles");
3186 query = query.arg("path", path.into());
3187 query = query.arg("sources", sources);
3188 Container {
3189 proc: self.proc.clone(),
3190 selection: query,
3191 graphql_client: self.graphql_client.clone(),
3192 }
3193 }
3194 pub fn with_files_opts<'a>(
3202 &self,
3203 path: impl Into<String>,
3204 sources: Vec<Id>,
3205 opts: ContainerWithFilesOpts<'a>,
3206 ) -> Container {
3207 let mut query = self.selection.select("withFiles");
3208 query = query.arg("path", path.into());
3209 query = query.arg("sources", sources);
3210 if let Some(permissions) = opts.permissions {
3211 query = query.arg("permissions", permissions);
3212 }
3213 if let Some(owner) = opts.owner {
3214 query = query.arg("owner", owner);
3215 }
3216 if let Some(expand) = opts.expand {
3217 query = query.arg("expand", expand);
3218 }
3219 Container {
3220 proc: self.proc.clone(),
3221 selection: query,
3222 graphql_client: self.graphql_client.clone(),
3223 }
3224 }
3225 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3232 let mut query = self.selection.select("withLabel");
3233 query = query.arg("name", name.into());
3234 query = query.arg("value", value.into());
3235 Container {
3236 proc: self.proc.clone(),
3237 selection: query,
3238 graphql_client: self.graphql_client.clone(),
3239 }
3240 }
3241 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3249 let mut query = self.selection.select("withMountedCache");
3250 query = query.arg("path", path.into());
3251 query = query.arg_lazy(
3252 "cache",
3253 Box::new(move || {
3254 let cache = cache.clone();
3255 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3256 }),
3257 );
3258 Container {
3259 proc: self.proc.clone(),
3260 selection: query,
3261 graphql_client: self.graphql_client.clone(),
3262 }
3263 }
3264 pub fn with_mounted_cache_opts<'a>(
3272 &self,
3273 path: impl Into<String>,
3274 cache: impl IntoID<Id>,
3275 opts: ContainerWithMountedCacheOpts<'a>,
3276 ) -> Container {
3277 let mut query = self.selection.select("withMountedCache");
3278 query = query.arg("path", path.into());
3279 query = query.arg_lazy(
3280 "cache",
3281 Box::new(move || {
3282 let cache = cache.clone();
3283 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3284 }),
3285 );
3286 if let Some(source) = opts.source {
3287 query = query.arg("source", source);
3288 }
3289 if let Some(sharing) = opts.sharing {
3290 query = query.arg("sharing", sharing);
3291 }
3292 if let Some(owner) = opts.owner {
3293 query = query.arg("owner", owner);
3294 }
3295 if let Some(expand) = opts.expand {
3296 query = query.arg("expand", expand);
3297 }
3298 Container {
3299 proc: self.proc.clone(),
3300 selection: query,
3301 graphql_client: self.graphql_client.clone(),
3302 }
3303 }
3304 pub fn with_mounted_directory(
3312 &self,
3313 path: impl Into<String>,
3314 source: impl IntoID<Id>,
3315 ) -> Container {
3316 let mut query = self.selection.select("withMountedDirectory");
3317 query = query.arg("path", path.into());
3318 query = query.arg_lazy(
3319 "source",
3320 Box::new(move || {
3321 let source = source.clone();
3322 Box::pin(async move { source.into_id().await.unwrap().quote() })
3323 }),
3324 );
3325 Container {
3326 proc: self.proc.clone(),
3327 selection: query,
3328 graphql_client: self.graphql_client.clone(),
3329 }
3330 }
3331 pub fn with_mounted_directory_opts<'a>(
3339 &self,
3340 path: impl Into<String>,
3341 source: impl IntoID<Id>,
3342 opts: ContainerWithMountedDirectoryOpts<'a>,
3343 ) -> Container {
3344 let mut query = self.selection.select("withMountedDirectory");
3345 query = query.arg("path", path.into());
3346 query = query.arg_lazy(
3347 "source",
3348 Box::new(move || {
3349 let source = source.clone();
3350 Box::pin(async move { source.into_id().await.unwrap().quote() })
3351 }),
3352 );
3353 if let Some(owner) = opts.owner {
3354 query = query.arg("owner", owner);
3355 }
3356 if let Some(read_only) = opts.read_only {
3357 query = query.arg("readOnly", read_only);
3358 }
3359 if let Some(expand) = opts.expand {
3360 query = query.arg("expand", expand);
3361 }
3362 Container {
3363 proc: self.proc.clone(),
3364 selection: query,
3365 graphql_client: self.graphql_client.clone(),
3366 }
3367 }
3368 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3376 let mut query = self.selection.select("withMountedFile");
3377 query = query.arg("path", path.into());
3378 query = query.arg_lazy(
3379 "source",
3380 Box::new(move || {
3381 let source = source.clone();
3382 Box::pin(async move { source.into_id().await.unwrap().quote() })
3383 }),
3384 );
3385 Container {
3386 proc: self.proc.clone(),
3387 selection: query,
3388 graphql_client: self.graphql_client.clone(),
3389 }
3390 }
3391 pub fn with_mounted_file_opts<'a>(
3399 &self,
3400 path: impl Into<String>,
3401 source: impl IntoID<Id>,
3402 opts: ContainerWithMountedFileOpts<'a>,
3403 ) -> Container {
3404 let mut query = self.selection.select("withMountedFile");
3405 query = query.arg("path", path.into());
3406 query = query.arg_lazy(
3407 "source",
3408 Box::new(move || {
3409 let source = source.clone();
3410 Box::pin(async move { source.into_id().await.unwrap().quote() })
3411 }),
3412 );
3413 if let Some(owner) = opts.owner {
3414 query = query.arg("owner", owner);
3415 }
3416 if let Some(expand) = opts.expand {
3417 query = query.arg("expand", expand);
3418 }
3419 Container {
3420 proc: self.proc.clone(),
3421 selection: query,
3422 graphql_client: self.graphql_client.clone(),
3423 }
3424 }
3425 pub fn with_mounted_secret(
3433 &self,
3434 path: impl Into<String>,
3435 source: impl IntoID<Id>,
3436 ) -> Container {
3437 let mut query = self.selection.select("withMountedSecret");
3438 query = query.arg("path", path.into());
3439 query = query.arg_lazy(
3440 "source",
3441 Box::new(move || {
3442 let source = source.clone();
3443 Box::pin(async move { source.into_id().await.unwrap().quote() })
3444 }),
3445 );
3446 Container {
3447 proc: self.proc.clone(),
3448 selection: query,
3449 graphql_client: self.graphql_client.clone(),
3450 }
3451 }
3452 pub fn with_mounted_secret_opts<'a>(
3460 &self,
3461 path: impl Into<String>,
3462 source: impl IntoID<Id>,
3463 opts: ContainerWithMountedSecretOpts<'a>,
3464 ) -> Container {
3465 let mut query = self.selection.select("withMountedSecret");
3466 query = query.arg("path", path.into());
3467 query = query.arg_lazy(
3468 "source",
3469 Box::new(move || {
3470 let source = source.clone();
3471 Box::pin(async move { source.into_id().await.unwrap().quote() })
3472 }),
3473 );
3474 if let Some(owner) = opts.owner {
3475 query = query.arg("owner", owner);
3476 }
3477 if let Some(mode) = opts.mode {
3478 query = query.arg("mode", mode);
3479 }
3480 if let Some(expand) = opts.expand {
3481 query = query.arg("expand", expand);
3482 }
3483 Container {
3484 proc: self.proc.clone(),
3485 selection: query,
3486 graphql_client: self.graphql_client.clone(),
3487 }
3488 }
3489 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3496 let mut query = self.selection.select("withMountedTemp");
3497 query = query.arg("path", path.into());
3498 Container {
3499 proc: self.proc.clone(),
3500 selection: query,
3501 graphql_client: self.graphql_client.clone(),
3502 }
3503 }
3504 pub fn with_mounted_temp_opts(
3511 &self,
3512 path: impl Into<String>,
3513 opts: ContainerWithMountedTempOpts,
3514 ) -> Container {
3515 let mut query = self.selection.select("withMountedTemp");
3516 query = query.arg("path", path.into());
3517 if let Some(size) = opts.size {
3518 query = query.arg("size", size);
3519 }
3520 if let Some(expand) = opts.expand {
3521 query = query.arg("expand", expand);
3522 }
3523 Container {
3524 proc: self.proc.clone(),
3525 selection: query,
3526 graphql_client: self.graphql_client.clone(),
3527 }
3528 }
3529 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3537 let mut query = self.selection.select("withNewFile");
3538 query = query.arg("path", path.into());
3539 query = query.arg("contents", contents.into());
3540 Container {
3541 proc: self.proc.clone(),
3542 selection: query,
3543 graphql_client: self.graphql_client.clone(),
3544 }
3545 }
3546 pub fn with_new_file_opts<'a>(
3554 &self,
3555 path: impl Into<String>,
3556 contents: impl Into<String>,
3557 opts: ContainerWithNewFileOpts<'a>,
3558 ) -> Container {
3559 let mut query = self.selection.select("withNewFile");
3560 query = query.arg("path", path.into());
3561 query = query.arg("contents", contents.into());
3562 if let Some(permissions) = opts.permissions {
3563 query = query.arg("permissions", permissions);
3564 }
3565 if let Some(owner) = opts.owner {
3566 query = query.arg("owner", owner);
3567 }
3568 if let Some(expand) = opts.expand {
3569 query = query.arg("expand", expand);
3570 }
3571 Container {
3572 proc: self.proc.clone(),
3573 selection: query,
3574 graphql_client: self.graphql_client.clone(),
3575 }
3576 }
3577 pub fn with_registry_auth(
3585 &self,
3586 address: impl Into<String>,
3587 username: impl Into<String>,
3588 secret: impl IntoID<Id>,
3589 ) -> Container {
3590 let mut query = self.selection.select("withRegistryAuth");
3591 query = query.arg("address", address.into());
3592 query = query.arg("username", username.into());
3593 query = query.arg_lazy(
3594 "secret",
3595 Box::new(move || {
3596 let secret = secret.clone();
3597 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3598 }),
3599 );
3600 Container {
3601 proc: self.proc.clone(),
3602 selection: query,
3603 graphql_client: self.graphql_client.clone(),
3604 }
3605 }
3606 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3612 let mut query = self.selection.select("withRootfs");
3613 query = query.arg_lazy(
3614 "directory",
3615 Box::new(move || {
3616 let directory = directory.clone();
3617 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3618 }),
3619 );
3620 Container {
3621 proc: self.proc.clone(),
3622 selection: query,
3623 graphql_client: self.graphql_client.clone(),
3624 }
3625 }
3626 pub fn with_secret_variable(
3633 &self,
3634 name: impl Into<String>,
3635 secret: impl IntoID<Id>,
3636 ) -> Container {
3637 let mut query = self.selection.select("withSecretVariable");
3638 query = query.arg("name", name.into());
3639 query = query.arg_lazy(
3640 "secret",
3641 Box::new(move || {
3642 let secret = secret.clone();
3643 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3644 }),
3645 );
3646 Container {
3647 proc: self.proc.clone(),
3648 selection: query,
3649 graphql_client: self.graphql_client.clone(),
3650 }
3651 }
3652 pub fn with_service_binding(
3662 &self,
3663 alias: impl Into<String>,
3664 service: impl IntoID<Id>,
3665 ) -> Container {
3666 let mut query = self.selection.select("withServiceBinding");
3667 query = query.arg("alias", alias.into());
3668 query = query.arg_lazy(
3669 "service",
3670 Box::new(move || {
3671 let service = service.clone();
3672 Box::pin(async move { service.into_id().await.unwrap().quote() })
3673 }),
3674 );
3675 Container {
3676 proc: self.proc.clone(),
3677 selection: query,
3678 graphql_client: self.graphql_client.clone(),
3679 }
3680 }
3681 pub fn with_symlink(
3689 &self,
3690 target: impl Into<String>,
3691 link_name: impl Into<String>,
3692 ) -> Container {
3693 let mut query = self.selection.select("withSymlink");
3694 query = query.arg("target", target.into());
3695 query = query.arg("linkName", link_name.into());
3696 Container {
3697 proc: self.proc.clone(),
3698 selection: query,
3699 graphql_client: self.graphql_client.clone(),
3700 }
3701 }
3702 pub fn with_symlink_opts(
3710 &self,
3711 target: impl Into<String>,
3712 link_name: impl Into<String>,
3713 opts: ContainerWithSymlinkOpts,
3714 ) -> Container {
3715 let mut query = self.selection.select("withSymlink");
3716 query = query.arg("target", target.into());
3717 query = query.arg("linkName", link_name.into());
3718 if let Some(expand) = opts.expand {
3719 query = query.arg("expand", expand);
3720 }
3721 Container {
3722 proc: self.proc.clone(),
3723 selection: query,
3724 graphql_client: self.graphql_client.clone(),
3725 }
3726 }
3727 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3735 let mut query = self.selection.select("withUnixSocket");
3736 query = query.arg("path", path.into());
3737 query = query.arg_lazy(
3738 "source",
3739 Box::new(move || {
3740 let source = source.clone();
3741 Box::pin(async move { source.into_id().await.unwrap().quote() })
3742 }),
3743 );
3744 Container {
3745 proc: self.proc.clone(),
3746 selection: query,
3747 graphql_client: self.graphql_client.clone(),
3748 }
3749 }
3750 pub fn with_unix_socket_opts<'a>(
3758 &self,
3759 path: impl Into<String>,
3760 source: impl IntoID<Id>,
3761 opts: ContainerWithUnixSocketOpts<'a>,
3762 ) -> Container {
3763 let mut query = self.selection.select("withUnixSocket");
3764 query = query.arg("path", path.into());
3765 query = query.arg_lazy(
3766 "source",
3767 Box::new(move || {
3768 let source = source.clone();
3769 Box::pin(async move { source.into_id().await.unwrap().quote() })
3770 }),
3771 );
3772 if let Some(owner) = opts.owner {
3773 query = query.arg("owner", owner);
3774 }
3775 if let Some(expand) = opts.expand {
3776 query = query.arg("expand", expand);
3777 }
3778 Container {
3779 proc: self.proc.clone(),
3780 selection: query,
3781 graphql_client: self.graphql_client.clone(),
3782 }
3783 }
3784 pub fn with_user(&self, name: impl Into<String>) -> Container {
3790 let mut query = self.selection.select("withUser");
3791 query = query.arg("name", name.into());
3792 Container {
3793 proc: self.proc.clone(),
3794 selection: query,
3795 graphql_client: self.graphql_client.clone(),
3796 }
3797 }
3798 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3805 let mut query = self.selection.select("withWorkdir");
3806 query = query.arg("path", path.into());
3807 Container {
3808 proc: self.proc.clone(),
3809 selection: query,
3810 graphql_client: self.graphql_client.clone(),
3811 }
3812 }
3813 pub fn with_workdir_opts(
3820 &self,
3821 path: impl Into<String>,
3822 opts: ContainerWithWorkdirOpts,
3823 ) -> Container {
3824 let mut query = self.selection.select("withWorkdir");
3825 query = query.arg("path", path.into());
3826 if let Some(expand) = opts.expand {
3827 query = query.arg("expand", expand);
3828 }
3829 Container {
3830 proc: self.proc.clone(),
3831 selection: query,
3832 graphql_client: self.graphql_client.clone(),
3833 }
3834 }
3835 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3841 let mut query = self.selection.select("withoutAnnotation");
3842 query = query.arg("name", name.into());
3843 Container {
3844 proc: self.proc.clone(),
3845 selection: query,
3846 graphql_client: self.graphql_client.clone(),
3847 }
3848 }
3849 pub fn without_default_args(&self) -> Container {
3851 let query = self.selection.select("withoutDefaultArgs");
3852 Container {
3853 proc: self.proc.clone(),
3854 selection: query,
3855 graphql_client: self.graphql_client.clone(),
3856 }
3857 }
3858 pub fn without_directory(&self, path: impl Into<String>) -> Container {
3865 let mut query = self.selection.select("withoutDirectory");
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 without_directory_opts(
3880 &self,
3881 path: impl Into<String>,
3882 opts: ContainerWithoutDirectoryOpts,
3883 ) -> Container {
3884 let mut query = self.selection.select("withoutDirectory");
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_docker_healthcheck(&self) -> Container {
3897 let query = self.selection.select("withoutDockerHealthcheck");
3898 Container {
3899 proc: self.proc.clone(),
3900 selection: query,
3901 graphql_client: self.graphql_client.clone(),
3902 }
3903 }
3904 pub fn without_entrypoint(&self) -> Container {
3910 let query = self.selection.select("withoutEntrypoint");
3911 Container {
3912 proc: self.proc.clone(),
3913 selection: query,
3914 graphql_client: self.graphql_client.clone(),
3915 }
3916 }
3917 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3923 let mut query = self.selection.select("withoutEntrypoint");
3924 if let Some(keep_default_args) = opts.keep_default_args {
3925 query = query.arg("keepDefaultArgs", keep_default_args);
3926 }
3927 Container {
3928 proc: self.proc.clone(),
3929 selection: query,
3930 graphql_client: self.graphql_client.clone(),
3931 }
3932 }
3933 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3939 let mut query = self.selection.select("withoutEnvVariable");
3940 query = query.arg("name", name.into());
3941 Container {
3942 proc: self.proc.clone(),
3943 selection: query,
3944 graphql_client: self.graphql_client.clone(),
3945 }
3946 }
3947 pub fn without_exposed_port(&self, port: isize) -> Container {
3954 let mut query = self.selection.select("withoutExposedPort");
3955 query = query.arg("port", port);
3956 Container {
3957 proc: self.proc.clone(),
3958 selection: query,
3959 graphql_client: self.graphql_client.clone(),
3960 }
3961 }
3962 pub fn without_exposed_port_opts(
3969 &self,
3970 port: isize,
3971 opts: ContainerWithoutExposedPortOpts,
3972 ) -> Container {
3973 let mut query = self.selection.select("withoutExposedPort");
3974 query = query.arg("port", port);
3975 if let Some(protocol) = opts.protocol {
3976 query = query.arg("protocol", protocol);
3977 }
3978 Container {
3979 proc: self.proc.clone(),
3980 selection: query,
3981 graphql_client: self.graphql_client.clone(),
3982 }
3983 }
3984 pub fn without_file(&self, path: impl Into<String>) -> Container {
3991 let mut query = self.selection.select("withoutFile");
3992 query = query.arg("path", path.into());
3993 Container {
3994 proc: self.proc.clone(),
3995 selection: query,
3996 graphql_client: self.graphql_client.clone(),
3997 }
3998 }
3999 pub fn without_file_opts(
4006 &self,
4007 path: impl Into<String>,
4008 opts: ContainerWithoutFileOpts,
4009 ) -> Container {
4010 let mut query = self.selection.select("withoutFile");
4011 query = query.arg("path", path.into());
4012 if let Some(expand) = opts.expand {
4013 query = query.arg("expand", expand);
4014 }
4015 Container {
4016 proc: self.proc.clone(),
4017 selection: query,
4018 graphql_client: self.graphql_client.clone(),
4019 }
4020 }
4021 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4028 let mut query = self.selection.select("withoutFiles");
4029 query = query.arg(
4030 "paths",
4031 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4032 );
4033 Container {
4034 proc: self.proc.clone(),
4035 selection: query,
4036 graphql_client: self.graphql_client.clone(),
4037 }
4038 }
4039 pub fn without_files_opts(
4046 &self,
4047 paths: Vec<impl Into<String>>,
4048 opts: ContainerWithoutFilesOpts,
4049 ) -> Container {
4050 let mut query = self.selection.select("withoutFiles");
4051 query = query.arg(
4052 "paths",
4053 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4054 );
4055 if let Some(expand) = opts.expand {
4056 query = query.arg("expand", expand);
4057 }
4058 Container {
4059 proc: self.proc.clone(),
4060 selection: query,
4061 graphql_client: self.graphql_client.clone(),
4062 }
4063 }
4064 pub fn without_label(&self, name: impl Into<String>) -> Container {
4070 let mut query = self.selection.select("withoutLabel");
4071 query = query.arg("name", name.into());
4072 Container {
4073 proc: self.proc.clone(),
4074 selection: query,
4075 graphql_client: self.graphql_client.clone(),
4076 }
4077 }
4078 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4085 let mut query = self.selection.select("withoutMount");
4086 query = query.arg("path", path.into());
4087 Container {
4088 proc: self.proc.clone(),
4089 selection: query,
4090 graphql_client: self.graphql_client.clone(),
4091 }
4092 }
4093 pub fn without_mount_opts(
4100 &self,
4101 path: impl Into<String>,
4102 opts: ContainerWithoutMountOpts,
4103 ) -> Container {
4104 let mut query = self.selection.select("withoutMount");
4105 query = query.arg("path", path.into());
4106 if let Some(expand) = opts.expand {
4107 query = query.arg("expand", expand);
4108 }
4109 Container {
4110 proc: self.proc.clone(),
4111 selection: query,
4112 graphql_client: self.graphql_client.clone(),
4113 }
4114 }
4115 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4123 let mut query = self.selection.select("withoutRegistryAuth");
4124 query = query.arg("address", address.into());
4125 Container {
4126 proc: self.proc.clone(),
4127 selection: query,
4128 graphql_client: self.graphql_client.clone(),
4129 }
4130 }
4131 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4137 let mut query = self.selection.select("withoutSecretVariable");
4138 query = query.arg("name", name.into());
4139 Container {
4140 proc: self.proc.clone(),
4141 selection: query,
4142 graphql_client: self.graphql_client.clone(),
4143 }
4144 }
4145 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4152 let mut query = self.selection.select("withoutUnixSocket");
4153 query = query.arg("path", path.into());
4154 Container {
4155 proc: self.proc.clone(),
4156 selection: query,
4157 graphql_client: self.graphql_client.clone(),
4158 }
4159 }
4160 pub fn without_unix_socket_opts(
4167 &self,
4168 path: impl Into<String>,
4169 opts: ContainerWithoutUnixSocketOpts,
4170 ) -> Container {
4171 let mut query = self.selection.select("withoutUnixSocket");
4172 query = query.arg("path", path.into());
4173 if let Some(expand) = opts.expand {
4174 query = query.arg("expand", expand);
4175 }
4176 Container {
4177 proc: self.proc.clone(),
4178 selection: query,
4179 graphql_client: self.graphql_client.clone(),
4180 }
4181 }
4182 pub fn without_user(&self) -> Container {
4185 let query = self.selection.select("withoutUser");
4186 Container {
4187 proc: self.proc.clone(),
4188 selection: query,
4189 graphql_client: self.graphql_client.clone(),
4190 }
4191 }
4192 pub fn without_workdir(&self) -> Container {
4195 let query = self.selection.select("withoutWorkdir");
4196 Container {
4197 proc: self.proc.clone(),
4198 selection: query,
4199 graphql_client: self.graphql_client.clone(),
4200 }
4201 }
4202 pub async fn workdir(&self) -> Result<String, DaggerError> {
4204 let query = self.selection.select("workdir");
4205 query.execute(self.graphql_client.clone()).await
4206 }
4207}
4208impl Exportable for Container {
4209 fn export(
4210 &self,
4211 path: impl Into<String>,
4212 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4213 let mut query = self.selection.select("export");
4214 query = query.arg("path", path.into());
4215 let graphql_client = self.graphql_client.clone();
4216 async move { query.execute(graphql_client).await }
4217 }
4218 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4219 let query = self.selection.select("id");
4220 let graphql_client = self.graphql_client.clone();
4221 async move { query.execute(graphql_client).await }
4222 }
4223}
4224impl Node for Container {
4225 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4226 let query = self.selection.select("id");
4227 let graphql_client = self.graphql_client.clone();
4228 async move { query.execute(graphql_client).await }
4229 }
4230}
4231impl Syncer for Container {
4232 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4233 let query = self.selection.select("id");
4234 let graphql_client = self.graphql_client.clone();
4235 async move { query.execute(graphql_client).await }
4236 }
4237 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4238 let query = self.selection.select("sync");
4239 let graphql_client = self.graphql_client.clone();
4240 async move { query.execute(graphql_client).await }
4241 }
4242}
4243#[derive(Clone)]
4244pub struct CurrentModule {
4245 pub proc: Option<Arc<DaggerSessionProc>>,
4246 pub selection: Selection,
4247 pub graphql_client: DynGraphQLClient,
4248}
4249#[derive(Builder, Debug, PartialEq)]
4250pub struct CurrentModuleGeneratorsOpts<'a> {
4251 #[builder(setter(into, strip_option), default)]
4253 pub include: Option<Vec<&'a str>>,
4254}
4255#[derive(Builder, Debug, PartialEq)]
4256pub struct CurrentModuleWorkdirOpts<'a> {
4257 #[builder(setter(into, strip_option), default)]
4259 pub exclude: Option<Vec<&'a str>>,
4260 #[builder(setter(into, strip_option), default)]
4262 pub gitignore: Option<bool>,
4263 #[builder(setter(into, strip_option), default)]
4265 pub include: Option<Vec<&'a str>>,
4266}
4267impl IntoID<Id> for CurrentModule {
4268 fn into_id(
4269 self,
4270 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4271 Box::pin(async move { self.id().await })
4272 }
4273}
4274impl Loadable for CurrentModule {
4275 fn graphql_type() -> &'static str {
4276 "CurrentModule"
4277 }
4278 fn from_query(
4279 proc: Option<Arc<DaggerSessionProc>>,
4280 selection: Selection,
4281 graphql_client: DynGraphQLClient,
4282 ) -> Self {
4283 Self {
4284 proc,
4285 selection,
4286 graphql_client,
4287 }
4288 }
4289}
4290impl CurrentModule {
4291 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4293 let query = self.selection.select("dependencies");
4294 let query = query.select("id");
4295 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4296 Ok(ids
4297 .into_iter()
4298 .map(|id| Module {
4299 proc: self.proc.clone(),
4300 selection: crate::querybuilder::query()
4301 .select("node")
4302 .arg("id", &id.0)
4303 .inline_fragment("Module"),
4304 graphql_client: self.graphql_client.clone(),
4305 })
4306 .collect())
4307 }
4308 pub fn generated_context_directory(&self) -> Directory {
4310 let query = self.selection.select("generatedContextDirectory");
4311 Directory {
4312 proc: self.proc.clone(),
4313 selection: query,
4314 graphql_client: self.graphql_client.clone(),
4315 }
4316 }
4317 pub fn generators(&self) -> GeneratorGroup {
4323 let query = self.selection.select("generators");
4324 GeneratorGroup {
4325 proc: self.proc.clone(),
4326 selection: query,
4327 graphql_client: self.graphql_client.clone(),
4328 }
4329 }
4330 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4336 let mut query = self.selection.select("generators");
4337 if let Some(include) = opts.include {
4338 query = query.arg("include", include);
4339 }
4340 GeneratorGroup {
4341 proc: self.proc.clone(),
4342 selection: query,
4343 graphql_client: self.graphql_client.clone(),
4344 }
4345 }
4346 pub async fn id(&self) -> Result<Id, DaggerError> {
4348 let query = self.selection.select("id");
4349 query.execute(self.graphql_client.clone()).await
4350 }
4351 pub async fn name(&self) -> Result<String, DaggerError> {
4353 let query = self.selection.select("name");
4354 query.execute(self.graphql_client.clone()).await
4355 }
4356 pub fn source(&self) -> Directory {
4358 let query = self.selection.select("source");
4359 Directory {
4360 proc: self.proc.clone(),
4361 selection: query,
4362 graphql_client: self.graphql_client.clone(),
4363 }
4364 }
4365 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4372 let mut query = self.selection.select("workdir");
4373 query = query.arg("path", path.into());
4374 Directory {
4375 proc: self.proc.clone(),
4376 selection: query,
4377 graphql_client: self.graphql_client.clone(),
4378 }
4379 }
4380 pub fn workdir_opts<'a>(
4387 &self,
4388 path: impl Into<String>,
4389 opts: CurrentModuleWorkdirOpts<'a>,
4390 ) -> Directory {
4391 let mut query = self.selection.select("workdir");
4392 query = query.arg("path", path.into());
4393 if let Some(exclude) = opts.exclude {
4394 query = query.arg("exclude", exclude);
4395 }
4396 if let Some(include) = opts.include {
4397 query = query.arg("include", include);
4398 }
4399 if let Some(gitignore) = opts.gitignore {
4400 query = query.arg("gitignore", gitignore);
4401 }
4402 Directory {
4403 proc: self.proc.clone(),
4404 selection: query,
4405 graphql_client: self.graphql_client.clone(),
4406 }
4407 }
4408 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4414 let mut query = self.selection.select("workdirFile");
4415 query = query.arg("path", path.into());
4416 File {
4417 proc: self.proc.clone(),
4418 selection: query,
4419 graphql_client: self.graphql_client.clone(),
4420 }
4421 }
4422}
4423impl Node for CurrentModule {
4424 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4425 let query = self.selection.select("id");
4426 let graphql_client = self.graphql_client.clone();
4427 async move { query.execute(graphql_client).await }
4428 }
4429}
4430#[derive(Clone)]
4431pub struct DiffStat {
4432 pub proc: Option<Arc<DaggerSessionProc>>,
4433 pub selection: Selection,
4434 pub graphql_client: DynGraphQLClient,
4435}
4436impl IntoID<Id> for DiffStat {
4437 fn into_id(
4438 self,
4439 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4440 Box::pin(async move { self.id().await })
4441 }
4442}
4443impl Loadable for DiffStat {
4444 fn graphql_type() -> &'static str {
4445 "DiffStat"
4446 }
4447 fn from_query(
4448 proc: Option<Arc<DaggerSessionProc>>,
4449 selection: Selection,
4450 graphql_client: DynGraphQLClient,
4451 ) -> Self {
4452 Self {
4453 proc,
4454 selection,
4455 graphql_client,
4456 }
4457 }
4458}
4459impl DiffStat {
4460 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4462 let query = self.selection.select("addedLines");
4463 query.execute(self.graphql_client.clone()).await
4464 }
4465 pub async fn id(&self) -> Result<Id, DaggerError> {
4467 let query = self.selection.select("id");
4468 query.execute(self.graphql_client.clone()).await
4469 }
4470 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4472 let query = self.selection.select("kind");
4473 query.execute(self.graphql_client.clone()).await
4474 }
4475 pub async fn old_path(&self) -> Result<String, DaggerError> {
4477 let query = self.selection.select("oldPath");
4478 query.execute(self.graphql_client.clone()).await
4479 }
4480 pub async fn path(&self) -> Result<String, DaggerError> {
4482 let query = self.selection.select("path");
4483 query.execute(self.graphql_client.clone()).await
4484 }
4485 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4487 let query = self.selection.select("removedLines");
4488 query.execute(self.graphql_client.clone()).await
4489 }
4490}
4491impl Node for DiffStat {
4492 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4493 let query = self.selection.select("id");
4494 let graphql_client = self.graphql_client.clone();
4495 async move { query.execute(graphql_client).await }
4496 }
4497}
4498#[derive(Clone)]
4499pub struct Directory {
4500 pub proc: Option<Arc<DaggerSessionProc>>,
4501 pub selection: Selection,
4502 pub graphql_client: DynGraphQLClient,
4503}
4504#[derive(Builder, Debug, PartialEq)]
4505pub struct DirectoryAsModuleOpts<'a> {
4506 #[builder(setter(into, strip_option), default)]
4509 pub source_root_path: Option<&'a str>,
4510}
4511#[derive(Builder, Debug, PartialEq)]
4512pub struct DirectoryAsModuleSourceOpts<'a> {
4513 #[builder(setter(into, strip_option), default)]
4516 pub source_root_path: Option<&'a str>,
4517}
4518#[derive(Builder, Debug, PartialEq)]
4519pub struct DirectoryDockerBuildOpts<'a> {
4520 #[builder(setter(into, strip_option), default)]
4522 pub build_args: Option<Vec<BuildArg>>,
4523 #[builder(setter(into, strip_option), default)]
4525 pub dockerfile: Option<&'a str>,
4526 #[builder(setter(into, strip_option), default)]
4529 pub no_init: Option<bool>,
4530 #[builder(setter(into, strip_option), default)]
4532 pub platform: Option<Platform>,
4533 #[builder(setter(into, strip_option), default)]
4536 pub secrets: Option<Vec<Id>>,
4537 #[builder(setter(into, strip_option), default)]
4541 pub ssh: Option<Id>,
4542 #[builder(setter(into, strip_option), default)]
4544 pub target: Option<&'a str>,
4545}
4546#[derive(Builder, Debug, PartialEq)]
4547pub struct DirectoryEntriesOpts<'a> {
4548 #[builder(setter(into, strip_option), default)]
4550 pub path: Option<&'a str>,
4551}
4552#[derive(Builder, Debug, PartialEq)]
4553pub struct DirectoryExistsOpts {
4554 #[builder(setter(into, strip_option), default)]
4556 pub do_not_follow_symlinks: Option<bool>,
4557 #[builder(setter(into, strip_option), default)]
4559 pub expected_type: Option<ExistsType>,
4560}
4561#[derive(Builder, Debug, PartialEq)]
4562pub struct DirectoryExportOpts {
4563 #[builder(setter(into, strip_option), default)]
4565 pub wipe: Option<bool>,
4566}
4567#[derive(Builder, Debug, PartialEq)]
4568pub struct DirectoryFilterOpts<'a> {
4569 #[builder(setter(into, strip_option), default)]
4571 pub exclude: Option<Vec<&'a str>>,
4572 #[builder(setter(into, strip_option), default)]
4574 pub gitignore: Option<bool>,
4575 #[builder(setter(into, strip_option), default)]
4577 pub include: Option<Vec<&'a str>>,
4578}
4579#[derive(Builder, Debug, PartialEq)]
4580pub struct DirectorySearchOpts<'a> {
4581 #[builder(setter(into, strip_option), default)]
4583 pub dotall: Option<bool>,
4584 #[builder(setter(into, strip_option), default)]
4586 pub files_only: Option<bool>,
4587 #[builder(setter(into, strip_option), default)]
4589 pub globs: Option<Vec<&'a str>>,
4590 #[builder(setter(into, strip_option), default)]
4592 pub insensitive: Option<bool>,
4593 #[builder(setter(into, strip_option), default)]
4595 pub limit: Option<isize>,
4596 #[builder(setter(into, strip_option), default)]
4598 pub literal: Option<bool>,
4599 #[builder(setter(into, strip_option), default)]
4601 pub multiline: Option<bool>,
4602 #[builder(setter(into, strip_option), default)]
4604 pub paths: Option<Vec<&'a str>>,
4605 #[builder(setter(into, strip_option), default)]
4607 pub skip_hidden: Option<bool>,
4608 #[builder(setter(into, strip_option), default)]
4610 pub skip_ignored: Option<bool>,
4611}
4612#[derive(Builder, Debug, PartialEq)]
4613pub struct DirectoryStatOpts {
4614 #[builder(setter(into, strip_option), default)]
4616 pub do_not_follow_symlinks: Option<bool>,
4617}
4618#[derive(Builder, Debug, PartialEq)]
4619pub struct DirectoryTerminalOpts<'a> {
4620 #[builder(setter(into, strip_option), default)]
4622 pub cmd: Option<Vec<&'a str>>,
4623 #[builder(setter(into, strip_option), default)]
4625 pub container: Option<Id>,
4626 #[builder(setter(into, strip_option), default)]
4628 pub experimental_privileged_nesting: Option<bool>,
4629 #[builder(setter(into, strip_option), default)]
4631 pub insecure_root_capabilities: Option<bool>,
4632}
4633#[derive(Builder, Debug, PartialEq)]
4634pub struct DirectoryWithDirectoryOpts<'a> {
4635 #[builder(setter(into, strip_option), default)]
4637 pub exclude: Option<Vec<&'a str>>,
4638 #[builder(setter(into, strip_option), default)]
4640 pub gitignore: Option<bool>,
4641 #[builder(setter(into, strip_option), default)]
4643 pub include: Option<Vec<&'a str>>,
4644 #[builder(setter(into, strip_option), default)]
4648 pub owner: Option<&'a str>,
4649 #[builder(setter(into, strip_option), default)]
4651 pub permissions: Option<isize>,
4652}
4653#[derive(Builder, Debug, PartialEq)]
4654pub struct DirectoryWithFileOpts<'a> {
4655 #[builder(setter(into, strip_option), default)]
4659 pub owner: Option<&'a str>,
4660 #[builder(setter(into, strip_option), default)]
4662 pub permissions: Option<isize>,
4663}
4664#[derive(Builder, Debug, PartialEq)]
4665pub struct DirectoryWithFilesOpts {
4666 #[builder(setter(into, strip_option), default)]
4668 pub permissions: Option<isize>,
4669}
4670#[derive(Builder, Debug, PartialEq)]
4671pub struct DirectoryWithNewDirectoryOpts {
4672 #[builder(setter(into, strip_option), default)]
4674 pub permissions: Option<isize>,
4675}
4676#[derive(Builder, Debug, PartialEq)]
4677pub struct DirectoryWithNewFileOpts {
4678 #[builder(setter(into, strip_option), default)]
4680 pub permissions: Option<isize>,
4681}
4682impl IntoID<Id> for Directory {
4683 fn into_id(
4684 self,
4685 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4686 Box::pin(async move { self.id().await })
4687 }
4688}
4689impl Loadable for Directory {
4690 fn graphql_type() -> &'static str {
4691 "Directory"
4692 }
4693 fn from_query(
4694 proc: Option<Arc<DaggerSessionProc>>,
4695 selection: Selection,
4696 graphql_client: DynGraphQLClient,
4697 ) -> Self {
4698 Self {
4699 proc,
4700 selection,
4701 graphql_client,
4702 }
4703 }
4704}
4705impl Directory {
4706 pub fn as_git(&self) -> GitRepository {
4708 let query = self.selection.select("asGit");
4709 GitRepository {
4710 proc: self.proc.clone(),
4711 selection: query,
4712 graphql_client: self.graphql_client.clone(),
4713 }
4714 }
4715 pub fn as_module(&self) -> Module {
4721 let query = self.selection.select("asModule");
4722 Module {
4723 proc: self.proc.clone(),
4724 selection: query,
4725 graphql_client: self.graphql_client.clone(),
4726 }
4727 }
4728 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4734 let mut query = self.selection.select("asModule");
4735 if let Some(source_root_path) = opts.source_root_path {
4736 query = query.arg("sourceRootPath", source_root_path);
4737 }
4738 Module {
4739 proc: self.proc.clone(),
4740 selection: query,
4741 graphql_client: self.graphql_client.clone(),
4742 }
4743 }
4744 pub fn as_module_source(&self) -> ModuleSource {
4750 let query = self.selection.select("asModuleSource");
4751 ModuleSource {
4752 proc: self.proc.clone(),
4753 selection: query,
4754 graphql_client: self.graphql_client.clone(),
4755 }
4756 }
4757 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4763 let mut query = self.selection.select("asModuleSource");
4764 if let Some(source_root_path) = opts.source_root_path {
4765 query = query.arg("sourceRootPath", source_root_path);
4766 }
4767 ModuleSource {
4768 proc: self.proc.clone(),
4769 selection: query,
4770 graphql_client: self.graphql_client.clone(),
4771 }
4772 }
4773 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4780 let mut query = self.selection.select("changes");
4781 query = query.arg_lazy(
4782 "from",
4783 Box::new(move || {
4784 let from = from.clone();
4785 Box::pin(async move { from.into_id().await.unwrap().quote() })
4786 }),
4787 );
4788 Changeset {
4789 proc: self.proc.clone(),
4790 selection: query,
4791 graphql_client: self.graphql_client.clone(),
4792 }
4793 }
4794 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4805 let mut query = self.selection.select("chown");
4806 query = query.arg("path", path.into());
4807 query = query.arg("owner", owner.into());
4808 Directory {
4809 proc: self.proc.clone(),
4810 selection: query,
4811 graphql_client: self.graphql_client.clone(),
4812 }
4813 }
4814 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4820 let mut query = self.selection.select("diff");
4821 query = query.arg_lazy(
4822 "other",
4823 Box::new(move || {
4824 let other = other.clone();
4825 Box::pin(async move { other.into_id().await.unwrap().quote() })
4826 }),
4827 );
4828 Directory {
4829 proc: self.proc.clone(),
4830 selection: query,
4831 graphql_client: self.graphql_client.clone(),
4832 }
4833 }
4834 pub async fn digest(&self) -> Result<String, DaggerError> {
4836 let query = self.selection.select("digest");
4837 query.execute(self.graphql_client.clone()).await
4838 }
4839 pub fn directory(&self, path: impl Into<String>) -> Directory {
4845 let mut query = self.selection.select("directory");
4846 query = query.arg("path", path.into());
4847 Directory {
4848 proc: self.proc.clone(),
4849 selection: query,
4850 graphql_client: self.graphql_client.clone(),
4851 }
4852 }
4853 pub fn docker_build(&self) -> Container {
4859 let query = self.selection.select("dockerBuild");
4860 Container {
4861 proc: self.proc.clone(),
4862 selection: query,
4863 graphql_client: self.graphql_client.clone(),
4864 }
4865 }
4866 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4872 let mut query = self.selection.select("dockerBuild");
4873 if let Some(dockerfile) = opts.dockerfile {
4874 query = query.arg("dockerfile", dockerfile);
4875 }
4876 if let Some(platform) = opts.platform {
4877 query = query.arg("platform", platform);
4878 }
4879 if let Some(build_args) = opts.build_args {
4880 query = query.arg("buildArgs", build_args);
4881 }
4882 if let Some(target) = opts.target {
4883 query = query.arg("target", target);
4884 }
4885 if let Some(secrets) = opts.secrets {
4886 query = query.arg("secrets", secrets);
4887 }
4888 if let Some(no_init) = opts.no_init {
4889 query = query.arg("noInit", no_init);
4890 }
4891 if let Some(ssh) = opts.ssh {
4892 query = query.arg("ssh", ssh);
4893 }
4894 Container {
4895 proc: self.proc.clone(),
4896 selection: query,
4897 graphql_client: self.graphql_client.clone(),
4898 }
4899 }
4900 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4906 let query = self.selection.select("entries");
4907 query.execute(self.graphql_client.clone()).await
4908 }
4909 pub async fn entries_opts<'a>(
4915 &self,
4916 opts: DirectoryEntriesOpts<'a>,
4917 ) -> Result<Vec<String>, DaggerError> {
4918 let mut query = self.selection.select("entries");
4919 if let Some(path) = opts.path {
4920 query = query.arg("path", path);
4921 }
4922 query.execute(self.graphql_client.clone()).await
4923 }
4924 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4931 let mut query = self.selection.select("exists");
4932 query = query.arg("path", path.into());
4933 query.execute(self.graphql_client.clone()).await
4934 }
4935 pub async fn exists_opts(
4942 &self,
4943 path: impl Into<String>,
4944 opts: DirectoryExistsOpts,
4945 ) -> Result<bool, DaggerError> {
4946 let mut query = self.selection.select("exists");
4947 query = query.arg("path", path.into());
4948 if let Some(expected_type) = opts.expected_type {
4949 query = query.arg("expectedType", expected_type);
4950 }
4951 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4952 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4953 }
4954 query.execute(self.graphql_client.clone()).await
4955 }
4956 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4963 let mut query = self.selection.select("export");
4964 query = query.arg("path", path.into());
4965 query.execute(self.graphql_client.clone()).await
4966 }
4967 pub async fn export_opts(
4974 &self,
4975 path: impl Into<String>,
4976 opts: DirectoryExportOpts,
4977 ) -> Result<String, DaggerError> {
4978 let mut query = self.selection.select("export");
4979 query = query.arg("path", path.into());
4980 if let Some(wipe) = opts.wipe {
4981 query = query.arg("wipe", wipe);
4982 }
4983 query.execute(self.graphql_client.clone()).await
4984 }
4985 pub fn file(&self, path: impl Into<String>) -> File {
4991 let mut query = self.selection.select("file");
4992 query = query.arg("path", path.into());
4993 File {
4994 proc: self.proc.clone(),
4995 selection: query,
4996 graphql_client: self.graphql_client.clone(),
4997 }
4998 }
4999 pub fn filter(&self) -> Directory {
5005 let query = self.selection.select("filter");
5006 Directory {
5007 proc: self.proc.clone(),
5008 selection: query,
5009 graphql_client: self.graphql_client.clone(),
5010 }
5011 }
5012 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5018 let mut query = self.selection.select("filter");
5019 if let Some(exclude) = opts.exclude {
5020 query = query.arg("exclude", exclude);
5021 }
5022 if let Some(include) = opts.include {
5023 query = query.arg("include", include);
5024 }
5025 if let Some(gitignore) = opts.gitignore {
5026 query = query.arg("gitignore", gitignore);
5027 }
5028 Directory {
5029 proc: self.proc.clone(),
5030 selection: query,
5031 graphql_client: self.graphql_client.clone(),
5032 }
5033 }
5034 pub async fn find_up(
5041 &self,
5042 name: impl Into<String>,
5043 start: impl Into<String>,
5044 ) -> Result<String, DaggerError> {
5045 let mut query = self.selection.select("findUp");
5046 query = query.arg("name", name.into());
5047 query = query.arg("start", start.into());
5048 query.execute(self.graphql_client.clone()).await
5049 }
5050 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5056 let mut query = self.selection.select("glob");
5057 query = query.arg("pattern", pattern.into());
5058 query.execute(self.graphql_client.clone()).await
5059 }
5060 pub async fn id(&self) -> Result<Id, DaggerError> {
5062 let query = self.selection.select("id");
5063 query.execute(self.graphql_client.clone()).await
5064 }
5065 pub async fn name(&self) -> Result<String, DaggerError> {
5067 let query = self.selection.select("name");
5068 query.execute(self.graphql_client.clone()).await
5069 }
5070 pub async fn search(
5078 &self,
5079 pattern: impl Into<String>,
5080 ) -> Result<Vec<SearchResult>, DaggerError> {
5081 let mut query = self.selection.select("search");
5082 query = query.arg("pattern", pattern.into());
5083 let query = query.select("id");
5084 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5085 Ok(ids
5086 .into_iter()
5087 .map(|id| SearchResult {
5088 proc: self.proc.clone(),
5089 selection: crate::querybuilder::query()
5090 .select("node")
5091 .arg("id", &id.0)
5092 .inline_fragment("SearchResult"),
5093 graphql_client: self.graphql_client.clone(),
5094 })
5095 .collect())
5096 }
5097 pub async fn search_opts<'a>(
5105 &self,
5106 pattern: impl Into<String>,
5107 opts: DirectorySearchOpts<'a>,
5108 ) -> Result<Vec<SearchResult>, DaggerError> {
5109 let mut query = self.selection.select("search");
5110 query = query.arg("pattern", pattern.into());
5111 if let Some(paths) = opts.paths {
5112 query = query.arg("paths", paths);
5113 }
5114 if let Some(globs) = opts.globs {
5115 query = query.arg("globs", globs);
5116 }
5117 if let Some(literal) = opts.literal {
5118 query = query.arg("literal", literal);
5119 }
5120 if let Some(multiline) = opts.multiline {
5121 query = query.arg("multiline", multiline);
5122 }
5123 if let Some(dotall) = opts.dotall {
5124 query = query.arg("dotall", dotall);
5125 }
5126 if let Some(insensitive) = opts.insensitive {
5127 query = query.arg("insensitive", insensitive);
5128 }
5129 if let Some(skip_ignored) = opts.skip_ignored {
5130 query = query.arg("skipIgnored", skip_ignored);
5131 }
5132 if let Some(skip_hidden) = opts.skip_hidden {
5133 query = query.arg("skipHidden", skip_hidden);
5134 }
5135 if let Some(files_only) = opts.files_only {
5136 query = query.arg("filesOnly", files_only);
5137 }
5138 if let Some(limit) = opts.limit {
5139 query = query.arg("limit", limit);
5140 }
5141 let query = query.select("id");
5142 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5143 Ok(ids
5144 .into_iter()
5145 .map(|id| SearchResult {
5146 proc: self.proc.clone(),
5147 selection: crate::querybuilder::query()
5148 .select("node")
5149 .arg("id", &id.0)
5150 .inline_fragment("SearchResult"),
5151 graphql_client: self.graphql_client.clone(),
5152 })
5153 .collect())
5154 }
5155 pub fn stat(&self, path: impl Into<String>) -> Stat {
5162 let mut query = self.selection.select("stat");
5163 query = query.arg("path", path.into());
5164 Stat {
5165 proc: self.proc.clone(),
5166 selection: query,
5167 graphql_client: self.graphql_client.clone(),
5168 }
5169 }
5170 pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5177 let mut query = self.selection.select("stat");
5178 query = query.arg("path", path.into());
5179 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5180 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5181 }
5182 Stat {
5183 proc: self.proc.clone(),
5184 selection: query,
5185 graphql_client: self.graphql_client.clone(),
5186 }
5187 }
5188 pub async fn sync(&self) -> Result<Directory, DaggerError> {
5190 let query = self.selection.select("sync");
5191 let id: Id = query.execute(self.graphql_client.clone()).await?;
5192 Ok(Directory {
5193 proc: self.proc.clone(),
5194 selection: query
5195 .root()
5196 .select("node")
5197 .arg("id", &id.0)
5198 .inline_fragment("Directory"),
5199 graphql_client: self.graphql_client.clone(),
5200 })
5201 }
5202 pub fn terminal(&self) -> Directory {
5208 let query = self.selection.select("terminal");
5209 Directory {
5210 proc: self.proc.clone(),
5211 selection: query,
5212 graphql_client: self.graphql_client.clone(),
5213 }
5214 }
5215 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5221 let mut query = self.selection.select("terminal");
5222 if let Some(container) = opts.container {
5223 query = query.arg("container", container);
5224 }
5225 if let Some(cmd) = opts.cmd {
5226 query = query.arg("cmd", cmd);
5227 }
5228 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5229 query = query.arg(
5230 "experimentalPrivilegedNesting",
5231 experimental_privileged_nesting,
5232 );
5233 }
5234 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5235 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5236 }
5237 Directory {
5238 proc: self.proc.clone(),
5239 selection: query,
5240 graphql_client: self.graphql_client.clone(),
5241 }
5242 }
5243 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5249 let mut query = self.selection.select("withChanges");
5250 query = query.arg_lazy(
5251 "changes",
5252 Box::new(move || {
5253 let changes = changes.clone();
5254 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5255 }),
5256 );
5257 Directory {
5258 proc: self.proc.clone(),
5259 selection: query,
5260 graphql_client: self.graphql_client.clone(),
5261 }
5262 }
5263 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5271 let mut query = self.selection.select("withDirectory");
5272 query = query.arg("path", path.into());
5273 query = query.arg_lazy(
5274 "source",
5275 Box::new(move || {
5276 let source = source.clone();
5277 Box::pin(async move { source.into_id().await.unwrap().quote() })
5278 }),
5279 );
5280 Directory {
5281 proc: self.proc.clone(),
5282 selection: query,
5283 graphql_client: self.graphql_client.clone(),
5284 }
5285 }
5286 pub fn with_directory_opts<'a>(
5294 &self,
5295 path: impl Into<String>,
5296 source: impl IntoID<Id>,
5297 opts: DirectoryWithDirectoryOpts<'a>,
5298 ) -> Directory {
5299 let mut query = self.selection.select("withDirectory");
5300 query = query.arg("path", path.into());
5301 query = query.arg_lazy(
5302 "source",
5303 Box::new(move || {
5304 let source = source.clone();
5305 Box::pin(async move { source.into_id().await.unwrap().quote() })
5306 }),
5307 );
5308 if let Some(exclude) = opts.exclude {
5309 query = query.arg("exclude", exclude);
5310 }
5311 if let Some(include) = opts.include {
5312 query = query.arg("include", include);
5313 }
5314 if let Some(gitignore) = opts.gitignore {
5315 query = query.arg("gitignore", gitignore);
5316 }
5317 if let Some(owner) = opts.owner {
5318 query = query.arg("owner", owner);
5319 }
5320 if let Some(permissions) = opts.permissions {
5321 query = query.arg("permissions", permissions);
5322 }
5323 Directory {
5324 proc: self.proc.clone(),
5325 selection: query,
5326 graphql_client: self.graphql_client.clone(),
5327 }
5328 }
5329 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5335 let mut query = self.selection.select("withError");
5336 query = query.arg("err", err.into());
5337 Directory {
5338 proc: self.proc.clone(),
5339 selection: query,
5340 graphql_client: self.graphql_client.clone(),
5341 }
5342 }
5343 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5351 let mut query = self.selection.select("withFile");
5352 query = query.arg("path", path.into());
5353 query = query.arg_lazy(
5354 "source",
5355 Box::new(move || {
5356 let source = source.clone();
5357 Box::pin(async move { source.into_id().await.unwrap().quote() })
5358 }),
5359 );
5360 Directory {
5361 proc: self.proc.clone(),
5362 selection: query,
5363 graphql_client: self.graphql_client.clone(),
5364 }
5365 }
5366 pub fn with_file_opts<'a>(
5374 &self,
5375 path: impl Into<String>,
5376 source: impl IntoID<Id>,
5377 opts: DirectoryWithFileOpts<'a>,
5378 ) -> Directory {
5379 let mut query = self.selection.select("withFile");
5380 query = query.arg("path", path.into());
5381 query = query.arg_lazy(
5382 "source",
5383 Box::new(move || {
5384 let source = source.clone();
5385 Box::pin(async move { source.into_id().await.unwrap().quote() })
5386 }),
5387 );
5388 if let Some(permissions) = opts.permissions {
5389 query = query.arg("permissions", permissions);
5390 }
5391 if let Some(owner) = opts.owner {
5392 query = query.arg("owner", owner);
5393 }
5394 Directory {
5395 proc: self.proc.clone(),
5396 selection: query,
5397 graphql_client: self.graphql_client.clone(),
5398 }
5399 }
5400 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5408 let mut query = self.selection.select("withFiles");
5409 query = query.arg("path", path.into());
5410 query = query.arg("sources", sources);
5411 Directory {
5412 proc: self.proc.clone(),
5413 selection: query,
5414 graphql_client: self.graphql_client.clone(),
5415 }
5416 }
5417 pub fn with_files_opts(
5425 &self,
5426 path: impl Into<String>,
5427 sources: Vec<Id>,
5428 opts: DirectoryWithFilesOpts,
5429 ) -> Directory {
5430 let mut query = self.selection.select("withFiles");
5431 query = query.arg("path", path.into());
5432 query = query.arg("sources", sources);
5433 if let Some(permissions) = opts.permissions {
5434 query = query.arg("permissions", permissions);
5435 }
5436 Directory {
5437 proc: self.proc.clone(),
5438 selection: query,
5439 graphql_client: self.graphql_client.clone(),
5440 }
5441 }
5442 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5449 let mut query = self.selection.select("withNewDirectory");
5450 query = query.arg("path", path.into());
5451 Directory {
5452 proc: self.proc.clone(),
5453 selection: query,
5454 graphql_client: self.graphql_client.clone(),
5455 }
5456 }
5457 pub fn with_new_directory_opts(
5464 &self,
5465 path: impl Into<String>,
5466 opts: DirectoryWithNewDirectoryOpts,
5467 ) -> Directory {
5468 let mut query = self.selection.select("withNewDirectory");
5469 query = query.arg("path", path.into());
5470 if let Some(permissions) = opts.permissions {
5471 query = query.arg("permissions", permissions);
5472 }
5473 Directory {
5474 proc: self.proc.clone(),
5475 selection: query,
5476 graphql_client: self.graphql_client.clone(),
5477 }
5478 }
5479 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5487 let mut query = self.selection.select("withNewFile");
5488 query = query.arg("path", path.into());
5489 query = query.arg("contents", contents.into());
5490 Directory {
5491 proc: self.proc.clone(),
5492 selection: query,
5493 graphql_client: self.graphql_client.clone(),
5494 }
5495 }
5496 pub fn with_new_file_opts(
5504 &self,
5505 path: impl Into<String>,
5506 contents: impl Into<String>,
5507 opts: DirectoryWithNewFileOpts,
5508 ) -> Directory {
5509 let mut query = self.selection.select("withNewFile");
5510 query = query.arg("path", path.into());
5511 query = query.arg("contents", contents.into());
5512 if let Some(permissions) = opts.permissions {
5513 query = query.arg("permissions", permissions);
5514 }
5515 Directory {
5516 proc: self.proc.clone(),
5517 selection: query,
5518 graphql_client: self.graphql_client.clone(),
5519 }
5520 }
5521 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5527 let mut query = self.selection.select("withPatch");
5528 query = query.arg("patch", patch.into());
5529 Directory {
5530 proc: self.proc.clone(),
5531 selection: query,
5532 graphql_client: self.graphql_client.clone(),
5533 }
5534 }
5535 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5541 let mut query = self.selection.select("withPatchFile");
5542 query = query.arg_lazy(
5543 "patch",
5544 Box::new(move || {
5545 let patch = patch.clone();
5546 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5547 }),
5548 );
5549 Directory {
5550 proc: self.proc.clone(),
5551 selection: query,
5552 graphql_client: self.graphql_client.clone(),
5553 }
5554 }
5555 pub fn with_symlink(
5562 &self,
5563 target: impl Into<String>,
5564 link_name: impl Into<String>,
5565 ) -> Directory {
5566 let mut query = self.selection.select("withSymlink");
5567 query = query.arg("target", target.into());
5568 query = query.arg("linkName", link_name.into());
5569 Directory {
5570 proc: self.proc.clone(),
5571 selection: query,
5572 graphql_client: self.graphql_client.clone(),
5573 }
5574 }
5575 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5583 let mut query = self.selection.select("withTimestamps");
5584 query = query.arg("timestamp", timestamp);
5585 Directory {
5586 proc: self.proc.clone(),
5587 selection: query,
5588 graphql_client: self.graphql_client.clone(),
5589 }
5590 }
5591 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5597 let mut query = self.selection.select("withoutDirectory");
5598 query = query.arg("path", path.into());
5599 Directory {
5600 proc: self.proc.clone(),
5601 selection: query,
5602 graphql_client: self.graphql_client.clone(),
5603 }
5604 }
5605 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5611 let mut query = self.selection.select("withoutFile");
5612 query = query.arg("path", path.into());
5613 Directory {
5614 proc: self.proc.clone(),
5615 selection: query,
5616 graphql_client: self.graphql_client.clone(),
5617 }
5618 }
5619 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5625 let mut query = self.selection.select("withoutFiles");
5626 query = query.arg(
5627 "paths",
5628 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5629 );
5630 Directory {
5631 proc: self.proc.clone(),
5632 selection: query,
5633 graphql_client: self.graphql_client.clone(),
5634 }
5635 }
5636}
5637impl Exportable for Directory {
5638 fn export(
5639 &self,
5640 path: impl Into<String>,
5641 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5642 let mut query = self.selection.select("export");
5643 query = query.arg("path", path.into());
5644 let graphql_client = self.graphql_client.clone();
5645 async move { query.execute(graphql_client).await }
5646 }
5647 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5648 let query = self.selection.select("id");
5649 let graphql_client = self.graphql_client.clone();
5650 async move { query.execute(graphql_client).await }
5651 }
5652}
5653impl Node for Directory {
5654 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5655 let query = self.selection.select("id");
5656 let graphql_client = self.graphql_client.clone();
5657 async move { query.execute(graphql_client).await }
5658 }
5659}
5660impl Syncer for Directory {
5661 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5662 let query = self.selection.select("id");
5663 let graphql_client = self.graphql_client.clone();
5664 async move { query.execute(graphql_client).await }
5665 }
5666 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5667 let query = self.selection.select("sync");
5668 let graphql_client = self.graphql_client.clone();
5669 async move { query.execute(graphql_client).await }
5670 }
5671}
5672#[derive(Clone)]
5673pub struct Engine {
5674 pub proc: Option<Arc<DaggerSessionProc>>,
5675 pub selection: Selection,
5676 pub graphql_client: DynGraphQLClient,
5677}
5678impl IntoID<Id> for Engine {
5679 fn into_id(
5680 self,
5681 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5682 Box::pin(async move { self.id().await })
5683 }
5684}
5685impl Loadable for Engine {
5686 fn graphql_type() -> &'static str {
5687 "Engine"
5688 }
5689 fn from_query(
5690 proc: Option<Arc<DaggerSessionProc>>,
5691 selection: Selection,
5692 graphql_client: DynGraphQLClient,
5693 ) -> Self {
5694 Self {
5695 proc,
5696 selection,
5697 graphql_client,
5698 }
5699 }
5700}
5701impl Engine {
5702 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5704 let query = self.selection.select("clients");
5705 query.execute(self.graphql_client.clone()).await
5706 }
5707 pub async fn id(&self) -> Result<Id, DaggerError> {
5709 let query = self.selection.select("id");
5710 query.execute(self.graphql_client.clone()).await
5711 }
5712 pub fn local_cache(&self) -> EngineCache {
5714 let query = self.selection.select("localCache");
5715 EngineCache {
5716 proc: self.proc.clone(),
5717 selection: query,
5718 graphql_client: self.graphql_client.clone(),
5719 }
5720 }
5721 pub async fn name(&self) -> Result<String, DaggerError> {
5723 let query = self.selection.select("name");
5724 query.execute(self.graphql_client.clone()).await
5725 }
5726}
5727impl Node for Engine {
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}
5734#[derive(Clone)]
5735pub struct EngineCache {
5736 pub proc: Option<Arc<DaggerSessionProc>>,
5737 pub selection: Selection,
5738 pub graphql_client: DynGraphQLClient,
5739}
5740#[derive(Builder, Debug, PartialEq)]
5741pub struct EngineCacheEntrySetOpts<'a> {
5742 #[builder(setter(into, strip_option), default)]
5743 pub key: Option<&'a str>,
5744}
5745#[derive(Builder, Debug, PartialEq)]
5746pub struct EngineCachePruneOpts<'a> {
5747 #[builder(setter(into, strip_option), default)]
5749 pub max_used_space: Option<&'a str>,
5750 #[builder(setter(into, strip_option), default)]
5752 pub min_free_space: Option<&'a str>,
5753 #[builder(setter(into, strip_option), default)]
5755 pub reserved_space: Option<&'a str>,
5756 #[builder(setter(into, strip_option), default)]
5758 pub target_space: Option<&'a str>,
5759 #[builder(setter(into, strip_option), default)]
5761 pub use_default_policy: Option<bool>,
5762}
5763impl IntoID<Id> for EngineCache {
5764 fn into_id(
5765 self,
5766 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5767 Box::pin(async move { self.id().await })
5768 }
5769}
5770impl Loadable for EngineCache {
5771 fn graphql_type() -> &'static str {
5772 "EngineCache"
5773 }
5774 fn from_query(
5775 proc: Option<Arc<DaggerSessionProc>>,
5776 selection: Selection,
5777 graphql_client: DynGraphQLClient,
5778 ) -> Self {
5779 Self {
5780 proc,
5781 selection,
5782 graphql_client,
5783 }
5784 }
5785}
5786impl EngineCache {
5787 pub fn entry_set(&self) -> EngineCacheEntrySet {
5793 let query = self.selection.select("entrySet");
5794 EngineCacheEntrySet {
5795 proc: self.proc.clone(),
5796 selection: query,
5797 graphql_client: self.graphql_client.clone(),
5798 }
5799 }
5800 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5806 let mut query = self.selection.select("entrySet");
5807 if let Some(key) = opts.key {
5808 query = query.arg("key", key);
5809 }
5810 EngineCacheEntrySet {
5811 proc: self.proc.clone(),
5812 selection: query,
5813 graphql_client: self.graphql_client.clone(),
5814 }
5815 }
5816 pub async fn id(&self) -> Result<Id, DaggerError> {
5818 let query = self.selection.select("id");
5819 query.execute(self.graphql_client.clone()).await
5820 }
5821 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5823 let query = self.selection.select("maxUsedSpace");
5824 query.execute(self.graphql_client.clone()).await
5825 }
5826 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5828 let query = self.selection.select("minFreeSpace");
5829 query.execute(self.graphql_client.clone()).await
5830 }
5831 pub async fn prune(&self) -> Result<Void, DaggerError> {
5837 let query = self.selection.select("prune");
5838 query.execute(self.graphql_client.clone()).await
5839 }
5840 pub async fn prune_opts<'a>(
5846 &self,
5847 opts: EngineCachePruneOpts<'a>,
5848 ) -> Result<Void, DaggerError> {
5849 let mut query = self.selection.select("prune");
5850 if let Some(use_default_policy) = opts.use_default_policy {
5851 query = query.arg("useDefaultPolicy", use_default_policy);
5852 }
5853 if let Some(max_used_space) = opts.max_used_space {
5854 query = query.arg("maxUsedSpace", max_used_space);
5855 }
5856 if let Some(reserved_space) = opts.reserved_space {
5857 query = query.arg("reservedSpace", reserved_space);
5858 }
5859 if let Some(min_free_space) = opts.min_free_space {
5860 query = query.arg("minFreeSpace", min_free_space);
5861 }
5862 if let Some(target_space) = opts.target_space {
5863 query = query.arg("targetSpace", target_space);
5864 }
5865 query.execute(self.graphql_client.clone()).await
5866 }
5867 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5869 let query = self.selection.select("reservedSpace");
5870 query.execute(self.graphql_client.clone()).await
5871 }
5872 pub async fn target_space(&self) -> Result<isize, DaggerError> {
5874 let query = self.selection.select("targetSpace");
5875 query.execute(self.graphql_client.clone()).await
5876 }
5877}
5878impl Node for EngineCache {
5879 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5880 let query = self.selection.select("id");
5881 let graphql_client = self.graphql_client.clone();
5882 async move { query.execute(graphql_client).await }
5883 }
5884}
5885#[derive(Clone)]
5886pub struct EngineCacheEntry {
5887 pub proc: Option<Arc<DaggerSessionProc>>,
5888 pub selection: Selection,
5889 pub graphql_client: DynGraphQLClient,
5890}
5891impl IntoID<Id> for EngineCacheEntry {
5892 fn into_id(
5893 self,
5894 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5895 Box::pin(async move { self.id().await })
5896 }
5897}
5898impl Loadable for EngineCacheEntry {
5899 fn graphql_type() -> &'static str {
5900 "EngineCacheEntry"
5901 }
5902 fn from_query(
5903 proc: Option<Arc<DaggerSessionProc>>,
5904 selection: Selection,
5905 graphql_client: DynGraphQLClient,
5906 ) -> Self {
5907 Self {
5908 proc,
5909 selection,
5910 graphql_client,
5911 }
5912 }
5913}
5914impl EngineCacheEntry {
5915 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5917 let query = self.selection.select("activelyUsed");
5918 query.execute(self.graphql_client.clone()).await
5919 }
5920 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5922 let query = self.selection.select("createdTimeUnixNano");
5923 query.execute(self.graphql_client.clone()).await
5924 }
5925 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
5927 let query = self.selection.select("dagqlCall");
5928 query.execute(self.graphql_client.clone()).await
5929 }
5930 pub async fn description(&self) -> Result<String, DaggerError> {
5932 let query = self.selection.select("description");
5933 query.execute(self.graphql_client.clone()).await
5934 }
5935 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5937 let query = self.selection.select("diskSpaceBytes");
5938 query.execute(self.graphql_client.clone()).await
5939 }
5940 pub async fn id(&self) -> Result<Id, DaggerError> {
5942 let query = self.selection.select("id");
5943 query.execute(self.graphql_client.clone()).await
5944 }
5945 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5947 let query = self.selection.select("mostRecentUseTimeUnixNano");
5948 query.execute(self.graphql_client.clone()).await
5949 }
5950 pub async fn record_type(&self) -> Result<String, DaggerError> {
5952 let query = self.selection.select("recordType");
5953 query.execute(self.graphql_client.clone()).await
5954 }
5955 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
5957 let query = self.selection.select("recordTypes");
5958 query.execute(self.graphql_client.clone()).await
5959 }
5960}
5961impl Node for EngineCacheEntry {
5962 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5963 let query = self.selection.select("id");
5964 let graphql_client = self.graphql_client.clone();
5965 async move { query.execute(graphql_client).await }
5966 }
5967}
5968#[derive(Clone)]
5969pub struct EngineCacheEntrySet {
5970 pub proc: Option<Arc<DaggerSessionProc>>,
5971 pub selection: Selection,
5972 pub graphql_client: DynGraphQLClient,
5973}
5974impl IntoID<Id> for EngineCacheEntrySet {
5975 fn into_id(
5976 self,
5977 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5978 Box::pin(async move { self.id().await })
5979 }
5980}
5981impl Loadable for EngineCacheEntrySet {
5982 fn graphql_type() -> &'static str {
5983 "EngineCacheEntrySet"
5984 }
5985 fn from_query(
5986 proc: Option<Arc<DaggerSessionProc>>,
5987 selection: Selection,
5988 graphql_client: DynGraphQLClient,
5989 ) -> Self {
5990 Self {
5991 proc,
5992 selection,
5993 graphql_client,
5994 }
5995 }
5996}
5997impl EngineCacheEntrySet {
5998 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6000 let query = self.selection.select("diskSpaceBytes");
6001 query.execute(self.graphql_client.clone()).await
6002 }
6003 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6005 let query = self.selection.select("entries");
6006 let query = query.select("id");
6007 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6008 Ok(ids
6009 .into_iter()
6010 .map(|id| EngineCacheEntry {
6011 proc: self.proc.clone(),
6012 selection: crate::querybuilder::query()
6013 .select("node")
6014 .arg("id", &id.0)
6015 .inline_fragment("EngineCacheEntry"),
6016 graphql_client: self.graphql_client.clone(),
6017 })
6018 .collect())
6019 }
6020 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6022 let query = self.selection.select("entryCount");
6023 query.execute(self.graphql_client.clone()).await
6024 }
6025 pub async fn id(&self) -> Result<Id, DaggerError> {
6027 let query = self.selection.select("id");
6028 query.execute(self.graphql_client.clone()).await
6029 }
6030}
6031impl Node for EngineCacheEntrySet {
6032 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6033 let query = self.selection.select("id");
6034 let graphql_client = self.graphql_client.clone();
6035 async move { query.execute(graphql_client).await }
6036 }
6037}
6038#[derive(Clone)]
6039pub struct EnumTypeDef {
6040 pub proc: Option<Arc<DaggerSessionProc>>,
6041 pub selection: Selection,
6042 pub graphql_client: DynGraphQLClient,
6043}
6044impl IntoID<Id> for EnumTypeDef {
6045 fn into_id(
6046 self,
6047 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6048 Box::pin(async move { self.id().await })
6049 }
6050}
6051impl Loadable for EnumTypeDef {
6052 fn graphql_type() -> &'static str {
6053 "EnumTypeDef"
6054 }
6055 fn from_query(
6056 proc: Option<Arc<DaggerSessionProc>>,
6057 selection: Selection,
6058 graphql_client: DynGraphQLClient,
6059 ) -> Self {
6060 Self {
6061 proc,
6062 selection,
6063 graphql_client,
6064 }
6065 }
6066}
6067impl EnumTypeDef {
6068 pub async fn description(&self) -> Result<String, DaggerError> {
6070 let query = self.selection.select("description");
6071 query.execute(self.graphql_client.clone()).await
6072 }
6073 pub async fn id(&self) -> Result<Id, DaggerError> {
6075 let query = self.selection.select("id");
6076 query.execute(self.graphql_client.clone()).await
6077 }
6078 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6080 let query = self.selection.select("members");
6081 let query = query.select("id");
6082 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6083 Ok(ids
6084 .into_iter()
6085 .map(|id| EnumValueTypeDef {
6086 proc: self.proc.clone(),
6087 selection: crate::querybuilder::query()
6088 .select("node")
6089 .arg("id", &id.0)
6090 .inline_fragment("EnumValueTypeDef"),
6091 graphql_client: self.graphql_client.clone(),
6092 })
6093 .collect())
6094 }
6095 pub async fn name(&self) -> Result<String, DaggerError> {
6097 let query = self.selection.select("name");
6098 query.execute(self.graphql_client.clone()).await
6099 }
6100 pub fn source_map(&self) -> SourceMap {
6102 let query = self.selection.select("sourceMap");
6103 SourceMap {
6104 proc: self.proc.clone(),
6105 selection: query,
6106 graphql_client: self.graphql_client.clone(),
6107 }
6108 }
6109 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6111 let query = self.selection.select("sourceModuleName");
6112 query.execute(self.graphql_client.clone()).await
6113 }
6114 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6116 let query = self.selection.select("values");
6117 let query = query.select("id");
6118 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6119 Ok(ids
6120 .into_iter()
6121 .map(|id| EnumValueTypeDef {
6122 proc: self.proc.clone(),
6123 selection: crate::querybuilder::query()
6124 .select("node")
6125 .arg("id", &id.0)
6126 .inline_fragment("EnumValueTypeDef"),
6127 graphql_client: self.graphql_client.clone(),
6128 })
6129 .collect())
6130 }
6131}
6132impl Node for EnumTypeDef {
6133 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6134 let query = self.selection.select("id");
6135 let graphql_client = self.graphql_client.clone();
6136 async move { query.execute(graphql_client).await }
6137 }
6138}
6139#[derive(Clone)]
6140pub struct EnumValueTypeDef {
6141 pub proc: Option<Arc<DaggerSessionProc>>,
6142 pub selection: Selection,
6143 pub graphql_client: DynGraphQLClient,
6144}
6145impl IntoID<Id> for EnumValueTypeDef {
6146 fn into_id(
6147 self,
6148 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6149 Box::pin(async move { self.id().await })
6150 }
6151}
6152impl Loadable for EnumValueTypeDef {
6153 fn graphql_type() -> &'static str {
6154 "EnumValueTypeDef"
6155 }
6156 fn from_query(
6157 proc: Option<Arc<DaggerSessionProc>>,
6158 selection: Selection,
6159 graphql_client: DynGraphQLClient,
6160 ) -> Self {
6161 Self {
6162 proc,
6163 selection,
6164 graphql_client,
6165 }
6166 }
6167}
6168impl EnumValueTypeDef {
6169 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6171 let query = self.selection.select("deprecated");
6172 query.execute(self.graphql_client.clone()).await
6173 }
6174 pub async fn description(&self) -> Result<String, DaggerError> {
6176 let query = self.selection.select("description");
6177 query.execute(self.graphql_client.clone()).await
6178 }
6179 pub async fn id(&self) -> Result<Id, DaggerError> {
6181 let query = self.selection.select("id");
6182 query.execute(self.graphql_client.clone()).await
6183 }
6184 pub async fn name(&self) -> Result<String, DaggerError> {
6186 let query = self.selection.select("name");
6187 query.execute(self.graphql_client.clone()).await
6188 }
6189 pub fn source_map(&self) -> SourceMap {
6191 let query = self.selection.select("sourceMap");
6192 SourceMap {
6193 proc: self.proc.clone(),
6194 selection: query,
6195 graphql_client: self.graphql_client.clone(),
6196 }
6197 }
6198 pub async fn value(&self) -> Result<String, DaggerError> {
6200 let query = self.selection.select("value");
6201 query.execute(self.graphql_client.clone()).await
6202 }
6203}
6204impl Node for EnumValueTypeDef {
6205 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6206 let query = self.selection.select("id");
6207 let graphql_client = self.graphql_client.clone();
6208 async move { query.execute(graphql_client).await }
6209 }
6210}
6211#[derive(Clone)]
6212pub struct Env {
6213 pub proc: Option<Arc<DaggerSessionProc>>,
6214 pub selection: Selection,
6215 pub graphql_client: DynGraphQLClient,
6216}
6217#[derive(Builder, Debug, PartialEq)]
6218pub struct EnvChecksOpts<'a> {
6219 #[builder(setter(into, strip_option), default)]
6221 pub include: Option<Vec<&'a str>>,
6222 #[builder(setter(into, strip_option), default)]
6224 pub no_generate: Option<bool>,
6225}
6226#[derive(Builder, Debug, PartialEq)]
6227pub struct EnvServicesOpts<'a> {
6228 #[builder(setter(into, strip_option), default)]
6230 pub include: Option<Vec<&'a str>>,
6231}
6232impl IntoID<Id> for Env {
6233 fn into_id(
6234 self,
6235 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6236 Box::pin(async move { self.id().await })
6237 }
6238}
6239impl Loadable for Env {
6240 fn graphql_type() -> &'static str {
6241 "Env"
6242 }
6243 fn from_query(
6244 proc: Option<Arc<DaggerSessionProc>>,
6245 selection: Selection,
6246 graphql_client: DynGraphQLClient,
6247 ) -> Self {
6248 Self {
6249 proc,
6250 selection,
6251 graphql_client,
6252 }
6253 }
6254}
6255impl Env {
6256 pub fn check(&self, name: impl Into<String>) -> Check {
6262 let mut query = self.selection.select("check");
6263 query = query.arg("name", name.into());
6264 Check {
6265 proc: self.proc.clone(),
6266 selection: query,
6267 graphql_client: self.graphql_client.clone(),
6268 }
6269 }
6270 pub fn checks(&self) -> CheckGroup {
6276 let query = self.selection.select("checks");
6277 CheckGroup {
6278 proc: self.proc.clone(),
6279 selection: query,
6280 graphql_client: self.graphql_client.clone(),
6281 }
6282 }
6283 pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6289 let mut query = self.selection.select("checks");
6290 if let Some(include) = opts.include {
6291 query = query.arg("include", include);
6292 }
6293 if let Some(no_generate) = opts.no_generate {
6294 query = query.arg("noGenerate", no_generate);
6295 }
6296 CheckGroup {
6297 proc: self.proc.clone(),
6298 selection: query,
6299 graphql_client: self.graphql_client.clone(),
6300 }
6301 }
6302 pub async fn id(&self) -> Result<Id, DaggerError> {
6304 let query = self.selection.select("id");
6305 query.execute(self.graphql_client.clone()).await
6306 }
6307 pub fn input(&self, name: impl Into<String>) -> Binding {
6309 let mut query = self.selection.select("input");
6310 query = query.arg("name", name.into());
6311 Binding {
6312 proc: self.proc.clone(),
6313 selection: query,
6314 graphql_client: self.graphql_client.clone(),
6315 }
6316 }
6317 pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6319 let query = self.selection.select("inputs");
6320 let query = query.select("id");
6321 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6322 Ok(ids
6323 .into_iter()
6324 .map(|id| Binding {
6325 proc: self.proc.clone(),
6326 selection: crate::querybuilder::query()
6327 .select("node")
6328 .arg("id", &id.0)
6329 .inline_fragment("Binding"),
6330 graphql_client: self.graphql_client.clone(),
6331 })
6332 .collect())
6333 }
6334 pub fn output(&self, name: impl Into<String>) -> Binding {
6336 let mut query = self.selection.select("output");
6337 query = query.arg("name", name.into());
6338 Binding {
6339 proc: self.proc.clone(),
6340 selection: query,
6341 graphql_client: self.graphql_client.clone(),
6342 }
6343 }
6344 pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6346 let query = self.selection.select("outputs");
6347 let query = query.select("id");
6348 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6349 Ok(ids
6350 .into_iter()
6351 .map(|id| Binding {
6352 proc: self.proc.clone(),
6353 selection: crate::querybuilder::query()
6354 .select("node")
6355 .arg("id", &id.0)
6356 .inline_fragment("Binding"),
6357 graphql_client: self.graphql_client.clone(),
6358 })
6359 .collect())
6360 }
6361 pub fn services(&self) -> UpGroup {
6367 let query = self.selection.select("services");
6368 UpGroup {
6369 proc: self.proc.clone(),
6370 selection: query,
6371 graphql_client: self.graphql_client.clone(),
6372 }
6373 }
6374 pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6380 let mut query = self.selection.select("services");
6381 if let Some(include) = opts.include {
6382 query = query.arg("include", include);
6383 }
6384 UpGroup {
6385 proc: self.proc.clone(),
6386 selection: query,
6387 graphql_client: self.graphql_client.clone(),
6388 }
6389 }
6390 pub fn with_address_input(
6398 &self,
6399 name: impl Into<String>,
6400 value: impl IntoID<Id>,
6401 description: impl Into<String>,
6402 ) -> Env {
6403 let mut query = self.selection.select("withAddressInput");
6404 query = query.arg("name", name.into());
6405 query = query.arg_lazy(
6406 "value",
6407 Box::new(move || {
6408 let value = value.clone();
6409 Box::pin(async move { value.into_id().await.unwrap().quote() })
6410 }),
6411 );
6412 query = query.arg("description", description.into());
6413 Env {
6414 proc: self.proc.clone(),
6415 selection: query,
6416 graphql_client: self.graphql_client.clone(),
6417 }
6418 }
6419 pub fn with_address_output(
6426 &self,
6427 name: impl Into<String>,
6428 description: impl Into<String>,
6429 ) -> Env {
6430 let mut query = self.selection.select("withAddressOutput");
6431 query = query.arg("name", name.into());
6432 query = query.arg("description", description.into());
6433 Env {
6434 proc: self.proc.clone(),
6435 selection: query,
6436 graphql_client: self.graphql_client.clone(),
6437 }
6438 }
6439 pub fn with_cache_volume_input(
6447 &self,
6448 name: impl Into<String>,
6449 value: impl IntoID<Id>,
6450 description: impl Into<String>,
6451 ) -> Env {
6452 let mut query = self.selection.select("withCacheVolumeInput");
6453 query = query.arg("name", name.into());
6454 query = query.arg_lazy(
6455 "value",
6456 Box::new(move || {
6457 let value = value.clone();
6458 Box::pin(async move { value.into_id().await.unwrap().quote() })
6459 }),
6460 );
6461 query = query.arg("description", description.into());
6462 Env {
6463 proc: self.proc.clone(),
6464 selection: query,
6465 graphql_client: self.graphql_client.clone(),
6466 }
6467 }
6468 pub fn with_cache_volume_output(
6475 &self,
6476 name: impl Into<String>,
6477 description: impl Into<String>,
6478 ) -> Env {
6479 let mut query = self.selection.select("withCacheVolumeOutput");
6480 query = query.arg("name", name.into());
6481 query = query.arg("description", description.into());
6482 Env {
6483 proc: self.proc.clone(),
6484 selection: query,
6485 graphql_client: self.graphql_client.clone(),
6486 }
6487 }
6488 pub fn with_changeset_input(
6496 &self,
6497 name: impl Into<String>,
6498 value: impl IntoID<Id>,
6499 description: impl Into<String>,
6500 ) -> Env {
6501 let mut query = self.selection.select("withChangesetInput");
6502 query = query.arg("name", name.into());
6503 query = query.arg_lazy(
6504 "value",
6505 Box::new(move || {
6506 let value = value.clone();
6507 Box::pin(async move { value.into_id().await.unwrap().quote() })
6508 }),
6509 );
6510 query = query.arg("description", description.into());
6511 Env {
6512 proc: self.proc.clone(),
6513 selection: query,
6514 graphql_client: self.graphql_client.clone(),
6515 }
6516 }
6517 pub fn with_changeset_output(
6524 &self,
6525 name: impl Into<String>,
6526 description: impl Into<String>,
6527 ) -> Env {
6528 let mut query = self.selection.select("withChangesetOutput");
6529 query = query.arg("name", name.into());
6530 query = query.arg("description", description.into());
6531 Env {
6532 proc: self.proc.clone(),
6533 selection: query,
6534 graphql_client: self.graphql_client.clone(),
6535 }
6536 }
6537 pub fn with_check_group_input(
6545 &self,
6546 name: impl Into<String>,
6547 value: impl IntoID<Id>,
6548 description: impl Into<String>,
6549 ) -> Env {
6550 let mut query = self.selection.select("withCheckGroupInput");
6551 query = query.arg("name", name.into());
6552 query = query.arg_lazy(
6553 "value",
6554 Box::new(move || {
6555 let value = value.clone();
6556 Box::pin(async move { value.into_id().await.unwrap().quote() })
6557 }),
6558 );
6559 query = query.arg("description", description.into());
6560 Env {
6561 proc: self.proc.clone(),
6562 selection: query,
6563 graphql_client: self.graphql_client.clone(),
6564 }
6565 }
6566 pub fn with_check_group_output(
6573 &self,
6574 name: impl Into<String>,
6575 description: impl Into<String>,
6576 ) -> Env {
6577 let mut query = self.selection.select("withCheckGroupOutput");
6578 query = query.arg("name", name.into());
6579 query = query.arg("description", description.into());
6580 Env {
6581 proc: self.proc.clone(),
6582 selection: query,
6583 graphql_client: self.graphql_client.clone(),
6584 }
6585 }
6586 pub fn with_check_input(
6594 &self,
6595 name: impl Into<String>,
6596 value: impl IntoID<Id>,
6597 description: impl Into<String>,
6598 ) -> Env {
6599 let mut query = self.selection.select("withCheckInput");
6600 query = query.arg("name", name.into());
6601 query = query.arg_lazy(
6602 "value",
6603 Box::new(move || {
6604 let value = value.clone();
6605 Box::pin(async move { value.into_id().await.unwrap().quote() })
6606 }),
6607 );
6608 query = query.arg("description", description.into());
6609 Env {
6610 proc: self.proc.clone(),
6611 selection: query,
6612 graphql_client: self.graphql_client.clone(),
6613 }
6614 }
6615 pub fn with_check_output(
6622 &self,
6623 name: impl Into<String>,
6624 description: impl Into<String>,
6625 ) -> Env {
6626 let mut query = self.selection.select("withCheckOutput");
6627 query = query.arg("name", name.into());
6628 query = query.arg("description", description.into());
6629 Env {
6630 proc: self.proc.clone(),
6631 selection: query,
6632 graphql_client: self.graphql_client.clone(),
6633 }
6634 }
6635 pub fn with_cloud_input(
6643 &self,
6644 name: impl Into<String>,
6645 value: impl IntoID<Id>,
6646 description: impl Into<String>,
6647 ) -> Env {
6648 let mut query = self.selection.select("withCloudInput");
6649 query = query.arg("name", name.into());
6650 query = query.arg_lazy(
6651 "value",
6652 Box::new(move || {
6653 let value = value.clone();
6654 Box::pin(async move { value.into_id().await.unwrap().quote() })
6655 }),
6656 );
6657 query = query.arg("description", description.into());
6658 Env {
6659 proc: self.proc.clone(),
6660 selection: query,
6661 graphql_client: self.graphql_client.clone(),
6662 }
6663 }
6664 pub fn with_cloud_output(
6671 &self,
6672 name: impl Into<String>,
6673 description: impl Into<String>,
6674 ) -> Env {
6675 let mut query = self.selection.select("withCloudOutput");
6676 query = query.arg("name", name.into());
6677 query = query.arg("description", description.into());
6678 Env {
6679 proc: self.proc.clone(),
6680 selection: query,
6681 graphql_client: self.graphql_client.clone(),
6682 }
6683 }
6684 pub fn with_container_input(
6692 &self,
6693 name: impl Into<String>,
6694 value: impl IntoID<Id>,
6695 description: impl Into<String>,
6696 ) -> Env {
6697 let mut query = self.selection.select("withContainerInput");
6698 query = query.arg("name", name.into());
6699 query = query.arg_lazy(
6700 "value",
6701 Box::new(move || {
6702 let value = value.clone();
6703 Box::pin(async move { value.into_id().await.unwrap().quote() })
6704 }),
6705 );
6706 query = query.arg("description", description.into());
6707 Env {
6708 proc: self.proc.clone(),
6709 selection: query,
6710 graphql_client: self.graphql_client.clone(),
6711 }
6712 }
6713 pub fn with_container_output(
6720 &self,
6721 name: impl Into<String>,
6722 description: impl Into<String>,
6723 ) -> Env {
6724 let mut query = self.selection.select("withContainerOutput");
6725 query = query.arg("name", name.into());
6726 query = query.arg("description", description.into());
6727 Env {
6728 proc: self.proc.clone(),
6729 selection: query,
6730 graphql_client: self.graphql_client.clone(),
6731 }
6732 }
6733 pub fn with_current_module(&self) -> Env {
6736 let query = self.selection.select("withCurrentModule");
6737 Env {
6738 proc: self.proc.clone(),
6739 selection: query,
6740 graphql_client: self.graphql_client.clone(),
6741 }
6742 }
6743 pub fn with_diff_stat_input(
6751 &self,
6752 name: impl Into<String>,
6753 value: impl IntoID<Id>,
6754 description: impl Into<String>,
6755 ) -> Env {
6756 let mut query = self.selection.select("withDiffStatInput");
6757 query = query.arg("name", name.into());
6758 query = query.arg_lazy(
6759 "value",
6760 Box::new(move || {
6761 let value = value.clone();
6762 Box::pin(async move { value.into_id().await.unwrap().quote() })
6763 }),
6764 );
6765 query = query.arg("description", description.into());
6766 Env {
6767 proc: self.proc.clone(),
6768 selection: query,
6769 graphql_client: self.graphql_client.clone(),
6770 }
6771 }
6772 pub fn with_diff_stat_output(
6779 &self,
6780 name: impl Into<String>,
6781 description: impl Into<String>,
6782 ) -> Env {
6783 let mut query = self.selection.select("withDiffStatOutput");
6784 query = query.arg("name", name.into());
6785 query = query.arg("description", description.into());
6786 Env {
6787 proc: self.proc.clone(),
6788 selection: query,
6789 graphql_client: self.graphql_client.clone(),
6790 }
6791 }
6792 pub fn with_directory_input(
6800 &self,
6801 name: impl Into<String>,
6802 value: impl IntoID<Id>,
6803 description: impl Into<String>,
6804 ) -> Env {
6805 let mut query = self.selection.select("withDirectoryInput");
6806 query = query.arg("name", name.into());
6807 query = query.arg_lazy(
6808 "value",
6809 Box::new(move || {
6810 let value = value.clone();
6811 Box::pin(async move { value.into_id().await.unwrap().quote() })
6812 }),
6813 );
6814 query = query.arg("description", description.into());
6815 Env {
6816 proc: self.proc.clone(),
6817 selection: query,
6818 graphql_client: self.graphql_client.clone(),
6819 }
6820 }
6821 pub fn with_directory_output(
6828 &self,
6829 name: impl Into<String>,
6830 description: impl Into<String>,
6831 ) -> Env {
6832 let mut query = self.selection.select("withDirectoryOutput");
6833 query = query.arg("name", name.into());
6834 query = query.arg("description", description.into());
6835 Env {
6836 proc: self.proc.clone(),
6837 selection: query,
6838 graphql_client: self.graphql_client.clone(),
6839 }
6840 }
6841 pub fn with_env_file_input(
6849 &self,
6850 name: impl Into<String>,
6851 value: impl IntoID<Id>,
6852 description: impl Into<String>,
6853 ) -> Env {
6854 let mut query = self.selection.select("withEnvFileInput");
6855 query = query.arg("name", name.into());
6856 query = query.arg_lazy(
6857 "value",
6858 Box::new(move || {
6859 let value = value.clone();
6860 Box::pin(async move { value.into_id().await.unwrap().quote() })
6861 }),
6862 );
6863 query = query.arg("description", description.into());
6864 Env {
6865 proc: self.proc.clone(),
6866 selection: query,
6867 graphql_client: self.graphql_client.clone(),
6868 }
6869 }
6870 pub fn with_env_file_output(
6877 &self,
6878 name: impl Into<String>,
6879 description: impl Into<String>,
6880 ) -> Env {
6881 let mut query = self.selection.select("withEnvFileOutput");
6882 query = query.arg("name", name.into());
6883 query = query.arg("description", description.into());
6884 Env {
6885 proc: self.proc.clone(),
6886 selection: query,
6887 graphql_client: self.graphql_client.clone(),
6888 }
6889 }
6890 pub fn with_env_input(
6898 &self,
6899 name: impl Into<String>,
6900 value: impl IntoID<Id>,
6901 description: impl Into<String>,
6902 ) -> Env {
6903 let mut query = self.selection.select("withEnvInput");
6904 query = query.arg("name", name.into());
6905 query = query.arg_lazy(
6906 "value",
6907 Box::new(move || {
6908 let value = value.clone();
6909 Box::pin(async move { value.into_id().await.unwrap().quote() })
6910 }),
6911 );
6912 query = query.arg("description", description.into());
6913 Env {
6914 proc: self.proc.clone(),
6915 selection: query,
6916 graphql_client: self.graphql_client.clone(),
6917 }
6918 }
6919 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6926 let mut query = self.selection.select("withEnvOutput");
6927 query = query.arg("name", name.into());
6928 query = query.arg("description", description.into());
6929 Env {
6930 proc: self.proc.clone(),
6931 selection: query,
6932 graphql_client: self.graphql_client.clone(),
6933 }
6934 }
6935 pub fn with_file_input(
6943 &self,
6944 name: impl Into<String>,
6945 value: impl IntoID<Id>,
6946 description: impl Into<String>,
6947 ) -> Env {
6948 let mut query = self.selection.select("withFileInput");
6949 query = query.arg("name", name.into());
6950 query = query.arg_lazy(
6951 "value",
6952 Box::new(move || {
6953 let value = value.clone();
6954 Box::pin(async move { value.into_id().await.unwrap().quote() })
6955 }),
6956 );
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_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6971 let mut query = self.selection.select("withFileOutput");
6972 query = query.arg("name", name.into());
6973 query = query.arg("description", description.into());
6974 Env {
6975 proc: self.proc.clone(),
6976 selection: query,
6977 graphql_client: self.graphql_client.clone(),
6978 }
6979 }
6980 pub fn with_generator_group_input(
6988 &self,
6989 name: impl Into<String>,
6990 value: impl IntoID<Id>,
6991 description: impl Into<String>,
6992 ) -> Env {
6993 let mut query = self.selection.select("withGeneratorGroupInput");
6994 query = query.arg("name", name.into());
6995 query = query.arg_lazy(
6996 "value",
6997 Box::new(move || {
6998 let value = value.clone();
6999 Box::pin(async move { value.into_id().await.unwrap().quote() })
7000 }),
7001 );
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_generator_group_output(
7016 &self,
7017 name: impl Into<String>,
7018 description: impl Into<String>,
7019 ) -> Env {
7020 let mut query = self.selection.select("withGeneratorGroupOutput");
7021 query = query.arg("name", name.into());
7022 query = query.arg("description", description.into());
7023 Env {
7024 proc: self.proc.clone(),
7025 selection: query,
7026 graphql_client: self.graphql_client.clone(),
7027 }
7028 }
7029 pub fn with_generator_input(
7037 &self,
7038 name: impl Into<String>,
7039 value: impl IntoID<Id>,
7040 description: impl Into<String>,
7041 ) -> Env {
7042 let mut query = self.selection.select("withGeneratorInput");
7043 query = query.arg("name", name.into());
7044 query = query.arg_lazy(
7045 "value",
7046 Box::new(move || {
7047 let value = value.clone();
7048 Box::pin(async move { value.into_id().await.unwrap().quote() })
7049 }),
7050 );
7051 query = query.arg("description", description.into());
7052 Env {
7053 proc: self.proc.clone(),
7054 selection: query,
7055 graphql_client: self.graphql_client.clone(),
7056 }
7057 }
7058 pub fn with_generator_output(
7065 &self,
7066 name: impl Into<String>,
7067 description: impl Into<String>,
7068 ) -> Env {
7069 let mut query = self.selection.select("withGeneratorOutput");
7070 query = query.arg("name", name.into());
7071 query = query.arg("description", description.into());
7072 Env {
7073 proc: self.proc.clone(),
7074 selection: query,
7075 graphql_client: self.graphql_client.clone(),
7076 }
7077 }
7078 pub fn with_git_ref_input(
7086 &self,
7087 name: impl Into<String>,
7088 value: impl IntoID<Id>,
7089 description: impl Into<String>,
7090 ) -> Env {
7091 let mut query = self.selection.select("withGitRefInput");
7092 query = query.arg("name", name.into());
7093 query = query.arg_lazy(
7094 "value",
7095 Box::new(move || {
7096 let value = value.clone();
7097 Box::pin(async move { value.into_id().await.unwrap().quote() })
7098 }),
7099 );
7100 query = query.arg("description", description.into());
7101 Env {
7102 proc: self.proc.clone(),
7103 selection: query,
7104 graphql_client: self.graphql_client.clone(),
7105 }
7106 }
7107 pub fn with_git_ref_output(
7114 &self,
7115 name: impl Into<String>,
7116 description: impl Into<String>,
7117 ) -> Env {
7118 let mut query = self.selection.select("withGitRefOutput");
7119 query = query.arg("name", name.into());
7120 query = query.arg("description", description.into());
7121 Env {
7122 proc: self.proc.clone(),
7123 selection: query,
7124 graphql_client: self.graphql_client.clone(),
7125 }
7126 }
7127 pub fn with_git_repository_input(
7135 &self,
7136 name: impl Into<String>,
7137 value: impl IntoID<Id>,
7138 description: impl Into<String>,
7139 ) -> Env {
7140 let mut query = self.selection.select("withGitRepositoryInput");
7141 query = query.arg("name", name.into());
7142 query = query.arg_lazy(
7143 "value",
7144 Box::new(move || {
7145 let value = value.clone();
7146 Box::pin(async move { value.into_id().await.unwrap().quote() })
7147 }),
7148 );
7149 query = query.arg("description", description.into());
7150 Env {
7151 proc: self.proc.clone(),
7152 selection: query,
7153 graphql_client: self.graphql_client.clone(),
7154 }
7155 }
7156 pub fn with_git_repository_output(
7163 &self,
7164 name: impl Into<String>,
7165 description: impl Into<String>,
7166 ) -> Env {
7167 let mut query = self.selection.select("withGitRepositoryOutput");
7168 query = query.arg("name", name.into());
7169 query = query.arg("description", description.into());
7170 Env {
7171 proc: self.proc.clone(),
7172 selection: query,
7173 graphql_client: self.graphql_client.clone(),
7174 }
7175 }
7176 pub fn with_http_state_input(
7184 &self,
7185 name: impl Into<String>,
7186 value: impl IntoID<Id>,
7187 description: impl Into<String>,
7188 ) -> Env {
7189 let mut query = self.selection.select("withHTTPStateInput");
7190 query = query.arg("name", name.into());
7191 query = query.arg_lazy(
7192 "value",
7193 Box::new(move || {
7194 let value = value.clone();
7195 Box::pin(async move { value.into_id().await.unwrap().quote() })
7196 }),
7197 );
7198 query = query.arg("description", description.into());
7199 Env {
7200 proc: self.proc.clone(),
7201 selection: query,
7202 graphql_client: self.graphql_client.clone(),
7203 }
7204 }
7205 pub fn with_http_state_output(
7212 &self,
7213 name: impl Into<String>,
7214 description: impl Into<String>,
7215 ) -> Env {
7216 let mut query = self.selection.select("withHTTPStateOutput");
7217 query = query.arg("name", name.into());
7218 query = query.arg("description", description.into());
7219 Env {
7220 proc: self.proc.clone(),
7221 selection: query,
7222 graphql_client: self.graphql_client.clone(),
7223 }
7224 }
7225 pub fn with_json_value_input(
7233 &self,
7234 name: impl Into<String>,
7235 value: impl IntoID<Id>,
7236 description: impl Into<String>,
7237 ) -> Env {
7238 let mut query = self.selection.select("withJSONValueInput");
7239 query = query.arg("name", name.into());
7240 query = query.arg_lazy(
7241 "value",
7242 Box::new(move || {
7243 let value = value.clone();
7244 Box::pin(async move { value.into_id().await.unwrap().quote() })
7245 }),
7246 );
7247 query = query.arg("description", description.into());
7248 Env {
7249 proc: self.proc.clone(),
7250 selection: query,
7251 graphql_client: self.graphql_client.clone(),
7252 }
7253 }
7254 pub fn with_json_value_output(
7261 &self,
7262 name: impl Into<String>,
7263 description: impl Into<String>,
7264 ) -> Env {
7265 let mut query = self.selection.select("withJSONValueOutput");
7266 query = query.arg("name", name.into());
7267 query = query.arg("description", description.into());
7268 Env {
7269 proc: self.proc.clone(),
7270 selection: query,
7271 graphql_client: self.graphql_client.clone(),
7272 }
7273 }
7274 pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7277 let mut query = self.selection.select("withMainModule");
7278 query = query.arg_lazy(
7279 "module",
7280 Box::new(move || {
7281 let module = module.clone();
7282 Box::pin(async move { module.into_id().await.unwrap().quote() })
7283 }),
7284 );
7285 Env {
7286 proc: self.proc.clone(),
7287 selection: query,
7288 graphql_client: self.graphql_client.clone(),
7289 }
7290 }
7291 pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7294 let mut query = self.selection.select("withModule");
7295 query = query.arg_lazy(
7296 "module",
7297 Box::new(move || {
7298 let module = module.clone();
7299 Box::pin(async move { module.into_id().await.unwrap().quote() })
7300 }),
7301 );
7302 Env {
7303 proc: self.proc.clone(),
7304 selection: query,
7305 graphql_client: self.graphql_client.clone(),
7306 }
7307 }
7308 pub fn with_module_config_client_input(
7316 &self,
7317 name: impl Into<String>,
7318 value: impl IntoID<Id>,
7319 description: impl Into<String>,
7320 ) -> Env {
7321 let mut query = self.selection.select("withModuleConfigClientInput");
7322 query = query.arg("name", name.into());
7323 query = query.arg_lazy(
7324 "value",
7325 Box::new(move || {
7326 let value = value.clone();
7327 Box::pin(async move { value.into_id().await.unwrap().quote() })
7328 }),
7329 );
7330 query = query.arg("description", description.into());
7331 Env {
7332 proc: self.proc.clone(),
7333 selection: query,
7334 graphql_client: self.graphql_client.clone(),
7335 }
7336 }
7337 pub fn with_module_config_client_output(
7344 &self,
7345 name: impl Into<String>,
7346 description: impl Into<String>,
7347 ) -> Env {
7348 let mut query = self.selection.select("withModuleConfigClientOutput");
7349 query = query.arg("name", name.into());
7350 query = query.arg("description", description.into());
7351 Env {
7352 proc: self.proc.clone(),
7353 selection: query,
7354 graphql_client: self.graphql_client.clone(),
7355 }
7356 }
7357 pub fn with_module_input(
7365 &self,
7366 name: impl Into<String>,
7367 value: impl IntoID<Id>,
7368 description: impl Into<String>,
7369 ) -> Env {
7370 let mut query = self.selection.select("withModuleInput");
7371 query = query.arg("name", name.into());
7372 query = query.arg_lazy(
7373 "value",
7374 Box::new(move || {
7375 let value = value.clone();
7376 Box::pin(async move { value.into_id().await.unwrap().quote() })
7377 }),
7378 );
7379 query = query.arg("description", description.into());
7380 Env {
7381 proc: self.proc.clone(),
7382 selection: query,
7383 graphql_client: self.graphql_client.clone(),
7384 }
7385 }
7386 pub fn with_module_output(
7393 &self,
7394 name: impl Into<String>,
7395 description: impl Into<String>,
7396 ) -> Env {
7397 let mut query = self.selection.select("withModuleOutput");
7398 query = query.arg("name", name.into());
7399 query = query.arg("description", description.into());
7400 Env {
7401 proc: self.proc.clone(),
7402 selection: query,
7403 graphql_client: self.graphql_client.clone(),
7404 }
7405 }
7406 pub fn with_module_source_input(
7414 &self,
7415 name: impl Into<String>,
7416 value: impl IntoID<Id>,
7417 description: impl Into<String>,
7418 ) -> Env {
7419 let mut query = self.selection.select("withModuleSourceInput");
7420 query = query.arg("name", name.into());
7421 query = query.arg_lazy(
7422 "value",
7423 Box::new(move || {
7424 let value = value.clone();
7425 Box::pin(async move { value.into_id().await.unwrap().quote() })
7426 }),
7427 );
7428 query = query.arg("description", description.into());
7429 Env {
7430 proc: self.proc.clone(),
7431 selection: query,
7432 graphql_client: self.graphql_client.clone(),
7433 }
7434 }
7435 pub fn with_module_source_output(
7442 &self,
7443 name: impl Into<String>,
7444 description: impl Into<String>,
7445 ) -> Env {
7446 let mut query = self.selection.select("withModuleSourceOutput");
7447 query = query.arg("name", name.into());
7448 query = query.arg("description", description.into());
7449 Env {
7450 proc: self.proc.clone(),
7451 selection: query,
7452 graphql_client: self.graphql_client.clone(),
7453 }
7454 }
7455 pub fn with_search_result_input(
7463 &self,
7464 name: impl Into<String>,
7465 value: impl IntoID<Id>,
7466 description: impl Into<String>,
7467 ) -> Env {
7468 let mut query = self.selection.select("withSearchResultInput");
7469 query = query.arg("name", name.into());
7470 query = query.arg_lazy(
7471 "value",
7472 Box::new(move || {
7473 let value = value.clone();
7474 Box::pin(async move { value.into_id().await.unwrap().quote() })
7475 }),
7476 );
7477 query = query.arg("description", description.into());
7478 Env {
7479 proc: self.proc.clone(),
7480 selection: query,
7481 graphql_client: self.graphql_client.clone(),
7482 }
7483 }
7484 pub fn with_search_result_output(
7491 &self,
7492 name: impl Into<String>,
7493 description: impl Into<String>,
7494 ) -> Env {
7495 let mut query = self.selection.select("withSearchResultOutput");
7496 query = query.arg("name", name.into());
7497 query = query.arg("description", description.into());
7498 Env {
7499 proc: self.proc.clone(),
7500 selection: query,
7501 graphql_client: self.graphql_client.clone(),
7502 }
7503 }
7504 pub fn with_search_submatch_input(
7512 &self,
7513 name: impl Into<String>,
7514 value: impl IntoID<Id>,
7515 description: impl Into<String>,
7516 ) -> Env {
7517 let mut query = self.selection.select("withSearchSubmatchInput");
7518 query = query.arg("name", name.into());
7519 query = query.arg_lazy(
7520 "value",
7521 Box::new(move || {
7522 let value = value.clone();
7523 Box::pin(async move { value.into_id().await.unwrap().quote() })
7524 }),
7525 );
7526 query = query.arg("description", description.into());
7527 Env {
7528 proc: self.proc.clone(),
7529 selection: query,
7530 graphql_client: self.graphql_client.clone(),
7531 }
7532 }
7533 pub fn with_search_submatch_output(
7540 &self,
7541 name: impl Into<String>,
7542 description: impl Into<String>,
7543 ) -> Env {
7544 let mut query = self.selection.select("withSearchSubmatchOutput");
7545 query = query.arg("name", name.into());
7546 query = query.arg("description", description.into());
7547 Env {
7548 proc: self.proc.clone(),
7549 selection: query,
7550 graphql_client: self.graphql_client.clone(),
7551 }
7552 }
7553 pub fn with_secret_input(
7561 &self,
7562 name: impl Into<String>,
7563 value: impl IntoID<Id>,
7564 description: impl Into<String>,
7565 ) -> Env {
7566 let mut query = self.selection.select("withSecretInput");
7567 query = query.arg("name", name.into());
7568 query = query.arg_lazy(
7569 "value",
7570 Box::new(move || {
7571 let value = value.clone();
7572 Box::pin(async move { value.into_id().await.unwrap().quote() })
7573 }),
7574 );
7575 query = query.arg("description", description.into());
7576 Env {
7577 proc: self.proc.clone(),
7578 selection: query,
7579 graphql_client: self.graphql_client.clone(),
7580 }
7581 }
7582 pub fn with_secret_output(
7589 &self,
7590 name: impl Into<String>,
7591 description: impl Into<String>,
7592 ) -> Env {
7593 let mut query = self.selection.select("withSecretOutput");
7594 query = query.arg("name", name.into());
7595 query = query.arg("description", description.into());
7596 Env {
7597 proc: self.proc.clone(),
7598 selection: query,
7599 graphql_client: self.graphql_client.clone(),
7600 }
7601 }
7602 pub fn with_service_input(
7610 &self,
7611 name: impl Into<String>,
7612 value: impl IntoID<Id>,
7613 description: impl Into<String>,
7614 ) -> Env {
7615 let mut query = self.selection.select("withServiceInput");
7616 query = query.arg("name", name.into());
7617 query = query.arg_lazy(
7618 "value",
7619 Box::new(move || {
7620 let value = value.clone();
7621 Box::pin(async move { value.into_id().await.unwrap().quote() })
7622 }),
7623 );
7624 query = query.arg("description", description.into());
7625 Env {
7626 proc: self.proc.clone(),
7627 selection: query,
7628 graphql_client: self.graphql_client.clone(),
7629 }
7630 }
7631 pub fn with_service_output(
7638 &self,
7639 name: impl Into<String>,
7640 description: impl Into<String>,
7641 ) -> Env {
7642 let mut query = self.selection.select("withServiceOutput");
7643 query = query.arg("name", name.into());
7644 query = query.arg("description", description.into());
7645 Env {
7646 proc: self.proc.clone(),
7647 selection: query,
7648 graphql_client: self.graphql_client.clone(),
7649 }
7650 }
7651 pub fn with_socket_input(
7659 &self,
7660 name: impl Into<String>,
7661 value: impl IntoID<Id>,
7662 description: impl Into<String>,
7663 ) -> Env {
7664 let mut query = self.selection.select("withSocketInput");
7665 query = query.arg("name", name.into());
7666 query = query.arg_lazy(
7667 "value",
7668 Box::new(move || {
7669 let value = value.clone();
7670 Box::pin(async move { value.into_id().await.unwrap().quote() })
7671 }),
7672 );
7673 query = query.arg("description", description.into());
7674 Env {
7675 proc: self.proc.clone(),
7676 selection: query,
7677 graphql_client: self.graphql_client.clone(),
7678 }
7679 }
7680 pub fn with_socket_output(
7687 &self,
7688 name: impl Into<String>,
7689 description: impl Into<String>,
7690 ) -> Env {
7691 let mut query = self.selection.select("withSocketOutput");
7692 query = query.arg("name", name.into());
7693 query = query.arg("description", description.into());
7694 Env {
7695 proc: self.proc.clone(),
7696 selection: query,
7697 graphql_client: self.graphql_client.clone(),
7698 }
7699 }
7700 pub fn with_stat_input(
7708 &self,
7709 name: impl Into<String>,
7710 value: impl IntoID<Id>,
7711 description: impl Into<String>,
7712 ) -> Env {
7713 let mut query = self.selection.select("withStatInput");
7714 query = query.arg("name", name.into());
7715 query = query.arg_lazy(
7716 "value",
7717 Box::new(move || {
7718 let value = value.clone();
7719 Box::pin(async move { value.into_id().await.unwrap().quote() })
7720 }),
7721 );
7722 query = query.arg("description", description.into());
7723 Env {
7724 proc: self.proc.clone(),
7725 selection: query,
7726 graphql_client: self.graphql_client.clone(),
7727 }
7728 }
7729 pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7736 let mut query = self.selection.select("withStatOutput");
7737 query = query.arg("name", name.into());
7738 query = query.arg("description", description.into());
7739 Env {
7740 proc: self.proc.clone(),
7741 selection: query,
7742 graphql_client: self.graphql_client.clone(),
7743 }
7744 }
7745 pub fn with_string_input(
7753 &self,
7754 name: impl Into<String>,
7755 value: impl Into<String>,
7756 description: impl Into<String>,
7757 ) -> Env {
7758 let mut query = self.selection.select("withStringInput");
7759 query = query.arg("name", name.into());
7760 query = query.arg("value", value.into());
7761 query = query.arg("description", description.into());
7762 Env {
7763 proc: self.proc.clone(),
7764 selection: query,
7765 graphql_client: self.graphql_client.clone(),
7766 }
7767 }
7768 pub fn with_string_output(
7775 &self,
7776 name: impl Into<String>,
7777 description: impl Into<String>,
7778 ) -> Env {
7779 let mut query = self.selection.select("withStringOutput");
7780 query = query.arg("name", name.into());
7781 query = query.arg("description", description.into());
7782 Env {
7783 proc: self.proc.clone(),
7784 selection: query,
7785 graphql_client: self.graphql_client.clone(),
7786 }
7787 }
7788 pub fn with_up_group_input(
7796 &self,
7797 name: impl Into<String>,
7798 value: impl IntoID<Id>,
7799 description: impl Into<String>,
7800 ) -> Env {
7801 let mut query = self.selection.select("withUpGroupInput");
7802 query = query.arg("name", name.into());
7803 query = query.arg_lazy(
7804 "value",
7805 Box::new(move || {
7806 let value = value.clone();
7807 Box::pin(async move { value.into_id().await.unwrap().quote() })
7808 }),
7809 );
7810 query = query.arg("description", description.into());
7811 Env {
7812 proc: self.proc.clone(),
7813 selection: query,
7814 graphql_client: self.graphql_client.clone(),
7815 }
7816 }
7817 pub fn with_up_group_output(
7824 &self,
7825 name: impl Into<String>,
7826 description: impl Into<String>,
7827 ) -> Env {
7828 let mut query = self.selection.select("withUpGroupOutput");
7829 query = query.arg("name", name.into());
7830 query = query.arg("description", description.into());
7831 Env {
7832 proc: self.proc.clone(),
7833 selection: query,
7834 graphql_client: self.graphql_client.clone(),
7835 }
7836 }
7837 pub fn with_up_input(
7845 &self,
7846 name: impl Into<String>,
7847 value: impl IntoID<Id>,
7848 description: impl Into<String>,
7849 ) -> Env {
7850 let mut query = self.selection.select("withUpInput");
7851 query = query.arg("name", name.into());
7852 query = query.arg_lazy(
7853 "value",
7854 Box::new(move || {
7855 let value = value.clone();
7856 Box::pin(async move { value.into_id().await.unwrap().quote() })
7857 }),
7858 );
7859 query = query.arg("description", description.into());
7860 Env {
7861 proc: self.proc.clone(),
7862 selection: query,
7863 graphql_client: self.graphql_client.clone(),
7864 }
7865 }
7866 pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7873 let mut query = self.selection.select("withUpOutput");
7874 query = query.arg("name", name.into());
7875 query = query.arg("description", description.into());
7876 Env {
7877 proc: self.proc.clone(),
7878 selection: query,
7879 graphql_client: self.graphql_client.clone(),
7880 }
7881 }
7882 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
7888 let mut query = self.selection.select("withWorkspace");
7889 query = query.arg_lazy(
7890 "workspace",
7891 Box::new(move || {
7892 let workspace = workspace.clone();
7893 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7894 }),
7895 );
7896 Env {
7897 proc: self.proc.clone(),
7898 selection: query,
7899 graphql_client: self.graphql_client.clone(),
7900 }
7901 }
7902 pub fn with_workspace_input(
7910 &self,
7911 name: impl Into<String>,
7912 value: impl IntoID<Id>,
7913 description: impl Into<String>,
7914 ) -> Env {
7915 let mut query = self.selection.select("withWorkspaceInput");
7916 query = query.arg("name", name.into());
7917 query = query.arg_lazy(
7918 "value",
7919 Box::new(move || {
7920 let value = value.clone();
7921 Box::pin(async move { value.into_id().await.unwrap().quote() })
7922 }),
7923 );
7924 query = query.arg("description", description.into());
7925 Env {
7926 proc: self.proc.clone(),
7927 selection: query,
7928 graphql_client: self.graphql_client.clone(),
7929 }
7930 }
7931 pub fn with_workspace_output(
7938 &self,
7939 name: impl Into<String>,
7940 description: impl Into<String>,
7941 ) -> Env {
7942 let mut query = self.selection.select("withWorkspaceOutput");
7943 query = query.arg("name", name.into());
7944 query = query.arg("description", description.into());
7945 Env {
7946 proc: self.proc.clone(),
7947 selection: query,
7948 graphql_client: self.graphql_client.clone(),
7949 }
7950 }
7951 pub fn without_outputs(&self) -> Env {
7953 let query = self.selection.select("withoutOutputs");
7954 Env {
7955 proc: self.proc.clone(),
7956 selection: query,
7957 graphql_client: self.graphql_client.clone(),
7958 }
7959 }
7960 pub fn workspace(&self) -> Directory {
7961 let query = self.selection.select("workspace");
7962 Directory {
7963 proc: self.proc.clone(),
7964 selection: query,
7965 graphql_client: self.graphql_client.clone(),
7966 }
7967 }
7968}
7969impl Node for Env {
7970 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7971 let query = self.selection.select("id");
7972 let graphql_client = self.graphql_client.clone();
7973 async move { query.execute(graphql_client).await }
7974 }
7975}
7976#[derive(Clone)]
7977pub struct EnvFile {
7978 pub proc: Option<Arc<DaggerSessionProc>>,
7979 pub selection: Selection,
7980 pub graphql_client: DynGraphQLClient,
7981}
7982#[derive(Builder, Debug, PartialEq)]
7983pub struct EnvFileGetOpts {
7984 #[builder(setter(into, strip_option), default)]
7986 pub raw: Option<bool>,
7987}
7988#[derive(Builder, Debug, PartialEq)]
7989pub struct EnvFileVariablesOpts {
7990 #[builder(setter(into, strip_option), default)]
7992 pub raw: Option<bool>,
7993}
7994impl IntoID<Id> for EnvFile {
7995 fn into_id(
7996 self,
7997 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7998 Box::pin(async move { self.id().await })
7999 }
8000}
8001impl Loadable for EnvFile {
8002 fn graphql_type() -> &'static str {
8003 "EnvFile"
8004 }
8005 fn from_query(
8006 proc: Option<Arc<DaggerSessionProc>>,
8007 selection: Selection,
8008 graphql_client: DynGraphQLClient,
8009 ) -> Self {
8010 Self {
8011 proc,
8012 selection,
8013 graphql_client,
8014 }
8015 }
8016}
8017impl EnvFile {
8018 pub fn as_file(&self) -> File {
8020 let query = self.selection.select("asFile");
8021 File {
8022 proc: self.proc.clone(),
8023 selection: query,
8024 graphql_client: self.graphql_client.clone(),
8025 }
8026 }
8027 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8033 let mut query = self.selection.select("exists");
8034 query = query.arg("name", name.into());
8035 query.execute(self.graphql_client.clone()).await
8036 }
8037 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8044 let mut query = self.selection.select("get");
8045 query = query.arg("name", name.into());
8046 query.execute(self.graphql_client.clone()).await
8047 }
8048 pub async fn get_opts(
8055 &self,
8056 name: impl Into<String>,
8057 opts: EnvFileGetOpts,
8058 ) -> Result<String, DaggerError> {
8059 let mut query = self.selection.select("get");
8060 query = query.arg("name", name.into());
8061 if let Some(raw) = opts.raw {
8062 query = query.arg("raw", raw);
8063 }
8064 query.execute(self.graphql_client.clone()).await
8065 }
8066 pub async fn id(&self) -> Result<Id, DaggerError> {
8068 let query = self.selection.select("id");
8069 query.execute(self.graphql_client.clone()).await
8070 }
8071 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8077 let mut query = self.selection.select("namespace");
8078 query = query.arg("prefix", prefix.into());
8079 EnvFile {
8080 proc: self.proc.clone(),
8081 selection: query,
8082 graphql_client: self.graphql_client.clone(),
8083 }
8084 }
8085 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8091 let query = self.selection.select("variables");
8092 let query = query.select("id");
8093 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8094 Ok(ids
8095 .into_iter()
8096 .map(|id| EnvVariable {
8097 proc: self.proc.clone(),
8098 selection: crate::querybuilder::query()
8099 .select("node")
8100 .arg("id", &id.0)
8101 .inline_fragment("EnvVariable"),
8102 graphql_client: self.graphql_client.clone(),
8103 })
8104 .collect())
8105 }
8106 pub async fn variables_opts(
8112 &self,
8113 opts: EnvFileVariablesOpts,
8114 ) -> Result<Vec<EnvVariable>, DaggerError> {
8115 let mut query = self.selection.select("variables");
8116 if let Some(raw) = opts.raw {
8117 query = query.arg("raw", raw);
8118 }
8119 let query = query.select("id");
8120 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8121 Ok(ids
8122 .into_iter()
8123 .map(|id| EnvVariable {
8124 proc: self.proc.clone(),
8125 selection: crate::querybuilder::query()
8126 .select("node")
8127 .arg("id", &id.0)
8128 .inline_fragment("EnvVariable"),
8129 graphql_client: self.graphql_client.clone(),
8130 })
8131 .collect())
8132 }
8133 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8140 let mut query = self.selection.select("withVariable");
8141 query = query.arg("name", name.into());
8142 query = query.arg("value", value.into());
8143 EnvFile {
8144 proc: self.proc.clone(),
8145 selection: query,
8146 graphql_client: self.graphql_client.clone(),
8147 }
8148 }
8149 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8155 let mut query = self.selection.select("withoutVariable");
8156 query = query.arg("name", name.into());
8157 EnvFile {
8158 proc: self.proc.clone(),
8159 selection: query,
8160 graphql_client: self.graphql_client.clone(),
8161 }
8162 }
8163}
8164impl Node for EnvFile {
8165 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8166 let query = self.selection.select("id");
8167 let graphql_client = self.graphql_client.clone();
8168 async move { query.execute(graphql_client).await }
8169 }
8170}
8171#[derive(Clone)]
8172pub struct EnvVariable {
8173 pub proc: Option<Arc<DaggerSessionProc>>,
8174 pub selection: Selection,
8175 pub graphql_client: DynGraphQLClient,
8176}
8177impl IntoID<Id> for EnvVariable {
8178 fn into_id(
8179 self,
8180 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8181 Box::pin(async move { self.id().await })
8182 }
8183}
8184impl Loadable for EnvVariable {
8185 fn graphql_type() -> &'static str {
8186 "EnvVariable"
8187 }
8188 fn from_query(
8189 proc: Option<Arc<DaggerSessionProc>>,
8190 selection: Selection,
8191 graphql_client: DynGraphQLClient,
8192 ) -> Self {
8193 Self {
8194 proc,
8195 selection,
8196 graphql_client,
8197 }
8198 }
8199}
8200impl EnvVariable {
8201 pub async fn id(&self) -> Result<Id, DaggerError> {
8203 let query = self.selection.select("id");
8204 query.execute(self.graphql_client.clone()).await
8205 }
8206 pub async fn name(&self) -> Result<String, DaggerError> {
8208 let query = self.selection.select("name");
8209 query.execute(self.graphql_client.clone()).await
8210 }
8211 pub async fn value(&self) -> Result<String, DaggerError> {
8213 let query = self.selection.select("value");
8214 query.execute(self.graphql_client.clone()).await
8215 }
8216}
8217impl Node for EnvVariable {
8218 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8219 let query = self.selection.select("id");
8220 let graphql_client = self.graphql_client.clone();
8221 async move { query.execute(graphql_client).await }
8222 }
8223}
8224#[derive(Clone)]
8225pub struct Error {
8226 pub proc: Option<Arc<DaggerSessionProc>>,
8227 pub selection: Selection,
8228 pub graphql_client: DynGraphQLClient,
8229}
8230impl IntoID<Id> for Error {
8231 fn into_id(
8232 self,
8233 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8234 Box::pin(async move { self.id().await })
8235 }
8236}
8237impl Loadable for Error {
8238 fn graphql_type() -> &'static str {
8239 "Error"
8240 }
8241 fn from_query(
8242 proc: Option<Arc<DaggerSessionProc>>,
8243 selection: Selection,
8244 graphql_client: DynGraphQLClient,
8245 ) -> Self {
8246 Self {
8247 proc,
8248 selection,
8249 graphql_client,
8250 }
8251 }
8252}
8253impl Error {
8254 pub async fn id(&self) -> Result<Id, DaggerError> {
8256 let query = self.selection.select("id");
8257 query.execute(self.graphql_client.clone()).await
8258 }
8259 pub async fn message(&self) -> Result<String, DaggerError> {
8261 let query = self.selection.select("message");
8262 query.execute(self.graphql_client.clone()).await
8263 }
8264 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8266 let query = self.selection.select("values");
8267 let query = query.select("id");
8268 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8269 Ok(ids
8270 .into_iter()
8271 .map(|id| ErrorValue {
8272 proc: self.proc.clone(),
8273 selection: crate::querybuilder::query()
8274 .select("node")
8275 .arg("id", &id.0)
8276 .inline_fragment("ErrorValue"),
8277 graphql_client: self.graphql_client.clone(),
8278 })
8279 .collect())
8280 }
8281 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8288 let mut query = self.selection.select("withValue");
8289 query = query.arg("name", name.into());
8290 query = query.arg("value", value);
8291 Error {
8292 proc: self.proc.clone(),
8293 selection: query,
8294 graphql_client: self.graphql_client.clone(),
8295 }
8296 }
8297}
8298impl Node for Error {
8299 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8300 let query = self.selection.select("id");
8301 let graphql_client = self.graphql_client.clone();
8302 async move { query.execute(graphql_client).await }
8303 }
8304}
8305#[derive(Clone)]
8306pub struct ErrorValue {
8307 pub proc: Option<Arc<DaggerSessionProc>>,
8308 pub selection: Selection,
8309 pub graphql_client: DynGraphQLClient,
8310}
8311impl IntoID<Id> for ErrorValue {
8312 fn into_id(
8313 self,
8314 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8315 Box::pin(async move { self.id().await })
8316 }
8317}
8318impl Loadable for ErrorValue {
8319 fn graphql_type() -> &'static str {
8320 "ErrorValue"
8321 }
8322 fn from_query(
8323 proc: Option<Arc<DaggerSessionProc>>,
8324 selection: Selection,
8325 graphql_client: DynGraphQLClient,
8326 ) -> Self {
8327 Self {
8328 proc,
8329 selection,
8330 graphql_client,
8331 }
8332 }
8333}
8334impl ErrorValue {
8335 pub async fn id(&self) -> Result<Id, DaggerError> {
8337 let query = self.selection.select("id");
8338 query.execute(self.graphql_client.clone()).await
8339 }
8340 pub async fn name(&self) -> Result<String, DaggerError> {
8342 let query = self.selection.select("name");
8343 query.execute(self.graphql_client.clone()).await
8344 }
8345 pub async fn value(&self) -> Result<Json, DaggerError> {
8347 let query = self.selection.select("value");
8348 query.execute(self.graphql_client.clone()).await
8349 }
8350}
8351impl Node for ErrorValue {
8352 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8353 let query = self.selection.select("id");
8354 let graphql_client = self.graphql_client.clone();
8355 async move { query.execute(graphql_client).await }
8356 }
8357}
8358#[derive(Clone)]
8359pub struct FieldTypeDef {
8360 pub proc: Option<Arc<DaggerSessionProc>>,
8361 pub selection: Selection,
8362 pub graphql_client: DynGraphQLClient,
8363}
8364impl IntoID<Id> for FieldTypeDef {
8365 fn into_id(
8366 self,
8367 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8368 Box::pin(async move { self.id().await })
8369 }
8370}
8371impl Loadable for FieldTypeDef {
8372 fn graphql_type() -> &'static str {
8373 "FieldTypeDef"
8374 }
8375 fn from_query(
8376 proc: Option<Arc<DaggerSessionProc>>,
8377 selection: Selection,
8378 graphql_client: DynGraphQLClient,
8379 ) -> Self {
8380 Self {
8381 proc,
8382 selection,
8383 graphql_client,
8384 }
8385 }
8386}
8387impl FieldTypeDef {
8388 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8390 let query = self.selection.select("deprecated");
8391 query.execute(self.graphql_client.clone()).await
8392 }
8393 pub async fn description(&self) -> Result<String, DaggerError> {
8395 let query = self.selection.select("description");
8396 query.execute(self.graphql_client.clone()).await
8397 }
8398 pub async fn id(&self) -> Result<Id, DaggerError> {
8400 let query = self.selection.select("id");
8401 query.execute(self.graphql_client.clone()).await
8402 }
8403 pub async fn name(&self) -> Result<String, DaggerError> {
8405 let query = self.selection.select("name");
8406 query.execute(self.graphql_client.clone()).await
8407 }
8408 pub fn source_map(&self) -> SourceMap {
8410 let query = self.selection.select("sourceMap");
8411 SourceMap {
8412 proc: self.proc.clone(),
8413 selection: query,
8414 graphql_client: self.graphql_client.clone(),
8415 }
8416 }
8417 pub fn type_def(&self) -> TypeDef {
8419 let query = self.selection.select("typeDef");
8420 TypeDef {
8421 proc: self.proc.clone(),
8422 selection: query,
8423 graphql_client: self.graphql_client.clone(),
8424 }
8425 }
8426}
8427impl Node for FieldTypeDef {
8428 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8429 let query = self.selection.select("id");
8430 let graphql_client = self.graphql_client.clone();
8431 async move { query.execute(graphql_client).await }
8432 }
8433}
8434#[derive(Clone)]
8435pub struct File {
8436 pub proc: Option<Arc<DaggerSessionProc>>,
8437 pub selection: Selection,
8438 pub graphql_client: DynGraphQLClient,
8439}
8440#[derive(Builder, Debug, PartialEq)]
8441pub struct FileAsEnvFileOpts {
8442 #[builder(setter(into, strip_option), default)]
8444 pub expand: Option<bool>,
8445}
8446#[derive(Builder, Debug, PartialEq)]
8447pub struct FileContentsOpts {
8448 #[builder(setter(into, strip_option), default)]
8450 pub limit_lines: Option<isize>,
8451 #[builder(setter(into, strip_option), default)]
8453 pub offset_lines: Option<isize>,
8454}
8455#[derive(Builder, Debug, PartialEq)]
8456pub struct FileDigestOpts {
8457 #[builder(setter(into, strip_option), default)]
8459 pub exclude_metadata: Option<bool>,
8460}
8461#[derive(Builder, Debug, PartialEq)]
8462pub struct FileExportOpts {
8463 #[builder(setter(into, strip_option), default)]
8465 pub allow_parent_dir_path: Option<bool>,
8466}
8467#[derive(Builder, Debug, PartialEq)]
8468pub struct FileSearchOpts<'a> {
8469 #[builder(setter(into, strip_option), default)]
8471 pub dotall: Option<bool>,
8472 #[builder(setter(into, strip_option), default)]
8474 pub files_only: Option<bool>,
8475 #[builder(setter(into, strip_option), default)]
8476 pub globs: Option<Vec<&'a str>>,
8477 #[builder(setter(into, strip_option), default)]
8479 pub insensitive: Option<bool>,
8480 #[builder(setter(into, strip_option), default)]
8482 pub limit: Option<isize>,
8483 #[builder(setter(into, strip_option), default)]
8485 pub literal: Option<bool>,
8486 #[builder(setter(into, strip_option), default)]
8488 pub multiline: Option<bool>,
8489 #[builder(setter(into, strip_option), default)]
8490 pub paths: Option<Vec<&'a str>>,
8491 #[builder(setter(into, strip_option), default)]
8493 pub skip_hidden: Option<bool>,
8494 #[builder(setter(into, strip_option), default)]
8496 pub skip_ignored: Option<bool>,
8497}
8498#[derive(Builder, Debug, PartialEq)]
8499pub struct FileWithReplacedOpts {
8500 #[builder(setter(into, strip_option), default)]
8502 pub all: Option<bool>,
8503 #[builder(setter(into, strip_option), default)]
8505 pub first_from: Option<isize>,
8506}
8507impl IntoID<Id> for File {
8508 fn into_id(
8509 self,
8510 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8511 Box::pin(async move { self.id().await })
8512 }
8513}
8514impl Loadable for File {
8515 fn graphql_type() -> &'static str {
8516 "File"
8517 }
8518 fn from_query(
8519 proc: Option<Arc<DaggerSessionProc>>,
8520 selection: Selection,
8521 graphql_client: DynGraphQLClient,
8522 ) -> Self {
8523 Self {
8524 proc,
8525 selection,
8526 graphql_client,
8527 }
8528 }
8529}
8530impl File {
8531 pub fn as_env_file(&self) -> EnvFile {
8537 let query = self.selection.select("asEnvFile");
8538 EnvFile {
8539 proc: self.proc.clone(),
8540 selection: query,
8541 graphql_client: self.graphql_client.clone(),
8542 }
8543 }
8544 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8550 let mut query = self.selection.select("asEnvFile");
8551 if let Some(expand) = opts.expand {
8552 query = query.arg("expand", expand);
8553 }
8554 EnvFile {
8555 proc: self.proc.clone(),
8556 selection: query,
8557 graphql_client: self.graphql_client.clone(),
8558 }
8559 }
8560 pub fn as_json(&self) -> JsonValue {
8562 let query = self.selection.select("asJSON");
8563 JsonValue {
8564 proc: self.proc.clone(),
8565 selection: query,
8566 graphql_client: self.graphql_client.clone(),
8567 }
8568 }
8569 pub fn chown(&self, owner: impl Into<String>) -> File {
8579 let mut query = self.selection.select("chown");
8580 query = query.arg("owner", owner.into());
8581 File {
8582 proc: self.proc.clone(),
8583 selection: query,
8584 graphql_client: self.graphql_client.clone(),
8585 }
8586 }
8587 pub async fn contents(&self) -> Result<String, DaggerError> {
8593 let query = self.selection.select("contents");
8594 query.execute(self.graphql_client.clone()).await
8595 }
8596 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8602 let mut query = self.selection.select("contents");
8603 if let Some(offset_lines) = opts.offset_lines {
8604 query = query.arg("offsetLines", offset_lines);
8605 }
8606 if let Some(limit_lines) = opts.limit_lines {
8607 query = query.arg("limitLines", limit_lines);
8608 }
8609 query.execute(self.graphql_client.clone()).await
8610 }
8611 pub async fn digest(&self) -> Result<String, DaggerError> {
8617 let query = self.selection.select("digest");
8618 query.execute(self.graphql_client.clone()).await
8619 }
8620 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8626 let mut query = self.selection.select("digest");
8627 if let Some(exclude_metadata) = opts.exclude_metadata {
8628 query = query.arg("excludeMetadata", exclude_metadata);
8629 }
8630 query.execute(self.graphql_client.clone()).await
8631 }
8632 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8639 let mut query = self.selection.select("export");
8640 query = query.arg("path", path.into());
8641 query.execute(self.graphql_client.clone()).await
8642 }
8643 pub async fn export_opts(
8650 &self,
8651 path: impl Into<String>,
8652 opts: FileExportOpts,
8653 ) -> Result<String, DaggerError> {
8654 let mut query = self.selection.select("export");
8655 query = query.arg("path", path.into());
8656 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8657 query = query.arg("allowParentDirPath", allow_parent_dir_path);
8658 }
8659 query.execute(self.graphql_client.clone()).await
8660 }
8661 pub async fn id(&self) -> Result<Id, DaggerError> {
8663 let query = self.selection.select("id");
8664 query.execute(self.graphql_client.clone()).await
8665 }
8666 pub async fn name(&self) -> Result<String, DaggerError> {
8668 let query = self.selection.select("name");
8669 query.execute(self.graphql_client.clone()).await
8670 }
8671 pub async fn search(
8679 &self,
8680 pattern: impl Into<String>,
8681 ) -> Result<Vec<SearchResult>, DaggerError> {
8682 let mut query = self.selection.select("search");
8683 query = query.arg("pattern", pattern.into());
8684 let query = query.select("id");
8685 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8686 Ok(ids
8687 .into_iter()
8688 .map(|id| SearchResult {
8689 proc: self.proc.clone(),
8690 selection: crate::querybuilder::query()
8691 .select("node")
8692 .arg("id", &id.0)
8693 .inline_fragment("SearchResult"),
8694 graphql_client: self.graphql_client.clone(),
8695 })
8696 .collect())
8697 }
8698 pub async fn search_opts<'a>(
8706 &self,
8707 pattern: impl Into<String>,
8708 opts: FileSearchOpts<'a>,
8709 ) -> Result<Vec<SearchResult>, DaggerError> {
8710 let mut query = self.selection.select("search");
8711 query = query.arg("pattern", pattern.into());
8712 if let Some(literal) = opts.literal {
8713 query = query.arg("literal", literal);
8714 }
8715 if let Some(multiline) = opts.multiline {
8716 query = query.arg("multiline", multiline);
8717 }
8718 if let Some(dotall) = opts.dotall {
8719 query = query.arg("dotall", dotall);
8720 }
8721 if let Some(insensitive) = opts.insensitive {
8722 query = query.arg("insensitive", insensitive);
8723 }
8724 if let Some(skip_ignored) = opts.skip_ignored {
8725 query = query.arg("skipIgnored", skip_ignored);
8726 }
8727 if let Some(skip_hidden) = opts.skip_hidden {
8728 query = query.arg("skipHidden", skip_hidden);
8729 }
8730 if let Some(files_only) = opts.files_only {
8731 query = query.arg("filesOnly", files_only);
8732 }
8733 if let Some(limit) = opts.limit {
8734 query = query.arg("limit", limit);
8735 }
8736 if let Some(paths) = opts.paths {
8737 query = query.arg("paths", paths);
8738 }
8739 if let Some(globs) = opts.globs {
8740 query = query.arg("globs", globs);
8741 }
8742 let query = query.select("id");
8743 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8744 Ok(ids
8745 .into_iter()
8746 .map(|id| SearchResult {
8747 proc: self.proc.clone(),
8748 selection: crate::querybuilder::query()
8749 .select("node")
8750 .arg("id", &id.0)
8751 .inline_fragment("SearchResult"),
8752 graphql_client: self.graphql_client.clone(),
8753 })
8754 .collect())
8755 }
8756 pub async fn size(&self) -> Result<isize, DaggerError> {
8758 let query = self.selection.select("size");
8759 query.execute(self.graphql_client.clone()).await
8760 }
8761 pub fn stat(&self) -> Stat {
8763 let query = self.selection.select("stat");
8764 Stat {
8765 proc: self.proc.clone(),
8766 selection: query,
8767 graphql_client: self.graphql_client.clone(),
8768 }
8769 }
8770 pub async fn sync(&self) -> Result<File, DaggerError> {
8772 let query = self.selection.select("sync");
8773 let id: Id = query.execute(self.graphql_client.clone()).await?;
8774 Ok(File {
8775 proc: self.proc.clone(),
8776 selection: query
8777 .root()
8778 .select("node")
8779 .arg("id", &id.0)
8780 .inline_fragment("File"),
8781 graphql_client: self.graphql_client.clone(),
8782 })
8783 }
8784 pub fn with_name(&self, name: impl Into<String>) -> File {
8790 let mut query = self.selection.select("withName");
8791 query = query.arg("name", name.into());
8792 File {
8793 proc: self.proc.clone(),
8794 selection: query,
8795 graphql_client: self.graphql_client.clone(),
8796 }
8797 }
8798 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8810 let mut query = self.selection.select("withReplaced");
8811 query = query.arg("search", search.into());
8812 query = query.arg("replacement", replacement.into());
8813 File {
8814 proc: self.proc.clone(),
8815 selection: query,
8816 graphql_client: self.graphql_client.clone(),
8817 }
8818 }
8819 pub fn with_replaced_opts(
8831 &self,
8832 search: impl Into<String>,
8833 replacement: impl Into<String>,
8834 opts: FileWithReplacedOpts,
8835 ) -> File {
8836 let mut query = self.selection.select("withReplaced");
8837 query = query.arg("search", search.into());
8838 query = query.arg("replacement", replacement.into());
8839 if let Some(all) = opts.all {
8840 query = query.arg("all", all);
8841 }
8842 if let Some(first_from) = opts.first_from {
8843 query = query.arg("firstFrom", first_from);
8844 }
8845 File {
8846 proc: self.proc.clone(),
8847 selection: query,
8848 graphql_client: self.graphql_client.clone(),
8849 }
8850 }
8851 pub fn with_timestamps(&self, timestamp: isize) -> File {
8859 let mut query = self.selection.select("withTimestamps");
8860 query = query.arg("timestamp", timestamp);
8861 File {
8862 proc: self.proc.clone(),
8863 selection: query,
8864 graphql_client: self.graphql_client.clone(),
8865 }
8866 }
8867}
8868impl Exportable for File {
8869 fn export(
8870 &self,
8871 path: impl Into<String>,
8872 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
8873 let mut query = self.selection.select("export");
8874 query = query.arg("path", path.into());
8875 let graphql_client = self.graphql_client.clone();
8876 async move { query.execute(graphql_client).await }
8877 }
8878 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8879 let query = self.selection.select("id");
8880 let graphql_client = self.graphql_client.clone();
8881 async move { query.execute(graphql_client).await }
8882 }
8883}
8884impl Node for File {
8885 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8886 let query = self.selection.select("id");
8887 let graphql_client = self.graphql_client.clone();
8888 async move { query.execute(graphql_client).await }
8889 }
8890}
8891impl Syncer for File {
8892 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8893 let query = self.selection.select("id");
8894 let graphql_client = self.graphql_client.clone();
8895 async move { query.execute(graphql_client).await }
8896 }
8897 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8898 let query = self.selection.select("sync");
8899 let graphql_client = self.graphql_client.clone();
8900 async move { query.execute(graphql_client).await }
8901 }
8902}
8903#[derive(Clone)]
8904pub struct Function {
8905 pub proc: Option<Arc<DaggerSessionProc>>,
8906 pub selection: Selection,
8907 pub graphql_client: DynGraphQLClient,
8908}
8909#[derive(Builder, Debug, PartialEq)]
8910pub struct FunctionWithArgOpts<'a> {
8911 #[builder(setter(into, strip_option), default)]
8912 pub default_address: Option<&'a str>,
8913 #[builder(setter(into, strip_option), default)]
8915 pub default_path: Option<&'a str>,
8916 #[builder(setter(into, strip_option), default)]
8918 pub default_value: Option<Json>,
8919 #[builder(setter(into, strip_option), default)]
8921 pub deprecated: Option<&'a str>,
8922 #[builder(setter(into, strip_option), default)]
8924 pub description: Option<&'a str>,
8925 #[builder(setter(into, strip_option), default)]
8927 pub ignore: Option<Vec<&'a str>>,
8928 #[builder(setter(into, strip_option), default)]
8930 pub source_map: Option<Id>,
8931}
8932#[derive(Builder, Debug, PartialEq)]
8933pub struct FunctionWithCachePolicyOpts<'a> {
8934 #[builder(setter(into, strip_option), default)]
8936 pub time_to_live: Option<&'a str>,
8937}
8938#[derive(Builder, Debug, PartialEq)]
8939pub struct FunctionWithDeprecatedOpts<'a> {
8940 #[builder(setter(into, strip_option), default)]
8942 pub reason: Option<&'a str>,
8943}
8944impl IntoID<Id> for Function {
8945 fn into_id(
8946 self,
8947 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8948 Box::pin(async move { self.id().await })
8949 }
8950}
8951impl Loadable for Function {
8952 fn graphql_type() -> &'static str {
8953 "Function"
8954 }
8955 fn from_query(
8956 proc: Option<Arc<DaggerSessionProc>>,
8957 selection: Selection,
8958 graphql_client: DynGraphQLClient,
8959 ) -> Self {
8960 Self {
8961 proc,
8962 selection,
8963 graphql_client,
8964 }
8965 }
8966}
8967impl Function {
8968 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
8970 let query = self.selection.select("args");
8971 let query = query.select("id");
8972 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8973 Ok(ids
8974 .into_iter()
8975 .map(|id| FunctionArg {
8976 proc: self.proc.clone(),
8977 selection: crate::querybuilder::query()
8978 .select("node")
8979 .arg("id", &id.0)
8980 .inline_fragment("FunctionArg"),
8981 graphql_client: self.graphql_client.clone(),
8982 })
8983 .collect())
8984 }
8985 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8987 let query = self.selection.select("deprecated");
8988 query.execute(self.graphql_client.clone()).await
8989 }
8990 pub async fn description(&self) -> Result<String, DaggerError> {
8992 let query = self.selection.select("description");
8993 query.execute(self.graphql_client.clone()).await
8994 }
8995 pub async fn id(&self) -> Result<Id, DaggerError> {
8997 let query = self.selection.select("id");
8998 query.execute(self.graphql_client.clone()).await
8999 }
9000 pub async fn name(&self) -> Result<String, DaggerError> {
9002 let query = self.selection.select("name");
9003 query.execute(self.graphql_client.clone()).await
9004 }
9005 pub fn return_type(&self) -> TypeDef {
9007 let query = self.selection.select("returnType");
9008 TypeDef {
9009 proc: self.proc.clone(),
9010 selection: query,
9011 graphql_client: self.graphql_client.clone(),
9012 }
9013 }
9014 pub fn source_map(&self) -> SourceMap {
9016 let query = self.selection.select("sourceMap");
9017 SourceMap {
9018 proc: self.proc.clone(),
9019 selection: query,
9020 graphql_client: self.graphql_client.clone(),
9021 }
9022 }
9023 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9025 let query = self.selection.select("sourceModuleName");
9026 query.execute(self.graphql_client.clone()).await
9027 }
9028 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9036 let mut query = self.selection.select("withArg");
9037 query = query.arg("name", name.into());
9038 query = query.arg_lazy(
9039 "typeDef",
9040 Box::new(move || {
9041 let type_def = type_def.clone();
9042 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9043 }),
9044 );
9045 Function {
9046 proc: self.proc.clone(),
9047 selection: query,
9048 graphql_client: self.graphql_client.clone(),
9049 }
9050 }
9051 pub fn with_arg_opts<'a>(
9059 &self,
9060 name: impl Into<String>,
9061 type_def: impl IntoID<Id>,
9062 opts: FunctionWithArgOpts<'a>,
9063 ) -> Function {
9064 let mut query = self.selection.select("withArg");
9065 query = query.arg("name", name.into());
9066 query = query.arg_lazy(
9067 "typeDef",
9068 Box::new(move || {
9069 let type_def = type_def.clone();
9070 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9071 }),
9072 );
9073 if let Some(description) = opts.description {
9074 query = query.arg("description", description);
9075 }
9076 if let Some(default_value) = opts.default_value {
9077 query = query.arg("defaultValue", default_value);
9078 }
9079 if let Some(default_path) = opts.default_path {
9080 query = query.arg("defaultPath", default_path);
9081 }
9082 if let Some(ignore) = opts.ignore {
9083 query = query.arg("ignore", ignore);
9084 }
9085 if let Some(source_map) = opts.source_map {
9086 query = query.arg("sourceMap", source_map);
9087 }
9088 if let Some(deprecated) = opts.deprecated {
9089 query = query.arg("deprecated", deprecated);
9090 }
9091 if let Some(default_address) = opts.default_address {
9092 query = query.arg("defaultAddress", default_address);
9093 }
9094 Function {
9095 proc: self.proc.clone(),
9096 selection: query,
9097 graphql_client: self.graphql_client.clone(),
9098 }
9099 }
9100 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9107 let mut query = self.selection.select("withCachePolicy");
9108 query = query.arg("policy", policy);
9109 Function {
9110 proc: self.proc.clone(),
9111 selection: query,
9112 graphql_client: self.graphql_client.clone(),
9113 }
9114 }
9115 pub fn with_cache_policy_opts<'a>(
9122 &self,
9123 policy: FunctionCachePolicy,
9124 opts: FunctionWithCachePolicyOpts<'a>,
9125 ) -> Function {
9126 let mut query = self.selection.select("withCachePolicy");
9127 query = query.arg("policy", policy);
9128 if let Some(time_to_live) = opts.time_to_live {
9129 query = query.arg("timeToLive", time_to_live);
9130 }
9131 Function {
9132 proc: self.proc.clone(),
9133 selection: query,
9134 graphql_client: self.graphql_client.clone(),
9135 }
9136 }
9137 pub fn with_check(&self) -> Function {
9139 let query = self.selection.select("withCheck");
9140 Function {
9141 proc: self.proc.clone(),
9142 selection: query,
9143 graphql_client: self.graphql_client.clone(),
9144 }
9145 }
9146 pub fn with_deprecated(&self) -> Function {
9152 let query = self.selection.select("withDeprecated");
9153 Function {
9154 proc: self.proc.clone(),
9155 selection: query,
9156 graphql_client: self.graphql_client.clone(),
9157 }
9158 }
9159 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9165 let mut query = self.selection.select("withDeprecated");
9166 if let Some(reason) = opts.reason {
9167 query = query.arg("reason", reason);
9168 }
9169 Function {
9170 proc: self.proc.clone(),
9171 selection: query,
9172 graphql_client: self.graphql_client.clone(),
9173 }
9174 }
9175 pub fn with_description(&self, description: impl Into<String>) -> Function {
9181 let mut query = self.selection.select("withDescription");
9182 query = query.arg("description", description.into());
9183 Function {
9184 proc: self.proc.clone(),
9185 selection: query,
9186 graphql_client: self.graphql_client.clone(),
9187 }
9188 }
9189 pub fn with_generator(&self) -> Function {
9191 let query = self.selection.select("withGenerator");
9192 Function {
9193 proc: self.proc.clone(),
9194 selection: query,
9195 graphql_client: self.graphql_client.clone(),
9196 }
9197 }
9198 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9204 let mut query = self.selection.select("withSourceMap");
9205 query = query.arg_lazy(
9206 "sourceMap",
9207 Box::new(move || {
9208 let source_map = source_map.clone();
9209 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9210 }),
9211 );
9212 Function {
9213 proc: self.proc.clone(),
9214 selection: query,
9215 graphql_client: self.graphql_client.clone(),
9216 }
9217 }
9218 pub fn with_up(&self) -> Function {
9220 let query = self.selection.select("withUp");
9221 Function {
9222 proc: self.proc.clone(),
9223 selection: query,
9224 graphql_client: self.graphql_client.clone(),
9225 }
9226 }
9227}
9228impl Node for Function {
9229 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9230 let query = self.selection.select("id");
9231 let graphql_client = self.graphql_client.clone();
9232 async move { query.execute(graphql_client).await }
9233 }
9234}
9235#[derive(Clone)]
9236pub struct FunctionArg {
9237 pub proc: Option<Arc<DaggerSessionProc>>,
9238 pub selection: Selection,
9239 pub graphql_client: DynGraphQLClient,
9240}
9241impl IntoID<Id> for FunctionArg {
9242 fn into_id(
9243 self,
9244 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9245 Box::pin(async move { self.id().await })
9246 }
9247}
9248impl Loadable for FunctionArg {
9249 fn graphql_type() -> &'static str {
9250 "FunctionArg"
9251 }
9252 fn from_query(
9253 proc: Option<Arc<DaggerSessionProc>>,
9254 selection: Selection,
9255 graphql_client: DynGraphQLClient,
9256 ) -> Self {
9257 Self {
9258 proc,
9259 selection,
9260 graphql_client,
9261 }
9262 }
9263}
9264impl FunctionArg {
9265 pub async fn default_address(&self) -> Result<String, DaggerError> {
9267 let query = self.selection.select("defaultAddress");
9268 query.execute(self.graphql_client.clone()).await
9269 }
9270 pub async fn default_path(&self) -> Result<String, DaggerError> {
9272 let query = self.selection.select("defaultPath");
9273 query.execute(self.graphql_client.clone()).await
9274 }
9275 pub async fn default_value(&self) -> Result<Json, DaggerError> {
9277 let query = self.selection.select("defaultValue");
9278 query.execute(self.graphql_client.clone()).await
9279 }
9280 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9282 let query = self.selection.select("deprecated");
9283 query.execute(self.graphql_client.clone()).await
9284 }
9285 pub async fn description(&self) -> Result<String, DaggerError> {
9287 let query = self.selection.select("description");
9288 query.execute(self.graphql_client.clone()).await
9289 }
9290 pub async fn id(&self) -> Result<Id, DaggerError> {
9292 let query = self.selection.select("id");
9293 query.execute(self.graphql_client.clone()).await
9294 }
9295 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9297 let query = self.selection.select("ignore");
9298 query.execute(self.graphql_client.clone()).await
9299 }
9300 pub async fn name(&self) -> Result<String, DaggerError> {
9302 let query = self.selection.select("name");
9303 query.execute(self.graphql_client.clone()).await
9304 }
9305 pub fn source_map(&self) -> SourceMap {
9307 let query = self.selection.select("sourceMap");
9308 SourceMap {
9309 proc: self.proc.clone(),
9310 selection: query,
9311 graphql_client: self.graphql_client.clone(),
9312 }
9313 }
9314 pub fn type_def(&self) -> TypeDef {
9316 let query = self.selection.select("typeDef");
9317 TypeDef {
9318 proc: self.proc.clone(),
9319 selection: query,
9320 graphql_client: self.graphql_client.clone(),
9321 }
9322 }
9323}
9324impl Node for FunctionArg {
9325 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9326 let query = self.selection.select("id");
9327 let graphql_client = self.graphql_client.clone();
9328 async move { query.execute(graphql_client).await }
9329 }
9330}
9331#[derive(Clone)]
9332pub struct FunctionCall {
9333 pub proc: Option<Arc<DaggerSessionProc>>,
9334 pub selection: Selection,
9335 pub graphql_client: DynGraphQLClient,
9336}
9337impl IntoID<Id> for FunctionCall {
9338 fn into_id(
9339 self,
9340 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9341 Box::pin(async move { self.id().await })
9342 }
9343}
9344impl Loadable for FunctionCall {
9345 fn graphql_type() -> &'static str {
9346 "FunctionCall"
9347 }
9348 fn from_query(
9349 proc: Option<Arc<DaggerSessionProc>>,
9350 selection: Selection,
9351 graphql_client: DynGraphQLClient,
9352 ) -> Self {
9353 Self {
9354 proc,
9355 selection,
9356 graphql_client,
9357 }
9358 }
9359}
9360impl FunctionCall {
9361 pub async fn id(&self) -> Result<Id, DaggerError> {
9363 let query = self.selection.select("id");
9364 query.execute(self.graphql_client.clone()).await
9365 }
9366 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9368 let query = self.selection.select("inputArgs");
9369 let query = query.select("id");
9370 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9371 Ok(ids
9372 .into_iter()
9373 .map(|id| FunctionCallArgValue {
9374 proc: self.proc.clone(),
9375 selection: crate::querybuilder::query()
9376 .select("node")
9377 .arg("id", &id.0)
9378 .inline_fragment("FunctionCallArgValue"),
9379 graphql_client: self.graphql_client.clone(),
9380 })
9381 .collect())
9382 }
9383 pub async fn name(&self) -> Result<String, DaggerError> {
9385 let query = self.selection.select("name");
9386 query.execute(self.graphql_client.clone()).await
9387 }
9388 pub async fn parent(&self) -> Result<Json, DaggerError> {
9390 let query = self.selection.select("parent");
9391 query.execute(self.graphql_client.clone()).await
9392 }
9393 pub async fn parent_name(&self) -> Result<String, DaggerError> {
9395 let query = self.selection.select("parentName");
9396 query.execute(self.graphql_client.clone()).await
9397 }
9398 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9404 let mut query = self.selection.select("returnError");
9405 query = query.arg_lazy(
9406 "error",
9407 Box::new(move || {
9408 let error = error.clone();
9409 Box::pin(async move { error.into_id().await.unwrap().quote() })
9410 }),
9411 );
9412 query.execute(self.graphql_client.clone()).await
9413 }
9414 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9420 let mut query = self.selection.select("returnValue");
9421 query = query.arg("value", value);
9422 query.execute(self.graphql_client.clone()).await
9423 }
9424}
9425impl Node for FunctionCall {
9426 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9427 let query = self.selection.select("id");
9428 let graphql_client = self.graphql_client.clone();
9429 async move { query.execute(graphql_client).await }
9430 }
9431}
9432#[derive(Clone)]
9433pub struct FunctionCallArgValue {
9434 pub proc: Option<Arc<DaggerSessionProc>>,
9435 pub selection: Selection,
9436 pub graphql_client: DynGraphQLClient,
9437}
9438impl IntoID<Id> for FunctionCallArgValue {
9439 fn into_id(
9440 self,
9441 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9442 Box::pin(async move { self.id().await })
9443 }
9444}
9445impl Loadable for FunctionCallArgValue {
9446 fn graphql_type() -> &'static str {
9447 "FunctionCallArgValue"
9448 }
9449 fn from_query(
9450 proc: Option<Arc<DaggerSessionProc>>,
9451 selection: Selection,
9452 graphql_client: DynGraphQLClient,
9453 ) -> Self {
9454 Self {
9455 proc,
9456 selection,
9457 graphql_client,
9458 }
9459 }
9460}
9461impl FunctionCallArgValue {
9462 pub async fn id(&self) -> Result<Id, DaggerError> {
9464 let query = self.selection.select("id");
9465 query.execute(self.graphql_client.clone()).await
9466 }
9467 pub async fn name(&self) -> Result<String, DaggerError> {
9469 let query = self.selection.select("name");
9470 query.execute(self.graphql_client.clone()).await
9471 }
9472 pub async fn value(&self) -> Result<Json, DaggerError> {
9474 let query = self.selection.select("value");
9475 query.execute(self.graphql_client.clone()).await
9476 }
9477}
9478impl Node for FunctionCallArgValue {
9479 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9480 let query = self.selection.select("id");
9481 let graphql_client = self.graphql_client.clone();
9482 async move { query.execute(graphql_client).await }
9483 }
9484}
9485#[derive(Clone)]
9486pub struct GeneratedCode {
9487 pub proc: Option<Arc<DaggerSessionProc>>,
9488 pub selection: Selection,
9489 pub graphql_client: DynGraphQLClient,
9490}
9491impl IntoID<Id> for GeneratedCode {
9492 fn into_id(
9493 self,
9494 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9495 Box::pin(async move { self.id().await })
9496 }
9497}
9498impl Loadable for GeneratedCode {
9499 fn graphql_type() -> &'static str {
9500 "GeneratedCode"
9501 }
9502 fn from_query(
9503 proc: Option<Arc<DaggerSessionProc>>,
9504 selection: Selection,
9505 graphql_client: DynGraphQLClient,
9506 ) -> Self {
9507 Self {
9508 proc,
9509 selection,
9510 graphql_client,
9511 }
9512 }
9513}
9514impl GeneratedCode {
9515 pub fn code(&self) -> Directory {
9517 let query = self.selection.select("code");
9518 Directory {
9519 proc: self.proc.clone(),
9520 selection: query,
9521 graphql_client: self.graphql_client.clone(),
9522 }
9523 }
9524 pub async fn id(&self) -> Result<Id, DaggerError> {
9526 let query = self.selection.select("id");
9527 query.execute(self.graphql_client.clone()).await
9528 }
9529 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9531 let query = self.selection.select("vcsGeneratedPaths");
9532 query.execute(self.graphql_client.clone()).await
9533 }
9534 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9536 let query = self.selection.select("vcsIgnoredPaths");
9537 query.execute(self.graphql_client.clone()).await
9538 }
9539 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9541 let mut query = self.selection.select("withVCSGeneratedPaths");
9542 query = query.arg(
9543 "paths",
9544 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9545 );
9546 GeneratedCode {
9547 proc: self.proc.clone(),
9548 selection: query,
9549 graphql_client: self.graphql_client.clone(),
9550 }
9551 }
9552 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9554 let mut query = self.selection.select("withVCSIgnoredPaths");
9555 query = query.arg(
9556 "paths",
9557 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9558 );
9559 GeneratedCode {
9560 proc: self.proc.clone(),
9561 selection: query,
9562 graphql_client: self.graphql_client.clone(),
9563 }
9564 }
9565}
9566impl Node for GeneratedCode {
9567 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9568 let query = self.selection.select("id");
9569 let graphql_client = self.graphql_client.clone();
9570 async move { query.execute(graphql_client).await }
9571 }
9572}
9573#[derive(Clone)]
9574pub struct Generator {
9575 pub proc: Option<Arc<DaggerSessionProc>>,
9576 pub selection: Selection,
9577 pub graphql_client: DynGraphQLClient,
9578}
9579impl IntoID<Id> for Generator {
9580 fn into_id(
9581 self,
9582 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9583 Box::pin(async move { self.id().await })
9584 }
9585}
9586impl Loadable for Generator {
9587 fn graphql_type() -> &'static str {
9588 "Generator"
9589 }
9590 fn from_query(
9591 proc: Option<Arc<DaggerSessionProc>>,
9592 selection: Selection,
9593 graphql_client: DynGraphQLClient,
9594 ) -> Self {
9595 Self {
9596 proc,
9597 selection,
9598 graphql_client,
9599 }
9600 }
9601}
9602impl Generator {
9603 pub fn changes(&self) -> Changeset {
9605 let query = self.selection.select("changes");
9606 Changeset {
9607 proc: self.proc.clone(),
9608 selection: query,
9609 graphql_client: self.graphql_client.clone(),
9610 }
9611 }
9612 pub async fn completed(&self) -> Result<bool, DaggerError> {
9614 let query = self.selection.select("completed");
9615 query.execute(self.graphql_client.clone()).await
9616 }
9617 pub async fn description(&self) -> Result<String, DaggerError> {
9619 let query = self.selection.select("description");
9620 query.execute(self.graphql_client.clone()).await
9621 }
9622 pub async fn id(&self) -> Result<Id, DaggerError> {
9624 let query = self.selection.select("id");
9625 query.execute(self.graphql_client.clone()).await
9626 }
9627 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9629 let query = self.selection.select("isEmpty");
9630 query.execute(self.graphql_client.clone()).await
9631 }
9632 pub async fn name(&self) -> Result<String, DaggerError> {
9634 let query = self.selection.select("name");
9635 query.execute(self.graphql_client.clone()).await
9636 }
9637 pub fn original_module(&self) -> Module {
9639 let query = self.selection.select("originalModule");
9640 Module {
9641 proc: self.proc.clone(),
9642 selection: query,
9643 graphql_client: self.graphql_client.clone(),
9644 }
9645 }
9646 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9648 let query = self.selection.select("path");
9649 query.execute(self.graphql_client.clone()).await
9650 }
9651 pub fn run(&self) -> Generator {
9653 let query = self.selection.select("run");
9654 Generator {
9655 proc: self.proc.clone(),
9656 selection: query,
9657 graphql_client: self.graphql_client.clone(),
9658 }
9659 }
9660}
9661impl Node for Generator {
9662 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9663 let query = self.selection.select("id");
9664 let graphql_client = self.graphql_client.clone();
9665 async move { query.execute(graphql_client).await }
9666 }
9667}
9668#[derive(Clone)]
9669pub struct GeneratorGroup {
9670 pub proc: Option<Arc<DaggerSessionProc>>,
9671 pub selection: Selection,
9672 pub graphql_client: DynGraphQLClient,
9673}
9674#[derive(Builder, Debug, PartialEq)]
9675pub struct GeneratorGroupChangesOpts {
9676 #[builder(setter(into, strip_option), default)]
9678 pub on_conflict: Option<ChangesetsMergeConflict>,
9679}
9680impl IntoID<Id> for GeneratorGroup {
9681 fn into_id(
9682 self,
9683 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9684 Box::pin(async move { self.id().await })
9685 }
9686}
9687impl Loadable for GeneratorGroup {
9688 fn graphql_type() -> &'static str {
9689 "GeneratorGroup"
9690 }
9691 fn from_query(
9692 proc: Option<Arc<DaggerSessionProc>>,
9693 selection: Selection,
9694 graphql_client: DynGraphQLClient,
9695 ) -> Self {
9696 Self {
9697 proc,
9698 selection,
9699 graphql_client,
9700 }
9701 }
9702}
9703impl GeneratorGroup {
9704 pub fn changes(&self) -> Changeset {
9712 let query = self.selection.select("changes");
9713 Changeset {
9714 proc: self.proc.clone(),
9715 selection: query,
9716 graphql_client: self.graphql_client.clone(),
9717 }
9718 }
9719 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9727 let mut query = self.selection.select("changes");
9728 if let Some(on_conflict) = opts.on_conflict {
9729 query = query.arg("onConflict", on_conflict);
9730 }
9731 Changeset {
9732 proc: self.proc.clone(),
9733 selection: query,
9734 graphql_client: self.graphql_client.clone(),
9735 }
9736 }
9737 pub async fn id(&self) -> Result<Id, DaggerError> {
9739 let query = self.selection.select("id");
9740 query.execute(self.graphql_client.clone()).await
9741 }
9742 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9744 let query = self.selection.select("isEmpty");
9745 query.execute(self.graphql_client.clone()).await
9746 }
9747 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9749 let query = self.selection.select("list");
9750 let query = query.select("id");
9751 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9752 Ok(ids
9753 .into_iter()
9754 .map(|id| Generator {
9755 proc: self.proc.clone(),
9756 selection: crate::querybuilder::query()
9757 .select("node")
9758 .arg("id", &id.0)
9759 .inline_fragment("Generator"),
9760 graphql_client: self.graphql_client.clone(),
9761 })
9762 .collect())
9763 }
9764 pub fn run(&self) -> GeneratorGroup {
9766 let query = self.selection.select("run");
9767 GeneratorGroup {
9768 proc: self.proc.clone(),
9769 selection: query,
9770 graphql_client: self.graphql_client.clone(),
9771 }
9772 }
9773}
9774impl Node for GeneratorGroup {
9775 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9776 let query = self.selection.select("id");
9777 let graphql_client = self.graphql_client.clone();
9778 async move { query.execute(graphql_client).await }
9779 }
9780}
9781#[derive(Clone)]
9782pub struct GitRef {
9783 pub proc: Option<Arc<DaggerSessionProc>>,
9784 pub selection: Selection,
9785 pub graphql_client: DynGraphQLClient,
9786}
9787#[derive(Builder, Debug, PartialEq)]
9788pub struct GitRefTreeOpts {
9789 #[builder(setter(into, strip_option), default)]
9791 pub depth: Option<isize>,
9792 #[builder(setter(into, strip_option), default)]
9794 pub discard_git_dir: Option<bool>,
9795 #[builder(setter(into, strip_option), default)]
9797 pub include_tags: Option<bool>,
9798}
9799impl IntoID<Id> for GitRef {
9800 fn into_id(
9801 self,
9802 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9803 Box::pin(async move { self.id().await })
9804 }
9805}
9806impl Loadable for GitRef {
9807 fn graphql_type() -> &'static str {
9808 "GitRef"
9809 }
9810 fn from_query(
9811 proc: Option<Arc<DaggerSessionProc>>,
9812 selection: Selection,
9813 graphql_client: DynGraphQLClient,
9814 ) -> Self {
9815 Self {
9816 proc,
9817 selection,
9818 graphql_client,
9819 }
9820 }
9821}
9822impl GitRef {
9823 pub async fn commit(&self) -> Result<String, DaggerError> {
9825 let query = self.selection.select("commit");
9826 query.execute(self.graphql_client.clone()).await
9827 }
9828 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9834 let mut query = self.selection.select("commonAncestor");
9835 query = query.arg_lazy(
9836 "other",
9837 Box::new(move || {
9838 let other = other.clone();
9839 Box::pin(async move { other.into_id().await.unwrap().quote() })
9840 }),
9841 );
9842 GitRef {
9843 proc: self.proc.clone(),
9844 selection: query,
9845 graphql_client: self.graphql_client.clone(),
9846 }
9847 }
9848 pub async fn id(&self) -> Result<Id, DaggerError> {
9850 let query = self.selection.select("id");
9851 query.execute(self.graphql_client.clone()).await
9852 }
9853 pub async fn r#ref(&self) -> Result<String, DaggerError> {
9855 let query = self.selection.select("ref");
9856 query.execute(self.graphql_client.clone()).await
9857 }
9858 pub fn tree(&self) -> Directory {
9864 let query = self.selection.select("tree");
9865 Directory {
9866 proc: self.proc.clone(),
9867 selection: query,
9868 graphql_client: self.graphql_client.clone(),
9869 }
9870 }
9871 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9877 let mut query = self.selection.select("tree");
9878 if let Some(discard_git_dir) = opts.discard_git_dir {
9879 query = query.arg("discardGitDir", discard_git_dir);
9880 }
9881 if let Some(depth) = opts.depth {
9882 query = query.arg("depth", depth);
9883 }
9884 if let Some(include_tags) = opts.include_tags {
9885 query = query.arg("includeTags", include_tags);
9886 }
9887 Directory {
9888 proc: self.proc.clone(),
9889 selection: query,
9890 graphql_client: self.graphql_client.clone(),
9891 }
9892 }
9893}
9894impl Node for GitRef {
9895 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9896 let query = self.selection.select("id");
9897 let graphql_client = self.graphql_client.clone();
9898 async move { query.execute(graphql_client).await }
9899 }
9900}
9901#[derive(Clone)]
9902pub struct GitRepository {
9903 pub proc: Option<Arc<DaggerSessionProc>>,
9904 pub selection: Selection,
9905 pub graphql_client: DynGraphQLClient,
9906}
9907#[derive(Builder, Debug, PartialEq)]
9908pub struct GitRepositoryBranchesOpts<'a> {
9909 #[builder(setter(into, strip_option), default)]
9911 pub patterns: Option<Vec<&'a str>>,
9912}
9913#[derive(Builder, Debug, PartialEq)]
9914pub struct GitRepositoryTagsOpts<'a> {
9915 #[builder(setter(into, strip_option), default)]
9917 pub patterns: Option<Vec<&'a str>>,
9918}
9919impl IntoID<Id> for GitRepository {
9920 fn into_id(
9921 self,
9922 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9923 Box::pin(async move { self.id().await })
9924 }
9925}
9926impl Loadable for GitRepository {
9927 fn graphql_type() -> &'static str {
9928 "GitRepository"
9929 }
9930 fn from_query(
9931 proc: Option<Arc<DaggerSessionProc>>,
9932 selection: Selection,
9933 graphql_client: DynGraphQLClient,
9934 ) -> Self {
9935 Self {
9936 proc,
9937 selection,
9938 graphql_client,
9939 }
9940 }
9941}
9942impl GitRepository {
9943 pub fn branch(&self, name: impl Into<String>) -> GitRef {
9949 let mut query = self.selection.select("branch");
9950 query = query.arg("name", name.into());
9951 GitRef {
9952 proc: self.proc.clone(),
9953 selection: query,
9954 graphql_client: self.graphql_client.clone(),
9955 }
9956 }
9957 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9963 let query = self.selection.select("branches");
9964 query.execute(self.graphql_client.clone()).await
9965 }
9966 pub async fn branches_opts<'a>(
9972 &self,
9973 opts: GitRepositoryBranchesOpts<'a>,
9974 ) -> Result<Vec<String>, DaggerError> {
9975 let mut query = self.selection.select("branches");
9976 if let Some(patterns) = opts.patterns {
9977 query = query.arg("patterns", patterns);
9978 }
9979 query.execute(self.graphql_client.clone()).await
9980 }
9981 pub fn commit(&self, id: impl Into<String>) -> GitRef {
9987 let mut query = self.selection.select("commit");
9988 query = query.arg("id", id.into());
9989 GitRef {
9990 proc: self.proc.clone(),
9991 selection: query,
9992 graphql_client: self.graphql_client.clone(),
9993 }
9994 }
9995 pub fn head(&self) -> GitRef {
9997 let query = self.selection.select("head");
9998 GitRef {
9999 proc: self.proc.clone(),
10000 selection: query,
10001 graphql_client: self.graphql_client.clone(),
10002 }
10003 }
10004 pub async fn id(&self) -> Result<Id, DaggerError> {
10006 let query = self.selection.select("id");
10007 query.execute(self.graphql_client.clone()).await
10008 }
10009 pub fn latest_version(&self) -> GitRef {
10011 let query = self.selection.select("latestVersion");
10012 GitRef {
10013 proc: self.proc.clone(),
10014 selection: query,
10015 graphql_client: self.graphql_client.clone(),
10016 }
10017 }
10018 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10024 let mut query = self.selection.select("ref");
10025 query = query.arg("name", name.into());
10026 GitRef {
10027 proc: self.proc.clone(),
10028 selection: query,
10029 graphql_client: self.graphql_client.clone(),
10030 }
10031 }
10032 pub fn tag(&self, name: impl Into<String>) -> GitRef {
10038 let mut query = self.selection.select("tag");
10039 query = query.arg("name", name.into());
10040 GitRef {
10041 proc: self.proc.clone(),
10042 selection: query,
10043 graphql_client: self.graphql_client.clone(),
10044 }
10045 }
10046 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10052 let query = self.selection.select("tags");
10053 query.execute(self.graphql_client.clone()).await
10054 }
10055 pub async fn tags_opts<'a>(
10061 &self,
10062 opts: GitRepositoryTagsOpts<'a>,
10063 ) -> Result<Vec<String>, DaggerError> {
10064 let mut query = self.selection.select("tags");
10065 if let Some(patterns) = opts.patterns {
10066 query = query.arg("patterns", patterns);
10067 }
10068 query.execute(self.graphql_client.clone()).await
10069 }
10070 pub fn uncommitted(&self) -> Changeset {
10072 let query = self.selection.select("uncommitted");
10073 Changeset {
10074 proc: self.proc.clone(),
10075 selection: query,
10076 graphql_client: self.graphql_client.clone(),
10077 }
10078 }
10079 pub async fn url(&self) -> Result<String, DaggerError> {
10081 let query = self.selection.select("url");
10082 query.execute(self.graphql_client.clone()).await
10083 }
10084}
10085impl Node for GitRepository {
10086 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10087 let query = self.selection.select("id");
10088 let graphql_client = self.graphql_client.clone();
10089 async move { query.execute(graphql_client).await }
10090 }
10091}
10092#[derive(Clone)]
10093pub struct HttpState {
10094 pub proc: Option<Arc<DaggerSessionProc>>,
10095 pub selection: Selection,
10096 pub graphql_client: DynGraphQLClient,
10097}
10098impl IntoID<Id> for HttpState {
10099 fn into_id(
10100 self,
10101 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10102 Box::pin(async move { self.id().await })
10103 }
10104}
10105impl Loadable for HttpState {
10106 fn graphql_type() -> &'static str {
10107 "HTTPState"
10108 }
10109 fn from_query(
10110 proc: Option<Arc<DaggerSessionProc>>,
10111 selection: Selection,
10112 graphql_client: DynGraphQLClient,
10113 ) -> Self {
10114 Self {
10115 proc,
10116 selection,
10117 graphql_client,
10118 }
10119 }
10120}
10121impl HttpState {
10122 pub async fn id(&self) -> Result<Id, DaggerError> {
10124 let query = self.selection.select("id");
10125 query.execute(self.graphql_client.clone()).await
10126 }
10127}
10128impl Node for HttpState {
10129 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10130 let query = self.selection.select("id");
10131 let graphql_client = self.graphql_client.clone();
10132 async move { query.execute(graphql_client).await }
10133 }
10134}
10135#[derive(Clone)]
10136pub struct HealthcheckConfig {
10137 pub proc: Option<Arc<DaggerSessionProc>>,
10138 pub selection: Selection,
10139 pub graphql_client: DynGraphQLClient,
10140}
10141impl IntoID<Id> for HealthcheckConfig {
10142 fn into_id(
10143 self,
10144 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10145 Box::pin(async move { self.id().await })
10146 }
10147}
10148impl Loadable for HealthcheckConfig {
10149 fn graphql_type() -> &'static str {
10150 "HealthcheckConfig"
10151 }
10152 fn from_query(
10153 proc: Option<Arc<DaggerSessionProc>>,
10154 selection: Selection,
10155 graphql_client: DynGraphQLClient,
10156 ) -> Self {
10157 Self {
10158 proc,
10159 selection,
10160 graphql_client,
10161 }
10162 }
10163}
10164impl HealthcheckConfig {
10165 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10167 let query = self.selection.select("args");
10168 query.execute(self.graphql_client.clone()).await
10169 }
10170 pub async fn id(&self) -> Result<Id, DaggerError> {
10172 let query = self.selection.select("id");
10173 query.execute(self.graphql_client.clone()).await
10174 }
10175 pub async fn interval(&self) -> Result<String, DaggerError> {
10177 let query = self.selection.select("interval");
10178 query.execute(self.graphql_client.clone()).await
10179 }
10180 pub async fn retries(&self) -> Result<isize, DaggerError> {
10182 let query = self.selection.select("retries");
10183 query.execute(self.graphql_client.clone()).await
10184 }
10185 pub async fn shell(&self) -> Result<bool, DaggerError> {
10187 let query = self.selection.select("shell");
10188 query.execute(self.graphql_client.clone()).await
10189 }
10190 pub async fn start_interval(&self) -> Result<String, DaggerError> {
10192 let query = self.selection.select("startInterval");
10193 query.execute(self.graphql_client.clone()).await
10194 }
10195 pub async fn start_period(&self) -> Result<String, DaggerError> {
10197 let query = self.selection.select("startPeriod");
10198 query.execute(self.graphql_client.clone()).await
10199 }
10200 pub async fn timeout(&self) -> Result<String, DaggerError> {
10202 let query = self.selection.select("timeout");
10203 query.execute(self.graphql_client.clone()).await
10204 }
10205}
10206impl Node for HealthcheckConfig {
10207 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10208 let query = self.selection.select("id");
10209 let graphql_client = self.graphql_client.clone();
10210 async move { query.execute(graphql_client).await }
10211 }
10212}
10213#[derive(Clone)]
10214pub struct Host {
10215 pub proc: Option<Arc<DaggerSessionProc>>,
10216 pub selection: Selection,
10217 pub graphql_client: DynGraphQLClient,
10218}
10219#[derive(Builder, Debug, PartialEq)]
10220pub struct HostDirectoryOpts<'a> {
10221 #[builder(setter(into, strip_option), default)]
10223 pub exclude: Option<Vec<&'a str>>,
10224 #[builder(setter(into, strip_option), default)]
10226 pub gitignore: Option<bool>,
10227 #[builder(setter(into, strip_option), default)]
10229 pub include: Option<Vec<&'a str>>,
10230 #[builder(setter(into, strip_option), default)]
10232 pub no_cache: Option<bool>,
10233}
10234#[derive(Builder, Debug, PartialEq)]
10235pub struct HostFileOpts {
10236 #[builder(setter(into, strip_option), default)]
10238 pub no_cache: Option<bool>,
10239}
10240#[derive(Builder, Debug, PartialEq)]
10241pub struct HostFindUpOpts {
10242 #[builder(setter(into, strip_option), default)]
10243 pub no_cache: Option<bool>,
10244}
10245#[derive(Builder, Debug, PartialEq)]
10246pub struct HostServiceOpts<'a> {
10247 #[builder(setter(into, strip_option), default)]
10249 pub host: Option<&'a str>,
10250}
10251#[derive(Builder, Debug, PartialEq)]
10252pub struct HostTunnelOpts {
10253 #[builder(setter(into, strip_option), default)]
10256 pub native: Option<bool>,
10257 #[builder(setter(into, strip_option), default)]
10262 pub ports: Option<Vec<PortForward>>,
10263}
10264impl IntoID<Id> for Host {
10265 fn into_id(
10266 self,
10267 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10268 Box::pin(async move { self.id().await })
10269 }
10270}
10271impl Loadable for Host {
10272 fn graphql_type() -> &'static str {
10273 "Host"
10274 }
10275 fn from_query(
10276 proc: Option<Arc<DaggerSessionProc>>,
10277 selection: Selection,
10278 graphql_client: DynGraphQLClient,
10279 ) -> Self {
10280 Self {
10281 proc,
10282 selection,
10283 graphql_client,
10284 }
10285 }
10286}
10287impl Host {
10288 pub fn container_image(&self, name: impl Into<String>) -> Container {
10294 let mut query = self.selection.select("containerImage");
10295 query = query.arg("name", name.into());
10296 Container {
10297 proc: self.proc.clone(),
10298 selection: query,
10299 graphql_client: self.graphql_client.clone(),
10300 }
10301 }
10302 pub fn directory(&self, path: impl Into<String>) -> Directory {
10309 let mut query = self.selection.select("directory");
10310 query = query.arg("path", path.into());
10311 Directory {
10312 proc: self.proc.clone(),
10313 selection: query,
10314 graphql_client: self.graphql_client.clone(),
10315 }
10316 }
10317 pub fn directory_opts<'a>(
10324 &self,
10325 path: impl Into<String>,
10326 opts: HostDirectoryOpts<'a>,
10327 ) -> Directory {
10328 let mut query = self.selection.select("directory");
10329 query = query.arg("path", path.into());
10330 if let Some(exclude) = opts.exclude {
10331 query = query.arg("exclude", exclude);
10332 }
10333 if let Some(include) = opts.include {
10334 query = query.arg("include", include);
10335 }
10336 if let Some(no_cache) = opts.no_cache {
10337 query = query.arg("noCache", no_cache);
10338 }
10339 if let Some(gitignore) = opts.gitignore {
10340 query = query.arg("gitignore", gitignore);
10341 }
10342 Directory {
10343 proc: self.proc.clone(),
10344 selection: query,
10345 graphql_client: self.graphql_client.clone(),
10346 }
10347 }
10348 pub fn file(&self, path: impl Into<String>) -> File {
10355 let mut query = self.selection.select("file");
10356 query = query.arg("path", path.into());
10357 File {
10358 proc: self.proc.clone(),
10359 selection: query,
10360 graphql_client: self.graphql_client.clone(),
10361 }
10362 }
10363 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10370 let mut query = self.selection.select("file");
10371 query = query.arg("path", path.into());
10372 if let Some(no_cache) = opts.no_cache {
10373 query = query.arg("noCache", no_cache);
10374 }
10375 File {
10376 proc: self.proc.clone(),
10377 selection: query,
10378 graphql_client: self.graphql_client.clone(),
10379 }
10380 }
10381 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10388 let mut query = self.selection.select("findUp");
10389 query = query.arg("name", name.into());
10390 query.execute(self.graphql_client.clone()).await
10391 }
10392 pub async fn find_up_opts(
10399 &self,
10400 name: impl Into<String>,
10401 opts: HostFindUpOpts,
10402 ) -> Result<String, DaggerError> {
10403 let mut query = self.selection.select("findUp");
10404 query = query.arg("name", name.into());
10405 if let Some(no_cache) = opts.no_cache {
10406 query = query.arg("noCache", no_cache);
10407 }
10408 query.execute(self.graphql_client.clone()).await
10409 }
10410 pub async fn id(&self) -> Result<Id, DaggerError> {
10412 let query = self.selection.select("id");
10413 query.execute(self.graphql_client.clone()).await
10414 }
10415 pub fn service(&self, ports: Vec<PortForward>) -> Service {
10426 let mut query = self.selection.select("service");
10427 query = query.arg("ports", ports);
10428 Service {
10429 proc: self.proc.clone(),
10430 selection: query,
10431 graphql_client: self.graphql_client.clone(),
10432 }
10433 }
10434 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10445 let mut query = self.selection.select("service");
10446 query = query.arg("ports", ports);
10447 if let Some(host) = opts.host {
10448 query = query.arg("host", host);
10449 }
10450 Service {
10451 proc: self.proc.clone(),
10452 selection: query,
10453 graphql_client: self.graphql_client.clone(),
10454 }
10455 }
10456 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10463 let mut query = self.selection.select("tunnel");
10464 query = query.arg_lazy(
10465 "service",
10466 Box::new(move || {
10467 let service = service.clone();
10468 Box::pin(async move { service.into_id().await.unwrap().quote() })
10469 }),
10470 );
10471 Service {
10472 proc: self.proc.clone(),
10473 selection: query,
10474 graphql_client: self.graphql_client.clone(),
10475 }
10476 }
10477 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10484 let mut query = self.selection.select("tunnel");
10485 query = query.arg_lazy(
10486 "service",
10487 Box::new(move || {
10488 let service = service.clone();
10489 Box::pin(async move { service.into_id().await.unwrap().quote() })
10490 }),
10491 );
10492 if let Some(native) = opts.native {
10493 query = query.arg("native", native);
10494 }
10495 if let Some(ports) = opts.ports {
10496 query = query.arg("ports", ports);
10497 }
10498 Service {
10499 proc: self.proc.clone(),
10500 selection: query,
10501 graphql_client: self.graphql_client.clone(),
10502 }
10503 }
10504 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10510 let mut query = self.selection.select("unixSocket");
10511 query = query.arg("path", path.into());
10512 Socket {
10513 proc: self.proc.clone(),
10514 selection: query,
10515 graphql_client: self.graphql_client.clone(),
10516 }
10517 }
10518}
10519impl Node for Host {
10520 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10521 let query = self.selection.select("id");
10522 let graphql_client = self.graphql_client.clone();
10523 async move { query.execute(graphql_client).await }
10524 }
10525}
10526#[derive(Clone)]
10527pub struct InputTypeDef {
10528 pub proc: Option<Arc<DaggerSessionProc>>,
10529 pub selection: Selection,
10530 pub graphql_client: DynGraphQLClient,
10531}
10532impl IntoID<Id> for InputTypeDef {
10533 fn into_id(
10534 self,
10535 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10536 Box::pin(async move { self.id().await })
10537 }
10538}
10539impl Loadable for InputTypeDef {
10540 fn graphql_type() -> &'static str {
10541 "InputTypeDef"
10542 }
10543 fn from_query(
10544 proc: Option<Arc<DaggerSessionProc>>,
10545 selection: Selection,
10546 graphql_client: DynGraphQLClient,
10547 ) -> Self {
10548 Self {
10549 proc,
10550 selection,
10551 graphql_client,
10552 }
10553 }
10554}
10555impl InputTypeDef {
10556 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10558 let query = self.selection.select("fields");
10559 let query = query.select("id");
10560 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10561 Ok(ids
10562 .into_iter()
10563 .map(|id| FieldTypeDef {
10564 proc: self.proc.clone(),
10565 selection: crate::querybuilder::query()
10566 .select("node")
10567 .arg("id", &id.0)
10568 .inline_fragment("FieldTypeDef"),
10569 graphql_client: self.graphql_client.clone(),
10570 })
10571 .collect())
10572 }
10573 pub async fn id(&self) -> Result<Id, DaggerError> {
10575 let query = self.selection.select("id");
10576 query.execute(self.graphql_client.clone()).await
10577 }
10578 pub async fn name(&self) -> Result<String, DaggerError> {
10580 let query = self.selection.select("name");
10581 query.execute(self.graphql_client.clone()).await
10582 }
10583}
10584impl Node for InputTypeDef {
10585 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10586 let query = self.selection.select("id");
10587 let graphql_client = self.graphql_client.clone();
10588 async move { query.execute(graphql_client).await }
10589 }
10590}
10591#[derive(Clone)]
10592pub struct InterfaceTypeDef {
10593 pub proc: Option<Arc<DaggerSessionProc>>,
10594 pub selection: Selection,
10595 pub graphql_client: DynGraphQLClient,
10596}
10597impl IntoID<Id> for InterfaceTypeDef {
10598 fn into_id(
10599 self,
10600 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10601 Box::pin(async move { self.id().await })
10602 }
10603}
10604impl Loadable for InterfaceTypeDef {
10605 fn graphql_type() -> &'static str {
10606 "InterfaceTypeDef"
10607 }
10608 fn from_query(
10609 proc: Option<Arc<DaggerSessionProc>>,
10610 selection: Selection,
10611 graphql_client: DynGraphQLClient,
10612 ) -> Self {
10613 Self {
10614 proc,
10615 selection,
10616 graphql_client,
10617 }
10618 }
10619}
10620impl InterfaceTypeDef {
10621 pub async fn description(&self) -> Result<String, DaggerError> {
10623 let query = self.selection.select("description");
10624 query.execute(self.graphql_client.clone()).await
10625 }
10626 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10628 let query = self.selection.select("functions");
10629 let query = query.select("id");
10630 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10631 Ok(ids
10632 .into_iter()
10633 .map(|id| Function {
10634 proc: self.proc.clone(),
10635 selection: crate::querybuilder::query()
10636 .select("node")
10637 .arg("id", &id.0)
10638 .inline_fragment("Function"),
10639 graphql_client: self.graphql_client.clone(),
10640 })
10641 .collect())
10642 }
10643 pub async fn id(&self) -> Result<Id, DaggerError> {
10645 let query = self.selection.select("id");
10646 query.execute(self.graphql_client.clone()).await
10647 }
10648 pub async fn name(&self) -> Result<String, DaggerError> {
10650 let query = self.selection.select("name");
10651 query.execute(self.graphql_client.clone()).await
10652 }
10653 pub fn source_map(&self) -> SourceMap {
10655 let query = self.selection.select("sourceMap");
10656 SourceMap {
10657 proc: self.proc.clone(),
10658 selection: query,
10659 graphql_client: self.graphql_client.clone(),
10660 }
10661 }
10662 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10664 let query = self.selection.select("sourceModuleName");
10665 query.execute(self.graphql_client.clone()).await
10666 }
10667}
10668impl Node for InterfaceTypeDef {
10669 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10670 let query = self.selection.select("id");
10671 let graphql_client = self.graphql_client.clone();
10672 async move { query.execute(graphql_client).await }
10673 }
10674}
10675#[derive(Clone)]
10676pub struct JsonValue {
10677 pub proc: Option<Arc<DaggerSessionProc>>,
10678 pub selection: Selection,
10679 pub graphql_client: DynGraphQLClient,
10680}
10681#[derive(Builder, Debug, PartialEq)]
10682pub struct JsonValueContentsOpts<'a> {
10683 #[builder(setter(into, strip_option), default)]
10685 pub indent: Option<&'a str>,
10686 #[builder(setter(into, strip_option), default)]
10688 pub pretty: Option<bool>,
10689}
10690impl IntoID<Id> for JsonValue {
10691 fn into_id(
10692 self,
10693 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10694 Box::pin(async move { self.id().await })
10695 }
10696}
10697impl Loadable for JsonValue {
10698 fn graphql_type() -> &'static str {
10699 "JSONValue"
10700 }
10701 fn from_query(
10702 proc: Option<Arc<DaggerSessionProc>>,
10703 selection: Selection,
10704 graphql_client: DynGraphQLClient,
10705 ) -> Self {
10706 Self {
10707 proc,
10708 selection,
10709 graphql_client,
10710 }
10711 }
10712}
10713impl JsonValue {
10714 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10716 let query = self.selection.select("asArray");
10717 let query = query.select("id");
10718 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10719 Ok(ids
10720 .into_iter()
10721 .map(|id| JsonValue {
10722 proc: self.proc.clone(),
10723 selection: crate::querybuilder::query()
10724 .select("node")
10725 .arg("id", &id.0)
10726 .inline_fragment("JSONValue"),
10727 graphql_client: self.graphql_client.clone(),
10728 })
10729 .collect())
10730 }
10731 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10733 let query = self.selection.select("asBoolean");
10734 query.execute(self.graphql_client.clone()).await
10735 }
10736 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10738 let query = self.selection.select("asInteger");
10739 query.execute(self.graphql_client.clone()).await
10740 }
10741 pub async fn as_string(&self) -> Result<String, DaggerError> {
10743 let query = self.selection.select("asString");
10744 query.execute(self.graphql_client.clone()).await
10745 }
10746 pub async fn contents(&self) -> Result<Json, DaggerError> {
10752 let query = self.selection.select("contents");
10753 query.execute(self.graphql_client.clone()).await
10754 }
10755 pub async fn contents_opts<'a>(
10761 &self,
10762 opts: JsonValueContentsOpts<'a>,
10763 ) -> Result<Json, DaggerError> {
10764 let mut query = self.selection.select("contents");
10765 if let Some(pretty) = opts.pretty {
10766 query = query.arg("pretty", pretty);
10767 }
10768 if let Some(indent) = opts.indent {
10769 query = query.arg("indent", indent);
10770 }
10771 query.execute(self.graphql_client.clone()).await
10772 }
10773 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10779 let mut query = self.selection.select("field");
10780 query = query.arg(
10781 "path",
10782 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10783 );
10784 JsonValue {
10785 proc: self.proc.clone(),
10786 selection: query,
10787 graphql_client: self.graphql_client.clone(),
10788 }
10789 }
10790 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10792 let query = self.selection.select("fields");
10793 query.execute(self.graphql_client.clone()).await
10794 }
10795 pub async fn id(&self) -> Result<Id, DaggerError> {
10797 let query = self.selection.select("id");
10798 query.execute(self.graphql_client.clone()).await
10799 }
10800 pub fn new_boolean(&self, value: bool) -> JsonValue {
10806 let mut query = self.selection.select("newBoolean");
10807 query = query.arg("value", value);
10808 JsonValue {
10809 proc: self.proc.clone(),
10810 selection: query,
10811 graphql_client: self.graphql_client.clone(),
10812 }
10813 }
10814 pub fn new_integer(&self, value: isize) -> JsonValue {
10820 let mut query = self.selection.select("newInteger");
10821 query = query.arg("value", value);
10822 JsonValue {
10823 proc: self.proc.clone(),
10824 selection: query,
10825 graphql_client: self.graphql_client.clone(),
10826 }
10827 }
10828 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10834 let mut query = self.selection.select("newString");
10835 query = query.arg("value", value.into());
10836 JsonValue {
10837 proc: self.proc.clone(),
10838 selection: query,
10839 graphql_client: self.graphql_client.clone(),
10840 }
10841 }
10842 pub fn with_contents(&self, contents: Json) -> JsonValue {
10848 let mut query = self.selection.select("withContents");
10849 query = query.arg("contents", contents);
10850 JsonValue {
10851 proc: self.proc.clone(),
10852 selection: query,
10853 graphql_client: self.graphql_client.clone(),
10854 }
10855 }
10856 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10863 let mut query = self.selection.select("withField");
10864 query = query.arg(
10865 "path",
10866 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10867 );
10868 query = query.arg_lazy(
10869 "value",
10870 Box::new(move || {
10871 let value = value.clone();
10872 Box::pin(async move { value.into_id().await.unwrap().quote() })
10873 }),
10874 );
10875 JsonValue {
10876 proc: self.proc.clone(),
10877 selection: query,
10878 graphql_client: self.graphql_client.clone(),
10879 }
10880 }
10881}
10882impl Node for JsonValue {
10883 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10884 let query = self.selection.select("id");
10885 let graphql_client = self.graphql_client.clone();
10886 async move { query.execute(graphql_client).await }
10887 }
10888}
10889#[derive(Clone)]
10890pub struct Llm {
10891 pub proc: Option<Arc<DaggerSessionProc>>,
10892 pub selection: Selection,
10893 pub graphql_client: DynGraphQLClient,
10894}
10895impl IntoID<Id> for Llm {
10896 fn into_id(
10897 self,
10898 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10899 Box::pin(async move { self.id().await })
10900 }
10901}
10902impl Loadable for Llm {
10903 fn graphql_type() -> &'static str {
10904 "LLM"
10905 }
10906 fn from_query(
10907 proc: Option<Arc<DaggerSessionProc>>,
10908 selection: Selection,
10909 graphql_client: DynGraphQLClient,
10910 ) -> Self {
10911 Self {
10912 proc,
10913 selection,
10914 graphql_client,
10915 }
10916 }
10917}
10918impl Llm {
10919 pub fn attempt(&self, number: isize) -> Llm {
10921 let mut query = self.selection.select("attempt");
10922 query = query.arg("number", number);
10923 Llm {
10924 proc: self.proc.clone(),
10925 selection: query,
10926 graphql_client: self.graphql_client.clone(),
10927 }
10928 }
10929 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10931 let mut query = self.selection.select("bindResult");
10932 query = query.arg("name", name.into());
10933 Binding {
10934 proc: self.proc.clone(),
10935 selection: query,
10936 graphql_client: self.graphql_client.clone(),
10937 }
10938 }
10939 pub fn env(&self) -> Env {
10941 let query = self.selection.select("env");
10942 Env {
10943 proc: self.proc.clone(),
10944 selection: query,
10945 graphql_client: self.graphql_client.clone(),
10946 }
10947 }
10948 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10950 let query = self.selection.select("hasPrompt");
10951 query.execute(self.graphql_client.clone()).await
10952 }
10953 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10955 let query = self.selection.select("history");
10956 query.execute(self.graphql_client.clone()).await
10957 }
10958 pub async fn history_json(&self) -> Result<Json, DaggerError> {
10960 let query = self.selection.select("historyJSON");
10961 query.execute(self.graphql_client.clone()).await
10962 }
10963 pub async fn id(&self) -> Result<Id, DaggerError> {
10965 let query = self.selection.select("id");
10966 query.execute(self.graphql_client.clone()).await
10967 }
10968 pub async fn last_reply(&self) -> Result<String, DaggerError> {
10970 let query = self.selection.select("lastReply");
10971 query.execute(self.graphql_client.clone()).await
10972 }
10973 pub fn r#loop(&self) -> Llm {
10975 let query = self.selection.select("loop");
10976 Llm {
10977 proc: self.proc.clone(),
10978 selection: query,
10979 graphql_client: self.graphql_client.clone(),
10980 }
10981 }
10982 pub async fn model(&self) -> Result<String, DaggerError> {
10984 let query = self.selection.select("model");
10985 query.execute(self.graphql_client.clone()).await
10986 }
10987 pub async fn provider(&self) -> Result<String, DaggerError> {
10989 let query = self.selection.select("provider");
10990 query.execute(self.graphql_client.clone()).await
10991 }
10992 pub async fn step(&self) -> Result<Llm, DaggerError> {
10994 let query = self.selection.select("step");
10995 let id: Id = query.execute(self.graphql_client.clone()).await?;
10996 Ok(Llm {
10997 proc: self.proc.clone(),
10998 selection: query
10999 .root()
11000 .select("node")
11001 .arg("id", &id.0)
11002 .inline_fragment("LLM"),
11003 graphql_client: self.graphql_client.clone(),
11004 })
11005 }
11006 pub async fn sync(&self) -> Result<Llm, DaggerError> {
11008 let query = self.selection.select("sync");
11009 let id: Id = query.execute(self.graphql_client.clone()).await?;
11010 Ok(Llm {
11011 proc: self.proc.clone(),
11012 selection: query
11013 .root()
11014 .select("node")
11015 .arg("id", &id.0)
11016 .inline_fragment("LLM"),
11017 graphql_client: self.graphql_client.clone(),
11018 })
11019 }
11020 pub fn token_usage(&self) -> LlmTokenUsage {
11022 let query = self.selection.select("tokenUsage");
11023 LlmTokenUsage {
11024 proc: self.proc.clone(),
11025 selection: query,
11026 graphql_client: self.graphql_client.clone(),
11027 }
11028 }
11029 pub async fn tools(&self) -> Result<String, DaggerError> {
11031 let query = self.selection.select("tools");
11032 query.execute(self.graphql_client.clone()).await
11033 }
11034 pub fn with_blocked_function(
11043 &self,
11044 type_name: impl Into<String>,
11045 function: impl Into<String>,
11046 ) -> Llm {
11047 let mut query = self.selection.select("withBlockedFunction");
11048 query = query.arg("typeName", type_name.into());
11049 query = query.arg("function", function.into());
11050 Llm {
11051 proc: self.proc.clone(),
11052 selection: query,
11053 graphql_client: self.graphql_client.clone(),
11054 }
11055 }
11056 pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11058 let mut query = self.selection.select("withEnv");
11059 query = query.arg_lazy(
11060 "env",
11061 Box::new(move || {
11062 let env = env.clone();
11063 Box::pin(async move { env.into_id().await.unwrap().quote() })
11064 }),
11065 );
11066 Llm {
11067 proc: self.proc.clone(),
11068 selection: query,
11069 graphql_client: self.graphql_client.clone(),
11070 }
11071 }
11072 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11079 let mut query = self.selection.select("withMCPServer");
11080 query = query.arg("name", name.into());
11081 query = query.arg_lazy(
11082 "service",
11083 Box::new(move || {
11084 let service = service.clone();
11085 Box::pin(async move { service.into_id().await.unwrap().quote() })
11086 }),
11087 );
11088 Llm {
11089 proc: self.proc.clone(),
11090 selection: query,
11091 graphql_client: self.graphql_client.clone(),
11092 }
11093 }
11094 pub fn with_model(&self, model: impl Into<String>) -> Llm {
11100 let mut query = self.selection.select("withModel");
11101 query = query.arg("model", model.into());
11102 Llm {
11103 proc: self.proc.clone(),
11104 selection: query,
11105 graphql_client: self.graphql_client.clone(),
11106 }
11107 }
11108 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11114 let mut query = self.selection.select("withPrompt");
11115 query = query.arg("prompt", prompt.into());
11116 Llm {
11117 proc: self.proc.clone(),
11118 selection: query,
11119 graphql_client: self.graphql_client.clone(),
11120 }
11121 }
11122 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11128 let mut query = self.selection.select("withPromptFile");
11129 query = query.arg_lazy(
11130 "file",
11131 Box::new(move || {
11132 let file = file.clone();
11133 Box::pin(async move { file.into_id().await.unwrap().quote() })
11134 }),
11135 );
11136 Llm {
11137 proc: self.proc.clone(),
11138 selection: query,
11139 graphql_client: self.graphql_client.clone(),
11140 }
11141 }
11142 pub fn with_static_tools(&self) -> Llm {
11144 let query = self.selection.select("withStaticTools");
11145 Llm {
11146 proc: self.proc.clone(),
11147 selection: query,
11148 graphql_client: self.graphql_client.clone(),
11149 }
11150 }
11151 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11157 let mut query = self.selection.select("withSystemPrompt");
11158 query = query.arg("prompt", prompt.into());
11159 Llm {
11160 proc: self.proc.clone(),
11161 selection: query,
11162 graphql_client: self.graphql_client.clone(),
11163 }
11164 }
11165 pub fn without_default_system_prompt(&self) -> Llm {
11167 let query = self.selection.select("withoutDefaultSystemPrompt");
11168 Llm {
11169 proc: self.proc.clone(),
11170 selection: query,
11171 graphql_client: self.graphql_client.clone(),
11172 }
11173 }
11174 pub fn without_message_history(&self) -> Llm {
11176 let query = self.selection.select("withoutMessageHistory");
11177 Llm {
11178 proc: self.proc.clone(),
11179 selection: query,
11180 graphql_client: self.graphql_client.clone(),
11181 }
11182 }
11183 pub fn without_system_prompts(&self) -> Llm {
11185 let query = self.selection.select("withoutSystemPrompts");
11186 Llm {
11187 proc: self.proc.clone(),
11188 selection: query,
11189 graphql_client: self.graphql_client.clone(),
11190 }
11191 }
11192}
11193impl Node for Llm {
11194 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11195 let query = self.selection.select("id");
11196 let graphql_client = self.graphql_client.clone();
11197 async move { query.execute(graphql_client).await }
11198 }
11199}
11200impl Syncer for Llm {
11201 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11202 let query = self.selection.select("id");
11203 let graphql_client = self.graphql_client.clone();
11204 async move { query.execute(graphql_client).await }
11205 }
11206 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11207 let query = self.selection.select("sync");
11208 let graphql_client = self.graphql_client.clone();
11209 async move { query.execute(graphql_client).await }
11210 }
11211}
11212#[derive(Clone)]
11213pub struct LlmTokenUsage {
11214 pub proc: Option<Arc<DaggerSessionProc>>,
11215 pub selection: Selection,
11216 pub graphql_client: DynGraphQLClient,
11217}
11218impl IntoID<Id> for LlmTokenUsage {
11219 fn into_id(
11220 self,
11221 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11222 Box::pin(async move { self.id().await })
11223 }
11224}
11225impl Loadable for LlmTokenUsage {
11226 fn graphql_type() -> &'static str {
11227 "LLMTokenUsage"
11228 }
11229 fn from_query(
11230 proc: Option<Arc<DaggerSessionProc>>,
11231 selection: Selection,
11232 graphql_client: DynGraphQLClient,
11233 ) -> Self {
11234 Self {
11235 proc,
11236 selection,
11237 graphql_client,
11238 }
11239 }
11240}
11241impl LlmTokenUsage {
11242 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11243 let query = self.selection.select("cachedTokenReads");
11244 query.execute(self.graphql_client.clone()).await
11245 }
11246 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11247 let query = self.selection.select("cachedTokenWrites");
11248 query.execute(self.graphql_client.clone()).await
11249 }
11250 pub async fn id(&self) -> Result<Id, DaggerError> {
11252 let query = self.selection.select("id");
11253 query.execute(self.graphql_client.clone()).await
11254 }
11255 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11256 let query = self.selection.select("inputTokens");
11257 query.execute(self.graphql_client.clone()).await
11258 }
11259 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11260 let query = self.selection.select("outputTokens");
11261 query.execute(self.graphql_client.clone()).await
11262 }
11263 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11264 let query = self.selection.select("totalTokens");
11265 query.execute(self.graphql_client.clone()).await
11266 }
11267}
11268impl Node for LlmTokenUsage {
11269 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11270 let query = self.selection.select("id");
11271 let graphql_client = self.graphql_client.clone();
11272 async move { query.execute(graphql_client).await }
11273 }
11274}
11275#[derive(Clone)]
11276pub struct Label {
11277 pub proc: Option<Arc<DaggerSessionProc>>,
11278 pub selection: Selection,
11279 pub graphql_client: DynGraphQLClient,
11280}
11281impl IntoID<Id> for Label {
11282 fn into_id(
11283 self,
11284 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11285 Box::pin(async move { self.id().await })
11286 }
11287}
11288impl Loadable for Label {
11289 fn graphql_type() -> &'static str {
11290 "Label"
11291 }
11292 fn from_query(
11293 proc: Option<Arc<DaggerSessionProc>>,
11294 selection: Selection,
11295 graphql_client: DynGraphQLClient,
11296 ) -> Self {
11297 Self {
11298 proc,
11299 selection,
11300 graphql_client,
11301 }
11302 }
11303}
11304impl Label {
11305 pub async fn id(&self) -> Result<Id, DaggerError> {
11307 let query = self.selection.select("id");
11308 query.execute(self.graphql_client.clone()).await
11309 }
11310 pub async fn name(&self) -> Result<String, DaggerError> {
11312 let query = self.selection.select("name");
11313 query.execute(self.graphql_client.clone()).await
11314 }
11315 pub async fn value(&self) -> Result<String, DaggerError> {
11317 let query = self.selection.select("value");
11318 query.execute(self.graphql_client.clone()).await
11319 }
11320}
11321impl Node for Label {
11322 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11323 let query = self.selection.select("id");
11324 let graphql_client = self.graphql_client.clone();
11325 async move { query.execute(graphql_client).await }
11326 }
11327}
11328#[derive(Clone)]
11329pub struct ListTypeDef {
11330 pub proc: Option<Arc<DaggerSessionProc>>,
11331 pub selection: Selection,
11332 pub graphql_client: DynGraphQLClient,
11333}
11334impl IntoID<Id> for ListTypeDef {
11335 fn into_id(
11336 self,
11337 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11338 Box::pin(async move { self.id().await })
11339 }
11340}
11341impl Loadable for ListTypeDef {
11342 fn graphql_type() -> &'static str {
11343 "ListTypeDef"
11344 }
11345 fn from_query(
11346 proc: Option<Arc<DaggerSessionProc>>,
11347 selection: Selection,
11348 graphql_client: DynGraphQLClient,
11349 ) -> Self {
11350 Self {
11351 proc,
11352 selection,
11353 graphql_client,
11354 }
11355 }
11356}
11357impl ListTypeDef {
11358 pub fn element_type_def(&self) -> TypeDef {
11360 let query = self.selection.select("elementTypeDef");
11361 TypeDef {
11362 proc: self.proc.clone(),
11363 selection: query,
11364 graphql_client: self.graphql_client.clone(),
11365 }
11366 }
11367 pub async fn id(&self) -> Result<Id, DaggerError> {
11369 let query = self.selection.select("id");
11370 query.execute(self.graphql_client.clone()).await
11371 }
11372}
11373impl Node for ListTypeDef {
11374 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11375 let query = self.selection.select("id");
11376 let graphql_client = self.graphql_client.clone();
11377 async move { query.execute(graphql_client).await }
11378 }
11379}
11380#[derive(Clone)]
11381pub struct Module {
11382 pub proc: Option<Arc<DaggerSessionProc>>,
11383 pub selection: Selection,
11384 pub graphql_client: DynGraphQLClient,
11385}
11386#[derive(Builder, Debug, PartialEq)]
11387pub struct ModuleChecksOpts<'a> {
11388 #[builder(setter(into, strip_option), default)]
11390 pub include: Option<Vec<&'a str>>,
11391 #[builder(setter(into, strip_option), default)]
11393 pub no_generate: Option<bool>,
11394}
11395#[derive(Builder, Debug, PartialEq)]
11396pub struct ModuleGeneratorsOpts<'a> {
11397 #[builder(setter(into, strip_option), default)]
11399 pub include: Option<Vec<&'a str>>,
11400}
11401#[derive(Builder, Debug, PartialEq)]
11402pub struct ModuleServeOpts {
11403 #[builder(setter(into, strip_option), default)]
11405 pub entrypoint: Option<bool>,
11406 #[builder(setter(into, strip_option), default)]
11408 pub include_dependencies: Option<bool>,
11409}
11410#[derive(Builder, Debug, PartialEq)]
11411pub struct ModuleServicesOpts<'a> {
11412 #[builder(setter(into, strip_option), default)]
11414 pub include: Option<Vec<&'a str>>,
11415}
11416impl IntoID<Id> for Module {
11417 fn into_id(
11418 self,
11419 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11420 Box::pin(async move { self.id().await })
11421 }
11422}
11423impl Loadable for Module {
11424 fn graphql_type() -> &'static str {
11425 "Module"
11426 }
11427 fn from_query(
11428 proc: Option<Arc<DaggerSessionProc>>,
11429 selection: Selection,
11430 graphql_client: DynGraphQLClient,
11431 ) -> Self {
11432 Self {
11433 proc,
11434 selection,
11435 graphql_client,
11436 }
11437 }
11438}
11439impl Module {
11440 pub fn check(&self, name: impl Into<String>) -> Check {
11446 let mut query = self.selection.select("check");
11447 query = query.arg("name", name.into());
11448 Check {
11449 proc: self.proc.clone(),
11450 selection: query,
11451 graphql_client: self.graphql_client.clone(),
11452 }
11453 }
11454 pub fn checks(&self) -> CheckGroup {
11460 let query = self.selection.select("checks");
11461 CheckGroup {
11462 proc: self.proc.clone(),
11463 selection: query,
11464 graphql_client: self.graphql_client.clone(),
11465 }
11466 }
11467 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11473 let mut query = self.selection.select("checks");
11474 if let Some(include) = opts.include {
11475 query = query.arg("include", include);
11476 }
11477 if let Some(no_generate) = opts.no_generate {
11478 query = query.arg("noGenerate", no_generate);
11479 }
11480 CheckGroup {
11481 proc: self.proc.clone(),
11482 selection: query,
11483 graphql_client: self.graphql_client.clone(),
11484 }
11485 }
11486 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11488 let query = self.selection.select("dependencies");
11489 let query = query.select("id");
11490 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11491 Ok(ids
11492 .into_iter()
11493 .map(|id| Module {
11494 proc: self.proc.clone(),
11495 selection: crate::querybuilder::query()
11496 .select("node")
11497 .arg("id", &id.0)
11498 .inline_fragment("Module"),
11499 graphql_client: self.graphql_client.clone(),
11500 })
11501 .collect())
11502 }
11503 pub async fn description(&self) -> Result<String, DaggerError> {
11505 let query = self.selection.select("description");
11506 query.execute(self.graphql_client.clone()).await
11507 }
11508 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11510 let query = self.selection.select("enums");
11511 let query = query.select("id");
11512 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11513 Ok(ids
11514 .into_iter()
11515 .map(|id| TypeDef {
11516 proc: self.proc.clone(),
11517 selection: crate::querybuilder::query()
11518 .select("node")
11519 .arg("id", &id.0)
11520 .inline_fragment("TypeDef"),
11521 graphql_client: self.graphql_client.clone(),
11522 })
11523 .collect())
11524 }
11525 pub fn generated_context_directory(&self) -> Directory {
11527 let query = self.selection.select("generatedContextDirectory");
11528 Directory {
11529 proc: self.proc.clone(),
11530 selection: query,
11531 graphql_client: self.graphql_client.clone(),
11532 }
11533 }
11534 pub fn generator(&self, name: impl Into<String>) -> Generator {
11540 let mut query = self.selection.select("generator");
11541 query = query.arg("name", name.into());
11542 Generator {
11543 proc: self.proc.clone(),
11544 selection: query,
11545 graphql_client: self.graphql_client.clone(),
11546 }
11547 }
11548 pub fn generators(&self) -> GeneratorGroup {
11554 let query = self.selection.select("generators");
11555 GeneratorGroup {
11556 proc: self.proc.clone(),
11557 selection: query,
11558 graphql_client: self.graphql_client.clone(),
11559 }
11560 }
11561 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11567 let mut query = self.selection.select("generators");
11568 if let Some(include) = opts.include {
11569 query = query.arg("include", include);
11570 }
11571 GeneratorGroup {
11572 proc: self.proc.clone(),
11573 selection: query,
11574 graphql_client: self.graphql_client.clone(),
11575 }
11576 }
11577 pub async fn id(&self) -> Result<Id, DaggerError> {
11579 let query = self.selection.select("id");
11580 query.execute(self.graphql_client.clone()).await
11581 }
11582 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11584 let query = self.selection.select("interfaces");
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 introspection_schema_json(&self) -> File {
11603 let query = self.selection.select("introspectionSchemaJSON");
11604 File {
11605 proc: self.proc.clone(),
11606 selection: query,
11607 graphql_client: self.graphql_client.clone(),
11608 }
11609 }
11610 pub async fn name(&self) -> Result<String, DaggerError> {
11612 let query = self.selection.select("name");
11613 query.execute(self.graphql_client.clone()).await
11614 }
11615 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11617 let query = self.selection.select("objects");
11618 let query = query.select("id");
11619 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11620 Ok(ids
11621 .into_iter()
11622 .map(|id| TypeDef {
11623 proc: self.proc.clone(),
11624 selection: crate::querybuilder::query()
11625 .select("node")
11626 .arg("id", &id.0)
11627 .inline_fragment("TypeDef"),
11628 graphql_client: self.graphql_client.clone(),
11629 })
11630 .collect())
11631 }
11632 pub fn runtime(&self) -> Container {
11634 let query = self.selection.select("runtime");
11635 Container {
11636 proc: self.proc.clone(),
11637 selection: query,
11638 graphql_client: self.graphql_client.clone(),
11639 }
11640 }
11641 pub fn sdk(&self) -> SdkConfig {
11643 let query = self.selection.select("sdk");
11644 SdkConfig {
11645 proc: self.proc.clone(),
11646 selection: query,
11647 graphql_client: self.graphql_client.clone(),
11648 }
11649 }
11650 pub async fn serve(&self) -> Result<Void, DaggerError> {
11657 let query = self.selection.select("serve");
11658 query.execute(self.graphql_client.clone()).await
11659 }
11660 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11667 let mut query = self.selection.select("serve");
11668 if let Some(include_dependencies) = opts.include_dependencies {
11669 query = query.arg("includeDependencies", include_dependencies);
11670 }
11671 if let Some(entrypoint) = opts.entrypoint {
11672 query = query.arg("entrypoint", entrypoint);
11673 }
11674 query.execute(self.graphql_client.clone()).await
11675 }
11676 pub fn services(&self) -> UpGroup {
11682 let query = self.selection.select("services");
11683 UpGroup {
11684 proc: self.proc.clone(),
11685 selection: query,
11686 graphql_client: self.graphql_client.clone(),
11687 }
11688 }
11689 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11695 let mut query = self.selection.select("services");
11696 if let Some(include) = opts.include {
11697 query = query.arg("include", include);
11698 }
11699 UpGroup {
11700 proc: self.proc.clone(),
11701 selection: query,
11702 graphql_client: self.graphql_client.clone(),
11703 }
11704 }
11705 pub fn source(&self) -> ModuleSource {
11707 let query = self.selection.select("source");
11708 ModuleSource {
11709 proc: self.proc.clone(),
11710 selection: query,
11711 graphql_client: self.graphql_client.clone(),
11712 }
11713 }
11714 pub async fn sync(&self) -> Result<Module, DaggerError> {
11716 let query = self.selection.select("sync");
11717 let id: Id = query.execute(self.graphql_client.clone()).await?;
11718 Ok(Module {
11719 proc: self.proc.clone(),
11720 selection: query
11721 .root()
11722 .select("node")
11723 .arg("id", &id.0)
11724 .inline_fragment("Module"),
11725 graphql_client: self.graphql_client.clone(),
11726 })
11727 }
11728 pub fn user_defaults(&self) -> EnvFile {
11730 let query = self.selection.select("userDefaults");
11731 EnvFile {
11732 proc: self.proc.clone(),
11733 selection: query,
11734 graphql_client: self.graphql_client.clone(),
11735 }
11736 }
11737 pub fn with_description(&self, description: impl Into<String>) -> Module {
11743 let mut query = self.selection.select("withDescription");
11744 query = query.arg("description", description.into());
11745 Module {
11746 proc: self.proc.clone(),
11747 selection: query,
11748 graphql_client: self.graphql_client.clone(),
11749 }
11750 }
11751 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11753 let mut query = self.selection.select("withEnum");
11754 query = query.arg_lazy(
11755 "enum",
11756 Box::new(move || {
11757 let r#enum = r#enum.clone();
11758 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11759 }),
11760 );
11761 Module {
11762 proc: self.proc.clone(),
11763 selection: query,
11764 graphql_client: self.graphql_client.clone(),
11765 }
11766 }
11767 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11769 let mut query = self.selection.select("withInterface");
11770 query = query.arg_lazy(
11771 "iface",
11772 Box::new(move || {
11773 let iface = iface.clone();
11774 Box::pin(async move { iface.into_id().await.unwrap().quote() })
11775 }),
11776 );
11777 Module {
11778 proc: self.proc.clone(),
11779 selection: query,
11780 graphql_client: self.graphql_client.clone(),
11781 }
11782 }
11783 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11785 let mut query = self.selection.select("withObject");
11786 query = query.arg_lazy(
11787 "object",
11788 Box::new(move || {
11789 let object = object.clone();
11790 Box::pin(async move { object.into_id().await.unwrap().quote() })
11791 }),
11792 );
11793 Module {
11794 proc: self.proc.clone(),
11795 selection: query,
11796 graphql_client: self.graphql_client.clone(),
11797 }
11798 }
11799}
11800impl Node for Module {
11801 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11802 let query = self.selection.select("id");
11803 let graphql_client = self.graphql_client.clone();
11804 async move { query.execute(graphql_client).await }
11805 }
11806}
11807impl Syncer for Module {
11808 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11809 let query = self.selection.select("id");
11810 let graphql_client = self.graphql_client.clone();
11811 async move { query.execute(graphql_client).await }
11812 }
11813 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11814 let query = self.selection.select("sync");
11815 let graphql_client = self.graphql_client.clone();
11816 async move { query.execute(graphql_client).await }
11817 }
11818}
11819#[derive(Clone)]
11820pub struct ModuleConfigClient {
11821 pub proc: Option<Arc<DaggerSessionProc>>,
11822 pub selection: Selection,
11823 pub graphql_client: DynGraphQLClient,
11824}
11825impl IntoID<Id> for ModuleConfigClient {
11826 fn into_id(
11827 self,
11828 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11829 Box::pin(async move { self.id().await })
11830 }
11831}
11832impl Loadable for ModuleConfigClient {
11833 fn graphql_type() -> &'static str {
11834 "ModuleConfigClient"
11835 }
11836 fn from_query(
11837 proc: Option<Arc<DaggerSessionProc>>,
11838 selection: Selection,
11839 graphql_client: DynGraphQLClient,
11840 ) -> Self {
11841 Self {
11842 proc,
11843 selection,
11844 graphql_client,
11845 }
11846 }
11847}
11848impl ModuleConfigClient {
11849 pub async fn directory(&self) -> Result<String, DaggerError> {
11851 let query = self.selection.select("directory");
11852 query.execute(self.graphql_client.clone()).await
11853 }
11854 pub async fn generator(&self) -> Result<String, DaggerError> {
11856 let query = self.selection.select("generator");
11857 query.execute(self.graphql_client.clone()).await
11858 }
11859 pub async fn id(&self) -> Result<Id, DaggerError> {
11861 let query = self.selection.select("id");
11862 query.execute(self.graphql_client.clone()).await
11863 }
11864}
11865impl Node for ModuleConfigClient {
11866 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11867 let query = self.selection.select("id");
11868 let graphql_client = self.graphql_client.clone();
11869 async move { query.execute(graphql_client).await }
11870 }
11871}
11872#[derive(Clone)]
11873pub struct ModuleSource {
11874 pub proc: Option<Arc<DaggerSessionProc>>,
11875 pub selection: Selection,
11876 pub graphql_client: DynGraphQLClient,
11877}
11878impl IntoID<Id> for ModuleSource {
11879 fn into_id(
11880 self,
11881 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11882 Box::pin(async move { self.id().await })
11883 }
11884}
11885impl Loadable for ModuleSource {
11886 fn graphql_type() -> &'static str {
11887 "ModuleSource"
11888 }
11889 fn from_query(
11890 proc: Option<Arc<DaggerSessionProc>>,
11891 selection: Selection,
11892 graphql_client: DynGraphQLClient,
11893 ) -> Self {
11894 Self {
11895 proc,
11896 selection,
11897 graphql_client,
11898 }
11899 }
11900}
11901impl ModuleSource {
11902 pub fn as_module(&self) -> Module {
11904 let query = self.selection.select("asModule");
11905 Module {
11906 proc: self.proc.clone(),
11907 selection: query,
11908 graphql_client: self.graphql_client.clone(),
11909 }
11910 }
11911 pub async fn as_string(&self) -> Result<String, DaggerError> {
11913 let query = self.selection.select("asString");
11914 query.execute(self.graphql_client.clone()).await
11915 }
11916 pub fn blueprint(&self) -> ModuleSource {
11918 let query = self.selection.select("blueprint");
11919 ModuleSource {
11920 proc: self.proc.clone(),
11921 selection: query,
11922 graphql_client: self.graphql_client.clone(),
11923 }
11924 }
11925 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11927 let query = self.selection.select("cloneRef");
11928 query.execute(self.graphql_client.clone()).await
11929 }
11930 pub async fn commit(&self) -> Result<String, DaggerError> {
11932 let query = self.selection.select("commit");
11933 query.execute(self.graphql_client.clone()).await
11934 }
11935 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11937 let query = self.selection.select("configClients");
11938 let query = query.select("id");
11939 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11940 Ok(ids
11941 .into_iter()
11942 .map(|id| ModuleConfigClient {
11943 proc: self.proc.clone(),
11944 selection: crate::querybuilder::query()
11945 .select("node")
11946 .arg("id", &id.0)
11947 .inline_fragment("ModuleConfigClient"),
11948 graphql_client: self.graphql_client.clone(),
11949 })
11950 .collect())
11951 }
11952 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11954 let query = self.selection.select("configExists");
11955 query.execute(self.graphql_client.clone()).await
11956 }
11957 pub fn context_directory(&self) -> Directory {
11959 let query = self.selection.select("contextDirectory");
11960 Directory {
11961 proc: self.proc.clone(),
11962 selection: query,
11963 graphql_client: self.graphql_client.clone(),
11964 }
11965 }
11966 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
11968 let query = self.selection.select("dependencies");
11969 let query = query.select("id");
11970 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11971 Ok(ids
11972 .into_iter()
11973 .map(|id| ModuleSource {
11974 proc: self.proc.clone(),
11975 selection: crate::querybuilder::query()
11976 .select("node")
11977 .arg("id", &id.0)
11978 .inline_fragment("ModuleSource"),
11979 graphql_client: self.graphql_client.clone(),
11980 })
11981 .collect())
11982 }
11983 pub async fn digest(&self) -> Result<String, DaggerError> {
11985 let query = self.selection.select("digest");
11986 query.execute(self.graphql_client.clone()).await
11987 }
11988 pub fn directory(&self, path: impl Into<String>) -> Directory {
11994 let mut query = self.selection.select("directory");
11995 query = query.arg("path", path.into());
11996 Directory {
11997 proc: self.proc.clone(),
11998 selection: query,
11999 graphql_client: self.graphql_client.clone(),
12000 }
12001 }
12002 pub async fn engine_version(&self) -> Result<String, DaggerError> {
12004 let query = self.selection.select("engineVersion");
12005 query.execute(self.graphql_client.clone()).await
12006 }
12007 pub fn generated_context_changeset(&self) -> Changeset {
12009 let query = self.selection.select("generatedContextChangeset");
12010 Changeset {
12011 proc: self.proc.clone(),
12012 selection: query,
12013 graphql_client: self.graphql_client.clone(),
12014 }
12015 }
12016 pub fn generated_context_directory(&self) -> Directory {
12018 let query = self.selection.select("generatedContextDirectory");
12019 Directory {
12020 proc: self.proc.clone(),
12021 selection: query,
12022 graphql_client: self.graphql_client.clone(),
12023 }
12024 }
12025 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12027 let query = self.selection.select("htmlRepoURL");
12028 query.execute(self.graphql_client.clone()).await
12029 }
12030 pub async fn html_url(&self) -> Result<String, DaggerError> {
12032 let query = self.selection.select("htmlURL");
12033 query.execute(self.graphql_client.clone()).await
12034 }
12035 pub async fn id(&self) -> Result<Id, DaggerError> {
12037 let query = self.selection.select("id");
12038 query.execute(self.graphql_client.clone()).await
12039 }
12040 pub fn introspection_schema_json(&self) -> File {
12044 let query = self.selection.select("introspectionSchemaJSON");
12045 File {
12046 proc: self.proc.clone(),
12047 selection: query,
12048 graphql_client: self.graphql_client.clone(),
12049 }
12050 }
12051 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12053 let query = self.selection.select("kind");
12054 query.execute(self.graphql_client.clone()).await
12055 }
12056 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12058 let query = self.selection.select("localContextDirectoryPath");
12059 query.execute(self.graphql_client.clone()).await
12060 }
12061 pub async fn module_name(&self) -> Result<String, DaggerError> {
12063 let query = self.selection.select("moduleName");
12064 query.execute(self.graphql_client.clone()).await
12065 }
12066 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12068 let query = self.selection.select("moduleOriginalName");
12069 query.execute(self.graphql_client.clone()).await
12070 }
12071 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12073 let query = self.selection.select("originalSubpath");
12074 query.execute(self.graphql_client.clone()).await
12075 }
12076 pub async fn pin(&self) -> Result<String, DaggerError> {
12078 let query = self.selection.select("pin");
12079 query.execute(self.graphql_client.clone()).await
12080 }
12081 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12083 let query = self.selection.select("repoRootPath");
12084 query.execute(self.graphql_client.clone()).await
12085 }
12086 pub fn sdk(&self) -> SdkConfig {
12088 let query = self.selection.select("sdk");
12089 SdkConfig {
12090 proc: self.proc.clone(),
12091 selection: query,
12092 graphql_client: self.graphql_client.clone(),
12093 }
12094 }
12095 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12097 let query = self.selection.select("sourceRootSubpath");
12098 query.execute(self.graphql_client.clone()).await
12099 }
12100 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12102 let query = self.selection.select("sourceSubpath");
12103 query.execute(self.graphql_client.clone()).await
12104 }
12105 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12107 let query = self.selection.select("sync");
12108 let id: Id = query.execute(self.graphql_client.clone()).await?;
12109 Ok(ModuleSource {
12110 proc: self.proc.clone(),
12111 selection: query
12112 .root()
12113 .select("node")
12114 .arg("id", &id.0)
12115 .inline_fragment("ModuleSource"),
12116 graphql_client: self.graphql_client.clone(),
12117 })
12118 }
12119 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12121 let query = self.selection.select("toolchains");
12122 let query = query.select("id");
12123 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12124 Ok(ids
12125 .into_iter()
12126 .map(|id| ModuleSource {
12127 proc: self.proc.clone(),
12128 selection: crate::querybuilder::query()
12129 .select("node")
12130 .arg("id", &id.0)
12131 .inline_fragment("ModuleSource"),
12132 graphql_client: self.graphql_client.clone(),
12133 })
12134 .collect())
12135 }
12136 pub fn user_defaults(&self) -> EnvFile {
12138 let query = self.selection.select("userDefaults");
12139 EnvFile {
12140 proc: self.proc.clone(),
12141 selection: query,
12142 graphql_client: self.graphql_client.clone(),
12143 }
12144 }
12145 pub async fn version(&self) -> Result<String, DaggerError> {
12147 let query = self.selection.select("version");
12148 query.execute(self.graphql_client.clone()).await
12149 }
12150 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12156 let mut query = self.selection.select("withBlueprint");
12157 query = query.arg_lazy(
12158 "blueprint",
12159 Box::new(move || {
12160 let blueprint = blueprint.clone();
12161 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12162 }),
12163 );
12164 ModuleSource {
12165 proc: self.proc.clone(),
12166 selection: query,
12167 graphql_client: self.graphql_client.clone(),
12168 }
12169 }
12170 pub fn with_client(
12177 &self,
12178 generator: impl Into<String>,
12179 output_dir: impl Into<String>,
12180 ) -> ModuleSource {
12181 let mut query = self.selection.select("withClient");
12182 query = query.arg("generator", generator.into());
12183 query = query.arg("outputDir", output_dir.into());
12184 ModuleSource {
12185 proc: self.proc.clone(),
12186 selection: query,
12187 graphql_client: self.graphql_client.clone(),
12188 }
12189 }
12190 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12196 let mut query = self.selection.select("withDependencies");
12197 query = query.arg("dependencies", dependencies);
12198 ModuleSource {
12199 proc: self.proc.clone(),
12200 selection: query,
12201 graphql_client: self.graphql_client.clone(),
12202 }
12203 }
12204 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12210 let mut query = self.selection.select("withEngineVersion");
12211 query = query.arg("version", version.into());
12212 ModuleSource {
12213 proc: self.proc.clone(),
12214 selection: query,
12215 graphql_client: self.graphql_client.clone(),
12216 }
12217 }
12218 pub fn with_experimental_features(
12224 &self,
12225 features: Vec<ModuleSourceExperimentalFeature>,
12226 ) -> ModuleSource {
12227 let mut query = self.selection.select("withExperimentalFeatures");
12228 query = query.arg("features", features);
12229 ModuleSource {
12230 proc: self.proc.clone(),
12231 selection: query,
12232 graphql_client: self.graphql_client.clone(),
12233 }
12234 }
12235 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12241 let mut query = self.selection.select("withIncludes");
12242 query = query.arg(
12243 "patterns",
12244 patterns
12245 .into_iter()
12246 .map(|i| i.into())
12247 .collect::<Vec<String>>(),
12248 );
12249 ModuleSource {
12250 proc: self.proc.clone(),
12251 selection: query,
12252 graphql_client: self.graphql_client.clone(),
12253 }
12254 }
12255 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12261 let mut query = self.selection.select("withName");
12262 query = query.arg("name", name.into());
12263 ModuleSource {
12264 proc: self.proc.clone(),
12265 selection: query,
12266 graphql_client: self.graphql_client.clone(),
12267 }
12268 }
12269 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12275 let mut query = self.selection.select("withSDK");
12276 query = query.arg("source", source.into());
12277 ModuleSource {
12278 proc: self.proc.clone(),
12279 selection: query,
12280 graphql_client: self.graphql_client.clone(),
12281 }
12282 }
12283 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12289 let mut query = self.selection.select("withSourceSubpath");
12290 query = query.arg("path", path.into());
12291 ModuleSource {
12292 proc: self.proc.clone(),
12293 selection: query,
12294 graphql_client: self.graphql_client.clone(),
12295 }
12296 }
12297 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12303 let mut query = self.selection.select("withToolchains");
12304 query = query.arg("toolchains", toolchains);
12305 ModuleSource {
12306 proc: self.proc.clone(),
12307 selection: query,
12308 graphql_client: self.graphql_client.clone(),
12309 }
12310 }
12311 pub fn with_update_blueprint(&self) -> ModuleSource {
12313 let query = self.selection.select("withUpdateBlueprint");
12314 ModuleSource {
12315 proc: self.proc.clone(),
12316 selection: query,
12317 graphql_client: self.graphql_client.clone(),
12318 }
12319 }
12320 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12326 let mut query = self.selection.select("withUpdateDependencies");
12327 query = query.arg(
12328 "dependencies",
12329 dependencies
12330 .into_iter()
12331 .map(|i| i.into())
12332 .collect::<Vec<String>>(),
12333 );
12334 ModuleSource {
12335 proc: self.proc.clone(),
12336 selection: query,
12337 graphql_client: self.graphql_client.clone(),
12338 }
12339 }
12340 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12346 let mut query = self.selection.select("withUpdateToolchains");
12347 query = query.arg(
12348 "toolchains",
12349 toolchains
12350 .into_iter()
12351 .map(|i| i.into())
12352 .collect::<Vec<String>>(),
12353 );
12354 ModuleSource {
12355 proc: self.proc.clone(),
12356 selection: query,
12357 graphql_client: self.graphql_client.clone(),
12358 }
12359 }
12360 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12366 let mut query = self.selection.select("withUpdatedClients");
12367 query = query.arg(
12368 "clients",
12369 clients
12370 .into_iter()
12371 .map(|i| i.into())
12372 .collect::<Vec<String>>(),
12373 );
12374 ModuleSource {
12375 proc: self.proc.clone(),
12376 selection: query,
12377 graphql_client: self.graphql_client.clone(),
12378 }
12379 }
12380 pub fn without_blueprint(&self) -> ModuleSource {
12382 let query = self.selection.select("withoutBlueprint");
12383 ModuleSource {
12384 proc: self.proc.clone(),
12385 selection: query,
12386 graphql_client: self.graphql_client.clone(),
12387 }
12388 }
12389 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12395 let mut query = self.selection.select("withoutClient");
12396 query = query.arg("path", path.into());
12397 ModuleSource {
12398 proc: self.proc.clone(),
12399 selection: query,
12400 graphql_client: self.graphql_client.clone(),
12401 }
12402 }
12403 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12409 let mut query = self.selection.select("withoutDependencies");
12410 query = query.arg(
12411 "dependencies",
12412 dependencies
12413 .into_iter()
12414 .map(|i| i.into())
12415 .collect::<Vec<String>>(),
12416 );
12417 ModuleSource {
12418 proc: self.proc.clone(),
12419 selection: query,
12420 graphql_client: self.graphql_client.clone(),
12421 }
12422 }
12423 pub fn without_experimental_features(
12429 &self,
12430 features: Vec<ModuleSourceExperimentalFeature>,
12431 ) -> ModuleSource {
12432 let mut query = self.selection.select("withoutExperimentalFeatures");
12433 query = query.arg("features", features);
12434 ModuleSource {
12435 proc: self.proc.clone(),
12436 selection: query,
12437 graphql_client: self.graphql_client.clone(),
12438 }
12439 }
12440 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12446 let mut query = self.selection.select("withoutToolchains");
12447 query = query.arg(
12448 "toolchains",
12449 toolchains
12450 .into_iter()
12451 .map(|i| i.into())
12452 .collect::<Vec<String>>(),
12453 );
12454 ModuleSource {
12455 proc: self.proc.clone(),
12456 selection: query,
12457 graphql_client: self.graphql_client.clone(),
12458 }
12459 }
12460}
12461impl Node for ModuleSource {
12462 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12463 let query = self.selection.select("id");
12464 let graphql_client = self.graphql_client.clone();
12465 async move { query.execute(graphql_client).await }
12466 }
12467}
12468impl Syncer for ModuleSource {
12469 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12470 let query = self.selection.select("id");
12471 let graphql_client = self.graphql_client.clone();
12472 async move { query.execute(graphql_client).await }
12473 }
12474 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12475 let query = self.selection.select("sync");
12476 let graphql_client = self.graphql_client.clone();
12477 async move { query.execute(graphql_client).await }
12478 }
12479}
12480#[derive(Clone)]
12481pub struct ObjectTypeDef {
12482 pub proc: Option<Arc<DaggerSessionProc>>,
12483 pub selection: Selection,
12484 pub graphql_client: DynGraphQLClient,
12485}
12486impl IntoID<Id> for ObjectTypeDef {
12487 fn into_id(
12488 self,
12489 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12490 Box::pin(async move { self.id().await })
12491 }
12492}
12493impl Loadable for ObjectTypeDef {
12494 fn graphql_type() -> &'static str {
12495 "ObjectTypeDef"
12496 }
12497 fn from_query(
12498 proc: Option<Arc<DaggerSessionProc>>,
12499 selection: Selection,
12500 graphql_client: DynGraphQLClient,
12501 ) -> Self {
12502 Self {
12503 proc,
12504 selection,
12505 graphql_client,
12506 }
12507 }
12508}
12509impl ObjectTypeDef {
12510 pub fn constructor(&self) -> Function {
12512 let query = self.selection.select("constructor");
12513 Function {
12514 proc: self.proc.clone(),
12515 selection: query,
12516 graphql_client: self.graphql_client.clone(),
12517 }
12518 }
12519 pub async fn deprecated(&self) -> Result<String, DaggerError> {
12521 let query = self.selection.select("deprecated");
12522 query.execute(self.graphql_client.clone()).await
12523 }
12524 pub async fn description(&self) -> Result<String, DaggerError> {
12526 let query = self.selection.select("description");
12527 query.execute(self.graphql_client.clone()).await
12528 }
12529 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12531 let query = self.selection.select("fields");
12532 let query = query.select("id");
12533 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12534 Ok(ids
12535 .into_iter()
12536 .map(|id| FieldTypeDef {
12537 proc: self.proc.clone(),
12538 selection: crate::querybuilder::query()
12539 .select("node")
12540 .arg("id", &id.0)
12541 .inline_fragment("FieldTypeDef"),
12542 graphql_client: self.graphql_client.clone(),
12543 })
12544 .collect())
12545 }
12546 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12548 let query = self.selection.select("functions");
12549 let query = query.select("id");
12550 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12551 Ok(ids
12552 .into_iter()
12553 .map(|id| Function {
12554 proc: self.proc.clone(),
12555 selection: crate::querybuilder::query()
12556 .select("node")
12557 .arg("id", &id.0)
12558 .inline_fragment("Function"),
12559 graphql_client: self.graphql_client.clone(),
12560 })
12561 .collect())
12562 }
12563 pub async fn id(&self) -> Result<Id, DaggerError> {
12565 let query = self.selection.select("id");
12566 query.execute(self.graphql_client.clone()).await
12567 }
12568 pub async fn name(&self) -> Result<String, DaggerError> {
12570 let query = self.selection.select("name");
12571 query.execute(self.graphql_client.clone()).await
12572 }
12573 pub fn source_map(&self) -> SourceMap {
12575 let query = self.selection.select("sourceMap");
12576 SourceMap {
12577 proc: self.proc.clone(),
12578 selection: query,
12579 graphql_client: self.graphql_client.clone(),
12580 }
12581 }
12582 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12584 let query = self.selection.select("sourceModuleName");
12585 query.execute(self.graphql_client.clone()).await
12586 }
12587}
12588impl Node for ObjectTypeDef {
12589 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12590 let query = self.selection.select("id");
12591 let graphql_client = self.graphql_client.clone();
12592 async move { query.execute(graphql_client).await }
12593 }
12594}
12595#[derive(Clone)]
12596pub struct Port {
12597 pub proc: Option<Arc<DaggerSessionProc>>,
12598 pub selection: Selection,
12599 pub graphql_client: DynGraphQLClient,
12600}
12601impl IntoID<Id> for Port {
12602 fn into_id(
12603 self,
12604 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12605 Box::pin(async move { self.id().await })
12606 }
12607}
12608impl Loadable for Port {
12609 fn graphql_type() -> &'static str {
12610 "Port"
12611 }
12612 fn from_query(
12613 proc: Option<Arc<DaggerSessionProc>>,
12614 selection: Selection,
12615 graphql_client: DynGraphQLClient,
12616 ) -> Self {
12617 Self {
12618 proc,
12619 selection,
12620 graphql_client,
12621 }
12622 }
12623}
12624impl Port {
12625 pub async fn description(&self) -> Result<String, DaggerError> {
12627 let query = self.selection.select("description");
12628 query.execute(self.graphql_client.clone()).await
12629 }
12630 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12632 let query = self.selection.select("experimentalSkipHealthcheck");
12633 query.execute(self.graphql_client.clone()).await
12634 }
12635 pub async fn id(&self) -> Result<Id, DaggerError> {
12637 let query = self.selection.select("id");
12638 query.execute(self.graphql_client.clone()).await
12639 }
12640 pub async fn port(&self) -> Result<isize, DaggerError> {
12642 let query = self.selection.select("port");
12643 query.execute(self.graphql_client.clone()).await
12644 }
12645 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12647 let query = self.selection.select("protocol");
12648 query.execute(self.graphql_client.clone()).await
12649 }
12650}
12651impl Node for Port {
12652 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12653 let query = self.selection.select("id");
12654 let graphql_client = self.graphql_client.clone();
12655 async move { query.execute(graphql_client).await }
12656 }
12657}
12658#[derive(Clone)]
12659pub struct Query {
12660 pub proc: Option<Arc<DaggerSessionProc>>,
12661 pub selection: Selection,
12662 pub graphql_client: DynGraphQLClient,
12663}
12664#[derive(Builder, Debug, PartialEq)]
12665pub struct QueryCacheVolumeOpts<'a> {
12666 #[builder(setter(into, strip_option), default)]
12670 pub owner: Option<&'a str>,
12671 #[builder(setter(into, strip_option), default)]
12673 pub sharing: Option<CacheSharingMode>,
12674 #[builder(setter(into, strip_option), default)]
12676 pub source: Option<Id>,
12677}
12678#[derive(Builder, Debug, PartialEq)]
12679pub struct QueryContainerOpts {
12680 #[builder(setter(into, strip_option), default)]
12682 pub platform: Option<Platform>,
12683}
12684#[derive(Builder, Debug, PartialEq)]
12685pub struct QueryCurrentTypeDefsOpts {
12686 #[builder(setter(into, strip_option), default)]
12689 pub hide_core: Option<bool>,
12690 #[builder(setter(into, strip_option), default)]
12692 pub return_all_types: Option<bool>,
12693}
12694#[derive(Builder, Debug, PartialEq)]
12695pub struct QueryEnvOpts {
12696 #[builder(setter(into, strip_option), default)]
12698 pub privileged: Option<bool>,
12699 #[builder(setter(into, strip_option), default)]
12701 pub writable: Option<bool>,
12702}
12703#[derive(Builder, Debug, PartialEq)]
12704pub struct QueryEnvFileOpts {
12705 #[builder(setter(into, strip_option), default)]
12707 pub expand: Option<bool>,
12708}
12709#[derive(Builder, Debug, PartialEq)]
12710pub struct QueryFileOpts {
12711 #[builder(setter(into, strip_option), default)]
12713 pub permissions: Option<isize>,
12714}
12715#[derive(Builder, Debug, PartialEq)]
12716pub struct QueryGitOpts<'a> {
12717 #[builder(setter(into, strip_option), default)]
12719 pub experimental_service_host: Option<Id>,
12720 #[builder(setter(into, strip_option), default)]
12722 pub http_auth_header: Option<Id>,
12723 #[builder(setter(into, strip_option), default)]
12725 pub http_auth_token: Option<Id>,
12726 #[builder(setter(into, strip_option), default)]
12728 pub http_auth_username: Option<&'a str>,
12729 #[builder(setter(into, strip_option), default)]
12731 pub keep_git_dir: Option<bool>,
12732 #[builder(setter(into, strip_option), default)]
12734 pub ssh_auth_socket: Option<Id>,
12735 #[builder(setter(into, strip_option), default)]
12737 pub ssh_known_hosts: Option<&'a str>,
12738}
12739#[derive(Builder, Debug, PartialEq)]
12740pub struct QueryHttpOpts<'a> {
12741 #[builder(setter(into, strip_option), default)]
12743 pub auth_header: Option<Id>,
12744 #[builder(setter(into, strip_option), default)]
12746 pub checksum: Option<&'a str>,
12747 #[builder(setter(into, strip_option), default)]
12749 pub experimental_service_host: Option<Id>,
12750 #[builder(setter(into, strip_option), default)]
12752 pub name: Option<&'a str>,
12753 #[builder(setter(into, strip_option), default)]
12755 pub permissions: Option<isize>,
12756}
12757#[derive(Builder, Debug, PartialEq)]
12758pub struct QueryLlmOpts<'a> {
12759 #[builder(setter(into, strip_option), default)]
12761 pub max_api_calls: Option<isize>,
12762 #[builder(setter(into, strip_option), default)]
12764 pub model: Option<&'a str>,
12765}
12766#[derive(Builder, Debug, PartialEq)]
12767pub struct QueryModuleSourceOpts<'a> {
12768 #[builder(setter(into, strip_option), default)]
12770 pub allow_not_exists: Option<bool>,
12771 #[builder(setter(into, strip_option), default)]
12773 pub disable_find_up: Option<bool>,
12774 #[builder(setter(into, strip_option), default)]
12776 pub ref_pin: Option<&'a str>,
12777 #[builder(setter(into, strip_option), default)]
12779 pub require_kind: Option<ModuleSourceKind>,
12780}
12781#[derive(Builder, Debug, PartialEq)]
12782pub struct QuerySecretOpts<'a> {
12783 #[builder(setter(into, strip_option), default)]
12787 pub cache_key: Option<&'a str>,
12788}
12789impl IntoID<Id> for Query {
12790 fn into_id(
12791 self,
12792 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12793 Box::pin(async move { self.id().await })
12794 }
12795}
12796impl Loadable for Query {
12797 fn graphql_type() -> &'static str {
12798 "Query"
12799 }
12800 fn from_query(
12801 proc: Option<Arc<DaggerSessionProc>>,
12802 selection: Selection,
12803 graphql_client: DynGraphQLClient,
12804 ) -> Self {
12805 Self {
12806 proc,
12807 selection,
12808 graphql_client,
12809 }
12810 }
12811}
12812impl Query {
12813 pub fn address(&self, value: impl Into<String>) -> Address {
12815 let mut query = self.selection.select("address");
12816 query = query.arg("value", value.into());
12817 Address {
12818 proc: self.proc.clone(),
12819 selection: query,
12820 graphql_client: self.graphql_client.clone(),
12821 }
12822 }
12823 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12830 let mut query = self.selection.select("cacheVolume");
12831 query = query.arg("key", key.into());
12832 CacheVolume {
12833 proc: self.proc.clone(),
12834 selection: query,
12835 graphql_client: self.graphql_client.clone(),
12836 }
12837 }
12838 pub fn cache_volume_opts<'a>(
12845 &self,
12846 key: impl Into<String>,
12847 opts: QueryCacheVolumeOpts<'a>,
12848 ) -> CacheVolume {
12849 let mut query = self.selection.select("cacheVolume");
12850 query = query.arg("key", key.into());
12851 if let Some(source) = opts.source {
12852 query = query.arg("source", source);
12853 }
12854 if let Some(sharing) = opts.sharing {
12855 query = query.arg("sharing", sharing);
12856 }
12857 if let Some(owner) = opts.owner {
12858 query = query.arg("owner", owner);
12859 }
12860 CacheVolume {
12861 proc: self.proc.clone(),
12862 selection: query,
12863 graphql_client: self.graphql_client.clone(),
12864 }
12865 }
12866 pub fn changeset(&self) -> Changeset {
12868 let query = self.selection.select("changeset");
12869 Changeset {
12870 proc: self.proc.clone(),
12871 selection: query,
12872 graphql_client: self.graphql_client.clone(),
12873 }
12874 }
12875 pub fn cloud(&self) -> Cloud {
12877 let query = self.selection.select("cloud");
12878 Cloud {
12879 proc: self.proc.clone(),
12880 selection: query,
12881 graphql_client: self.graphql_client.clone(),
12882 }
12883 }
12884 pub fn container(&self) -> Container {
12891 let query = self.selection.select("container");
12892 Container {
12893 proc: self.proc.clone(),
12894 selection: query,
12895 graphql_client: self.graphql_client.clone(),
12896 }
12897 }
12898 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12905 let mut query = self.selection.select("container");
12906 if let Some(platform) = opts.platform {
12907 query = query.arg("platform", platform);
12908 }
12909 Container {
12910 proc: self.proc.clone(),
12911 selection: query,
12912 graphql_client: self.graphql_client.clone(),
12913 }
12914 }
12915 pub fn current_env(&self) -> Env {
12919 let query = self.selection.select("currentEnv");
12920 Env {
12921 proc: self.proc.clone(),
12922 selection: query,
12923 graphql_client: self.graphql_client.clone(),
12924 }
12925 }
12926 pub fn current_function_call(&self) -> FunctionCall {
12929 let query = self.selection.select("currentFunctionCall");
12930 FunctionCall {
12931 proc: self.proc.clone(),
12932 selection: query,
12933 graphql_client: self.graphql_client.clone(),
12934 }
12935 }
12936 pub fn current_module(&self) -> CurrentModule {
12938 let query = self.selection.select("currentModule");
12939 CurrentModule {
12940 proc: self.proc.clone(),
12941 selection: query,
12942 graphql_client: self.graphql_client.clone(),
12943 }
12944 }
12945 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12951 let query = self.selection.select("currentTypeDefs");
12952 let query = query.select("id");
12953 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12954 Ok(ids
12955 .into_iter()
12956 .map(|id| TypeDef {
12957 proc: self.proc.clone(),
12958 selection: crate::querybuilder::query()
12959 .select("node")
12960 .arg("id", &id.0)
12961 .inline_fragment("TypeDef"),
12962 graphql_client: self.graphql_client.clone(),
12963 })
12964 .collect())
12965 }
12966 pub async fn current_type_defs_opts(
12972 &self,
12973 opts: QueryCurrentTypeDefsOpts,
12974 ) -> Result<Vec<TypeDef>, DaggerError> {
12975 let mut query = self.selection.select("currentTypeDefs");
12976 if let Some(return_all_types) = opts.return_all_types {
12977 query = query.arg("returnAllTypes", return_all_types);
12978 }
12979 if let Some(hide_core) = opts.hide_core {
12980 query = query.arg("hideCore", hide_core);
12981 }
12982 let query = query.select("id");
12983 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12984 Ok(ids
12985 .into_iter()
12986 .map(|id| TypeDef {
12987 proc: self.proc.clone(),
12988 selection: crate::querybuilder::query()
12989 .select("node")
12990 .arg("id", &id.0)
12991 .inline_fragment("TypeDef"),
12992 graphql_client: self.graphql_client.clone(),
12993 })
12994 .collect())
12995 }
12996 pub fn current_workspace(&self) -> Workspace {
12998 let query = self.selection.select("currentWorkspace");
12999 Workspace {
13000 proc: self.proc.clone(),
13001 selection: query,
13002 graphql_client: self.graphql_client.clone(),
13003 }
13004 }
13005 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13007 let query = self.selection.select("defaultPlatform");
13008 query.execute(self.graphql_client.clone()).await
13009 }
13010 pub fn directory(&self) -> Directory {
13012 let query = self.selection.select("directory");
13013 Directory {
13014 proc: self.proc.clone(),
13015 selection: query,
13016 graphql_client: self.graphql_client.clone(),
13017 }
13018 }
13019 pub fn engine(&self) -> Engine {
13021 let query = self.selection.select("engine");
13022 Engine {
13023 proc: self.proc.clone(),
13024 selection: query,
13025 graphql_client: self.graphql_client.clone(),
13026 }
13027 }
13028 pub fn env(&self) -> Env {
13034 let query = self.selection.select("env");
13035 Env {
13036 proc: self.proc.clone(),
13037 selection: query,
13038 graphql_client: self.graphql_client.clone(),
13039 }
13040 }
13041 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13047 let mut query = self.selection.select("env");
13048 if let Some(privileged) = opts.privileged {
13049 query = query.arg("privileged", privileged);
13050 }
13051 if let Some(writable) = opts.writable {
13052 query = query.arg("writable", writable);
13053 }
13054 Env {
13055 proc: self.proc.clone(),
13056 selection: query,
13057 graphql_client: self.graphql_client.clone(),
13058 }
13059 }
13060 pub fn env_file(&self) -> EnvFile {
13066 let query = self.selection.select("envFile");
13067 EnvFile {
13068 proc: self.proc.clone(),
13069 selection: query,
13070 graphql_client: self.graphql_client.clone(),
13071 }
13072 }
13073 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13079 let mut query = self.selection.select("envFile");
13080 if let Some(expand) = opts.expand {
13081 query = query.arg("expand", expand);
13082 }
13083 EnvFile {
13084 proc: self.proc.clone(),
13085 selection: query,
13086 graphql_client: self.graphql_client.clone(),
13087 }
13088 }
13089 pub fn error(&self, message: impl Into<String>) -> Error {
13095 let mut query = self.selection.select("error");
13096 query = query.arg("message", message.into());
13097 Error {
13098 proc: self.proc.clone(),
13099 selection: query,
13100 graphql_client: self.graphql_client.clone(),
13101 }
13102 }
13103 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13111 let mut query = self.selection.select("file");
13112 query = query.arg("name", name.into());
13113 query = query.arg("contents", contents.into());
13114 File {
13115 proc: self.proc.clone(),
13116 selection: query,
13117 graphql_client: self.graphql_client.clone(),
13118 }
13119 }
13120 pub fn file_opts(
13128 &self,
13129 name: impl Into<String>,
13130 contents: impl Into<String>,
13131 opts: QueryFileOpts,
13132 ) -> File {
13133 let mut query = self.selection.select("file");
13134 query = query.arg("name", name.into());
13135 query = query.arg("contents", contents.into());
13136 if let Some(permissions) = opts.permissions {
13137 query = query.arg("permissions", permissions);
13138 }
13139 File {
13140 proc: self.proc.clone(),
13141 selection: query,
13142 graphql_client: self.graphql_client.clone(),
13143 }
13144 }
13145 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13152 let mut query = self.selection.select("function");
13153 query = query.arg("name", name.into());
13154 query = query.arg_lazy(
13155 "returnType",
13156 Box::new(move || {
13157 let return_type = return_type.clone();
13158 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13159 }),
13160 );
13161 Function {
13162 proc: self.proc.clone(),
13163 selection: query,
13164 graphql_client: self.graphql_client.clone(),
13165 }
13166 }
13167 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13169 let mut query = self.selection.select("generatedCode");
13170 query = query.arg_lazy(
13171 "code",
13172 Box::new(move || {
13173 let code = code.clone();
13174 Box::pin(async move { code.into_id().await.unwrap().quote() })
13175 }),
13176 );
13177 GeneratedCode {
13178 proc: self.proc.clone(),
13179 selection: query,
13180 graphql_client: self.graphql_client.clone(),
13181 }
13182 }
13183 pub fn git(&self, url: impl Into<String>) -> GitRepository {
13194 let mut query = self.selection.select("git");
13195 query = query.arg("url", url.into());
13196 GitRepository {
13197 proc: self.proc.clone(),
13198 selection: query,
13199 graphql_client: self.graphql_client.clone(),
13200 }
13201 }
13202 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13213 let mut query = self.selection.select("git");
13214 query = query.arg("url", url.into());
13215 if let Some(keep_git_dir) = opts.keep_git_dir {
13216 query = query.arg("keepGitDir", keep_git_dir);
13217 }
13218 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13219 query = query.arg("sshKnownHosts", ssh_known_hosts);
13220 }
13221 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13222 query = query.arg("sshAuthSocket", ssh_auth_socket);
13223 }
13224 if let Some(http_auth_username) = opts.http_auth_username {
13225 query = query.arg("httpAuthUsername", http_auth_username);
13226 }
13227 if let Some(http_auth_token) = opts.http_auth_token {
13228 query = query.arg("httpAuthToken", http_auth_token);
13229 }
13230 if let Some(http_auth_header) = opts.http_auth_header {
13231 query = query.arg("httpAuthHeader", http_auth_header);
13232 }
13233 if let Some(experimental_service_host) = opts.experimental_service_host {
13234 query = query.arg("experimentalServiceHost", experimental_service_host);
13235 }
13236 GitRepository {
13237 proc: self.proc.clone(),
13238 selection: query,
13239 graphql_client: self.graphql_client.clone(),
13240 }
13241 }
13242 pub fn host(&self) -> Host {
13244 let query = self.selection.select("host");
13245 Host {
13246 proc: self.proc.clone(),
13247 selection: query,
13248 graphql_client: self.graphql_client.clone(),
13249 }
13250 }
13251 pub fn http(&self, url: impl Into<String>) -> File {
13258 let mut query = self.selection.select("http");
13259 query = query.arg("url", url.into());
13260 File {
13261 proc: self.proc.clone(),
13262 selection: query,
13263 graphql_client: self.graphql_client.clone(),
13264 }
13265 }
13266 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13273 let mut query = self.selection.select("http");
13274 query = query.arg("url", url.into());
13275 if let Some(name) = opts.name {
13276 query = query.arg("name", name);
13277 }
13278 if let Some(permissions) = opts.permissions {
13279 query = query.arg("permissions", permissions);
13280 }
13281 if let Some(checksum) = opts.checksum {
13282 query = query.arg("checksum", checksum);
13283 }
13284 if let Some(auth_header) = opts.auth_header {
13285 query = query.arg("authHeader", auth_header);
13286 }
13287 if let Some(experimental_service_host) = opts.experimental_service_host {
13288 query = query.arg("experimentalServiceHost", experimental_service_host);
13289 }
13290 File {
13291 proc: self.proc.clone(),
13292 selection: query,
13293 graphql_client: self.graphql_client.clone(),
13294 }
13295 }
13296 pub async fn id(&self) -> Result<Id, DaggerError> {
13298 let query = self.selection.select("id");
13299 query.execute(self.graphql_client.clone()).await
13300 }
13301 pub fn json(&self) -> JsonValue {
13303 let query = self.selection.select("json");
13304 JsonValue {
13305 proc: self.proc.clone(),
13306 selection: query,
13307 graphql_client: self.graphql_client.clone(),
13308 }
13309 }
13310 pub fn llm(&self) -> Llm {
13316 let query = self.selection.select("llm");
13317 Llm {
13318 proc: self.proc.clone(),
13319 selection: query,
13320 graphql_client: self.graphql_client.clone(),
13321 }
13322 }
13323 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13329 let mut query = self.selection.select("llm");
13330 if let Some(model) = opts.model {
13331 query = query.arg("model", model);
13332 }
13333 if let Some(max_api_calls) = opts.max_api_calls {
13334 query = query.arg("maxAPICalls", max_api_calls);
13335 }
13336 Llm {
13337 proc: self.proc.clone(),
13338 selection: query,
13339 graphql_client: self.graphql_client.clone(),
13340 }
13341 }
13342 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13344 let mut query = self.selection.select("loadAddressFromID");
13345 query = query.arg_lazy(
13346 "id",
13347 Box::new(move || {
13348 let id = id.clone();
13349 Box::pin(async move { id.into_id().await.unwrap().quote() })
13350 }),
13351 );
13352 Address {
13353 proc: self.proc.clone(),
13354 selection: query,
13355 graphql_client: self.graphql_client.clone(),
13356 }
13357 }
13358 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13360 let mut query = self.selection.select("loadBindingFromID");
13361 query = query.arg_lazy(
13362 "id",
13363 Box::new(move || {
13364 let id = id.clone();
13365 Box::pin(async move { id.into_id().await.unwrap().quote() })
13366 }),
13367 );
13368 Binding {
13369 proc: self.proc.clone(),
13370 selection: query,
13371 graphql_client: self.graphql_client.clone(),
13372 }
13373 }
13374 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13376 let mut query = self.selection.select("loadCacheVolumeFromID");
13377 query = query.arg_lazy(
13378 "id",
13379 Box::new(move || {
13380 let id = id.clone();
13381 Box::pin(async move { id.into_id().await.unwrap().quote() })
13382 }),
13383 );
13384 CacheVolume {
13385 proc: self.proc.clone(),
13386 selection: query,
13387 graphql_client: self.graphql_client.clone(),
13388 }
13389 }
13390 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13392 let mut query = self.selection.select("loadChangesetFromID");
13393 query = query.arg_lazy(
13394 "id",
13395 Box::new(move || {
13396 let id = id.clone();
13397 Box::pin(async move { id.into_id().await.unwrap().quote() })
13398 }),
13399 );
13400 Changeset {
13401 proc: self.proc.clone(),
13402 selection: query,
13403 graphql_client: self.graphql_client.clone(),
13404 }
13405 }
13406 pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13408 let mut query = self.selection.select("loadCheckFromID");
13409 query = query.arg_lazy(
13410 "id",
13411 Box::new(move || {
13412 let id = id.clone();
13413 Box::pin(async move { id.into_id().await.unwrap().quote() })
13414 }),
13415 );
13416 Check {
13417 proc: self.proc.clone(),
13418 selection: query,
13419 graphql_client: self.graphql_client.clone(),
13420 }
13421 }
13422 pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13424 let mut query = self.selection.select("loadCheckGroupFromID");
13425 query = query.arg_lazy(
13426 "id",
13427 Box::new(move || {
13428 let id = id.clone();
13429 Box::pin(async move { id.into_id().await.unwrap().quote() })
13430 }),
13431 );
13432 CheckGroup {
13433 proc: self.proc.clone(),
13434 selection: query,
13435 graphql_client: self.graphql_client.clone(),
13436 }
13437 }
13438 pub fn load_client_filesync_mirror_from_id(
13440 &self,
13441 id: impl IntoID<ClientFilesyncMirrorId>,
13442 ) -> ClientFilesyncMirror {
13443 let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13444 query = query.arg_lazy(
13445 "id",
13446 Box::new(move || {
13447 let id = id.clone();
13448 Box::pin(async move { id.into_id().await.unwrap().quote() })
13449 }),
13450 );
13451 ClientFilesyncMirror {
13452 proc: self.proc.clone(),
13453 selection: query,
13454 graphql_client: self.graphql_client.clone(),
13455 }
13456 }
13457 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13459 let mut query = self.selection.select("loadCloudFromID");
13460 query = query.arg_lazy(
13461 "id",
13462 Box::new(move || {
13463 let id = id.clone();
13464 Box::pin(async move { id.into_id().await.unwrap().quote() })
13465 }),
13466 );
13467 Cloud {
13468 proc: self.proc.clone(),
13469 selection: query,
13470 graphql_client: self.graphql_client.clone(),
13471 }
13472 }
13473 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13475 let mut query = self.selection.select("loadContainerFromID");
13476 query = query.arg_lazy(
13477 "id",
13478 Box::new(move || {
13479 let id = id.clone();
13480 Box::pin(async move { id.into_id().await.unwrap().quote() })
13481 }),
13482 );
13483 Container {
13484 proc: self.proc.clone(),
13485 selection: query,
13486 graphql_client: self.graphql_client.clone(),
13487 }
13488 }
13489 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13491 let mut query = self.selection.select("loadCurrentModuleFromID");
13492 query = query.arg_lazy(
13493 "id",
13494 Box::new(move || {
13495 let id = id.clone();
13496 Box::pin(async move { id.into_id().await.unwrap().quote() })
13497 }),
13498 );
13499 CurrentModule {
13500 proc: self.proc.clone(),
13501 selection: query,
13502 graphql_client: self.graphql_client.clone(),
13503 }
13504 }
13505 pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13507 let mut query = self.selection.select("loadDiffStatFromID");
13508 query = query.arg_lazy(
13509 "id",
13510 Box::new(move || {
13511 let id = id.clone();
13512 Box::pin(async move { id.into_id().await.unwrap().quote() })
13513 }),
13514 );
13515 DiffStat {
13516 proc: self.proc.clone(),
13517 selection: query,
13518 graphql_client: self.graphql_client.clone(),
13519 }
13520 }
13521 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13523 let mut query = self.selection.select("loadDirectoryFromID");
13524 query = query.arg_lazy(
13525 "id",
13526 Box::new(move || {
13527 let id = id.clone();
13528 Box::pin(async move { id.into_id().await.unwrap().quote() })
13529 }),
13530 );
13531 Directory {
13532 proc: self.proc.clone(),
13533 selection: query,
13534 graphql_client: self.graphql_client.clone(),
13535 }
13536 }
13537 pub fn load_engine_cache_entry_from_id(
13539 &self,
13540 id: impl IntoID<EngineCacheEntryId>,
13541 ) -> EngineCacheEntry {
13542 let mut query = self.selection.select("loadEngineCacheEntryFromID");
13543 query = query.arg_lazy(
13544 "id",
13545 Box::new(move || {
13546 let id = id.clone();
13547 Box::pin(async move { id.into_id().await.unwrap().quote() })
13548 }),
13549 );
13550 EngineCacheEntry {
13551 proc: self.proc.clone(),
13552 selection: query,
13553 graphql_client: self.graphql_client.clone(),
13554 }
13555 }
13556 pub fn load_engine_cache_entry_set_from_id(
13558 &self,
13559 id: impl IntoID<EngineCacheEntrySetId>,
13560 ) -> EngineCacheEntrySet {
13561 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13562 query = query.arg_lazy(
13563 "id",
13564 Box::new(move || {
13565 let id = id.clone();
13566 Box::pin(async move { id.into_id().await.unwrap().quote() })
13567 }),
13568 );
13569 EngineCacheEntrySet {
13570 proc: self.proc.clone(),
13571 selection: query,
13572 graphql_client: self.graphql_client.clone(),
13573 }
13574 }
13575 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13577 let mut query = self.selection.select("loadEngineCacheFromID");
13578 query = query.arg_lazy(
13579 "id",
13580 Box::new(move || {
13581 let id = id.clone();
13582 Box::pin(async move { id.into_id().await.unwrap().quote() })
13583 }),
13584 );
13585 EngineCache {
13586 proc: self.proc.clone(),
13587 selection: query,
13588 graphql_client: self.graphql_client.clone(),
13589 }
13590 }
13591 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13593 let mut query = self.selection.select("loadEngineFromID");
13594 query = query.arg_lazy(
13595 "id",
13596 Box::new(move || {
13597 let id = id.clone();
13598 Box::pin(async move { id.into_id().await.unwrap().quote() })
13599 }),
13600 );
13601 Engine {
13602 proc: self.proc.clone(),
13603 selection: query,
13604 graphql_client: self.graphql_client.clone(),
13605 }
13606 }
13607 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13609 let mut query = self.selection.select("loadEnumTypeDefFromID");
13610 query = query.arg_lazy(
13611 "id",
13612 Box::new(move || {
13613 let id = id.clone();
13614 Box::pin(async move { id.into_id().await.unwrap().quote() })
13615 }),
13616 );
13617 EnumTypeDef {
13618 proc: self.proc.clone(),
13619 selection: query,
13620 graphql_client: self.graphql_client.clone(),
13621 }
13622 }
13623 pub fn load_enum_value_type_def_from_id(
13625 &self,
13626 id: impl IntoID<EnumValueTypeDefId>,
13627 ) -> EnumValueTypeDef {
13628 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13629 query = query.arg_lazy(
13630 "id",
13631 Box::new(move || {
13632 let id = id.clone();
13633 Box::pin(async move { id.into_id().await.unwrap().quote() })
13634 }),
13635 );
13636 EnumValueTypeDef {
13637 proc: self.proc.clone(),
13638 selection: query,
13639 graphql_client: self.graphql_client.clone(),
13640 }
13641 }
13642 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13644 let mut query = self.selection.select("loadEnvFileFromID");
13645 query = query.arg_lazy(
13646 "id",
13647 Box::new(move || {
13648 let id = id.clone();
13649 Box::pin(async move { id.into_id().await.unwrap().quote() })
13650 }),
13651 );
13652 EnvFile {
13653 proc: self.proc.clone(),
13654 selection: query,
13655 graphql_client: self.graphql_client.clone(),
13656 }
13657 }
13658 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13660 let mut query = self.selection.select("loadEnvFromID");
13661 query = query.arg_lazy(
13662 "id",
13663 Box::new(move || {
13664 let id = id.clone();
13665 Box::pin(async move { id.into_id().await.unwrap().quote() })
13666 }),
13667 );
13668 Env {
13669 proc: self.proc.clone(),
13670 selection: query,
13671 graphql_client: self.graphql_client.clone(),
13672 }
13673 }
13674 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13676 let mut query = self.selection.select("loadEnvVariableFromID");
13677 query = query.arg_lazy(
13678 "id",
13679 Box::new(move || {
13680 let id = id.clone();
13681 Box::pin(async move { id.into_id().await.unwrap().quote() })
13682 }),
13683 );
13684 EnvVariable {
13685 proc: self.proc.clone(),
13686 selection: query,
13687 graphql_client: self.graphql_client.clone(),
13688 }
13689 }
13690 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13692 let mut query = self.selection.select("loadErrorFromID");
13693 query = query.arg_lazy(
13694 "id",
13695 Box::new(move || {
13696 let id = id.clone();
13697 Box::pin(async move { id.into_id().await.unwrap().quote() })
13698 }),
13699 );
13700 Error {
13701 proc: self.proc.clone(),
13702 selection: query,
13703 graphql_client: self.graphql_client.clone(),
13704 }
13705 }
13706 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13708 let mut query = self.selection.select("loadErrorValueFromID");
13709 query = query.arg_lazy(
13710 "id",
13711 Box::new(move || {
13712 let id = id.clone();
13713 Box::pin(async move { id.into_id().await.unwrap().quote() })
13714 }),
13715 );
13716 ErrorValue {
13717 proc: self.proc.clone(),
13718 selection: query,
13719 graphql_client: self.graphql_client.clone(),
13720 }
13721 }
13722 pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13724 let mut query = self.selection.select("loadExportableFromID");
13725 query = query.arg_lazy(
13726 "id",
13727 Box::new(move || {
13728 let id = id.clone();
13729 Box::pin(async move { id.into_id().await.unwrap().quote() })
13730 }),
13731 );
13732 ExportableClient {
13733 proc: self.proc.clone(),
13734 selection: query,
13735 graphql_client: self.graphql_client.clone(),
13736 }
13737 }
13738 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13740 let mut query = self.selection.select("loadFieldTypeDefFromID");
13741 query = query.arg_lazy(
13742 "id",
13743 Box::new(move || {
13744 let id = id.clone();
13745 Box::pin(async move { id.into_id().await.unwrap().quote() })
13746 }),
13747 );
13748 FieldTypeDef {
13749 proc: self.proc.clone(),
13750 selection: query,
13751 graphql_client: self.graphql_client.clone(),
13752 }
13753 }
13754 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13756 let mut query = self.selection.select("loadFileFromID");
13757 query = query.arg_lazy(
13758 "id",
13759 Box::new(move || {
13760 let id = id.clone();
13761 Box::pin(async move { id.into_id().await.unwrap().quote() })
13762 }),
13763 );
13764 File {
13765 proc: self.proc.clone(),
13766 selection: query,
13767 graphql_client: self.graphql_client.clone(),
13768 }
13769 }
13770 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13772 let mut query = self.selection.select("loadFunctionArgFromID");
13773 query = query.arg_lazy(
13774 "id",
13775 Box::new(move || {
13776 let id = id.clone();
13777 Box::pin(async move { id.into_id().await.unwrap().quote() })
13778 }),
13779 );
13780 FunctionArg {
13781 proc: self.proc.clone(),
13782 selection: query,
13783 graphql_client: self.graphql_client.clone(),
13784 }
13785 }
13786 pub fn load_function_call_arg_value_from_id(
13788 &self,
13789 id: impl IntoID<FunctionCallArgValueId>,
13790 ) -> FunctionCallArgValue {
13791 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13792 query = query.arg_lazy(
13793 "id",
13794 Box::new(move || {
13795 let id = id.clone();
13796 Box::pin(async move { id.into_id().await.unwrap().quote() })
13797 }),
13798 );
13799 FunctionCallArgValue {
13800 proc: self.proc.clone(),
13801 selection: query,
13802 graphql_client: self.graphql_client.clone(),
13803 }
13804 }
13805 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13807 let mut query = self.selection.select("loadFunctionCallFromID");
13808 query = query.arg_lazy(
13809 "id",
13810 Box::new(move || {
13811 let id = id.clone();
13812 Box::pin(async move { id.into_id().await.unwrap().quote() })
13813 }),
13814 );
13815 FunctionCall {
13816 proc: self.proc.clone(),
13817 selection: query,
13818 graphql_client: self.graphql_client.clone(),
13819 }
13820 }
13821 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13823 let mut query = self.selection.select("loadFunctionFromID");
13824 query = query.arg_lazy(
13825 "id",
13826 Box::new(move || {
13827 let id = id.clone();
13828 Box::pin(async move { id.into_id().await.unwrap().quote() })
13829 }),
13830 );
13831 Function {
13832 proc: self.proc.clone(),
13833 selection: query,
13834 graphql_client: self.graphql_client.clone(),
13835 }
13836 }
13837 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13839 let mut query = self.selection.select("loadGeneratedCodeFromID");
13840 query = query.arg_lazy(
13841 "id",
13842 Box::new(move || {
13843 let id = id.clone();
13844 Box::pin(async move { id.into_id().await.unwrap().quote() })
13845 }),
13846 );
13847 GeneratedCode {
13848 proc: self.proc.clone(),
13849 selection: query,
13850 graphql_client: self.graphql_client.clone(),
13851 }
13852 }
13853 pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13855 let mut query = self.selection.select("loadGeneratorFromID");
13856 query = query.arg_lazy(
13857 "id",
13858 Box::new(move || {
13859 let id = id.clone();
13860 Box::pin(async move { id.into_id().await.unwrap().quote() })
13861 }),
13862 );
13863 Generator {
13864 proc: self.proc.clone(),
13865 selection: query,
13866 graphql_client: self.graphql_client.clone(),
13867 }
13868 }
13869 pub fn load_generator_group_from_id(
13871 &self,
13872 id: impl IntoID<GeneratorGroupId>,
13873 ) -> GeneratorGroup {
13874 let mut query = self.selection.select("loadGeneratorGroupFromID");
13875 query = query.arg_lazy(
13876 "id",
13877 Box::new(move || {
13878 let id = id.clone();
13879 Box::pin(async move { id.into_id().await.unwrap().quote() })
13880 }),
13881 );
13882 GeneratorGroup {
13883 proc: self.proc.clone(),
13884 selection: query,
13885 graphql_client: self.graphql_client.clone(),
13886 }
13887 }
13888 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13890 let mut query = self.selection.select("loadGitRefFromID");
13891 query = query.arg_lazy(
13892 "id",
13893 Box::new(move || {
13894 let id = id.clone();
13895 Box::pin(async move { id.into_id().await.unwrap().quote() })
13896 }),
13897 );
13898 GitRef {
13899 proc: self.proc.clone(),
13900 selection: query,
13901 graphql_client: self.graphql_client.clone(),
13902 }
13903 }
13904 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13906 let mut query = self.selection.select("loadGitRepositoryFromID");
13907 query = query.arg_lazy(
13908 "id",
13909 Box::new(move || {
13910 let id = id.clone();
13911 Box::pin(async move { id.into_id().await.unwrap().quote() })
13912 }),
13913 );
13914 GitRepository {
13915 proc: self.proc.clone(),
13916 selection: query,
13917 graphql_client: self.graphql_client.clone(),
13918 }
13919 }
13920 pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
13922 let mut query = self.selection.select("loadHTTPStateFromID");
13923 query = query.arg_lazy(
13924 "id",
13925 Box::new(move || {
13926 let id = id.clone();
13927 Box::pin(async move { id.into_id().await.unwrap().quote() })
13928 }),
13929 );
13930 HttpState {
13931 proc: self.proc.clone(),
13932 selection: query,
13933 graphql_client: self.graphql_client.clone(),
13934 }
13935 }
13936 pub fn load_healthcheck_config_from_id(
13938 &self,
13939 id: impl IntoID<HealthcheckConfigId>,
13940 ) -> HealthcheckConfig {
13941 let mut query = self.selection.select("loadHealthcheckConfigFromID");
13942 query = query.arg_lazy(
13943 "id",
13944 Box::new(move || {
13945 let id = id.clone();
13946 Box::pin(async move { id.into_id().await.unwrap().quote() })
13947 }),
13948 );
13949 HealthcheckConfig {
13950 proc: self.proc.clone(),
13951 selection: query,
13952 graphql_client: self.graphql_client.clone(),
13953 }
13954 }
13955 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13957 let mut query = self.selection.select("loadHostFromID");
13958 query = query.arg_lazy(
13959 "id",
13960 Box::new(move || {
13961 let id = id.clone();
13962 Box::pin(async move { id.into_id().await.unwrap().quote() })
13963 }),
13964 );
13965 Host {
13966 proc: self.proc.clone(),
13967 selection: query,
13968 graphql_client: self.graphql_client.clone(),
13969 }
13970 }
13971 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
13973 let mut query = self.selection.select("loadInputTypeDefFromID");
13974 query = query.arg_lazy(
13975 "id",
13976 Box::new(move || {
13977 let id = id.clone();
13978 Box::pin(async move { id.into_id().await.unwrap().quote() })
13979 }),
13980 );
13981 InputTypeDef {
13982 proc: self.proc.clone(),
13983 selection: query,
13984 graphql_client: self.graphql_client.clone(),
13985 }
13986 }
13987 pub fn load_interface_type_def_from_id(
13989 &self,
13990 id: impl IntoID<InterfaceTypeDefId>,
13991 ) -> InterfaceTypeDef {
13992 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
13993 query = query.arg_lazy(
13994 "id",
13995 Box::new(move || {
13996 let id = id.clone();
13997 Box::pin(async move { id.into_id().await.unwrap().quote() })
13998 }),
13999 );
14000 InterfaceTypeDef {
14001 proc: self.proc.clone(),
14002 selection: query,
14003 graphql_client: self.graphql_client.clone(),
14004 }
14005 }
14006 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14008 let mut query = self.selection.select("loadJSONValueFromID");
14009 query = query.arg_lazy(
14010 "id",
14011 Box::new(move || {
14012 let id = id.clone();
14013 Box::pin(async move { id.into_id().await.unwrap().quote() })
14014 }),
14015 );
14016 JsonValue {
14017 proc: self.proc.clone(),
14018 selection: query,
14019 graphql_client: self.graphql_client.clone(),
14020 }
14021 }
14022 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14024 let mut query = self.selection.select("loadLLMFromID");
14025 query = query.arg_lazy(
14026 "id",
14027 Box::new(move || {
14028 let id = id.clone();
14029 Box::pin(async move { id.into_id().await.unwrap().quote() })
14030 }),
14031 );
14032 Llm {
14033 proc: self.proc.clone(),
14034 selection: query,
14035 graphql_client: self.graphql_client.clone(),
14036 }
14037 }
14038 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14040 let mut query = self.selection.select("loadLLMTokenUsageFromID");
14041 query = query.arg_lazy(
14042 "id",
14043 Box::new(move || {
14044 let id = id.clone();
14045 Box::pin(async move { id.into_id().await.unwrap().quote() })
14046 }),
14047 );
14048 LlmTokenUsage {
14049 proc: self.proc.clone(),
14050 selection: query,
14051 graphql_client: self.graphql_client.clone(),
14052 }
14053 }
14054 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14056 let mut query = self.selection.select("loadLabelFromID");
14057 query = query.arg_lazy(
14058 "id",
14059 Box::new(move || {
14060 let id = id.clone();
14061 Box::pin(async move { id.into_id().await.unwrap().quote() })
14062 }),
14063 );
14064 Label {
14065 proc: self.proc.clone(),
14066 selection: query,
14067 graphql_client: self.graphql_client.clone(),
14068 }
14069 }
14070 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14072 let mut query = self.selection.select("loadListTypeDefFromID");
14073 query = query.arg_lazy(
14074 "id",
14075 Box::new(move || {
14076 let id = id.clone();
14077 Box::pin(async move { id.into_id().await.unwrap().quote() })
14078 }),
14079 );
14080 ListTypeDef {
14081 proc: self.proc.clone(),
14082 selection: query,
14083 graphql_client: self.graphql_client.clone(),
14084 }
14085 }
14086 pub fn load_module_config_client_from_id(
14088 &self,
14089 id: impl IntoID<ModuleConfigClientId>,
14090 ) -> ModuleConfigClient {
14091 let mut query = self.selection.select("loadModuleConfigClientFromID");
14092 query = query.arg_lazy(
14093 "id",
14094 Box::new(move || {
14095 let id = id.clone();
14096 Box::pin(async move { id.into_id().await.unwrap().quote() })
14097 }),
14098 );
14099 ModuleConfigClient {
14100 proc: self.proc.clone(),
14101 selection: query,
14102 graphql_client: self.graphql_client.clone(),
14103 }
14104 }
14105 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14107 let mut query = self.selection.select("loadModuleFromID");
14108 query = query.arg_lazy(
14109 "id",
14110 Box::new(move || {
14111 let id = id.clone();
14112 Box::pin(async move { id.into_id().await.unwrap().quote() })
14113 }),
14114 );
14115 Module {
14116 proc: self.proc.clone(),
14117 selection: query,
14118 graphql_client: self.graphql_client.clone(),
14119 }
14120 }
14121 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14123 let mut query = self.selection.select("loadModuleSourceFromID");
14124 query = query.arg_lazy(
14125 "id",
14126 Box::new(move || {
14127 let id = id.clone();
14128 Box::pin(async move { id.into_id().await.unwrap().quote() })
14129 }),
14130 );
14131 ModuleSource {
14132 proc: self.proc.clone(),
14133 selection: query,
14134 graphql_client: self.graphql_client.clone(),
14135 }
14136 }
14137 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14139 let mut query = self.selection.select("loadObjectTypeDefFromID");
14140 query = query.arg_lazy(
14141 "id",
14142 Box::new(move || {
14143 let id = id.clone();
14144 Box::pin(async move { id.into_id().await.unwrap().quote() })
14145 }),
14146 );
14147 ObjectTypeDef {
14148 proc: self.proc.clone(),
14149 selection: query,
14150 graphql_client: self.graphql_client.clone(),
14151 }
14152 }
14153 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14155 let mut query = self.selection.select("loadPortFromID");
14156 query = query.arg_lazy(
14157 "id",
14158 Box::new(move || {
14159 let id = id.clone();
14160 Box::pin(async move { id.into_id().await.unwrap().quote() })
14161 }),
14162 );
14163 Port {
14164 proc: self.proc.clone(),
14165 selection: query,
14166 graphql_client: self.graphql_client.clone(),
14167 }
14168 }
14169 pub fn load_remote_git_mirror_from_id(
14171 &self,
14172 id: impl IntoID<RemoteGitMirrorId>,
14173 ) -> RemoteGitMirror {
14174 let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14175 query = query.arg_lazy(
14176 "id",
14177 Box::new(move || {
14178 let id = id.clone();
14179 Box::pin(async move { id.into_id().await.unwrap().quote() })
14180 }),
14181 );
14182 RemoteGitMirror {
14183 proc: self.proc.clone(),
14184 selection: query,
14185 graphql_client: self.graphql_client.clone(),
14186 }
14187 }
14188 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14190 let mut query = self.selection.select("loadSDKConfigFromID");
14191 query = query.arg_lazy(
14192 "id",
14193 Box::new(move || {
14194 let id = id.clone();
14195 Box::pin(async move { id.into_id().await.unwrap().quote() })
14196 }),
14197 );
14198 SdkConfig {
14199 proc: self.proc.clone(),
14200 selection: query,
14201 graphql_client: self.graphql_client.clone(),
14202 }
14203 }
14204 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14206 let mut query = self.selection.select("loadScalarTypeDefFromID");
14207 query = query.arg_lazy(
14208 "id",
14209 Box::new(move || {
14210 let id = id.clone();
14211 Box::pin(async move { id.into_id().await.unwrap().quote() })
14212 }),
14213 );
14214 ScalarTypeDef {
14215 proc: self.proc.clone(),
14216 selection: query,
14217 graphql_client: self.graphql_client.clone(),
14218 }
14219 }
14220 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14222 let mut query = self.selection.select("loadSearchResultFromID");
14223 query = query.arg_lazy(
14224 "id",
14225 Box::new(move || {
14226 let id = id.clone();
14227 Box::pin(async move { id.into_id().await.unwrap().quote() })
14228 }),
14229 );
14230 SearchResult {
14231 proc: self.proc.clone(),
14232 selection: query,
14233 graphql_client: self.graphql_client.clone(),
14234 }
14235 }
14236 pub fn load_search_submatch_from_id(
14238 &self,
14239 id: impl IntoID<SearchSubmatchId>,
14240 ) -> SearchSubmatch {
14241 let mut query = self.selection.select("loadSearchSubmatchFromID");
14242 query = query.arg_lazy(
14243 "id",
14244 Box::new(move || {
14245 let id = id.clone();
14246 Box::pin(async move { id.into_id().await.unwrap().quote() })
14247 }),
14248 );
14249 SearchSubmatch {
14250 proc: self.proc.clone(),
14251 selection: query,
14252 graphql_client: self.graphql_client.clone(),
14253 }
14254 }
14255 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14257 let mut query = self.selection.select("loadSecretFromID");
14258 query = query.arg_lazy(
14259 "id",
14260 Box::new(move || {
14261 let id = id.clone();
14262 Box::pin(async move { id.into_id().await.unwrap().quote() })
14263 }),
14264 );
14265 Secret {
14266 proc: self.proc.clone(),
14267 selection: query,
14268 graphql_client: self.graphql_client.clone(),
14269 }
14270 }
14271 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14273 let mut query = self.selection.select("loadServiceFromID");
14274 query = query.arg_lazy(
14275 "id",
14276 Box::new(move || {
14277 let id = id.clone();
14278 Box::pin(async move { id.into_id().await.unwrap().quote() })
14279 }),
14280 );
14281 Service {
14282 proc: self.proc.clone(),
14283 selection: query,
14284 graphql_client: self.graphql_client.clone(),
14285 }
14286 }
14287 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14289 let mut query = self.selection.select("loadSocketFromID");
14290 query = query.arg_lazy(
14291 "id",
14292 Box::new(move || {
14293 let id = id.clone();
14294 Box::pin(async move { id.into_id().await.unwrap().quote() })
14295 }),
14296 );
14297 Socket {
14298 proc: self.proc.clone(),
14299 selection: query,
14300 graphql_client: self.graphql_client.clone(),
14301 }
14302 }
14303 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14305 let mut query = self.selection.select("loadSourceMapFromID");
14306 query = query.arg_lazy(
14307 "id",
14308 Box::new(move || {
14309 let id = id.clone();
14310 Box::pin(async move { id.into_id().await.unwrap().quote() })
14311 }),
14312 );
14313 SourceMap {
14314 proc: self.proc.clone(),
14315 selection: query,
14316 graphql_client: self.graphql_client.clone(),
14317 }
14318 }
14319 pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14321 let mut query = self.selection.select("loadStatFromID");
14322 query = query.arg_lazy(
14323 "id",
14324 Box::new(move || {
14325 let id = id.clone();
14326 Box::pin(async move { id.into_id().await.unwrap().quote() })
14327 }),
14328 );
14329 Stat {
14330 proc: self.proc.clone(),
14331 selection: query,
14332 graphql_client: self.graphql_client.clone(),
14333 }
14334 }
14335 pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14337 let mut query = self.selection.select("loadSyncerFromID");
14338 query = query.arg_lazy(
14339 "id",
14340 Box::new(move || {
14341 let id = id.clone();
14342 Box::pin(async move { id.into_id().await.unwrap().quote() })
14343 }),
14344 );
14345 SyncerClient {
14346 proc: self.proc.clone(),
14347 selection: query,
14348 graphql_client: self.graphql_client.clone(),
14349 }
14350 }
14351 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14353 let mut query = self.selection.select("loadTerminalFromID");
14354 query = query.arg_lazy(
14355 "id",
14356 Box::new(move || {
14357 let id = id.clone();
14358 Box::pin(async move { id.into_id().await.unwrap().quote() })
14359 }),
14360 );
14361 Terminal {
14362 proc: self.proc.clone(),
14363 selection: query,
14364 graphql_client: self.graphql_client.clone(),
14365 }
14366 }
14367 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14369 let mut query = self.selection.select("loadTypeDefFromID");
14370 query = query.arg_lazy(
14371 "id",
14372 Box::new(move || {
14373 let id = id.clone();
14374 Box::pin(async move { id.into_id().await.unwrap().quote() })
14375 }),
14376 );
14377 TypeDef {
14378 proc: self.proc.clone(),
14379 selection: query,
14380 graphql_client: self.graphql_client.clone(),
14381 }
14382 }
14383 pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14385 let mut query = self.selection.select("loadUpFromID");
14386 query = query.arg_lazy(
14387 "id",
14388 Box::new(move || {
14389 let id = id.clone();
14390 Box::pin(async move { id.into_id().await.unwrap().quote() })
14391 }),
14392 );
14393 Up {
14394 proc: self.proc.clone(),
14395 selection: query,
14396 graphql_client: self.graphql_client.clone(),
14397 }
14398 }
14399 pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14401 let mut query = self.selection.select("loadUpGroupFromID");
14402 query = query.arg_lazy(
14403 "id",
14404 Box::new(move || {
14405 let id = id.clone();
14406 Box::pin(async move { id.into_id().await.unwrap().quote() })
14407 }),
14408 );
14409 UpGroup {
14410 proc: self.proc.clone(),
14411 selection: query,
14412 graphql_client: self.graphql_client.clone(),
14413 }
14414 }
14415 pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14417 let mut query = self.selection.select("loadWorkspaceFromID");
14418 query = query.arg_lazy(
14419 "id",
14420 Box::new(move || {
14421 let id = id.clone();
14422 Box::pin(async move { id.into_id().await.unwrap().quote() })
14423 }),
14424 );
14425 Workspace {
14426 proc: self.proc.clone(),
14427 selection: query,
14428 graphql_client: self.graphql_client.clone(),
14429 }
14430 }
14431 pub fn module(&self) -> Module {
14433 let query = self.selection.select("module");
14434 Module {
14435 proc: self.proc.clone(),
14436 selection: query,
14437 graphql_client: self.graphql_client.clone(),
14438 }
14439 }
14440 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14447 let mut query = self.selection.select("moduleSource");
14448 query = query.arg("refString", ref_string.into());
14449 ModuleSource {
14450 proc: self.proc.clone(),
14451 selection: query,
14452 graphql_client: self.graphql_client.clone(),
14453 }
14454 }
14455 pub fn module_source_opts<'a>(
14462 &self,
14463 ref_string: impl Into<String>,
14464 opts: QueryModuleSourceOpts<'a>,
14465 ) -> ModuleSource {
14466 let mut query = self.selection.select("moduleSource");
14467 query = query.arg("refString", ref_string.into());
14468 if let Some(ref_pin) = opts.ref_pin {
14469 query = query.arg("refPin", ref_pin);
14470 }
14471 if let Some(disable_find_up) = opts.disable_find_up {
14472 query = query.arg("disableFindUp", disable_find_up);
14473 }
14474 if let Some(allow_not_exists) = opts.allow_not_exists {
14475 query = query.arg("allowNotExists", allow_not_exists);
14476 }
14477 if let Some(require_kind) = opts.require_kind {
14478 query = query.arg("requireKind", require_kind);
14479 }
14480 ModuleSource {
14481 proc: self.proc.clone(),
14482 selection: query,
14483 graphql_client: self.graphql_client.clone(),
14484 }
14485 }
14486 pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14488 let mut query = self.selection.select("node");
14489 query = query.arg_lazy(
14490 "id",
14491 Box::new(move || {
14492 let id = id.clone();
14493 Box::pin(async move { id.into_id().await.unwrap().quote() })
14494 }),
14495 );
14496 NodeClient {
14497 proc: self.proc.clone(),
14498 selection: query,
14499 graphql_client: self.graphql_client.clone(),
14500 }
14501 }
14502 pub fn secret(&self, uri: impl Into<String>) -> Secret {
14509 let mut query = self.selection.select("secret");
14510 query = query.arg("uri", uri.into());
14511 Secret {
14512 proc: self.proc.clone(),
14513 selection: query,
14514 graphql_client: self.graphql_client.clone(),
14515 }
14516 }
14517 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14524 let mut query = self.selection.select("secret");
14525 query = query.arg("uri", uri.into());
14526 if let Some(cache_key) = opts.cache_key {
14527 query = query.arg("cacheKey", cache_key);
14528 }
14529 Secret {
14530 proc: self.proc.clone(),
14531 selection: query,
14532 graphql_client: self.graphql_client.clone(),
14533 }
14534 }
14535 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14543 let mut query = self.selection.select("setSecret");
14544 query = query.arg("name", name.into());
14545 query = query.arg("plaintext", plaintext.into());
14546 Secret {
14547 proc: self.proc.clone(),
14548 selection: query,
14549 graphql_client: self.graphql_client.clone(),
14550 }
14551 }
14552 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14560 let mut query = self.selection.select("sourceMap");
14561 query = query.arg("filename", filename.into());
14562 query = query.arg("line", line);
14563 query = query.arg("column", column);
14564 SourceMap {
14565 proc: self.proc.clone(),
14566 selection: query,
14567 graphql_client: self.graphql_client.clone(),
14568 }
14569 }
14570 pub fn type_def(&self) -> TypeDef {
14572 let query = self.selection.select("typeDef");
14573 TypeDef {
14574 proc: self.proc.clone(),
14575 selection: query,
14576 graphql_client: self.graphql_client.clone(),
14577 }
14578 }
14579 pub async fn version(&self) -> Result<String, DaggerError> {
14581 let query = self.selection.select("version");
14582 query.execute(self.graphql_client.clone()).await
14583 }
14584}
14585impl Node for Query {
14586 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14587 let query = self.selection.select("id");
14588 let graphql_client = self.graphql_client.clone();
14589 async move { query.execute(graphql_client).await }
14590 }
14591}
14592#[derive(Clone)]
14593pub struct RemoteGitMirror {
14594 pub proc: Option<Arc<DaggerSessionProc>>,
14595 pub selection: Selection,
14596 pub graphql_client: DynGraphQLClient,
14597}
14598impl IntoID<Id> for RemoteGitMirror {
14599 fn into_id(
14600 self,
14601 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14602 Box::pin(async move { self.id().await })
14603 }
14604}
14605impl Loadable for RemoteGitMirror {
14606 fn graphql_type() -> &'static str {
14607 "RemoteGitMirror"
14608 }
14609 fn from_query(
14610 proc: Option<Arc<DaggerSessionProc>>,
14611 selection: Selection,
14612 graphql_client: DynGraphQLClient,
14613 ) -> Self {
14614 Self {
14615 proc,
14616 selection,
14617 graphql_client,
14618 }
14619 }
14620}
14621impl RemoteGitMirror {
14622 pub async fn id(&self) -> Result<Id, DaggerError> {
14624 let query = self.selection.select("id");
14625 query.execute(self.graphql_client.clone()).await
14626 }
14627}
14628impl Node for RemoteGitMirror {
14629 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14630 let query = self.selection.select("id");
14631 let graphql_client = self.graphql_client.clone();
14632 async move { query.execute(graphql_client).await }
14633 }
14634}
14635#[derive(Clone)]
14636pub struct SdkConfig {
14637 pub proc: Option<Arc<DaggerSessionProc>>,
14638 pub selection: Selection,
14639 pub graphql_client: DynGraphQLClient,
14640}
14641impl IntoID<Id> for SdkConfig {
14642 fn into_id(
14643 self,
14644 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14645 Box::pin(async move { self.id().await })
14646 }
14647}
14648impl Loadable for SdkConfig {
14649 fn graphql_type() -> &'static str {
14650 "SDKConfig"
14651 }
14652 fn from_query(
14653 proc: Option<Arc<DaggerSessionProc>>,
14654 selection: Selection,
14655 graphql_client: DynGraphQLClient,
14656 ) -> Self {
14657 Self {
14658 proc,
14659 selection,
14660 graphql_client,
14661 }
14662 }
14663}
14664impl SdkConfig {
14665 pub async fn debug(&self) -> Result<bool, DaggerError> {
14667 let query = self.selection.select("debug");
14668 query.execute(self.graphql_client.clone()).await
14669 }
14670 pub async fn id(&self) -> Result<Id, DaggerError> {
14672 let query = self.selection.select("id");
14673 query.execute(self.graphql_client.clone()).await
14674 }
14675 pub async fn source(&self) -> Result<String, DaggerError> {
14677 let query = self.selection.select("source");
14678 query.execute(self.graphql_client.clone()).await
14679 }
14680}
14681impl Node for SdkConfig {
14682 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14683 let query = self.selection.select("id");
14684 let graphql_client = self.graphql_client.clone();
14685 async move { query.execute(graphql_client).await }
14686 }
14687}
14688#[derive(Clone)]
14689pub struct ScalarTypeDef {
14690 pub proc: Option<Arc<DaggerSessionProc>>,
14691 pub selection: Selection,
14692 pub graphql_client: DynGraphQLClient,
14693}
14694impl IntoID<Id> for ScalarTypeDef {
14695 fn into_id(
14696 self,
14697 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14698 Box::pin(async move { self.id().await })
14699 }
14700}
14701impl Loadable for ScalarTypeDef {
14702 fn graphql_type() -> &'static str {
14703 "ScalarTypeDef"
14704 }
14705 fn from_query(
14706 proc: Option<Arc<DaggerSessionProc>>,
14707 selection: Selection,
14708 graphql_client: DynGraphQLClient,
14709 ) -> Self {
14710 Self {
14711 proc,
14712 selection,
14713 graphql_client,
14714 }
14715 }
14716}
14717impl ScalarTypeDef {
14718 pub async fn description(&self) -> Result<String, DaggerError> {
14720 let query = self.selection.select("description");
14721 query.execute(self.graphql_client.clone()).await
14722 }
14723 pub async fn id(&self) -> Result<Id, DaggerError> {
14725 let query = self.selection.select("id");
14726 query.execute(self.graphql_client.clone()).await
14727 }
14728 pub async fn name(&self) -> Result<String, DaggerError> {
14730 let query = self.selection.select("name");
14731 query.execute(self.graphql_client.clone()).await
14732 }
14733 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14735 let query = self.selection.select("sourceModuleName");
14736 query.execute(self.graphql_client.clone()).await
14737 }
14738}
14739impl Node for ScalarTypeDef {
14740 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14741 let query = self.selection.select("id");
14742 let graphql_client = self.graphql_client.clone();
14743 async move { query.execute(graphql_client).await }
14744 }
14745}
14746#[derive(Clone)]
14747pub struct SearchResult {
14748 pub proc: Option<Arc<DaggerSessionProc>>,
14749 pub selection: Selection,
14750 pub graphql_client: DynGraphQLClient,
14751}
14752impl IntoID<Id> for SearchResult {
14753 fn into_id(
14754 self,
14755 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14756 Box::pin(async move { self.id().await })
14757 }
14758}
14759impl Loadable for SearchResult {
14760 fn graphql_type() -> &'static str {
14761 "SearchResult"
14762 }
14763 fn from_query(
14764 proc: Option<Arc<DaggerSessionProc>>,
14765 selection: Selection,
14766 graphql_client: DynGraphQLClient,
14767 ) -> Self {
14768 Self {
14769 proc,
14770 selection,
14771 graphql_client,
14772 }
14773 }
14774}
14775impl SearchResult {
14776 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14778 let query = self.selection.select("absoluteOffset");
14779 query.execute(self.graphql_client.clone()).await
14780 }
14781 pub async fn file_path(&self) -> Result<String, DaggerError> {
14783 let query = self.selection.select("filePath");
14784 query.execute(self.graphql_client.clone()).await
14785 }
14786 pub async fn id(&self) -> Result<Id, DaggerError> {
14788 let query = self.selection.select("id");
14789 query.execute(self.graphql_client.clone()).await
14790 }
14791 pub async fn line_number(&self) -> Result<isize, DaggerError> {
14793 let query = self.selection.select("lineNumber");
14794 query.execute(self.graphql_client.clone()).await
14795 }
14796 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14798 let query = self.selection.select("matchedLines");
14799 query.execute(self.graphql_client.clone()).await
14800 }
14801 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14803 let query = self.selection.select("submatches");
14804 let query = query.select("id");
14805 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14806 Ok(ids
14807 .into_iter()
14808 .map(|id| SearchSubmatch {
14809 proc: self.proc.clone(),
14810 selection: crate::querybuilder::query()
14811 .select("node")
14812 .arg("id", &id.0)
14813 .inline_fragment("SearchSubmatch"),
14814 graphql_client: self.graphql_client.clone(),
14815 })
14816 .collect())
14817 }
14818}
14819impl Node for SearchResult {
14820 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14821 let query = self.selection.select("id");
14822 let graphql_client = self.graphql_client.clone();
14823 async move { query.execute(graphql_client).await }
14824 }
14825}
14826#[derive(Clone)]
14827pub struct SearchSubmatch {
14828 pub proc: Option<Arc<DaggerSessionProc>>,
14829 pub selection: Selection,
14830 pub graphql_client: DynGraphQLClient,
14831}
14832impl IntoID<Id> for SearchSubmatch {
14833 fn into_id(
14834 self,
14835 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14836 Box::pin(async move { self.id().await })
14837 }
14838}
14839impl Loadable for SearchSubmatch {
14840 fn graphql_type() -> &'static str {
14841 "SearchSubmatch"
14842 }
14843 fn from_query(
14844 proc: Option<Arc<DaggerSessionProc>>,
14845 selection: Selection,
14846 graphql_client: DynGraphQLClient,
14847 ) -> Self {
14848 Self {
14849 proc,
14850 selection,
14851 graphql_client,
14852 }
14853 }
14854}
14855impl SearchSubmatch {
14856 pub async fn end(&self) -> Result<isize, DaggerError> {
14858 let query = self.selection.select("end");
14859 query.execute(self.graphql_client.clone()).await
14860 }
14861 pub async fn id(&self) -> Result<Id, DaggerError> {
14863 let query = self.selection.select("id");
14864 query.execute(self.graphql_client.clone()).await
14865 }
14866 pub async fn start(&self) -> Result<isize, DaggerError> {
14868 let query = self.selection.select("start");
14869 query.execute(self.graphql_client.clone()).await
14870 }
14871 pub async fn text(&self) -> Result<String, DaggerError> {
14873 let query = self.selection.select("text");
14874 query.execute(self.graphql_client.clone()).await
14875 }
14876}
14877impl Node for SearchSubmatch {
14878 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14879 let query = self.selection.select("id");
14880 let graphql_client = self.graphql_client.clone();
14881 async move { query.execute(graphql_client).await }
14882 }
14883}
14884#[derive(Clone)]
14885pub struct Secret {
14886 pub proc: Option<Arc<DaggerSessionProc>>,
14887 pub selection: Selection,
14888 pub graphql_client: DynGraphQLClient,
14889}
14890impl IntoID<Id> for Secret {
14891 fn into_id(
14892 self,
14893 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14894 Box::pin(async move { self.id().await })
14895 }
14896}
14897impl Loadable for Secret {
14898 fn graphql_type() -> &'static str {
14899 "Secret"
14900 }
14901 fn from_query(
14902 proc: Option<Arc<DaggerSessionProc>>,
14903 selection: Selection,
14904 graphql_client: DynGraphQLClient,
14905 ) -> Self {
14906 Self {
14907 proc,
14908 selection,
14909 graphql_client,
14910 }
14911 }
14912}
14913impl Secret {
14914 pub async fn id(&self) -> Result<Id, DaggerError> {
14916 let query = self.selection.select("id");
14917 query.execute(self.graphql_client.clone()).await
14918 }
14919 pub async fn name(&self) -> Result<String, DaggerError> {
14921 let query = self.selection.select("name");
14922 query.execute(self.graphql_client.clone()).await
14923 }
14924 pub async fn plaintext(&self) -> Result<String, DaggerError> {
14926 let query = self.selection.select("plaintext");
14927 query.execute(self.graphql_client.clone()).await
14928 }
14929 pub async fn uri(&self) -> Result<String, DaggerError> {
14931 let query = self.selection.select("uri");
14932 query.execute(self.graphql_client.clone()).await
14933 }
14934}
14935impl Node for Secret {
14936 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14937 let query = self.selection.select("id");
14938 let graphql_client = self.graphql_client.clone();
14939 async move { query.execute(graphql_client).await }
14940 }
14941}
14942#[derive(Clone)]
14943pub struct Service {
14944 pub proc: Option<Arc<DaggerSessionProc>>,
14945 pub selection: Selection,
14946 pub graphql_client: DynGraphQLClient,
14947}
14948#[derive(Builder, Debug, PartialEq)]
14949pub struct ServiceEndpointOpts<'a> {
14950 #[builder(setter(into, strip_option), default)]
14952 pub port: Option<isize>,
14953 #[builder(setter(into, strip_option), default)]
14955 pub scheme: Option<&'a str>,
14956}
14957#[derive(Builder, Debug, PartialEq)]
14958pub struct ServiceStopOpts {
14959 #[builder(setter(into, strip_option), default)]
14961 pub kill: Option<bool>,
14962}
14963#[derive(Builder, Debug, PartialEq)]
14964pub struct ServiceTerminalOpts<'a> {
14965 #[builder(setter(into, strip_option), default)]
14966 pub cmd: Option<Vec<&'a str>>,
14967}
14968#[derive(Builder, Debug, PartialEq)]
14969pub struct ServiceUpOpts {
14970 #[builder(setter(into, strip_option), default)]
14973 pub ports: Option<Vec<PortForward>>,
14974 #[builder(setter(into, strip_option), default)]
14976 pub random: Option<bool>,
14977}
14978impl IntoID<Id> for Service {
14979 fn into_id(
14980 self,
14981 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14982 Box::pin(async move { self.id().await })
14983 }
14984}
14985impl Loadable for Service {
14986 fn graphql_type() -> &'static str {
14987 "Service"
14988 }
14989 fn from_query(
14990 proc: Option<Arc<DaggerSessionProc>>,
14991 selection: Selection,
14992 graphql_client: DynGraphQLClient,
14993 ) -> Self {
14994 Self {
14995 proc,
14996 selection,
14997 graphql_client,
14998 }
14999 }
15000}
15001impl Service {
15002 pub async fn endpoint(&self) -> Result<String, DaggerError> {
15010 let query = self.selection.select("endpoint");
15011 query.execute(self.graphql_client.clone()).await
15012 }
15013 pub async fn endpoint_opts<'a>(
15021 &self,
15022 opts: ServiceEndpointOpts<'a>,
15023 ) -> Result<String, DaggerError> {
15024 let mut query = self.selection.select("endpoint");
15025 if let Some(port) = opts.port {
15026 query = query.arg("port", port);
15027 }
15028 if let Some(scheme) = opts.scheme {
15029 query = query.arg("scheme", scheme);
15030 }
15031 query.execute(self.graphql_client.clone()).await
15032 }
15033 pub async fn hostname(&self) -> Result<String, DaggerError> {
15035 let query = self.selection.select("hostname");
15036 query.execute(self.graphql_client.clone()).await
15037 }
15038 pub async fn id(&self) -> Result<Id, DaggerError> {
15040 let query = self.selection.select("id");
15041 query.execute(self.graphql_client.clone()).await
15042 }
15043 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15045 let query = self.selection.select("ports");
15046 let query = query.select("id");
15047 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15048 Ok(ids
15049 .into_iter()
15050 .map(|id| Port {
15051 proc: self.proc.clone(),
15052 selection: crate::querybuilder::query()
15053 .select("node")
15054 .arg("id", &id.0)
15055 .inline_fragment("Port"),
15056 graphql_client: self.graphql_client.clone(),
15057 })
15058 .collect())
15059 }
15060 pub async fn start(&self) -> Result<Service, DaggerError> {
15063 let query = self.selection.select("start");
15064 let id: Id = query.execute(self.graphql_client.clone()).await?;
15065 Ok(Service {
15066 proc: self.proc.clone(),
15067 selection: query
15068 .root()
15069 .select("node")
15070 .arg("id", &id.0)
15071 .inline_fragment("Service"),
15072 graphql_client: self.graphql_client.clone(),
15073 })
15074 }
15075 pub async fn stop(&self) -> Result<Service, DaggerError> {
15081 let query = self.selection.select("stop");
15082 let id: Id = query.execute(self.graphql_client.clone()).await?;
15083 Ok(Service {
15084 proc: self.proc.clone(),
15085 selection: query
15086 .root()
15087 .select("node")
15088 .arg("id", &id.0)
15089 .inline_fragment("Service"),
15090 graphql_client: self.graphql_client.clone(),
15091 })
15092 }
15093 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15099 let mut query = self.selection.select("stop");
15100 if let Some(kill) = opts.kill {
15101 query = query.arg("kill", kill);
15102 }
15103 let id: Id = query.execute(self.graphql_client.clone()).await?;
15104 Ok(Service {
15105 proc: self.proc.clone(),
15106 selection: query
15107 .root()
15108 .select("node")
15109 .arg("id", &id.0)
15110 .inline_fragment("Service"),
15111 graphql_client: self.graphql_client.clone(),
15112 })
15113 }
15114 pub async fn sync(&self) -> Result<Service, DaggerError> {
15116 let query = self.selection.select("sync");
15117 let id: Id = query.execute(self.graphql_client.clone()).await?;
15118 Ok(Service {
15119 proc: self.proc.clone(),
15120 selection: query
15121 .root()
15122 .select("node")
15123 .arg("id", &id.0)
15124 .inline_fragment("Service"),
15125 graphql_client: self.graphql_client.clone(),
15126 })
15127 }
15128 pub fn terminal(&self) -> Service {
15133 let query = self.selection.select("terminal");
15134 Service {
15135 proc: self.proc.clone(),
15136 selection: query,
15137 graphql_client: self.graphql_client.clone(),
15138 }
15139 }
15140 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15145 let mut query = self.selection.select("terminal");
15146 if let Some(cmd) = opts.cmd {
15147 query = query.arg("cmd", cmd);
15148 }
15149 Service {
15150 proc: self.proc.clone(),
15151 selection: query,
15152 graphql_client: self.graphql_client.clone(),
15153 }
15154 }
15155 pub async fn up(&self) -> Result<Void, DaggerError> {
15161 let query = self.selection.select("up");
15162 query.execute(self.graphql_client.clone()).await
15163 }
15164 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15170 let mut query = self.selection.select("up");
15171 if let Some(ports) = opts.ports {
15172 query = query.arg("ports", ports);
15173 }
15174 if let Some(random) = opts.random {
15175 query = query.arg("random", random);
15176 }
15177 query.execute(self.graphql_client.clone()).await
15178 }
15179 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15185 let mut query = self.selection.select("withHostname");
15186 query = query.arg("hostname", hostname.into());
15187 Service {
15188 proc: self.proc.clone(),
15189 selection: query,
15190 graphql_client: self.graphql_client.clone(),
15191 }
15192 }
15193}
15194impl Node for Service {
15195 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15196 let query = self.selection.select("id");
15197 let graphql_client = self.graphql_client.clone();
15198 async move { query.execute(graphql_client).await }
15199 }
15200}
15201impl Syncer for Service {
15202 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15203 let query = self.selection.select("id");
15204 let graphql_client = self.graphql_client.clone();
15205 async move { query.execute(graphql_client).await }
15206 }
15207 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15208 let query = self.selection.select("sync");
15209 let graphql_client = self.graphql_client.clone();
15210 async move { query.execute(graphql_client).await }
15211 }
15212}
15213#[derive(Clone)]
15214pub struct Socket {
15215 pub proc: Option<Arc<DaggerSessionProc>>,
15216 pub selection: Selection,
15217 pub graphql_client: DynGraphQLClient,
15218}
15219impl IntoID<Id> for Socket {
15220 fn into_id(
15221 self,
15222 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15223 Box::pin(async move { self.id().await })
15224 }
15225}
15226impl Loadable for Socket {
15227 fn graphql_type() -> &'static str {
15228 "Socket"
15229 }
15230 fn from_query(
15231 proc: Option<Arc<DaggerSessionProc>>,
15232 selection: Selection,
15233 graphql_client: DynGraphQLClient,
15234 ) -> Self {
15235 Self {
15236 proc,
15237 selection,
15238 graphql_client,
15239 }
15240 }
15241}
15242impl Socket {
15243 pub async fn id(&self) -> Result<Id, DaggerError> {
15245 let query = self.selection.select("id");
15246 query.execute(self.graphql_client.clone()).await
15247 }
15248}
15249impl Node for Socket {
15250 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15251 let query = self.selection.select("id");
15252 let graphql_client = self.graphql_client.clone();
15253 async move { query.execute(graphql_client).await }
15254 }
15255}
15256#[derive(Clone)]
15257pub struct SourceMap {
15258 pub proc: Option<Arc<DaggerSessionProc>>,
15259 pub selection: Selection,
15260 pub graphql_client: DynGraphQLClient,
15261}
15262impl IntoID<Id> for SourceMap {
15263 fn into_id(
15264 self,
15265 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15266 Box::pin(async move { self.id().await })
15267 }
15268}
15269impl Loadable for SourceMap {
15270 fn graphql_type() -> &'static str {
15271 "SourceMap"
15272 }
15273 fn from_query(
15274 proc: Option<Arc<DaggerSessionProc>>,
15275 selection: Selection,
15276 graphql_client: DynGraphQLClient,
15277 ) -> Self {
15278 Self {
15279 proc,
15280 selection,
15281 graphql_client,
15282 }
15283 }
15284}
15285impl SourceMap {
15286 pub async fn column(&self) -> Result<isize, DaggerError> {
15288 let query = self.selection.select("column");
15289 query.execute(self.graphql_client.clone()).await
15290 }
15291 pub async fn filename(&self) -> Result<String, DaggerError> {
15293 let query = self.selection.select("filename");
15294 query.execute(self.graphql_client.clone()).await
15295 }
15296 pub async fn id(&self) -> Result<Id, DaggerError> {
15298 let query = self.selection.select("id");
15299 query.execute(self.graphql_client.clone()).await
15300 }
15301 pub async fn line(&self) -> Result<isize, DaggerError> {
15303 let query = self.selection.select("line");
15304 query.execute(self.graphql_client.clone()).await
15305 }
15306 pub async fn module(&self) -> Result<String, DaggerError> {
15308 let query = self.selection.select("module");
15309 query.execute(self.graphql_client.clone()).await
15310 }
15311 pub async fn url(&self) -> Result<String, DaggerError> {
15313 let query = self.selection.select("url");
15314 query.execute(self.graphql_client.clone()).await
15315 }
15316}
15317impl Node for SourceMap {
15318 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15319 let query = self.selection.select("id");
15320 let graphql_client = self.graphql_client.clone();
15321 async move { query.execute(graphql_client).await }
15322 }
15323}
15324#[derive(Clone)]
15325pub struct Stat {
15326 pub proc: Option<Arc<DaggerSessionProc>>,
15327 pub selection: Selection,
15328 pub graphql_client: DynGraphQLClient,
15329}
15330impl IntoID<Id> for Stat {
15331 fn into_id(
15332 self,
15333 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15334 Box::pin(async move { self.id().await })
15335 }
15336}
15337impl Loadable for Stat {
15338 fn graphql_type() -> &'static str {
15339 "Stat"
15340 }
15341 fn from_query(
15342 proc: Option<Arc<DaggerSessionProc>>,
15343 selection: Selection,
15344 graphql_client: DynGraphQLClient,
15345 ) -> Self {
15346 Self {
15347 proc,
15348 selection,
15349 graphql_client,
15350 }
15351 }
15352}
15353impl Stat {
15354 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15356 let query = self.selection.select("fileType");
15357 query.execute(self.graphql_client.clone()).await
15358 }
15359 pub async fn id(&self) -> Result<Id, DaggerError> {
15361 let query = self.selection.select("id");
15362 query.execute(self.graphql_client.clone()).await
15363 }
15364 pub async fn name(&self) -> Result<String, DaggerError> {
15366 let query = self.selection.select("name");
15367 query.execute(self.graphql_client.clone()).await
15368 }
15369 pub async fn permissions(&self) -> Result<isize, DaggerError> {
15371 let query = self.selection.select("permissions");
15372 query.execute(self.graphql_client.clone()).await
15373 }
15374 pub async fn size(&self) -> Result<isize, DaggerError> {
15376 let query = self.selection.select("size");
15377 query.execute(self.graphql_client.clone()).await
15378 }
15379}
15380impl Node for Stat {
15381 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15382 let query = self.selection.select("id");
15383 let graphql_client = self.graphql_client.clone();
15384 async move { query.execute(graphql_client).await }
15385 }
15386}
15387#[derive(Clone)]
15388pub struct Terminal {
15389 pub proc: Option<Arc<DaggerSessionProc>>,
15390 pub selection: Selection,
15391 pub graphql_client: DynGraphQLClient,
15392}
15393impl IntoID<Id> for Terminal {
15394 fn into_id(
15395 self,
15396 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15397 Box::pin(async move { self.id().await })
15398 }
15399}
15400impl Loadable for Terminal {
15401 fn graphql_type() -> &'static str {
15402 "Terminal"
15403 }
15404 fn from_query(
15405 proc: Option<Arc<DaggerSessionProc>>,
15406 selection: Selection,
15407 graphql_client: DynGraphQLClient,
15408 ) -> Self {
15409 Self {
15410 proc,
15411 selection,
15412 graphql_client,
15413 }
15414 }
15415}
15416impl Terminal {
15417 pub async fn id(&self) -> Result<Id, DaggerError> {
15419 let query = self.selection.select("id");
15420 query.execute(self.graphql_client.clone()).await
15421 }
15422 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15425 let query = self.selection.select("sync");
15426 let id: Id = query.execute(self.graphql_client.clone()).await?;
15427 Ok(Terminal {
15428 proc: self.proc.clone(),
15429 selection: query
15430 .root()
15431 .select("node")
15432 .arg("id", &id.0)
15433 .inline_fragment("Terminal"),
15434 graphql_client: self.graphql_client.clone(),
15435 })
15436 }
15437}
15438impl Node for Terminal {
15439 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15440 let query = self.selection.select("id");
15441 let graphql_client = self.graphql_client.clone();
15442 async move { query.execute(graphql_client).await }
15443 }
15444}
15445impl Syncer for Terminal {
15446 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15447 let query = self.selection.select("id");
15448 let graphql_client = self.graphql_client.clone();
15449 async move { query.execute(graphql_client).await }
15450 }
15451 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15452 let query = self.selection.select("sync");
15453 let graphql_client = self.graphql_client.clone();
15454 async move { query.execute(graphql_client).await }
15455 }
15456}
15457#[derive(Clone)]
15458pub struct TypeDef {
15459 pub proc: Option<Arc<DaggerSessionProc>>,
15460 pub selection: Selection,
15461 pub graphql_client: DynGraphQLClient,
15462}
15463#[derive(Builder, Debug, PartialEq)]
15464pub struct TypeDefWithEnumOpts<'a> {
15465 #[builder(setter(into, strip_option), default)]
15467 pub description: Option<&'a str>,
15468 #[builder(setter(into, strip_option), default)]
15470 pub source_map: Option<Id>,
15471}
15472#[derive(Builder, Debug, PartialEq)]
15473pub struct TypeDefWithEnumMemberOpts<'a> {
15474 #[builder(setter(into, strip_option), default)]
15476 pub deprecated: Option<&'a str>,
15477 #[builder(setter(into, strip_option), default)]
15479 pub description: Option<&'a str>,
15480 #[builder(setter(into, strip_option), default)]
15482 pub source_map: Option<Id>,
15483 #[builder(setter(into, strip_option), default)]
15485 pub value: Option<&'a str>,
15486}
15487#[derive(Builder, Debug, PartialEq)]
15488pub struct TypeDefWithEnumValueOpts<'a> {
15489 #[builder(setter(into, strip_option), default)]
15491 pub deprecated: Option<&'a str>,
15492 #[builder(setter(into, strip_option), default)]
15494 pub description: Option<&'a str>,
15495 #[builder(setter(into, strip_option), default)]
15497 pub source_map: Option<Id>,
15498}
15499#[derive(Builder, Debug, PartialEq)]
15500pub struct TypeDefWithFieldOpts<'a> {
15501 #[builder(setter(into, strip_option), default)]
15503 pub deprecated: Option<&'a str>,
15504 #[builder(setter(into, strip_option), default)]
15506 pub description: Option<&'a str>,
15507 #[builder(setter(into, strip_option), default)]
15509 pub source_map: Option<Id>,
15510}
15511#[derive(Builder, Debug, PartialEq)]
15512pub struct TypeDefWithInterfaceOpts<'a> {
15513 #[builder(setter(into, strip_option), default)]
15514 pub description: Option<&'a str>,
15515 #[builder(setter(into, strip_option), default)]
15516 pub source_map: Option<Id>,
15517}
15518#[derive(Builder, Debug, PartialEq)]
15519pub struct TypeDefWithObjectOpts<'a> {
15520 #[builder(setter(into, strip_option), default)]
15521 pub deprecated: Option<&'a str>,
15522 #[builder(setter(into, strip_option), default)]
15523 pub description: Option<&'a str>,
15524 #[builder(setter(into, strip_option), default)]
15525 pub source_map: Option<Id>,
15526}
15527#[derive(Builder, Debug, PartialEq)]
15528pub struct TypeDefWithScalarOpts<'a> {
15529 #[builder(setter(into, strip_option), default)]
15530 pub description: Option<&'a str>,
15531}
15532impl IntoID<Id> for TypeDef {
15533 fn into_id(
15534 self,
15535 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15536 Box::pin(async move { self.id().await })
15537 }
15538}
15539impl Loadable for TypeDef {
15540 fn graphql_type() -> &'static str {
15541 "TypeDef"
15542 }
15543 fn from_query(
15544 proc: Option<Arc<DaggerSessionProc>>,
15545 selection: Selection,
15546 graphql_client: DynGraphQLClient,
15547 ) -> Self {
15548 Self {
15549 proc,
15550 selection,
15551 graphql_client,
15552 }
15553 }
15554}
15555impl TypeDef {
15556 pub fn as_enum(&self) -> EnumTypeDef {
15558 let query = self.selection.select("asEnum");
15559 EnumTypeDef {
15560 proc: self.proc.clone(),
15561 selection: query,
15562 graphql_client: self.graphql_client.clone(),
15563 }
15564 }
15565 pub fn as_input(&self) -> InputTypeDef {
15567 let query = self.selection.select("asInput");
15568 InputTypeDef {
15569 proc: self.proc.clone(),
15570 selection: query,
15571 graphql_client: self.graphql_client.clone(),
15572 }
15573 }
15574 pub fn as_interface(&self) -> InterfaceTypeDef {
15576 let query = self.selection.select("asInterface");
15577 InterfaceTypeDef {
15578 proc: self.proc.clone(),
15579 selection: query,
15580 graphql_client: self.graphql_client.clone(),
15581 }
15582 }
15583 pub fn as_list(&self) -> ListTypeDef {
15585 let query = self.selection.select("asList");
15586 ListTypeDef {
15587 proc: self.proc.clone(),
15588 selection: query,
15589 graphql_client: self.graphql_client.clone(),
15590 }
15591 }
15592 pub fn as_object(&self) -> ObjectTypeDef {
15594 let query = self.selection.select("asObject");
15595 ObjectTypeDef {
15596 proc: self.proc.clone(),
15597 selection: query,
15598 graphql_client: self.graphql_client.clone(),
15599 }
15600 }
15601 pub fn as_scalar(&self) -> ScalarTypeDef {
15603 let query = self.selection.select("asScalar");
15604 ScalarTypeDef {
15605 proc: self.proc.clone(),
15606 selection: query,
15607 graphql_client: self.graphql_client.clone(),
15608 }
15609 }
15610 pub async fn id(&self) -> Result<Id, DaggerError> {
15612 let query = self.selection.select("id");
15613 query.execute(self.graphql_client.clone()).await
15614 }
15615 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15617 let query = self.selection.select("kind");
15618 query.execute(self.graphql_client.clone()).await
15619 }
15620 pub async fn name(&self) -> Result<String, DaggerError> {
15622 let query = self.selection.select("name");
15623 query.execute(self.graphql_client.clone()).await
15624 }
15625 pub async fn optional(&self) -> Result<bool, DaggerError> {
15627 let query = self.selection.select("optional");
15628 query.execute(self.graphql_client.clone()).await
15629 }
15630 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15632 let mut query = self.selection.select("withConstructor");
15633 query = query.arg_lazy(
15634 "function",
15635 Box::new(move || {
15636 let function = function.clone();
15637 Box::pin(async move { function.into_id().await.unwrap().quote() })
15638 }),
15639 );
15640 TypeDef {
15641 proc: self.proc.clone(),
15642 selection: query,
15643 graphql_client: self.graphql_client.clone(),
15644 }
15645 }
15646 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15654 let mut query = self.selection.select("withEnum");
15655 query = query.arg("name", name.into());
15656 TypeDef {
15657 proc: self.proc.clone(),
15658 selection: query,
15659 graphql_client: self.graphql_client.clone(),
15660 }
15661 }
15662 pub fn with_enum_opts<'a>(
15670 &self,
15671 name: impl Into<String>,
15672 opts: TypeDefWithEnumOpts<'a>,
15673 ) -> TypeDef {
15674 let mut query = self.selection.select("withEnum");
15675 query = query.arg("name", name.into());
15676 if let Some(description) = opts.description {
15677 query = query.arg("description", description);
15678 }
15679 if let Some(source_map) = opts.source_map {
15680 query = query.arg("sourceMap", source_map);
15681 }
15682 TypeDef {
15683 proc: self.proc.clone(),
15684 selection: query,
15685 graphql_client: self.graphql_client.clone(),
15686 }
15687 }
15688 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15695 let mut query = self.selection.select("withEnumMember");
15696 query = query.arg("name", name.into());
15697 TypeDef {
15698 proc: self.proc.clone(),
15699 selection: query,
15700 graphql_client: self.graphql_client.clone(),
15701 }
15702 }
15703 pub fn with_enum_member_opts<'a>(
15710 &self,
15711 name: impl Into<String>,
15712 opts: TypeDefWithEnumMemberOpts<'a>,
15713 ) -> TypeDef {
15714 let mut query = self.selection.select("withEnumMember");
15715 query = query.arg("name", name.into());
15716 if let Some(value) = opts.value {
15717 query = query.arg("value", value);
15718 }
15719 if let Some(description) = opts.description {
15720 query = query.arg("description", description);
15721 }
15722 if let Some(source_map) = opts.source_map {
15723 query = query.arg("sourceMap", source_map);
15724 }
15725 if let Some(deprecated) = opts.deprecated {
15726 query = query.arg("deprecated", deprecated);
15727 }
15728 TypeDef {
15729 proc: self.proc.clone(),
15730 selection: query,
15731 graphql_client: self.graphql_client.clone(),
15732 }
15733 }
15734 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15741 let mut query = self.selection.select("withEnumValue");
15742 query = query.arg("value", value.into());
15743 TypeDef {
15744 proc: self.proc.clone(),
15745 selection: query,
15746 graphql_client: self.graphql_client.clone(),
15747 }
15748 }
15749 pub fn with_enum_value_opts<'a>(
15756 &self,
15757 value: impl Into<String>,
15758 opts: TypeDefWithEnumValueOpts<'a>,
15759 ) -> TypeDef {
15760 let mut query = self.selection.select("withEnumValue");
15761 query = query.arg("value", value.into());
15762 if let Some(description) = opts.description {
15763 query = query.arg("description", description);
15764 }
15765 if let Some(source_map) = opts.source_map {
15766 query = query.arg("sourceMap", source_map);
15767 }
15768 if let Some(deprecated) = opts.deprecated {
15769 query = query.arg("deprecated", deprecated);
15770 }
15771 TypeDef {
15772 proc: self.proc.clone(),
15773 selection: query,
15774 graphql_client: self.graphql_client.clone(),
15775 }
15776 }
15777 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
15785 let mut query = self.selection.select("withField");
15786 query = query.arg("name", name.into());
15787 query = query.arg_lazy(
15788 "typeDef",
15789 Box::new(move || {
15790 let type_def = type_def.clone();
15791 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15792 }),
15793 );
15794 TypeDef {
15795 proc: self.proc.clone(),
15796 selection: query,
15797 graphql_client: self.graphql_client.clone(),
15798 }
15799 }
15800 pub fn with_field_opts<'a>(
15808 &self,
15809 name: impl Into<String>,
15810 type_def: impl IntoID<Id>,
15811 opts: TypeDefWithFieldOpts<'a>,
15812 ) -> TypeDef {
15813 let mut query = self.selection.select("withField");
15814 query = query.arg("name", name.into());
15815 query = query.arg_lazy(
15816 "typeDef",
15817 Box::new(move || {
15818 let type_def = type_def.clone();
15819 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15820 }),
15821 );
15822 if let Some(description) = opts.description {
15823 query = query.arg("description", description);
15824 }
15825 if let Some(source_map) = opts.source_map {
15826 query = query.arg("sourceMap", source_map);
15827 }
15828 if let Some(deprecated) = opts.deprecated {
15829 query = query.arg("deprecated", deprecated);
15830 }
15831 TypeDef {
15832 proc: self.proc.clone(),
15833 selection: query,
15834 graphql_client: self.graphql_client.clone(),
15835 }
15836 }
15837 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15839 let mut query = self.selection.select("withFunction");
15840 query = query.arg_lazy(
15841 "function",
15842 Box::new(move || {
15843 let function = function.clone();
15844 Box::pin(async move { function.into_id().await.unwrap().quote() })
15845 }),
15846 );
15847 TypeDef {
15848 proc: self.proc.clone(),
15849 selection: query,
15850 graphql_client: self.graphql_client.clone(),
15851 }
15852 }
15853 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15859 let mut query = self.selection.select("withInterface");
15860 query = query.arg("name", name.into());
15861 TypeDef {
15862 proc: self.proc.clone(),
15863 selection: query,
15864 graphql_client: self.graphql_client.clone(),
15865 }
15866 }
15867 pub fn with_interface_opts<'a>(
15873 &self,
15874 name: impl Into<String>,
15875 opts: TypeDefWithInterfaceOpts<'a>,
15876 ) -> TypeDef {
15877 let mut query = self.selection.select("withInterface");
15878 query = query.arg("name", name.into());
15879 if let Some(description) = opts.description {
15880 query = query.arg("description", description);
15881 }
15882 if let Some(source_map) = opts.source_map {
15883 query = query.arg("sourceMap", source_map);
15884 }
15885 TypeDef {
15886 proc: self.proc.clone(),
15887 selection: query,
15888 graphql_client: self.graphql_client.clone(),
15889 }
15890 }
15891 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15893 let mut query = self.selection.select("withKind");
15894 query = query.arg("kind", kind);
15895 TypeDef {
15896 proc: self.proc.clone(),
15897 selection: query,
15898 graphql_client: self.graphql_client.clone(),
15899 }
15900 }
15901 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15903 let mut query = self.selection.select("withListOf");
15904 query = query.arg_lazy(
15905 "elementType",
15906 Box::new(move || {
15907 let element_type = element_type.clone();
15908 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15909 }),
15910 );
15911 TypeDef {
15912 proc: self.proc.clone(),
15913 selection: query,
15914 graphql_client: self.graphql_client.clone(),
15915 }
15916 }
15917 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15924 let mut query = self.selection.select("withObject");
15925 query = query.arg("name", name.into());
15926 TypeDef {
15927 proc: self.proc.clone(),
15928 selection: query,
15929 graphql_client: self.graphql_client.clone(),
15930 }
15931 }
15932 pub fn with_object_opts<'a>(
15939 &self,
15940 name: impl Into<String>,
15941 opts: TypeDefWithObjectOpts<'a>,
15942 ) -> TypeDef {
15943 let mut query = self.selection.select("withObject");
15944 query = query.arg("name", name.into());
15945 if let Some(description) = opts.description {
15946 query = query.arg("description", description);
15947 }
15948 if let Some(source_map) = opts.source_map {
15949 query = query.arg("sourceMap", source_map);
15950 }
15951 if let Some(deprecated) = opts.deprecated {
15952 query = query.arg("deprecated", deprecated);
15953 }
15954 TypeDef {
15955 proc: self.proc.clone(),
15956 selection: query,
15957 graphql_client: self.graphql_client.clone(),
15958 }
15959 }
15960 pub fn with_optional(&self, optional: bool) -> TypeDef {
15962 let mut query = self.selection.select("withOptional");
15963 query = query.arg("optional", optional);
15964 TypeDef {
15965 proc: self.proc.clone(),
15966 selection: query,
15967 graphql_client: self.graphql_client.clone(),
15968 }
15969 }
15970 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
15976 let mut query = self.selection.select("withScalar");
15977 query = query.arg("name", name.into());
15978 TypeDef {
15979 proc: self.proc.clone(),
15980 selection: query,
15981 graphql_client: self.graphql_client.clone(),
15982 }
15983 }
15984 pub fn with_scalar_opts<'a>(
15990 &self,
15991 name: impl Into<String>,
15992 opts: TypeDefWithScalarOpts<'a>,
15993 ) -> TypeDef {
15994 let mut query = self.selection.select("withScalar");
15995 query = query.arg("name", name.into());
15996 if let Some(description) = opts.description {
15997 query = query.arg("description", description);
15998 }
15999 TypeDef {
16000 proc: self.proc.clone(),
16001 selection: query,
16002 graphql_client: self.graphql_client.clone(),
16003 }
16004 }
16005}
16006impl Node for TypeDef {
16007 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16008 let query = self.selection.select("id");
16009 let graphql_client = self.graphql_client.clone();
16010 async move { query.execute(graphql_client).await }
16011 }
16012}
16013#[derive(Clone)]
16014pub struct Up {
16015 pub proc: Option<Arc<DaggerSessionProc>>,
16016 pub selection: Selection,
16017 pub graphql_client: DynGraphQLClient,
16018}
16019impl IntoID<Id> for Up {
16020 fn into_id(
16021 self,
16022 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16023 Box::pin(async move { self.id().await })
16024 }
16025}
16026impl Loadable for Up {
16027 fn graphql_type() -> &'static str {
16028 "Up"
16029 }
16030 fn from_query(
16031 proc: Option<Arc<DaggerSessionProc>>,
16032 selection: Selection,
16033 graphql_client: DynGraphQLClient,
16034 ) -> Self {
16035 Self {
16036 proc,
16037 selection,
16038 graphql_client,
16039 }
16040 }
16041}
16042impl Up {
16043 pub async fn description(&self) -> Result<String, DaggerError> {
16045 let query = self.selection.select("description");
16046 query.execute(self.graphql_client.clone()).await
16047 }
16048 pub async fn id(&self) -> Result<Id, DaggerError> {
16050 let query = self.selection.select("id");
16051 query.execute(self.graphql_client.clone()).await
16052 }
16053 pub async fn name(&self) -> Result<String, DaggerError> {
16055 let query = self.selection.select("name");
16056 query.execute(self.graphql_client.clone()).await
16057 }
16058 pub fn original_module(&self) -> Module {
16060 let query = self.selection.select("originalModule");
16061 Module {
16062 proc: self.proc.clone(),
16063 selection: query,
16064 graphql_client: self.graphql_client.clone(),
16065 }
16066 }
16067 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16069 let query = self.selection.select("path");
16070 query.execute(self.graphql_client.clone()).await
16071 }
16072 pub fn run(&self) -> Up {
16074 let query = self.selection.select("run");
16075 Up {
16076 proc: self.proc.clone(),
16077 selection: query,
16078 graphql_client: self.graphql_client.clone(),
16079 }
16080 }
16081}
16082impl Node for Up {
16083 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16084 let query = self.selection.select("id");
16085 let graphql_client = self.graphql_client.clone();
16086 async move { query.execute(graphql_client).await }
16087 }
16088}
16089#[derive(Clone)]
16090pub struct UpGroup {
16091 pub proc: Option<Arc<DaggerSessionProc>>,
16092 pub selection: Selection,
16093 pub graphql_client: DynGraphQLClient,
16094}
16095impl IntoID<Id> for UpGroup {
16096 fn into_id(
16097 self,
16098 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16099 Box::pin(async move { self.id().await })
16100 }
16101}
16102impl Loadable for UpGroup {
16103 fn graphql_type() -> &'static str {
16104 "UpGroup"
16105 }
16106 fn from_query(
16107 proc: Option<Arc<DaggerSessionProc>>,
16108 selection: Selection,
16109 graphql_client: DynGraphQLClient,
16110 ) -> Self {
16111 Self {
16112 proc,
16113 selection,
16114 graphql_client,
16115 }
16116 }
16117}
16118impl UpGroup {
16119 pub async fn id(&self) -> Result<Id, DaggerError> {
16121 let query = self.selection.select("id");
16122 query.execute(self.graphql_client.clone()).await
16123 }
16124 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16126 let query = self.selection.select("list");
16127 let query = query.select("id");
16128 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16129 Ok(ids
16130 .into_iter()
16131 .map(|id| Up {
16132 proc: self.proc.clone(),
16133 selection: crate::querybuilder::query()
16134 .select("node")
16135 .arg("id", &id.0)
16136 .inline_fragment("Up"),
16137 graphql_client: self.graphql_client.clone(),
16138 })
16139 .collect())
16140 }
16141 pub fn run(&self) -> UpGroup {
16143 let query = self.selection.select("run");
16144 UpGroup {
16145 proc: self.proc.clone(),
16146 selection: query,
16147 graphql_client: self.graphql_client.clone(),
16148 }
16149 }
16150}
16151impl Node for UpGroup {
16152 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16153 let query = self.selection.select("id");
16154 let graphql_client = self.graphql_client.clone();
16155 async move { query.execute(graphql_client).await }
16156 }
16157}
16158#[derive(Clone)]
16159pub struct Workspace {
16160 pub proc: Option<Arc<DaggerSessionProc>>,
16161 pub selection: Selection,
16162 pub graphql_client: DynGraphQLClient,
16163}
16164#[derive(Builder, Debug, PartialEq)]
16165pub struct WorkspaceChecksOpts<'a> {
16166 #[builder(setter(into, strip_option), default)]
16168 pub include: Option<Vec<&'a str>>,
16169 #[builder(setter(into, strip_option), default)]
16171 pub no_generate: Option<bool>,
16172}
16173#[derive(Builder, Debug, PartialEq)]
16174pub struct WorkspaceDirectoryOpts<'a> {
16175 #[builder(setter(into, strip_option), default)]
16177 pub exclude: Option<Vec<&'a str>>,
16178 #[builder(setter(into, strip_option), default)]
16180 pub gitignore: Option<bool>,
16181 #[builder(setter(into, strip_option), default)]
16183 pub include: Option<Vec<&'a str>>,
16184}
16185#[derive(Builder, Debug, PartialEq)]
16186pub struct WorkspaceFindUpOpts<'a> {
16187 #[builder(setter(into, strip_option), default)]
16189 pub from: Option<&'a str>,
16190}
16191#[derive(Builder, Debug, PartialEq)]
16192pub struct WorkspaceGeneratorsOpts<'a> {
16193 #[builder(setter(into, strip_option), default)]
16195 pub include: Option<Vec<&'a str>>,
16196}
16197#[derive(Builder, Debug, PartialEq)]
16198pub struct WorkspaceServicesOpts<'a> {
16199 #[builder(setter(into, strip_option), default)]
16201 pub include: Option<Vec<&'a str>>,
16202}
16203impl IntoID<Id> for Workspace {
16204 fn into_id(
16205 self,
16206 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16207 Box::pin(async move { self.id().await })
16208 }
16209}
16210impl Loadable for Workspace {
16211 fn graphql_type() -> &'static str {
16212 "Workspace"
16213 }
16214 fn from_query(
16215 proc: Option<Arc<DaggerSessionProc>>,
16216 selection: Selection,
16217 graphql_client: DynGraphQLClient,
16218 ) -> Self {
16219 Self {
16220 proc,
16221 selection,
16222 graphql_client,
16223 }
16224 }
16225}
16226impl Workspace {
16227 pub async fn address(&self) -> Result<String, DaggerError> {
16229 let query = self.selection.select("address");
16230 query.execute(self.graphql_client.clone()).await
16231 }
16232 pub fn checks(&self) -> CheckGroup {
16238 let query = self.selection.select("checks");
16239 CheckGroup {
16240 proc: self.proc.clone(),
16241 selection: query,
16242 graphql_client: self.graphql_client.clone(),
16243 }
16244 }
16245 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16251 let mut query = self.selection.select("checks");
16252 if let Some(include) = opts.include {
16253 query = query.arg("include", include);
16254 }
16255 if let Some(no_generate) = opts.no_generate {
16256 query = query.arg("noGenerate", no_generate);
16257 }
16258 CheckGroup {
16259 proc: self.proc.clone(),
16260 selection: query,
16261 graphql_client: self.graphql_client.clone(),
16262 }
16263 }
16264 pub async fn client_id(&self) -> Result<String, DaggerError> {
16266 let query = self.selection.select("clientId");
16267 query.execute(self.graphql_client.clone()).await
16268 }
16269 pub async fn config_path(&self) -> Result<String, DaggerError> {
16271 let query = self.selection.select("configPath");
16272 query.execute(self.graphql_client.clone()).await
16273 }
16274 pub fn directory(&self, path: impl Into<String>) -> Directory {
16282 let mut query = self.selection.select("directory");
16283 query = query.arg("path", path.into());
16284 Directory {
16285 proc: self.proc.clone(),
16286 selection: query,
16287 graphql_client: self.graphql_client.clone(),
16288 }
16289 }
16290 pub fn directory_opts<'a>(
16298 &self,
16299 path: impl Into<String>,
16300 opts: WorkspaceDirectoryOpts<'a>,
16301 ) -> Directory {
16302 let mut query = self.selection.select("directory");
16303 query = query.arg("path", path.into());
16304 if let Some(exclude) = opts.exclude {
16305 query = query.arg("exclude", exclude);
16306 }
16307 if let Some(include) = opts.include {
16308 query = query.arg("include", include);
16309 }
16310 if let Some(gitignore) = opts.gitignore {
16311 query = query.arg("gitignore", gitignore);
16312 }
16313 Directory {
16314 proc: self.proc.clone(),
16315 selection: query,
16316 graphql_client: self.graphql_client.clone(),
16317 }
16318 }
16319 pub fn file(&self, path: impl Into<String>) -> File {
16326 let mut query = self.selection.select("file");
16327 query = query.arg("path", path.into());
16328 File {
16329 proc: self.proc.clone(),
16330 selection: query,
16331 graphql_client: self.graphql_client.clone(),
16332 }
16333 }
16334 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16344 let mut query = self.selection.select("findUp");
16345 query = query.arg("name", name.into());
16346 query.execute(self.graphql_client.clone()).await
16347 }
16348 pub async fn find_up_opts<'a>(
16358 &self,
16359 name: impl Into<String>,
16360 opts: WorkspaceFindUpOpts<'a>,
16361 ) -> Result<String, DaggerError> {
16362 let mut query = self.selection.select("findUp");
16363 query = query.arg("name", name.into());
16364 if let Some(from) = opts.from {
16365 query = query.arg("from", from);
16366 }
16367 query.execute(self.graphql_client.clone()).await
16368 }
16369 pub fn generators(&self) -> GeneratorGroup {
16375 let query = self.selection.select("generators");
16376 GeneratorGroup {
16377 proc: self.proc.clone(),
16378 selection: query,
16379 graphql_client: self.graphql_client.clone(),
16380 }
16381 }
16382 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16388 let mut query = self.selection.select("generators");
16389 if let Some(include) = opts.include {
16390 query = query.arg("include", include);
16391 }
16392 GeneratorGroup {
16393 proc: self.proc.clone(),
16394 selection: query,
16395 graphql_client: self.graphql_client.clone(),
16396 }
16397 }
16398 pub async fn has_config(&self) -> Result<bool, DaggerError> {
16400 let query = self.selection.select("hasConfig");
16401 query.execute(self.graphql_client.clone()).await
16402 }
16403 pub async fn id(&self) -> Result<Id, DaggerError> {
16405 let query = self.selection.select("id");
16406 query.execute(self.graphql_client.clone()).await
16407 }
16408 pub async fn initialized(&self) -> Result<bool, DaggerError> {
16410 let query = self.selection.select("initialized");
16411 query.execute(self.graphql_client.clone()).await
16412 }
16413 pub async fn path(&self) -> Result<String, DaggerError> {
16415 let query = self.selection.select("path");
16416 query.execute(self.graphql_client.clone()).await
16417 }
16418 pub fn services(&self) -> UpGroup {
16424 let query = self.selection.select("services");
16425 UpGroup {
16426 proc: self.proc.clone(),
16427 selection: query,
16428 graphql_client: self.graphql_client.clone(),
16429 }
16430 }
16431 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16437 let mut query = self.selection.select("services");
16438 if let Some(include) = opts.include {
16439 query = query.arg("include", include);
16440 }
16441 UpGroup {
16442 proc: self.proc.clone(),
16443 selection: query,
16444 graphql_client: self.graphql_client.clone(),
16445 }
16446 }
16447 pub fn update(&self) -> Changeset {
16450 let query = self.selection.select("update");
16451 Changeset {
16452 proc: self.proc.clone(),
16453 selection: query,
16454 graphql_client: self.graphql_client.clone(),
16455 }
16456 }
16457}
16458impl Node for Workspace {
16459 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16460 let query = self.selection.select("id");
16461 let graphql_client = self.graphql_client.clone();
16462 async move { query.execute(graphql_client).await }
16463 }
16464}
16465#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16466pub enum CacheSharingMode {
16467 #[serde(rename = "LOCKED")]
16468 Locked,
16469 #[serde(rename = "PRIVATE")]
16470 Private,
16471 #[serde(rename = "SHARED")]
16472 Shared,
16473}
16474#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16475pub enum ChangesetMergeConflict {
16476 #[serde(rename = "FAIL")]
16477 Fail,
16478 #[serde(rename = "FAIL_EARLY")]
16479 FailEarly,
16480 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16481 LeaveConflictMarkers,
16482 #[serde(rename = "PREFER_OURS")]
16483 PreferOurs,
16484 #[serde(rename = "PREFER_THEIRS")]
16485 PreferTheirs,
16486}
16487#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16488pub enum ChangesetsMergeConflict {
16489 #[serde(rename = "FAIL")]
16490 Fail,
16491 #[serde(rename = "FAIL_EARLY")]
16492 FailEarly,
16493}
16494#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16495pub enum DiffStatKind {
16496 #[serde(rename = "ADDED")]
16497 Added,
16498 #[serde(rename = "MODIFIED")]
16499 Modified,
16500 #[serde(rename = "REMOVED")]
16501 Removed,
16502 #[serde(rename = "RENAMED")]
16503 Renamed,
16504}
16505#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16506pub enum ExistsType {
16507 #[serde(rename = "DIRECTORY_TYPE")]
16508 DirectoryType,
16509 #[serde(rename = "REGULAR_TYPE")]
16510 RegularType,
16511 #[serde(rename = "SYMLINK_TYPE")]
16512 SymlinkType,
16513}
16514#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16515pub enum FileType {
16516 #[serde(rename = "DIRECTORY")]
16517 Directory,
16518 #[serde(rename = "DIRECTORY_TYPE")]
16519 DirectoryType,
16520 #[serde(rename = "REGULAR")]
16521 Regular,
16522 #[serde(rename = "REGULAR_TYPE")]
16523 RegularType,
16524 #[serde(rename = "SYMLINK")]
16525 Symlink,
16526 #[serde(rename = "SYMLINK_TYPE")]
16527 SymlinkType,
16528 #[serde(rename = "UNKNOWN")]
16529 Unknown,
16530}
16531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16532pub enum FunctionCachePolicy {
16533 #[serde(rename = "Default")]
16534 Default,
16535 #[serde(rename = "Never")]
16536 Never,
16537 #[serde(rename = "PerSession")]
16538 PerSession,
16539}
16540#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16541pub enum ImageLayerCompression {
16542 #[serde(rename = "EStarGZ")]
16543 EStarGz,
16544 #[serde(rename = "ESTARGZ")]
16545 Estargz,
16546 #[serde(rename = "Gzip")]
16547 Gzip,
16548 #[serde(rename = "Uncompressed")]
16549 Uncompressed,
16550 #[serde(rename = "Zstd")]
16551 Zstd,
16552}
16553#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16554pub enum ImageMediaTypes {
16555 #[serde(rename = "DOCKER")]
16556 Docker,
16557 #[serde(rename = "DockerMediaTypes")]
16558 DockerMediaTypes,
16559 #[serde(rename = "OCI")]
16560 Oci,
16561 #[serde(rename = "OCIMediaTypes")]
16562 OciMediaTypes,
16563}
16564#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16565pub enum ModuleSourceExperimentalFeature {
16566 #[serde(rename = "SELF_CALLS")]
16567 SelfCalls,
16568}
16569#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16570pub enum ModuleSourceKind {
16571 #[serde(rename = "DIR")]
16572 Dir,
16573 #[serde(rename = "DIR_SOURCE")]
16574 DirSource,
16575 #[serde(rename = "GIT")]
16576 Git,
16577 #[serde(rename = "GIT_SOURCE")]
16578 GitSource,
16579 #[serde(rename = "LOCAL")]
16580 Local,
16581 #[serde(rename = "LOCAL_SOURCE")]
16582 LocalSource,
16583}
16584#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16585pub enum NetworkProtocol {
16586 #[serde(rename = "TCP")]
16587 Tcp,
16588 #[serde(rename = "UDP")]
16589 Udp,
16590}
16591#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16592pub enum ReturnType {
16593 #[serde(rename = "ANY")]
16594 Any,
16595 #[serde(rename = "FAILURE")]
16596 Failure,
16597 #[serde(rename = "SUCCESS")]
16598 Success,
16599}
16600#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16601pub enum TypeDefKind {
16602 #[serde(rename = "BOOLEAN")]
16603 Boolean,
16604 #[serde(rename = "BOOLEAN_KIND")]
16605 BooleanKind,
16606 #[serde(rename = "ENUM")]
16607 Enum,
16608 #[serde(rename = "ENUM_KIND")]
16609 EnumKind,
16610 #[serde(rename = "FLOAT")]
16611 Float,
16612 #[serde(rename = "FLOAT_KIND")]
16613 FloatKind,
16614 #[serde(rename = "INPUT")]
16615 Input,
16616 #[serde(rename = "INPUT_KIND")]
16617 InputKind,
16618 #[serde(rename = "INTEGER")]
16619 Integer,
16620 #[serde(rename = "INTEGER_KIND")]
16621 IntegerKind,
16622 #[serde(rename = "INTERFACE")]
16623 Interface,
16624 #[serde(rename = "INTERFACE_KIND")]
16625 InterfaceKind,
16626 #[serde(rename = "LIST")]
16627 List,
16628 #[serde(rename = "LIST_KIND")]
16629 ListKind,
16630 #[serde(rename = "OBJECT")]
16631 Object,
16632 #[serde(rename = "OBJECT_KIND")]
16633 ObjectKind,
16634 #[serde(rename = "SCALAR")]
16635 Scalar,
16636 #[serde(rename = "SCALAR_KIND")]
16637 ScalarKind,
16638 #[serde(rename = "STRING")]
16639 String,
16640 #[serde(rename = "STRING_KIND")]
16641 StringKind,
16642 #[serde(rename = "VOID")]
16643 Void,
16644 #[serde(rename = "VOID_KIND")]
16645 VoidKind,
16646}