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_volatile_variable(
3806 &self,
3807 name: impl Into<String>,
3808 value: impl Into<String>,
3809 ) -> Container {
3810 let mut query = self.selection.select("withVolatileVariable");
3811 query = query.arg("name", name.into());
3812 query = query.arg("value", value.into());
3813 Container {
3814 proc: self.proc.clone(),
3815 selection: query,
3816 graphql_client: self.graphql_client.clone(),
3817 }
3818 }
3819 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3826 let mut query = self.selection.select("withWorkdir");
3827 query = query.arg("path", path.into());
3828 Container {
3829 proc: self.proc.clone(),
3830 selection: query,
3831 graphql_client: self.graphql_client.clone(),
3832 }
3833 }
3834 pub fn with_workdir_opts(
3841 &self,
3842 path: impl Into<String>,
3843 opts: ContainerWithWorkdirOpts,
3844 ) -> Container {
3845 let mut query = self.selection.select("withWorkdir");
3846 query = query.arg("path", path.into());
3847 if let Some(expand) = opts.expand {
3848 query = query.arg("expand", expand);
3849 }
3850 Container {
3851 proc: self.proc.clone(),
3852 selection: query,
3853 graphql_client: self.graphql_client.clone(),
3854 }
3855 }
3856 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3862 let mut query = self.selection.select("withoutAnnotation");
3863 query = query.arg("name", name.into());
3864 Container {
3865 proc: self.proc.clone(),
3866 selection: query,
3867 graphql_client: self.graphql_client.clone(),
3868 }
3869 }
3870 pub fn without_default_args(&self) -> Container {
3872 let query = self.selection.select("withoutDefaultArgs");
3873 Container {
3874 proc: self.proc.clone(),
3875 selection: query,
3876 graphql_client: self.graphql_client.clone(),
3877 }
3878 }
3879 pub fn without_directory(&self, path: impl Into<String>) -> Container {
3886 let mut query = self.selection.select("withoutDirectory");
3887 query = query.arg("path", path.into());
3888 Container {
3889 proc: self.proc.clone(),
3890 selection: query,
3891 graphql_client: self.graphql_client.clone(),
3892 }
3893 }
3894 pub fn without_directory_opts(
3901 &self,
3902 path: impl Into<String>,
3903 opts: ContainerWithoutDirectoryOpts,
3904 ) -> Container {
3905 let mut query = self.selection.select("withoutDirectory");
3906 query = query.arg("path", path.into());
3907 if let Some(expand) = opts.expand {
3908 query = query.arg("expand", expand);
3909 }
3910 Container {
3911 proc: self.proc.clone(),
3912 selection: query,
3913 graphql_client: self.graphql_client.clone(),
3914 }
3915 }
3916 pub fn without_docker_healthcheck(&self) -> Container {
3918 let query = self.selection.select("withoutDockerHealthcheck");
3919 Container {
3920 proc: self.proc.clone(),
3921 selection: query,
3922 graphql_client: self.graphql_client.clone(),
3923 }
3924 }
3925 pub fn without_entrypoint(&self) -> Container {
3931 let query = self.selection.select("withoutEntrypoint");
3932 Container {
3933 proc: self.proc.clone(),
3934 selection: query,
3935 graphql_client: self.graphql_client.clone(),
3936 }
3937 }
3938 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3944 let mut query = self.selection.select("withoutEntrypoint");
3945 if let Some(keep_default_args) = opts.keep_default_args {
3946 query = query.arg("keepDefaultArgs", keep_default_args);
3947 }
3948 Container {
3949 proc: self.proc.clone(),
3950 selection: query,
3951 graphql_client: self.graphql_client.clone(),
3952 }
3953 }
3954 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3960 let mut query = self.selection.select("withoutEnvVariable");
3961 query = query.arg("name", name.into());
3962 Container {
3963 proc: self.proc.clone(),
3964 selection: query,
3965 graphql_client: self.graphql_client.clone(),
3966 }
3967 }
3968 pub fn without_exposed_port(&self, port: isize) -> Container {
3975 let mut query = self.selection.select("withoutExposedPort");
3976 query = query.arg("port", port);
3977 Container {
3978 proc: self.proc.clone(),
3979 selection: query,
3980 graphql_client: self.graphql_client.clone(),
3981 }
3982 }
3983 pub fn without_exposed_port_opts(
3990 &self,
3991 port: isize,
3992 opts: ContainerWithoutExposedPortOpts,
3993 ) -> Container {
3994 let mut query = self.selection.select("withoutExposedPort");
3995 query = query.arg("port", port);
3996 if let Some(protocol) = opts.protocol {
3997 query = query.arg("protocol", protocol);
3998 }
3999 Container {
4000 proc: self.proc.clone(),
4001 selection: query,
4002 graphql_client: self.graphql_client.clone(),
4003 }
4004 }
4005 pub fn without_file(&self, path: impl Into<String>) -> Container {
4012 let mut query = self.selection.select("withoutFile");
4013 query = query.arg("path", path.into());
4014 Container {
4015 proc: self.proc.clone(),
4016 selection: query,
4017 graphql_client: self.graphql_client.clone(),
4018 }
4019 }
4020 pub fn without_file_opts(
4027 &self,
4028 path: impl Into<String>,
4029 opts: ContainerWithoutFileOpts,
4030 ) -> Container {
4031 let mut query = self.selection.select("withoutFile");
4032 query = query.arg("path", path.into());
4033 if let Some(expand) = opts.expand {
4034 query = query.arg("expand", expand);
4035 }
4036 Container {
4037 proc: self.proc.clone(),
4038 selection: query,
4039 graphql_client: self.graphql_client.clone(),
4040 }
4041 }
4042 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4049 let mut query = self.selection.select("withoutFiles");
4050 query = query.arg(
4051 "paths",
4052 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4053 );
4054 Container {
4055 proc: self.proc.clone(),
4056 selection: query,
4057 graphql_client: self.graphql_client.clone(),
4058 }
4059 }
4060 pub fn without_files_opts(
4067 &self,
4068 paths: Vec<impl Into<String>>,
4069 opts: ContainerWithoutFilesOpts,
4070 ) -> Container {
4071 let mut query = self.selection.select("withoutFiles");
4072 query = query.arg(
4073 "paths",
4074 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4075 );
4076 if let Some(expand) = opts.expand {
4077 query = query.arg("expand", expand);
4078 }
4079 Container {
4080 proc: self.proc.clone(),
4081 selection: query,
4082 graphql_client: self.graphql_client.clone(),
4083 }
4084 }
4085 pub fn without_label(&self, name: impl Into<String>) -> Container {
4091 let mut query = self.selection.select("withoutLabel");
4092 query = query.arg("name", name.into());
4093 Container {
4094 proc: self.proc.clone(),
4095 selection: query,
4096 graphql_client: self.graphql_client.clone(),
4097 }
4098 }
4099 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4106 let mut query = self.selection.select("withoutMount");
4107 query = query.arg("path", path.into());
4108 Container {
4109 proc: self.proc.clone(),
4110 selection: query,
4111 graphql_client: self.graphql_client.clone(),
4112 }
4113 }
4114 pub fn without_mount_opts(
4121 &self,
4122 path: impl Into<String>,
4123 opts: ContainerWithoutMountOpts,
4124 ) -> Container {
4125 let mut query = self.selection.select("withoutMount");
4126 query = query.arg("path", path.into());
4127 if let Some(expand) = opts.expand {
4128 query = query.arg("expand", expand);
4129 }
4130 Container {
4131 proc: self.proc.clone(),
4132 selection: query,
4133 graphql_client: self.graphql_client.clone(),
4134 }
4135 }
4136 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4144 let mut query = self.selection.select("withoutRegistryAuth");
4145 query = query.arg("address", address.into());
4146 Container {
4147 proc: self.proc.clone(),
4148 selection: query,
4149 graphql_client: self.graphql_client.clone(),
4150 }
4151 }
4152 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4158 let mut query = self.selection.select("withoutSecretVariable");
4159 query = query.arg("name", name.into());
4160 Container {
4161 proc: self.proc.clone(),
4162 selection: query,
4163 graphql_client: self.graphql_client.clone(),
4164 }
4165 }
4166 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4173 let mut query = self.selection.select("withoutUnixSocket");
4174 query = query.arg("path", path.into());
4175 Container {
4176 proc: self.proc.clone(),
4177 selection: query,
4178 graphql_client: self.graphql_client.clone(),
4179 }
4180 }
4181 pub fn without_unix_socket_opts(
4188 &self,
4189 path: impl Into<String>,
4190 opts: ContainerWithoutUnixSocketOpts,
4191 ) -> Container {
4192 let mut query = self.selection.select("withoutUnixSocket");
4193 query = query.arg("path", path.into());
4194 if let Some(expand) = opts.expand {
4195 query = query.arg("expand", expand);
4196 }
4197 Container {
4198 proc: self.proc.clone(),
4199 selection: query,
4200 graphql_client: self.graphql_client.clone(),
4201 }
4202 }
4203 pub fn without_user(&self) -> Container {
4206 let query = self.selection.select("withoutUser");
4207 Container {
4208 proc: self.proc.clone(),
4209 selection: query,
4210 graphql_client: self.graphql_client.clone(),
4211 }
4212 }
4213 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4219 let mut query = self.selection.select("withoutVolatileVariable");
4220 query = query.arg("name", name.into());
4221 Container {
4222 proc: self.proc.clone(),
4223 selection: query,
4224 graphql_client: self.graphql_client.clone(),
4225 }
4226 }
4227 pub fn without_workdir(&self) -> Container {
4230 let query = self.selection.select("withoutWorkdir");
4231 Container {
4232 proc: self.proc.clone(),
4233 selection: query,
4234 graphql_client: self.graphql_client.clone(),
4235 }
4236 }
4237 pub async fn workdir(&self) -> Result<String, DaggerError> {
4239 let query = self.selection.select("workdir");
4240 query.execute(self.graphql_client.clone()).await
4241 }
4242}
4243impl Exportable for Container {
4244 fn export(
4245 &self,
4246 path: impl Into<String>,
4247 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4248 let mut query = self.selection.select("export");
4249 query = query.arg("path", path.into());
4250 let graphql_client = self.graphql_client.clone();
4251 async move { query.execute(graphql_client).await }
4252 }
4253 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4254 let query = self.selection.select("id");
4255 let graphql_client = self.graphql_client.clone();
4256 async move { query.execute(graphql_client).await }
4257 }
4258}
4259impl Node for Container {
4260 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4261 let query = self.selection.select("id");
4262 let graphql_client = self.graphql_client.clone();
4263 async move { query.execute(graphql_client).await }
4264 }
4265}
4266impl Syncer for Container {
4267 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4268 let query = self.selection.select("id");
4269 let graphql_client = self.graphql_client.clone();
4270 async move { query.execute(graphql_client).await }
4271 }
4272 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4273 let query = self.selection.select("sync");
4274 let graphql_client = self.graphql_client.clone();
4275 async move { query.execute(graphql_client).await }
4276 }
4277}
4278#[derive(Clone)]
4279pub struct CurrentModule {
4280 pub proc: Option<Arc<DaggerSessionProc>>,
4281 pub selection: Selection,
4282 pub graphql_client: DynGraphQLClient,
4283}
4284#[derive(Builder, Debug, PartialEq)]
4285pub struct CurrentModuleGeneratorsOpts<'a> {
4286 #[builder(setter(into, strip_option), default)]
4288 pub include: Option<Vec<&'a str>>,
4289}
4290#[derive(Builder, Debug, PartialEq)]
4291pub struct CurrentModuleWorkdirOpts<'a> {
4292 #[builder(setter(into, strip_option), default)]
4294 pub exclude: Option<Vec<&'a str>>,
4295 #[builder(setter(into, strip_option), default)]
4297 pub gitignore: Option<bool>,
4298 #[builder(setter(into, strip_option), default)]
4300 pub include: Option<Vec<&'a str>>,
4301}
4302impl IntoID<Id> for CurrentModule {
4303 fn into_id(
4304 self,
4305 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4306 Box::pin(async move { self.id().await })
4307 }
4308}
4309impl Loadable for CurrentModule {
4310 fn graphql_type() -> &'static str {
4311 "CurrentModule"
4312 }
4313 fn from_query(
4314 proc: Option<Arc<DaggerSessionProc>>,
4315 selection: Selection,
4316 graphql_client: DynGraphQLClient,
4317 ) -> Self {
4318 Self {
4319 proc,
4320 selection,
4321 graphql_client,
4322 }
4323 }
4324}
4325impl CurrentModule {
4326 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4328 let query = self.selection.select("dependencies");
4329 let query = query.select("id");
4330 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4331 Ok(ids
4332 .into_iter()
4333 .map(|id| Module {
4334 proc: self.proc.clone(),
4335 selection: crate::querybuilder::query()
4336 .select("node")
4337 .arg("id", &id.0)
4338 .inline_fragment("Module"),
4339 graphql_client: self.graphql_client.clone(),
4340 })
4341 .collect())
4342 }
4343 pub fn generated_context_directory(&self) -> Directory {
4345 let query = self.selection.select("generatedContextDirectory");
4346 Directory {
4347 proc: self.proc.clone(),
4348 selection: query,
4349 graphql_client: self.graphql_client.clone(),
4350 }
4351 }
4352 pub fn generators(&self) -> GeneratorGroup {
4358 let query = self.selection.select("generators");
4359 GeneratorGroup {
4360 proc: self.proc.clone(),
4361 selection: query,
4362 graphql_client: self.graphql_client.clone(),
4363 }
4364 }
4365 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4371 let mut query = self.selection.select("generators");
4372 if let Some(include) = opts.include {
4373 query = query.arg("include", include);
4374 }
4375 GeneratorGroup {
4376 proc: self.proc.clone(),
4377 selection: query,
4378 graphql_client: self.graphql_client.clone(),
4379 }
4380 }
4381 pub async fn id(&self) -> Result<Id, DaggerError> {
4383 let query = self.selection.select("id");
4384 query.execute(self.graphql_client.clone()).await
4385 }
4386 pub async fn name(&self) -> Result<String, DaggerError> {
4388 let query = self.selection.select("name");
4389 query.execute(self.graphql_client.clone()).await
4390 }
4391 pub fn source(&self) -> Directory {
4393 let query = self.selection.select("source");
4394 Directory {
4395 proc: self.proc.clone(),
4396 selection: query,
4397 graphql_client: self.graphql_client.clone(),
4398 }
4399 }
4400 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4407 let mut query = self.selection.select("workdir");
4408 query = query.arg("path", path.into());
4409 Directory {
4410 proc: self.proc.clone(),
4411 selection: query,
4412 graphql_client: self.graphql_client.clone(),
4413 }
4414 }
4415 pub fn workdir_opts<'a>(
4422 &self,
4423 path: impl Into<String>,
4424 opts: CurrentModuleWorkdirOpts<'a>,
4425 ) -> Directory {
4426 let mut query = self.selection.select("workdir");
4427 query = query.arg("path", path.into());
4428 if let Some(exclude) = opts.exclude {
4429 query = query.arg("exclude", exclude);
4430 }
4431 if let Some(include) = opts.include {
4432 query = query.arg("include", include);
4433 }
4434 if let Some(gitignore) = opts.gitignore {
4435 query = query.arg("gitignore", gitignore);
4436 }
4437 Directory {
4438 proc: self.proc.clone(),
4439 selection: query,
4440 graphql_client: self.graphql_client.clone(),
4441 }
4442 }
4443 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4449 let mut query = self.selection.select("workdirFile");
4450 query = query.arg("path", path.into());
4451 File {
4452 proc: self.proc.clone(),
4453 selection: query,
4454 graphql_client: self.graphql_client.clone(),
4455 }
4456 }
4457}
4458impl Node for CurrentModule {
4459 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4460 let query = self.selection.select("id");
4461 let graphql_client = self.graphql_client.clone();
4462 async move { query.execute(graphql_client).await }
4463 }
4464}
4465#[derive(Clone)]
4466pub struct DiffStat {
4467 pub proc: Option<Arc<DaggerSessionProc>>,
4468 pub selection: Selection,
4469 pub graphql_client: DynGraphQLClient,
4470}
4471impl IntoID<Id> for DiffStat {
4472 fn into_id(
4473 self,
4474 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4475 Box::pin(async move { self.id().await })
4476 }
4477}
4478impl Loadable for DiffStat {
4479 fn graphql_type() -> &'static str {
4480 "DiffStat"
4481 }
4482 fn from_query(
4483 proc: Option<Arc<DaggerSessionProc>>,
4484 selection: Selection,
4485 graphql_client: DynGraphQLClient,
4486 ) -> Self {
4487 Self {
4488 proc,
4489 selection,
4490 graphql_client,
4491 }
4492 }
4493}
4494impl DiffStat {
4495 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4497 let query = self.selection.select("addedLines");
4498 query.execute(self.graphql_client.clone()).await
4499 }
4500 pub async fn id(&self) -> Result<Id, DaggerError> {
4502 let query = self.selection.select("id");
4503 query.execute(self.graphql_client.clone()).await
4504 }
4505 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4507 let query = self.selection.select("kind");
4508 query.execute(self.graphql_client.clone()).await
4509 }
4510 pub async fn old_path(&self) -> Result<String, DaggerError> {
4512 let query = self.selection.select("oldPath");
4513 query.execute(self.graphql_client.clone()).await
4514 }
4515 pub async fn path(&self) -> Result<String, DaggerError> {
4517 let query = self.selection.select("path");
4518 query.execute(self.graphql_client.clone()).await
4519 }
4520 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4522 let query = self.selection.select("removedLines");
4523 query.execute(self.graphql_client.clone()).await
4524 }
4525}
4526impl Node for DiffStat {
4527 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4528 let query = self.selection.select("id");
4529 let graphql_client = self.graphql_client.clone();
4530 async move { query.execute(graphql_client).await }
4531 }
4532}
4533#[derive(Clone)]
4534pub struct Directory {
4535 pub proc: Option<Arc<DaggerSessionProc>>,
4536 pub selection: Selection,
4537 pub graphql_client: DynGraphQLClient,
4538}
4539#[derive(Builder, Debug, PartialEq)]
4540pub struct DirectoryAsModuleOpts<'a> {
4541 #[builder(setter(into, strip_option), default)]
4544 pub source_root_path: Option<&'a str>,
4545}
4546#[derive(Builder, Debug, PartialEq)]
4547pub struct DirectoryAsModuleSourceOpts<'a> {
4548 #[builder(setter(into, strip_option), default)]
4551 pub source_root_path: Option<&'a str>,
4552}
4553#[derive(Builder, Debug, PartialEq)]
4554pub struct DirectoryDockerBuildOpts<'a> {
4555 #[builder(setter(into, strip_option), default)]
4557 pub build_args: Option<Vec<BuildArg>>,
4558 #[builder(setter(into, strip_option), default)]
4560 pub dockerfile: Option<&'a str>,
4561 #[builder(setter(into, strip_option), default)]
4564 pub no_init: Option<bool>,
4565 #[builder(setter(into, strip_option), default)]
4567 pub platform: Option<Platform>,
4568 #[builder(setter(into, strip_option), default)]
4571 pub secrets: Option<Vec<Id>>,
4572 #[builder(setter(into, strip_option), default)]
4576 pub ssh: Option<Id>,
4577 #[builder(setter(into, strip_option), default)]
4579 pub target: Option<&'a str>,
4580}
4581#[derive(Builder, Debug, PartialEq)]
4582pub struct DirectoryEntriesOpts<'a> {
4583 #[builder(setter(into, strip_option), default)]
4585 pub path: Option<&'a str>,
4586}
4587#[derive(Builder, Debug, PartialEq)]
4588pub struct DirectoryExistsOpts {
4589 #[builder(setter(into, strip_option), default)]
4591 pub do_not_follow_symlinks: Option<bool>,
4592 #[builder(setter(into, strip_option), default)]
4594 pub expected_type: Option<ExistsType>,
4595}
4596#[derive(Builder, Debug, PartialEq)]
4597pub struct DirectoryExportOpts {
4598 #[builder(setter(into, strip_option), default)]
4600 pub wipe: Option<bool>,
4601}
4602#[derive(Builder, Debug, PartialEq)]
4603pub struct DirectoryFilterOpts<'a> {
4604 #[builder(setter(into, strip_option), default)]
4606 pub exclude: Option<Vec<&'a str>>,
4607 #[builder(setter(into, strip_option), default)]
4609 pub gitignore: Option<bool>,
4610 #[builder(setter(into, strip_option), default)]
4612 pub include: Option<Vec<&'a str>>,
4613}
4614#[derive(Builder, Debug, PartialEq)]
4615pub struct DirectorySearchOpts<'a> {
4616 #[builder(setter(into, strip_option), default)]
4618 pub dotall: Option<bool>,
4619 #[builder(setter(into, strip_option), default)]
4621 pub files_only: Option<bool>,
4622 #[builder(setter(into, strip_option), default)]
4624 pub globs: Option<Vec<&'a str>>,
4625 #[builder(setter(into, strip_option), default)]
4627 pub insensitive: Option<bool>,
4628 #[builder(setter(into, strip_option), default)]
4630 pub limit: Option<isize>,
4631 #[builder(setter(into, strip_option), default)]
4633 pub literal: Option<bool>,
4634 #[builder(setter(into, strip_option), default)]
4636 pub multiline: Option<bool>,
4637 #[builder(setter(into, strip_option), default)]
4639 pub paths: Option<Vec<&'a str>>,
4640 #[builder(setter(into, strip_option), default)]
4642 pub skip_hidden: Option<bool>,
4643 #[builder(setter(into, strip_option), default)]
4645 pub skip_ignored: Option<bool>,
4646}
4647#[derive(Builder, Debug, PartialEq)]
4648pub struct DirectoryStatOpts {
4649 #[builder(setter(into, strip_option), default)]
4651 pub do_not_follow_symlinks: Option<bool>,
4652}
4653#[derive(Builder, Debug, PartialEq)]
4654pub struct DirectoryTerminalOpts<'a> {
4655 #[builder(setter(into, strip_option), default)]
4657 pub cmd: Option<Vec<&'a str>>,
4658 #[builder(setter(into, strip_option), default)]
4660 pub container: Option<Id>,
4661 #[builder(setter(into, strip_option), default)]
4663 pub experimental_privileged_nesting: Option<bool>,
4664 #[builder(setter(into, strip_option), default)]
4666 pub insecure_root_capabilities: Option<bool>,
4667}
4668#[derive(Builder, Debug, PartialEq)]
4669pub struct DirectoryWithDirectoryOpts<'a> {
4670 #[builder(setter(into, strip_option), default)]
4672 pub exclude: Option<Vec<&'a str>>,
4673 #[builder(setter(into, strip_option), default)]
4675 pub gitignore: Option<bool>,
4676 #[builder(setter(into, strip_option), default)]
4678 pub include: Option<Vec<&'a str>>,
4679 #[builder(setter(into, strip_option), default)]
4683 pub owner: Option<&'a str>,
4684 #[builder(setter(into, strip_option), default)]
4686 pub permissions: Option<isize>,
4687}
4688#[derive(Builder, Debug, PartialEq)]
4689pub struct DirectoryWithFileOpts<'a> {
4690 #[builder(setter(into, strip_option), default)]
4694 pub owner: Option<&'a str>,
4695 #[builder(setter(into, strip_option), default)]
4697 pub permissions: Option<isize>,
4698}
4699#[derive(Builder, Debug, PartialEq)]
4700pub struct DirectoryWithFilesOpts {
4701 #[builder(setter(into, strip_option), default)]
4703 pub permissions: Option<isize>,
4704}
4705#[derive(Builder, Debug, PartialEq)]
4706pub struct DirectoryWithNewDirectoryOpts {
4707 #[builder(setter(into, strip_option), default)]
4709 pub permissions: Option<isize>,
4710}
4711#[derive(Builder, Debug, PartialEq)]
4712pub struct DirectoryWithNewFileOpts {
4713 #[builder(setter(into, strip_option), default)]
4715 pub permissions: Option<isize>,
4716}
4717impl IntoID<Id> for Directory {
4718 fn into_id(
4719 self,
4720 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4721 Box::pin(async move { self.id().await })
4722 }
4723}
4724impl Loadable for Directory {
4725 fn graphql_type() -> &'static str {
4726 "Directory"
4727 }
4728 fn from_query(
4729 proc: Option<Arc<DaggerSessionProc>>,
4730 selection: Selection,
4731 graphql_client: DynGraphQLClient,
4732 ) -> Self {
4733 Self {
4734 proc,
4735 selection,
4736 graphql_client,
4737 }
4738 }
4739}
4740impl Directory {
4741 pub fn as_git(&self) -> GitRepository {
4743 let query = self.selection.select("asGit");
4744 GitRepository {
4745 proc: self.proc.clone(),
4746 selection: query,
4747 graphql_client: self.graphql_client.clone(),
4748 }
4749 }
4750 pub fn as_module(&self) -> Module {
4756 let query = self.selection.select("asModule");
4757 Module {
4758 proc: self.proc.clone(),
4759 selection: query,
4760 graphql_client: self.graphql_client.clone(),
4761 }
4762 }
4763 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4769 let mut query = self.selection.select("asModule");
4770 if let Some(source_root_path) = opts.source_root_path {
4771 query = query.arg("sourceRootPath", source_root_path);
4772 }
4773 Module {
4774 proc: self.proc.clone(),
4775 selection: query,
4776 graphql_client: self.graphql_client.clone(),
4777 }
4778 }
4779 pub fn as_module_source(&self) -> ModuleSource {
4785 let query = self.selection.select("asModuleSource");
4786 ModuleSource {
4787 proc: self.proc.clone(),
4788 selection: query,
4789 graphql_client: self.graphql_client.clone(),
4790 }
4791 }
4792 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4798 let mut query = self.selection.select("asModuleSource");
4799 if let Some(source_root_path) = opts.source_root_path {
4800 query = query.arg("sourceRootPath", source_root_path);
4801 }
4802 ModuleSource {
4803 proc: self.proc.clone(),
4804 selection: query,
4805 graphql_client: self.graphql_client.clone(),
4806 }
4807 }
4808 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4815 let mut query = self.selection.select("changes");
4816 query = query.arg_lazy(
4817 "from",
4818 Box::new(move || {
4819 let from = from.clone();
4820 Box::pin(async move { from.into_id().await.unwrap().quote() })
4821 }),
4822 );
4823 Changeset {
4824 proc: self.proc.clone(),
4825 selection: query,
4826 graphql_client: self.graphql_client.clone(),
4827 }
4828 }
4829 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4840 let mut query = self.selection.select("chown");
4841 query = query.arg("path", path.into());
4842 query = query.arg("owner", owner.into());
4843 Directory {
4844 proc: self.proc.clone(),
4845 selection: query,
4846 graphql_client: self.graphql_client.clone(),
4847 }
4848 }
4849 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4855 let mut query = self.selection.select("diff");
4856 query = query.arg_lazy(
4857 "other",
4858 Box::new(move || {
4859 let other = other.clone();
4860 Box::pin(async move { other.into_id().await.unwrap().quote() })
4861 }),
4862 );
4863 Directory {
4864 proc: self.proc.clone(),
4865 selection: query,
4866 graphql_client: self.graphql_client.clone(),
4867 }
4868 }
4869 pub async fn digest(&self) -> Result<String, DaggerError> {
4871 let query = self.selection.select("digest");
4872 query.execute(self.graphql_client.clone()).await
4873 }
4874 pub fn directory(&self, path: impl Into<String>) -> Directory {
4880 let mut query = self.selection.select("directory");
4881 query = query.arg("path", path.into());
4882 Directory {
4883 proc: self.proc.clone(),
4884 selection: query,
4885 graphql_client: self.graphql_client.clone(),
4886 }
4887 }
4888 pub fn docker_build(&self) -> Container {
4894 let query = self.selection.select("dockerBuild");
4895 Container {
4896 proc: self.proc.clone(),
4897 selection: query,
4898 graphql_client: self.graphql_client.clone(),
4899 }
4900 }
4901 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4907 let mut query = self.selection.select("dockerBuild");
4908 if let Some(dockerfile) = opts.dockerfile {
4909 query = query.arg("dockerfile", dockerfile);
4910 }
4911 if let Some(platform) = opts.platform {
4912 query = query.arg("platform", platform);
4913 }
4914 if let Some(build_args) = opts.build_args {
4915 query = query.arg("buildArgs", build_args);
4916 }
4917 if let Some(target) = opts.target {
4918 query = query.arg("target", target);
4919 }
4920 if let Some(secrets) = opts.secrets {
4921 query = query.arg("secrets", secrets);
4922 }
4923 if let Some(no_init) = opts.no_init {
4924 query = query.arg("noInit", no_init);
4925 }
4926 if let Some(ssh) = opts.ssh {
4927 query = query.arg("ssh", ssh);
4928 }
4929 Container {
4930 proc: self.proc.clone(),
4931 selection: query,
4932 graphql_client: self.graphql_client.clone(),
4933 }
4934 }
4935 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4941 let query = self.selection.select("entries");
4942 query.execute(self.graphql_client.clone()).await
4943 }
4944 pub async fn entries_opts<'a>(
4950 &self,
4951 opts: DirectoryEntriesOpts<'a>,
4952 ) -> Result<Vec<String>, DaggerError> {
4953 let mut query = self.selection.select("entries");
4954 if let Some(path) = opts.path {
4955 query = query.arg("path", path);
4956 }
4957 query.execute(self.graphql_client.clone()).await
4958 }
4959 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4966 let mut query = self.selection.select("exists");
4967 query = query.arg("path", path.into());
4968 query.execute(self.graphql_client.clone()).await
4969 }
4970 pub async fn exists_opts(
4977 &self,
4978 path: impl Into<String>,
4979 opts: DirectoryExistsOpts,
4980 ) -> Result<bool, DaggerError> {
4981 let mut query = self.selection.select("exists");
4982 query = query.arg("path", path.into());
4983 if let Some(expected_type) = opts.expected_type {
4984 query = query.arg("expectedType", expected_type);
4985 }
4986 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4987 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4988 }
4989 query.execute(self.graphql_client.clone()).await
4990 }
4991 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4998 let mut query = self.selection.select("export");
4999 query = query.arg("path", path.into());
5000 query.execute(self.graphql_client.clone()).await
5001 }
5002 pub async fn export_opts(
5009 &self,
5010 path: impl Into<String>,
5011 opts: DirectoryExportOpts,
5012 ) -> Result<String, DaggerError> {
5013 let mut query = self.selection.select("export");
5014 query = query.arg("path", path.into());
5015 if let Some(wipe) = opts.wipe {
5016 query = query.arg("wipe", wipe);
5017 }
5018 query.execute(self.graphql_client.clone()).await
5019 }
5020 pub fn file(&self, path: impl Into<String>) -> File {
5026 let mut query = self.selection.select("file");
5027 query = query.arg("path", path.into());
5028 File {
5029 proc: self.proc.clone(),
5030 selection: query,
5031 graphql_client: self.graphql_client.clone(),
5032 }
5033 }
5034 pub fn filter(&self) -> Directory {
5040 let query = self.selection.select("filter");
5041 Directory {
5042 proc: self.proc.clone(),
5043 selection: query,
5044 graphql_client: self.graphql_client.clone(),
5045 }
5046 }
5047 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5053 let mut query = self.selection.select("filter");
5054 if let Some(exclude) = opts.exclude {
5055 query = query.arg("exclude", exclude);
5056 }
5057 if let Some(include) = opts.include {
5058 query = query.arg("include", include);
5059 }
5060 if let Some(gitignore) = opts.gitignore {
5061 query = query.arg("gitignore", gitignore);
5062 }
5063 Directory {
5064 proc: self.proc.clone(),
5065 selection: query,
5066 graphql_client: self.graphql_client.clone(),
5067 }
5068 }
5069 pub async fn find_up(
5076 &self,
5077 name: impl Into<String>,
5078 start: impl Into<String>,
5079 ) -> Result<String, DaggerError> {
5080 let mut query = self.selection.select("findUp");
5081 query = query.arg("name", name.into());
5082 query = query.arg("start", start.into());
5083 query.execute(self.graphql_client.clone()).await
5084 }
5085 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5091 let mut query = self.selection.select("glob");
5092 query = query.arg("pattern", pattern.into());
5093 query.execute(self.graphql_client.clone()).await
5094 }
5095 pub async fn id(&self) -> Result<Id, DaggerError> {
5097 let query = self.selection.select("id");
5098 query.execute(self.graphql_client.clone()).await
5099 }
5100 pub async fn name(&self) -> Result<String, DaggerError> {
5102 let query = self.selection.select("name");
5103 query.execute(self.graphql_client.clone()).await
5104 }
5105 pub async fn search(
5113 &self,
5114 pattern: impl Into<String>,
5115 ) -> Result<Vec<SearchResult>, DaggerError> {
5116 let mut query = self.selection.select("search");
5117 query = query.arg("pattern", pattern.into());
5118 let query = query.select("id");
5119 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5120 Ok(ids
5121 .into_iter()
5122 .map(|id| SearchResult {
5123 proc: self.proc.clone(),
5124 selection: crate::querybuilder::query()
5125 .select("node")
5126 .arg("id", &id.0)
5127 .inline_fragment("SearchResult"),
5128 graphql_client: self.graphql_client.clone(),
5129 })
5130 .collect())
5131 }
5132 pub async fn search_opts<'a>(
5140 &self,
5141 pattern: impl Into<String>,
5142 opts: DirectorySearchOpts<'a>,
5143 ) -> Result<Vec<SearchResult>, DaggerError> {
5144 let mut query = self.selection.select("search");
5145 query = query.arg("pattern", pattern.into());
5146 if let Some(paths) = opts.paths {
5147 query = query.arg("paths", paths);
5148 }
5149 if let Some(globs) = opts.globs {
5150 query = query.arg("globs", globs);
5151 }
5152 if let Some(literal) = opts.literal {
5153 query = query.arg("literal", literal);
5154 }
5155 if let Some(multiline) = opts.multiline {
5156 query = query.arg("multiline", multiline);
5157 }
5158 if let Some(dotall) = opts.dotall {
5159 query = query.arg("dotall", dotall);
5160 }
5161 if let Some(insensitive) = opts.insensitive {
5162 query = query.arg("insensitive", insensitive);
5163 }
5164 if let Some(skip_ignored) = opts.skip_ignored {
5165 query = query.arg("skipIgnored", skip_ignored);
5166 }
5167 if let Some(skip_hidden) = opts.skip_hidden {
5168 query = query.arg("skipHidden", skip_hidden);
5169 }
5170 if let Some(files_only) = opts.files_only {
5171 query = query.arg("filesOnly", files_only);
5172 }
5173 if let Some(limit) = opts.limit {
5174 query = query.arg("limit", limit);
5175 }
5176 let query = query.select("id");
5177 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5178 Ok(ids
5179 .into_iter()
5180 .map(|id| SearchResult {
5181 proc: self.proc.clone(),
5182 selection: crate::querybuilder::query()
5183 .select("node")
5184 .arg("id", &id.0)
5185 .inline_fragment("SearchResult"),
5186 graphql_client: self.graphql_client.clone(),
5187 })
5188 .collect())
5189 }
5190 pub fn stat(&self, path: impl Into<String>) -> Stat {
5197 let mut query = self.selection.select("stat");
5198 query = query.arg("path", path.into());
5199 Stat {
5200 proc: self.proc.clone(),
5201 selection: query,
5202 graphql_client: self.graphql_client.clone(),
5203 }
5204 }
5205 pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5212 let mut query = self.selection.select("stat");
5213 query = query.arg("path", path.into());
5214 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5215 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5216 }
5217 Stat {
5218 proc: self.proc.clone(),
5219 selection: query,
5220 graphql_client: self.graphql_client.clone(),
5221 }
5222 }
5223 pub async fn sync(&self) -> Result<Directory, DaggerError> {
5225 let query = self.selection.select("sync");
5226 let id: Id = query.execute(self.graphql_client.clone()).await?;
5227 Ok(Directory {
5228 proc: self.proc.clone(),
5229 selection: query
5230 .root()
5231 .select("node")
5232 .arg("id", &id.0)
5233 .inline_fragment("Directory"),
5234 graphql_client: self.graphql_client.clone(),
5235 })
5236 }
5237 pub fn terminal(&self) -> Directory {
5243 let query = self.selection.select("terminal");
5244 Directory {
5245 proc: self.proc.clone(),
5246 selection: query,
5247 graphql_client: self.graphql_client.clone(),
5248 }
5249 }
5250 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5256 let mut query = self.selection.select("terminal");
5257 if let Some(container) = opts.container {
5258 query = query.arg("container", container);
5259 }
5260 if let Some(cmd) = opts.cmd {
5261 query = query.arg("cmd", cmd);
5262 }
5263 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5264 query = query.arg(
5265 "experimentalPrivilegedNesting",
5266 experimental_privileged_nesting,
5267 );
5268 }
5269 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5270 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5271 }
5272 Directory {
5273 proc: self.proc.clone(),
5274 selection: query,
5275 graphql_client: self.graphql_client.clone(),
5276 }
5277 }
5278 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5284 let mut query = self.selection.select("withChanges");
5285 query = query.arg_lazy(
5286 "changes",
5287 Box::new(move || {
5288 let changes = changes.clone();
5289 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5290 }),
5291 );
5292 Directory {
5293 proc: self.proc.clone(),
5294 selection: query,
5295 graphql_client: self.graphql_client.clone(),
5296 }
5297 }
5298 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5306 let mut query = self.selection.select("withDirectory");
5307 query = query.arg("path", path.into());
5308 query = query.arg_lazy(
5309 "source",
5310 Box::new(move || {
5311 let source = source.clone();
5312 Box::pin(async move { source.into_id().await.unwrap().quote() })
5313 }),
5314 );
5315 Directory {
5316 proc: self.proc.clone(),
5317 selection: query,
5318 graphql_client: self.graphql_client.clone(),
5319 }
5320 }
5321 pub fn with_directory_opts<'a>(
5329 &self,
5330 path: impl Into<String>,
5331 source: impl IntoID<Id>,
5332 opts: DirectoryWithDirectoryOpts<'a>,
5333 ) -> Directory {
5334 let mut query = self.selection.select("withDirectory");
5335 query = query.arg("path", path.into());
5336 query = query.arg_lazy(
5337 "source",
5338 Box::new(move || {
5339 let source = source.clone();
5340 Box::pin(async move { source.into_id().await.unwrap().quote() })
5341 }),
5342 );
5343 if let Some(exclude) = opts.exclude {
5344 query = query.arg("exclude", exclude);
5345 }
5346 if let Some(include) = opts.include {
5347 query = query.arg("include", include);
5348 }
5349 if let Some(gitignore) = opts.gitignore {
5350 query = query.arg("gitignore", gitignore);
5351 }
5352 if let Some(owner) = opts.owner {
5353 query = query.arg("owner", owner);
5354 }
5355 if let Some(permissions) = opts.permissions {
5356 query = query.arg("permissions", permissions);
5357 }
5358 Directory {
5359 proc: self.proc.clone(),
5360 selection: query,
5361 graphql_client: self.graphql_client.clone(),
5362 }
5363 }
5364 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5370 let mut query = self.selection.select("withError");
5371 query = query.arg("err", err.into());
5372 Directory {
5373 proc: self.proc.clone(),
5374 selection: query,
5375 graphql_client: self.graphql_client.clone(),
5376 }
5377 }
5378 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5386 let mut query = self.selection.select("withFile");
5387 query = query.arg("path", path.into());
5388 query = query.arg_lazy(
5389 "source",
5390 Box::new(move || {
5391 let source = source.clone();
5392 Box::pin(async move { source.into_id().await.unwrap().quote() })
5393 }),
5394 );
5395 Directory {
5396 proc: self.proc.clone(),
5397 selection: query,
5398 graphql_client: self.graphql_client.clone(),
5399 }
5400 }
5401 pub fn with_file_opts<'a>(
5409 &self,
5410 path: impl Into<String>,
5411 source: impl IntoID<Id>,
5412 opts: DirectoryWithFileOpts<'a>,
5413 ) -> Directory {
5414 let mut query = self.selection.select("withFile");
5415 query = query.arg("path", path.into());
5416 query = query.arg_lazy(
5417 "source",
5418 Box::new(move || {
5419 let source = source.clone();
5420 Box::pin(async move { source.into_id().await.unwrap().quote() })
5421 }),
5422 );
5423 if let Some(permissions) = opts.permissions {
5424 query = query.arg("permissions", permissions);
5425 }
5426 if let Some(owner) = opts.owner {
5427 query = query.arg("owner", owner);
5428 }
5429 Directory {
5430 proc: self.proc.clone(),
5431 selection: query,
5432 graphql_client: self.graphql_client.clone(),
5433 }
5434 }
5435 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5443 let mut query = self.selection.select("withFiles");
5444 query = query.arg("path", path.into());
5445 query = query.arg("sources", sources);
5446 Directory {
5447 proc: self.proc.clone(),
5448 selection: query,
5449 graphql_client: self.graphql_client.clone(),
5450 }
5451 }
5452 pub fn with_files_opts(
5460 &self,
5461 path: impl Into<String>,
5462 sources: Vec<Id>,
5463 opts: DirectoryWithFilesOpts,
5464 ) -> Directory {
5465 let mut query = self.selection.select("withFiles");
5466 query = query.arg("path", path.into());
5467 query = query.arg("sources", sources);
5468 if let Some(permissions) = opts.permissions {
5469 query = query.arg("permissions", permissions);
5470 }
5471 Directory {
5472 proc: self.proc.clone(),
5473 selection: query,
5474 graphql_client: self.graphql_client.clone(),
5475 }
5476 }
5477 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5484 let mut query = self.selection.select("withNewDirectory");
5485 query = query.arg("path", path.into());
5486 Directory {
5487 proc: self.proc.clone(),
5488 selection: query,
5489 graphql_client: self.graphql_client.clone(),
5490 }
5491 }
5492 pub fn with_new_directory_opts(
5499 &self,
5500 path: impl Into<String>,
5501 opts: DirectoryWithNewDirectoryOpts,
5502 ) -> Directory {
5503 let mut query = self.selection.select("withNewDirectory");
5504 query = query.arg("path", path.into());
5505 if let Some(permissions) = opts.permissions {
5506 query = query.arg("permissions", permissions);
5507 }
5508 Directory {
5509 proc: self.proc.clone(),
5510 selection: query,
5511 graphql_client: self.graphql_client.clone(),
5512 }
5513 }
5514 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5522 let mut query = self.selection.select("withNewFile");
5523 query = query.arg("path", path.into());
5524 query = query.arg("contents", contents.into());
5525 Directory {
5526 proc: self.proc.clone(),
5527 selection: query,
5528 graphql_client: self.graphql_client.clone(),
5529 }
5530 }
5531 pub fn with_new_file_opts(
5539 &self,
5540 path: impl Into<String>,
5541 contents: impl Into<String>,
5542 opts: DirectoryWithNewFileOpts,
5543 ) -> Directory {
5544 let mut query = self.selection.select("withNewFile");
5545 query = query.arg("path", path.into());
5546 query = query.arg("contents", contents.into());
5547 if let Some(permissions) = opts.permissions {
5548 query = query.arg("permissions", permissions);
5549 }
5550 Directory {
5551 proc: self.proc.clone(),
5552 selection: query,
5553 graphql_client: self.graphql_client.clone(),
5554 }
5555 }
5556 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5562 let mut query = self.selection.select("withPatch");
5563 query = query.arg("patch", patch.into());
5564 Directory {
5565 proc: self.proc.clone(),
5566 selection: query,
5567 graphql_client: self.graphql_client.clone(),
5568 }
5569 }
5570 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5576 let mut query = self.selection.select("withPatchFile");
5577 query = query.arg_lazy(
5578 "patch",
5579 Box::new(move || {
5580 let patch = patch.clone();
5581 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5582 }),
5583 );
5584 Directory {
5585 proc: self.proc.clone(),
5586 selection: query,
5587 graphql_client: self.graphql_client.clone(),
5588 }
5589 }
5590 pub fn with_symlink(
5597 &self,
5598 target: impl Into<String>,
5599 link_name: impl Into<String>,
5600 ) -> Directory {
5601 let mut query = self.selection.select("withSymlink");
5602 query = query.arg("target", target.into());
5603 query = query.arg("linkName", link_name.into());
5604 Directory {
5605 proc: self.proc.clone(),
5606 selection: query,
5607 graphql_client: self.graphql_client.clone(),
5608 }
5609 }
5610 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5618 let mut query = self.selection.select("withTimestamps");
5619 query = query.arg("timestamp", timestamp);
5620 Directory {
5621 proc: self.proc.clone(),
5622 selection: query,
5623 graphql_client: self.graphql_client.clone(),
5624 }
5625 }
5626 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5632 let mut query = self.selection.select("withoutDirectory");
5633 query = query.arg("path", path.into());
5634 Directory {
5635 proc: self.proc.clone(),
5636 selection: query,
5637 graphql_client: self.graphql_client.clone(),
5638 }
5639 }
5640 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5646 let mut query = self.selection.select("withoutFile");
5647 query = query.arg("path", path.into());
5648 Directory {
5649 proc: self.proc.clone(),
5650 selection: query,
5651 graphql_client: self.graphql_client.clone(),
5652 }
5653 }
5654 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5660 let mut query = self.selection.select("withoutFiles");
5661 query = query.arg(
5662 "paths",
5663 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5664 );
5665 Directory {
5666 proc: self.proc.clone(),
5667 selection: query,
5668 graphql_client: self.graphql_client.clone(),
5669 }
5670 }
5671}
5672impl Exportable for Directory {
5673 fn export(
5674 &self,
5675 path: impl Into<String>,
5676 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5677 let mut query = self.selection.select("export");
5678 query = query.arg("path", path.into());
5679 let graphql_client = self.graphql_client.clone();
5680 async move { query.execute(graphql_client).await }
5681 }
5682 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5683 let query = self.selection.select("id");
5684 let graphql_client = self.graphql_client.clone();
5685 async move { query.execute(graphql_client).await }
5686 }
5687}
5688impl Node for Directory {
5689 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5690 let query = self.selection.select("id");
5691 let graphql_client = self.graphql_client.clone();
5692 async move { query.execute(graphql_client).await }
5693 }
5694}
5695impl Syncer for Directory {
5696 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5697 let query = self.selection.select("id");
5698 let graphql_client = self.graphql_client.clone();
5699 async move { query.execute(graphql_client).await }
5700 }
5701 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5702 let query = self.selection.select("sync");
5703 let graphql_client = self.graphql_client.clone();
5704 async move { query.execute(graphql_client).await }
5705 }
5706}
5707#[derive(Clone)]
5708pub struct Engine {
5709 pub proc: Option<Arc<DaggerSessionProc>>,
5710 pub selection: Selection,
5711 pub graphql_client: DynGraphQLClient,
5712}
5713impl IntoID<Id> for Engine {
5714 fn into_id(
5715 self,
5716 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5717 Box::pin(async move { self.id().await })
5718 }
5719}
5720impl Loadable for Engine {
5721 fn graphql_type() -> &'static str {
5722 "Engine"
5723 }
5724 fn from_query(
5725 proc: Option<Arc<DaggerSessionProc>>,
5726 selection: Selection,
5727 graphql_client: DynGraphQLClient,
5728 ) -> Self {
5729 Self {
5730 proc,
5731 selection,
5732 graphql_client,
5733 }
5734 }
5735}
5736impl Engine {
5737 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5739 let query = self.selection.select("clients");
5740 query.execute(self.graphql_client.clone()).await
5741 }
5742 pub async fn id(&self) -> Result<Id, DaggerError> {
5744 let query = self.selection.select("id");
5745 query.execute(self.graphql_client.clone()).await
5746 }
5747 pub fn local_cache(&self) -> EngineCache {
5749 let query = self.selection.select("localCache");
5750 EngineCache {
5751 proc: self.proc.clone(),
5752 selection: query,
5753 graphql_client: self.graphql_client.clone(),
5754 }
5755 }
5756 pub async fn name(&self) -> Result<String, DaggerError> {
5758 let query = self.selection.select("name");
5759 query.execute(self.graphql_client.clone()).await
5760 }
5761}
5762impl Node for Engine {
5763 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5764 let query = self.selection.select("id");
5765 let graphql_client = self.graphql_client.clone();
5766 async move { query.execute(graphql_client).await }
5767 }
5768}
5769#[derive(Clone)]
5770pub struct EngineCache {
5771 pub proc: Option<Arc<DaggerSessionProc>>,
5772 pub selection: Selection,
5773 pub graphql_client: DynGraphQLClient,
5774}
5775#[derive(Builder, Debug, PartialEq)]
5776pub struct EngineCacheEntrySetOpts<'a> {
5777 #[builder(setter(into, strip_option), default)]
5778 pub key: Option<&'a str>,
5779}
5780#[derive(Builder, Debug, PartialEq)]
5781pub struct EngineCachePruneOpts<'a> {
5782 #[builder(setter(into, strip_option), default)]
5784 pub max_used_space: Option<&'a str>,
5785 #[builder(setter(into, strip_option), default)]
5787 pub min_free_space: Option<&'a str>,
5788 #[builder(setter(into, strip_option), default)]
5790 pub reserved_space: Option<&'a str>,
5791 #[builder(setter(into, strip_option), default)]
5793 pub target_space: Option<&'a str>,
5794 #[builder(setter(into, strip_option), default)]
5796 pub use_default_policy: Option<bool>,
5797}
5798impl IntoID<Id> for EngineCache {
5799 fn into_id(
5800 self,
5801 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5802 Box::pin(async move { self.id().await })
5803 }
5804}
5805impl Loadable for EngineCache {
5806 fn graphql_type() -> &'static str {
5807 "EngineCache"
5808 }
5809 fn from_query(
5810 proc: Option<Arc<DaggerSessionProc>>,
5811 selection: Selection,
5812 graphql_client: DynGraphQLClient,
5813 ) -> Self {
5814 Self {
5815 proc,
5816 selection,
5817 graphql_client,
5818 }
5819 }
5820}
5821impl EngineCache {
5822 pub fn entry_set(&self) -> EngineCacheEntrySet {
5828 let query = self.selection.select("entrySet");
5829 EngineCacheEntrySet {
5830 proc: self.proc.clone(),
5831 selection: query,
5832 graphql_client: self.graphql_client.clone(),
5833 }
5834 }
5835 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5841 let mut query = self.selection.select("entrySet");
5842 if let Some(key) = opts.key {
5843 query = query.arg("key", key);
5844 }
5845 EngineCacheEntrySet {
5846 proc: self.proc.clone(),
5847 selection: query,
5848 graphql_client: self.graphql_client.clone(),
5849 }
5850 }
5851 pub async fn id(&self) -> Result<Id, DaggerError> {
5853 let query = self.selection.select("id");
5854 query.execute(self.graphql_client.clone()).await
5855 }
5856 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5858 let query = self.selection.select("maxUsedSpace");
5859 query.execute(self.graphql_client.clone()).await
5860 }
5861 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5863 let query = self.selection.select("minFreeSpace");
5864 query.execute(self.graphql_client.clone()).await
5865 }
5866 pub async fn prune(&self) -> Result<Void, DaggerError> {
5872 let query = self.selection.select("prune");
5873 query.execute(self.graphql_client.clone()).await
5874 }
5875 pub async fn prune_opts<'a>(
5881 &self,
5882 opts: EngineCachePruneOpts<'a>,
5883 ) -> Result<Void, DaggerError> {
5884 let mut query = self.selection.select("prune");
5885 if let Some(use_default_policy) = opts.use_default_policy {
5886 query = query.arg("useDefaultPolicy", use_default_policy);
5887 }
5888 if let Some(max_used_space) = opts.max_used_space {
5889 query = query.arg("maxUsedSpace", max_used_space);
5890 }
5891 if let Some(reserved_space) = opts.reserved_space {
5892 query = query.arg("reservedSpace", reserved_space);
5893 }
5894 if let Some(min_free_space) = opts.min_free_space {
5895 query = query.arg("minFreeSpace", min_free_space);
5896 }
5897 if let Some(target_space) = opts.target_space {
5898 query = query.arg("targetSpace", target_space);
5899 }
5900 query.execute(self.graphql_client.clone()).await
5901 }
5902 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5904 let query = self.selection.select("reservedSpace");
5905 query.execute(self.graphql_client.clone()).await
5906 }
5907 pub async fn target_space(&self) -> Result<isize, DaggerError> {
5909 let query = self.selection.select("targetSpace");
5910 query.execute(self.graphql_client.clone()).await
5911 }
5912}
5913impl Node for EngineCache {
5914 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5915 let query = self.selection.select("id");
5916 let graphql_client = self.graphql_client.clone();
5917 async move { query.execute(graphql_client).await }
5918 }
5919}
5920#[derive(Clone)]
5921pub struct EngineCacheEntry {
5922 pub proc: Option<Arc<DaggerSessionProc>>,
5923 pub selection: Selection,
5924 pub graphql_client: DynGraphQLClient,
5925}
5926impl IntoID<Id> for EngineCacheEntry {
5927 fn into_id(
5928 self,
5929 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5930 Box::pin(async move { self.id().await })
5931 }
5932}
5933impl Loadable for EngineCacheEntry {
5934 fn graphql_type() -> &'static str {
5935 "EngineCacheEntry"
5936 }
5937 fn from_query(
5938 proc: Option<Arc<DaggerSessionProc>>,
5939 selection: Selection,
5940 graphql_client: DynGraphQLClient,
5941 ) -> Self {
5942 Self {
5943 proc,
5944 selection,
5945 graphql_client,
5946 }
5947 }
5948}
5949impl EngineCacheEntry {
5950 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5952 let query = self.selection.select("activelyUsed");
5953 query.execute(self.graphql_client.clone()).await
5954 }
5955 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5957 let query = self.selection.select("createdTimeUnixNano");
5958 query.execute(self.graphql_client.clone()).await
5959 }
5960 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
5962 let query = self.selection.select("dagqlCall");
5963 query.execute(self.graphql_client.clone()).await
5964 }
5965 pub async fn description(&self) -> Result<String, DaggerError> {
5967 let query = self.selection.select("description");
5968 query.execute(self.graphql_client.clone()).await
5969 }
5970 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5972 let query = self.selection.select("diskSpaceBytes");
5973 query.execute(self.graphql_client.clone()).await
5974 }
5975 pub async fn id(&self) -> Result<Id, DaggerError> {
5977 let query = self.selection.select("id");
5978 query.execute(self.graphql_client.clone()).await
5979 }
5980 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5982 let query = self.selection.select("mostRecentUseTimeUnixNano");
5983 query.execute(self.graphql_client.clone()).await
5984 }
5985 pub async fn record_type(&self) -> Result<String, DaggerError> {
5987 let query = self.selection.select("recordType");
5988 query.execute(self.graphql_client.clone()).await
5989 }
5990 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
5992 let query = self.selection.select("recordTypes");
5993 query.execute(self.graphql_client.clone()).await
5994 }
5995}
5996impl Node for EngineCacheEntry {
5997 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5998 let query = self.selection.select("id");
5999 let graphql_client = self.graphql_client.clone();
6000 async move { query.execute(graphql_client).await }
6001 }
6002}
6003#[derive(Clone)]
6004pub struct EngineCacheEntrySet {
6005 pub proc: Option<Arc<DaggerSessionProc>>,
6006 pub selection: Selection,
6007 pub graphql_client: DynGraphQLClient,
6008}
6009impl IntoID<Id> for EngineCacheEntrySet {
6010 fn into_id(
6011 self,
6012 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6013 Box::pin(async move { self.id().await })
6014 }
6015}
6016impl Loadable for EngineCacheEntrySet {
6017 fn graphql_type() -> &'static str {
6018 "EngineCacheEntrySet"
6019 }
6020 fn from_query(
6021 proc: Option<Arc<DaggerSessionProc>>,
6022 selection: Selection,
6023 graphql_client: DynGraphQLClient,
6024 ) -> Self {
6025 Self {
6026 proc,
6027 selection,
6028 graphql_client,
6029 }
6030 }
6031}
6032impl EngineCacheEntrySet {
6033 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6035 let query = self.selection.select("diskSpaceBytes");
6036 query.execute(self.graphql_client.clone()).await
6037 }
6038 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6040 let query = self.selection.select("entries");
6041 let query = query.select("id");
6042 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6043 Ok(ids
6044 .into_iter()
6045 .map(|id| EngineCacheEntry {
6046 proc: self.proc.clone(),
6047 selection: crate::querybuilder::query()
6048 .select("node")
6049 .arg("id", &id.0)
6050 .inline_fragment("EngineCacheEntry"),
6051 graphql_client: self.graphql_client.clone(),
6052 })
6053 .collect())
6054 }
6055 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6057 let query = self.selection.select("entryCount");
6058 query.execute(self.graphql_client.clone()).await
6059 }
6060 pub async fn id(&self) -> Result<Id, DaggerError> {
6062 let query = self.selection.select("id");
6063 query.execute(self.graphql_client.clone()).await
6064 }
6065}
6066impl Node for EngineCacheEntrySet {
6067 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6068 let query = self.selection.select("id");
6069 let graphql_client = self.graphql_client.clone();
6070 async move { query.execute(graphql_client).await }
6071 }
6072}
6073#[derive(Clone)]
6074pub struct EnumTypeDef {
6075 pub proc: Option<Arc<DaggerSessionProc>>,
6076 pub selection: Selection,
6077 pub graphql_client: DynGraphQLClient,
6078}
6079impl IntoID<Id> for EnumTypeDef {
6080 fn into_id(
6081 self,
6082 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6083 Box::pin(async move { self.id().await })
6084 }
6085}
6086impl Loadable for EnumTypeDef {
6087 fn graphql_type() -> &'static str {
6088 "EnumTypeDef"
6089 }
6090 fn from_query(
6091 proc: Option<Arc<DaggerSessionProc>>,
6092 selection: Selection,
6093 graphql_client: DynGraphQLClient,
6094 ) -> Self {
6095 Self {
6096 proc,
6097 selection,
6098 graphql_client,
6099 }
6100 }
6101}
6102impl EnumTypeDef {
6103 pub async fn description(&self) -> Result<String, DaggerError> {
6105 let query = self.selection.select("description");
6106 query.execute(self.graphql_client.clone()).await
6107 }
6108 pub async fn id(&self) -> Result<Id, DaggerError> {
6110 let query = self.selection.select("id");
6111 query.execute(self.graphql_client.clone()).await
6112 }
6113 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6115 let query = self.selection.select("members");
6116 let query = query.select("id");
6117 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6118 Ok(ids
6119 .into_iter()
6120 .map(|id| EnumValueTypeDef {
6121 proc: self.proc.clone(),
6122 selection: crate::querybuilder::query()
6123 .select("node")
6124 .arg("id", &id.0)
6125 .inline_fragment("EnumValueTypeDef"),
6126 graphql_client: self.graphql_client.clone(),
6127 })
6128 .collect())
6129 }
6130 pub async fn name(&self) -> Result<String, DaggerError> {
6132 let query = self.selection.select("name");
6133 query.execute(self.graphql_client.clone()).await
6134 }
6135 pub fn source_map(&self) -> SourceMap {
6137 let query = self.selection.select("sourceMap");
6138 SourceMap {
6139 proc: self.proc.clone(),
6140 selection: query,
6141 graphql_client: self.graphql_client.clone(),
6142 }
6143 }
6144 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6146 let query = self.selection.select("sourceModuleName");
6147 query.execute(self.graphql_client.clone()).await
6148 }
6149 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6151 let query = self.selection.select("values");
6152 let query = query.select("id");
6153 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6154 Ok(ids
6155 .into_iter()
6156 .map(|id| EnumValueTypeDef {
6157 proc: self.proc.clone(),
6158 selection: crate::querybuilder::query()
6159 .select("node")
6160 .arg("id", &id.0)
6161 .inline_fragment("EnumValueTypeDef"),
6162 graphql_client: self.graphql_client.clone(),
6163 })
6164 .collect())
6165 }
6166}
6167impl Node for EnumTypeDef {
6168 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6169 let query = self.selection.select("id");
6170 let graphql_client = self.graphql_client.clone();
6171 async move { query.execute(graphql_client).await }
6172 }
6173}
6174#[derive(Clone)]
6175pub struct EnumValueTypeDef {
6176 pub proc: Option<Arc<DaggerSessionProc>>,
6177 pub selection: Selection,
6178 pub graphql_client: DynGraphQLClient,
6179}
6180impl IntoID<Id> for EnumValueTypeDef {
6181 fn into_id(
6182 self,
6183 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6184 Box::pin(async move { self.id().await })
6185 }
6186}
6187impl Loadable for EnumValueTypeDef {
6188 fn graphql_type() -> &'static str {
6189 "EnumValueTypeDef"
6190 }
6191 fn from_query(
6192 proc: Option<Arc<DaggerSessionProc>>,
6193 selection: Selection,
6194 graphql_client: DynGraphQLClient,
6195 ) -> Self {
6196 Self {
6197 proc,
6198 selection,
6199 graphql_client,
6200 }
6201 }
6202}
6203impl EnumValueTypeDef {
6204 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6206 let query = self.selection.select("deprecated");
6207 query.execute(self.graphql_client.clone()).await
6208 }
6209 pub async fn description(&self) -> Result<String, DaggerError> {
6211 let query = self.selection.select("description");
6212 query.execute(self.graphql_client.clone()).await
6213 }
6214 pub async fn id(&self) -> Result<Id, DaggerError> {
6216 let query = self.selection.select("id");
6217 query.execute(self.graphql_client.clone()).await
6218 }
6219 pub async fn name(&self) -> Result<String, DaggerError> {
6221 let query = self.selection.select("name");
6222 query.execute(self.graphql_client.clone()).await
6223 }
6224 pub fn source_map(&self) -> SourceMap {
6226 let query = self.selection.select("sourceMap");
6227 SourceMap {
6228 proc: self.proc.clone(),
6229 selection: query,
6230 graphql_client: self.graphql_client.clone(),
6231 }
6232 }
6233 pub async fn value(&self) -> Result<String, DaggerError> {
6235 let query = self.selection.select("value");
6236 query.execute(self.graphql_client.clone()).await
6237 }
6238}
6239impl Node for EnumValueTypeDef {
6240 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6241 let query = self.selection.select("id");
6242 let graphql_client = self.graphql_client.clone();
6243 async move { query.execute(graphql_client).await }
6244 }
6245}
6246#[derive(Clone)]
6247pub struct Env {
6248 pub proc: Option<Arc<DaggerSessionProc>>,
6249 pub selection: Selection,
6250 pub graphql_client: DynGraphQLClient,
6251}
6252#[derive(Builder, Debug, PartialEq)]
6253pub struct EnvChecksOpts<'a> {
6254 #[builder(setter(into, strip_option), default)]
6256 pub include: Option<Vec<&'a str>>,
6257 #[builder(setter(into, strip_option), default)]
6259 pub no_generate: Option<bool>,
6260}
6261#[derive(Builder, Debug, PartialEq)]
6262pub struct EnvServicesOpts<'a> {
6263 #[builder(setter(into, strip_option), default)]
6265 pub include: Option<Vec<&'a str>>,
6266}
6267impl IntoID<Id> for Env {
6268 fn into_id(
6269 self,
6270 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6271 Box::pin(async move { self.id().await })
6272 }
6273}
6274impl Loadable for Env {
6275 fn graphql_type() -> &'static str {
6276 "Env"
6277 }
6278 fn from_query(
6279 proc: Option<Arc<DaggerSessionProc>>,
6280 selection: Selection,
6281 graphql_client: DynGraphQLClient,
6282 ) -> Self {
6283 Self {
6284 proc,
6285 selection,
6286 graphql_client,
6287 }
6288 }
6289}
6290impl Env {
6291 pub fn check(&self, name: impl Into<String>) -> Check {
6297 let mut query = self.selection.select("check");
6298 query = query.arg("name", name.into());
6299 Check {
6300 proc: self.proc.clone(),
6301 selection: query,
6302 graphql_client: self.graphql_client.clone(),
6303 }
6304 }
6305 pub fn checks(&self) -> CheckGroup {
6311 let query = self.selection.select("checks");
6312 CheckGroup {
6313 proc: self.proc.clone(),
6314 selection: query,
6315 graphql_client: self.graphql_client.clone(),
6316 }
6317 }
6318 pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6324 let mut query = self.selection.select("checks");
6325 if let Some(include) = opts.include {
6326 query = query.arg("include", include);
6327 }
6328 if let Some(no_generate) = opts.no_generate {
6329 query = query.arg("noGenerate", no_generate);
6330 }
6331 CheckGroup {
6332 proc: self.proc.clone(),
6333 selection: query,
6334 graphql_client: self.graphql_client.clone(),
6335 }
6336 }
6337 pub async fn id(&self) -> Result<Id, DaggerError> {
6339 let query = self.selection.select("id");
6340 query.execute(self.graphql_client.clone()).await
6341 }
6342 pub fn input(&self, name: impl Into<String>) -> Binding {
6344 let mut query = self.selection.select("input");
6345 query = query.arg("name", name.into());
6346 Binding {
6347 proc: self.proc.clone(),
6348 selection: query,
6349 graphql_client: self.graphql_client.clone(),
6350 }
6351 }
6352 pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6354 let query = self.selection.select("inputs");
6355 let query = query.select("id");
6356 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6357 Ok(ids
6358 .into_iter()
6359 .map(|id| Binding {
6360 proc: self.proc.clone(),
6361 selection: crate::querybuilder::query()
6362 .select("node")
6363 .arg("id", &id.0)
6364 .inline_fragment("Binding"),
6365 graphql_client: self.graphql_client.clone(),
6366 })
6367 .collect())
6368 }
6369 pub fn output(&self, name: impl Into<String>) -> Binding {
6371 let mut query = self.selection.select("output");
6372 query = query.arg("name", name.into());
6373 Binding {
6374 proc: self.proc.clone(),
6375 selection: query,
6376 graphql_client: self.graphql_client.clone(),
6377 }
6378 }
6379 pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6381 let query = self.selection.select("outputs");
6382 let query = query.select("id");
6383 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6384 Ok(ids
6385 .into_iter()
6386 .map(|id| Binding {
6387 proc: self.proc.clone(),
6388 selection: crate::querybuilder::query()
6389 .select("node")
6390 .arg("id", &id.0)
6391 .inline_fragment("Binding"),
6392 graphql_client: self.graphql_client.clone(),
6393 })
6394 .collect())
6395 }
6396 pub fn services(&self) -> UpGroup {
6402 let query = self.selection.select("services");
6403 UpGroup {
6404 proc: self.proc.clone(),
6405 selection: query,
6406 graphql_client: self.graphql_client.clone(),
6407 }
6408 }
6409 pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6415 let mut query = self.selection.select("services");
6416 if let Some(include) = opts.include {
6417 query = query.arg("include", include);
6418 }
6419 UpGroup {
6420 proc: self.proc.clone(),
6421 selection: query,
6422 graphql_client: self.graphql_client.clone(),
6423 }
6424 }
6425 pub fn with_address_input(
6433 &self,
6434 name: impl Into<String>,
6435 value: impl IntoID<Id>,
6436 description: impl Into<String>,
6437 ) -> Env {
6438 let mut query = self.selection.select("withAddressInput");
6439 query = query.arg("name", name.into());
6440 query = query.arg_lazy(
6441 "value",
6442 Box::new(move || {
6443 let value = value.clone();
6444 Box::pin(async move { value.into_id().await.unwrap().quote() })
6445 }),
6446 );
6447 query = query.arg("description", description.into());
6448 Env {
6449 proc: self.proc.clone(),
6450 selection: query,
6451 graphql_client: self.graphql_client.clone(),
6452 }
6453 }
6454 pub fn with_address_output(
6461 &self,
6462 name: impl Into<String>,
6463 description: impl Into<String>,
6464 ) -> Env {
6465 let mut query = self.selection.select("withAddressOutput");
6466 query = query.arg("name", name.into());
6467 query = query.arg("description", description.into());
6468 Env {
6469 proc: self.proc.clone(),
6470 selection: query,
6471 graphql_client: self.graphql_client.clone(),
6472 }
6473 }
6474 pub fn with_cache_volume_input(
6482 &self,
6483 name: impl Into<String>,
6484 value: impl IntoID<Id>,
6485 description: impl Into<String>,
6486 ) -> Env {
6487 let mut query = self.selection.select("withCacheVolumeInput");
6488 query = query.arg("name", name.into());
6489 query = query.arg_lazy(
6490 "value",
6491 Box::new(move || {
6492 let value = value.clone();
6493 Box::pin(async move { value.into_id().await.unwrap().quote() })
6494 }),
6495 );
6496 query = query.arg("description", description.into());
6497 Env {
6498 proc: self.proc.clone(),
6499 selection: query,
6500 graphql_client: self.graphql_client.clone(),
6501 }
6502 }
6503 pub fn with_cache_volume_output(
6510 &self,
6511 name: impl Into<String>,
6512 description: impl Into<String>,
6513 ) -> Env {
6514 let mut query = self.selection.select("withCacheVolumeOutput");
6515 query = query.arg("name", name.into());
6516 query = query.arg("description", description.into());
6517 Env {
6518 proc: self.proc.clone(),
6519 selection: query,
6520 graphql_client: self.graphql_client.clone(),
6521 }
6522 }
6523 pub fn with_changeset_input(
6531 &self,
6532 name: impl Into<String>,
6533 value: impl IntoID<Id>,
6534 description: impl Into<String>,
6535 ) -> Env {
6536 let mut query = self.selection.select("withChangesetInput");
6537 query = query.arg("name", name.into());
6538 query = query.arg_lazy(
6539 "value",
6540 Box::new(move || {
6541 let value = value.clone();
6542 Box::pin(async move { value.into_id().await.unwrap().quote() })
6543 }),
6544 );
6545 query = query.arg("description", description.into());
6546 Env {
6547 proc: self.proc.clone(),
6548 selection: query,
6549 graphql_client: self.graphql_client.clone(),
6550 }
6551 }
6552 pub fn with_changeset_output(
6559 &self,
6560 name: impl Into<String>,
6561 description: impl Into<String>,
6562 ) -> Env {
6563 let mut query = self.selection.select("withChangesetOutput");
6564 query = query.arg("name", name.into());
6565 query = query.arg("description", description.into());
6566 Env {
6567 proc: self.proc.clone(),
6568 selection: query,
6569 graphql_client: self.graphql_client.clone(),
6570 }
6571 }
6572 pub fn with_check_group_input(
6580 &self,
6581 name: impl Into<String>,
6582 value: impl IntoID<Id>,
6583 description: impl Into<String>,
6584 ) -> Env {
6585 let mut query = self.selection.select("withCheckGroupInput");
6586 query = query.arg("name", name.into());
6587 query = query.arg_lazy(
6588 "value",
6589 Box::new(move || {
6590 let value = value.clone();
6591 Box::pin(async move { value.into_id().await.unwrap().quote() })
6592 }),
6593 );
6594 query = query.arg("description", description.into());
6595 Env {
6596 proc: self.proc.clone(),
6597 selection: query,
6598 graphql_client: self.graphql_client.clone(),
6599 }
6600 }
6601 pub fn with_check_group_output(
6608 &self,
6609 name: impl Into<String>,
6610 description: impl Into<String>,
6611 ) -> Env {
6612 let mut query = self.selection.select("withCheckGroupOutput");
6613 query = query.arg("name", name.into());
6614 query = query.arg("description", description.into());
6615 Env {
6616 proc: self.proc.clone(),
6617 selection: query,
6618 graphql_client: self.graphql_client.clone(),
6619 }
6620 }
6621 pub fn with_check_input(
6629 &self,
6630 name: impl Into<String>,
6631 value: impl IntoID<Id>,
6632 description: impl Into<String>,
6633 ) -> Env {
6634 let mut query = self.selection.select("withCheckInput");
6635 query = query.arg("name", name.into());
6636 query = query.arg_lazy(
6637 "value",
6638 Box::new(move || {
6639 let value = value.clone();
6640 Box::pin(async move { value.into_id().await.unwrap().quote() })
6641 }),
6642 );
6643 query = query.arg("description", description.into());
6644 Env {
6645 proc: self.proc.clone(),
6646 selection: query,
6647 graphql_client: self.graphql_client.clone(),
6648 }
6649 }
6650 pub fn with_check_output(
6657 &self,
6658 name: impl Into<String>,
6659 description: impl Into<String>,
6660 ) -> Env {
6661 let mut query = self.selection.select("withCheckOutput");
6662 query = query.arg("name", name.into());
6663 query = query.arg("description", description.into());
6664 Env {
6665 proc: self.proc.clone(),
6666 selection: query,
6667 graphql_client: self.graphql_client.clone(),
6668 }
6669 }
6670 pub fn with_cloud_input(
6678 &self,
6679 name: impl Into<String>,
6680 value: impl IntoID<Id>,
6681 description: impl Into<String>,
6682 ) -> Env {
6683 let mut query = self.selection.select("withCloudInput");
6684 query = query.arg("name", name.into());
6685 query = query.arg_lazy(
6686 "value",
6687 Box::new(move || {
6688 let value = value.clone();
6689 Box::pin(async move { value.into_id().await.unwrap().quote() })
6690 }),
6691 );
6692 query = query.arg("description", description.into());
6693 Env {
6694 proc: self.proc.clone(),
6695 selection: query,
6696 graphql_client: self.graphql_client.clone(),
6697 }
6698 }
6699 pub fn with_cloud_output(
6706 &self,
6707 name: impl Into<String>,
6708 description: impl Into<String>,
6709 ) -> Env {
6710 let mut query = self.selection.select("withCloudOutput");
6711 query = query.arg("name", name.into());
6712 query = query.arg("description", description.into());
6713 Env {
6714 proc: self.proc.clone(),
6715 selection: query,
6716 graphql_client: self.graphql_client.clone(),
6717 }
6718 }
6719 pub fn with_container_input(
6727 &self,
6728 name: impl Into<String>,
6729 value: impl IntoID<Id>,
6730 description: impl Into<String>,
6731 ) -> Env {
6732 let mut query = self.selection.select("withContainerInput");
6733 query = query.arg("name", name.into());
6734 query = query.arg_lazy(
6735 "value",
6736 Box::new(move || {
6737 let value = value.clone();
6738 Box::pin(async move { value.into_id().await.unwrap().quote() })
6739 }),
6740 );
6741 query = query.arg("description", description.into());
6742 Env {
6743 proc: self.proc.clone(),
6744 selection: query,
6745 graphql_client: self.graphql_client.clone(),
6746 }
6747 }
6748 pub fn with_container_output(
6755 &self,
6756 name: impl Into<String>,
6757 description: impl Into<String>,
6758 ) -> Env {
6759 let mut query = self.selection.select("withContainerOutput");
6760 query = query.arg("name", name.into());
6761 query = query.arg("description", description.into());
6762 Env {
6763 proc: self.proc.clone(),
6764 selection: query,
6765 graphql_client: self.graphql_client.clone(),
6766 }
6767 }
6768 pub fn with_current_module(&self) -> Env {
6771 let query = self.selection.select("withCurrentModule");
6772 Env {
6773 proc: self.proc.clone(),
6774 selection: query,
6775 graphql_client: self.graphql_client.clone(),
6776 }
6777 }
6778 pub fn with_diff_stat_input(
6786 &self,
6787 name: impl Into<String>,
6788 value: impl IntoID<Id>,
6789 description: impl Into<String>,
6790 ) -> Env {
6791 let mut query = self.selection.select("withDiffStatInput");
6792 query = query.arg("name", name.into());
6793 query = query.arg_lazy(
6794 "value",
6795 Box::new(move || {
6796 let value = value.clone();
6797 Box::pin(async move { value.into_id().await.unwrap().quote() })
6798 }),
6799 );
6800 query = query.arg("description", description.into());
6801 Env {
6802 proc: self.proc.clone(),
6803 selection: query,
6804 graphql_client: self.graphql_client.clone(),
6805 }
6806 }
6807 pub fn with_diff_stat_output(
6814 &self,
6815 name: impl Into<String>,
6816 description: impl Into<String>,
6817 ) -> Env {
6818 let mut query = self.selection.select("withDiffStatOutput");
6819 query = query.arg("name", name.into());
6820 query = query.arg("description", description.into());
6821 Env {
6822 proc: self.proc.clone(),
6823 selection: query,
6824 graphql_client: self.graphql_client.clone(),
6825 }
6826 }
6827 pub fn with_directory_input(
6835 &self,
6836 name: impl Into<String>,
6837 value: impl IntoID<Id>,
6838 description: impl Into<String>,
6839 ) -> Env {
6840 let mut query = self.selection.select("withDirectoryInput");
6841 query = query.arg("name", name.into());
6842 query = query.arg_lazy(
6843 "value",
6844 Box::new(move || {
6845 let value = value.clone();
6846 Box::pin(async move { value.into_id().await.unwrap().quote() })
6847 }),
6848 );
6849 query = query.arg("description", description.into());
6850 Env {
6851 proc: self.proc.clone(),
6852 selection: query,
6853 graphql_client: self.graphql_client.clone(),
6854 }
6855 }
6856 pub fn with_directory_output(
6863 &self,
6864 name: impl Into<String>,
6865 description: impl Into<String>,
6866 ) -> Env {
6867 let mut query = self.selection.select("withDirectoryOutput");
6868 query = query.arg("name", name.into());
6869 query = query.arg("description", description.into());
6870 Env {
6871 proc: self.proc.clone(),
6872 selection: query,
6873 graphql_client: self.graphql_client.clone(),
6874 }
6875 }
6876 pub fn with_env_file_input(
6884 &self,
6885 name: impl Into<String>,
6886 value: impl IntoID<Id>,
6887 description: impl Into<String>,
6888 ) -> Env {
6889 let mut query = self.selection.select("withEnvFileInput");
6890 query = query.arg("name", name.into());
6891 query = query.arg_lazy(
6892 "value",
6893 Box::new(move || {
6894 let value = value.clone();
6895 Box::pin(async move { value.into_id().await.unwrap().quote() })
6896 }),
6897 );
6898 query = query.arg("description", description.into());
6899 Env {
6900 proc: self.proc.clone(),
6901 selection: query,
6902 graphql_client: self.graphql_client.clone(),
6903 }
6904 }
6905 pub fn with_env_file_output(
6912 &self,
6913 name: impl Into<String>,
6914 description: impl Into<String>,
6915 ) -> Env {
6916 let mut query = self.selection.select("withEnvFileOutput");
6917 query = query.arg("name", name.into());
6918 query = query.arg("description", description.into());
6919 Env {
6920 proc: self.proc.clone(),
6921 selection: query,
6922 graphql_client: self.graphql_client.clone(),
6923 }
6924 }
6925 pub fn with_env_input(
6933 &self,
6934 name: impl Into<String>,
6935 value: impl IntoID<Id>,
6936 description: impl Into<String>,
6937 ) -> Env {
6938 let mut query = self.selection.select("withEnvInput");
6939 query = query.arg("name", name.into());
6940 query = query.arg_lazy(
6941 "value",
6942 Box::new(move || {
6943 let value = value.clone();
6944 Box::pin(async move { value.into_id().await.unwrap().quote() })
6945 }),
6946 );
6947 query = query.arg("description", description.into());
6948 Env {
6949 proc: self.proc.clone(),
6950 selection: query,
6951 graphql_client: self.graphql_client.clone(),
6952 }
6953 }
6954 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6961 let mut query = self.selection.select("withEnvOutput");
6962 query = query.arg("name", name.into());
6963 query = query.arg("description", description.into());
6964 Env {
6965 proc: self.proc.clone(),
6966 selection: query,
6967 graphql_client: self.graphql_client.clone(),
6968 }
6969 }
6970 pub fn with_file_input(
6978 &self,
6979 name: impl Into<String>,
6980 value: impl IntoID<Id>,
6981 description: impl Into<String>,
6982 ) -> Env {
6983 let mut query = self.selection.select("withFileInput");
6984 query = query.arg("name", name.into());
6985 query = query.arg_lazy(
6986 "value",
6987 Box::new(move || {
6988 let value = value.clone();
6989 Box::pin(async move { value.into_id().await.unwrap().quote() })
6990 }),
6991 );
6992 query = query.arg("description", description.into());
6993 Env {
6994 proc: self.proc.clone(),
6995 selection: query,
6996 graphql_client: self.graphql_client.clone(),
6997 }
6998 }
6999 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7006 let mut query = self.selection.select("withFileOutput");
7007 query = query.arg("name", name.into());
7008 query = query.arg("description", description.into());
7009 Env {
7010 proc: self.proc.clone(),
7011 selection: query,
7012 graphql_client: self.graphql_client.clone(),
7013 }
7014 }
7015 pub fn with_generator_group_input(
7023 &self,
7024 name: impl Into<String>,
7025 value: impl IntoID<Id>,
7026 description: impl Into<String>,
7027 ) -> Env {
7028 let mut query = self.selection.select("withGeneratorGroupInput");
7029 query = query.arg("name", name.into());
7030 query = query.arg_lazy(
7031 "value",
7032 Box::new(move || {
7033 let value = value.clone();
7034 Box::pin(async move { value.into_id().await.unwrap().quote() })
7035 }),
7036 );
7037 query = query.arg("description", description.into());
7038 Env {
7039 proc: self.proc.clone(),
7040 selection: query,
7041 graphql_client: self.graphql_client.clone(),
7042 }
7043 }
7044 pub fn with_generator_group_output(
7051 &self,
7052 name: impl Into<String>,
7053 description: impl Into<String>,
7054 ) -> Env {
7055 let mut query = self.selection.select("withGeneratorGroupOutput");
7056 query = query.arg("name", name.into());
7057 query = query.arg("description", description.into());
7058 Env {
7059 proc: self.proc.clone(),
7060 selection: query,
7061 graphql_client: self.graphql_client.clone(),
7062 }
7063 }
7064 pub fn with_generator_input(
7072 &self,
7073 name: impl Into<String>,
7074 value: impl IntoID<Id>,
7075 description: impl Into<String>,
7076 ) -> Env {
7077 let mut query = self.selection.select("withGeneratorInput");
7078 query = query.arg("name", name.into());
7079 query = query.arg_lazy(
7080 "value",
7081 Box::new(move || {
7082 let value = value.clone();
7083 Box::pin(async move { value.into_id().await.unwrap().quote() })
7084 }),
7085 );
7086 query = query.arg("description", description.into());
7087 Env {
7088 proc: self.proc.clone(),
7089 selection: query,
7090 graphql_client: self.graphql_client.clone(),
7091 }
7092 }
7093 pub fn with_generator_output(
7100 &self,
7101 name: impl Into<String>,
7102 description: impl Into<String>,
7103 ) -> Env {
7104 let mut query = self.selection.select("withGeneratorOutput");
7105 query = query.arg("name", name.into());
7106 query = query.arg("description", description.into());
7107 Env {
7108 proc: self.proc.clone(),
7109 selection: query,
7110 graphql_client: self.graphql_client.clone(),
7111 }
7112 }
7113 pub fn with_git_ref_input(
7121 &self,
7122 name: impl Into<String>,
7123 value: impl IntoID<Id>,
7124 description: impl Into<String>,
7125 ) -> Env {
7126 let mut query = self.selection.select("withGitRefInput");
7127 query = query.arg("name", name.into());
7128 query = query.arg_lazy(
7129 "value",
7130 Box::new(move || {
7131 let value = value.clone();
7132 Box::pin(async move { value.into_id().await.unwrap().quote() })
7133 }),
7134 );
7135 query = query.arg("description", description.into());
7136 Env {
7137 proc: self.proc.clone(),
7138 selection: query,
7139 graphql_client: self.graphql_client.clone(),
7140 }
7141 }
7142 pub fn with_git_ref_output(
7149 &self,
7150 name: impl Into<String>,
7151 description: impl Into<String>,
7152 ) -> Env {
7153 let mut query = self.selection.select("withGitRefOutput");
7154 query = query.arg("name", name.into());
7155 query = query.arg("description", description.into());
7156 Env {
7157 proc: self.proc.clone(),
7158 selection: query,
7159 graphql_client: self.graphql_client.clone(),
7160 }
7161 }
7162 pub fn with_git_repository_input(
7170 &self,
7171 name: impl Into<String>,
7172 value: impl IntoID<Id>,
7173 description: impl Into<String>,
7174 ) -> Env {
7175 let mut query = self.selection.select("withGitRepositoryInput");
7176 query = query.arg("name", name.into());
7177 query = query.arg_lazy(
7178 "value",
7179 Box::new(move || {
7180 let value = value.clone();
7181 Box::pin(async move { value.into_id().await.unwrap().quote() })
7182 }),
7183 );
7184 query = query.arg("description", description.into());
7185 Env {
7186 proc: self.proc.clone(),
7187 selection: query,
7188 graphql_client: self.graphql_client.clone(),
7189 }
7190 }
7191 pub fn with_git_repository_output(
7198 &self,
7199 name: impl Into<String>,
7200 description: impl Into<String>,
7201 ) -> Env {
7202 let mut query = self.selection.select("withGitRepositoryOutput");
7203 query = query.arg("name", name.into());
7204 query = query.arg("description", description.into());
7205 Env {
7206 proc: self.proc.clone(),
7207 selection: query,
7208 graphql_client: self.graphql_client.clone(),
7209 }
7210 }
7211 pub fn with_http_state_input(
7219 &self,
7220 name: impl Into<String>,
7221 value: impl IntoID<Id>,
7222 description: impl Into<String>,
7223 ) -> Env {
7224 let mut query = self.selection.select("withHTTPStateInput");
7225 query = query.arg("name", name.into());
7226 query = query.arg_lazy(
7227 "value",
7228 Box::new(move || {
7229 let value = value.clone();
7230 Box::pin(async move { value.into_id().await.unwrap().quote() })
7231 }),
7232 );
7233 query = query.arg("description", description.into());
7234 Env {
7235 proc: self.proc.clone(),
7236 selection: query,
7237 graphql_client: self.graphql_client.clone(),
7238 }
7239 }
7240 pub fn with_http_state_output(
7247 &self,
7248 name: impl Into<String>,
7249 description: impl Into<String>,
7250 ) -> Env {
7251 let mut query = self.selection.select("withHTTPStateOutput");
7252 query = query.arg("name", name.into());
7253 query = query.arg("description", description.into());
7254 Env {
7255 proc: self.proc.clone(),
7256 selection: query,
7257 graphql_client: self.graphql_client.clone(),
7258 }
7259 }
7260 pub fn with_json_value_input(
7268 &self,
7269 name: impl Into<String>,
7270 value: impl IntoID<Id>,
7271 description: impl Into<String>,
7272 ) -> Env {
7273 let mut query = self.selection.select("withJSONValueInput");
7274 query = query.arg("name", name.into());
7275 query = query.arg_lazy(
7276 "value",
7277 Box::new(move || {
7278 let value = value.clone();
7279 Box::pin(async move { value.into_id().await.unwrap().quote() })
7280 }),
7281 );
7282 query = query.arg("description", description.into());
7283 Env {
7284 proc: self.proc.clone(),
7285 selection: query,
7286 graphql_client: self.graphql_client.clone(),
7287 }
7288 }
7289 pub fn with_json_value_output(
7296 &self,
7297 name: impl Into<String>,
7298 description: impl Into<String>,
7299 ) -> Env {
7300 let mut query = self.selection.select("withJSONValueOutput");
7301 query = query.arg("name", name.into());
7302 query = query.arg("description", description.into());
7303 Env {
7304 proc: self.proc.clone(),
7305 selection: query,
7306 graphql_client: self.graphql_client.clone(),
7307 }
7308 }
7309 pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7312 let mut query = self.selection.select("withMainModule");
7313 query = query.arg_lazy(
7314 "module",
7315 Box::new(move || {
7316 let module = module.clone();
7317 Box::pin(async move { module.into_id().await.unwrap().quote() })
7318 }),
7319 );
7320 Env {
7321 proc: self.proc.clone(),
7322 selection: query,
7323 graphql_client: self.graphql_client.clone(),
7324 }
7325 }
7326 pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7329 let mut query = self.selection.select("withModule");
7330 query = query.arg_lazy(
7331 "module",
7332 Box::new(move || {
7333 let module = module.clone();
7334 Box::pin(async move { module.into_id().await.unwrap().quote() })
7335 }),
7336 );
7337 Env {
7338 proc: self.proc.clone(),
7339 selection: query,
7340 graphql_client: self.graphql_client.clone(),
7341 }
7342 }
7343 pub fn with_module_config_client_input(
7351 &self,
7352 name: impl Into<String>,
7353 value: impl IntoID<Id>,
7354 description: impl Into<String>,
7355 ) -> Env {
7356 let mut query = self.selection.select("withModuleConfigClientInput");
7357 query = query.arg("name", name.into());
7358 query = query.arg_lazy(
7359 "value",
7360 Box::new(move || {
7361 let value = value.clone();
7362 Box::pin(async move { value.into_id().await.unwrap().quote() })
7363 }),
7364 );
7365 query = query.arg("description", description.into());
7366 Env {
7367 proc: self.proc.clone(),
7368 selection: query,
7369 graphql_client: self.graphql_client.clone(),
7370 }
7371 }
7372 pub fn with_module_config_client_output(
7379 &self,
7380 name: impl Into<String>,
7381 description: impl Into<String>,
7382 ) -> Env {
7383 let mut query = self.selection.select("withModuleConfigClientOutput");
7384 query = query.arg("name", name.into());
7385 query = query.arg("description", description.into());
7386 Env {
7387 proc: self.proc.clone(),
7388 selection: query,
7389 graphql_client: self.graphql_client.clone(),
7390 }
7391 }
7392 pub fn with_module_input(
7400 &self,
7401 name: impl Into<String>,
7402 value: impl IntoID<Id>,
7403 description: impl Into<String>,
7404 ) -> Env {
7405 let mut query = self.selection.select("withModuleInput");
7406 query = query.arg("name", name.into());
7407 query = query.arg_lazy(
7408 "value",
7409 Box::new(move || {
7410 let value = value.clone();
7411 Box::pin(async move { value.into_id().await.unwrap().quote() })
7412 }),
7413 );
7414 query = query.arg("description", description.into());
7415 Env {
7416 proc: self.proc.clone(),
7417 selection: query,
7418 graphql_client: self.graphql_client.clone(),
7419 }
7420 }
7421 pub fn with_module_output(
7428 &self,
7429 name: impl Into<String>,
7430 description: impl Into<String>,
7431 ) -> Env {
7432 let mut query = self.selection.select("withModuleOutput");
7433 query = query.arg("name", name.into());
7434 query = query.arg("description", description.into());
7435 Env {
7436 proc: self.proc.clone(),
7437 selection: query,
7438 graphql_client: self.graphql_client.clone(),
7439 }
7440 }
7441 pub fn with_module_source_input(
7449 &self,
7450 name: impl Into<String>,
7451 value: impl IntoID<Id>,
7452 description: impl Into<String>,
7453 ) -> Env {
7454 let mut query = self.selection.select("withModuleSourceInput");
7455 query = query.arg("name", name.into());
7456 query = query.arg_lazy(
7457 "value",
7458 Box::new(move || {
7459 let value = value.clone();
7460 Box::pin(async move { value.into_id().await.unwrap().quote() })
7461 }),
7462 );
7463 query = query.arg("description", description.into());
7464 Env {
7465 proc: self.proc.clone(),
7466 selection: query,
7467 graphql_client: self.graphql_client.clone(),
7468 }
7469 }
7470 pub fn with_module_source_output(
7477 &self,
7478 name: impl Into<String>,
7479 description: impl Into<String>,
7480 ) -> Env {
7481 let mut query = self.selection.select("withModuleSourceOutput");
7482 query = query.arg("name", name.into());
7483 query = query.arg("description", description.into());
7484 Env {
7485 proc: self.proc.clone(),
7486 selection: query,
7487 graphql_client: self.graphql_client.clone(),
7488 }
7489 }
7490 pub fn with_search_result_input(
7498 &self,
7499 name: impl Into<String>,
7500 value: impl IntoID<Id>,
7501 description: impl Into<String>,
7502 ) -> Env {
7503 let mut query = self.selection.select("withSearchResultInput");
7504 query = query.arg("name", name.into());
7505 query = query.arg_lazy(
7506 "value",
7507 Box::new(move || {
7508 let value = value.clone();
7509 Box::pin(async move { value.into_id().await.unwrap().quote() })
7510 }),
7511 );
7512 query = query.arg("description", description.into());
7513 Env {
7514 proc: self.proc.clone(),
7515 selection: query,
7516 graphql_client: self.graphql_client.clone(),
7517 }
7518 }
7519 pub fn with_search_result_output(
7526 &self,
7527 name: impl Into<String>,
7528 description: impl Into<String>,
7529 ) -> Env {
7530 let mut query = self.selection.select("withSearchResultOutput");
7531 query = query.arg("name", name.into());
7532 query = query.arg("description", description.into());
7533 Env {
7534 proc: self.proc.clone(),
7535 selection: query,
7536 graphql_client: self.graphql_client.clone(),
7537 }
7538 }
7539 pub fn with_search_submatch_input(
7547 &self,
7548 name: impl Into<String>,
7549 value: impl IntoID<Id>,
7550 description: impl Into<String>,
7551 ) -> Env {
7552 let mut query = self.selection.select("withSearchSubmatchInput");
7553 query = query.arg("name", name.into());
7554 query = query.arg_lazy(
7555 "value",
7556 Box::new(move || {
7557 let value = value.clone();
7558 Box::pin(async move { value.into_id().await.unwrap().quote() })
7559 }),
7560 );
7561 query = query.arg("description", description.into());
7562 Env {
7563 proc: self.proc.clone(),
7564 selection: query,
7565 graphql_client: self.graphql_client.clone(),
7566 }
7567 }
7568 pub fn with_search_submatch_output(
7575 &self,
7576 name: impl Into<String>,
7577 description: impl Into<String>,
7578 ) -> Env {
7579 let mut query = self.selection.select("withSearchSubmatchOutput");
7580 query = query.arg("name", name.into());
7581 query = query.arg("description", description.into());
7582 Env {
7583 proc: self.proc.clone(),
7584 selection: query,
7585 graphql_client: self.graphql_client.clone(),
7586 }
7587 }
7588 pub fn with_secret_input(
7596 &self,
7597 name: impl Into<String>,
7598 value: impl IntoID<Id>,
7599 description: impl Into<String>,
7600 ) -> Env {
7601 let mut query = self.selection.select("withSecretInput");
7602 query = query.arg("name", name.into());
7603 query = query.arg_lazy(
7604 "value",
7605 Box::new(move || {
7606 let value = value.clone();
7607 Box::pin(async move { value.into_id().await.unwrap().quote() })
7608 }),
7609 );
7610 query = query.arg("description", description.into());
7611 Env {
7612 proc: self.proc.clone(),
7613 selection: query,
7614 graphql_client: self.graphql_client.clone(),
7615 }
7616 }
7617 pub fn with_secret_output(
7624 &self,
7625 name: impl Into<String>,
7626 description: impl Into<String>,
7627 ) -> Env {
7628 let mut query = self.selection.select("withSecretOutput");
7629 query = query.arg("name", name.into());
7630 query = query.arg("description", description.into());
7631 Env {
7632 proc: self.proc.clone(),
7633 selection: query,
7634 graphql_client: self.graphql_client.clone(),
7635 }
7636 }
7637 pub fn with_service_input(
7645 &self,
7646 name: impl Into<String>,
7647 value: impl IntoID<Id>,
7648 description: impl Into<String>,
7649 ) -> Env {
7650 let mut query = self.selection.select("withServiceInput");
7651 query = query.arg("name", name.into());
7652 query = query.arg_lazy(
7653 "value",
7654 Box::new(move || {
7655 let value = value.clone();
7656 Box::pin(async move { value.into_id().await.unwrap().quote() })
7657 }),
7658 );
7659 query = query.arg("description", description.into());
7660 Env {
7661 proc: self.proc.clone(),
7662 selection: query,
7663 graphql_client: self.graphql_client.clone(),
7664 }
7665 }
7666 pub fn with_service_output(
7673 &self,
7674 name: impl Into<String>,
7675 description: impl Into<String>,
7676 ) -> Env {
7677 let mut query = self.selection.select("withServiceOutput");
7678 query = query.arg("name", name.into());
7679 query = query.arg("description", description.into());
7680 Env {
7681 proc: self.proc.clone(),
7682 selection: query,
7683 graphql_client: self.graphql_client.clone(),
7684 }
7685 }
7686 pub fn with_socket_input(
7694 &self,
7695 name: impl Into<String>,
7696 value: impl IntoID<Id>,
7697 description: impl Into<String>,
7698 ) -> Env {
7699 let mut query = self.selection.select("withSocketInput");
7700 query = query.arg("name", name.into());
7701 query = query.arg_lazy(
7702 "value",
7703 Box::new(move || {
7704 let value = value.clone();
7705 Box::pin(async move { value.into_id().await.unwrap().quote() })
7706 }),
7707 );
7708 query = query.arg("description", description.into());
7709 Env {
7710 proc: self.proc.clone(),
7711 selection: query,
7712 graphql_client: self.graphql_client.clone(),
7713 }
7714 }
7715 pub fn with_socket_output(
7722 &self,
7723 name: impl Into<String>,
7724 description: impl Into<String>,
7725 ) -> Env {
7726 let mut query = self.selection.select("withSocketOutput");
7727 query = query.arg("name", name.into());
7728 query = query.arg("description", description.into());
7729 Env {
7730 proc: self.proc.clone(),
7731 selection: query,
7732 graphql_client: self.graphql_client.clone(),
7733 }
7734 }
7735 pub fn with_stat_input(
7743 &self,
7744 name: impl Into<String>,
7745 value: impl IntoID<Id>,
7746 description: impl Into<String>,
7747 ) -> Env {
7748 let mut query = self.selection.select("withStatInput");
7749 query = query.arg("name", name.into());
7750 query = query.arg_lazy(
7751 "value",
7752 Box::new(move || {
7753 let value = value.clone();
7754 Box::pin(async move { value.into_id().await.unwrap().quote() })
7755 }),
7756 );
7757 query = query.arg("description", description.into());
7758 Env {
7759 proc: self.proc.clone(),
7760 selection: query,
7761 graphql_client: self.graphql_client.clone(),
7762 }
7763 }
7764 pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7771 let mut query = self.selection.select("withStatOutput");
7772 query = query.arg("name", name.into());
7773 query = query.arg("description", description.into());
7774 Env {
7775 proc: self.proc.clone(),
7776 selection: query,
7777 graphql_client: self.graphql_client.clone(),
7778 }
7779 }
7780 pub fn with_string_input(
7788 &self,
7789 name: impl Into<String>,
7790 value: impl Into<String>,
7791 description: impl Into<String>,
7792 ) -> Env {
7793 let mut query = self.selection.select("withStringInput");
7794 query = query.arg("name", name.into());
7795 query = query.arg("value", value.into());
7796 query = query.arg("description", description.into());
7797 Env {
7798 proc: self.proc.clone(),
7799 selection: query,
7800 graphql_client: self.graphql_client.clone(),
7801 }
7802 }
7803 pub fn with_string_output(
7810 &self,
7811 name: impl Into<String>,
7812 description: impl Into<String>,
7813 ) -> Env {
7814 let mut query = self.selection.select("withStringOutput");
7815 query = query.arg("name", name.into());
7816 query = query.arg("description", description.into());
7817 Env {
7818 proc: self.proc.clone(),
7819 selection: query,
7820 graphql_client: self.graphql_client.clone(),
7821 }
7822 }
7823 pub fn with_up_group_input(
7831 &self,
7832 name: impl Into<String>,
7833 value: impl IntoID<Id>,
7834 description: impl Into<String>,
7835 ) -> Env {
7836 let mut query = self.selection.select("withUpGroupInput");
7837 query = query.arg("name", name.into());
7838 query = query.arg_lazy(
7839 "value",
7840 Box::new(move || {
7841 let value = value.clone();
7842 Box::pin(async move { value.into_id().await.unwrap().quote() })
7843 }),
7844 );
7845 query = query.arg("description", description.into());
7846 Env {
7847 proc: self.proc.clone(),
7848 selection: query,
7849 graphql_client: self.graphql_client.clone(),
7850 }
7851 }
7852 pub fn with_up_group_output(
7859 &self,
7860 name: impl Into<String>,
7861 description: impl Into<String>,
7862 ) -> Env {
7863 let mut query = self.selection.select("withUpGroupOutput");
7864 query = query.arg("name", name.into());
7865 query = query.arg("description", description.into());
7866 Env {
7867 proc: self.proc.clone(),
7868 selection: query,
7869 graphql_client: self.graphql_client.clone(),
7870 }
7871 }
7872 pub fn with_up_input(
7880 &self,
7881 name: impl Into<String>,
7882 value: impl IntoID<Id>,
7883 description: impl Into<String>,
7884 ) -> Env {
7885 let mut query = self.selection.select("withUpInput");
7886 query = query.arg("name", name.into());
7887 query = query.arg_lazy(
7888 "value",
7889 Box::new(move || {
7890 let value = value.clone();
7891 Box::pin(async move { value.into_id().await.unwrap().quote() })
7892 }),
7893 );
7894 query = query.arg("description", description.into());
7895 Env {
7896 proc: self.proc.clone(),
7897 selection: query,
7898 graphql_client: self.graphql_client.clone(),
7899 }
7900 }
7901 pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7908 let mut query = self.selection.select("withUpOutput");
7909 query = query.arg("name", name.into());
7910 query = query.arg("description", description.into());
7911 Env {
7912 proc: self.proc.clone(),
7913 selection: query,
7914 graphql_client: self.graphql_client.clone(),
7915 }
7916 }
7917 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
7923 let mut query = self.selection.select("withWorkspace");
7924 query = query.arg_lazy(
7925 "workspace",
7926 Box::new(move || {
7927 let workspace = workspace.clone();
7928 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7929 }),
7930 );
7931 Env {
7932 proc: self.proc.clone(),
7933 selection: query,
7934 graphql_client: self.graphql_client.clone(),
7935 }
7936 }
7937 pub fn with_workspace_input(
7945 &self,
7946 name: impl Into<String>,
7947 value: impl IntoID<Id>,
7948 description: impl Into<String>,
7949 ) -> Env {
7950 let mut query = self.selection.select("withWorkspaceInput");
7951 query = query.arg("name", name.into());
7952 query = query.arg_lazy(
7953 "value",
7954 Box::new(move || {
7955 let value = value.clone();
7956 Box::pin(async move { value.into_id().await.unwrap().quote() })
7957 }),
7958 );
7959 query = query.arg("description", description.into());
7960 Env {
7961 proc: self.proc.clone(),
7962 selection: query,
7963 graphql_client: self.graphql_client.clone(),
7964 }
7965 }
7966 pub fn with_workspace_output(
7973 &self,
7974 name: impl Into<String>,
7975 description: impl Into<String>,
7976 ) -> Env {
7977 let mut query = self.selection.select("withWorkspaceOutput");
7978 query = query.arg("name", name.into());
7979 query = query.arg("description", description.into());
7980 Env {
7981 proc: self.proc.clone(),
7982 selection: query,
7983 graphql_client: self.graphql_client.clone(),
7984 }
7985 }
7986 pub fn without_outputs(&self) -> Env {
7988 let query = self.selection.select("withoutOutputs");
7989 Env {
7990 proc: self.proc.clone(),
7991 selection: query,
7992 graphql_client: self.graphql_client.clone(),
7993 }
7994 }
7995 pub fn workspace(&self) -> Directory {
7996 let query = self.selection.select("workspace");
7997 Directory {
7998 proc: self.proc.clone(),
7999 selection: query,
8000 graphql_client: self.graphql_client.clone(),
8001 }
8002 }
8003}
8004impl Node for Env {
8005 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8006 let query = self.selection.select("id");
8007 let graphql_client = self.graphql_client.clone();
8008 async move { query.execute(graphql_client).await }
8009 }
8010}
8011#[derive(Clone)]
8012pub struct EnvFile {
8013 pub proc: Option<Arc<DaggerSessionProc>>,
8014 pub selection: Selection,
8015 pub graphql_client: DynGraphQLClient,
8016}
8017#[derive(Builder, Debug, PartialEq)]
8018pub struct EnvFileGetOpts {
8019 #[builder(setter(into, strip_option), default)]
8021 pub raw: Option<bool>,
8022}
8023#[derive(Builder, Debug, PartialEq)]
8024pub struct EnvFileVariablesOpts {
8025 #[builder(setter(into, strip_option), default)]
8027 pub raw: Option<bool>,
8028}
8029impl IntoID<Id> for EnvFile {
8030 fn into_id(
8031 self,
8032 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8033 Box::pin(async move { self.id().await })
8034 }
8035}
8036impl Loadable for EnvFile {
8037 fn graphql_type() -> &'static str {
8038 "EnvFile"
8039 }
8040 fn from_query(
8041 proc: Option<Arc<DaggerSessionProc>>,
8042 selection: Selection,
8043 graphql_client: DynGraphQLClient,
8044 ) -> Self {
8045 Self {
8046 proc,
8047 selection,
8048 graphql_client,
8049 }
8050 }
8051}
8052impl EnvFile {
8053 pub fn as_file(&self) -> File {
8055 let query = self.selection.select("asFile");
8056 File {
8057 proc: self.proc.clone(),
8058 selection: query,
8059 graphql_client: self.graphql_client.clone(),
8060 }
8061 }
8062 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8068 let mut query = self.selection.select("exists");
8069 query = query.arg("name", name.into());
8070 query.execute(self.graphql_client.clone()).await
8071 }
8072 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8079 let mut query = self.selection.select("get");
8080 query = query.arg("name", name.into());
8081 query.execute(self.graphql_client.clone()).await
8082 }
8083 pub async fn get_opts(
8090 &self,
8091 name: impl Into<String>,
8092 opts: EnvFileGetOpts,
8093 ) -> Result<String, DaggerError> {
8094 let mut query = self.selection.select("get");
8095 query = query.arg("name", name.into());
8096 if let Some(raw) = opts.raw {
8097 query = query.arg("raw", raw);
8098 }
8099 query.execute(self.graphql_client.clone()).await
8100 }
8101 pub async fn id(&self) -> Result<Id, DaggerError> {
8103 let query = self.selection.select("id");
8104 query.execute(self.graphql_client.clone()).await
8105 }
8106 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8112 let mut query = self.selection.select("namespace");
8113 query = query.arg("prefix", prefix.into());
8114 EnvFile {
8115 proc: self.proc.clone(),
8116 selection: query,
8117 graphql_client: self.graphql_client.clone(),
8118 }
8119 }
8120 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8126 let query = self.selection.select("variables");
8127 let query = query.select("id");
8128 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8129 Ok(ids
8130 .into_iter()
8131 .map(|id| EnvVariable {
8132 proc: self.proc.clone(),
8133 selection: crate::querybuilder::query()
8134 .select("node")
8135 .arg("id", &id.0)
8136 .inline_fragment("EnvVariable"),
8137 graphql_client: self.graphql_client.clone(),
8138 })
8139 .collect())
8140 }
8141 pub async fn variables_opts(
8147 &self,
8148 opts: EnvFileVariablesOpts,
8149 ) -> Result<Vec<EnvVariable>, DaggerError> {
8150 let mut query = self.selection.select("variables");
8151 if let Some(raw) = opts.raw {
8152 query = query.arg("raw", raw);
8153 }
8154 let query = query.select("id");
8155 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8156 Ok(ids
8157 .into_iter()
8158 .map(|id| EnvVariable {
8159 proc: self.proc.clone(),
8160 selection: crate::querybuilder::query()
8161 .select("node")
8162 .arg("id", &id.0)
8163 .inline_fragment("EnvVariable"),
8164 graphql_client: self.graphql_client.clone(),
8165 })
8166 .collect())
8167 }
8168 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8175 let mut query = self.selection.select("withVariable");
8176 query = query.arg("name", name.into());
8177 query = query.arg("value", value.into());
8178 EnvFile {
8179 proc: self.proc.clone(),
8180 selection: query,
8181 graphql_client: self.graphql_client.clone(),
8182 }
8183 }
8184 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8190 let mut query = self.selection.select("withoutVariable");
8191 query = query.arg("name", name.into());
8192 EnvFile {
8193 proc: self.proc.clone(),
8194 selection: query,
8195 graphql_client: self.graphql_client.clone(),
8196 }
8197 }
8198}
8199impl Node for EnvFile {
8200 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8201 let query = self.selection.select("id");
8202 let graphql_client = self.graphql_client.clone();
8203 async move { query.execute(graphql_client).await }
8204 }
8205}
8206#[derive(Clone)]
8207pub struct EnvVariable {
8208 pub proc: Option<Arc<DaggerSessionProc>>,
8209 pub selection: Selection,
8210 pub graphql_client: DynGraphQLClient,
8211}
8212impl IntoID<Id> for EnvVariable {
8213 fn into_id(
8214 self,
8215 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8216 Box::pin(async move { self.id().await })
8217 }
8218}
8219impl Loadable for EnvVariable {
8220 fn graphql_type() -> &'static str {
8221 "EnvVariable"
8222 }
8223 fn from_query(
8224 proc: Option<Arc<DaggerSessionProc>>,
8225 selection: Selection,
8226 graphql_client: DynGraphQLClient,
8227 ) -> Self {
8228 Self {
8229 proc,
8230 selection,
8231 graphql_client,
8232 }
8233 }
8234}
8235impl EnvVariable {
8236 pub async fn id(&self) -> Result<Id, DaggerError> {
8238 let query = self.selection.select("id");
8239 query.execute(self.graphql_client.clone()).await
8240 }
8241 pub async fn name(&self) -> Result<String, DaggerError> {
8243 let query = self.selection.select("name");
8244 query.execute(self.graphql_client.clone()).await
8245 }
8246 pub async fn value(&self) -> Result<String, DaggerError> {
8248 let query = self.selection.select("value");
8249 query.execute(self.graphql_client.clone()).await
8250 }
8251}
8252impl Node for EnvVariable {
8253 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8254 let query = self.selection.select("id");
8255 let graphql_client = self.graphql_client.clone();
8256 async move { query.execute(graphql_client).await }
8257 }
8258}
8259#[derive(Clone)]
8260pub struct Error {
8261 pub proc: Option<Arc<DaggerSessionProc>>,
8262 pub selection: Selection,
8263 pub graphql_client: DynGraphQLClient,
8264}
8265impl IntoID<Id> for Error {
8266 fn into_id(
8267 self,
8268 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8269 Box::pin(async move { self.id().await })
8270 }
8271}
8272impl Loadable for Error {
8273 fn graphql_type() -> &'static str {
8274 "Error"
8275 }
8276 fn from_query(
8277 proc: Option<Arc<DaggerSessionProc>>,
8278 selection: Selection,
8279 graphql_client: DynGraphQLClient,
8280 ) -> Self {
8281 Self {
8282 proc,
8283 selection,
8284 graphql_client,
8285 }
8286 }
8287}
8288impl Error {
8289 pub async fn id(&self) -> Result<Id, DaggerError> {
8291 let query = self.selection.select("id");
8292 query.execute(self.graphql_client.clone()).await
8293 }
8294 pub async fn message(&self) -> Result<String, DaggerError> {
8296 let query = self.selection.select("message");
8297 query.execute(self.graphql_client.clone()).await
8298 }
8299 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8301 let query = self.selection.select("values");
8302 let query = query.select("id");
8303 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8304 Ok(ids
8305 .into_iter()
8306 .map(|id| ErrorValue {
8307 proc: self.proc.clone(),
8308 selection: crate::querybuilder::query()
8309 .select("node")
8310 .arg("id", &id.0)
8311 .inline_fragment("ErrorValue"),
8312 graphql_client: self.graphql_client.clone(),
8313 })
8314 .collect())
8315 }
8316 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8323 let mut query = self.selection.select("withValue");
8324 query = query.arg("name", name.into());
8325 query = query.arg("value", value);
8326 Error {
8327 proc: self.proc.clone(),
8328 selection: query,
8329 graphql_client: self.graphql_client.clone(),
8330 }
8331 }
8332}
8333impl Node for Error {
8334 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8335 let query = self.selection.select("id");
8336 let graphql_client = self.graphql_client.clone();
8337 async move { query.execute(graphql_client).await }
8338 }
8339}
8340#[derive(Clone)]
8341pub struct ErrorValue {
8342 pub proc: Option<Arc<DaggerSessionProc>>,
8343 pub selection: Selection,
8344 pub graphql_client: DynGraphQLClient,
8345}
8346impl IntoID<Id> for ErrorValue {
8347 fn into_id(
8348 self,
8349 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8350 Box::pin(async move { self.id().await })
8351 }
8352}
8353impl Loadable for ErrorValue {
8354 fn graphql_type() -> &'static str {
8355 "ErrorValue"
8356 }
8357 fn from_query(
8358 proc: Option<Arc<DaggerSessionProc>>,
8359 selection: Selection,
8360 graphql_client: DynGraphQLClient,
8361 ) -> Self {
8362 Self {
8363 proc,
8364 selection,
8365 graphql_client,
8366 }
8367 }
8368}
8369impl ErrorValue {
8370 pub async fn id(&self) -> Result<Id, DaggerError> {
8372 let query = self.selection.select("id");
8373 query.execute(self.graphql_client.clone()).await
8374 }
8375 pub async fn name(&self) -> Result<String, DaggerError> {
8377 let query = self.selection.select("name");
8378 query.execute(self.graphql_client.clone()).await
8379 }
8380 pub async fn value(&self) -> Result<Json, DaggerError> {
8382 let query = self.selection.select("value");
8383 query.execute(self.graphql_client.clone()).await
8384 }
8385}
8386impl Node for ErrorValue {
8387 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8388 let query = self.selection.select("id");
8389 let graphql_client = self.graphql_client.clone();
8390 async move { query.execute(graphql_client).await }
8391 }
8392}
8393#[derive(Clone)]
8394pub struct FieldTypeDef {
8395 pub proc: Option<Arc<DaggerSessionProc>>,
8396 pub selection: Selection,
8397 pub graphql_client: DynGraphQLClient,
8398}
8399impl IntoID<Id> for FieldTypeDef {
8400 fn into_id(
8401 self,
8402 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8403 Box::pin(async move { self.id().await })
8404 }
8405}
8406impl Loadable for FieldTypeDef {
8407 fn graphql_type() -> &'static str {
8408 "FieldTypeDef"
8409 }
8410 fn from_query(
8411 proc: Option<Arc<DaggerSessionProc>>,
8412 selection: Selection,
8413 graphql_client: DynGraphQLClient,
8414 ) -> Self {
8415 Self {
8416 proc,
8417 selection,
8418 graphql_client,
8419 }
8420 }
8421}
8422impl FieldTypeDef {
8423 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8425 let query = self.selection.select("deprecated");
8426 query.execute(self.graphql_client.clone()).await
8427 }
8428 pub async fn description(&self) -> Result<String, DaggerError> {
8430 let query = self.selection.select("description");
8431 query.execute(self.graphql_client.clone()).await
8432 }
8433 pub async fn id(&self) -> Result<Id, DaggerError> {
8435 let query = self.selection.select("id");
8436 query.execute(self.graphql_client.clone()).await
8437 }
8438 pub async fn name(&self) -> Result<String, DaggerError> {
8440 let query = self.selection.select("name");
8441 query.execute(self.graphql_client.clone()).await
8442 }
8443 pub fn source_map(&self) -> SourceMap {
8445 let query = self.selection.select("sourceMap");
8446 SourceMap {
8447 proc: self.proc.clone(),
8448 selection: query,
8449 graphql_client: self.graphql_client.clone(),
8450 }
8451 }
8452 pub fn type_def(&self) -> TypeDef {
8454 let query = self.selection.select("typeDef");
8455 TypeDef {
8456 proc: self.proc.clone(),
8457 selection: query,
8458 graphql_client: self.graphql_client.clone(),
8459 }
8460 }
8461}
8462impl Node for FieldTypeDef {
8463 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8464 let query = self.selection.select("id");
8465 let graphql_client = self.graphql_client.clone();
8466 async move { query.execute(graphql_client).await }
8467 }
8468}
8469#[derive(Clone)]
8470pub struct File {
8471 pub proc: Option<Arc<DaggerSessionProc>>,
8472 pub selection: Selection,
8473 pub graphql_client: DynGraphQLClient,
8474}
8475#[derive(Builder, Debug, PartialEq)]
8476pub struct FileAsEnvFileOpts {
8477 #[builder(setter(into, strip_option), default)]
8479 pub expand: Option<bool>,
8480}
8481#[derive(Builder, Debug, PartialEq)]
8482pub struct FileContentsOpts {
8483 #[builder(setter(into, strip_option), default)]
8485 pub limit_lines: Option<isize>,
8486 #[builder(setter(into, strip_option), default)]
8488 pub offset_lines: Option<isize>,
8489}
8490#[derive(Builder, Debug, PartialEq)]
8491pub struct FileDigestOpts {
8492 #[builder(setter(into, strip_option), default)]
8494 pub exclude_metadata: Option<bool>,
8495}
8496#[derive(Builder, Debug, PartialEq)]
8497pub struct FileExportOpts {
8498 #[builder(setter(into, strip_option), default)]
8500 pub allow_parent_dir_path: Option<bool>,
8501}
8502#[derive(Builder, Debug, PartialEq)]
8503pub struct FileSearchOpts<'a> {
8504 #[builder(setter(into, strip_option), default)]
8506 pub dotall: Option<bool>,
8507 #[builder(setter(into, strip_option), default)]
8509 pub files_only: Option<bool>,
8510 #[builder(setter(into, strip_option), default)]
8511 pub globs: Option<Vec<&'a str>>,
8512 #[builder(setter(into, strip_option), default)]
8514 pub insensitive: Option<bool>,
8515 #[builder(setter(into, strip_option), default)]
8517 pub limit: Option<isize>,
8518 #[builder(setter(into, strip_option), default)]
8520 pub literal: Option<bool>,
8521 #[builder(setter(into, strip_option), default)]
8523 pub multiline: Option<bool>,
8524 #[builder(setter(into, strip_option), default)]
8525 pub paths: Option<Vec<&'a str>>,
8526 #[builder(setter(into, strip_option), default)]
8528 pub skip_hidden: Option<bool>,
8529 #[builder(setter(into, strip_option), default)]
8531 pub skip_ignored: Option<bool>,
8532}
8533#[derive(Builder, Debug, PartialEq)]
8534pub struct FileWithReplacedOpts {
8535 #[builder(setter(into, strip_option), default)]
8537 pub all: Option<bool>,
8538 #[builder(setter(into, strip_option), default)]
8540 pub first_from: Option<isize>,
8541}
8542impl IntoID<Id> for File {
8543 fn into_id(
8544 self,
8545 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8546 Box::pin(async move { self.id().await })
8547 }
8548}
8549impl Loadable for File {
8550 fn graphql_type() -> &'static str {
8551 "File"
8552 }
8553 fn from_query(
8554 proc: Option<Arc<DaggerSessionProc>>,
8555 selection: Selection,
8556 graphql_client: DynGraphQLClient,
8557 ) -> Self {
8558 Self {
8559 proc,
8560 selection,
8561 graphql_client,
8562 }
8563 }
8564}
8565impl File {
8566 pub fn as_env_file(&self) -> EnvFile {
8572 let query = self.selection.select("asEnvFile");
8573 EnvFile {
8574 proc: self.proc.clone(),
8575 selection: query,
8576 graphql_client: self.graphql_client.clone(),
8577 }
8578 }
8579 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8585 let mut query = self.selection.select("asEnvFile");
8586 if let Some(expand) = opts.expand {
8587 query = query.arg("expand", expand);
8588 }
8589 EnvFile {
8590 proc: self.proc.clone(),
8591 selection: query,
8592 graphql_client: self.graphql_client.clone(),
8593 }
8594 }
8595 pub fn as_json(&self) -> JsonValue {
8597 let query = self.selection.select("asJSON");
8598 JsonValue {
8599 proc: self.proc.clone(),
8600 selection: query,
8601 graphql_client: self.graphql_client.clone(),
8602 }
8603 }
8604 pub fn chown(&self, owner: impl Into<String>) -> File {
8614 let mut query = self.selection.select("chown");
8615 query = query.arg("owner", owner.into());
8616 File {
8617 proc: self.proc.clone(),
8618 selection: query,
8619 graphql_client: self.graphql_client.clone(),
8620 }
8621 }
8622 pub async fn contents(&self) -> Result<String, DaggerError> {
8628 let query = self.selection.select("contents");
8629 query.execute(self.graphql_client.clone()).await
8630 }
8631 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8637 let mut query = self.selection.select("contents");
8638 if let Some(offset_lines) = opts.offset_lines {
8639 query = query.arg("offsetLines", offset_lines);
8640 }
8641 if let Some(limit_lines) = opts.limit_lines {
8642 query = query.arg("limitLines", limit_lines);
8643 }
8644 query.execute(self.graphql_client.clone()).await
8645 }
8646 pub async fn digest(&self) -> Result<String, DaggerError> {
8652 let query = self.selection.select("digest");
8653 query.execute(self.graphql_client.clone()).await
8654 }
8655 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8661 let mut query = self.selection.select("digest");
8662 if let Some(exclude_metadata) = opts.exclude_metadata {
8663 query = query.arg("excludeMetadata", exclude_metadata);
8664 }
8665 query.execute(self.graphql_client.clone()).await
8666 }
8667 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8674 let mut query = self.selection.select("export");
8675 query = query.arg("path", path.into());
8676 query.execute(self.graphql_client.clone()).await
8677 }
8678 pub async fn export_opts(
8685 &self,
8686 path: impl Into<String>,
8687 opts: FileExportOpts,
8688 ) -> Result<String, DaggerError> {
8689 let mut query = self.selection.select("export");
8690 query = query.arg("path", path.into());
8691 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8692 query = query.arg("allowParentDirPath", allow_parent_dir_path);
8693 }
8694 query.execute(self.graphql_client.clone()).await
8695 }
8696 pub async fn id(&self) -> Result<Id, DaggerError> {
8698 let query = self.selection.select("id");
8699 query.execute(self.graphql_client.clone()).await
8700 }
8701 pub async fn name(&self) -> Result<String, DaggerError> {
8703 let query = self.selection.select("name");
8704 query.execute(self.graphql_client.clone()).await
8705 }
8706 pub async fn search(
8714 &self,
8715 pattern: impl Into<String>,
8716 ) -> Result<Vec<SearchResult>, DaggerError> {
8717 let mut query = self.selection.select("search");
8718 query = query.arg("pattern", pattern.into());
8719 let query = query.select("id");
8720 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8721 Ok(ids
8722 .into_iter()
8723 .map(|id| SearchResult {
8724 proc: self.proc.clone(),
8725 selection: crate::querybuilder::query()
8726 .select("node")
8727 .arg("id", &id.0)
8728 .inline_fragment("SearchResult"),
8729 graphql_client: self.graphql_client.clone(),
8730 })
8731 .collect())
8732 }
8733 pub async fn search_opts<'a>(
8741 &self,
8742 pattern: impl Into<String>,
8743 opts: FileSearchOpts<'a>,
8744 ) -> Result<Vec<SearchResult>, DaggerError> {
8745 let mut query = self.selection.select("search");
8746 query = query.arg("pattern", pattern.into());
8747 if let Some(literal) = opts.literal {
8748 query = query.arg("literal", literal);
8749 }
8750 if let Some(multiline) = opts.multiline {
8751 query = query.arg("multiline", multiline);
8752 }
8753 if let Some(dotall) = opts.dotall {
8754 query = query.arg("dotall", dotall);
8755 }
8756 if let Some(insensitive) = opts.insensitive {
8757 query = query.arg("insensitive", insensitive);
8758 }
8759 if let Some(skip_ignored) = opts.skip_ignored {
8760 query = query.arg("skipIgnored", skip_ignored);
8761 }
8762 if let Some(skip_hidden) = opts.skip_hidden {
8763 query = query.arg("skipHidden", skip_hidden);
8764 }
8765 if let Some(files_only) = opts.files_only {
8766 query = query.arg("filesOnly", files_only);
8767 }
8768 if let Some(limit) = opts.limit {
8769 query = query.arg("limit", limit);
8770 }
8771 if let Some(paths) = opts.paths {
8772 query = query.arg("paths", paths);
8773 }
8774 if let Some(globs) = opts.globs {
8775 query = query.arg("globs", globs);
8776 }
8777 let query = query.select("id");
8778 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8779 Ok(ids
8780 .into_iter()
8781 .map(|id| SearchResult {
8782 proc: self.proc.clone(),
8783 selection: crate::querybuilder::query()
8784 .select("node")
8785 .arg("id", &id.0)
8786 .inline_fragment("SearchResult"),
8787 graphql_client: self.graphql_client.clone(),
8788 })
8789 .collect())
8790 }
8791 pub async fn size(&self) -> Result<isize, DaggerError> {
8793 let query = self.selection.select("size");
8794 query.execute(self.graphql_client.clone()).await
8795 }
8796 pub fn stat(&self) -> Stat {
8798 let query = self.selection.select("stat");
8799 Stat {
8800 proc: self.proc.clone(),
8801 selection: query,
8802 graphql_client: self.graphql_client.clone(),
8803 }
8804 }
8805 pub async fn sync(&self) -> Result<File, DaggerError> {
8807 let query = self.selection.select("sync");
8808 let id: Id = query.execute(self.graphql_client.clone()).await?;
8809 Ok(File {
8810 proc: self.proc.clone(),
8811 selection: query
8812 .root()
8813 .select("node")
8814 .arg("id", &id.0)
8815 .inline_fragment("File"),
8816 graphql_client: self.graphql_client.clone(),
8817 })
8818 }
8819 pub fn with_name(&self, name: impl Into<String>) -> File {
8825 let mut query = self.selection.select("withName");
8826 query = query.arg("name", name.into());
8827 File {
8828 proc: self.proc.clone(),
8829 selection: query,
8830 graphql_client: self.graphql_client.clone(),
8831 }
8832 }
8833 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8845 let mut query = self.selection.select("withReplaced");
8846 query = query.arg("search", search.into());
8847 query = query.arg("replacement", replacement.into());
8848 File {
8849 proc: self.proc.clone(),
8850 selection: query,
8851 graphql_client: self.graphql_client.clone(),
8852 }
8853 }
8854 pub fn with_replaced_opts(
8866 &self,
8867 search: impl Into<String>,
8868 replacement: impl Into<String>,
8869 opts: FileWithReplacedOpts,
8870 ) -> File {
8871 let mut query = self.selection.select("withReplaced");
8872 query = query.arg("search", search.into());
8873 query = query.arg("replacement", replacement.into());
8874 if let Some(all) = opts.all {
8875 query = query.arg("all", all);
8876 }
8877 if let Some(first_from) = opts.first_from {
8878 query = query.arg("firstFrom", first_from);
8879 }
8880 File {
8881 proc: self.proc.clone(),
8882 selection: query,
8883 graphql_client: self.graphql_client.clone(),
8884 }
8885 }
8886 pub fn with_timestamps(&self, timestamp: isize) -> File {
8894 let mut query = self.selection.select("withTimestamps");
8895 query = query.arg("timestamp", timestamp);
8896 File {
8897 proc: self.proc.clone(),
8898 selection: query,
8899 graphql_client: self.graphql_client.clone(),
8900 }
8901 }
8902}
8903impl Exportable for File {
8904 fn export(
8905 &self,
8906 path: impl Into<String>,
8907 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
8908 let mut query = self.selection.select("export");
8909 query = query.arg("path", path.into());
8910 let graphql_client = self.graphql_client.clone();
8911 async move { query.execute(graphql_client).await }
8912 }
8913 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8914 let query = self.selection.select("id");
8915 let graphql_client = self.graphql_client.clone();
8916 async move { query.execute(graphql_client).await }
8917 }
8918}
8919impl Node for File {
8920 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8921 let query = self.selection.select("id");
8922 let graphql_client = self.graphql_client.clone();
8923 async move { query.execute(graphql_client).await }
8924 }
8925}
8926impl Syncer for File {
8927 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8928 let query = self.selection.select("id");
8929 let graphql_client = self.graphql_client.clone();
8930 async move { query.execute(graphql_client).await }
8931 }
8932 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8933 let query = self.selection.select("sync");
8934 let graphql_client = self.graphql_client.clone();
8935 async move { query.execute(graphql_client).await }
8936 }
8937}
8938#[derive(Clone)]
8939pub struct Function {
8940 pub proc: Option<Arc<DaggerSessionProc>>,
8941 pub selection: Selection,
8942 pub graphql_client: DynGraphQLClient,
8943}
8944#[derive(Builder, Debug, PartialEq)]
8945pub struct FunctionWithArgOpts<'a> {
8946 #[builder(setter(into, strip_option), default)]
8947 pub default_address: Option<&'a str>,
8948 #[builder(setter(into, strip_option), default)]
8950 pub default_path: Option<&'a str>,
8951 #[builder(setter(into, strip_option), default)]
8953 pub default_value: Option<Json>,
8954 #[builder(setter(into, strip_option), default)]
8956 pub deprecated: Option<&'a str>,
8957 #[builder(setter(into, strip_option), default)]
8959 pub description: Option<&'a str>,
8960 #[builder(setter(into, strip_option), default)]
8962 pub ignore: Option<Vec<&'a str>>,
8963 #[builder(setter(into, strip_option), default)]
8965 pub source_map: Option<Id>,
8966}
8967#[derive(Builder, Debug, PartialEq)]
8968pub struct FunctionWithCachePolicyOpts<'a> {
8969 #[builder(setter(into, strip_option), default)]
8971 pub time_to_live: Option<&'a str>,
8972}
8973#[derive(Builder, Debug, PartialEq)]
8974pub struct FunctionWithDeprecatedOpts<'a> {
8975 #[builder(setter(into, strip_option), default)]
8977 pub reason: Option<&'a str>,
8978}
8979impl IntoID<Id> for Function {
8980 fn into_id(
8981 self,
8982 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8983 Box::pin(async move { self.id().await })
8984 }
8985}
8986impl Loadable for Function {
8987 fn graphql_type() -> &'static str {
8988 "Function"
8989 }
8990 fn from_query(
8991 proc: Option<Arc<DaggerSessionProc>>,
8992 selection: Selection,
8993 graphql_client: DynGraphQLClient,
8994 ) -> Self {
8995 Self {
8996 proc,
8997 selection,
8998 graphql_client,
8999 }
9000 }
9001}
9002impl Function {
9003 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9005 let query = self.selection.select("args");
9006 let query = query.select("id");
9007 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9008 Ok(ids
9009 .into_iter()
9010 .map(|id| FunctionArg {
9011 proc: self.proc.clone(),
9012 selection: crate::querybuilder::query()
9013 .select("node")
9014 .arg("id", &id.0)
9015 .inline_fragment("FunctionArg"),
9016 graphql_client: self.graphql_client.clone(),
9017 })
9018 .collect())
9019 }
9020 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9022 let query = self.selection.select("deprecated");
9023 query.execute(self.graphql_client.clone()).await
9024 }
9025 pub async fn description(&self) -> Result<String, DaggerError> {
9027 let query = self.selection.select("description");
9028 query.execute(self.graphql_client.clone()).await
9029 }
9030 pub async fn id(&self) -> Result<Id, DaggerError> {
9032 let query = self.selection.select("id");
9033 query.execute(self.graphql_client.clone()).await
9034 }
9035 pub async fn name(&self) -> Result<String, DaggerError> {
9037 let query = self.selection.select("name");
9038 query.execute(self.graphql_client.clone()).await
9039 }
9040 pub fn return_type(&self) -> TypeDef {
9042 let query = self.selection.select("returnType");
9043 TypeDef {
9044 proc: self.proc.clone(),
9045 selection: query,
9046 graphql_client: self.graphql_client.clone(),
9047 }
9048 }
9049 pub fn source_map(&self) -> SourceMap {
9051 let query = self.selection.select("sourceMap");
9052 SourceMap {
9053 proc: self.proc.clone(),
9054 selection: query,
9055 graphql_client: self.graphql_client.clone(),
9056 }
9057 }
9058 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9060 let query = self.selection.select("sourceModuleName");
9061 query.execute(self.graphql_client.clone()).await
9062 }
9063 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9071 let mut query = self.selection.select("withArg");
9072 query = query.arg("name", name.into());
9073 query = query.arg_lazy(
9074 "typeDef",
9075 Box::new(move || {
9076 let type_def = type_def.clone();
9077 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9078 }),
9079 );
9080 Function {
9081 proc: self.proc.clone(),
9082 selection: query,
9083 graphql_client: self.graphql_client.clone(),
9084 }
9085 }
9086 pub fn with_arg_opts<'a>(
9094 &self,
9095 name: impl Into<String>,
9096 type_def: impl IntoID<Id>,
9097 opts: FunctionWithArgOpts<'a>,
9098 ) -> Function {
9099 let mut query = self.selection.select("withArg");
9100 query = query.arg("name", name.into());
9101 query = query.arg_lazy(
9102 "typeDef",
9103 Box::new(move || {
9104 let type_def = type_def.clone();
9105 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9106 }),
9107 );
9108 if let Some(description) = opts.description {
9109 query = query.arg("description", description);
9110 }
9111 if let Some(default_value) = opts.default_value {
9112 query = query.arg("defaultValue", default_value);
9113 }
9114 if let Some(default_path) = opts.default_path {
9115 query = query.arg("defaultPath", default_path);
9116 }
9117 if let Some(ignore) = opts.ignore {
9118 query = query.arg("ignore", ignore);
9119 }
9120 if let Some(source_map) = opts.source_map {
9121 query = query.arg("sourceMap", source_map);
9122 }
9123 if let Some(deprecated) = opts.deprecated {
9124 query = query.arg("deprecated", deprecated);
9125 }
9126 if let Some(default_address) = opts.default_address {
9127 query = query.arg("defaultAddress", default_address);
9128 }
9129 Function {
9130 proc: self.proc.clone(),
9131 selection: query,
9132 graphql_client: self.graphql_client.clone(),
9133 }
9134 }
9135 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9142 let mut query = self.selection.select("withCachePolicy");
9143 query = query.arg("policy", policy);
9144 Function {
9145 proc: self.proc.clone(),
9146 selection: query,
9147 graphql_client: self.graphql_client.clone(),
9148 }
9149 }
9150 pub fn with_cache_policy_opts<'a>(
9157 &self,
9158 policy: FunctionCachePolicy,
9159 opts: FunctionWithCachePolicyOpts<'a>,
9160 ) -> Function {
9161 let mut query = self.selection.select("withCachePolicy");
9162 query = query.arg("policy", policy);
9163 if let Some(time_to_live) = opts.time_to_live {
9164 query = query.arg("timeToLive", time_to_live);
9165 }
9166 Function {
9167 proc: self.proc.clone(),
9168 selection: query,
9169 graphql_client: self.graphql_client.clone(),
9170 }
9171 }
9172 pub fn with_check(&self) -> Function {
9174 let query = self.selection.select("withCheck");
9175 Function {
9176 proc: self.proc.clone(),
9177 selection: query,
9178 graphql_client: self.graphql_client.clone(),
9179 }
9180 }
9181 pub fn with_deprecated(&self) -> Function {
9187 let query = self.selection.select("withDeprecated");
9188 Function {
9189 proc: self.proc.clone(),
9190 selection: query,
9191 graphql_client: self.graphql_client.clone(),
9192 }
9193 }
9194 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9200 let mut query = self.selection.select("withDeprecated");
9201 if let Some(reason) = opts.reason {
9202 query = query.arg("reason", reason);
9203 }
9204 Function {
9205 proc: self.proc.clone(),
9206 selection: query,
9207 graphql_client: self.graphql_client.clone(),
9208 }
9209 }
9210 pub fn with_description(&self, description: impl Into<String>) -> Function {
9216 let mut query = self.selection.select("withDescription");
9217 query = query.arg("description", description.into());
9218 Function {
9219 proc: self.proc.clone(),
9220 selection: query,
9221 graphql_client: self.graphql_client.clone(),
9222 }
9223 }
9224 pub fn with_generator(&self) -> Function {
9226 let query = self.selection.select("withGenerator");
9227 Function {
9228 proc: self.proc.clone(),
9229 selection: query,
9230 graphql_client: self.graphql_client.clone(),
9231 }
9232 }
9233 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9239 let mut query = self.selection.select("withSourceMap");
9240 query = query.arg_lazy(
9241 "sourceMap",
9242 Box::new(move || {
9243 let source_map = source_map.clone();
9244 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9245 }),
9246 );
9247 Function {
9248 proc: self.proc.clone(),
9249 selection: query,
9250 graphql_client: self.graphql_client.clone(),
9251 }
9252 }
9253 pub fn with_up(&self) -> Function {
9255 let query = self.selection.select("withUp");
9256 Function {
9257 proc: self.proc.clone(),
9258 selection: query,
9259 graphql_client: self.graphql_client.clone(),
9260 }
9261 }
9262}
9263impl Node for Function {
9264 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9265 let query = self.selection.select("id");
9266 let graphql_client = self.graphql_client.clone();
9267 async move { query.execute(graphql_client).await }
9268 }
9269}
9270#[derive(Clone)]
9271pub struct FunctionArg {
9272 pub proc: Option<Arc<DaggerSessionProc>>,
9273 pub selection: Selection,
9274 pub graphql_client: DynGraphQLClient,
9275}
9276impl IntoID<Id> for FunctionArg {
9277 fn into_id(
9278 self,
9279 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9280 Box::pin(async move { self.id().await })
9281 }
9282}
9283impl Loadable for FunctionArg {
9284 fn graphql_type() -> &'static str {
9285 "FunctionArg"
9286 }
9287 fn from_query(
9288 proc: Option<Arc<DaggerSessionProc>>,
9289 selection: Selection,
9290 graphql_client: DynGraphQLClient,
9291 ) -> Self {
9292 Self {
9293 proc,
9294 selection,
9295 graphql_client,
9296 }
9297 }
9298}
9299impl FunctionArg {
9300 pub async fn default_address(&self) -> Result<String, DaggerError> {
9302 let query = self.selection.select("defaultAddress");
9303 query.execute(self.graphql_client.clone()).await
9304 }
9305 pub async fn default_path(&self) -> Result<String, DaggerError> {
9307 let query = self.selection.select("defaultPath");
9308 query.execute(self.graphql_client.clone()).await
9309 }
9310 pub async fn default_value(&self) -> Result<Json, DaggerError> {
9312 let query = self.selection.select("defaultValue");
9313 query.execute(self.graphql_client.clone()).await
9314 }
9315 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9317 let query = self.selection.select("deprecated");
9318 query.execute(self.graphql_client.clone()).await
9319 }
9320 pub async fn description(&self) -> Result<String, DaggerError> {
9322 let query = self.selection.select("description");
9323 query.execute(self.graphql_client.clone()).await
9324 }
9325 pub async fn id(&self) -> Result<Id, DaggerError> {
9327 let query = self.selection.select("id");
9328 query.execute(self.graphql_client.clone()).await
9329 }
9330 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9332 let query = self.selection.select("ignore");
9333 query.execute(self.graphql_client.clone()).await
9334 }
9335 pub async fn name(&self) -> Result<String, DaggerError> {
9337 let query = self.selection.select("name");
9338 query.execute(self.graphql_client.clone()).await
9339 }
9340 pub fn source_map(&self) -> SourceMap {
9342 let query = self.selection.select("sourceMap");
9343 SourceMap {
9344 proc: self.proc.clone(),
9345 selection: query,
9346 graphql_client: self.graphql_client.clone(),
9347 }
9348 }
9349 pub fn type_def(&self) -> TypeDef {
9351 let query = self.selection.select("typeDef");
9352 TypeDef {
9353 proc: self.proc.clone(),
9354 selection: query,
9355 graphql_client: self.graphql_client.clone(),
9356 }
9357 }
9358}
9359impl Node for FunctionArg {
9360 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9361 let query = self.selection.select("id");
9362 let graphql_client = self.graphql_client.clone();
9363 async move { query.execute(graphql_client).await }
9364 }
9365}
9366#[derive(Clone)]
9367pub struct FunctionCall {
9368 pub proc: Option<Arc<DaggerSessionProc>>,
9369 pub selection: Selection,
9370 pub graphql_client: DynGraphQLClient,
9371}
9372impl IntoID<Id> for FunctionCall {
9373 fn into_id(
9374 self,
9375 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9376 Box::pin(async move { self.id().await })
9377 }
9378}
9379impl Loadable for FunctionCall {
9380 fn graphql_type() -> &'static str {
9381 "FunctionCall"
9382 }
9383 fn from_query(
9384 proc: Option<Arc<DaggerSessionProc>>,
9385 selection: Selection,
9386 graphql_client: DynGraphQLClient,
9387 ) -> Self {
9388 Self {
9389 proc,
9390 selection,
9391 graphql_client,
9392 }
9393 }
9394}
9395impl FunctionCall {
9396 pub async fn id(&self) -> Result<Id, DaggerError> {
9398 let query = self.selection.select("id");
9399 query.execute(self.graphql_client.clone()).await
9400 }
9401 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9403 let query = self.selection.select("inputArgs");
9404 let query = query.select("id");
9405 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9406 Ok(ids
9407 .into_iter()
9408 .map(|id| FunctionCallArgValue {
9409 proc: self.proc.clone(),
9410 selection: crate::querybuilder::query()
9411 .select("node")
9412 .arg("id", &id.0)
9413 .inline_fragment("FunctionCallArgValue"),
9414 graphql_client: self.graphql_client.clone(),
9415 })
9416 .collect())
9417 }
9418 pub async fn name(&self) -> Result<String, DaggerError> {
9420 let query = self.selection.select("name");
9421 query.execute(self.graphql_client.clone()).await
9422 }
9423 pub async fn parent(&self) -> Result<Json, DaggerError> {
9425 let query = self.selection.select("parent");
9426 query.execute(self.graphql_client.clone()).await
9427 }
9428 pub async fn parent_name(&self) -> Result<String, DaggerError> {
9430 let query = self.selection.select("parentName");
9431 query.execute(self.graphql_client.clone()).await
9432 }
9433 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9439 let mut query = self.selection.select("returnError");
9440 query = query.arg_lazy(
9441 "error",
9442 Box::new(move || {
9443 let error = error.clone();
9444 Box::pin(async move { error.into_id().await.unwrap().quote() })
9445 }),
9446 );
9447 query.execute(self.graphql_client.clone()).await
9448 }
9449 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9455 let mut query = self.selection.select("returnValue");
9456 query = query.arg("value", value);
9457 query.execute(self.graphql_client.clone()).await
9458 }
9459}
9460impl Node for FunctionCall {
9461 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9462 let query = self.selection.select("id");
9463 let graphql_client = self.graphql_client.clone();
9464 async move { query.execute(graphql_client).await }
9465 }
9466}
9467#[derive(Clone)]
9468pub struct FunctionCallArgValue {
9469 pub proc: Option<Arc<DaggerSessionProc>>,
9470 pub selection: Selection,
9471 pub graphql_client: DynGraphQLClient,
9472}
9473impl IntoID<Id> for FunctionCallArgValue {
9474 fn into_id(
9475 self,
9476 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9477 Box::pin(async move { self.id().await })
9478 }
9479}
9480impl Loadable for FunctionCallArgValue {
9481 fn graphql_type() -> &'static str {
9482 "FunctionCallArgValue"
9483 }
9484 fn from_query(
9485 proc: Option<Arc<DaggerSessionProc>>,
9486 selection: Selection,
9487 graphql_client: DynGraphQLClient,
9488 ) -> Self {
9489 Self {
9490 proc,
9491 selection,
9492 graphql_client,
9493 }
9494 }
9495}
9496impl FunctionCallArgValue {
9497 pub async fn id(&self) -> Result<Id, DaggerError> {
9499 let query = self.selection.select("id");
9500 query.execute(self.graphql_client.clone()).await
9501 }
9502 pub async fn name(&self) -> Result<String, DaggerError> {
9504 let query = self.selection.select("name");
9505 query.execute(self.graphql_client.clone()).await
9506 }
9507 pub async fn value(&self) -> Result<Json, DaggerError> {
9509 let query = self.selection.select("value");
9510 query.execute(self.graphql_client.clone()).await
9511 }
9512}
9513impl Node for FunctionCallArgValue {
9514 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9515 let query = self.selection.select("id");
9516 let graphql_client = self.graphql_client.clone();
9517 async move { query.execute(graphql_client).await }
9518 }
9519}
9520#[derive(Clone)]
9521pub struct GeneratedCode {
9522 pub proc: Option<Arc<DaggerSessionProc>>,
9523 pub selection: Selection,
9524 pub graphql_client: DynGraphQLClient,
9525}
9526impl IntoID<Id> for GeneratedCode {
9527 fn into_id(
9528 self,
9529 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9530 Box::pin(async move { self.id().await })
9531 }
9532}
9533impl Loadable for GeneratedCode {
9534 fn graphql_type() -> &'static str {
9535 "GeneratedCode"
9536 }
9537 fn from_query(
9538 proc: Option<Arc<DaggerSessionProc>>,
9539 selection: Selection,
9540 graphql_client: DynGraphQLClient,
9541 ) -> Self {
9542 Self {
9543 proc,
9544 selection,
9545 graphql_client,
9546 }
9547 }
9548}
9549impl GeneratedCode {
9550 pub fn code(&self) -> Directory {
9552 let query = self.selection.select("code");
9553 Directory {
9554 proc: self.proc.clone(),
9555 selection: query,
9556 graphql_client: self.graphql_client.clone(),
9557 }
9558 }
9559 pub async fn id(&self) -> Result<Id, DaggerError> {
9561 let query = self.selection.select("id");
9562 query.execute(self.graphql_client.clone()).await
9563 }
9564 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9566 let query = self.selection.select("vcsGeneratedPaths");
9567 query.execute(self.graphql_client.clone()).await
9568 }
9569 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9571 let query = self.selection.select("vcsIgnoredPaths");
9572 query.execute(self.graphql_client.clone()).await
9573 }
9574 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9576 let mut query = self.selection.select("withVCSGeneratedPaths");
9577 query = query.arg(
9578 "paths",
9579 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9580 );
9581 GeneratedCode {
9582 proc: self.proc.clone(),
9583 selection: query,
9584 graphql_client: self.graphql_client.clone(),
9585 }
9586 }
9587 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9589 let mut query = self.selection.select("withVCSIgnoredPaths");
9590 query = query.arg(
9591 "paths",
9592 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9593 );
9594 GeneratedCode {
9595 proc: self.proc.clone(),
9596 selection: query,
9597 graphql_client: self.graphql_client.clone(),
9598 }
9599 }
9600}
9601impl Node for GeneratedCode {
9602 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9603 let query = self.selection.select("id");
9604 let graphql_client = self.graphql_client.clone();
9605 async move { query.execute(graphql_client).await }
9606 }
9607}
9608#[derive(Clone)]
9609pub struct Generator {
9610 pub proc: Option<Arc<DaggerSessionProc>>,
9611 pub selection: Selection,
9612 pub graphql_client: DynGraphQLClient,
9613}
9614impl IntoID<Id> for Generator {
9615 fn into_id(
9616 self,
9617 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9618 Box::pin(async move { self.id().await })
9619 }
9620}
9621impl Loadable for Generator {
9622 fn graphql_type() -> &'static str {
9623 "Generator"
9624 }
9625 fn from_query(
9626 proc: Option<Arc<DaggerSessionProc>>,
9627 selection: Selection,
9628 graphql_client: DynGraphQLClient,
9629 ) -> Self {
9630 Self {
9631 proc,
9632 selection,
9633 graphql_client,
9634 }
9635 }
9636}
9637impl Generator {
9638 pub fn changes(&self) -> Changeset {
9640 let query = self.selection.select("changes");
9641 Changeset {
9642 proc: self.proc.clone(),
9643 selection: query,
9644 graphql_client: self.graphql_client.clone(),
9645 }
9646 }
9647 pub async fn completed(&self) -> Result<bool, DaggerError> {
9649 let query = self.selection.select("completed");
9650 query.execute(self.graphql_client.clone()).await
9651 }
9652 pub async fn description(&self) -> Result<String, DaggerError> {
9654 let query = self.selection.select("description");
9655 query.execute(self.graphql_client.clone()).await
9656 }
9657 pub async fn id(&self) -> Result<Id, DaggerError> {
9659 let query = self.selection.select("id");
9660 query.execute(self.graphql_client.clone()).await
9661 }
9662 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9664 let query = self.selection.select("isEmpty");
9665 query.execute(self.graphql_client.clone()).await
9666 }
9667 pub async fn name(&self) -> Result<String, DaggerError> {
9669 let query = self.selection.select("name");
9670 query.execute(self.graphql_client.clone()).await
9671 }
9672 pub fn original_module(&self) -> Module {
9674 let query = self.selection.select("originalModule");
9675 Module {
9676 proc: self.proc.clone(),
9677 selection: query,
9678 graphql_client: self.graphql_client.clone(),
9679 }
9680 }
9681 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9683 let query = self.selection.select("path");
9684 query.execute(self.graphql_client.clone()).await
9685 }
9686 pub fn run(&self) -> Generator {
9688 let query = self.selection.select("run");
9689 Generator {
9690 proc: self.proc.clone(),
9691 selection: query,
9692 graphql_client: self.graphql_client.clone(),
9693 }
9694 }
9695}
9696impl Node for Generator {
9697 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9698 let query = self.selection.select("id");
9699 let graphql_client = self.graphql_client.clone();
9700 async move { query.execute(graphql_client).await }
9701 }
9702}
9703#[derive(Clone)]
9704pub struct GeneratorGroup {
9705 pub proc: Option<Arc<DaggerSessionProc>>,
9706 pub selection: Selection,
9707 pub graphql_client: DynGraphQLClient,
9708}
9709#[derive(Builder, Debug, PartialEq)]
9710pub struct GeneratorGroupChangesOpts {
9711 #[builder(setter(into, strip_option), default)]
9713 pub on_conflict: Option<ChangesetsMergeConflict>,
9714}
9715impl IntoID<Id> for GeneratorGroup {
9716 fn into_id(
9717 self,
9718 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9719 Box::pin(async move { self.id().await })
9720 }
9721}
9722impl Loadable for GeneratorGroup {
9723 fn graphql_type() -> &'static str {
9724 "GeneratorGroup"
9725 }
9726 fn from_query(
9727 proc: Option<Arc<DaggerSessionProc>>,
9728 selection: Selection,
9729 graphql_client: DynGraphQLClient,
9730 ) -> Self {
9731 Self {
9732 proc,
9733 selection,
9734 graphql_client,
9735 }
9736 }
9737}
9738impl GeneratorGroup {
9739 pub fn changes(&self) -> Changeset {
9747 let query = self.selection.select("changes");
9748 Changeset {
9749 proc: self.proc.clone(),
9750 selection: query,
9751 graphql_client: self.graphql_client.clone(),
9752 }
9753 }
9754 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9762 let mut query = self.selection.select("changes");
9763 if let Some(on_conflict) = opts.on_conflict {
9764 query = query.arg("onConflict", on_conflict);
9765 }
9766 Changeset {
9767 proc: self.proc.clone(),
9768 selection: query,
9769 graphql_client: self.graphql_client.clone(),
9770 }
9771 }
9772 pub async fn id(&self) -> Result<Id, DaggerError> {
9774 let query = self.selection.select("id");
9775 query.execute(self.graphql_client.clone()).await
9776 }
9777 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9779 let query = self.selection.select("isEmpty");
9780 query.execute(self.graphql_client.clone()).await
9781 }
9782 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9784 let query = self.selection.select("list");
9785 let query = query.select("id");
9786 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9787 Ok(ids
9788 .into_iter()
9789 .map(|id| Generator {
9790 proc: self.proc.clone(),
9791 selection: crate::querybuilder::query()
9792 .select("node")
9793 .arg("id", &id.0)
9794 .inline_fragment("Generator"),
9795 graphql_client: self.graphql_client.clone(),
9796 })
9797 .collect())
9798 }
9799 pub fn run(&self) -> GeneratorGroup {
9801 let query = self.selection.select("run");
9802 GeneratorGroup {
9803 proc: self.proc.clone(),
9804 selection: query,
9805 graphql_client: self.graphql_client.clone(),
9806 }
9807 }
9808}
9809impl Node for GeneratorGroup {
9810 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9811 let query = self.selection.select("id");
9812 let graphql_client = self.graphql_client.clone();
9813 async move { query.execute(graphql_client).await }
9814 }
9815}
9816#[derive(Clone)]
9817pub struct GitRef {
9818 pub proc: Option<Arc<DaggerSessionProc>>,
9819 pub selection: Selection,
9820 pub graphql_client: DynGraphQLClient,
9821}
9822#[derive(Builder, Debug, PartialEq)]
9823pub struct GitRefTreeOpts {
9824 #[builder(setter(into, strip_option), default)]
9826 pub depth: Option<isize>,
9827 #[builder(setter(into, strip_option), default)]
9829 pub discard_git_dir: Option<bool>,
9830 #[builder(setter(into, strip_option), default)]
9832 pub include_tags: Option<bool>,
9833}
9834impl IntoID<Id> for GitRef {
9835 fn into_id(
9836 self,
9837 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9838 Box::pin(async move { self.id().await })
9839 }
9840}
9841impl Loadable for GitRef {
9842 fn graphql_type() -> &'static str {
9843 "GitRef"
9844 }
9845 fn from_query(
9846 proc: Option<Arc<DaggerSessionProc>>,
9847 selection: Selection,
9848 graphql_client: DynGraphQLClient,
9849 ) -> Self {
9850 Self {
9851 proc,
9852 selection,
9853 graphql_client,
9854 }
9855 }
9856}
9857impl GitRef {
9858 pub async fn commit(&self) -> Result<String, DaggerError> {
9860 let query = self.selection.select("commit");
9861 query.execute(self.graphql_client.clone()).await
9862 }
9863 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9869 let mut query = self.selection.select("commonAncestor");
9870 query = query.arg_lazy(
9871 "other",
9872 Box::new(move || {
9873 let other = other.clone();
9874 Box::pin(async move { other.into_id().await.unwrap().quote() })
9875 }),
9876 );
9877 GitRef {
9878 proc: self.proc.clone(),
9879 selection: query,
9880 graphql_client: self.graphql_client.clone(),
9881 }
9882 }
9883 pub async fn id(&self) -> Result<Id, DaggerError> {
9885 let query = self.selection.select("id");
9886 query.execute(self.graphql_client.clone()).await
9887 }
9888 pub async fn r#ref(&self) -> Result<String, DaggerError> {
9890 let query = self.selection.select("ref");
9891 query.execute(self.graphql_client.clone()).await
9892 }
9893 pub fn tree(&self) -> Directory {
9899 let query = self.selection.select("tree");
9900 Directory {
9901 proc: self.proc.clone(),
9902 selection: query,
9903 graphql_client: self.graphql_client.clone(),
9904 }
9905 }
9906 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9912 let mut query = self.selection.select("tree");
9913 if let Some(discard_git_dir) = opts.discard_git_dir {
9914 query = query.arg("discardGitDir", discard_git_dir);
9915 }
9916 if let Some(depth) = opts.depth {
9917 query = query.arg("depth", depth);
9918 }
9919 if let Some(include_tags) = opts.include_tags {
9920 query = query.arg("includeTags", include_tags);
9921 }
9922 Directory {
9923 proc: self.proc.clone(),
9924 selection: query,
9925 graphql_client: self.graphql_client.clone(),
9926 }
9927 }
9928}
9929impl Node for GitRef {
9930 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9931 let query = self.selection.select("id");
9932 let graphql_client = self.graphql_client.clone();
9933 async move { query.execute(graphql_client).await }
9934 }
9935}
9936#[derive(Clone)]
9937pub struct GitRepository {
9938 pub proc: Option<Arc<DaggerSessionProc>>,
9939 pub selection: Selection,
9940 pub graphql_client: DynGraphQLClient,
9941}
9942#[derive(Builder, Debug, PartialEq)]
9943pub struct GitRepositoryBranchesOpts<'a> {
9944 #[builder(setter(into, strip_option), default)]
9946 pub patterns: Option<Vec<&'a str>>,
9947}
9948#[derive(Builder, Debug, PartialEq)]
9949pub struct GitRepositoryTagsOpts<'a> {
9950 #[builder(setter(into, strip_option), default)]
9952 pub patterns: Option<Vec<&'a str>>,
9953}
9954impl IntoID<Id> for GitRepository {
9955 fn into_id(
9956 self,
9957 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9958 Box::pin(async move { self.id().await })
9959 }
9960}
9961impl Loadable for GitRepository {
9962 fn graphql_type() -> &'static str {
9963 "GitRepository"
9964 }
9965 fn from_query(
9966 proc: Option<Arc<DaggerSessionProc>>,
9967 selection: Selection,
9968 graphql_client: DynGraphQLClient,
9969 ) -> Self {
9970 Self {
9971 proc,
9972 selection,
9973 graphql_client,
9974 }
9975 }
9976}
9977impl GitRepository {
9978 pub fn branch(&self, name: impl Into<String>) -> GitRef {
9984 let mut query = self.selection.select("branch");
9985 query = query.arg("name", name.into());
9986 GitRef {
9987 proc: self.proc.clone(),
9988 selection: query,
9989 graphql_client: self.graphql_client.clone(),
9990 }
9991 }
9992 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9998 let query = self.selection.select("branches");
9999 query.execute(self.graphql_client.clone()).await
10000 }
10001 pub async fn branches_opts<'a>(
10007 &self,
10008 opts: GitRepositoryBranchesOpts<'a>,
10009 ) -> Result<Vec<String>, DaggerError> {
10010 let mut query = self.selection.select("branches");
10011 if let Some(patterns) = opts.patterns {
10012 query = query.arg("patterns", patterns);
10013 }
10014 query.execute(self.graphql_client.clone()).await
10015 }
10016 pub fn commit(&self, id: impl Into<String>) -> GitRef {
10022 let mut query = self.selection.select("commit");
10023 query = query.arg("id", id.into());
10024 GitRef {
10025 proc: self.proc.clone(),
10026 selection: query,
10027 graphql_client: self.graphql_client.clone(),
10028 }
10029 }
10030 pub fn head(&self) -> GitRef {
10032 let query = self.selection.select("head");
10033 GitRef {
10034 proc: self.proc.clone(),
10035 selection: query,
10036 graphql_client: self.graphql_client.clone(),
10037 }
10038 }
10039 pub async fn id(&self) -> Result<Id, DaggerError> {
10041 let query = self.selection.select("id");
10042 query.execute(self.graphql_client.clone()).await
10043 }
10044 pub fn latest_version(&self) -> GitRef {
10046 let query = self.selection.select("latestVersion");
10047 GitRef {
10048 proc: self.proc.clone(),
10049 selection: query,
10050 graphql_client: self.graphql_client.clone(),
10051 }
10052 }
10053 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10059 let mut query = self.selection.select("ref");
10060 query = query.arg("name", name.into());
10061 GitRef {
10062 proc: self.proc.clone(),
10063 selection: query,
10064 graphql_client: self.graphql_client.clone(),
10065 }
10066 }
10067 pub fn tag(&self, name: impl Into<String>) -> GitRef {
10073 let mut query = self.selection.select("tag");
10074 query = query.arg("name", name.into());
10075 GitRef {
10076 proc: self.proc.clone(),
10077 selection: query,
10078 graphql_client: self.graphql_client.clone(),
10079 }
10080 }
10081 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10087 let query = self.selection.select("tags");
10088 query.execute(self.graphql_client.clone()).await
10089 }
10090 pub async fn tags_opts<'a>(
10096 &self,
10097 opts: GitRepositoryTagsOpts<'a>,
10098 ) -> Result<Vec<String>, DaggerError> {
10099 let mut query = self.selection.select("tags");
10100 if let Some(patterns) = opts.patterns {
10101 query = query.arg("patterns", patterns);
10102 }
10103 query.execute(self.graphql_client.clone()).await
10104 }
10105 pub fn uncommitted(&self) -> Changeset {
10107 let query = self.selection.select("uncommitted");
10108 Changeset {
10109 proc: self.proc.clone(),
10110 selection: query,
10111 graphql_client: self.graphql_client.clone(),
10112 }
10113 }
10114 pub async fn url(&self) -> Result<String, DaggerError> {
10116 let query = self.selection.select("url");
10117 query.execute(self.graphql_client.clone()).await
10118 }
10119}
10120impl Node for GitRepository {
10121 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10122 let query = self.selection.select("id");
10123 let graphql_client = self.graphql_client.clone();
10124 async move { query.execute(graphql_client).await }
10125 }
10126}
10127#[derive(Clone)]
10128pub struct HttpState {
10129 pub proc: Option<Arc<DaggerSessionProc>>,
10130 pub selection: Selection,
10131 pub graphql_client: DynGraphQLClient,
10132}
10133impl IntoID<Id> for HttpState {
10134 fn into_id(
10135 self,
10136 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10137 Box::pin(async move { self.id().await })
10138 }
10139}
10140impl Loadable for HttpState {
10141 fn graphql_type() -> &'static str {
10142 "HTTPState"
10143 }
10144 fn from_query(
10145 proc: Option<Arc<DaggerSessionProc>>,
10146 selection: Selection,
10147 graphql_client: DynGraphQLClient,
10148 ) -> Self {
10149 Self {
10150 proc,
10151 selection,
10152 graphql_client,
10153 }
10154 }
10155}
10156impl HttpState {
10157 pub async fn id(&self) -> Result<Id, DaggerError> {
10159 let query = self.selection.select("id");
10160 query.execute(self.graphql_client.clone()).await
10161 }
10162}
10163impl Node for HttpState {
10164 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10165 let query = self.selection.select("id");
10166 let graphql_client = self.graphql_client.clone();
10167 async move { query.execute(graphql_client).await }
10168 }
10169}
10170#[derive(Clone)]
10171pub struct HealthcheckConfig {
10172 pub proc: Option<Arc<DaggerSessionProc>>,
10173 pub selection: Selection,
10174 pub graphql_client: DynGraphQLClient,
10175}
10176impl IntoID<Id> for HealthcheckConfig {
10177 fn into_id(
10178 self,
10179 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10180 Box::pin(async move { self.id().await })
10181 }
10182}
10183impl Loadable for HealthcheckConfig {
10184 fn graphql_type() -> &'static str {
10185 "HealthcheckConfig"
10186 }
10187 fn from_query(
10188 proc: Option<Arc<DaggerSessionProc>>,
10189 selection: Selection,
10190 graphql_client: DynGraphQLClient,
10191 ) -> Self {
10192 Self {
10193 proc,
10194 selection,
10195 graphql_client,
10196 }
10197 }
10198}
10199impl HealthcheckConfig {
10200 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10202 let query = self.selection.select("args");
10203 query.execute(self.graphql_client.clone()).await
10204 }
10205 pub async fn id(&self) -> Result<Id, DaggerError> {
10207 let query = self.selection.select("id");
10208 query.execute(self.graphql_client.clone()).await
10209 }
10210 pub async fn interval(&self) -> Result<String, DaggerError> {
10212 let query = self.selection.select("interval");
10213 query.execute(self.graphql_client.clone()).await
10214 }
10215 pub async fn retries(&self) -> Result<isize, DaggerError> {
10217 let query = self.selection.select("retries");
10218 query.execute(self.graphql_client.clone()).await
10219 }
10220 pub async fn shell(&self) -> Result<bool, DaggerError> {
10222 let query = self.selection.select("shell");
10223 query.execute(self.graphql_client.clone()).await
10224 }
10225 pub async fn start_interval(&self) -> Result<String, DaggerError> {
10227 let query = self.selection.select("startInterval");
10228 query.execute(self.graphql_client.clone()).await
10229 }
10230 pub async fn start_period(&self) -> Result<String, DaggerError> {
10232 let query = self.selection.select("startPeriod");
10233 query.execute(self.graphql_client.clone()).await
10234 }
10235 pub async fn timeout(&self) -> Result<String, DaggerError> {
10237 let query = self.selection.select("timeout");
10238 query.execute(self.graphql_client.clone()).await
10239 }
10240}
10241impl Node for HealthcheckConfig {
10242 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10243 let query = self.selection.select("id");
10244 let graphql_client = self.graphql_client.clone();
10245 async move { query.execute(graphql_client).await }
10246 }
10247}
10248#[derive(Clone)]
10249pub struct Host {
10250 pub proc: Option<Arc<DaggerSessionProc>>,
10251 pub selection: Selection,
10252 pub graphql_client: DynGraphQLClient,
10253}
10254#[derive(Builder, Debug, PartialEq)]
10255pub struct HostDirectoryOpts<'a> {
10256 #[builder(setter(into, strip_option), default)]
10258 pub exclude: Option<Vec<&'a str>>,
10259 #[builder(setter(into, strip_option), default)]
10261 pub gitignore: Option<bool>,
10262 #[builder(setter(into, strip_option), default)]
10264 pub include: Option<Vec<&'a str>>,
10265 #[builder(setter(into, strip_option), default)]
10267 pub no_cache: Option<bool>,
10268}
10269#[derive(Builder, Debug, PartialEq)]
10270pub struct HostFileOpts {
10271 #[builder(setter(into, strip_option), default)]
10273 pub no_cache: Option<bool>,
10274}
10275#[derive(Builder, Debug, PartialEq)]
10276pub struct HostFindUpOpts {
10277 #[builder(setter(into, strip_option), default)]
10278 pub no_cache: Option<bool>,
10279}
10280#[derive(Builder, Debug, PartialEq)]
10281pub struct HostServiceOpts<'a> {
10282 #[builder(setter(into, strip_option), default)]
10284 pub host: Option<&'a str>,
10285}
10286#[derive(Builder, Debug, PartialEq)]
10287pub struct HostTunnelOpts {
10288 #[builder(setter(into, strip_option), default)]
10291 pub native: Option<bool>,
10292 #[builder(setter(into, strip_option), default)]
10297 pub ports: Option<Vec<PortForward>>,
10298}
10299impl IntoID<Id> for Host {
10300 fn into_id(
10301 self,
10302 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10303 Box::pin(async move { self.id().await })
10304 }
10305}
10306impl Loadable for Host {
10307 fn graphql_type() -> &'static str {
10308 "Host"
10309 }
10310 fn from_query(
10311 proc: Option<Arc<DaggerSessionProc>>,
10312 selection: Selection,
10313 graphql_client: DynGraphQLClient,
10314 ) -> Self {
10315 Self {
10316 proc,
10317 selection,
10318 graphql_client,
10319 }
10320 }
10321}
10322impl Host {
10323 pub fn container_image(&self, name: impl Into<String>) -> Container {
10329 let mut query = self.selection.select("containerImage");
10330 query = query.arg("name", name.into());
10331 Container {
10332 proc: self.proc.clone(),
10333 selection: query,
10334 graphql_client: self.graphql_client.clone(),
10335 }
10336 }
10337 pub fn directory(&self, path: impl Into<String>) -> Directory {
10344 let mut query = self.selection.select("directory");
10345 query = query.arg("path", path.into());
10346 Directory {
10347 proc: self.proc.clone(),
10348 selection: query,
10349 graphql_client: self.graphql_client.clone(),
10350 }
10351 }
10352 pub fn directory_opts<'a>(
10359 &self,
10360 path: impl Into<String>,
10361 opts: HostDirectoryOpts<'a>,
10362 ) -> Directory {
10363 let mut query = self.selection.select("directory");
10364 query = query.arg("path", path.into());
10365 if let Some(exclude) = opts.exclude {
10366 query = query.arg("exclude", exclude);
10367 }
10368 if let Some(include) = opts.include {
10369 query = query.arg("include", include);
10370 }
10371 if let Some(no_cache) = opts.no_cache {
10372 query = query.arg("noCache", no_cache);
10373 }
10374 if let Some(gitignore) = opts.gitignore {
10375 query = query.arg("gitignore", gitignore);
10376 }
10377 Directory {
10378 proc: self.proc.clone(),
10379 selection: query,
10380 graphql_client: self.graphql_client.clone(),
10381 }
10382 }
10383 pub fn file(&self, path: impl Into<String>) -> File {
10390 let mut query = self.selection.select("file");
10391 query = query.arg("path", path.into());
10392 File {
10393 proc: self.proc.clone(),
10394 selection: query,
10395 graphql_client: self.graphql_client.clone(),
10396 }
10397 }
10398 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10405 let mut query = self.selection.select("file");
10406 query = query.arg("path", path.into());
10407 if let Some(no_cache) = opts.no_cache {
10408 query = query.arg("noCache", no_cache);
10409 }
10410 File {
10411 proc: self.proc.clone(),
10412 selection: query,
10413 graphql_client: self.graphql_client.clone(),
10414 }
10415 }
10416 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10423 let mut query = self.selection.select("findUp");
10424 query = query.arg("name", name.into());
10425 query.execute(self.graphql_client.clone()).await
10426 }
10427 pub async fn find_up_opts(
10434 &self,
10435 name: impl Into<String>,
10436 opts: HostFindUpOpts,
10437 ) -> Result<String, DaggerError> {
10438 let mut query = self.selection.select("findUp");
10439 query = query.arg("name", name.into());
10440 if let Some(no_cache) = opts.no_cache {
10441 query = query.arg("noCache", no_cache);
10442 }
10443 query.execute(self.graphql_client.clone()).await
10444 }
10445 pub async fn id(&self) -> Result<Id, DaggerError> {
10447 let query = self.selection.select("id");
10448 query.execute(self.graphql_client.clone()).await
10449 }
10450 pub fn service(&self, ports: Vec<PortForward>) -> Service {
10461 let mut query = self.selection.select("service");
10462 query = query.arg("ports", ports);
10463 Service {
10464 proc: self.proc.clone(),
10465 selection: query,
10466 graphql_client: self.graphql_client.clone(),
10467 }
10468 }
10469 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10480 let mut query = self.selection.select("service");
10481 query = query.arg("ports", ports);
10482 if let Some(host) = opts.host {
10483 query = query.arg("host", host);
10484 }
10485 Service {
10486 proc: self.proc.clone(),
10487 selection: query,
10488 graphql_client: self.graphql_client.clone(),
10489 }
10490 }
10491 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10498 let mut query = self.selection.select("tunnel");
10499 query = query.arg_lazy(
10500 "service",
10501 Box::new(move || {
10502 let service = service.clone();
10503 Box::pin(async move { service.into_id().await.unwrap().quote() })
10504 }),
10505 );
10506 Service {
10507 proc: self.proc.clone(),
10508 selection: query,
10509 graphql_client: self.graphql_client.clone(),
10510 }
10511 }
10512 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10519 let mut query = self.selection.select("tunnel");
10520 query = query.arg_lazy(
10521 "service",
10522 Box::new(move || {
10523 let service = service.clone();
10524 Box::pin(async move { service.into_id().await.unwrap().quote() })
10525 }),
10526 );
10527 if let Some(native) = opts.native {
10528 query = query.arg("native", native);
10529 }
10530 if let Some(ports) = opts.ports {
10531 query = query.arg("ports", ports);
10532 }
10533 Service {
10534 proc: self.proc.clone(),
10535 selection: query,
10536 graphql_client: self.graphql_client.clone(),
10537 }
10538 }
10539 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10545 let mut query = self.selection.select("unixSocket");
10546 query = query.arg("path", path.into());
10547 Socket {
10548 proc: self.proc.clone(),
10549 selection: query,
10550 graphql_client: self.graphql_client.clone(),
10551 }
10552 }
10553}
10554impl Node for Host {
10555 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10556 let query = self.selection.select("id");
10557 let graphql_client = self.graphql_client.clone();
10558 async move { query.execute(graphql_client).await }
10559 }
10560}
10561#[derive(Clone)]
10562pub struct InputTypeDef {
10563 pub proc: Option<Arc<DaggerSessionProc>>,
10564 pub selection: Selection,
10565 pub graphql_client: DynGraphQLClient,
10566}
10567impl IntoID<Id> for InputTypeDef {
10568 fn into_id(
10569 self,
10570 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10571 Box::pin(async move { self.id().await })
10572 }
10573}
10574impl Loadable for InputTypeDef {
10575 fn graphql_type() -> &'static str {
10576 "InputTypeDef"
10577 }
10578 fn from_query(
10579 proc: Option<Arc<DaggerSessionProc>>,
10580 selection: Selection,
10581 graphql_client: DynGraphQLClient,
10582 ) -> Self {
10583 Self {
10584 proc,
10585 selection,
10586 graphql_client,
10587 }
10588 }
10589}
10590impl InputTypeDef {
10591 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10593 let query = self.selection.select("fields");
10594 let query = query.select("id");
10595 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10596 Ok(ids
10597 .into_iter()
10598 .map(|id| FieldTypeDef {
10599 proc: self.proc.clone(),
10600 selection: crate::querybuilder::query()
10601 .select("node")
10602 .arg("id", &id.0)
10603 .inline_fragment("FieldTypeDef"),
10604 graphql_client: self.graphql_client.clone(),
10605 })
10606 .collect())
10607 }
10608 pub async fn id(&self) -> Result<Id, DaggerError> {
10610 let query = self.selection.select("id");
10611 query.execute(self.graphql_client.clone()).await
10612 }
10613 pub async fn name(&self) -> Result<String, DaggerError> {
10615 let query = self.selection.select("name");
10616 query.execute(self.graphql_client.clone()).await
10617 }
10618}
10619impl Node for InputTypeDef {
10620 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10621 let query = self.selection.select("id");
10622 let graphql_client = self.graphql_client.clone();
10623 async move { query.execute(graphql_client).await }
10624 }
10625}
10626#[derive(Clone)]
10627pub struct InterfaceTypeDef {
10628 pub proc: Option<Arc<DaggerSessionProc>>,
10629 pub selection: Selection,
10630 pub graphql_client: DynGraphQLClient,
10631}
10632impl IntoID<Id> for InterfaceTypeDef {
10633 fn into_id(
10634 self,
10635 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10636 Box::pin(async move { self.id().await })
10637 }
10638}
10639impl Loadable for InterfaceTypeDef {
10640 fn graphql_type() -> &'static str {
10641 "InterfaceTypeDef"
10642 }
10643 fn from_query(
10644 proc: Option<Arc<DaggerSessionProc>>,
10645 selection: Selection,
10646 graphql_client: DynGraphQLClient,
10647 ) -> Self {
10648 Self {
10649 proc,
10650 selection,
10651 graphql_client,
10652 }
10653 }
10654}
10655impl InterfaceTypeDef {
10656 pub async fn description(&self) -> Result<String, DaggerError> {
10658 let query = self.selection.select("description");
10659 query.execute(self.graphql_client.clone()).await
10660 }
10661 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10663 let query = self.selection.select("functions");
10664 let query = query.select("id");
10665 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10666 Ok(ids
10667 .into_iter()
10668 .map(|id| Function {
10669 proc: self.proc.clone(),
10670 selection: crate::querybuilder::query()
10671 .select("node")
10672 .arg("id", &id.0)
10673 .inline_fragment("Function"),
10674 graphql_client: self.graphql_client.clone(),
10675 })
10676 .collect())
10677 }
10678 pub async fn id(&self) -> Result<Id, DaggerError> {
10680 let query = self.selection.select("id");
10681 query.execute(self.graphql_client.clone()).await
10682 }
10683 pub async fn name(&self) -> Result<String, DaggerError> {
10685 let query = self.selection.select("name");
10686 query.execute(self.graphql_client.clone()).await
10687 }
10688 pub fn source_map(&self) -> SourceMap {
10690 let query = self.selection.select("sourceMap");
10691 SourceMap {
10692 proc: self.proc.clone(),
10693 selection: query,
10694 graphql_client: self.graphql_client.clone(),
10695 }
10696 }
10697 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10699 let query = self.selection.select("sourceModuleName");
10700 query.execute(self.graphql_client.clone()).await
10701 }
10702}
10703impl Node for InterfaceTypeDef {
10704 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10705 let query = self.selection.select("id");
10706 let graphql_client = self.graphql_client.clone();
10707 async move { query.execute(graphql_client).await }
10708 }
10709}
10710#[derive(Clone)]
10711pub struct JsonValue {
10712 pub proc: Option<Arc<DaggerSessionProc>>,
10713 pub selection: Selection,
10714 pub graphql_client: DynGraphQLClient,
10715}
10716#[derive(Builder, Debug, PartialEq)]
10717pub struct JsonValueContentsOpts<'a> {
10718 #[builder(setter(into, strip_option), default)]
10720 pub indent: Option<&'a str>,
10721 #[builder(setter(into, strip_option), default)]
10723 pub pretty: Option<bool>,
10724}
10725impl IntoID<Id> for JsonValue {
10726 fn into_id(
10727 self,
10728 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10729 Box::pin(async move { self.id().await })
10730 }
10731}
10732impl Loadable for JsonValue {
10733 fn graphql_type() -> &'static str {
10734 "JSONValue"
10735 }
10736 fn from_query(
10737 proc: Option<Arc<DaggerSessionProc>>,
10738 selection: Selection,
10739 graphql_client: DynGraphQLClient,
10740 ) -> Self {
10741 Self {
10742 proc,
10743 selection,
10744 graphql_client,
10745 }
10746 }
10747}
10748impl JsonValue {
10749 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10751 let query = self.selection.select("asArray");
10752 let query = query.select("id");
10753 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10754 Ok(ids
10755 .into_iter()
10756 .map(|id| JsonValue {
10757 proc: self.proc.clone(),
10758 selection: crate::querybuilder::query()
10759 .select("node")
10760 .arg("id", &id.0)
10761 .inline_fragment("JSONValue"),
10762 graphql_client: self.graphql_client.clone(),
10763 })
10764 .collect())
10765 }
10766 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10768 let query = self.selection.select("asBoolean");
10769 query.execute(self.graphql_client.clone()).await
10770 }
10771 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10773 let query = self.selection.select("asInteger");
10774 query.execute(self.graphql_client.clone()).await
10775 }
10776 pub async fn as_string(&self) -> Result<String, DaggerError> {
10778 let query = self.selection.select("asString");
10779 query.execute(self.graphql_client.clone()).await
10780 }
10781 pub async fn contents(&self) -> Result<Json, DaggerError> {
10787 let query = self.selection.select("contents");
10788 query.execute(self.graphql_client.clone()).await
10789 }
10790 pub async fn contents_opts<'a>(
10796 &self,
10797 opts: JsonValueContentsOpts<'a>,
10798 ) -> Result<Json, DaggerError> {
10799 let mut query = self.selection.select("contents");
10800 if let Some(pretty) = opts.pretty {
10801 query = query.arg("pretty", pretty);
10802 }
10803 if let Some(indent) = opts.indent {
10804 query = query.arg("indent", indent);
10805 }
10806 query.execute(self.graphql_client.clone()).await
10807 }
10808 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10814 let mut query = self.selection.select("field");
10815 query = query.arg(
10816 "path",
10817 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10818 );
10819 JsonValue {
10820 proc: self.proc.clone(),
10821 selection: query,
10822 graphql_client: self.graphql_client.clone(),
10823 }
10824 }
10825 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10827 let query = self.selection.select("fields");
10828 query.execute(self.graphql_client.clone()).await
10829 }
10830 pub async fn id(&self) -> Result<Id, DaggerError> {
10832 let query = self.selection.select("id");
10833 query.execute(self.graphql_client.clone()).await
10834 }
10835 pub fn new_boolean(&self, value: bool) -> JsonValue {
10841 let mut query = self.selection.select("newBoolean");
10842 query = query.arg("value", value);
10843 JsonValue {
10844 proc: self.proc.clone(),
10845 selection: query,
10846 graphql_client: self.graphql_client.clone(),
10847 }
10848 }
10849 pub fn new_integer(&self, value: isize) -> JsonValue {
10855 let mut query = self.selection.select("newInteger");
10856 query = query.arg("value", value);
10857 JsonValue {
10858 proc: self.proc.clone(),
10859 selection: query,
10860 graphql_client: self.graphql_client.clone(),
10861 }
10862 }
10863 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10869 let mut query = self.selection.select("newString");
10870 query = query.arg("value", value.into());
10871 JsonValue {
10872 proc: self.proc.clone(),
10873 selection: query,
10874 graphql_client: self.graphql_client.clone(),
10875 }
10876 }
10877 pub fn with_contents(&self, contents: Json) -> JsonValue {
10883 let mut query = self.selection.select("withContents");
10884 query = query.arg("contents", contents);
10885 JsonValue {
10886 proc: self.proc.clone(),
10887 selection: query,
10888 graphql_client: self.graphql_client.clone(),
10889 }
10890 }
10891 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10898 let mut query = self.selection.select("withField");
10899 query = query.arg(
10900 "path",
10901 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10902 );
10903 query = query.arg_lazy(
10904 "value",
10905 Box::new(move || {
10906 let value = value.clone();
10907 Box::pin(async move { value.into_id().await.unwrap().quote() })
10908 }),
10909 );
10910 JsonValue {
10911 proc: self.proc.clone(),
10912 selection: query,
10913 graphql_client: self.graphql_client.clone(),
10914 }
10915 }
10916}
10917impl Node for JsonValue {
10918 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10919 let query = self.selection.select("id");
10920 let graphql_client = self.graphql_client.clone();
10921 async move { query.execute(graphql_client).await }
10922 }
10923}
10924#[derive(Clone)]
10925pub struct Llm {
10926 pub proc: Option<Arc<DaggerSessionProc>>,
10927 pub selection: Selection,
10928 pub graphql_client: DynGraphQLClient,
10929}
10930impl IntoID<Id> for Llm {
10931 fn into_id(
10932 self,
10933 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10934 Box::pin(async move { self.id().await })
10935 }
10936}
10937impl Loadable for Llm {
10938 fn graphql_type() -> &'static str {
10939 "LLM"
10940 }
10941 fn from_query(
10942 proc: Option<Arc<DaggerSessionProc>>,
10943 selection: Selection,
10944 graphql_client: DynGraphQLClient,
10945 ) -> Self {
10946 Self {
10947 proc,
10948 selection,
10949 graphql_client,
10950 }
10951 }
10952}
10953impl Llm {
10954 pub fn attempt(&self, number: isize) -> Llm {
10956 let mut query = self.selection.select("attempt");
10957 query = query.arg("number", number);
10958 Llm {
10959 proc: self.proc.clone(),
10960 selection: query,
10961 graphql_client: self.graphql_client.clone(),
10962 }
10963 }
10964 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10966 let mut query = self.selection.select("bindResult");
10967 query = query.arg("name", name.into());
10968 Binding {
10969 proc: self.proc.clone(),
10970 selection: query,
10971 graphql_client: self.graphql_client.clone(),
10972 }
10973 }
10974 pub fn env(&self) -> Env {
10976 let query = self.selection.select("env");
10977 Env {
10978 proc: self.proc.clone(),
10979 selection: query,
10980 graphql_client: self.graphql_client.clone(),
10981 }
10982 }
10983 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10985 let query = self.selection.select("hasPrompt");
10986 query.execute(self.graphql_client.clone()).await
10987 }
10988 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10990 let query = self.selection.select("history");
10991 query.execute(self.graphql_client.clone()).await
10992 }
10993 pub async fn history_json(&self) -> Result<Json, DaggerError> {
10995 let query = self.selection.select("historyJSON");
10996 query.execute(self.graphql_client.clone()).await
10997 }
10998 pub async fn id(&self) -> Result<Id, DaggerError> {
11000 let query = self.selection.select("id");
11001 query.execute(self.graphql_client.clone()).await
11002 }
11003 pub async fn last_reply(&self) -> Result<String, DaggerError> {
11005 let query = self.selection.select("lastReply");
11006 query.execute(self.graphql_client.clone()).await
11007 }
11008 pub fn r#loop(&self) -> Llm {
11010 let query = self.selection.select("loop");
11011 Llm {
11012 proc: self.proc.clone(),
11013 selection: query,
11014 graphql_client: self.graphql_client.clone(),
11015 }
11016 }
11017 pub async fn model(&self) -> Result<String, DaggerError> {
11019 let query = self.selection.select("model");
11020 query.execute(self.graphql_client.clone()).await
11021 }
11022 pub async fn provider(&self) -> Result<String, DaggerError> {
11024 let query = self.selection.select("provider");
11025 query.execute(self.graphql_client.clone()).await
11026 }
11027 pub async fn step(&self) -> Result<Llm, DaggerError> {
11029 let query = self.selection.select("step");
11030 let id: Id = query.execute(self.graphql_client.clone()).await?;
11031 Ok(Llm {
11032 proc: self.proc.clone(),
11033 selection: query
11034 .root()
11035 .select("node")
11036 .arg("id", &id.0)
11037 .inline_fragment("LLM"),
11038 graphql_client: self.graphql_client.clone(),
11039 })
11040 }
11041 pub async fn sync(&self) -> Result<Llm, DaggerError> {
11043 let query = self.selection.select("sync");
11044 let id: Id = query.execute(self.graphql_client.clone()).await?;
11045 Ok(Llm {
11046 proc: self.proc.clone(),
11047 selection: query
11048 .root()
11049 .select("node")
11050 .arg("id", &id.0)
11051 .inline_fragment("LLM"),
11052 graphql_client: self.graphql_client.clone(),
11053 })
11054 }
11055 pub fn token_usage(&self) -> LlmTokenUsage {
11057 let query = self.selection.select("tokenUsage");
11058 LlmTokenUsage {
11059 proc: self.proc.clone(),
11060 selection: query,
11061 graphql_client: self.graphql_client.clone(),
11062 }
11063 }
11064 pub async fn tools(&self) -> Result<String, DaggerError> {
11066 let query = self.selection.select("tools");
11067 query.execute(self.graphql_client.clone()).await
11068 }
11069 pub fn with_blocked_function(
11078 &self,
11079 type_name: impl Into<String>,
11080 function: impl Into<String>,
11081 ) -> Llm {
11082 let mut query = self.selection.select("withBlockedFunction");
11083 query = query.arg("typeName", type_name.into());
11084 query = query.arg("function", function.into());
11085 Llm {
11086 proc: self.proc.clone(),
11087 selection: query,
11088 graphql_client: self.graphql_client.clone(),
11089 }
11090 }
11091 pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11093 let mut query = self.selection.select("withEnv");
11094 query = query.arg_lazy(
11095 "env",
11096 Box::new(move || {
11097 let env = env.clone();
11098 Box::pin(async move { env.into_id().await.unwrap().quote() })
11099 }),
11100 );
11101 Llm {
11102 proc: self.proc.clone(),
11103 selection: query,
11104 graphql_client: self.graphql_client.clone(),
11105 }
11106 }
11107 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11114 let mut query = self.selection.select("withMCPServer");
11115 query = query.arg("name", name.into());
11116 query = query.arg_lazy(
11117 "service",
11118 Box::new(move || {
11119 let service = service.clone();
11120 Box::pin(async move { service.into_id().await.unwrap().quote() })
11121 }),
11122 );
11123 Llm {
11124 proc: self.proc.clone(),
11125 selection: query,
11126 graphql_client: self.graphql_client.clone(),
11127 }
11128 }
11129 pub fn with_model(&self, model: impl Into<String>) -> Llm {
11135 let mut query = self.selection.select("withModel");
11136 query = query.arg("model", model.into());
11137 Llm {
11138 proc: self.proc.clone(),
11139 selection: query,
11140 graphql_client: self.graphql_client.clone(),
11141 }
11142 }
11143 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11149 let mut query = self.selection.select("withPrompt");
11150 query = query.arg("prompt", prompt.into());
11151 Llm {
11152 proc: self.proc.clone(),
11153 selection: query,
11154 graphql_client: self.graphql_client.clone(),
11155 }
11156 }
11157 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11163 let mut query = self.selection.select("withPromptFile");
11164 query = query.arg_lazy(
11165 "file",
11166 Box::new(move || {
11167 let file = file.clone();
11168 Box::pin(async move { file.into_id().await.unwrap().quote() })
11169 }),
11170 );
11171 Llm {
11172 proc: self.proc.clone(),
11173 selection: query,
11174 graphql_client: self.graphql_client.clone(),
11175 }
11176 }
11177 pub fn with_static_tools(&self) -> Llm {
11179 let query = self.selection.select("withStaticTools");
11180 Llm {
11181 proc: self.proc.clone(),
11182 selection: query,
11183 graphql_client: self.graphql_client.clone(),
11184 }
11185 }
11186 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11192 let mut query = self.selection.select("withSystemPrompt");
11193 query = query.arg("prompt", prompt.into());
11194 Llm {
11195 proc: self.proc.clone(),
11196 selection: query,
11197 graphql_client: self.graphql_client.clone(),
11198 }
11199 }
11200 pub fn without_default_system_prompt(&self) -> Llm {
11202 let query = self.selection.select("withoutDefaultSystemPrompt");
11203 Llm {
11204 proc: self.proc.clone(),
11205 selection: query,
11206 graphql_client: self.graphql_client.clone(),
11207 }
11208 }
11209 pub fn without_message_history(&self) -> Llm {
11211 let query = self.selection.select("withoutMessageHistory");
11212 Llm {
11213 proc: self.proc.clone(),
11214 selection: query,
11215 graphql_client: self.graphql_client.clone(),
11216 }
11217 }
11218 pub fn without_system_prompts(&self) -> Llm {
11220 let query = self.selection.select("withoutSystemPrompts");
11221 Llm {
11222 proc: self.proc.clone(),
11223 selection: query,
11224 graphql_client: self.graphql_client.clone(),
11225 }
11226 }
11227}
11228impl Node for Llm {
11229 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11230 let query = self.selection.select("id");
11231 let graphql_client = self.graphql_client.clone();
11232 async move { query.execute(graphql_client).await }
11233 }
11234}
11235impl Syncer for Llm {
11236 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11237 let query = self.selection.select("id");
11238 let graphql_client = self.graphql_client.clone();
11239 async move { query.execute(graphql_client).await }
11240 }
11241 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11242 let query = self.selection.select("sync");
11243 let graphql_client = self.graphql_client.clone();
11244 async move { query.execute(graphql_client).await }
11245 }
11246}
11247#[derive(Clone)]
11248pub struct LlmTokenUsage {
11249 pub proc: Option<Arc<DaggerSessionProc>>,
11250 pub selection: Selection,
11251 pub graphql_client: DynGraphQLClient,
11252}
11253impl IntoID<Id> for LlmTokenUsage {
11254 fn into_id(
11255 self,
11256 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11257 Box::pin(async move { self.id().await })
11258 }
11259}
11260impl Loadable for LlmTokenUsage {
11261 fn graphql_type() -> &'static str {
11262 "LLMTokenUsage"
11263 }
11264 fn from_query(
11265 proc: Option<Arc<DaggerSessionProc>>,
11266 selection: Selection,
11267 graphql_client: DynGraphQLClient,
11268 ) -> Self {
11269 Self {
11270 proc,
11271 selection,
11272 graphql_client,
11273 }
11274 }
11275}
11276impl LlmTokenUsage {
11277 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11278 let query = self.selection.select("cachedTokenReads");
11279 query.execute(self.graphql_client.clone()).await
11280 }
11281 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11282 let query = self.selection.select("cachedTokenWrites");
11283 query.execute(self.graphql_client.clone()).await
11284 }
11285 pub async fn id(&self) -> Result<Id, DaggerError> {
11287 let query = self.selection.select("id");
11288 query.execute(self.graphql_client.clone()).await
11289 }
11290 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11291 let query = self.selection.select("inputTokens");
11292 query.execute(self.graphql_client.clone()).await
11293 }
11294 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11295 let query = self.selection.select("outputTokens");
11296 query.execute(self.graphql_client.clone()).await
11297 }
11298 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11299 let query = self.selection.select("totalTokens");
11300 query.execute(self.graphql_client.clone()).await
11301 }
11302}
11303impl Node for LlmTokenUsage {
11304 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11305 let query = self.selection.select("id");
11306 let graphql_client = self.graphql_client.clone();
11307 async move { query.execute(graphql_client).await }
11308 }
11309}
11310#[derive(Clone)]
11311pub struct Label {
11312 pub proc: Option<Arc<DaggerSessionProc>>,
11313 pub selection: Selection,
11314 pub graphql_client: DynGraphQLClient,
11315}
11316impl IntoID<Id> for Label {
11317 fn into_id(
11318 self,
11319 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11320 Box::pin(async move { self.id().await })
11321 }
11322}
11323impl Loadable for Label {
11324 fn graphql_type() -> &'static str {
11325 "Label"
11326 }
11327 fn from_query(
11328 proc: Option<Arc<DaggerSessionProc>>,
11329 selection: Selection,
11330 graphql_client: DynGraphQLClient,
11331 ) -> Self {
11332 Self {
11333 proc,
11334 selection,
11335 graphql_client,
11336 }
11337 }
11338}
11339impl Label {
11340 pub async fn id(&self) -> Result<Id, DaggerError> {
11342 let query = self.selection.select("id");
11343 query.execute(self.graphql_client.clone()).await
11344 }
11345 pub async fn name(&self) -> Result<String, DaggerError> {
11347 let query = self.selection.select("name");
11348 query.execute(self.graphql_client.clone()).await
11349 }
11350 pub async fn value(&self) -> Result<String, DaggerError> {
11352 let query = self.selection.select("value");
11353 query.execute(self.graphql_client.clone()).await
11354 }
11355}
11356impl Node for Label {
11357 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11358 let query = self.selection.select("id");
11359 let graphql_client = self.graphql_client.clone();
11360 async move { query.execute(graphql_client).await }
11361 }
11362}
11363#[derive(Clone)]
11364pub struct ListTypeDef {
11365 pub proc: Option<Arc<DaggerSessionProc>>,
11366 pub selection: Selection,
11367 pub graphql_client: DynGraphQLClient,
11368}
11369impl IntoID<Id> for ListTypeDef {
11370 fn into_id(
11371 self,
11372 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11373 Box::pin(async move { self.id().await })
11374 }
11375}
11376impl Loadable for ListTypeDef {
11377 fn graphql_type() -> &'static str {
11378 "ListTypeDef"
11379 }
11380 fn from_query(
11381 proc: Option<Arc<DaggerSessionProc>>,
11382 selection: Selection,
11383 graphql_client: DynGraphQLClient,
11384 ) -> Self {
11385 Self {
11386 proc,
11387 selection,
11388 graphql_client,
11389 }
11390 }
11391}
11392impl ListTypeDef {
11393 pub fn element_type_def(&self) -> TypeDef {
11395 let query = self.selection.select("elementTypeDef");
11396 TypeDef {
11397 proc: self.proc.clone(),
11398 selection: query,
11399 graphql_client: self.graphql_client.clone(),
11400 }
11401 }
11402 pub async fn id(&self) -> Result<Id, DaggerError> {
11404 let query = self.selection.select("id");
11405 query.execute(self.graphql_client.clone()).await
11406 }
11407}
11408impl Node for ListTypeDef {
11409 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11410 let query = self.selection.select("id");
11411 let graphql_client = self.graphql_client.clone();
11412 async move { query.execute(graphql_client).await }
11413 }
11414}
11415#[derive(Clone)]
11416pub struct Module {
11417 pub proc: Option<Arc<DaggerSessionProc>>,
11418 pub selection: Selection,
11419 pub graphql_client: DynGraphQLClient,
11420}
11421#[derive(Builder, Debug, PartialEq)]
11422pub struct ModuleChecksOpts<'a> {
11423 #[builder(setter(into, strip_option), default)]
11425 pub include: Option<Vec<&'a str>>,
11426 #[builder(setter(into, strip_option), default)]
11428 pub no_generate: Option<bool>,
11429}
11430#[derive(Builder, Debug, PartialEq)]
11431pub struct ModuleGeneratorsOpts<'a> {
11432 #[builder(setter(into, strip_option), default)]
11434 pub include: Option<Vec<&'a str>>,
11435}
11436#[derive(Builder, Debug, PartialEq)]
11437pub struct ModuleServeOpts {
11438 #[builder(setter(into, strip_option), default)]
11440 pub entrypoint: Option<bool>,
11441 #[builder(setter(into, strip_option), default)]
11443 pub include_dependencies: Option<bool>,
11444}
11445#[derive(Builder, Debug, PartialEq)]
11446pub struct ModuleServicesOpts<'a> {
11447 #[builder(setter(into, strip_option), default)]
11449 pub include: Option<Vec<&'a str>>,
11450}
11451impl IntoID<Id> for Module {
11452 fn into_id(
11453 self,
11454 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11455 Box::pin(async move { self.id().await })
11456 }
11457}
11458impl Loadable for Module {
11459 fn graphql_type() -> &'static str {
11460 "Module"
11461 }
11462 fn from_query(
11463 proc: Option<Arc<DaggerSessionProc>>,
11464 selection: Selection,
11465 graphql_client: DynGraphQLClient,
11466 ) -> Self {
11467 Self {
11468 proc,
11469 selection,
11470 graphql_client,
11471 }
11472 }
11473}
11474impl Module {
11475 pub fn check(&self, name: impl Into<String>) -> Check {
11481 let mut query = self.selection.select("check");
11482 query = query.arg("name", name.into());
11483 Check {
11484 proc: self.proc.clone(),
11485 selection: query,
11486 graphql_client: self.graphql_client.clone(),
11487 }
11488 }
11489 pub fn checks(&self) -> CheckGroup {
11495 let query = self.selection.select("checks");
11496 CheckGroup {
11497 proc: self.proc.clone(),
11498 selection: query,
11499 graphql_client: self.graphql_client.clone(),
11500 }
11501 }
11502 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11508 let mut query = self.selection.select("checks");
11509 if let Some(include) = opts.include {
11510 query = query.arg("include", include);
11511 }
11512 if let Some(no_generate) = opts.no_generate {
11513 query = query.arg("noGenerate", no_generate);
11514 }
11515 CheckGroup {
11516 proc: self.proc.clone(),
11517 selection: query,
11518 graphql_client: self.graphql_client.clone(),
11519 }
11520 }
11521 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11523 let query = self.selection.select("dependencies");
11524 let query = query.select("id");
11525 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11526 Ok(ids
11527 .into_iter()
11528 .map(|id| Module {
11529 proc: self.proc.clone(),
11530 selection: crate::querybuilder::query()
11531 .select("node")
11532 .arg("id", &id.0)
11533 .inline_fragment("Module"),
11534 graphql_client: self.graphql_client.clone(),
11535 })
11536 .collect())
11537 }
11538 pub async fn description(&self) -> Result<String, DaggerError> {
11540 let query = self.selection.select("description");
11541 query.execute(self.graphql_client.clone()).await
11542 }
11543 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11545 let query = self.selection.select("enums");
11546 let query = query.select("id");
11547 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11548 Ok(ids
11549 .into_iter()
11550 .map(|id| TypeDef {
11551 proc: self.proc.clone(),
11552 selection: crate::querybuilder::query()
11553 .select("node")
11554 .arg("id", &id.0)
11555 .inline_fragment("TypeDef"),
11556 graphql_client: self.graphql_client.clone(),
11557 })
11558 .collect())
11559 }
11560 pub fn generated_context_directory(&self) -> Directory {
11562 let query = self.selection.select("generatedContextDirectory");
11563 Directory {
11564 proc: self.proc.clone(),
11565 selection: query,
11566 graphql_client: self.graphql_client.clone(),
11567 }
11568 }
11569 pub fn generator(&self, name: impl Into<String>) -> Generator {
11575 let mut query = self.selection.select("generator");
11576 query = query.arg("name", name.into());
11577 Generator {
11578 proc: self.proc.clone(),
11579 selection: query,
11580 graphql_client: self.graphql_client.clone(),
11581 }
11582 }
11583 pub fn generators(&self) -> GeneratorGroup {
11589 let query = self.selection.select("generators");
11590 GeneratorGroup {
11591 proc: self.proc.clone(),
11592 selection: query,
11593 graphql_client: self.graphql_client.clone(),
11594 }
11595 }
11596 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11602 let mut query = self.selection.select("generators");
11603 if let Some(include) = opts.include {
11604 query = query.arg("include", include);
11605 }
11606 GeneratorGroup {
11607 proc: self.proc.clone(),
11608 selection: query,
11609 graphql_client: self.graphql_client.clone(),
11610 }
11611 }
11612 pub async fn id(&self) -> Result<Id, DaggerError> {
11614 let query = self.selection.select("id");
11615 query.execute(self.graphql_client.clone()).await
11616 }
11617 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11619 let query = self.selection.select("interfaces");
11620 let query = query.select("id");
11621 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11622 Ok(ids
11623 .into_iter()
11624 .map(|id| TypeDef {
11625 proc: self.proc.clone(),
11626 selection: crate::querybuilder::query()
11627 .select("node")
11628 .arg("id", &id.0)
11629 .inline_fragment("TypeDef"),
11630 graphql_client: self.graphql_client.clone(),
11631 })
11632 .collect())
11633 }
11634 pub fn introspection_schema_json(&self) -> File {
11638 let query = self.selection.select("introspectionSchemaJSON");
11639 File {
11640 proc: self.proc.clone(),
11641 selection: query,
11642 graphql_client: self.graphql_client.clone(),
11643 }
11644 }
11645 pub async fn name(&self) -> Result<String, DaggerError> {
11647 let query = self.selection.select("name");
11648 query.execute(self.graphql_client.clone()).await
11649 }
11650 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11652 let query = self.selection.select("objects");
11653 let query = query.select("id");
11654 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11655 Ok(ids
11656 .into_iter()
11657 .map(|id| TypeDef {
11658 proc: self.proc.clone(),
11659 selection: crate::querybuilder::query()
11660 .select("node")
11661 .arg("id", &id.0)
11662 .inline_fragment("TypeDef"),
11663 graphql_client: self.graphql_client.clone(),
11664 })
11665 .collect())
11666 }
11667 pub fn runtime(&self) -> Container {
11669 let query = self.selection.select("runtime");
11670 Container {
11671 proc: self.proc.clone(),
11672 selection: query,
11673 graphql_client: self.graphql_client.clone(),
11674 }
11675 }
11676 pub fn sdk(&self) -> SdkConfig {
11678 let query = self.selection.select("sdk");
11679 SdkConfig {
11680 proc: self.proc.clone(),
11681 selection: query,
11682 graphql_client: self.graphql_client.clone(),
11683 }
11684 }
11685 pub async fn serve(&self) -> Result<Void, DaggerError> {
11692 let query = self.selection.select("serve");
11693 query.execute(self.graphql_client.clone()).await
11694 }
11695 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11702 let mut query = self.selection.select("serve");
11703 if let Some(include_dependencies) = opts.include_dependencies {
11704 query = query.arg("includeDependencies", include_dependencies);
11705 }
11706 if let Some(entrypoint) = opts.entrypoint {
11707 query = query.arg("entrypoint", entrypoint);
11708 }
11709 query.execute(self.graphql_client.clone()).await
11710 }
11711 pub fn services(&self) -> UpGroup {
11717 let query = self.selection.select("services");
11718 UpGroup {
11719 proc: self.proc.clone(),
11720 selection: query,
11721 graphql_client: self.graphql_client.clone(),
11722 }
11723 }
11724 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11730 let mut query = self.selection.select("services");
11731 if let Some(include) = opts.include {
11732 query = query.arg("include", include);
11733 }
11734 UpGroup {
11735 proc: self.proc.clone(),
11736 selection: query,
11737 graphql_client: self.graphql_client.clone(),
11738 }
11739 }
11740 pub fn source(&self) -> ModuleSource {
11742 let query = self.selection.select("source");
11743 ModuleSource {
11744 proc: self.proc.clone(),
11745 selection: query,
11746 graphql_client: self.graphql_client.clone(),
11747 }
11748 }
11749 pub async fn sync(&self) -> Result<Module, DaggerError> {
11751 let query = self.selection.select("sync");
11752 let id: Id = query.execute(self.graphql_client.clone()).await?;
11753 Ok(Module {
11754 proc: self.proc.clone(),
11755 selection: query
11756 .root()
11757 .select("node")
11758 .arg("id", &id.0)
11759 .inline_fragment("Module"),
11760 graphql_client: self.graphql_client.clone(),
11761 })
11762 }
11763 pub fn user_defaults(&self) -> EnvFile {
11765 let query = self.selection.select("userDefaults");
11766 EnvFile {
11767 proc: self.proc.clone(),
11768 selection: query,
11769 graphql_client: self.graphql_client.clone(),
11770 }
11771 }
11772 pub fn with_description(&self, description: impl Into<String>) -> Module {
11778 let mut query = self.selection.select("withDescription");
11779 query = query.arg("description", description.into());
11780 Module {
11781 proc: self.proc.clone(),
11782 selection: query,
11783 graphql_client: self.graphql_client.clone(),
11784 }
11785 }
11786 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11788 let mut query = self.selection.select("withEnum");
11789 query = query.arg_lazy(
11790 "enum",
11791 Box::new(move || {
11792 let r#enum = r#enum.clone();
11793 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11794 }),
11795 );
11796 Module {
11797 proc: self.proc.clone(),
11798 selection: query,
11799 graphql_client: self.graphql_client.clone(),
11800 }
11801 }
11802 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11804 let mut query = self.selection.select("withInterface");
11805 query = query.arg_lazy(
11806 "iface",
11807 Box::new(move || {
11808 let iface = iface.clone();
11809 Box::pin(async move { iface.into_id().await.unwrap().quote() })
11810 }),
11811 );
11812 Module {
11813 proc: self.proc.clone(),
11814 selection: query,
11815 graphql_client: self.graphql_client.clone(),
11816 }
11817 }
11818 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11820 let mut query = self.selection.select("withObject");
11821 query = query.arg_lazy(
11822 "object",
11823 Box::new(move || {
11824 let object = object.clone();
11825 Box::pin(async move { object.into_id().await.unwrap().quote() })
11826 }),
11827 );
11828 Module {
11829 proc: self.proc.clone(),
11830 selection: query,
11831 graphql_client: self.graphql_client.clone(),
11832 }
11833 }
11834}
11835impl Node for Module {
11836 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11837 let query = self.selection.select("id");
11838 let graphql_client = self.graphql_client.clone();
11839 async move { query.execute(graphql_client).await }
11840 }
11841}
11842impl Syncer for Module {
11843 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11844 let query = self.selection.select("id");
11845 let graphql_client = self.graphql_client.clone();
11846 async move { query.execute(graphql_client).await }
11847 }
11848 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11849 let query = self.selection.select("sync");
11850 let graphql_client = self.graphql_client.clone();
11851 async move { query.execute(graphql_client).await }
11852 }
11853}
11854#[derive(Clone)]
11855pub struct ModuleConfigClient {
11856 pub proc: Option<Arc<DaggerSessionProc>>,
11857 pub selection: Selection,
11858 pub graphql_client: DynGraphQLClient,
11859}
11860impl IntoID<Id> for ModuleConfigClient {
11861 fn into_id(
11862 self,
11863 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11864 Box::pin(async move { self.id().await })
11865 }
11866}
11867impl Loadable for ModuleConfigClient {
11868 fn graphql_type() -> &'static str {
11869 "ModuleConfigClient"
11870 }
11871 fn from_query(
11872 proc: Option<Arc<DaggerSessionProc>>,
11873 selection: Selection,
11874 graphql_client: DynGraphQLClient,
11875 ) -> Self {
11876 Self {
11877 proc,
11878 selection,
11879 graphql_client,
11880 }
11881 }
11882}
11883impl ModuleConfigClient {
11884 pub async fn directory(&self) -> Result<String, DaggerError> {
11886 let query = self.selection.select("directory");
11887 query.execute(self.graphql_client.clone()).await
11888 }
11889 pub async fn generator(&self) -> Result<String, DaggerError> {
11891 let query = self.selection.select("generator");
11892 query.execute(self.graphql_client.clone()).await
11893 }
11894 pub async fn id(&self) -> Result<Id, DaggerError> {
11896 let query = self.selection.select("id");
11897 query.execute(self.graphql_client.clone()).await
11898 }
11899}
11900impl Node for ModuleConfigClient {
11901 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11902 let query = self.selection.select("id");
11903 let graphql_client = self.graphql_client.clone();
11904 async move { query.execute(graphql_client).await }
11905 }
11906}
11907#[derive(Clone)]
11908pub struct ModuleSource {
11909 pub proc: Option<Arc<DaggerSessionProc>>,
11910 pub selection: Selection,
11911 pub graphql_client: DynGraphQLClient,
11912}
11913impl IntoID<Id> for ModuleSource {
11914 fn into_id(
11915 self,
11916 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11917 Box::pin(async move { self.id().await })
11918 }
11919}
11920impl Loadable for ModuleSource {
11921 fn graphql_type() -> &'static str {
11922 "ModuleSource"
11923 }
11924 fn from_query(
11925 proc: Option<Arc<DaggerSessionProc>>,
11926 selection: Selection,
11927 graphql_client: DynGraphQLClient,
11928 ) -> Self {
11929 Self {
11930 proc,
11931 selection,
11932 graphql_client,
11933 }
11934 }
11935}
11936impl ModuleSource {
11937 pub fn as_module(&self) -> Module {
11939 let query = self.selection.select("asModule");
11940 Module {
11941 proc: self.proc.clone(),
11942 selection: query,
11943 graphql_client: self.graphql_client.clone(),
11944 }
11945 }
11946 pub async fn as_string(&self) -> Result<String, DaggerError> {
11948 let query = self.selection.select("asString");
11949 query.execute(self.graphql_client.clone()).await
11950 }
11951 pub fn blueprint(&self) -> ModuleSource {
11953 let query = self.selection.select("blueprint");
11954 ModuleSource {
11955 proc: self.proc.clone(),
11956 selection: query,
11957 graphql_client: self.graphql_client.clone(),
11958 }
11959 }
11960 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11962 let query = self.selection.select("cloneRef");
11963 query.execute(self.graphql_client.clone()).await
11964 }
11965 pub async fn commit(&self) -> Result<String, DaggerError> {
11967 let query = self.selection.select("commit");
11968 query.execute(self.graphql_client.clone()).await
11969 }
11970 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11972 let query = self.selection.select("configClients");
11973 let query = query.select("id");
11974 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11975 Ok(ids
11976 .into_iter()
11977 .map(|id| ModuleConfigClient {
11978 proc: self.proc.clone(),
11979 selection: crate::querybuilder::query()
11980 .select("node")
11981 .arg("id", &id.0)
11982 .inline_fragment("ModuleConfigClient"),
11983 graphql_client: self.graphql_client.clone(),
11984 })
11985 .collect())
11986 }
11987 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11989 let query = self.selection.select("configExists");
11990 query.execute(self.graphql_client.clone()).await
11991 }
11992 pub fn context_directory(&self) -> Directory {
11994 let query = self.selection.select("contextDirectory");
11995 Directory {
11996 proc: self.proc.clone(),
11997 selection: query,
11998 graphql_client: self.graphql_client.clone(),
11999 }
12000 }
12001 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12003 let query = self.selection.select("dependencies");
12004 let query = query.select("id");
12005 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12006 Ok(ids
12007 .into_iter()
12008 .map(|id| ModuleSource {
12009 proc: self.proc.clone(),
12010 selection: crate::querybuilder::query()
12011 .select("node")
12012 .arg("id", &id.0)
12013 .inline_fragment("ModuleSource"),
12014 graphql_client: self.graphql_client.clone(),
12015 })
12016 .collect())
12017 }
12018 pub async fn digest(&self) -> Result<String, DaggerError> {
12020 let query = self.selection.select("digest");
12021 query.execute(self.graphql_client.clone()).await
12022 }
12023 pub fn directory(&self, path: impl Into<String>) -> Directory {
12029 let mut query = self.selection.select("directory");
12030 query = query.arg("path", path.into());
12031 Directory {
12032 proc: self.proc.clone(),
12033 selection: query,
12034 graphql_client: self.graphql_client.clone(),
12035 }
12036 }
12037 pub async fn engine_version(&self) -> Result<String, DaggerError> {
12039 let query = self.selection.select("engineVersion");
12040 query.execute(self.graphql_client.clone()).await
12041 }
12042 pub fn generated_context_changeset(&self) -> Changeset {
12044 let query = self.selection.select("generatedContextChangeset");
12045 Changeset {
12046 proc: self.proc.clone(),
12047 selection: query,
12048 graphql_client: self.graphql_client.clone(),
12049 }
12050 }
12051 pub fn generated_context_directory(&self) -> Directory {
12053 let query = self.selection.select("generatedContextDirectory");
12054 Directory {
12055 proc: self.proc.clone(),
12056 selection: query,
12057 graphql_client: self.graphql_client.clone(),
12058 }
12059 }
12060 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12062 let query = self.selection.select("htmlRepoURL");
12063 query.execute(self.graphql_client.clone()).await
12064 }
12065 pub async fn html_url(&self) -> Result<String, DaggerError> {
12067 let query = self.selection.select("htmlURL");
12068 query.execute(self.graphql_client.clone()).await
12069 }
12070 pub async fn id(&self) -> Result<Id, DaggerError> {
12072 let query = self.selection.select("id");
12073 query.execute(self.graphql_client.clone()).await
12074 }
12075 pub fn introspection_schema_json(&self) -> File {
12079 let query = self.selection.select("introspectionSchemaJSON");
12080 File {
12081 proc: self.proc.clone(),
12082 selection: query,
12083 graphql_client: self.graphql_client.clone(),
12084 }
12085 }
12086 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12088 let query = self.selection.select("kind");
12089 query.execute(self.graphql_client.clone()).await
12090 }
12091 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12093 let query = self.selection.select("localContextDirectoryPath");
12094 query.execute(self.graphql_client.clone()).await
12095 }
12096 pub async fn module_name(&self) -> Result<String, DaggerError> {
12098 let query = self.selection.select("moduleName");
12099 query.execute(self.graphql_client.clone()).await
12100 }
12101 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12103 let query = self.selection.select("moduleOriginalName");
12104 query.execute(self.graphql_client.clone()).await
12105 }
12106 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12108 let query = self.selection.select("originalSubpath");
12109 query.execute(self.graphql_client.clone()).await
12110 }
12111 pub async fn pin(&self) -> Result<String, DaggerError> {
12113 let query = self.selection.select("pin");
12114 query.execute(self.graphql_client.clone()).await
12115 }
12116 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12118 let query = self.selection.select("repoRootPath");
12119 query.execute(self.graphql_client.clone()).await
12120 }
12121 pub fn sdk(&self) -> SdkConfig {
12123 let query = self.selection.select("sdk");
12124 SdkConfig {
12125 proc: self.proc.clone(),
12126 selection: query,
12127 graphql_client: self.graphql_client.clone(),
12128 }
12129 }
12130 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12132 let query = self.selection.select("sourceRootSubpath");
12133 query.execute(self.graphql_client.clone()).await
12134 }
12135 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12137 let query = self.selection.select("sourceSubpath");
12138 query.execute(self.graphql_client.clone()).await
12139 }
12140 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12142 let query = self.selection.select("sync");
12143 let id: Id = query.execute(self.graphql_client.clone()).await?;
12144 Ok(ModuleSource {
12145 proc: self.proc.clone(),
12146 selection: query
12147 .root()
12148 .select("node")
12149 .arg("id", &id.0)
12150 .inline_fragment("ModuleSource"),
12151 graphql_client: self.graphql_client.clone(),
12152 })
12153 }
12154 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12156 let query = self.selection.select("toolchains");
12157 let query = query.select("id");
12158 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12159 Ok(ids
12160 .into_iter()
12161 .map(|id| ModuleSource {
12162 proc: self.proc.clone(),
12163 selection: crate::querybuilder::query()
12164 .select("node")
12165 .arg("id", &id.0)
12166 .inline_fragment("ModuleSource"),
12167 graphql_client: self.graphql_client.clone(),
12168 })
12169 .collect())
12170 }
12171 pub fn user_defaults(&self) -> EnvFile {
12173 let query = self.selection.select("userDefaults");
12174 EnvFile {
12175 proc: self.proc.clone(),
12176 selection: query,
12177 graphql_client: self.graphql_client.clone(),
12178 }
12179 }
12180 pub async fn version(&self) -> Result<String, DaggerError> {
12182 let query = self.selection.select("version");
12183 query.execute(self.graphql_client.clone()).await
12184 }
12185 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12191 let mut query = self.selection.select("withBlueprint");
12192 query = query.arg_lazy(
12193 "blueprint",
12194 Box::new(move || {
12195 let blueprint = blueprint.clone();
12196 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12197 }),
12198 );
12199 ModuleSource {
12200 proc: self.proc.clone(),
12201 selection: query,
12202 graphql_client: self.graphql_client.clone(),
12203 }
12204 }
12205 pub fn with_client(
12212 &self,
12213 generator: impl Into<String>,
12214 output_dir: impl Into<String>,
12215 ) -> ModuleSource {
12216 let mut query = self.selection.select("withClient");
12217 query = query.arg("generator", generator.into());
12218 query = query.arg("outputDir", output_dir.into());
12219 ModuleSource {
12220 proc: self.proc.clone(),
12221 selection: query,
12222 graphql_client: self.graphql_client.clone(),
12223 }
12224 }
12225 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12231 let mut query = self.selection.select("withDependencies");
12232 query = query.arg("dependencies", dependencies);
12233 ModuleSource {
12234 proc: self.proc.clone(),
12235 selection: query,
12236 graphql_client: self.graphql_client.clone(),
12237 }
12238 }
12239 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12245 let mut query = self.selection.select("withEngineVersion");
12246 query = query.arg("version", version.into());
12247 ModuleSource {
12248 proc: self.proc.clone(),
12249 selection: query,
12250 graphql_client: self.graphql_client.clone(),
12251 }
12252 }
12253 pub fn with_experimental_features(
12259 &self,
12260 features: Vec<ModuleSourceExperimentalFeature>,
12261 ) -> ModuleSource {
12262 let mut query = self.selection.select("withExperimentalFeatures");
12263 query = query.arg("features", features);
12264 ModuleSource {
12265 proc: self.proc.clone(),
12266 selection: query,
12267 graphql_client: self.graphql_client.clone(),
12268 }
12269 }
12270 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12276 let mut query = self.selection.select("withIncludes");
12277 query = query.arg(
12278 "patterns",
12279 patterns
12280 .into_iter()
12281 .map(|i| i.into())
12282 .collect::<Vec<String>>(),
12283 );
12284 ModuleSource {
12285 proc: self.proc.clone(),
12286 selection: query,
12287 graphql_client: self.graphql_client.clone(),
12288 }
12289 }
12290 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12296 let mut query = self.selection.select("withName");
12297 query = query.arg("name", name.into());
12298 ModuleSource {
12299 proc: self.proc.clone(),
12300 selection: query,
12301 graphql_client: self.graphql_client.clone(),
12302 }
12303 }
12304 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12310 let mut query = self.selection.select("withSDK");
12311 query = query.arg("source", source.into());
12312 ModuleSource {
12313 proc: self.proc.clone(),
12314 selection: query,
12315 graphql_client: self.graphql_client.clone(),
12316 }
12317 }
12318 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12324 let mut query = self.selection.select("withSourceSubpath");
12325 query = query.arg("path", path.into());
12326 ModuleSource {
12327 proc: self.proc.clone(),
12328 selection: query,
12329 graphql_client: self.graphql_client.clone(),
12330 }
12331 }
12332 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12338 let mut query = self.selection.select("withToolchains");
12339 query = query.arg("toolchains", toolchains);
12340 ModuleSource {
12341 proc: self.proc.clone(),
12342 selection: query,
12343 graphql_client: self.graphql_client.clone(),
12344 }
12345 }
12346 pub fn with_update_blueprint(&self) -> ModuleSource {
12348 let query = self.selection.select("withUpdateBlueprint");
12349 ModuleSource {
12350 proc: self.proc.clone(),
12351 selection: query,
12352 graphql_client: self.graphql_client.clone(),
12353 }
12354 }
12355 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12361 let mut query = self.selection.select("withUpdateDependencies");
12362 query = query.arg(
12363 "dependencies",
12364 dependencies
12365 .into_iter()
12366 .map(|i| i.into())
12367 .collect::<Vec<String>>(),
12368 );
12369 ModuleSource {
12370 proc: self.proc.clone(),
12371 selection: query,
12372 graphql_client: self.graphql_client.clone(),
12373 }
12374 }
12375 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12381 let mut query = self.selection.select("withUpdateToolchains");
12382 query = query.arg(
12383 "toolchains",
12384 toolchains
12385 .into_iter()
12386 .map(|i| i.into())
12387 .collect::<Vec<String>>(),
12388 );
12389 ModuleSource {
12390 proc: self.proc.clone(),
12391 selection: query,
12392 graphql_client: self.graphql_client.clone(),
12393 }
12394 }
12395 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12401 let mut query = self.selection.select("withUpdatedClients");
12402 query = query.arg(
12403 "clients",
12404 clients
12405 .into_iter()
12406 .map(|i| i.into())
12407 .collect::<Vec<String>>(),
12408 );
12409 ModuleSource {
12410 proc: self.proc.clone(),
12411 selection: query,
12412 graphql_client: self.graphql_client.clone(),
12413 }
12414 }
12415 pub fn without_blueprint(&self) -> ModuleSource {
12417 let query = self.selection.select("withoutBlueprint");
12418 ModuleSource {
12419 proc: self.proc.clone(),
12420 selection: query,
12421 graphql_client: self.graphql_client.clone(),
12422 }
12423 }
12424 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12430 let mut query = self.selection.select("withoutClient");
12431 query = query.arg("path", path.into());
12432 ModuleSource {
12433 proc: self.proc.clone(),
12434 selection: query,
12435 graphql_client: self.graphql_client.clone(),
12436 }
12437 }
12438 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12444 let mut query = self.selection.select("withoutDependencies");
12445 query = query.arg(
12446 "dependencies",
12447 dependencies
12448 .into_iter()
12449 .map(|i| i.into())
12450 .collect::<Vec<String>>(),
12451 );
12452 ModuleSource {
12453 proc: self.proc.clone(),
12454 selection: query,
12455 graphql_client: self.graphql_client.clone(),
12456 }
12457 }
12458 pub fn without_experimental_features(
12464 &self,
12465 features: Vec<ModuleSourceExperimentalFeature>,
12466 ) -> ModuleSource {
12467 let mut query = self.selection.select("withoutExperimentalFeatures");
12468 query = query.arg("features", features);
12469 ModuleSource {
12470 proc: self.proc.clone(),
12471 selection: query,
12472 graphql_client: self.graphql_client.clone(),
12473 }
12474 }
12475 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12481 let mut query = self.selection.select("withoutToolchains");
12482 query = query.arg(
12483 "toolchains",
12484 toolchains
12485 .into_iter()
12486 .map(|i| i.into())
12487 .collect::<Vec<String>>(),
12488 );
12489 ModuleSource {
12490 proc: self.proc.clone(),
12491 selection: query,
12492 graphql_client: self.graphql_client.clone(),
12493 }
12494 }
12495}
12496impl Node for ModuleSource {
12497 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12498 let query = self.selection.select("id");
12499 let graphql_client = self.graphql_client.clone();
12500 async move { query.execute(graphql_client).await }
12501 }
12502}
12503impl Syncer for ModuleSource {
12504 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12505 let query = self.selection.select("id");
12506 let graphql_client = self.graphql_client.clone();
12507 async move { query.execute(graphql_client).await }
12508 }
12509 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12510 let query = self.selection.select("sync");
12511 let graphql_client = self.graphql_client.clone();
12512 async move { query.execute(graphql_client).await }
12513 }
12514}
12515#[derive(Clone)]
12516pub struct ObjectTypeDef {
12517 pub proc: Option<Arc<DaggerSessionProc>>,
12518 pub selection: Selection,
12519 pub graphql_client: DynGraphQLClient,
12520}
12521impl IntoID<Id> for ObjectTypeDef {
12522 fn into_id(
12523 self,
12524 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12525 Box::pin(async move { self.id().await })
12526 }
12527}
12528impl Loadable for ObjectTypeDef {
12529 fn graphql_type() -> &'static str {
12530 "ObjectTypeDef"
12531 }
12532 fn from_query(
12533 proc: Option<Arc<DaggerSessionProc>>,
12534 selection: Selection,
12535 graphql_client: DynGraphQLClient,
12536 ) -> Self {
12537 Self {
12538 proc,
12539 selection,
12540 graphql_client,
12541 }
12542 }
12543}
12544impl ObjectTypeDef {
12545 pub fn constructor(&self) -> Function {
12547 let query = self.selection.select("constructor");
12548 Function {
12549 proc: self.proc.clone(),
12550 selection: query,
12551 graphql_client: self.graphql_client.clone(),
12552 }
12553 }
12554 pub async fn deprecated(&self) -> Result<String, DaggerError> {
12556 let query = self.selection.select("deprecated");
12557 query.execute(self.graphql_client.clone()).await
12558 }
12559 pub async fn description(&self) -> Result<String, DaggerError> {
12561 let query = self.selection.select("description");
12562 query.execute(self.graphql_client.clone()).await
12563 }
12564 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12566 let query = self.selection.select("fields");
12567 let query = query.select("id");
12568 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12569 Ok(ids
12570 .into_iter()
12571 .map(|id| FieldTypeDef {
12572 proc: self.proc.clone(),
12573 selection: crate::querybuilder::query()
12574 .select("node")
12575 .arg("id", &id.0)
12576 .inline_fragment("FieldTypeDef"),
12577 graphql_client: self.graphql_client.clone(),
12578 })
12579 .collect())
12580 }
12581 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12583 let query = self.selection.select("functions");
12584 let query = query.select("id");
12585 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12586 Ok(ids
12587 .into_iter()
12588 .map(|id| Function {
12589 proc: self.proc.clone(),
12590 selection: crate::querybuilder::query()
12591 .select("node")
12592 .arg("id", &id.0)
12593 .inline_fragment("Function"),
12594 graphql_client: self.graphql_client.clone(),
12595 })
12596 .collect())
12597 }
12598 pub async fn id(&self) -> Result<Id, DaggerError> {
12600 let query = self.selection.select("id");
12601 query.execute(self.graphql_client.clone()).await
12602 }
12603 pub async fn name(&self) -> Result<String, DaggerError> {
12605 let query = self.selection.select("name");
12606 query.execute(self.graphql_client.clone()).await
12607 }
12608 pub fn source_map(&self) -> SourceMap {
12610 let query = self.selection.select("sourceMap");
12611 SourceMap {
12612 proc: self.proc.clone(),
12613 selection: query,
12614 graphql_client: self.graphql_client.clone(),
12615 }
12616 }
12617 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12619 let query = self.selection.select("sourceModuleName");
12620 query.execute(self.graphql_client.clone()).await
12621 }
12622}
12623impl Node for ObjectTypeDef {
12624 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12625 let query = self.selection.select("id");
12626 let graphql_client = self.graphql_client.clone();
12627 async move { query.execute(graphql_client).await }
12628 }
12629}
12630#[derive(Clone)]
12631pub struct Port {
12632 pub proc: Option<Arc<DaggerSessionProc>>,
12633 pub selection: Selection,
12634 pub graphql_client: DynGraphQLClient,
12635}
12636impl IntoID<Id> for Port {
12637 fn into_id(
12638 self,
12639 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12640 Box::pin(async move { self.id().await })
12641 }
12642}
12643impl Loadable for Port {
12644 fn graphql_type() -> &'static str {
12645 "Port"
12646 }
12647 fn from_query(
12648 proc: Option<Arc<DaggerSessionProc>>,
12649 selection: Selection,
12650 graphql_client: DynGraphQLClient,
12651 ) -> Self {
12652 Self {
12653 proc,
12654 selection,
12655 graphql_client,
12656 }
12657 }
12658}
12659impl Port {
12660 pub async fn description(&self) -> Result<String, DaggerError> {
12662 let query = self.selection.select("description");
12663 query.execute(self.graphql_client.clone()).await
12664 }
12665 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12667 let query = self.selection.select("experimentalSkipHealthcheck");
12668 query.execute(self.graphql_client.clone()).await
12669 }
12670 pub async fn id(&self) -> Result<Id, DaggerError> {
12672 let query = self.selection.select("id");
12673 query.execute(self.graphql_client.clone()).await
12674 }
12675 pub async fn port(&self) -> Result<isize, DaggerError> {
12677 let query = self.selection.select("port");
12678 query.execute(self.graphql_client.clone()).await
12679 }
12680 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12682 let query = self.selection.select("protocol");
12683 query.execute(self.graphql_client.clone()).await
12684 }
12685}
12686impl Node for Port {
12687 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12688 let query = self.selection.select("id");
12689 let graphql_client = self.graphql_client.clone();
12690 async move { query.execute(graphql_client).await }
12691 }
12692}
12693#[derive(Clone)]
12694pub struct Query {
12695 pub proc: Option<Arc<DaggerSessionProc>>,
12696 pub selection: Selection,
12697 pub graphql_client: DynGraphQLClient,
12698}
12699#[derive(Builder, Debug, PartialEq)]
12700pub struct QueryCacheVolumeOpts<'a> {
12701 #[builder(setter(into, strip_option), default)]
12705 pub owner: Option<&'a str>,
12706 #[builder(setter(into, strip_option), default)]
12708 pub sharing: Option<CacheSharingMode>,
12709 #[builder(setter(into, strip_option), default)]
12711 pub source: Option<Id>,
12712}
12713#[derive(Builder, Debug, PartialEq)]
12714pub struct QueryContainerOpts {
12715 #[builder(setter(into, strip_option), default)]
12717 pub platform: Option<Platform>,
12718}
12719#[derive(Builder, Debug, PartialEq)]
12720pub struct QueryCurrentTypeDefsOpts {
12721 #[builder(setter(into, strip_option), default)]
12724 pub hide_core: Option<bool>,
12725 #[builder(setter(into, strip_option), default)]
12727 pub return_all_types: Option<bool>,
12728}
12729#[derive(Builder, Debug, PartialEq)]
12730pub struct QueryEnvOpts {
12731 #[builder(setter(into, strip_option), default)]
12733 pub privileged: Option<bool>,
12734 #[builder(setter(into, strip_option), default)]
12736 pub writable: Option<bool>,
12737}
12738#[derive(Builder, Debug, PartialEq)]
12739pub struct QueryEnvFileOpts {
12740 #[builder(setter(into, strip_option), default)]
12742 pub expand: Option<bool>,
12743}
12744#[derive(Builder, Debug, PartialEq)]
12745pub struct QueryFileOpts {
12746 #[builder(setter(into, strip_option), default)]
12748 pub permissions: Option<isize>,
12749}
12750#[derive(Builder, Debug, PartialEq)]
12751pub struct QueryGitOpts<'a> {
12752 #[builder(setter(into, strip_option), default)]
12754 pub experimental_service_host: Option<Id>,
12755 #[builder(setter(into, strip_option), default)]
12757 pub http_auth_header: Option<Id>,
12758 #[builder(setter(into, strip_option), default)]
12760 pub http_auth_token: Option<Id>,
12761 #[builder(setter(into, strip_option), default)]
12763 pub http_auth_username: Option<&'a str>,
12764 #[builder(setter(into, strip_option), default)]
12766 pub keep_git_dir: Option<bool>,
12767 #[builder(setter(into, strip_option), default)]
12769 pub ssh_auth_socket: Option<Id>,
12770 #[builder(setter(into, strip_option), default)]
12772 pub ssh_known_hosts: Option<&'a str>,
12773}
12774#[derive(Builder, Debug, PartialEq)]
12775pub struct QueryHttpOpts<'a> {
12776 #[builder(setter(into, strip_option), default)]
12778 pub auth_header: Option<Id>,
12779 #[builder(setter(into, strip_option), default)]
12781 pub checksum: Option<&'a str>,
12782 #[builder(setter(into, strip_option), default)]
12784 pub experimental_service_host: Option<Id>,
12785 #[builder(setter(into, strip_option), default)]
12787 pub name: Option<&'a str>,
12788 #[builder(setter(into, strip_option), default)]
12790 pub permissions: Option<isize>,
12791}
12792#[derive(Builder, Debug, PartialEq)]
12793pub struct QueryLlmOpts<'a> {
12794 #[builder(setter(into, strip_option), default)]
12796 pub max_api_calls: Option<isize>,
12797 #[builder(setter(into, strip_option), default)]
12799 pub model: Option<&'a str>,
12800}
12801#[derive(Builder, Debug, PartialEq)]
12802pub struct QueryModuleSourceOpts<'a> {
12803 #[builder(setter(into, strip_option), default)]
12805 pub allow_not_exists: Option<bool>,
12806 #[builder(setter(into, strip_option), default)]
12808 pub disable_find_up: Option<bool>,
12809 #[builder(setter(into, strip_option), default)]
12811 pub ref_pin: Option<&'a str>,
12812 #[builder(setter(into, strip_option), default)]
12814 pub require_kind: Option<ModuleSourceKind>,
12815}
12816#[derive(Builder, Debug, PartialEq)]
12817pub struct QuerySecretOpts<'a> {
12818 #[builder(setter(into, strip_option), default)]
12822 pub cache_key: Option<&'a str>,
12823}
12824impl IntoID<Id> for Query {
12825 fn into_id(
12826 self,
12827 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12828 Box::pin(async move { self.id().await })
12829 }
12830}
12831impl Loadable for Query {
12832 fn graphql_type() -> &'static str {
12833 "Query"
12834 }
12835 fn from_query(
12836 proc: Option<Arc<DaggerSessionProc>>,
12837 selection: Selection,
12838 graphql_client: DynGraphQLClient,
12839 ) -> Self {
12840 Self {
12841 proc,
12842 selection,
12843 graphql_client,
12844 }
12845 }
12846}
12847impl Query {
12848 pub fn address(&self, value: impl Into<String>) -> Address {
12850 let mut query = self.selection.select("address");
12851 query = query.arg("value", value.into());
12852 Address {
12853 proc: self.proc.clone(),
12854 selection: query,
12855 graphql_client: self.graphql_client.clone(),
12856 }
12857 }
12858 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12865 let mut query = self.selection.select("cacheVolume");
12866 query = query.arg("key", key.into());
12867 CacheVolume {
12868 proc: self.proc.clone(),
12869 selection: query,
12870 graphql_client: self.graphql_client.clone(),
12871 }
12872 }
12873 pub fn cache_volume_opts<'a>(
12880 &self,
12881 key: impl Into<String>,
12882 opts: QueryCacheVolumeOpts<'a>,
12883 ) -> CacheVolume {
12884 let mut query = self.selection.select("cacheVolume");
12885 query = query.arg("key", key.into());
12886 if let Some(source) = opts.source {
12887 query = query.arg("source", source);
12888 }
12889 if let Some(sharing) = opts.sharing {
12890 query = query.arg("sharing", sharing);
12891 }
12892 if let Some(owner) = opts.owner {
12893 query = query.arg("owner", owner);
12894 }
12895 CacheVolume {
12896 proc: self.proc.clone(),
12897 selection: query,
12898 graphql_client: self.graphql_client.clone(),
12899 }
12900 }
12901 pub fn changeset(&self) -> Changeset {
12903 let query = self.selection.select("changeset");
12904 Changeset {
12905 proc: self.proc.clone(),
12906 selection: query,
12907 graphql_client: self.graphql_client.clone(),
12908 }
12909 }
12910 pub fn cloud(&self) -> Cloud {
12912 let query = self.selection.select("cloud");
12913 Cloud {
12914 proc: self.proc.clone(),
12915 selection: query,
12916 graphql_client: self.graphql_client.clone(),
12917 }
12918 }
12919 pub fn container(&self) -> Container {
12926 let query = self.selection.select("container");
12927 Container {
12928 proc: self.proc.clone(),
12929 selection: query,
12930 graphql_client: self.graphql_client.clone(),
12931 }
12932 }
12933 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12940 let mut query = self.selection.select("container");
12941 if let Some(platform) = opts.platform {
12942 query = query.arg("platform", platform);
12943 }
12944 Container {
12945 proc: self.proc.clone(),
12946 selection: query,
12947 graphql_client: self.graphql_client.clone(),
12948 }
12949 }
12950 pub fn current_env(&self) -> Env {
12954 let query = self.selection.select("currentEnv");
12955 Env {
12956 proc: self.proc.clone(),
12957 selection: query,
12958 graphql_client: self.graphql_client.clone(),
12959 }
12960 }
12961 pub fn current_function_call(&self) -> FunctionCall {
12964 let query = self.selection.select("currentFunctionCall");
12965 FunctionCall {
12966 proc: self.proc.clone(),
12967 selection: query,
12968 graphql_client: self.graphql_client.clone(),
12969 }
12970 }
12971 pub fn current_module(&self) -> CurrentModule {
12973 let query = self.selection.select("currentModule");
12974 CurrentModule {
12975 proc: self.proc.clone(),
12976 selection: query,
12977 graphql_client: self.graphql_client.clone(),
12978 }
12979 }
12980 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12986 let query = self.selection.select("currentTypeDefs");
12987 let query = query.select("id");
12988 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12989 Ok(ids
12990 .into_iter()
12991 .map(|id| TypeDef {
12992 proc: self.proc.clone(),
12993 selection: crate::querybuilder::query()
12994 .select("node")
12995 .arg("id", &id.0)
12996 .inline_fragment("TypeDef"),
12997 graphql_client: self.graphql_client.clone(),
12998 })
12999 .collect())
13000 }
13001 pub async fn current_type_defs_opts(
13007 &self,
13008 opts: QueryCurrentTypeDefsOpts,
13009 ) -> Result<Vec<TypeDef>, DaggerError> {
13010 let mut query = self.selection.select("currentTypeDefs");
13011 if let Some(return_all_types) = opts.return_all_types {
13012 query = query.arg("returnAllTypes", return_all_types);
13013 }
13014 if let Some(hide_core) = opts.hide_core {
13015 query = query.arg("hideCore", hide_core);
13016 }
13017 let query = query.select("id");
13018 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13019 Ok(ids
13020 .into_iter()
13021 .map(|id| TypeDef {
13022 proc: self.proc.clone(),
13023 selection: crate::querybuilder::query()
13024 .select("node")
13025 .arg("id", &id.0)
13026 .inline_fragment("TypeDef"),
13027 graphql_client: self.graphql_client.clone(),
13028 })
13029 .collect())
13030 }
13031 pub fn current_workspace(&self) -> Workspace {
13033 let query = self.selection.select("currentWorkspace");
13034 Workspace {
13035 proc: self.proc.clone(),
13036 selection: query,
13037 graphql_client: self.graphql_client.clone(),
13038 }
13039 }
13040 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13042 let query = self.selection.select("defaultPlatform");
13043 query.execute(self.graphql_client.clone()).await
13044 }
13045 pub fn directory(&self) -> Directory {
13047 let query = self.selection.select("directory");
13048 Directory {
13049 proc: self.proc.clone(),
13050 selection: query,
13051 graphql_client: self.graphql_client.clone(),
13052 }
13053 }
13054 pub fn engine(&self) -> Engine {
13056 let query = self.selection.select("engine");
13057 Engine {
13058 proc: self.proc.clone(),
13059 selection: query,
13060 graphql_client: self.graphql_client.clone(),
13061 }
13062 }
13063 pub fn env(&self) -> Env {
13069 let query = self.selection.select("env");
13070 Env {
13071 proc: self.proc.clone(),
13072 selection: query,
13073 graphql_client: self.graphql_client.clone(),
13074 }
13075 }
13076 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13082 let mut query = self.selection.select("env");
13083 if let Some(privileged) = opts.privileged {
13084 query = query.arg("privileged", privileged);
13085 }
13086 if let Some(writable) = opts.writable {
13087 query = query.arg("writable", writable);
13088 }
13089 Env {
13090 proc: self.proc.clone(),
13091 selection: query,
13092 graphql_client: self.graphql_client.clone(),
13093 }
13094 }
13095 pub fn env_file(&self) -> EnvFile {
13101 let query = self.selection.select("envFile");
13102 EnvFile {
13103 proc: self.proc.clone(),
13104 selection: query,
13105 graphql_client: self.graphql_client.clone(),
13106 }
13107 }
13108 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13114 let mut query = self.selection.select("envFile");
13115 if let Some(expand) = opts.expand {
13116 query = query.arg("expand", expand);
13117 }
13118 EnvFile {
13119 proc: self.proc.clone(),
13120 selection: query,
13121 graphql_client: self.graphql_client.clone(),
13122 }
13123 }
13124 pub fn error(&self, message: impl Into<String>) -> Error {
13130 let mut query = self.selection.select("error");
13131 query = query.arg("message", message.into());
13132 Error {
13133 proc: self.proc.clone(),
13134 selection: query,
13135 graphql_client: self.graphql_client.clone(),
13136 }
13137 }
13138 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13146 let mut query = self.selection.select("file");
13147 query = query.arg("name", name.into());
13148 query = query.arg("contents", contents.into());
13149 File {
13150 proc: self.proc.clone(),
13151 selection: query,
13152 graphql_client: self.graphql_client.clone(),
13153 }
13154 }
13155 pub fn file_opts(
13163 &self,
13164 name: impl Into<String>,
13165 contents: impl Into<String>,
13166 opts: QueryFileOpts,
13167 ) -> File {
13168 let mut query = self.selection.select("file");
13169 query = query.arg("name", name.into());
13170 query = query.arg("contents", contents.into());
13171 if let Some(permissions) = opts.permissions {
13172 query = query.arg("permissions", permissions);
13173 }
13174 File {
13175 proc: self.proc.clone(),
13176 selection: query,
13177 graphql_client: self.graphql_client.clone(),
13178 }
13179 }
13180 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13187 let mut query = self.selection.select("function");
13188 query = query.arg("name", name.into());
13189 query = query.arg_lazy(
13190 "returnType",
13191 Box::new(move || {
13192 let return_type = return_type.clone();
13193 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13194 }),
13195 );
13196 Function {
13197 proc: self.proc.clone(),
13198 selection: query,
13199 graphql_client: self.graphql_client.clone(),
13200 }
13201 }
13202 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13204 let mut query = self.selection.select("generatedCode");
13205 query = query.arg_lazy(
13206 "code",
13207 Box::new(move || {
13208 let code = code.clone();
13209 Box::pin(async move { code.into_id().await.unwrap().quote() })
13210 }),
13211 );
13212 GeneratedCode {
13213 proc: self.proc.clone(),
13214 selection: query,
13215 graphql_client: self.graphql_client.clone(),
13216 }
13217 }
13218 pub fn git(&self, url: impl Into<String>) -> GitRepository {
13229 let mut query = self.selection.select("git");
13230 query = query.arg("url", url.into());
13231 GitRepository {
13232 proc: self.proc.clone(),
13233 selection: query,
13234 graphql_client: self.graphql_client.clone(),
13235 }
13236 }
13237 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13248 let mut query = self.selection.select("git");
13249 query = query.arg("url", url.into());
13250 if let Some(keep_git_dir) = opts.keep_git_dir {
13251 query = query.arg("keepGitDir", keep_git_dir);
13252 }
13253 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13254 query = query.arg("sshKnownHosts", ssh_known_hosts);
13255 }
13256 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13257 query = query.arg("sshAuthSocket", ssh_auth_socket);
13258 }
13259 if let Some(http_auth_username) = opts.http_auth_username {
13260 query = query.arg("httpAuthUsername", http_auth_username);
13261 }
13262 if let Some(http_auth_token) = opts.http_auth_token {
13263 query = query.arg("httpAuthToken", http_auth_token);
13264 }
13265 if let Some(http_auth_header) = opts.http_auth_header {
13266 query = query.arg("httpAuthHeader", http_auth_header);
13267 }
13268 if let Some(experimental_service_host) = opts.experimental_service_host {
13269 query = query.arg("experimentalServiceHost", experimental_service_host);
13270 }
13271 GitRepository {
13272 proc: self.proc.clone(),
13273 selection: query,
13274 graphql_client: self.graphql_client.clone(),
13275 }
13276 }
13277 pub fn host(&self) -> Host {
13279 let query = self.selection.select("host");
13280 Host {
13281 proc: self.proc.clone(),
13282 selection: query,
13283 graphql_client: self.graphql_client.clone(),
13284 }
13285 }
13286 pub fn http(&self, url: impl Into<String>) -> File {
13293 let mut query = self.selection.select("http");
13294 query = query.arg("url", url.into());
13295 File {
13296 proc: self.proc.clone(),
13297 selection: query,
13298 graphql_client: self.graphql_client.clone(),
13299 }
13300 }
13301 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13308 let mut query = self.selection.select("http");
13309 query = query.arg("url", url.into());
13310 if let Some(name) = opts.name {
13311 query = query.arg("name", name);
13312 }
13313 if let Some(permissions) = opts.permissions {
13314 query = query.arg("permissions", permissions);
13315 }
13316 if let Some(checksum) = opts.checksum {
13317 query = query.arg("checksum", checksum);
13318 }
13319 if let Some(auth_header) = opts.auth_header {
13320 query = query.arg("authHeader", auth_header);
13321 }
13322 if let Some(experimental_service_host) = opts.experimental_service_host {
13323 query = query.arg("experimentalServiceHost", experimental_service_host);
13324 }
13325 File {
13326 proc: self.proc.clone(),
13327 selection: query,
13328 graphql_client: self.graphql_client.clone(),
13329 }
13330 }
13331 pub async fn id(&self) -> Result<Id, DaggerError> {
13333 let query = self.selection.select("id");
13334 query.execute(self.graphql_client.clone()).await
13335 }
13336 pub fn json(&self) -> JsonValue {
13338 let query = self.selection.select("json");
13339 JsonValue {
13340 proc: self.proc.clone(),
13341 selection: query,
13342 graphql_client: self.graphql_client.clone(),
13343 }
13344 }
13345 pub fn llm(&self) -> Llm {
13351 let query = self.selection.select("llm");
13352 Llm {
13353 proc: self.proc.clone(),
13354 selection: query,
13355 graphql_client: self.graphql_client.clone(),
13356 }
13357 }
13358 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13364 let mut query = self.selection.select("llm");
13365 if let Some(model) = opts.model {
13366 query = query.arg("model", model);
13367 }
13368 if let Some(max_api_calls) = opts.max_api_calls {
13369 query = query.arg("maxAPICalls", max_api_calls);
13370 }
13371 Llm {
13372 proc: self.proc.clone(),
13373 selection: query,
13374 graphql_client: self.graphql_client.clone(),
13375 }
13376 }
13377 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13379 let mut query = self.selection.select("loadAddressFromID");
13380 query = query.arg_lazy(
13381 "id",
13382 Box::new(move || {
13383 let id = id.clone();
13384 Box::pin(async move { id.into_id().await.unwrap().quote() })
13385 }),
13386 );
13387 Address {
13388 proc: self.proc.clone(),
13389 selection: query,
13390 graphql_client: self.graphql_client.clone(),
13391 }
13392 }
13393 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13395 let mut query = self.selection.select("loadBindingFromID");
13396 query = query.arg_lazy(
13397 "id",
13398 Box::new(move || {
13399 let id = id.clone();
13400 Box::pin(async move { id.into_id().await.unwrap().quote() })
13401 }),
13402 );
13403 Binding {
13404 proc: self.proc.clone(),
13405 selection: query,
13406 graphql_client: self.graphql_client.clone(),
13407 }
13408 }
13409 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13411 let mut query = self.selection.select("loadCacheVolumeFromID");
13412 query = query.arg_lazy(
13413 "id",
13414 Box::new(move || {
13415 let id = id.clone();
13416 Box::pin(async move { id.into_id().await.unwrap().quote() })
13417 }),
13418 );
13419 CacheVolume {
13420 proc: self.proc.clone(),
13421 selection: query,
13422 graphql_client: self.graphql_client.clone(),
13423 }
13424 }
13425 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13427 let mut query = self.selection.select("loadChangesetFromID");
13428 query = query.arg_lazy(
13429 "id",
13430 Box::new(move || {
13431 let id = id.clone();
13432 Box::pin(async move { id.into_id().await.unwrap().quote() })
13433 }),
13434 );
13435 Changeset {
13436 proc: self.proc.clone(),
13437 selection: query,
13438 graphql_client: self.graphql_client.clone(),
13439 }
13440 }
13441 pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13443 let mut query = self.selection.select("loadCheckFromID");
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 Check {
13452 proc: self.proc.clone(),
13453 selection: query,
13454 graphql_client: self.graphql_client.clone(),
13455 }
13456 }
13457 pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13459 let mut query = self.selection.select("loadCheckGroupFromID");
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 CheckGroup {
13468 proc: self.proc.clone(),
13469 selection: query,
13470 graphql_client: self.graphql_client.clone(),
13471 }
13472 }
13473 pub fn load_client_filesync_mirror_from_id(
13475 &self,
13476 id: impl IntoID<ClientFilesyncMirrorId>,
13477 ) -> ClientFilesyncMirror {
13478 let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13479 query = query.arg_lazy(
13480 "id",
13481 Box::new(move || {
13482 let id = id.clone();
13483 Box::pin(async move { id.into_id().await.unwrap().quote() })
13484 }),
13485 );
13486 ClientFilesyncMirror {
13487 proc: self.proc.clone(),
13488 selection: query,
13489 graphql_client: self.graphql_client.clone(),
13490 }
13491 }
13492 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13494 let mut query = self.selection.select("loadCloudFromID");
13495 query = query.arg_lazy(
13496 "id",
13497 Box::new(move || {
13498 let id = id.clone();
13499 Box::pin(async move { id.into_id().await.unwrap().quote() })
13500 }),
13501 );
13502 Cloud {
13503 proc: self.proc.clone(),
13504 selection: query,
13505 graphql_client: self.graphql_client.clone(),
13506 }
13507 }
13508 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13510 let mut query = self.selection.select("loadContainerFromID");
13511 query = query.arg_lazy(
13512 "id",
13513 Box::new(move || {
13514 let id = id.clone();
13515 Box::pin(async move { id.into_id().await.unwrap().quote() })
13516 }),
13517 );
13518 Container {
13519 proc: self.proc.clone(),
13520 selection: query,
13521 graphql_client: self.graphql_client.clone(),
13522 }
13523 }
13524 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13526 let mut query = self.selection.select("loadCurrentModuleFromID");
13527 query = query.arg_lazy(
13528 "id",
13529 Box::new(move || {
13530 let id = id.clone();
13531 Box::pin(async move { id.into_id().await.unwrap().quote() })
13532 }),
13533 );
13534 CurrentModule {
13535 proc: self.proc.clone(),
13536 selection: query,
13537 graphql_client: self.graphql_client.clone(),
13538 }
13539 }
13540 pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13542 let mut query = self.selection.select("loadDiffStatFromID");
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 DiffStat {
13551 proc: self.proc.clone(),
13552 selection: query,
13553 graphql_client: self.graphql_client.clone(),
13554 }
13555 }
13556 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13558 let mut query = self.selection.select("loadDirectoryFromID");
13559 query = query.arg_lazy(
13560 "id",
13561 Box::new(move || {
13562 let id = id.clone();
13563 Box::pin(async move { id.into_id().await.unwrap().quote() })
13564 }),
13565 );
13566 Directory {
13567 proc: self.proc.clone(),
13568 selection: query,
13569 graphql_client: self.graphql_client.clone(),
13570 }
13571 }
13572 pub fn load_engine_cache_entry_from_id(
13574 &self,
13575 id: impl IntoID<EngineCacheEntryId>,
13576 ) -> EngineCacheEntry {
13577 let mut query = self.selection.select("loadEngineCacheEntryFromID");
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 EngineCacheEntry {
13586 proc: self.proc.clone(),
13587 selection: query,
13588 graphql_client: self.graphql_client.clone(),
13589 }
13590 }
13591 pub fn load_engine_cache_entry_set_from_id(
13593 &self,
13594 id: impl IntoID<EngineCacheEntrySetId>,
13595 ) -> EngineCacheEntrySet {
13596 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13597 query = query.arg_lazy(
13598 "id",
13599 Box::new(move || {
13600 let id = id.clone();
13601 Box::pin(async move { id.into_id().await.unwrap().quote() })
13602 }),
13603 );
13604 EngineCacheEntrySet {
13605 proc: self.proc.clone(),
13606 selection: query,
13607 graphql_client: self.graphql_client.clone(),
13608 }
13609 }
13610 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13612 let mut query = self.selection.select("loadEngineCacheFromID");
13613 query = query.arg_lazy(
13614 "id",
13615 Box::new(move || {
13616 let id = id.clone();
13617 Box::pin(async move { id.into_id().await.unwrap().quote() })
13618 }),
13619 );
13620 EngineCache {
13621 proc: self.proc.clone(),
13622 selection: query,
13623 graphql_client: self.graphql_client.clone(),
13624 }
13625 }
13626 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13628 let mut query = self.selection.select("loadEngineFromID");
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 Engine {
13637 proc: self.proc.clone(),
13638 selection: query,
13639 graphql_client: self.graphql_client.clone(),
13640 }
13641 }
13642 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13644 let mut query = self.selection.select("loadEnumTypeDefFromID");
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 EnumTypeDef {
13653 proc: self.proc.clone(),
13654 selection: query,
13655 graphql_client: self.graphql_client.clone(),
13656 }
13657 }
13658 pub fn load_enum_value_type_def_from_id(
13660 &self,
13661 id: impl IntoID<EnumValueTypeDefId>,
13662 ) -> EnumValueTypeDef {
13663 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13664 query = query.arg_lazy(
13665 "id",
13666 Box::new(move || {
13667 let id = id.clone();
13668 Box::pin(async move { id.into_id().await.unwrap().quote() })
13669 }),
13670 );
13671 EnumValueTypeDef {
13672 proc: self.proc.clone(),
13673 selection: query,
13674 graphql_client: self.graphql_client.clone(),
13675 }
13676 }
13677 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13679 let mut query = self.selection.select("loadEnvFileFromID");
13680 query = query.arg_lazy(
13681 "id",
13682 Box::new(move || {
13683 let id = id.clone();
13684 Box::pin(async move { id.into_id().await.unwrap().quote() })
13685 }),
13686 );
13687 EnvFile {
13688 proc: self.proc.clone(),
13689 selection: query,
13690 graphql_client: self.graphql_client.clone(),
13691 }
13692 }
13693 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13695 let mut query = self.selection.select("loadEnvFromID");
13696 query = query.arg_lazy(
13697 "id",
13698 Box::new(move || {
13699 let id = id.clone();
13700 Box::pin(async move { id.into_id().await.unwrap().quote() })
13701 }),
13702 );
13703 Env {
13704 proc: self.proc.clone(),
13705 selection: query,
13706 graphql_client: self.graphql_client.clone(),
13707 }
13708 }
13709 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13711 let mut query = self.selection.select("loadEnvVariableFromID");
13712 query = query.arg_lazy(
13713 "id",
13714 Box::new(move || {
13715 let id = id.clone();
13716 Box::pin(async move { id.into_id().await.unwrap().quote() })
13717 }),
13718 );
13719 EnvVariable {
13720 proc: self.proc.clone(),
13721 selection: query,
13722 graphql_client: self.graphql_client.clone(),
13723 }
13724 }
13725 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13727 let mut query = self.selection.select("loadErrorFromID");
13728 query = query.arg_lazy(
13729 "id",
13730 Box::new(move || {
13731 let id = id.clone();
13732 Box::pin(async move { id.into_id().await.unwrap().quote() })
13733 }),
13734 );
13735 Error {
13736 proc: self.proc.clone(),
13737 selection: query,
13738 graphql_client: self.graphql_client.clone(),
13739 }
13740 }
13741 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13743 let mut query = self.selection.select("loadErrorValueFromID");
13744 query = query.arg_lazy(
13745 "id",
13746 Box::new(move || {
13747 let id = id.clone();
13748 Box::pin(async move { id.into_id().await.unwrap().quote() })
13749 }),
13750 );
13751 ErrorValue {
13752 proc: self.proc.clone(),
13753 selection: query,
13754 graphql_client: self.graphql_client.clone(),
13755 }
13756 }
13757 pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13759 let mut query = self.selection.select("loadExportableFromID");
13760 query = query.arg_lazy(
13761 "id",
13762 Box::new(move || {
13763 let id = id.clone();
13764 Box::pin(async move { id.into_id().await.unwrap().quote() })
13765 }),
13766 );
13767 ExportableClient {
13768 proc: self.proc.clone(),
13769 selection: query,
13770 graphql_client: self.graphql_client.clone(),
13771 }
13772 }
13773 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13775 let mut query = self.selection.select("loadFieldTypeDefFromID");
13776 query = query.arg_lazy(
13777 "id",
13778 Box::new(move || {
13779 let id = id.clone();
13780 Box::pin(async move { id.into_id().await.unwrap().quote() })
13781 }),
13782 );
13783 FieldTypeDef {
13784 proc: self.proc.clone(),
13785 selection: query,
13786 graphql_client: self.graphql_client.clone(),
13787 }
13788 }
13789 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13791 let mut query = self.selection.select("loadFileFromID");
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 File {
13800 proc: self.proc.clone(),
13801 selection: query,
13802 graphql_client: self.graphql_client.clone(),
13803 }
13804 }
13805 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13807 let mut query = self.selection.select("loadFunctionArgFromID");
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 FunctionArg {
13816 proc: self.proc.clone(),
13817 selection: query,
13818 graphql_client: self.graphql_client.clone(),
13819 }
13820 }
13821 pub fn load_function_call_arg_value_from_id(
13823 &self,
13824 id: impl IntoID<FunctionCallArgValueId>,
13825 ) -> FunctionCallArgValue {
13826 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13827 query = query.arg_lazy(
13828 "id",
13829 Box::new(move || {
13830 let id = id.clone();
13831 Box::pin(async move { id.into_id().await.unwrap().quote() })
13832 }),
13833 );
13834 FunctionCallArgValue {
13835 proc: self.proc.clone(),
13836 selection: query,
13837 graphql_client: self.graphql_client.clone(),
13838 }
13839 }
13840 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13842 let mut query = self.selection.select("loadFunctionCallFromID");
13843 query = query.arg_lazy(
13844 "id",
13845 Box::new(move || {
13846 let id = id.clone();
13847 Box::pin(async move { id.into_id().await.unwrap().quote() })
13848 }),
13849 );
13850 FunctionCall {
13851 proc: self.proc.clone(),
13852 selection: query,
13853 graphql_client: self.graphql_client.clone(),
13854 }
13855 }
13856 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13858 let mut query = self.selection.select("loadFunctionFromID");
13859 query = query.arg_lazy(
13860 "id",
13861 Box::new(move || {
13862 let id = id.clone();
13863 Box::pin(async move { id.into_id().await.unwrap().quote() })
13864 }),
13865 );
13866 Function {
13867 proc: self.proc.clone(),
13868 selection: query,
13869 graphql_client: self.graphql_client.clone(),
13870 }
13871 }
13872 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13874 let mut query = self.selection.select("loadGeneratedCodeFromID");
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 GeneratedCode {
13883 proc: self.proc.clone(),
13884 selection: query,
13885 graphql_client: self.graphql_client.clone(),
13886 }
13887 }
13888 pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13890 let mut query = self.selection.select("loadGeneratorFromID");
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 Generator {
13899 proc: self.proc.clone(),
13900 selection: query,
13901 graphql_client: self.graphql_client.clone(),
13902 }
13903 }
13904 pub fn load_generator_group_from_id(
13906 &self,
13907 id: impl IntoID<GeneratorGroupId>,
13908 ) -> GeneratorGroup {
13909 let mut query = self.selection.select("loadGeneratorGroupFromID");
13910 query = query.arg_lazy(
13911 "id",
13912 Box::new(move || {
13913 let id = id.clone();
13914 Box::pin(async move { id.into_id().await.unwrap().quote() })
13915 }),
13916 );
13917 GeneratorGroup {
13918 proc: self.proc.clone(),
13919 selection: query,
13920 graphql_client: self.graphql_client.clone(),
13921 }
13922 }
13923 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13925 let mut query = self.selection.select("loadGitRefFromID");
13926 query = query.arg_lazy(
13927 "id",
13928 Box::new(move || {
13929 let id = id.clone();
13930 Box::pin(async move { id.into_id().await.unwrap().quote() })
13931 }),
13932 );
13933 GitRef {
13934 proc: self.proc.clone(),
13935 selection: query,
13936 graphql_client: self.graphql_client.clone(),
13937 }
13938 }
13939 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13941 let mut query = self.selection.select("loadGitRepositoryFromID");
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 GitRepository {
13950 proc: self.proc.clone(),
13951 selection: query,
13952 graphql_client: self.graphql_client.clone(),
13953 }
13954 }
13955 pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
13957 let mut query = self.selection.select("loadHTTPStateFromID");
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 HttpState {
13966 proc: self.proc.clone(),
13967 selection: query,
13968 graphql_client: self.graphql_client.clone(),
13969 }
13970 }
13971 pub fn load_healthcheck_config_from_id(
13973 &self,
13974 id: impl IntoID<HealthcheckConfigId>,
13975 ) -> HealthcheckConfig {
13976 let mut query = self.selection.select("loadHealthcheckConfigFromID");
13977 query = query.arg_lazy(
13978 "id",
13979 Box::new(move || {
13980 let id = id.clone();
13981 Box::pin(async move { id.into_id().await.unwrap().quote() })
13982 }),
13983 );
13984 HealthcheckConfig {
13985 proc: self.proc.clone(),
13986 selection: query,
13987 graphql_client: self.graphql_client.clone(),
13988 }
13989 }
13990 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13992 let mut query = self.selection.select("loadHostFromID");
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 Host {
14001 proc: self.proc.clone(),
14002 selection: query,
14003 graphql_client: self.graphql_client.clone(),
14004 }
14005 }
14006 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14008 let mut query = self.selection.select("loadInputTypeDefFromID");
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 InputTypeDef {
14017 proc: self.proc.clone(),
14018 selection: query,
14019 graphql_client: self.graphql_client.clone(),
14020 }
14021 }
14022 pub fn load_interface_type_def_from_id(
14024 &self,
14025 id: impl IntoID<InterfaceTypeDefId>,
14026 ) -> InterfaceTypeDef {
14027 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14028 query = query.arg_lazy(
14029 "id",
14030 Box::new(move || {
14031 let id = id.clone();
14032 Box::pin(async move { id.into_id().await.unwrap().quote() })
14033 }),
14034 );
14035 InterfaceTypeDef {
14036 proc: self.proc.clone(),
14037 selection: query,
14038 graphql_client: self.graphql_client.clone(),
14039 }
14040 }
14041 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14043 let mut query = self.selection.select("loadJSONValueFromID");
14044 query = query.arg_lazy(
14045 "id",
14046 Box::new(move || {
14047 let id = id.clone();
14048 Box::pin(async move { id.into_id().await.unwrap().quote() })
14049 }),
14050 );
14051 JsonValue {
14052 proc: self.proc.clone(),
14053 selection: query,
14054 graphql_client: self.graphql_client.clone(),
14055 }
14056 }
14057 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14059 let mut query = self.selection.select("loadLLMFromID");
14060 query = query.arg_lazy(
14061 "id",
14062 Box::new(move || {
14063 let id = id.clone();
14064 Box::pin(async move { id.into_id().await.unwrap().quote() })
14065 }),
14066 );
14067 Llm {
14068 proc: self.proc.clone(),
14069 selection: query,
14070 graphql_client: self.graphql_client.clone(),
14071 }
14072 }
14073 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14075 let mut query = self.selection.select("loadLLMTokenUsageFromID");
14076 query = query.arg_lazy(
14077 "id",
14078 Box::new(move || {
14079 let id = id.clone();
14080 Box::pin(async move { id.into_id().await.unwrap().quote() })
14081 }),
14082 );
14083 LlmTokenUsage {
14084 proc: self.proc.clone(),
14085 selection: query,
14086 graphql_client: self.graphql_client.clone(),
14087 }
14088 }
14089 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14091 let mut query = self.selection.select("loadLabelFromID");
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 Label {
14100 proc: self.proc.clone(),
14101 selection: query,
14102 graphql_client: self.graphql_client.clone(),
14103 }
14104 }
14105 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14107 let mut query = self.selection.select("loadListTypeDefFromID");
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 ListTypeDef {
14116 proc: self.proc.clone(),
14117 selection: query,
14118 graphql_client: self.graphql_client.clone(),
14119 }
14120 }
14121 pub fn load_module_config_client_from_id(
14123 &self,
14124 id: impl IntoID<ModuleConfigClientId>,
14125 ) -> ModuleConfigClient {
14126 let mut query = self.selection.select("loadModuleConfigClientFromID");
14127 query = query.arg_lazy(
14128 "id",
14129 Box::new(move || {
14130 let id = id.clone();
14131 Box::pin(async move { id.into_id().await.unwrap().quote() })
14132 }),
14133 );
14134 ModuleConfigClient {
14135 proc: self.proc.clone(),
14136 selection: query,
14137 graphql_client: self.graphql_client.clone(),
14138 }
14139 }
14140 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14142 let mut query = self.selection.select("loadModuleFromID");
14143 query = query.arg_lazy(
14144 "id",
14145 Box::new(move || {
14146 let id = id.clone();
14147 Box::pin(async move { id.into_id().await.unwrap().quote() })
14148 }),
14149 );
14150 Module {
14151 proc: self.proc.clone(),
14152 selection: query,
14153 graphql_client: self.graphql_client.clone(),
14154 }
14155 }
14156 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14158 let mut query = self.selection.select("loadModuleSourceFromID");
14159 query = query.arg_lazy(
14160 "id",
14161 Box::new(move || {
14162 let id = id.clone();
14163 Box::pin(async move { id.into_id().await.unwrap().quote() })
14164 }),
14165 );
14166 ModuleSource {
14167 proc: self.proc.clone(),
14168 selection: query,
14169 graphql_client: self.graphql_client.clone(),
14170 }
14171 }
14172 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14174 let mut query = self.selection.select("loadObjectTypeDefFromID");
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 ObjectTypeDef {
14183 proc: self.proc.clone(),
14184 selection: query,
14185 graphql_client: self.graphql_client.clone(),
14186 }
14187 }
14188 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14190 let mut query = self.selection.select("loadPortFromID");
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 Port {
14199 proc: self.proc.clone(),
14200 selection: query,
14201 graphql_client: self.graphql_client.clone(),
14202 }
14203 }
14204 pub fn load_remote_git_mirror_from_id(
14206 &self,
14207 id: impl IntoID<RemoteGitMirrorId>,
14208 ) -> RemoteGitMirror {
14209 let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14210 query = query.arg_lazy(
14211 "id",
14212 Box::new(move || {
14213 let id = id.clone();
14214 Box::pin(async move { id.into_id().await.unwrap().quote() })
14215 }),
14216 );
14217 RemoteGitMirror {
14218 proc: self.proc.clone(),
14219 selection: query,
14220 graphql_client: self.graphql_client.clone(),
14221 }
14222 }
14223 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14225 let mut query = self.selection.select("loadSDKConfigFromID");
14226 query = query.arg_lazy(
14227 "id",
14228 Box::new(move || {
14229 let id = id.clone();
14230 Box::pin(async move { id.into_id().await.unwrap().quote() })
14231 }),
14232 );
14233 SdkConfig {
14234 proc: self.proc.clone(),
14235 selection: query,
14236 graphql_client: self.graphql_client.clone(),
14237 }
14238 }
14239 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14241 let mut query = self.selection.select("loadScalarTypeDefFromID");
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 ScalarTypeDef {
14250 proc: self.proc.clone(),
14251 selection: query,
14252 graphql_client: self.graphql_client.clone(),
14253 }
14254 }
14255 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14257 let mut query = self.selection.select("loadSearchResultFromID");
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 SearchResult {
14266 proc: self.proc.clone(),
14267 selection: query,
14268 graphql_client: self.graphql_client.clone(),
14269 }
14270 }
14271 pub fn load_search_submatch_from_id(
14273 &self,
14274 id: impl IntoID<SearchSubmatchId>,
14275 ) -> SearchSubmatch {
14276 let mut query = self.selection.select("loadSearchSubmatchFromID");
14277 query = query.arg_lazy(
14278 "id",
14279 Box::new(move || {
14280 let id = id.clone();
14281 Box::pin(async move { id.into_id().await.unwrap().quote() })
14282 }),
14283 );
14284 SearchSubmatch {
14285 proc: self.proc.clone(),
14286 selection: query,
14287 graphql_client: self.graphql_client.clone(),
14288 }
14289 }
14290 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14292 let mut query = self.selection.select("loadSecretFromID");
14293 query = query.arg_lazy(
14294 "id",
14295 Box::new(move || {
14296 let id = id.clone();
14297 Box::pin(async move { id.into_id().await.unwrap().quote() })
14298 }),
14299 );
14300 Secret {
14301 proc: self.proc.clone(),
14302 selection: query,
14303 graphql_client: self.graphql_client.clone(),
14304 }
14305 }
14306 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14308 let mut query = self.selection.select("loadServiceFromID");
14309 query = query.arg_lazy(
14310 "id",
14311 Box::new(move || {
14312 let id = id.clone();
14313 Box::pin(async move { id.into_id().await.unwrap().quote() })
14314 }),
14315 );
14316 Service {
14317 proc: self.proc.clone(),
14318 selection: query,
14319 graphql_client: self.graphql_client.clone(),
14320 }
14321 }
14322 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14324 let mut query = self.selection.select("loadSocketFromID");
14325 query = query.arg_lazy(
14326 "id",
14327 Box::new(move || {
14328 let id = id.clone();
14329 Box::pin(async move { id.into_id().await.unwrap().quote() })
14330 }),
14331 );
14332 Socket {
14333 proc: self.proc.clone(),
14334 selection: query,
14335 graphql_client: self.graphql_client.clone(),
14336 }
14337 }
14338 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14340 let mut query = self.selection.select("loadSourceMapFromID");
14341 query = query.arg_lazy(
14342 "id",
14343 Box::new(move || {
14344 let id = id.clone();
14345 Box::pin(async move { id.into_id().await.unwrap().quote() })
14346 }),
14347 );
14348 SourceMap {
14349 proc: self.proc.clone(),
14350 selection: query,
14351 graphql_client: self.graphql_client.clone(),
14352 }
14353 }
14354 pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14356 let mut query = self.selection.select("loadStatFromID");
14357 query = query.arg_lazy(
14358 "id",
14359 Box::new(move || {
14360 let id = id.clone();
14361 Box::pin(async move { id.into_id().await.unwrap().quote() })
14362 }),
14363 );
14364 Stat {
14365 proc: self.proc.clone(),
14366 selection: query,
14367 graphql_client: self.graphql_client.clone(),
14368 }
14369 }
14370 pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14372 let mut query = self.selection.select("loadSyncerFromID");
14373 query = query.arg_lazy(
14374 "id",
14375 Box::new(move || {
14376 let id = id.clone();
14377 Box::pin(async move { id.into_id().await.unwrap().quote() })
14378 }),
14379 );
14380 SyncerClient {
14381 proc: self.proc.clone(),
14382 selection: query,
14383 graphql_client: self.graphql_client.clone(),
14384 }
14385 }
14386 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14388 let mut query = self.selection.select("loadTerminalFromID");
14389 query = query.arg_lazy(
14390 "id",
14391 Box::new(move || {
14392 let id = id.clone();
14393 Box::pin(async move { id.into_id().await.unwrap().quote() })
14394 }),
14395 );
14396 Terminal {
14397 proc: self.proc.clone(),
14398 selection: query,
14399 graphql_client: self.graphql_client.clone(),
14400 }
14401 }
14402 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14404 let mut query = self.selection.select("loadTypeDefFromID");
14405 query = query.arg_lazy(
14406 "id",
14407 Box::new(move || {
14408 let id = id.clone();
14409 Box::pin(async move { id.into_id().await.unwrap().quote() })
14410 }),
14411 );
14412 TypeDef {
14413 proc: self.proc.clone(),
14414 selection: query,
14415 graphql_client: self.graphql_client.clone(),
14416 }
14417 }
14418 pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14420 let mut query = self.selection.select("loadUpFromID");
14421 query = query.arg_lazy(
14422 "id",
14423 Box::new(move || {
14424 let id = id.clone();
14425 Box::pin(async move { id.into_id().await.unwrap().quote() })
14426 }),
14427 );
14428 Up {
14429 proc: self.proc.clone(),
14430 selection: query,
14431 graphql_client: self.graphql_client.clone(),
14432 }
14433 }
14434 pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14436 let mut query = self.selection.select("loadUpGroupFromID");
14437 query = query.arg_lazy(
14438 "id",
14439 Box::new(move || {
14440 let id = id.clone();
14441 Box::pin(async move { id.into_id().await.unwrap().quote() })
14442 }),
14443 );
14444 UpGroup {
14445 proc: self.proc.clone(),
14446 selection: query,
14447 graphql_client: self.graphql_client.clone(),
14448 }
14449 }
14450 pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14452 let mut query = self.selection.select("loadWorkspaceFromID");
14453 query = query.arg_lazy(
14454 "id",
14455 Box::new(move || {
14456 let id = id.clone();
14457 Box::pin(async move { id.into_id().await.unwrap().quote() })
14458 }),
14459 );
14460 Workspace {
14461 proc: self.proc.clone(),
14462 selection: query,
14463 graphql_client: self.graphql_client.clone(),
14464 }
14465 }
14466 pub fn module(&self) -> Module {
14468 let query = self.selection.select("module");
14469 Module {
14470 proc: self.proc.clone(),
14471 selection: query,
14472 graphql_client: self.graphql_client.clone(),
14473 }
14474 }
14475 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14482 let mut query = self.selection.select("moduleSource");
14483 query = query.arg("refString", ref_string.into());
14484 ModuleSource {
14485 proc: self.proc.clone(),
14486 selection: query,
14487 graphql_client: self.graphql_client.clone(),
14488 }
14489 }
14490 pub fn module_source_opts<'a>(
14497 &self,
14498 ref_string: impl Into<String>,
14499 opts: QueryModuleSourceOpts<'a>,
14500 ) -> ModuleSource {
14501 let mut query = self.selection.select("moduleSource");
14502 query = query.arg("refString", ref_string.into());
14503 if let Some(ref_pin) = opts.ref_pin {
14504 query = query.arg("refPin", ref_pin);
14505 }
14506 if let Some(disable_find_up) = opts.disable_find_up {
14507 query = query.arg("disableFindUp", disable_find_up);
14508 }
14509 if let Some(allow_not_exists) = opts.allow_not_exists {
14510 query = query.arg("allowNotExists", allow_not_exists);
14511 }
14512 if let Some(require_kind) = opts.require_kind {
14513 query = query.arg("requireKind", require_kind);
14514 }
14515 ModuleSource {
14516 proc: self.proc.clone(),
14517 selection: query,
14518 graphql_client: self.graphql_client.clone(),
14519 }
14520 }
14521 pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14523 let mut query = self.selection.select("node");
14524 query = query.arg_lazy(
14525 "id",
14526 Box::new(move || {
14527 let id = id.clone();
14528 Box::pin(async move { id.into_id().await.unwrap().quote() })
14529 }),
14530 );
14531 NodeClient {
14532 proc: self.proc.clone(),
14533 selection: query,
14534 graphql_client: self.graphql_client.clone(),
14535 }
14536 }
14537 pub fn secret(&self, uri: impl Into<String>) -> Secret {
14544 let mut query = self.selection.select("secret");
14545 query = query.arg("uri", uri.into());
14546 Secret {
14547 proc: self.proc.clone(),
14548 selection: query,
14549 graphql_client: self.graphql_client.clone(),
14550 }
14551 }
14552 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14559 let mut query = self.selection.select("secret");
14560 query = query.arg("uri", uri.into());
14561 if let Some(cache_key) = opts.cache_key {
14562 query = query.arg("cacheKey", cache_key);
14563 }
14564 Secret {
14565 proc: self.proc.clone(),
14566 selection: query,
14567 graphql_client: self.graphql_client.clone(),
14568 }
14569 }
14570 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14578 let mut query = self.selection.select("setSecret");
14579 query = query.arg("name", name.into());
14580 query = query.arg("plaintext", plaintext.into());
14581 Secret {
14582 proc: self.proc.clone(),
14583 selection: query,
14584 graphql_client: self.graphql_client.clone(),
14585 }
14586 }
14587 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14595 let mut query = self.selection.select("sourceMap");
14596 query = query.arg("filename", filename.into());
14597 query = query.arg("line", line);
14598 query = query.arg("column", column);
14599 SourceMap {
14600 proc: self.proc.clone(),
14601 selection: query,
14602 graphql_client: self.graphql_client.clone(),
14603 }
14604 }
14605 pub fn type_def(&self) -> TypeDef {
14607 let query = self.selection.select("typeDef");
14608 TypeDef {
14609 proc: self.proc.clone(),
14610 selection: query,
14611 graphql_client: self.graphql_client.clone(),
14612 }
14613 }
14614 pub async fn version(&self) -> Result<String, DaggerError> {
14616 let query = self.selection.select("version");
14617 query.execute(self.graphql_client.clone()).await
14618 }
14619}
14620impl Node for Query {
14621 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14622 let query = self.selection.select("id");
14623 let graphql_client = self.graphql_client.clone();
14624 async move { query.execute(graphql_client).await }
14625 }
14626}
14627#[derive(Clone)]
14628pub struct RemoteGitMirror {
14629 pub proc: Option<Arc<DaggerSessionProc>>,
14630 pub selection: Selection,
14631 pub graphql_client: DynGraphQLClient,
14632}
14633impl IntoID<Id> for RemoteGitMirror {
14634 fn into_id(
14635 self,
14636 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14637 Box::pin(async move { self.id().await })
14638 }
14639}
14640impl Loadable for RemoteGitMirror {
14641 fn graphql_type() -> &'static str {
14642 "RemoteGitMirror"
14643 }
14644 fn from_query(
14645 proc: Option<Arc<DaggerSessionProc>>,
14646 selection: Selection,
14647 graphql_client: DynGraphQLClient,
14648 ) -> Self {
14649 Self {
14650 proc,
14651 selection,
14652 graphql_client,
14653 }
14654 }
14655}
14656impl RemoteGitMirror {
14657 pub async fn id(&self) -> Result<Id, DaggerError> {
14659 let query = self.selection.select("id");
14660 query.execute(self.graphql_client.clone()).await
14661 }
14662}
14663impl Node for RemoteGitMirror {
14664 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14665 let query = self.selection.select("id");
14666 let graphql_client = self.graphql_client.clone();
14667 async move { query.execute(graphql_client).await }
14668 }
14669}
14670#[derive(Clone)]
14671pub struct SdkConfig {
14672 pub proc: Option<Arc<DaggerSessionProc>>,
14673 pub selection: Selection,
14674 pub graphql_client: DynGraphQLClient,
14675}
14676impl IntoID<Id> for SdkConfig {
14677 fn into_id(
14678 self,
14679 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14680 Box::pin(async move { self.id().await })
14681 }
14682}
14683impl Loadable for SdkConfig {
14684 fn graphql_type() -> &'static str {
14685 "SDKConfig"
14686 }
14687 fn from_query(
14688 proc: Option<Arc<DaggerSessionProc>>,
14689 selection: Selection,
14690 graphql_client: DynGraphQLClient,
14691 ) -> Self {
14692 Self {
14693 proc,
14694 selection,
14695 graphql_client,
14696 }
14697 }
14698}
14699impl SdkConfig {
14700 pub async fn debug(&self) -> Result<bool, DaggerError> {
14702 let query = self.selection.select("debug");
14703 query.execute(self.graphql_client.clone()).await
14704 }
14705 pub async fn id(&self) -> Result<Id, DaggerError> {
14707 let query = self.selection.select("id");
14708 query.execute(self.graphql_client.clone()).await
14709 }
14710 pub async fn source(&self) -> Result<String, DaggerError> {
14712 let query = self.selection.select("source");
14713 query.execute(self.graphql_client.clone()).await
14714 }
14715}
14716impl Node for SdkConfig {
14717 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14718 let query = self.selection.select("id");
14719 let graphql_client = self.graphql_client.clone();
14720 async move { query.execute(graphql_client).await }
14721 }
14722}
14723#[derive(Clone)]
14724pub struct ScalarTypeDef {
14725 pub proc: Option<Arc<DaggerSessionProc>>,
14726 pub selection: Selection,
14727 pub graphql_client: DynGraphQLClient,
14728}
14729impl IntoID<Id> for ScalarTypeDef {
14730 fn into_id(
14731 self,
14732 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14733 Box::pin(async move { self.id().await })
14734 }
14735}
14736impl Loadable for ScalarTypeDef {
14737 fn graphql_type() -> &'static str {
14738 "ScalarTypeDef"
14739 }
14740 fn from_query(
14741 proc: Option<Arc<DaggerSessionProc>>,
14742 selection: Selection,
14743 graphql_client: DynGraphQLClient,
14744 ) -> Self {
14745 Self {
14746 proc,
14747 selection,
14748 graphql_client,
14749 }
14750 }
14751}
14752impl ScalarTypeDef {
14753 pub async fn description(&self) -> Result<String, DaggerError> {
14755 let query = self.selection.select("description");
14756 query.execute(self.graphql_client.clone()).await
14757 }
14758 pub async fn id(&self) -> Result<Id, DaggerError> {
14760 let query = self.selection.select("id");
14761 query.execute(self.graphql_client.clone()).await
14762 }
14763 pub async fn name(&self) -> Result<String, DaggerError> {
14765 let query = self.selection.select("name");
14766 query.execute(self.graphql_client.clone()).await
14767 }
14768 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14770 let query = self.selection.select("sourceModuleName");
14771 query.execute(self.graphql_client.clone()).await
14772 }
14773}
14774impl Node for ScalarTypeDef {
14775 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14776 let query = self.selection.select("id");
14777 let graphql_client = self.graphql_client.clone();
14778 async move { query.execute(graphql_client).await }
14779 }
14780}
14781#[derive(Clone)]
14782pub struct SearchResult {
14783 pub proc: Option<Arc<DaggerSessionProc>>,
14784 pub selection: Selection,
14785 pub graphql_client: DynGraphQLClient,
14786}
14787impl IntoID<Id> for SearchResult {
14788 fn into_id(
14789 self,
14790 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14791 Box::pin(async move { self.id().await })
14792 }
14793}
14794impl Loadable for SearchResult {
14795 fn graphql_type() -> &'static str {
14796 "SearchResult"
14797 }
14798 fn from_query(
14799 proc: Option<Arc<DaggerSessionProc>>,
14800 selection: Selection,
14801 graphql_client: DynGraphQLClient,
14802 ) -> Self {
14803 Self {
14804 proc,
14805 selection,
14806 graphql_client,
14807 }
14808 }
14809}
14810impl SearchResult {
14811 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14813 let query = self.selection.select("absoluteOffset");
14814 query.execute(self.graphql_client.clone()).await
14815 }
14816 pub async fn file_path(&self) -> Result<String, DaggerError> {
14818 let query = self.selection.select("filePath");
14819 query.execute(self.graphql_client.clone()).await
14820 }
14821 pub async fn id(&self) -> Result<Id, DaggerError> {
14823 let query = self.selection.select("id");
14824 query.execute(self.graphql_client.clone()).await
14825 }
14826 pub async fn line_number(&self) -> Result<isize, DaggerError> {
14828 let query = self.selection.select("lineNumber");
14829 query.execute(self.graphql_client.clone()).await
14830 }
14831 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14833 let query = self.selection.select("matchedLines");
14834 query.execute(self.graphql_client.clone()).await
14835 }
14836 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14838 let query = self.selection.select("submatches");
14839 let query = query.select("id");
14840 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14841 Ok(ids
14842 .into_iter()
14843 .map(|id| SearchSubmatch {
14844 proc: self.proc.clone(),
14845 selection: crate::querybuilder::query()
14846 .select("node")
14847 .arg("id", &id.0)
14848 .inline_fragment("SearchSubmatch"),
14849 graphql_client: self.graphql_client.clone(),
14850 })
14851 .collect())
14852 }
14853}
14854impl Node for SearchResult {
14855 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14856 let query = self.selection.select("id");
14857 let graphql_client = self.graphql_client.clone();
14858 async move { query.execute(graphql_client).await }
14859 }
14860}
14861#[derive(Clone)]
14862pub struct SearchSubmatch {
14863 pub proc: Option<Arc<DaggerSessionProc>>,
14864 pub selection: Selection,
14865 pub graphql_client: DynGraphQLClient,
14866}
14867impl IntoID<Id> for SearchSubmatch {
14868 fn into_id(
14869 self,
14870 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14871 Box::pin(async move { self.id().await })
14872 }
14873}
14874impl Loadable for SearchSubmatch {
14875 fn graphql_type() -> &'static str {
14876 "SearchSubmatch"
14877 }
14878 fn from_query(
14879 proc: Option<Arc<DaggerSessionProc>>,
14880 selection: Selection,
14881 graphql_client: DynGraphQLClient,
14882 ) -> Self {
14883 Self {
14884 proc,
14885 selection,
14886 graphql_client,
14887 }
14888 }
14889}
14890impl SearchSubmatch {
14891 pub async fn end(&self) -> Result<isize, DaggerError> {
14893 let query = self.selection.select("end");
14894 query.execute(self.graphql_client.clone()).await
14895 }
14896 pub async fn id(&self) -> Result<Id, DaggerError> {
14898 let query = self.selection.select("id");
14899 query.execute(self.graphql_client.clone()).await
14900 }
14901 pub async fn start(&self) -> Result<isize, DaggerError> {
14903 let query = self.selection.select("start");
14904 query.execute(self.graphql_client.clone()).await
14905 }
14906 pub async fn text(&self) -> Result<String, DaggerError> {
14908 let query = self.selection.select("text");
14909 query.execute(self.graphql_client.clone()).await
14910 }
14911}
14912impl Node for SearchSubmatch {
14913 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14914 let query = self.selection.select("id");
14915 let graphql_client = self.graphql_client.clone();
14916 async move { query.execute(graphql_client).await }
14917 }
14918}
14919#[derive(Clone)]
14920pub struct Secret {
14921 pub proc: Option<Arc<DaggerSessionProc>>,
14922 pub selection: Selection,
14923 pub graphql_client: DynGraphQLClient,
14924}
14925impl IntoID<Id> for Secret {
14926 fn into_id(
14927 self,
14928 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14929 Box::pin(async move { self.id().await })
14930 }
14931}
14932impl Loadable for Secret {
14933 fn graphql_type() -> &'static str {
14934 "Secret"
14935 }
14936 fn from_query(
14937 proc: Option<Arc<DaggerSessionProc>>,
14938 selection: Selection,
14939 graphql_client: DynGraphQLClient,
14940 ) -> Self {
14941 Self {
14942 proc,
14943 selection,
14944 graphql_client,
14945 }
14946 }
14947}
14948impl Secret {
14949 pub async fn id(&self) -> Result<Id, DaggerError> {
14951 let query = self.selection.select("id");
14952 query.execute(self.graphql_client.clone()).await
14953 }
14954 pub async fn name(&self) -> Result<String, DaggerError> {
14956 let query = self.selection.select("name");
14957 query.execute(self.graphql_client.clone()).await
14958 }
14959 pub async fn plaintext(&self) -> Result<String, DaggerError> {
14961 let query = self.selection.select("plaintext");
14962 query.execute(self.graphql_client.clone()).await
14963 }
14964 pub async fn uri(&self) -> Result<String, DaggerError> {
14966 let query = self.selection.select("uri");
14967 query.execute(self.graphql_client.clone()).await
14968 }
14969}
14970impl Node for Secret {
14971 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14972 let query = self.selection.select("id");
14973 let graphql_client = self.graphql_client.clone();
14974 async move { query.execute(graphql_client).await }
14975 }
14976}
14977#[derive(Clone)]
14978pub struct Service {
14979 pub proc: Option<Arc<DaggerSessionProc>>,
14980 pub selection: Selection,
14981 pub graphql_client: DynGraphQLClient,
14982}
14983#[derive(Builder, Debug, PartialEq)]
14984pub struct ServiceEndpointOpts<'a> {
14985 #[builder(setter(into, strip_option), default)]
14987 pub port: Option<isize>,
14988 #[builder(setter(into, strip_option), default)]
14990 pub scheme: Option<&'a str>,
14991}
14992#[derive(Builder, Debug, PartialEq)]
14993pub struct ServiceStopOpts {
14994 #[builder(setter(into, strip_option), default)]
14996 pub kill: Option<bool>,
14997}
14998#[derive(Builder, Debug, PartialEq)]
14999pub struct ServiceTerminalOpts<'a> {
15000 #[builder(setter(into, strip_option), default)]
15001 pub cmd: Option<Vec<&'a str>>,
15002}
15003#[derive(Builder, Debug, PartialEq)]
15004pub struct ServiceUpOpts {
15005 #[builder(setter(into, strip_option), default)]
15008 pub ports: Option<Vec<PortForward>>,
15009 #[builder(setter(into, strip_option), default)]
15011 pub random: Option<bool>,
15012}
15013impl IntoID<Id> for Service {
15014 fn into_id(
15015 self,
15016 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15017 Box::pin(async move { self.id().await })
15018 }
15019}
15020impl Loadable for Service {
15021 fn graphql_type() -> &'static str {
15022 "Service"
15023 }
15024 fn from_query(
15025 proc: Option<Arc<DaggerSessionProc>>,
15026 selection: Selection,
15027 graphql_client: DynGraphQLClient,
15028 ) -> Self {
15029 Self {
15030 proc,
15031 selection,
15032 graphql_client,
15033 }
15034 }
15035}
15036impl Service {
15037 pub async fn endpoint(&self) -> Result<String, DaggerError> {
15045 let query = self.selection.select("endpoint");
15046 query.execute(self.graphql_client.clone()).await
15047 }
15048 pub async fn endpoint_opts<'a>(
15056 &self,
15057 opts: ServiceEndpointOpts<'a>,
15058 ) -> Result<String, DaggerError> {
15059 let mut query = self.selection.select("endpoint");
15060 if let Some(port) = opts.port {
15061 query = query.arg("port", port);
15062 }
15063 if let Some(scheme) = opts.scheme {
15064 query = query.arg("scheme", scheme);
15065 }
15066 query.execute(self.graphql_client.clone()).await
15067 }
15068 pub async fn hostname(&self) -> Result<String, DaggerError> {
15070 let query = self.selection.select("hostname");
15071 query.execute(self.graphql_client.clone()).await
15072 }
15073 pub async fn id(&self) -> Result<Id, DaggerError> {
15075 let query = self.selection.select("id");
15076 query.execute(self.graphql_client.clone()).await
15077 }
15078 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15080 let query = self.selection.select("ports");
15081 let query = query.select("id");
15082 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15083 Ok(ids
15084 .into_iter()
15085 .map(|id| Port {
15086 proc: self.proc.clone(),
15087 selection: crate::querybuilder::query()
15088 .select("node")
15089 .arg("id", &id.0)
15090 .inline_fragment("Port"),
15091 graphql_client: self.graphql_client.clone(),
15092 })
15093 .collect())
15094 }
15095 pub async fn start(&self) -> Result<Service, DaggerError> {
15098 let query = self.selection.select("start");
15099 let id: Id = query.execute(self.graphql_client.clone()).await?;
15100 Ok(Service {
15101 proc: self.proc.clone(),
15102 selection: query
15103 .root()
15104 .select("node")
15105 .arg("id", &id.0)
15106 .inline_fragment("Service"),
15107 graphql_client: self.graphql_client.clone(),
15108 })
15109 }
15110 pub async fn stop(&self) -> Result<Service, DaggerError> {
15116 let query = self.selection.select("stop");
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 async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15134 let mut query = self.selection.select("stop");
15135 if let Some(kill) = opts.kill {
15136 query = query.arg("kill", kill);
15137 }
15138 let id: Id = query.execute(self.graphql_client.clone()).await?;
15139 Ok(Service {
15140 proc: self.proc.clone(),
15141 selection: query
15142 .root()
15143 .select("node")
15144 .arg("id", &id.0)
15145 .inline_fragment("Service"),
15146 graphql_client: self.graphql_client.clone(),
15147 })
15148 }
15149 pub async fn sync(&self) -> Result<Service, DaggerError> {
15151 let query = self.selection.select("sync");
15152 let id: Id = query.execute(self.graphql_client.clone()).await?;
15153 Ok(Service {
15154 proc: self.proc.clone(),
15155 selection: query
15156 .root()
15157 .select("node")
15158 .arg("id", &id.0)
15159 .inline_fragment("Service"),
15160 graphql_client: self.graphql_client.clone(),
15161 })
15162 }
15163 pub fn terminal(&self) -> Service {
15168 let query = self.selection.select("terminal");
15169 Service {
15170 proc: self.proc.clone(),
15171 selection: query,
15172 graphql_client: self.graphql_client.clone(),
15173 }
15174 }
15175 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15180 let mut query = self.selection.select("terminal");
15181 if let Some(cmd) = opts.cmd {
15182 query = query.arg("cmd", cmd);
15183 }
15184 Service {
15185 proc: self.proc.clone(),
15186 selection: query,
15187 graphql_client: self.graphql_client.clone(),
15188 }
15189 }
15190 pub async fn up(&self) -> Result<Void, DaggerError> {
15196 let query = self.selection.select("up");
15197 query.execute(self.graphql_client.clone()).await
15198 }
15199 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15205 let mut query = self.selection.select("up");
15206 if let Some(ports) = opts.ports {
15207 query = query.arg("ports", ports);
15208 }
15209 if let Some(random) = opts.random {
15210 query = query.arg("random", random);
15211 }
15212 query.execute(self.graphql_client.clone()).await
15213 }
15214 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15220 let mut query = self.selection.select("withHostname");
15221 query = query.arg("hostname", hostname.into());
15222 Service {
15223 proc: self.proc.clone(),
15224 selection: query,
15225 graphql_client: self.graphql_client.clone(),
15226 }
15227 }
15228}
15229impl Node for Service {
15230 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15231 let query = self.selection.select("id");
15232 let graphql_client = self.graphql_client.clone();
15233 async move { query.execute(graphql_client).await }
15234 }
15235}
15236impl Syncer for Service {
15237 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15238 let query = self.selection.select("id");
15239 let graphql_client = self.graphql_client.clone();
15240 async move { query.execute(graphql_client).await }
15241 }
15242 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15243 let query = self.selection.select("sync");
15244 let graphql_client = self.graphql_client.clone();
15245 async move { query.execute(graphql_client).await }
15246 }
15247}
15248#[derive(Clone)]
15249pub struct Socket {
15250 pub proc: Option<Arc<DaggerSessionProc>>,
15251 pub selection: Selection,
15252 pub graphql_client: DynGraphQLClient,
15253}
15254impl IntoID<Id> for Socket {
15255 fn into_id(
15256 self,
15257 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15258 Box::pin(async move { self.id().await })
15259 }
15260}
15261impl Loadable for Socket {
15262 fn graphql_type() -> &'static str {
15263 "Socket"
15264 }
15265 fn from_query(
15266 proc: Option<Arc<DaggerSessionProc>>,
15267 selection: Selection,
15268 graphql_client: DynGraphQLClient,
15269 ) -> Self {
15270 Self {
15271 proc,
15272 selection,
15273 graphql_client,
15274 }
15275 }
15276}
15277impl Socket {
15278 pub async fn id(&self) -> Result<Id, DaggerError> {
15280 let query = self.selection.select("id");
15281 query.execute(self.graphql_client.clone()).await
15282 }
15283}
15284impl Node for Socket {
15285 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15286 let query = self.selection.select("id");
15287 let graphql_client = self.graphql_client.clone();
15288 async move { query.execute(graphql_client).await }
15289 }
15290}
15291#[derive(Clone)]
15292pub struct SourceMap {
15293 pub proc: Option<Arc<DaggerSessionProc>>,
15294 pub selection: Selection,
15295 pub graphql_client: DynGraphQLClient,
15296}
15297impl IntoID<Id> for SourceMap {
15298 fn into_id(
15299 self,
15300 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15301 Box::pin(async move { self.id().await })
15302 }
15303}
15304impl Loadable for SourceMap {
15305 fn graphql_type() -> &'static str {
15306 "SourceMap"
15307 }
15308 fn from_query(
15309 proc: Option<Arc<DaggerSessionProc>>,
15310 selection: Selection,
15311 graphql_client: DynGraphQLClient,
15312 ) -> Self {
15313 Self {
15314 proc,
15315 selection,
15316 graphql_client,
15317 }
15318 }
15319}
15320impl SourceMap {
15321 pub async fn column(&self) -> Result<isize, DaggerError> {
15323 let query = self.selection.select("column");
15324 query.execute(self.graphql_client.clone()).await
15325 }
15326 pub async fn filename(&self) -> Result<String, DaggerError> {
15328 let query = self.selection.select("filename");
15329 query.execute(self.graphql_client.clone()).await
15330 }
15331 pub async fn id(&self) -> Result<Id, DaggerError> {
15333 let query = self.selection.select("id");
15334 query.execute(self.graphql_client.clone()).await
15335 }
15336 pub async fn line(&self) -> Result<isize, DaggerError> {
15338 let query = self.selection.select("line");
15339 query.execute(self.graphql_client.clone()).await
15340 }
15341 pub async fn module(&self) -> Result<String, DaggerError> {
15343 let query = self.selection.select("module");
15344 query.execute(self.graphql_client.clone()).await
15345 }
15346 pub async fn url(&self) -> Result<String, DaggerError> {
15348 let query = self.selection.select("url");
15349 query.execute(self.graphql_client.clone()).await
15350 }
15351}
15352impl Node for SourceMap {
15353 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15354 let query = self.selection.select("id");
15355 let graphql_client = self.graphql_client.clone();
15356 async move { query.execute(graphql_client).await }
15357 }
15358}
15359#[derive(Clone)]
15360pub struct Stat {
15361 pub proc: Option<Arc<DaggerSessionProc>>,
15362 pub selection: Selection,
15363 pub graphql_client: DynGraphQLClient,
15364}
15365impl IntoID<Id> for Stat {
15366 fn into_id(
15367 self,
15368 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15369 Box::pin(async move { self.id().await })
15370 }
15371}
15372impl Loadable for Stat {
15373 fn graphql_type() -> &'static str {
15374 "Stat"
15375 }
15376 fn from_query(
15377 proc: Option<Arc<DaggerSessionProc>>,
15378 selection: Selection,
15379 graphql_client: DynGraphQLClient,
15380 ) -> Self {
15381 Self {
15382 proc,
15383 selection,
15384 graphql_client,
15385 }
15386 }
15387}
15388impl Stat {
15389 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15391 let query = self.selection.select("fileType");
15392 query.execute(self.graphql_client.clone()).await
15393 }
15394 pub async fn id(&self) -> Result<Id, DaggerError> {
15396 let query = self.selection.select("id");
15397 query.execute(self.graphql_client.clone()).await
15398 }
15399 pub async fn name(&self) -> Result<String, DaggerError> {
15401 let query = self.selection.select("name");
15402 query.execute(self.graphql_client.clone()).await
15403 }
15404 pub async fn permissions(&self) -> Result<isize, DaggerError> {
15406 let query = self.selection.select("permissions");
15407 query.execute(self.graphql_client.clone()).await
15408 }
15409 pub async fn size(&self) -> Result<isize, DaggerError> {
15411 let query = self.selection.select("size");
15412 query.execute(self.graphql_client.clone()).await
15413 }
15414}
15415impl Node for Stat {
15416 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15417 let query = self.selection.select("id");
15418 let graphql_client = self.graphql_client.clone();
15419 async move { query.execute(graphql_client).await }
15420 }
15421}
15422#[derive(Clone)]
15423pub struct Terminal {
15424 pub proc: Option<Arc<DaggerSessionProc>>,
15425 pub selection: Selection,
15426 pub graphql_client: DynGraphQLClient,
15427}
15428impl IntoID<Id> for Terminal {
15429 fn into_id(
15430 self,
15431 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15432 Box::pin(async move { self.id().await })
15433 }
15434}
15435impl Loadable for Terminal {
15436 fn graphql_type() -> &'static str {
15437 "Terminal"
15438 }
15439 fn from_query(
15440 proc: Option<Arc<DaggerSessionProc>>,
15441 selection: Selection,
15442 graphql_client: DynGraphQLClient,
15443 ) -> Self {
15444 Self {
15445 proc,
15446 selection,
15447 graphql_client,
15448 }
15449 }
15450}
15451impl Terminal {
15452 pub async fn id(&self) -> Result<Id, DaggerError> {
15454 let query = self.selection.select("id");
15455 query.execute(self.graphql_client.clone()).await
15456 }
15457 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15460 let query = self.selection.select("sync");
15461 let id: Id = query.execute(self.graphql_client.clone()).await?;
15462 Ok(Terminal {
15463 proc: self.proc.clone(),
15464 selection: query
15465 .root()
15466 .select("node")
15467 .arg("id", &id.0)
15468 .inline_fragment("Terminal"),
15469 graphql_client: self.graphql_client.clone(),
15470 })
15471 }
15472}
15473impl Node for Terminal {
15474 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15475 let query = self.selection.select("id");
15476 let graphql_client = self.graphql_client.clone();
15477 async move { query.execute(graphql_client).await }
15478 }
15479}
15480impl Syncer for Terminal {
15481 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15482 let query = self.selection.select("id");
15483 let graphql_client = self.graphql_client.clone();
15484 async move { query.execute(graphql_client).await }
15485 }
15486 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15487 let query = self.selection.select("sync");
15488 let graphql_client = self.graphql_client.clone();
15489 async move { query.execute(graphql_client).await }
15490 }
15491}
15492#[derive(Clone)]
15493pub struct TypeDef {
15494 pub proc: Option<Arc<DaggerSessionProc>>,
15495 pub selection: Selection,
15496 pub graphql_client: DynGraphQLClient,
15497}
15498#[derive(Builder, Debug, PartialEq)]
15499pub struct TypeDefWithEnumOpts<'a> {
15500 #[builder(setter(into, strip_option), default)]
15502 pub description: Option<&'a str>,
15503 #[builder(setter(into, strip_option), default)]
15505 pub source_map: Option<Id>,
15506}
15507#[derive(Builder, Debug, PartialEq)]
15508pub struct TypeDefWithEnumMemberOpts<'a> {
15509 #[builder(setter(into, strip_option), default)]
15511 pub deprecated: Option<&'a str>,
15512 #[builder(setter(into, strip_option), default)]
15514 pub description: Option<&'a str>,
15515 #[builder(setter(into, strip_option), default)]
15517 pub source_map: Option<Id>,
15518 #[builder(setter(into, strip_option), default)]
15520 pub value: Option<&'a str>,
15521}
15522#[derive(Builder, Debug, PartialEq)]
15523pub struct TypeDefWithEnumValueOpts<'a> {
15524 #[builder(setter(into, strip_option), default)]
15526 pub deprecated: Option<&'a str>,
15527 #[builder(setter(into, strip_option), default)]
15529 pub description: Option<&'a str>,
15530 #[builder(setter(into, strip_option), default)]
15532 pub source_map: Option<Id>,
15533}
15534#[derive(Builder, Debug, PartialEq)]
15535pub struct TypeDefWithFieldOpts<'a> {
15536 #[builder(setter(into, strip_option), default)]
15538 pub deprecated: Option<&'a str>,
15539 #[builder(setter(into, strip_option), default)]
15541 pub description: Option<&'a str>,
15542 #[builder(setter(into, strip_option), default)]
15544 pub source_map: Option<Id>,
15545}
15546#[derive(Builder, Debug, PartialEq)]
15547pub struct TypeDefWithInterfaceOpts<'a> {
15548 #[builder(setter(into, strip_option), default)]
15549 pub description: Option<&'a str>,
15550 #[builder(setter(into, strip_option), default)]
15551 pub source_map: Option<Id>,
15552}
15553#[derive(Builder, Debug, PartialEq)]
15554pub struct TypeDefWithObjectOpts<'a> {
15555 #[builder(setter(into, strip_option), default)]
15556 pub deprecated: Option<&'a str>,
15557 #[builder(setter(into, strip_option), default)]
15558 pub description: Option<&'a str>,
15559 #[builder(setter(into, strip_option), default)]
15560 pub source_map: Option<Id>,
15561}
15562#[derive(Builder, Debug, PartialEq)]
15563pub struct TypeDefWithScalarOpts<'a> {
15564 #[builder(setter(into, strip_option), default)]
15565 pub description: Option<&'a str>,
15566}
15567impl IntoID<Id> for TypeDef {
15568 fn into_id(
15569 self,
15570 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15571 Box::pin(async move { self.id().await })
15572 }
15573}
15574impl Loadable for TypeDef {
15575 fn graphql_type() -> &'static str {
15576 "TypeDef"
15577 }
15578 fn from_query(
15579 proc: Option<Arc<DaggerSessionProc>>,
15580 selection: Selection,
15581 graphql_client: DynGraphQLClient,
15582 ) -> Self {
15583 Self {
15584 proc,
15585 selection,
15586 graphql_client,
15587 }
15588 }
15589}
15590impl TypeDef {
15591 pub fn as_enum(&self) -> EnumTypeDef {
15593 let query = self.selection.select("asEnum");
15594 EnumTypeDef {
15595 proc: self.proc.clone(),
15596 selection: query,
15597 graphql_client: self.graphql_client.clone(),
15598 }
15599 }
15600 pub fn as_input(&self) -> InputTypeDef {
15602 let query = self.selection.select("asInput");
15603 InputTypeDef {
15604 proc: self.proc.clone(),
15605 selection: query,
15606 graphql_client: self.graphql_client.clone(),
15607 }
15608 }
15609 pub fn as_interface(&self) -> InterfaceTypeDef {
15611 let query = self.selection.select("asInterface");
15612 InterfaceTypeDef {
15613 proc: self.proc.clone(),
15614 selection: query,
15615 graphql_client: self.graphql_client.clone(),
15616 }
15617 }
15618 pub fn as_list(&self) -> ListTypeDef {
15620 let query = self.selection.select("asList");
15621 ListTypeDef {
15622 proc: self.proc.clone(),
15623 selection: query,
15624 graphql_client: self.graphql_client.clone(),
15625 }
15626 }
15627 pub fn as_object(&self) -> ObjectTypeDef {
15629 let query = self.selection.select("asObject");
15630 ObjectTypeDef {
15631 proc: self.proc.clone(),
15632 selection: query,
15633 graphql_client: self.graphql_client.clone(),
15634 }
15635 }
15636 pub fn as_scalar(&self) -> ScalarTypeDef {
15638 let query = self.selection.select("asScalar");
15639 ScalarTypeDef {
15640 proc: self.proc.clone(),
15641 selection: query,
15642 graphql_client: self.graphql_client.clone(),
15643 }
15644 }
15645 pub async fn id(&self) -> Result<Id, DaggerError> {
15647 let query = self.selection.select("id");
15648 query.execute(self.graphql_client.clone()).await
15649 }
15650 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15652 let query = self.selection.select("kind");
15653 query.execute(self.graphql_client.clone()).await
15654 }
15655 pub async fn name(&self) -> Result<String, DaggerError> {
15657 let query = self.selection.select("name");
15658 query.execute(self.graphql_client.clone()).await
15659 }
15660 pub async fn optional(&self) -> Result<bool, DaggerError> {
15662 let query = self.selection.select("optional");
15663 query.execute(self.graphql_client.clone()).await
15664 }
15665 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15667 let mut query = self.selection.select("withConstructor");
15668 query = query.arg_lazy(
15669 "function",
15670 Box::new(move || {
15671 let function = function.clone();
15672 Box::pin(async move { function.into_id().await.unwrap().quote() })
15673 }),
15674 );
15675 TypeDef {
15676 proc: self.proc.clone(),
15677 selection: query,
15678 graphql_client: self.graphql_client.clone(),
15679 }
15680 }
15681 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15689 let mut query = self.selection.select("withEnum");
15690 query = query.arg("name", name.into());
15691 TypeDef {
15692 proc: self.proc.clone(),
15693 selection: query,
15694 graphql_client: self.graphql_client.clone(),
15695 }
15696 }
15697 pub fn with_enum_opts<'a>(
15705 &self,
15706 name: impl Into<String>,
15707 opts: TypeDefWithEnumOpts<'a>,
15708 ) -> TypeDef {
15709 let mut query = self.selection.select("withEnum");
15710 query = query.arg("name", name.into());
15711 if let Some(description) = opts.description {
15712 query = query.arg("description", description);
15713 }
15714 if let Some(source_map) = opts.source_map {
15715 query = query.arg("sourceMap", source_map);
15716 }
15717 TypeDef {
15718 proc: self.proc.clone(),
15719 selection: query,
15720 graphql_client: self.graphql_client.clone(),
15721 }
15722 }
15723 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15730 let mut query = self.selection.select("withEnumMember");
15731 query = query.arg("name", name.into());
15732 TypeDef {
15733 proc: self.proc.clone(),
15734 selection: query,
15735 graphql_client: self.graphql_client.clone(),
15736 }
15737 }
15738 pub fn with_enum_member_opts<'a>(
15745 &self,
15746 name: impl Into<String>,
15747 opts: TypeDefWithEnumMemberOpts<'a>,
15748 ) -> TypeDef {
15749 let mut query = self.selection.select("withEnumMember");
15750 query = query.arg("name", name.into());
15751 if let Some(value) = opts.value {
15752 query = query.arg("value", value);
15753 }
15754 if let Some(description) = opts.description {
15755 query = query.arg("description", description);
15756 }
15757 if let Some(source_map) = opts.source_map {
15758 query = query.arg("sourceMap", source_map);
15759 }
15760 if let Some(deprecated) = opts.deprecated {
15761 query = query.arg("deprecated", deprecated);
15762 }
15763 TypeDef {
15764 proc: self.proc.clone(),
15765 selection: query,
15766 graphql_client: self.graphql_client.clone(),
15767 }
15768 }
15769 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15776 let mut query = self.selection.select("withEnumValue");
15777 query = query.arg("value", value.into());
15778 TypeDef {
15779 proc: self.proc.clone(),
15780 selection: query,
15781 graphql_client: self.graphql_client.clone(),
15782 }
15783 }
15784 pub fn with_enum_value_opts<'a>(
15791 &self,
15792 value: impl Into<String>,
15793 opts: TypeDefWithEnumValueOpts<'a>,
15794 ) -> TypeDef {
15795 let mut query = self.selection.select("withEnumValue");
15796 query = query.arg("value", value.into());
15797 if let Some(description) = opts.description {
15798 query = query.arg("description", description);
15799 }
15800 if let Some(source_map) = opts.source_map {
15801 query = query.arg("sourceMap", source_map);
15802 }
15803 if let Some(deprecated) = opts.deprecated {
15804 query = query.arg("deprecated", deprecated);
15805 }
15806 TypeDef {
15807 proc: self.proc.clone(),
15808 selection: query,
15809 graphql_client: self.graphql_client.clone(),
15810 }
15811 }
15812 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
15820 let mut query = self.selection.select("withField");
15821 query = query.arg("name", name.into());
15822 query = query.arg_lazy(
15823 "typeDef",
15824 Box::new(move || {
15825 let type_def = type_def.clone();
15826 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15827 }),
15828 );
15829 TypeDef {
15830 proc: self.proc.clone(),
15831 selection: query,
15832 graphql_client: self.graphql_client.clone(),
15833 }
15834 }
15835 pub fn with_field_opts<'a>(
15843 &self,
15844 name: impl Into<String>,
15845 type_def: impl IntoID<Id>,
15846 opts: TypeDefWithFieldOpts<'a>,
15847 ) -> TypeDef {
15848 let mut query = self.selection.select("withField");
15849 query = query.arg("name", name.into());
15850 query = query.arg_lazy(
15851 "typeDef",
15852 Box::new(move || {
15853 let type_def = type_def.clone();
15854 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15855 }),
15856 );
15857 if let Some(description) = opts.description {
15858 query = query.arg("description", description);
15859 }
15860 if let Some(source_map) = opts.source_map {
15861 query = query.arg("sourceMap", source_map);
15862 }
15863 if let Some(deprecated) = opts.deprecated {
15864 query = query.arg("deprecated", deprecated);
15865 }
15866 TypeDef {
15867 proc: self.proc.clone(),
15868 selection: query,
15869 graphql_client: self.graphql_client.clone(),
15870 }
15871 }
15872 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15874 let mut query = self.selection.select("withFunction");
15875 query = query.arg_lazy(
15876 "function",
15877 Box::new(move || {
15878 let function = function.clone();
15879 Box::pin(async move { function.into_id().await.unwrap().quote() })
15880 }),
15881 );
15882 TypeDef {
15883 proc: self.proc.clone(),
15884 selection: query,
15885 graphql_client: self.graphql_client.clone(),
15886 }
15887 }
15888 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15894 let mut query = self.selection.select("withInterface");
15895 query = query.arg("name", name.into());
15896 TypeDef {
15897 proc: self.proc.clone(),
15898 selection: query,
15899 graphql_client: self.graphql_client.clone(),
15900 }
15901 }
15902 pub fn with_interface_opts<'a>(
15908 &self,
15909 name: impl Into<String>,
15910 opts: TypeDefWithInterfaceOpts<'a>,
15911 ) -> TypeDef {
15912 let mut query = self.selection.select("withInterface");
15913 query = query.arg("name", name.into());
15914 if let Some(description) = opts.description {
15915 query = query.arg("description", description);
15916 }
15917 if let Some(source_map) = opts.source_map {
15918 query = query.arg("sourceMap", source_map);
15919 }
15920 TypeDef {
15921 proc: self.proc.clone(),
15922 selection: query,
15923 graphql_client: self.graphql_client.clone(),
15924 }
15925 }
15926 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15928 let mut query = self.selection.select("withKind");
15929 query = query.arg("kind", kind);
15930 TypeDef {
15931 proc: self.proc.clone(),
15932 selection: query,
15933 graphql_client: self.graphql_client.clone(),
15934 }
15935 }
15936 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15938 let mut query = self.selection.select("withListOf");
15939 query = query.arg_lazy(
15940 "elementType",
15941 Box::new(move || {
15942 let element_type = element_type.clone();
15943 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15944 }),
15945 );
15946 TypeDef {
15947 proc: self.proc.clone(),
15948 selection: query,
15949 graphql_client: self.graphql_client.clone(),
15950 }
15951 }
15952 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15959 let mut query = self.selection.select("withObject");
15960 query = query.arg("name", name.into());
15961 TypeDef {
15962 proc: self.proc.clone(),
15963 selection: query,
15964 graphql_client: self.graphql_client.clone(),
15965 }
15966 }
15967 pub fn with_object_opts<'a>(
15974 &self,
15975 name: impl Into<String>,
15976 opts: TypeDefWithObjectOpts<'a>,
15977 ) -> TypeDef {
15978 let mut query = self.selection.select("withObject");
15979 query = query.arg("name", name.into());
15980 if let Some(description) = opts.description {
15981 query = query.arg("description", description);
15982 }
15983 if let Some(source_map) = opts.source_map {
15984 query = query.arg("sourceMap", source_map);
15985 }
15986 if let Some(deprecated) = opts.deprecated {
15987 query = query.arg("deprecated", deprecated);
15988 }
15989 TypeDef {
15990 proc: self.proc.clone(),
15991 selection: query,
15992 graphql_client: self.graphql_client.clone(),
15993 }
15994 }
15995 pub fn with_optional(&self, optional: bool) -> TypeDef {
15997 let mut query = self.selection.select("withOptional");
15998 query = query.arg("optional", optional);
15999 TypeDef {
16000 proc: self.proc.clone(),
16001 selection: query,
16002 graphql_client: self.graphql_client.clone(),
16003 }
16004 }
16005 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16011 let mut query = self.selection.select("withScalar");
16012 query = query.arg("name", name.into());
16013 TypeDef {
16014 proc: self.proc.clone(),
16015 selection: query,
16016 graphql_client: self.graphql_client.clone(),
16017 }
16018 }
16019 pub fn with_scalar_opts<'a>(
16025 &self,
16026 name: impl Into<String>,
16027 opts: TypeDefWithScalarOpts<'a>,
16028 ) -> TypeDef {
16029 let mut query = self.selection.select("withScalar");
16030 query = query.arg("name", name.into());
16031 if let Some(description) = opts.description {
16032 query = query.arg("description", description);
16033 }
16034 TypeDef {
16035 proc: self.proc.clone(),
16036 selection: query,
16037 graphql_client: self.graphql_client.clone(),
16038 }
16039 }
16040}
16041impl Node for TypeDef {
16042 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16043 let query = self.selection.select("id");
16044 let graphql_client = self.graphql_client.clone();
16045 async move { query.execute(graphql_client).await }
16046 }
16047}
16048#[derive(Clone)]
16049pub struct Up {
16050 pub proc: Option<Arc<DaggerSessionProc>>,
16051 pub selection: Selection,
16052 pub graphql_client: DynGraphQLClient,
16053}
16054impl IntoID<Id> for Up {
16055 fn into_id(
16056 self,
16057 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16058 Box::pin(async move { self.id().await })
16059 }
16060}
16061impl Loadable for Up {
16062 fn graphql_type() -> &'static str {
16063 "Up"
16064 }
16065 fn from_query(
16066 proc: Option<Arc<DaggerSessionProc>>,
16067 selection: Selection,
16068 graphql_client: DynGraphQLClient,
16069 ) -> Self {
16070 Self {
16071 proc,
16072 selection,
16073 graphql_client,
16074 }
16075 }
16076}
16077impl Up {
16078 pub async fn description(&self) -> Result<String, DaggerError> {
16080 let query = self.selection.select("description");
16081 query.execute(self.graphql_client.clone()).await
16082 }
16083 pub async fn id(&self) -> Result<Id, DaggerError> {
16085 let query = self.selection.select("id");
16086 query.execute(self.graphql_client.clone()).await
16087 }
16088 pub async fn name(&self) -> Result<String, DaggerError> {
16090 let query = self.selection.select("name");
16091 query.execute(self.graphql_client.clone()).await
16092 }
16093 pub fn original_module(&self) -> Module {
16095 let query = self.selection.select("originalModule");
16096 Module {
16097 proc: self.proc.clone(),
16098 selection: query,
16099 graphql_client: self.graphql_client.clone(),
16100 }
16101 }
16102 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16104 let query = self.selection.select("path");
16105 query.execute(self.graphql_client.clone()).await
16106 }
16107 pub fn run(&self) -> Up {
16109 let query = self.selection.select("run");
16110 Up {
16111 proc: self.proc.clone(),
16112 selection: query,
16113 graphql_client: self.graphql_client.clone(),
16114 }
16115 }
16116}
16117impl Node for Up {
16118 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16119 let query = self.selection.select("id");
16120 let graphql_client = self.graphql_client.clone();
16121 async move { query.execute(graphql_client).await }
16122 }
16123}
16124#[derive(Clone)]
16125pub struct UpGroup {
16126 pub proc: Option<Arc<DaggerSessionProc>>,
16127 pub selection: Selection,
16128 pub graphql_client: DynGraphQLClient,
16129}
16130impl IntoID<Id> for UpGroup {
16131 fn into_id(
16132 self,
16133 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16134 Box::pin(async move { self.id().await })
16135 }
16136}
16137impl Loadable for UpGroup {
16138 fn graphql_type() -> &'static str {
16139 "UpGroup"
16140 }
16141 fn from_query(
16142 proc: Option<Arc<DaggerSessionProc>>,
16143 selection: Selection,
16144 graphql_client: DynGraphQLClient,
16145 ) -> Self {
16146 Self {
16147 proc,
16148 selection,
16149 graphql_client,
16150 }
16151 }
16152}
16153impl UpGroup {
16154 pub async fn id(&self) -> Result<Id, DaggerError> {
16156 let query = self.selection.select("id");
16157 query.execute(self.graphql_client.clone()).await
16158 }
16159 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16161 let query = self.selection.select("list");
16162 let query = query.select("id");
16163 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16164 Ok(ids
16165 .into_iter()
16166 .map(|id| Up {
16167 proc: self.proc.clone(),
16168 selection: crate::querybuilder::query()
16169 .select("node")
16170 .arg("id", &id.0)
16171 .inline_fragment("Up"),
16172 graphql_client: self.graphql_client.clone(),
16173 })
16174 .collect())
16175 }
16176 pub fn run(&self) -> UpGroup {
16178 let query = self.selection.select("run");
16179 UpGroup {
16180 proc: self.proc.clone(),
16181 selection: query,
16182 graphql_client: self.graphql_client.clone(),
16183 }
16184 }
16185}
16186impl Node for UpGroup {
16187 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16188 let query = self.selection.select("id");
16189 let graphql_client = self.graphql_client.clone();
16190 async move { query.execute(graphql_client).await }
16191 }
16192}
16193#[derive(Clone)]
16194pub struct Workspace {
16195 pub proc: Option<Arc<DaggerSessionProc>>,
16196 pub selection: Selection,
16197 pub graphql_client: DynGraphQLClient,
16198}
16199#[derive(Builder, Debug, PartialEq)]
16200pub struct WorkspaceChecksOpts<'a> {
16201 #[builder(setter(into, strip_option), default)]
16203 pub include: Option<Vec<&'a str>>,
16204 #[builder(setter(into, strip_option), default)]
16206 pub no_generate: Option<bool>,
16207 #[builder(setter(into, strip_option), default)]
16209 pub only_generate: Option<bool>,
16210}
16211#[derive(Builder, Debug, PartialEq)]
16212pub struct WorkspaceDirectoryOpts<'a> {
16213 #[builder(setter(into, strip_option), default)]
16215 pub exclude: Option<Vec<&'a str>>,
16216 #[builder(setter(into, strip_option), default)]
16218 pub gitignore: Option<bool>,
16219 #[builder(setter(into, strip_option), default)]
16221 pub include: Option<Vec<&'a str>>,
16222}
16223#[derive(Builder, Debug, PartialEq)]
16224pub struct WorkspaceFindUpOpts<'a> {
16225 #[builder(setter(into, strip_option), default)]
16227 pub from: Option<&'a str>,
16228}
16229#[derive(Builder, Debug, PartialEq)]
16230pub struct WorkspaceGeneratorsOpts<'a> {
16231 #[builder(setter(into, strip_option), default)]
16233 pub include: Option<Vec<&'a str>>,
16234}
16235#[derive(Builder, Debug, PartialEq)]
16236pub struct WorkspaceServicesOpts<'a> {
16237 #[builder(setter(into, strip_option), default)]
16239 pub include: Option<Vec<&'a str>>,
16240}
16241impl IntoID<Id> for Workspace {
16242 fn into_id(
16243 self,
16244 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16245 Box::pin(async move { self.id().await })
16246 }
16247}
16248impl Loadable for Workspace {
16249 fn graphql_type() -> &'static str {
16250 "Workspace"
16251 }
16252 fn from_query(
16253 proc: Option<Arc<DaggerSessionProc>>,
16254 selection: Selection,
16255 graphql_client: DynGraphQLClient,
16256 ) -> Self {
16257 Self {
16258 proc,
16259 selection,
16260 graphql_client,
16261 }
16262 }
16263}
16264impl Workspace {
16265 pub async fn address(&self) -> Result<String, DaggerError> {
16267 let query = self.selection.select("address");
16268 query.execute(self.graphql_client.clone()).await
16269 }
16270 pub fn checks(&self) -> CheckGroup {
16276 let query = self.selection.select("checks");
16277 CheckGroup {
16278 proc: self.proc.clone(),
16279 selection: query,
16280 graphql_client: self.graphql_client.clone(),
16281 }
16282 }
16283 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16289 let mut query = self.selection.select("checks");
16290 if let Some(include) = opts.include {
16291 query = query.arg("include", include);
16292 }
16293 if let Some(no_generate) = opts.no_generate {
16294 query = query.arg("noGenerate", no_generate);
16295 }
16296 if let Some(only_generate) = opts.only_generate {
16297 query = query.arg("onlyGenerate", only_generate);
16298 }
16299 CheckGroup {
16300 proc: self.proc.clone(),
16301 selection: query,
16302 graphql_client: self.graphql_client.clone(),
16303 }
16304 }
16305 pub async fn client_id(&self) -> Result<String, DaggerError> {
16307 let query = self.selection.select("clientId");
16308 query.execute(self.graphql_client.clone()).await
16309 }
16310 pub async fn config_path(&self) -> Result<String, DaggerError> {
16312 let query = self.selection.select("configPath");
16313 query.execute(self.graphql_client.clone()).await
16314 }
16315 pub fn directory(&self, path: impl Into<String>) -> Directory {
16323 let mut query = self.selection.select("directory");
16324 query = query.arg("path", path.into());
16325 Directory {
16326 proc: self.proc.clone(),
16327 selection: query,
16328 graphql_client: self.graphql_client.clone(),
16329 }
16330 }
16331 pub fn directory_opts<'a>(
16339 &self,
16340 path: impl Into<String>,
16341 opts: WorkspaceDirectoryOpts<'a>,
16342 ) -> Directory {
16343 let mut query = self.selection.select("directory");
16344 query = query.arg("path", path.into());
16345 if let Some(exclude) = opts.exclude {
16346 query = query.arg("exclude", exclude);
16347 }
16348 if let Some(include) = opts.include {
16349 query = query.arg("include", include);
16350 }
16351 if let Some(gitignore) = opts.gitignore {
16352 query = query.arg("gitignore", gitignore);
16353 }
16354 Directory {
16355 proc: self.proc.clone(),
16356 selection: query,
16357 graphql_client: self.graphql_client.clone(),
16358 }
16359 }
16360 pub fn file(&self, path: impl Into<String>) -> File {
16367 let mut query = self.selection.select("file");
16368 query = query.arg("path", path.into());
16369 File {
16370 proc: self.proc.clone(),
16371 selection: query,
16372 graphql_client: self.graphql_client.clone(),
16373 }
16374 }
16375 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16385 let mut query = self.selection.select("findUp");
16386 query = query.arg("name", name.into());
16387 query.execute(self.graphql_client.clone()).await
16388 }
16389 pub async fn find_up_opts<'a>(
16399 &self,
16400 name: impl Into<String>,
16401 opts: WorkspaceFindUpOpts<'a>,
16402 ) -> Result<String, DaggerError> {
16403 let mut query = self.selection.select("findUp");
16404 query = query.arg("name", name.into());
16405 if let Some(from) = opts.from {
16406 query = query.arg("from", from);
16407 }
16408 query.execute(self.graphql_client.clone()).await
16409 }
16410 pub fn generators(&self) -> GeneratorGroup {
16416 let query = self.selection.select("generators");
16417 GeneratorGroup {
16418 proc: self.proc.clone(),
16419 selection: query,
16420 graphql_client: self.graphql_client.clone(),
16421 }
16422 }
16423 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16429 let mut query = self.selection.select("generators");
16430 if let Some(include) = opts.include {
16431 query = query.arg("include", include);
16432 }
16433 GeneratorGroup {
16434 proc: self.proc.clone(),
16435 selection: query,
16436 graphql_client: self.graphql_client.clone(),
16437 }
16438 }
16439 pub async fn has_config(&self) -> Result<bool, DaggerError> {
16441 let query = self.selection.select("hasConfig");
16442 query.execute(self.graphql_client.clone()).await
16443 }
16444 pub async fn id(&self) -> Result<Id, DaggerError> {
16446 let query = self.selection.select("id");
16447 query.execute(self.graphql_client.clone()).await
16448 }
16449 pub async fn initialized(&self) -> Result<bool, DaggerError> {
16451 let query = self.selection.select("initialized");
16452 query.execute(self.graphql_client.clone()).await
16453 }
16454 pub async fn path(&self) -> Result<String, DaggerError> {
16456 let query = self.selection.select("path");
16457 query.execute(self.graphql_client.clone()).await
16458 }
16459 pub fn services(&self) -> UpGroup {
16465 let query = self.selection.select("services");
16466 UpGroup {
16467 proc: self.proc.clone(),
16468 selection: query,
16469 graphql_client: self.graphql_client.clone(),
16470 }
16471 }
16472 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16478 let mut query = self.selection.select("services");
16479 if let Some(include) = opts.include {
16480 query = query.arg("include", include);
16481 }
16482 UpGroup {
16483 proc: self.proc.clone(),
16484 selection: query,
16485 graphql_client: self.graphql_client.clone(),
16486 }
16487 }
16488 pub fn update(&self) -> Changeset {
16491 let query = self.selection.select("update");
16492 Changeset {
16493 proc: self.proc.clone(),
16494 selection: query,
16495 graphql_client: self.graphql_client.clone(),
16496 }
16497 }
16498}
16499impl Node for Workspace {
16500 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16501 let query = self.selection.select("id");
16502 let graphql_client = self.graphql_client.clone();
16503 async move { query.execute(graphql_client).await }
16504 }
16505}
16506#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16507pub enum CacheSharingMode {
16508 #[serde(rename = "LOCKED")]
16509 Locked,
16510 #[serde(rename = "PRIVATE")]
16511 Private,
16512 #[serde(rename = "SHARED")]
16513 Shared,
16514}
16515#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16516pub enum ChangesetMergeConflict {
16517 #[serde(rename = "FAIL")]
16518 Fail,
16519 #[serde(rename = "FAIL_EARLY")]
16520 FailEarly,
16521 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16522 LeaveConflictMarkers,
16523 #[serde(rename = "PREFER_OURS")]
16524 PreferOurs,
16525 #[serde(rename = "PREFER_THEIRS")]
16526 PreferTheirs,
16527}
16528#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16529pub enum ChangesetsMergeConflict {
16530 #[serde(rename = "FAIL")]
16531 Fail,
16532 #[serde(rename = "FAIL_EARLY")]
16533 FailEarly,
16534}
16535#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16536pub enum DiffStatKind {
16537 #[serde(rename = "ADDED")]
16538 Added,
16539 #[serde(rename = "MODIFIED")]
16540 Modified,
16541 #[serde(rename = "REMOVED")]
16542 Removed,
16543 #[serde(rename = "RENAMED")]
16544 Renamed,
16545}
16546#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16547pub enum ExistsType {
16548 #[serde(rename = "DIRECTORY_TYPE")]
16549 DirectoryType,
16550 #[serde(rename = "REGULAR_TYPE")]
16551 RegularType,
16552 #[serde(rename = "SYMLINK_TYPE")]
16553 SymlinkType,
16554}
16555#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16556pub enum FileType {
16557 #[serde(rename = "DIRECTORY")]
16558 Directory,
16559 #[serde(rename = "DIRECTORY_TYPE")]
16560 DirectoryType,
16561 #[serde(rename = "REGULAR")]
16562 Regular,
16563 #[serde(rename = "REGULAR_TYPE")]
16564 RegularType,
16565 #[serde(rename = "SYMLINK")]
16566 Symlink,
16567 #[serde(rename = "SYMLINK_TYPE")]
16568 SymlinkType,
16569 #[serde(rename = "UNKNOWN")]
16570 Unknown,
16571}
16572#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16573pub enum FunctionCachePolicy {
16574 #[serde(rename = "Default")]
16575 Default,
16576 #[serde(rename = "Never")]
16577 Never,
16578 #[serde(rename = "PerSession")]
16579 PerSession,
16580}
16581#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16582pub enum ImageLayerCompression {
16583 #[serde(rename = "EStarGZ")]
16584 EStarGz,
16585 #[serde(rename = "ESTARGZ")]
16586 Estargz,
16587 #[serde(rename = "Gzip")]
16588 Gzip,
16589 #[serde(rename = "Uncompressed")]
16590 Uncompressed,
16591 #[serde(rename = "Zstd")]
16592 Zstd,
16593}
16594#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16595pub enum ImageMediaTypes {
16596 #[serde(rename = "DOCKER")]
16597 Docker,
16598 #[serde(rename = "DockerMediaTypes")]
16599 DockerMediaTypes,
16600 #[serde(rename = "OCI")]
16601 Oci,
16602 #[serde(rename = "OCIMediaTypes")]
16603 OciMediaTypes,
16604}
16605#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16606pub enum ModuleSourceExperimentalFeature {
16607 #[serde(rename = "SELF_CALLS")]
16608 SelfCalls,
16609}
16610#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16611pub enum ModuleSourceKind {
16612 #[serde(rename = "DIR")]
16613 Dir,
16614 #[serde(rename = "DIR_SOURCE")]
16615 DirSource,
16616 #[serde(rename = "GIT")]
16617 Git,
16618 #[serde(rename = "GIT_SOURCE")]
16619 GitSource,
16620 #[serde(rename = "LOCAL")]
16621 Local,
16622 #[serde(rename = "LOCAL_SOURCE")]
16623 LocalSource,
16624}
16625#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16626pub enum NetworkProtocol {
16627 #[serde(rename = "TCP")]
16628 Tcp,
16629 #[serde(rename = "UDP")]
16630 Udp,
16631}
16632#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16633pub enum ReturnType {
16634 #[serde(rename = "ANY")]
16635 Any,
16636 #[serde(rename = "FAILURE")]
16637 Failure,
16638 #[serde(rename = "SUCCESS")]
16639 Success,
16640}
16641#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16642pub enum TypeDefKind {
16643 #[serde(rename = "BOOLEAN")]
16644 Boolean,
16645 #[serde(rename = "BOOLEAN_KIND")]
16646 BooleanKind,
16647 #[serde(rename = "ENUM")]
16648 Enum,
16649 #[serde(rename = "ENUM_KIND")]
16650 EnumKind,
16651 #[serde(rename = "FLOAT")]
16652 Float,
16653 #[serde(rename = "FLOAT_KIND")]
16654 FloatKind,
16655 #[serde(rename = "INPUT")]
16656 Input,
16657 #[serde(rename = "INPUT_KIND")]
16658 InputKind,
16659 #[serde(rename = "INTEGER")]
16660 Integer,
16661 #[serde(rename = "INTEGER_KIND")]
16662 IntegerKind,
16663 #[serde(rename = "INTERFACE")]
16664 Interface,
16665 #[serde(rename = "INTERFACE_KIND")]
16666 InterfaceKind,
16667 #[serde(rename = "LIST")]
16668 List,
16669 #[serde(rename = "LIST_KIND")]
16670 ListKind,
16671 #[serde(rename = "OBJECT")]
16672 Object,
16673 #[serde(rename = "OBJECT_KIND")]
16674 ObjectKind,
16675 #[serde(rename = "SCALAR")]
16676 Scalar,
16677 #[serde(rename = "SCALAR_KIND")]
16678 ScalarKind,
16679 #[serde(rename = "STRING")]
16680 String,
16681 #[serde(rename = "STRING_KIND")]
16682 StringKind,
16683 #[serde(rename = "VOID")]
16684 Void,
16685 #[serde(rename = "VOID_KIND")]
16686 VoidKind,
16687}